backstory/frontend/deployed/static/js/main.6f07f748.js
2025-05-03 01:34:23 -07:00

103 lines
4.9 MiB

/*! For license information please see main.6f07f748.js.LICENSE.txt */
(()=>{var e={4:(e,t,r)=>{"use strict";var n=r(853),i=r(43),a=r(950);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}var l=Symbol.for("react.element"),c=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),m=Symbol.for("react.consumer"),g=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),b=Symbol.for("react.memo"),_=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var w=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var k=Symbol.for("react.memo_cache_sentinel"),T=Symbol.iterator;function S(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=T&&e[T]||e["@@iterator"])?e:null}var A=Symbol.for("react.client.reference");function M(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===A?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case h:return"Fragment";case u:return"Portal";case d:return"Profiler";case p:return"StrictMode";case v:return"Suspense";case x:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case g:return(e.displayName||"Context")+".Provider";case m:return(e._context.displayName||"Context")+".Consumer";case y:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case b:return null!==(t=e.displayName||null)?t:M(e.type)||"Memo";case _:t=e._payload,e=e._init;try{return M(e(t))}catch(r){}}return null}var E,C,P=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.assign;function I(e){if(void 0===E)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);E=t&&t[1]||"",C=-1<r.stack.indexOf("\n at")?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+E+e+C}var z=!1;function O(e,t){if(!e||z)return"";z=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var r=function(){throw Error()};if(Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(r,[])}catch(i){var n=i}Reflect.construct(e,[],r)}else{try{r.call()}catch(a){n=a}e.call(r.prototype)}}else{try{throw Error()}catch(o){n=o}(r=e())&&"function"===typeof r.catch&&r.catch((function(){}))}}catch(s){if(s&&n&&"string"===typeof s.stack)return[s.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=n.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var l=o.split("\n"),c=s.split("\n");for(i=n=0;n<l.length&&!l[n].includes("DetermineComponentFrameRoot");)n++;for(;i<c.length&&!c[i].includes("DetermineComponentFrameRoot");)i++;if(n===l.length||i===c.length)for(n=l.length-1,i=c.length-1;1<=n&&0<=i&&l[n]!==c[i];)i--;for(;1<=n&&0<=i;n--,i--)if(l[n]!==c[i]){if(1!==n||1!==i)do{if(n--,0>--i||l[n]!==c[i]){var u="\n"+l[n].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=n&&0<=i);break}}}finally{z=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?I(r):""}function R(e){switch(e.tag){case 26:case 27:case 5:return I(e.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 15:return e=O(e.type,!1);case 11:return e=O(e.type.render,!1);case 1:return e=O(e.type,!0);default:return""}}function D(e){try{var t="";do{t+=R(e),e=e.return}while(e);return t}catch(r){return"\nError generating stack: "+r.message+"\n"+r.stack}}function j(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function F(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function B(e){if(j(e)!==e)throw Error(o(188))}function N(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=N(e)))return t;e=e.sibling}return null}var U=Array.isArray,V=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},H=[],G=-1;function W(e){return{current:e}}function $(e){0>G||(e.current=H[G],H[G]=null,G--)}function Z(e,t){G++,H[G]=e.current,e.current=t}var X=W(null),Y=W(null),K=W(null),J=W(null);function Q(e,t){switch(Z(K,t),Z(Y,e),Z(X,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?Yu(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=Ku(e=Yu(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}$(X),Z(X,t)}function ee(){$(X),$(Y),$(K)}function te(e){null!==e.memoizedState&&Z(J,e);var t=X.current,r=Ku(t,e.type);t!==r&&(Z(Y,e),Z(X,r))}function re(e){Y.current===e&&($(X),$(Y)),J.current===e&&($(J),Dh._currentValue=q)}var ne=Object.prototype.hasOwnProperty,ie=n.unstable_scheduleCallback,ae=n.unstable_cancelCallback,oe=n.unstable_shouldYield,se=n.unstable_requestPaint,le=n.unstable_now,ce=n.unstable_getCurrentPriorityLevel,ue=n.unstable_ImmediatePriority,he=n.unstable_UserBlockingPriority,pe=n.unstable_NormalPriority,de=n.unstable_LowPriority,fe=n.unstable_IdlePriority,me=n.log,ge=n.unstable_setDisableYieldValue,ye=null,ve=null;function xe(e){if("function"===typeof me&&ge(e),ve&&"function"===typeof ve.setStrictMode)try{ve.setStrictMode(ye,e)}catch(t){}}var be=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(_e(e)/we|0)|0},_e=Math.log,we=Math.LN2;var ke=128,Te=4194304;function Se(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ae(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=e.warmLanes;e=0!==e.finishedLanes;var s=134217727&r;return 0!==s?0!==(r=s&~i)?n=Se(r):0!==(a&=s)?n=Se(a):e||0!==(o=s&~o)&&(n=Se(o)):0!==(s=r&~i)?n=Se(s):0!==a?n=Se(a):e||0!==(o=r&~o)&&(n=Se(o)),0===n?0:0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(o=t&-t)||32===i&&0!==(4194176&o))?t:n}function Me(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function Ee(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ce(){var e=ke;return 0===(4194176&(ke<<=1))&&(ke=128),e}function Pe(){var e=Te;return 0===(62914560&(Te<<=1))&&(Te=4194304),e}function Le(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Ie(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ze(e,t,r){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-be(t);e.entangledLanes|=t,e.entanglements[n]=1073741824|e.entanglements[n]|4194218&r}function Oe(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-be(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}function Re(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function De(){var e=V.p;return 0!==e?e:void 0===(e=window.event)?32:Kh(e.type)}var je=Math.random().toString(36).slice(2),Fe="__reactFiber$"+je,Be="__reactProps$"+je,Ne="__reactContainer$"+je,Ue="__reactEvents$"+je,Ve="__reactListeners$"+je,qe="__reactHandles$"+je,He="__reactResources$"+je,Ge="__reactMarker$"+je;function We(e){delete e[Fe],delete e[Be],delete e[Ue],delete e[Ve],delete e[qe]}function $e(e){var t=e[Fe];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ne]||r[Fe]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=lh(e);null!==e;){if(r=e[Fe])return r;e=lh(e)}return t}r=(e=r).parentNode}return null}function Ze(e){if(e=e[Fe]||e[Ne]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function Xe(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(o(33))}function Ye(e){var t=e[He];return t||(t=e[He]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Ke(e){e[Ge]=!0}var Je=new Set,Qe={};function et(e,t){tt(e,t),tt(e+"Capture",t)}function tt(e,t){for(Qe[e]=t,e=0;e<t.length;e++)Je.add(t[e])}var rt=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),nt=RegExp("^[: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]*$"),it={},at={};function ot(e,t,r){if(i=t,ne.call(at,i)||!ne.call(it,i)&&(nt.test(i)?at[i]=!0:(it[i]=!0,0)))if(null===r)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var n=t.toLowerCase().slice(0,5);if("data-"!==n&&"aria-"!==n)return void e.removeAttribute(t)}e.setAttribute(t,""+r)}var i}function st(e,t,r){if(null===r)e.removeAttribute(t);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+r)}}function lt(e,t,r,n){if(null===n)e.removeAttribute(r);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(r)}e.setAttributeNS(t,r,""+n)}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function ht(e){e._valueTracker||(e._valueTracker=function(e){var t=ut(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function pt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=ut(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function dt(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var ft=/[\n"\\]/g;function mt(e){return e.replace(ft,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function gt(e,t,r,n,i,a,o,s){e.name="",null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?vt(e,o,ct(t)):null!=r?vt(e,o,ct(r)):null!=n&&e.removeAttribute("value"),null==i&&null!=a&&(e.defaultChecked=!!a),null!=i&&(e.checked=i&&"function"!==typeof i&&"symbol"!==typeof i),null!=s&&"function"!==typeof s&&"symbol"!==typeof s&&"boolean"!==typeof s?e.name=""+ct(s):e.removeAttribute("name")}function yt(e,t,r,n,i,a,o,s){if(null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(e.type=a),null!=t||null!=r){if(!("submit"!==a&&"reset"!==a||void 0!==t&&null!==t))return;r=null!=r?""+ct(r):"",t=null!=t?""+ct(t):r,s||t===e.value||(e.value=t),e.defaultValue=t}n="function"!==typeof(n=null!=n?n:i)&&"symbol"!==typeof n&&!!n,e.checked=s?e.checked:!!n,e.defaultChecked=!!n,null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o&&(e.name=o)}function vt(e,t,r){"number"===t&&dt(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function xt(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+ct(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function bt(e,t,r){null==t||((t=""+ct(t))!==e.value&&(e.value=t),null!=r)?e.defaultValue=null!=r?""+ct(r):"":e.defaultValue!==t&&(e.defaultValue=t)}function _t(e,t,r,n){if(null==t){if(null!=n){if(null!=r)throw Error(o(92));if(U(n)){if(1<n.length)throw Error(o(93));n=n[0]}r=n}null==r&&(r=""),t=r}r=ct(t),e.defaultValue=r,(n=e.textContent)===r&&""!==n&&null!==n&&(e.value=n)}function wt(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var kt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Tt(e,t,r){var n=0===t.indexOf("--");null==r||"boolean"===typeof r||""===r?n?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":n?e.setProperty(t,r):"number"!==typeof r||0===r||kt.has(t)?"float"===t?e.cssFloat=r:e[t]=(""+r).trim():e[t]=r+"px"}function St(e,t,r){if(null!=t&&"object"!==typeof t)throw Error(o(62));if(e=e.style,null!=r){for(var n in r)!r.hasOwnProperty(n)||null!=t&&t.hasOwnProperty(n)||(0===n.indexOf("--")?e.setProperty(n,""):"float"===n?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&r[i]!==n&&Tt(e,i,n)}else for(var a in t)t.hasOwnProperty(a)&&Tt(e,a,t[a])}function At(e){if(-1===e.indexOf("-"))return!1;switch(e){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 Mt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Et=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ct(e){return Et.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Pt=null;function Lt(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var It=null,zt=null;function Ot(e){var t=Ze(e);if(t&&(e=t.stateNode)){var r=e[Be]||null;e:switch(e=t.stateNode,t.type){case"input":if(gt(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+mt(""+t)+'"][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=n[Be]||null;if(!i)throw Error(o(90));gt(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<r.length;t++)(n=r[t]).form===e.form&&pt(n)}break e;case"textarea":bt(e,r.value,r.defaultValue);break e;case"select":null!=(t=r.value)&&xt(e,!!r.multiple,t,!1)}}}var Rt=!1;function Dt(e,t,r){if(Rt)return e(t,r);Rt=!0;try{return e(t)}finally{if(Rt=!1,(null!==It||null!==zt)&&(Fc(),It&&(t=It,e=zt,zt=It=null,Ot(t),e)))for(t=0;t<e.length;t++)Ot(e[t])}}function jt(e,t){var r=e.stateNode;if(null===r)return null;var n=r[Be]||null;if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!==typeof r)throw Error(o(231,t,typeof r));return r}var Ft=!1;if(rt)try{var Bt={};Object.defineProperty(Bt,"passive",{get:function(){Ft=!0}}),window.addEventListener("test",Bt,Bt),window.removeEventListener("test",Bt,Bt)}catch(_p){Ft=!1}var Nt=null,Ut=null,Vt=null;function qt(){if(Vt)return Vt;var e,t,r=Ut,n=r.length,i="value"in Nt?Nt.value:Nt.textContent,a=i.length;for(e=0;e<n&&r[e]===i[e];e++);var o=n-e;for(t=1;t<=o&&r[n-t]===i[a-t];t++);return Vt=i.slice(e,1<t?1-t:void 0)}function Ht(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gt(){return!0}function Wt(){return!1}function $t(e){function t(t,r,n,i,a){for(var o in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?Gt:Wt,this.isPropagationStopped=Wt,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),t}var Zt,Xt,Yt,Kt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jt=$t(Kt),Qt=L({},Kt,{view:0,detail:0}),er=$t(Qt),tr=L({},Qt,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yt&&(Yt&&"mousemove"===e.type?(Zt=e.screenX-Yt.screenX,Xt=e.screenY-Yt.screenY):Xt=Zt=0,Yt=e),Zt)},movementY:function(e){return"movementY"in e?e.movementY:Xt}}),rr=$t(tr),nr=$t(L({},tr,{dataTransfer:0})),ir=$t(L({},Qt,{relatedTarget:0})),ar=$t(L({},Kt,{animationName:0,elapsedTime:0,pseudoElement:0})),or=$t(L({},Kt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),sr=$t(L({},Kt,{data:0})),lr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ur={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function hr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=ur[e])&&!!t[e]}function pr(){return hr}var dr=$t(L({},Qt,{key:function(e){if(e.key){var t=lr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Ht(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?cr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pr,charCode:function(e){return"keypress"===e.type?Ht(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Ht(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),fr=$t(L({},tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mr=$t(L({},Qt,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pr})),gr=$t(L({},Kt,{propertyName:0,elapsedTime:0,pseudoElement:0})),yr=$t(L({},tr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),vr=$t(L({},Kt,{newState:0,oldState:0})),xr=[9,13,27,32],br=rt&&"CompositionEvent"in window,_r=null;rt&&"documentMode"in document&&(_r=document.documentMode);var wr=rt&&"TextEvent"in window&&!_r,kr=rt&&(!br||_r&&8<_r&&11>=_r),Tr=String.fromCharCode(32),Sr=!1;function Ar(e,t){switch(e){case"keyup":return-1!==xr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Mr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Er=!1;var Cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Cr[e.type]:"textarea"===t}function Lr(e,t,r,n){It?zt?zt.push(n):zt=[n]:It=n,0<(t=Du(t,"onChange")).length&&(r=new Jt("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ir=null,zr=null;function Or(e){Eu(e,0)}function Rr(e){if(pt(Xe(e)))return e}function Dr(e,t){if("change"===e)return t}var jr=!1;if(rt){var Fr;if(rt){var Br="oninput"in document;if(!Br){var Nr=document.createElement("div");Nr.setAttribute("oninput","return;"),Br="function"===typeof Nr.oninput}Fr=Br}else Fr=!1;jr=Fr&&(!document.documentMode||9<document.documentMode)}function Ur(){Ir&&(Ir.detachEvent("onpropertychange",Vr),zr=Ir=null)}function Vr(e){if("value"===e.propertyName&&Rr(zr)){var t=[];Lr(t,zr,e,Lt(e)),Dt(Or,t)}}function qr(e,t,r){"focusin"===e?(Ur(),zr=r,(Ir=t).attachEvent("onpropertychange",Vr)):"focusout"===e&&Ur()}function Hr(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Rr(zr)}function Gr(e,t){if("click"===e)return Rr(t)}function Wr(e,t){if("input"===e||"change"===e)return Rr(t)}var $r="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function Zr(e,t){if($r(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!ne.call(t,i)||!$r(e[i],t[i]))return!1}return!0}function Xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yr(e,t){var r,n=Xr(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Xr(n)}}function Kr(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Kr(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function Jr(e){for(var t=dt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=dt((e=t.contentWindow).document)}return t}function Qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function en(e,t){var r=Jr(t);t=e.focusedElem;var n=e.selectionRange;if(r!==t&&t&&t.ownerDocument&&Kr(t.ownerDocument.documentElement,t)){if(null!==n&&Qr(t))if(e=n.start,void 0===(r=n.end)&&(r=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(r,t.value.length);else if((r=(e=t.ownerDocument||document)&&e.defaultView||window).getSelection){r=r.getSelection();var i=t.textContent.length,a=Math.min(n.start,i);n=void 0===n.end?a:Math.min(n.end,i),!r.extend&&a>n&&(i=n,n=a,a=i),i=Yr(t,a);var o=Yr(t,n);i&&o&&(1!==r.rangeCount||r.anchorNode!==i.node||r.anchorOffset!==i.offset||r.focusNode!==o.node||r.focusOffset!==o.offset)&&((e=e.createRange()).setStart(i.node,i.offset),r.removeAllRanges(),a>n?(r.addRange(e),r.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),r.addRange(e)))}for(e=[],r=t;r=r.parentNode;)1===r.nodeType&&e.push({element:r,left:r.scrollLeft,top:r.scrollTop});for("function"===typeof t.focus&&t.focus(),t=0;t<e.length;t++)(r=e[t]).element.scrollLeft=r.left,r.element.scrollTop=r.top}}var tn=rt&&"documentMode"in document&&11>=document.documentMode,rn=null,nn=null,an=null,on=!1;function sn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;on||null==rn||rn!==dt(n)||("selectionStart"in(n=rn)&&Qr(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},an&&Zr(an,n)||(an=n,0<(n=Du(nn,"onSelect")).length&&(t=new Jt("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=rn)))}function ln(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var cn={animationend:ln("Animation","AnimationEnd"),animationiteration:ln("Animation","AnimationIteration"),animationstart:ln("Animation","AnimationStart"),transitionrun:ln("Transition","TransitionRun"),transitionstart:ln("Transition","TransitionStart"),transitioncancel:ln("Transition","TransitionCancel"),transitionend:ln("Transition","TransitionEnd")},un={},hn={};function pn(e){if(un[e])return un[e];if(!cn[e])return e;var t,r=cn[e];for(t in r)if(r.hasOwnProperty(t)&&t in hn)return un[e]=r[t];return e}rt&&(hn=document.createElement("div").style,"AnimationEvent"in window||(delete cn.animationend.animation,delete cn.animationiteration.animation,delete cn.animationstart.animation),"TransitionEvent"in window||delete cn.transitionend.transition);var dn=pn("animationend"),fn=pn("animationiteration"),mn=pn("animationstart"),gn=pn("transitionrun"),yn=pn("transitionstart"),vn=pn("transitioncancel"),xn=pn("transitionend"),bn=new Map,_n="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function wn(e,t){bn.set(e,t),et(t,[e])}var kn=[],Tn=0,Sn=0;function An(){for(var e=Tn,t=Sn=Tn=0;t<e;){var r=kn[t];kn[t++]=null;var n=kn[t];kn[t++]=null;var i=kn[t];kn[t++]=null;var a=kn[t];if(kn[t++]=null,null!==n&&null!==i){var o=n.pending;null===o?i.next=i:(i.next=o.next,o.next=i),n.pending=i}0!==a&&Pn(r,i,a)}}function Mn(e,t,r,n){kn[Tn++]=e,kn[Tn++]=t,kn[Tn++]=r,kn[Tn++]=n,Sn|=n,e.lanes|=n,null!==(e=e.alternate)&&(e.lanes|=n)}function En(e,t,r,n){return Mn(e,t,r,n),Ln(e)}function Cn(e,t){return Mn(e,null,null,t),Ln(e)}function Pn(e,t,r){e.lanes|=r;var n=e.alternate;null!==n&&(n.lanes|=r);for(var i=!1,a=e.return;null!==a;)a.childLanes|=r,null!==(n=a.alternate)&&(n.childLanes|=r),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(i=!0)),e=a,a=a.return;i&&null!==t&&3===e.tag&&(a=e.stateNode,i=31-be(r),null===(e=(a=a.hiddenUpdates)[i])?a[i]=[t]:e.push(t),t.lane=536870912|r)}function Ln(e){if(50<Ec)throw Ec=0,Cc=null,Error(o(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var In={},zn=new WeakMap;function On(e,t){if("object"===typeof e&&null!==e){var r=zn.get(e);return void 0!==r?r:(t={value:e,source:t,stack:D(t)},zn.set(e,t),t)}return{value:e,source:t,stack:D(t)}}var Rn=[],Dn=0,jn=null,Fn=0,Bn=[],Nn=0,Un=null,Vn=1,qn="";function Hn(e,t){Rn[Dn++]=Fn,Rn[Dn++]=jn,jn=e,Fn=t}function Gn(e,t,r){Bn[Nn++]=Vn,Bn[Nn++]=qn,Bn[Nn++]=Un,Un=e;var n=Vn;e=qn;var i=32-be(n)-1;n&=~(1<<i),r+=1;var a=32-be(t)+i;if(30<a){var o=i-i%5;a=(n&(1<<o)-1).toString(32),n>>=o,i-=o,Vn=1<<32-be(t)+i|r<<i|n,qn=a+e}else Vn=1<<a|r<<i|n,qn=e}function Wn(e){null!==e.return&&(Hn(e,1),Gn(e,1,0))}function $n(e){for(;e===jn;)jn=Rn[--Dn],Rn[Dn]=null,Fn=Rn[--Dn],Rn[Dn]=null;for(;e===Un;)Un=Bn[--Nn],Bn[Nn]=null,qn=Bn[--Nn],Bn[Nn]=null,Vn=Bn[--Nn],Bn[Nn]=null}var Zn=null,Xn=null,Yn=!1,Kn=null,Jn=!1,Qn=Error(o(519));function ei(e){throw ai(On(Error(o(418,"")),e)),Qn}function ti(e){var t=e.stateNode,r=e.type,n=e.memoizedProps;switch(t[Fe]=e,t[Be]=n,r){case"dialog":Cu("cancel",t),Cu("close",t);break;case"iframe":case"object":case"embed":Cu("load",t);break;case"video":case"audio":for(r=0;r<Au.length;r++)Cu(Au[r],t);break;case"source":Cu("error",t);break;case"img":case"image":case"link":Cu("error",t),Cu("load",t);break;case"details":Cu("toggle",t);break;case"input":Cu("invalid",t),yt(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0),ht(t);break;case"select":Cu("invalid",t);break;case"textarea":Cu("invalid",t),_t(t,n.value,n.defaultValue,n.children),ht(t)}"string"!==typeof(r=n.children)&&"number"!==typeof r&&"bigint"!==typeof r||t.textContent===""+r||!0===n.suppressHydrationWarning||Vu(t.textContent,r)?(null!=n.popover&&(Cu("beforetoggle",t),Cu("toggle",t)),null!=n.onScroll&&Cu("scroll",t),null!=n.onScrollEnd&&Cu("scrollend",t),null!=n.onClick&&(t.onclick=qu),t=!0):t=!1,t||ei(e)}function ri(e){for(Zn=e.return;Zn;)switch(Zn.tag){case 3:case 27:return void(Jn=!0);case 5:case 13:return void(Jn=!1);default:Zn=Zn.return}}function ni(e){if(e!==Zn)return!1;if(!Yn)return ri(e),Yn=!0,!1;var t,r=!1;if((t=3!==e.tag&&27!==e.tag)&&((t=5===e.tag)&&(t=!("form"!==(t=e.type)&&"button"!==t)||Ju(e.type,e.memoizedProps)),t=!t),t&&(r=!0),r&&Xn&&ei(e),ri(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,r=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===r){Xn=sh(e.nextSibling);break e}r--}else"$"!==t&&"$!"!==t&&"$?"!==t||r++;e=e.nextSibling}Xn=null}}else Xn=Zn?sh(e.stateNode.nextSibling):null;return!0}function ii(){Xn=Zn=null,Yn=!1}function ai(e){null===Kn?Kn=[e]:Kn.push(e)}var oi=Error(o(460)),si=Error(o(474)),li={then:function(){}};function ci(e){return"fulfilled"===(e=e.status)||"rejected"===e}function ui(){}function hi(e,t,r){switch(void 0===(r=e[r])?e.push(t):r!==t&&(t.then(ui,ui),t=r),t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===oi)throw Error(o(483));throw e;default:if("string"===typeof t.status)t.then(ui,ui);else{if(null!==(e=tc)&&100<e.shellSuspendCounter)throw Error(o(482));(e=t).status="pending",e.then((function(e){if("pending"===t.status){var r=t;r.status="fulfilled",r.value=e}}),(function(e){if("pending"===t.status){var r=t;r.status="rejected",r.reason=e}}))}switch(t.status){case"fulfilled":return t.value;case"rejected":if((e=t.reason)===oi)throw Error(o(483));throw e}throw pi=t,oi}}var pi=null;function di(){if(null===pi)throw Error(o(459));var e=pi;return pi=null,e}var fi=null,mi=0;function gi(e){var t=mi;return mi+=1,null===fi&&(fi=[]),hi(fi,e,t)}function yi(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function vi(e,t){if(t.$$typeof===l)throw Error(o(525));throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function xi(e){return(0,e._init)(e._payload)}function bi(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function i(e,t){return(e=jl(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=33554434,r):n:(t.flags|=33554434,r):(t.flags|=1048576,r)}function s(t){return e&&null===t.alternate&&(t.flags|=33554434),t}function l(e,t,r,n){return null===t||6!==t.tag?((t=Vl(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function p(e,t,r,n){var a=r.type;return a===h?f(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===_&&xi(a)===t.type)?(yi(t=i(t,r.props),r),t.return=e,t):(yi(t=Bl(r.type,r.key,r.props,null,e.mode,n),r),t.return=e,t)}function d(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=ql(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function f(e,t,r,n,a){return null===t||7!==t.tag?((t=Nl(r,e.mode,n,a)).return=e,t):((t=i(t,r)).return=e,t)}function m(e,t,r){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=Vl(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case c:return yi(r=Bl(t.type,t.key,t.props,null,e.mode,r),t),r.return=e,r;case u:return(t=ql(t,e.mode,r)).return=e,t;case _:return m(e,t=(0,t._init)(t._payload),r)}if(U(t)||S(t))return(t=Nl(t,e.mode,r,null)).return=e,t;if("function"===typeof t.then)return m(e,gi(t),r);if(t.$$typeof===g)return m(e,As(e,t),r);vi(e,t)}return null}function y(e,t,r,n){var i=null!==t?t.key:null;if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return null!==i?null:l(e,t,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case c:return r.key===i?p(e,t,r,n):null;case u:return r.key===i?d(e,t,r,n):null;case _:return y(e,t,r=(i=r._init)(r._payload),n)}if(U(r)||S(r))return null!==i?null:f(e,t,r,n,null);if("function"===typeof r.then)return y(e,t,gi(r),n);if(r.$$typeof===g)return y(e,t,As(e,r),n);vi(e,r)}return null}function v(e,t,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return l(t,e=e.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case c:return p(t,e=e.get(null===n.key?r:n.key)||null,n,i);case u:return d(t,e=e.get(null===n.key?r:n.key)||null,n,i);case _:return v(e,t,r,n=(0,n._init)(n._payload),i)}if(U(n)||S(n))return f(t,e=e.get(r)||null,n,i,null);if("function"===typeof n.then)return v(e,t,r,gi(n),i);if(n.$$typeof===g)return v(e,t,r,As(t,n),i);vi(t,n)}return null}function x(l,p,d,f){if("object"===typeof d&&null!==d&&d.type===h&&null===d.key&&(d=d.props.children),"object"===typeof d&&null!==d){switch(d.$$typeof){case c:e:{for(var b=d.key;null!==p;){if(p.key===b){if((b=d.type)===h){if(7===p.tag){r(l,p.sibling),(f=i(p,d.props.children)).return=l,l=f;break e}}else if(p.elementType===b||"object"===typeof b&&null!==b&&b.$$typeof===_&&xi(b)===p.type){r(l,p.sibling),yi(f=i(p,d.props),d),f.return=l,l=f;break e}r(l,p);break}t(l,p),p=p.sibling}d.type===h?((f=Nl(d.props.children,l.mode,f,d.key)).return=l,l=f):(yi(f=Bl(d.type,d.key,d.props,null,l.mode,f),d),f.return=l,l=f)}return s(l);case u:e:{for(b=d.key;null!==p;){if(p.key===b){if(4===p.tag&&p.stateNode.containerInfo===d.containerInfo&&p.stateNode.implementation===d.implementation){r(l,p.sibling),(f=i(p,d.children||[])).return=l,l=f;break e}r(l,p);break}t(l,p),p=p.sibling}(f=ql(d,l.mode,f)).return=l,l=f}return s(l);case _:return x(l,p,d=(b=d._init)(d._payload),f)}if(U(d))return function(i,o,s,l){for(var c=null,u=null,h=o,p=o=0,d=null;null!==h&&p<s.length;p++){h.index>p?(d=h,h=null):d=h.sibling;var f=y(i,h,s[p],l);if(null===f){null===h&&(h=d);break}e&&h&&null===f.alternate&&t(i,h),o=a(f,o,p),null===u?c=f:u.sibling=f,u=f,h=d}if(p===s.length)return r(i,h),Yn&&Hn(i,p),c;if(null===h){for(;p<s.length;p++)null!==(h=m(i,s[p],l))&&(o=a(h,o,p),null===u?c=h:u.sibling=h,u=h);return Yn&&Hn(i,p),c}for(h=n(h);p<s.length;p++)null!==(d=v(h,i,p,s[p],l))&&(e&&null!==d.alternate&&h.delete(null===d.key?p:d.key),o=a(d,o,p),null===u?c=d:u.sibling=d,u=d);return e&&h.forEach((function(e){return t(i,e)})),Yn&&Hn(i,p),c}(l,p,d,f);if(S(d)){if("function"!==typeof(b=S(d)))throw Error(o(150));return function(i,s,l,c){if(null==l)throw Error(o(151));for(var u=null,h=null,p=s,d=s=0,f=null,g=l.next();null!==p&&!g.done;d++,g=l.next()){p.index>d?(f=p,p=null):f=p.sibling;var x=y(i,p,g.value,c);if(null===x){null===p&&(p=f);break}e&&p&&null===x.alternate&&t(i,p),s=a(x,s,d),null===h?u=x:h.sibling=x,h=x,p=f}if(g.done)return r(i,p),Yn&&Hn(i,d),u;if(null===p){for(;!g.done;d++,g=l.next())null!==(g=m(i,g.value,c))&&(s=a(g,s,d),null===h?u=g:h.sibling=g,h=g);return Yn&&Hn(i,d),u}for(p=n(p);!g.done;d++,g=l.next())null!==(g=v(p,i,d,g.value,c))&&(e&&null!==g.alternate&&p.delete(null===g.key?d:g.key),s=a(g,s,d),null===h?u=g:h.sibling=g,h=g);return e&&p.forEach((function(e){return t(i,e)})),Yn&&Hn(i,d),u}(l,p,d=b.call(d),f)}if("function"===typeof d.then)return x(l,p,gi(d),f);if(d.$$typeof===g)return x(l,p,As(l,d),f);vi(l,d)}return"string"===typeof d&&""!==d||"number"===typeof d||"bigint"===typeof d?(d=""+d,null!==p&&6===p.tag?(r(l,p.sibling),(f=i(p,d)).return=l,l=f):(r(l,p),(f=Vl(d,l.mode,f)).return=l,l=f),s(l)):r(l,p)}return function(e,t,r,n){try{mi=0;var i=x(e,t,r,n);return fi=null,i}catch(o){if(o===oi)throw o;var a=Rl(29,o,null,e.mode);return a.lanes=n,a.return=e,a}}}var _i=bi(!0),wi=bi(!1),ki=W(null),Ti=W(0);function Si(e,t){Z(Ti,e=cc),Z(ki,t),cc=e|t.baseLanes}function Ai(){Z(Ti,cc),Z(ki,ki.current)}function Mi(){cc=Ti.current,$(ki),$(Ti)}var Ei=W(null),Ci=null;function Pi(e){var t=e.alternate;Z(Oi,1&Oi.current),Z(Ei,e),null===Ci&&(null===t||null!==ki.current||null!==t.memoizedState)&&(Ci=e)}function Li(e){if(22===e.tag){if(Z(Oi,Oi.current),Z(Ei,e),null===Ci){var t=e.alternate;null!==t&&null!==t.memoizedState&&(Ci=e)}}else Ii()}function Ii(){Z(Oi,Oi.current),Z(Ei,Ei.current)}function zi(e){$(Ei),Ci===e&&(Ci=null),$(Oi)}var Oi=W(0);function Ri(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Di="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach((function(e){return e()}))}},ji=n.unstable_scheduleCallback,Fi=n.unstable_NormalPriority,Bi={$$typeof:g,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ni(){return{controller:new Di,data:new Map,refCount:0}}function Ui(e){e.refCount--,0===e.refCount&&ji(Fi,(function(){e.controller.abort()}))}var Vi=null,qi=0,Hi=0,Gi=null;function Wi(){if(0===--qi&&null!==Vi){null!==Gi&&(Gi.status="fulfilled");var e=Vi;Vi=null,Hi=0,Gi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var $i=P.S;P.S=function(e,t){"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===Vi){var r=Vi=[];qi=0,Hi=_u(),Gi={status:"pending",value:void 0,then:function(e){r.push(e)}}}qi++,t.then(Wi,Wi)}(0,t),null!==$i&&$i(e,t)};var Zi=W(null);function Xi(){var e=Zi.current;return null!==e?e:tc.pooledCache}function Yi(e,t){Z(Zi,null===t?Zi.current:t.pool)}function Ki(){var e=Xi();return null===e?null:{parent:Bi._currentValue,pool:e}}var Ji=0,Qi=null,ea=null,ta=null,ra=!1,na=!1,ia=!1,aa=0,oa=0,sa=null,la=0;function ca(){throw Error(o(321))}function ua(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!$r(e[r],t[r]))return!1;return!0}function ha(e,t,r,n,i,a){return Ji=a,Qi=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=null===e||null===e.memoizedState?Ao:Mo,ia=!1,a=r(n,i),ia=!1,na&&(a=da(t,r,n,i)),pa(e),a}function pa(e){P.H=So;var t=null!==ea&&null!==ea.next;if(Ji=0,ta=ea=Qi=null,ra=!1,oa=0,sa=null,t)throw Error(o(300));null===e||Ho||null!==(e=e.dependencies)&&ks(e)&&(Ho=!0)}function da(e,t,r,n){Qi=e;var i=0;do{if(na&&(sa=null),oa=0,na=!1,25<=i)throw Error(o(301));if(i+=1,ta=ea=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}P.H=Eo,a=t(r,n)}while(na);return a}function fa(){var e=P.H,t=e.useState()[0];return t="function"===typeof t.then?ba(t):t,e=e.useState()[0],(null!==ea?ea.memoizedState:null)!==e&&(Qi.flags|=1024),t}function ma(){var e=0!==aa;return aa=0,e}function ga(e,t,r){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r}function ya(e){if(ra){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}ra=!1}Ji=0,ta=ea=Qi=null,na=!1,oa=aa=0,sa=null}function va(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ta?Qi.memoizedState=ta=e:ta=ta.next=e,ta}function xa(){if(null===ea){var e=Qi.alternate;e=null!==e?e.memoizedState:null}else e=ea.next;var t=null===ta?Qi.memoizedState:ta.next;if(null!==t)ta=t,ea=e;else{if(null===e){if(null===Qi.alternate)throw Error(o(467));throw Error(o(310))}e={memoizedState:(ea=e).memoizedState,baseState:ea.baseState,baseQueue:ea.baseQueue,queue:ea.queue,next:null},null===ta?Qi.memoizedState=ta=e:ta=ta.next=e}return ta}function ba(e){var t=oa;return oa+=1,null===sa&&(sa=[]),e=hi(sa,e,t),t=Qi,null===(null===ta?t.memoizedState:ta.next)&&(t=t.alternate,P.H=null===t||null===t.memoizedState?Ao:Mo),e}function _a(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return ba(e);if(e.$$typeof===g)return Ss(e)}throw Error(o(438,String(e)))}function wa(e){var t=null,r=Qi.updateQueue;if(null!==r&&(t=r.memoCache),null==t){var n=Qi.alternate;null!==n&&(null!==(n=n.updateQueue)&&(null!=(n=n.memoCache)&&(t={data:n.data.map((function(e){return e.slice()})),index:0})))}if(null==t&&(t={data:[],index:0}),null===r&&(r={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=r),r.memoCache=t,void 0===(r=t.data[t.index]))for(r=t.data[t.index]=Array(e),n=0;n<e;n++)r[n]=k;return t.index++,r}function ka(e,t){return"function"===typeof t?t(e):t}function Ta(e){return Sa(xa(),ea,e)}function Sa(e,t,r){var n=e.queue;if(null===n)throw Error(o(311));n.lastRenderedReducer=r;var i=e.baseQueue,a=n.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,n.pending=null}if(a=e.baseState,null===i)e.memoizedState=a;else{var l=s=null,c=null,u=t=i.next,h=!1;do{var p=-536870913&u.lane;if(p!==u.lane?(nc&p)===p:(Ji&p)===p){var d=u.revertLane;if(0===d)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),p===Hi&&(h=!0);else{if((Ji&d)===d){u=u.next,d===Hi&&(h=!0);continue}p={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=p,s=a):c=c.next=p,Qi.lanes|=d,hc|=d}p=u.action,ia&&r(a,p),a=u.hasEagerState?u.eagerState:r(a,p)}else d={lane:p,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=d,s=a):c=c.next=d,Qi.lanes|=p,hc|=p;u=u.next}while(null!==u&&u!==t);if(null===c?s=a:c.next=l,!$r(a,e.memoizedState)&&(Ho=!0,h&&null!==(r=Gi)))throw r;e.memoizedState=a,e.baseState=s,e.baseQueue=c,n.lastRenderedState=a}return null===i&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Aa(e){var t=xa(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);$r(a,t.memoizedState)||(Ho=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function Ma(e,t,r){var n=Qi,i=xa(),a=Yn;if(a){if(void 0===r)throw Error(o(407));r=r()}else r=t();var s=!$r((ea||i).memoizedState,r);if(s&&(i.memoizedState=r,Ho=!0),i=i.queue,Ja(Pa.bind(null,n,i,e),[e]),i.getSnapshot!==t||s||null!==ta&&1&ta.memoizedState.tag){if(n.flags|=2048,$a(9,Ca.bind(null,n,i,r,t),{destroy:void 0},null),null===tc)throw Error(o(349));a||0!==(60&Ji)||Ea(n,t,r)}return r}function Ea(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=Qi.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function Ca(e,t,r,n){t.value=r,t.getSnapshot=n,La(t)&&Ia(e)}function Pa(e,t,r){return r((function(){La(t)&&Ia(e)}))}function La(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!$r(e,r)}catch(n){return!0}}function Ia(e){var t=Cn(e,2);null!==t&&Ic(t,e,2)}function za(e){var t=va();if("function"===typeof e){var r=e;if(e=r(),ia){xe(!0);try{r()}finally{xe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:e},t}function Oa(e,t,r,n){return e.baseState=r,Sa(e,ea,"function"===typeof n?n:ka)}function Ra(e,t,r,n,i){if(wo(e))throw Error(o(485));if(null!==(e=t.action)){var a={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==P.T?r(!0):a.isTransition=!1,n(a),null===(r=t.pending)?(a.next=t.pending=a,Da(t,a)):(a.next=r.next,t.pending=r.next=a)}}function Da(e,t){var r=t.action,n=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=r(i,n),l=P.S;null!==l&&l(o,s),ja(e,t,s)}catch(c){Ba(e,t,c)}finally{P.T=a}}else try{ja(e,t,a=r(i,n))}catch(u){Ba(e,t,u)}}function ja(e,t,r){null!==r&&"object"===typeof r&&"function"===typeof r.then?r.then((function(r){Fa(e,t,r)}),(function(r){return Ba(e,t,r)})):Fa(e,t,r)}function Fa(e,t,r){t.status="fulfilled",t.value=r,Na(t),e.state=r,null!==(t=e.pending)&&((r=t.next)===t?e.pending=null:(r=r.next,t.next=r,Da(e,r)))}function Ba(e,t,r){var n=e.pending;if(e.pending=null,null!==n){n=n.next;do{t.status="rejected",t.reason=r,Na(t),t=t.next}while(t!==n)}e.action=null}function Na(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ua(e,t){return t}function Va(e,t){if(Yn){var r=tc.formState;if(null!==r){e:{var n=Qi;if(Yn){if(Xn){t:{for(var i=Xn,a=Jn;8!==i.nodeType;){if(!a){i=null;break t}if(null===(i=sh(i.nextSibling))){i=null;break t}}i="F!"===(a=i.data)||"F"===a?i:null}if(i){Xn=sh(i.nextSibling),n="F!"===i.data;break e}}ei(n)}n=!1}n&&(t=r[0])}}return(r=va()).memoizedState=r.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:t},r.queue=n,r=xo.bind(null,Qi,n),n.dispatch=r,n=za(!1),a=_o.bind(null,Qi,!1,n.queue),i={state:t,dispatch:null,action:e,pending:null},(n=va()).queue=i,r=Ra.bind(null,Qi,i,a,r),i.dispatch=r,n.memoizedState=e,[t,r,!1]}function qa(e){return Ha(xa(),ea,e)}function Ha(e,t,r){t=Sa(e,t,Ua)[0],e=Ta(ka)[0],t="object"===typeof t&&null!==t&&"function"===typeof t.then?ba(t):t;var n=xa(),i=n.queue,a=i.dispatch;return r!==n.memoizedState&&(Qi.flags|=2048,$a(9,Ga.bind(null,i,r),{destroy:void 0},null)),[t,a,e]}function Ga(e,t){e.action=t}function Wa(e){var t=xa(),r=ea;if(null!==r)return Ha(t,r,e);xa(),t=t.memoizedState;var n=(r=xa()).queue.dispatch;return r.memoizedState=e,[t,n,!1]}function $a(e,t,r,n){return e={tag:e,create:t,inst:r,deps:n,next:null},null===(t=Qi.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},Qi.updateQueue=t),null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function Za(){return xa().memoizedState}function Xa(e,t,r,n){var i=va();Qi.flags|=e,i.memoizedState=$a(1|t,r,{destroy:void 0},void 0===n?null:n)}function Ya(e,t,r,n){var i=xa();n=void 0===n?null:n;var a=i.memoizedState.inst;null!==ea&&null!==n&&ua(n,ea.memoizedState.deps)?i.memoizedState=$a(t,r,a,n):(Qi.flags|=e,i.memoizedState=$a(1|t,r,a,n))}function Ka(e,t){Xa(8390656,8,e,t)}function Ja(e,t){Ya(2048,8,e,t)}function Qa(e,t){return Ya(4,2,e,t)}function eo(e,t){return Ya(4,4,e,t)}function to(e,t){if("function"===typeof t){e=e();var r=t(e);return function(){"function"===typeof r?r():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function ro(e,t,r){r=null!==r&&void 0!==r?r.concat([e]):null,Ya(4,4,to.bind(null,t,e),r)}function no(){}function io(e,t){var r=xa();t=void 0===t?null:t;var n=r.memoizedState;return null!==t&&ua(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function ao(e,t){var r=xa();t=void 0===t?null:t;var n=r.memoizedState;if(null!==t&&ua(t,n[1]))return n[0];if(n=e(),ia){xe(!0);try{e()}finally{xe(!1)}}return r.memoizedState=[n,t],n}function oo(e,t,r){return void 0===r||0!==(1073741824&Ji)?e.memoizedState=t:(e.memoizedState=r,e=Lc(),Qi.lanes|=e,hc|=e,r)}function so(e,t,r,n){return $r(r,t)?r:null!==ki.current?(e=oo(e,r,n),$r(e,t)||(Ho=!0),e):0===(42&Ji)?(Ho=!0,e.memoizedState=r):(e=Lc(),Qi.lanes|=e,hc|=e,t)}function lo(e,t,r,n,i){var a=V.p;V.p=0!==a&&8>a?a:8;var o=P.T,s={};P.T=s,_o(e,!1,t,r);try{var l=i(),c=P.S;if(null!==c&&c(s,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)bo(e,t,function(e,t){var r=[],n={status:"pending",value:null,reason:null,then:function(e){r.push(e)}};return e.then((function(){n.status="fulfilled",n.value=t;for(var e=0;e<r.length;e++)(0,r[e])(t)}),(function(e){for(n.status="rejected",n.reason=e,e=0;e<r.length;e++)(0,r[e])(void 0)})),n}(l,n),Pc());else bo(e,t,n,Pc())}catch(u){bo(e,t,{then:function(){},status:"rejected",reason:u},Pc())}finally{V.p=a,P.T=o}}function co(){}function uo(e,t,r,n){if(5!==e.tag)throw Error(o(476));var i=ho(e).queue;lo(e,i,t,q,null===r?co:function(){return po(e),r(n)})}function ho(e){var t=e.memoizedState;if(null!==t)return t;var r={};return(t={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:q},next:null}).next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ka,lastRenderedState:r},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function po(e){bo(e,ho(e).next.queue,{},Pc())}function fo(){return Ss(Dh)}function mo(){return xa().memoizedState}function go(){return xa().memoizedState}function yo(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var r=Pc(),n=Is(t,e=Ls(r),r);return null!==n&&(Ic(n,t,r),zs(n,t,r)),t={cache:Ni()},void(e.payload=t)}t=t.return}}function vo(e,t,r){var n=Pc();r={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null},wo(e)?ko(t,r):null!==(r=En(e,t,r,n))&&(Ic(r,e,n),To(r,t,n))}function xo(e,t,r){bo(e,t,r,Pc())}function bo(e,t,r,n){var i={lane:n,revertLane:0,action:r,hasEagerState:!1,eagerState:null,next:null};if(wo(e))ko(t,i);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,$r(s,o))return Mn(e,t,i,0),null===tc&&An(),!1}catch(l){}if(null!==(r=En(e,t,i,n)))return Ic(r,e,n),To(r,t,n),!0}return!1}function _o(e,t,r,n){if(n={lane:2,revertLane:_u(),action:n,hasEagerState:!1,eagerState:null,next:null},wo(e)){if(t)throw Error(o(479))}else null!==(t=En(e,r,n,2))&&Ic(t,e,2)}function wo(e){var t=e.alternate;return e===Qi||null!==t&&t===Qi}function ko(e,t){na=ra=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function To(e,t,r){if(0!==(4194176&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,Oe(e,r)}}var So={readContext:Ss,use:_a,useCallback:ca,useContext:ca,useEffect:ca,useImperativeHandle:ca,useLayoutEffect:ca,useInsertionEffect:ca,useMemo:ca,useReducer:ca,useRef:ca,useState:ca,useDebugValue:ca,useDeferredValue:ca,useTransition:ca,useSyncExternalStore:ca,useId:ca};So.useCacheRefresh=ca,So.useMemoCache=ca,So.useHostTransitionStatus=ca,So.useFormState=ca,So.useActionState=ca,So.useOptimistic=ca;var Ao={readContext:Ss,use:_a,useCallback:function(e,t){return va().memoizedState=[e,void 0===t?null:t],e},useContext:Ss,useEffect:Ka,useImperativeHandle:function(e,t,r){r=null!==r&&void 0!==r?r.concat([e]):null,Xa(4194308,4,to.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xa(4194308,4,e,t)},useInsertionEffect:function(e,t){Xa(4,2,e,t)},useMemo:function(e,t){var r=va();t=void 0===t?null:t;var n=e();if(ia){xe(!0);try{e()}finally{xe(!1)}}return r.memoizedState=[n,t],n},useReducer:function(e,t,r){var n=va();if(void 0!==r){var i=r(t);if(ia){xe(!0);try{r(t)}finally{xe(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=vo.bind(null,Qi,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},va().memoizedState=e},useState:function(e){var t=(e=za(e)).queue,r=xo.bind(null,Qi,t);return t.dispatch=r,[e.memoizedState,r]},useDebugValue:no,useDeferredValue:function(e,t){return oo(va(),e,t)},useTransition:function(){var e=za(!1);return e=lo.bind(null,Qi,e.queue,!0,!1),va().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,r){var n=Qi,i=va();if(Yn){if(void 0===r)throw Error(o(407));r=r()}else{if(r=t(),null===tc)throw Error(o(349));0!==(60&nc)||Ea(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Ka(Pa.bind(null,n,a,e),[e]),n.flags|=2048,$a(9,Ca.bind(null,n,a,r,t),{destroy:void 0},null),r},useId:function(){var e=va(),t=tc.identifierPrefix;if(Yn){var r=qn;t=":"+t+"R"+(r=(Vn&~(1<<32-be(Vn)-1)).toString(32)+r),0<(r=aa++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=la++).toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return va().memoizedState=yo.bind(null,Qi)}};Ao.useMemoCache=wa,Ao.useHostTransitionStatus=fo,Ao.useFormState=Va,Ao.useActionState=Va,Ao.useOptimistic=function(e){var t=va();t.memoizedState=t.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=r,t=_o.bind(null,Qi,!0,r),r.dispatch=t,[e,t]};var Mo={readContext:Ss,use:_a,useCallback:io,useContext:Ss,useEffect:Ja,useImperativeHandle:ro,useInsertionEffect:Qa,useLayoutEffect:eo,useMemo:ao,useReducer:Ta,useRef:Za,useState:function(){return Ta(ka)},useDebugValue:no,useDeferredValue:function(e,t){return so(xa(),ea.memoizedState,e,t)},useTransition:function(){var e=Ta(ka)[0],t=xa().memoizedState;return["boolean"===typeof e?e:ba(e),t]},useSyncExternalStore:Ma,useId:mo};Mo.useCacheRefresh=go,Mo.useMemoCache=wa,Mo.useHostTransitionStatus=fo,Mo.useFormState=qa,Mo.useActionState=qa,Mo.useOptimistic=function(e,t){return Oa(xa(),0,e,t)};var Eo={readContext:Ss,use:_a,useCallback:io,useContext:Ss,useEffect:Ja,useImperativeHandle:ro,useInsertionEffect:Qa,useLayoutEffect:eo,useMemo:ao,useReducer:Aa,useRef:Za,useState:function(){return Aa(ka)},useDebugValue:no,useDeferredValue:function(e,t){var r=xa();return null===ea?oo(r,e,t):so(r,ea.memoizedState,e,t)},useTransition:function(){var e=Aa(ka)[0],t=xa().memoizedState;return["boolean"===typeof e?e:ba(e),t]},useSyncExternalStore:Ma,useId:mo};function Co(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:L({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}Eo.useCacheRefresh=go,Eo.useMemoCache=wa,Eo.useHostTransitionStatus=fo,Eo.useFormState=Wa,Eo.useActionState=Wa,Eo.useOptimistic=function(e,t){var r=xa();return null!==ea?Oa(r,0,e,t):(r.baseState=e,[e,r.queue.dispatch])};var Po={isMounted:function(e){return!!(e=e._reactInternals)&&j(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=Pc(),i=Ls(n);i.payload=t,void 0!==r&&null!==r&&(i.callback=r),null!==(t=Is(e,i,n))&&(Ic(t,e,n),zs(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=Pc(),i=Ls(n);i.tag=1,i.payload=t,void 0!==r&&null!==r&&(i.callback=r),null!==(t=Is(e,i,n))&&(Ic(t,e,n),zs(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Pc(),n=Ls(r);n.tag=2,void 0!==t&&null!==t&&(n.callback=t),null!==(t=Is(e,n,r))&&(Ic(t,e,r),zs(t,e,r))}};function Lo(e,t,r,n,i,a,o){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,a,o):!t.prototype||!t.prototype.isPureReactComponent||(!Zr(r,n)||!Zr(i,a))}function Io(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Po.enqueueReplaceState(t,t.state,null)}function zo(e,t){var r=t;if("ref"in t)for(var n in r={},t)"ref"!==n&&(r[n]=t[n]);if(e=e.defaultProps)for(var i in r===t&&(r=L({},r)),e)void 0===r[i]&&(r[i]=e[i]);return r}var Oo="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function Ro(e){Oo(e)}function Do(e){console.error(e)}function jo(e){Oo(e)}function Fo(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(r){setTimeout((function(){throw r}))}}function Bo(e,t,r){try{(0,e.onCaughtError)(r.value,{componentStack:r.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(n){setTimeout((function(){throw n}))}}function No(e,t,r){return(r=Ls(r)).tag=3,r.payload={element:null},r.callback=function(){Fo(e,t)},r}function Uo(e){return(e=Ls(e)).tag=3,e}function Vo(e,t,r,n){var i=r.type.getDerivedStateFromError;if("function"===typeof i){var a=n.value;e.payload=function(){return i(a)},e.callback=function(){Bo(t,r,n)}}var o=r.stateNode;null!==o&&"function"===typeof o.componentDidCatch&&(e.callback=function(){Bo(t,r,n),"function"!==typeof i&&(null===wc?wc=new Set([this]):wc.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})})}var qo=Error(o(461)),Ho=!1;function Go(e,t,r,n){t.child=null===e?wi(t,null,r,n):_i(t,e.child,r,n)}function Wo(e,t,r,n,i){r=r.render;var a=t.ref;if("ref"in n){var o={};for(var s in n)"ref"!==s&&(o[s]=n[s])}else o=n;return Ts(t),n=ha(e,t,r,o,a,i),s=ma(),null===e||Ho?(Yn&&s&&Wn(t),t.flags|=1,Go(e,t,n,i),t.child):(ga(e,t,i),ps(e,t,i))}function $o(e,t,r,n,i){if(null===e){var a=r.type;return"function"!==typeof a||Dl(a)||void 0!==a.defaultProps||null!==r.compare?((e=Bl(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Zo(e,t,a,n,i))}if(a=e.child,!ds(e,i)){var o=a.memoizedProps;if((r=null!==(r=r.compare)?r:Zr)(o,n)&&e.ref===t.ref)return ps(e,t,i)}return t.flags|=1,(e=jl(a,n)).ref=t.ref,e.return=t,t.child=e}function Zo(e,t,r,n,i){if(null!==e){var a=e.memoizedProps;if(Zr(a,n)&&e.ref===t.ref){if(Ho=!1,t.pendingProps=n=a,!ds(e,i))return t.lanes=e.lanes,ps(e,t,i);0!==(131072&e.flags)&&(Ho=!0)}}return Jo(e,t,r,n,i)}function Xo(e,t,r){var n=t.pendingProps,i=n.children,a=0!==(2&t.stateNode._pendingVisibility),o=null!==e?e.memoizedState:null;if(Ko(e,t),"hidden"===n.mode||a){if(0!==(128&t.flags)){if(n=null!==o?o.baseLanes|r:r,null!==e){for(i=t.child=e.child,a=0;null!==i;)a=a|i.lanes|i.childLanes,i=i.sibling;t.childLanes=a&~n}else t.childLanes=0,t.child=null;return Yo(e,t,n,r)}if(0===(536870912&r))return t.lanes=t.childLanes=536870912,Yo(e,t,null!==o?o.baseLanes|r:r,r);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&Yi(0,null!==o?o.cachePool:null),null!==o?Si(t,o):Ai(),Li(t)}else null!==o?(Yi(0,o.cachePool),Si(t,o),Ii(),t.memoizedState=null):(null!==e&&Yi(0,null),Ai(),Ii());return Go(e,t,i,r),t.child}function Yo(e,t,r,n){var i=Xi();return i=null===i?null:{parent:Bi._currentValue,pool:i},t.memoizedState={baseLanes:r,cachePool:i},null!==e&&Yi(0,null),Ai(),Li(t),null!==e&&ws(e,t,n,!0),null}function Ko(e,t){var r=t.ref;if(null===r)null!==e&&null!==e.ref&&(t.flags|=2097664);else{if("function"!==typeof r&&"object"!==typeof r)throw Error(o(284));null!==e&&e.ref===r||(t.flags|=2097664)}}function Jo(e,t,r,n,i){return Ts(t),r=ha(e,t,r,n,void 0,i),n=ma(),null===e||Ho?(Yn&&n&&Wn(t),t.flags|=1,Go(e,t,r,i),t.child):(ga(e,t,i),ps(e,t,i))}function Qo(e,t,r,n,i,a){return Ts(t),t.updateQueue=null,r=da(t,n,r,i),pa(e),n=ma(),null===e||Ho?(Yn&&n&&Wn(t),t.flags|=1,Go(e,t,r,a),t.child):(ga(e,t,a),ps(e,t,a))}function es(e,t,r,n,i){if(Ts(t),null===t.stateNode){var a=In,o=r.contextType;"object"===typeof o&&null!==o&&(a=Ss(o)),a=new r(n,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=Po,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=n,a.state=t.memoizedState,a.refs={},Cs(t),o=r.contextType,a.context="object"===typeof o&&null!==o?Ss(o):In,a.state=t.memoizedState,"function"===typeof(o=r.getDerivedStateFromProps)&&(Co(t,r,o,n),a.state=t.memoizedState),"function"===typeof r.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(o=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),o!==a.state&&Po.enqueueReplaceState(a,a.state,null),js(t,n,a,i),Ds(),a.state=t.memoizedState),"function"===typeof a.componentDidMount&&(t.flags|=4194308),n=!0}else if(null===e){a=t.stateNode;var s=t.memoizedProps,l=zo(r,s);a.props=l;var c=a.context,u=r.contextType;o=In,"object"===typeof u&&null!==u&&(o=Ss(u));var h=r.getDerivedStateFromProps;u="function"===typeof h||"function"===typeof a.getSnapshotBeforeUpdate,s=t.pendingProps!==s,u||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s||c!==o)&&Io(t,a,n,o),Es=!1;var p=t.memoizedState;a.state=p,js(t,n,a,i),Ds(),c=t.memoizedState,s||p!==c||Es?("function"===typeof h&&(Co(t,r,h,n),c=t.memoizedState),(l=Es||Lo(t,r,l,n,p,c,o))?(u||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),a.props=n,a.state=c,a.context=o,n=l):("function"===typeof a.componentDidMount&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,Ps(e,t),u=zo(r,o=t.memoizedProps),a.props=u,h=t.pendingProps,p=a.context,c=r.contextType,l=In,"object"===typeof c&&null!==c&&(l=Ss(c)),(c="function"===typeof(s=r.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o!==h||p!==l)&&Io(t,a,n,l),Es=!1,p=t.memoizedState,a.state=p,js(t,n,a,i),Ds();var d=t.memoizedState;o!==h||p!==d||Es||null!==e&&null!==e.dependencies&&ks(e.dependencies)?("function"===typeof s&&(Co(t,r,s,n),d=t.memoizedState),(u=Es||Lo(t,r,u,n,p,d,l)||null!==e&&null!==e.dependencies&&ks(e.dependencies))?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(n,d,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(n,d,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=d),a.props=n,a.state=d,a.context=l,n=u):("function"!==typeof a.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return a=n,Ko(e,t),n=0!==(128&t.flags),a||n?(a=t.stateNode,r=n&&"function"!==typeof r.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&n?(t.child=_i(t,e.child,null,i),t.child=_i(t,null,r,i)):Go(e,t,r,i),t.memoizedState=a.state,e=t.child):e=ps(e,t,i),e}function ts(e,t,r,n){return ii(),t.flags|=256,Go(e,t,r,n),t.child}var rs={dehydrated:null,treeContext:null,retryLane:0};function ns(e){return{baseLanes:e,cachePool:Ki()}}function is(e,t,r){return e=null!==e?e.childLanes&~r:0,t&&(e|=fc),e}function as(e,t,r){var n,i=t.pendingProps,a=!1,s=0!==(128&t.flags);if((n=s)||(n=(null===e||null!==e.memoizedState)&&0!==(2&Oi.current)),n&&(a=!0,t.flags&=-129),n=0!==(32&t.flags),t.flags&=-33,null===e){if(Yn){if(a?Pi(t):Ii(),Yn){var l,c=Xn;if(l=c){e:{for(l=c,c=Jn;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=sh(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==Un?{id:Vn,overflow:qn}:null,retryLane:536870912},(l=Rl(18,null,null,0)).stateNode=c,l.return=t,t.child=l,Zn=t,Xn=null,l=!0):l=!1}l||ei(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return"$!"===c.data?t.lanes=16:t.lanes=536870912,null;zi(t)}return c=i.children,i=i.fallback,a?(Ii(),c=ss({mode:"hidden",children:c},a=t.mode),i=Nl(i,a,r,null),c.return=t,i.return=t,c.sibling=i,t.child=c,(a=t.child).memoizedState=ns(r),a.childLanes=is(e,n,r),t.memoizedState=rs,i):(Pi(t),os(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(s)256&t.flags?(Pi(t),t.flags&=-257,t=ls(e,t,r)):null!==t.memoizedState?(Ii(),t.child=e.child,t.flags|=128,t=null):(Ii(),a=i.fallback,c=t.mode,i=ss({mode:"visible",children:i.children},c),(a=Nl(a,c,r,null)).flags|=2,i.return=t,a.return=t,i.sibling=a,t.child=i,_i(t,e.child,null,r),(i=t.child).memoizedState=ns(r),i.childLanes=is(e,n,r),t.memoizedState=rs,t=a);else if(Pi(t),"$!"===c.data){if(n=c.nextSibling&&c.nextSibling.dataset)var u=n.dgst;n=u,(i=Error(o(419))).stack="",i.digest=n,ai({value:i,source:null,stack:null}),t=ls(e,t,r)}else if(Ho||ws(e,t,r,!1),n=0!==(r&e.childLanes),Ho||n){if(null!==(n=tc)){if(0!==(42&(i=r&-r)))i=1;else switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:i=64;break;case 268435456:i=134217728;break;default:i=0}if(0!==(i=0!==(i&(n.suspendedLanes|r))?0:i)&&i!==l.retryLane)throw l.retryLane=i,Cn(e,i),Ic(n,e,i),qo}"$?"===c.data||Hc(),t=ls(e,t,r)}else"$?"===c.data?(t.flags|=128,t.child=e.child,t=su.bind(null,e),c._reactRetry=t,t=null):(e=l.treeContext,Xn=sh(c.nextSibling),Zn=t,Yn=!0,Kn=null,Jn=!1,null!==e&&(Bn[Nn++]=Vn,Bn[Nn++]=qn,Bn[Nn++]=Un,Vn=e.id,qn=e.overflow,Un=t),(t=os(t,i.children)).flags|=4096);return t}return a?(Ii(),a=i.fallback,c=t.mode,u=(l=e.child).sibling,(i=jl(l,{mode:"hidden",children:i.children})).subtreeFlags=31457280&l.subtreeFlags,null!==u?a=jl(u,a):(a=Nl(a,c,r,null)).flags|=2,a.return=t,i.return=t,i.sibling=a,t.child=i,i=a,a=t.child,null===(c=e.child.memoizedState)?c=ns(r):(null!==(l=c.cachePool)?(u=Bi._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Ki(),c={baseLanes:c.baseLanes|r,cachePool:l}),a.memoizedState=c,a.childLanes=is(e,n,r),t.memoizedState=rs,i):(Pi(t),e=(r=e.child).sibling,(r=jl(r,{mode:"visible",children:i.children})).return=t,r.sibling=null,null!==e&&(null===(n=t.deletions)?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r)}function os(e,t){return(t=ss({mode:"visible",children:t},e.mode)).return=e,e.child=t}function ss(e,t){return Ul(e,t,0,null)}function ls(e,t,r){return _i(t,e.child,null,r),(e=os(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function cs(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),bs(e.return,t,r)}function us(e,t,r,n,i){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function hs(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Go(e,t,n.children,r),0!==(2&(n=Oi.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&cs(e,r,t);else if(19===e.tag)cs(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}switch(Z(Oi,n),i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===Ri(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),us(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Ri(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}us(t,!0,r,null,a);break;case"together":us(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ps(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),hc|=t.lanes,0===(r&t.childLanes)){if(null===e)return null;if(ws(e,t,r,!1),0===(r&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(r=jl(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=jl(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function ds(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!ks(e))}function fs(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps)Ho=!0;else{if(!ds(e,r)&&0===(128&t.flags))return Ho=!1,function(e,t,r){switch(t.tag){case 3:Q(t,t.stateNode.containerInfo),vs(t,Bi,e.memoizedState.cache),ii();break;case 27:case 5:te(t);break;case 4:Q(t,t.stateNode.containerInfo);break;case 10:vs(t,t.type,t.memoizedProps.value);break;case 13:var n=t.memoizedState;if(null!==n)return null!==n.dehydrated?(Pi(t),t.flags|=128,null):0!==(r&t.child.childLanes)?as(e,t,r):(Pi(t),null!==(e=ps(e,t,r))?e.sibling:null);Pi(t);break;case 19:var i=0!==(128&e.flags);if((n=0!==(r&t.childLanes))||(ws(e,t,r,!1),n=0!==(r&t.childLanes)),i){if(n)return hs(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Z(Oi,Oi.current),n)break;return null;case 22:case 23:return t.lanes=0,Xo(e,t,r);case 24:vs(t,Bi,e.memoizedState.cache)}return ps(e,t,r)}(e,t,r);Ho=0!==(131072&e.flags)}else Ho=!1,Yn&&0!==(1048576&t.flags)&&Gn(t,Fn,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var n=t.elementType,i=n._init;if(n=i(n._payload),t.type=n,"function"!==typeof n){if(void 0!==n&&null!==n){if((i=n.$$typeof)===y){t.tag=11,t=Wo(null,t,n,e,r);break e}if(i===b){t.tag=14,t=$o(null,t,n,e,r);break e}}throw t=M(n)||n,Error(o(306,t,""))}Dl(n)?(e=zo(n,e),t.tag=1,t=es(null,t,n,e,r)):(t.tag=0,t=Jo(null,t,n,e,r))}return t;case 0:return Jo(e,t,t.type,t.pendingProps,r);case 1:return es(e,t,n=t.type,i=zo(n,t.pendingProps),r);case 3:e:{if(Q(t,t.stateNode.containerInfo),null===e)throw Error(o(387));var a=t.pendingProps;n=(i=t.memoizedState).element,Ps(e,t),js(t,a,null,r);var s=t.memoizedState;if(a=s.cache,vs(t,Bi,a),a!==i.cache&&_s(t,[Bi],r,!0),Ds(),a=s.element,i.isDehydrated){if(i={element:a,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=i,t.memoizedState=i,256&t.flags){t=ts(e,t,a,r);break e}if(a!==n){ai(n=On(Error(o(424)),t)),t=ts(e,t,a,r);break e}for(Xn=sh(t.stateNode.containerInfo.firstChild),Zn=t,Yn=!0,Kn=null,Jn=!0,r=wi(t,null,a,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(ii(),a===n){t=ps(e,t,r);break e}Go(e,t,a,r)}t=t.child}return t;case 26:return Ko(e,t),null===e?(r=gh(t.type,null,t.pendingProps,null))?t.memoizedState=r:Yn||(r=t.type,e=t.pendingProps,(n=Xu(K.current).createElement(r))[Fe]=t,n[Be]=e,Wu(n,r,e),Ke(n),t.stateNode=n):t.memoizedState=gh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),null===e&&Yn&&(n=t.stateNode=ch(t.type,t.pendingProps,K.current),Zn=t,Jn=!0,Xn=sh(n.firstChild)),n=t.pendingProps.children,null!==e||Yn?Go(e,t,n,r):t.child=_i(t,null,n,r),Ko(e,t),t.child;case 5:return null===e&&Yn&&((i=n=Xn)&&(null!==(n=function(e,t,r,n){for(;1===e.nodeType;){var i=r;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(n){if(!e[Ge])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==i.rel||e.getAttribute("href")!==(null==i.href?null:i.href)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||e.getAttribute("title")!==(null==i.title?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==i.src?null:i.src)||e.getAttribute("type")!==(null==i.type?null:i.type)||e.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==i.name?null:""+i.name;if("hidden"===i.type&&e.getAttribute("name")===a)return e}if(null===(e=sh(e.nextSibling)))break}return null}(n,t.type,t.pendingProps,Jn))?(t.stateNode=n,Zn=t,Xn=sh(n.firstChild),Jn=!1,i=!0):i=!1),i||ei(t)),te(t),i=t.type,a=t.pendingProps,s=null!==e?e.memoizedProps:null,n=a.children,Ju(i,a)?n=null:null!==s&&Ju(i,s)&&(t.flags|=32),null!==t.memoizedState&&(i=ha(e,t,fa,null,null,r),Dh._currentValue=i),Ko(e,t),Go(e,t,n,r),t.child;case 6:return null===e&&Yn&&((e=r=Xn)&&(null!==(r=function(e,t,r){if(""===t)return null;for(;3!==e.nodeType;){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!r)return null;if(null===(e=sh(e.nextSibling)))return null}return e}(r,t.pendingProps,Jn))?(t.stateNode=r,Zn=t,Xn=null,e=!0):e=!1),e||ei(t)),null;case 13:return as(e,t,r);case 4:return Q(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=_i(t,null,n,r):Go(e,t,n,r),t.child;case 11:return Wo(e,t,t.type,t.pendingProps,r);case 7:return Go(e,t,t.pendingProps,r),t.child;case 8:case 12:return Go(e,t,t.pendingProps.children,r),t.child;case 10:return n=t.pendingProps,vs(t,t.type,n.value),Go(e,t,n.children,r),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,Ts(t),n=n(i=Ss(i)),t.flags|=1,Go(e,t,n,r),t.child;case 14:return $o(e,t,t.type,t.pendingProps,r);case 15:return Zo(e,t,t.type,t.pendingProps,r);case 19:return hs(e,t,r);case 22:return Xo(e,t,r);case 24:return Ts(t),n=Ss(Bi),null===e?(null===(i=Xi())&&(i=tc,a=Ni(),i.pooledCache=a,a.refCount++,null!==a&&(i.pooledCacheLanes|=r),i=a),t.memoizedState={parent:n,cache:i},Cs(t),vs(t,Bi,i)):(0!==(e.lanes&r)&&(Ps(e,t),js(t,null,null,r),Ds()),i=e.memoizedState,a=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=i),vs(t,Bi,n)):(n=a.cache,vs(t,Bi,n),n!==i.cache&&_s(t,[Bi],r,!0))),Go(e,t,t.pendingProps.children,r),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}var ms=W(null),gs=null,ys=null;function vs(e,t,r){Z(ms,t._currentValue),t._currentValue=r}function xs(e){e._currentValue=ms.current,$(ms)}function bs(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function _s(e,t,r,n){var i=e.child;for(null!==i&&(i.return=e);null!==i;){var a=i.dependencies;if(null!==a){var s=i.child;a=a.firstContext;e:for(;null!==a;){var l=a;a=i;for(var c=0;c<t.length;c++)if(l.context===t[c]){a.lanes|=r,null!==(l=a.alternate)&&(l.lanes|=r),bs(a.return,r,e),n||(s=null);break e}a=l.next}}else if(18===i.tag){if(null===(s=i.return))throw Error(o(341));s.lanes|=r,null!==(a=s.alternate)&&(a.lanes|=r),bs(s,r,e),s=null}else s=i.child;if(null!==s)s.return=i;else for(s=i;null!==s;){if(s===e){s=null;break}if(null!==(i=s.sibling)){i.return=s.return,s=i;break}s=s.return}i=s}}function ws(e,t,r,n){e=null;for(var i=t,a=!1;null!==i;){if(!a)if(0!==(524288&i.flags))a=!0;else if(0!==(262144&i.flags))break;if(10===i.tag){var s=i.alternate;if(null===s)throw Error(o(387));if(null!==(s=s.memoizedProps)){var l=i.type;$r(i.pendingProps.value,s.value)||(null!==e?e.push(l):e=[l])}}else if(i===J.current){if(null===(s=i.alternate))throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(null!==e?e.push(Dh):e=[Dh])}i=i.return}null!==e&&_s(t,e,r,n),t.flags|=262144}function ks(e){for(e=e.firstContext;null!==e;){if(!$r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ts(e){gs=e,ys=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Ss(e){return Ms(gs,e)}function As(e,t){return null===gs&&Ts(e),Ms(e,t)}function Ms(e,t){var r=t._currentValue;if(t={context:t,memoizedValue:r,next:null},null===ys){if(null===e)throw Error(o(308));ys=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ys=ys.next=t;return r}var Es=!1;function Cs(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ps(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ls(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Is(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&ec)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=Ln(e),Pn(e,null,r),t}return Mn(e,n,t,r),Ln(e)}function zs(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194176&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,Oe(e,r)}}function Os(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,a=null;if(null!==(r=r.firstBaseUpdate)){do{var o={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};null===a?i=a=o:a=a.next=o,r=r.next}while(null!==r);null===a?i=a=t:a=a.next=t}else i=a=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,callbacks:n.callbacks},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}var Rs=!1;function Ds(){if(Rs){if(null!==Gi)throw Gi}}function js(e,t,r,n){Rs=!1;var i=e.updateQueue;Es=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var l=s,c=l.next;l.next=null,null===o?a=c:o.next=c,o=l;var u=e.alternate;null!==u&&((s=(u=u.updateQueue).lastBaseUpdate)!==o&&(null===s?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(null!==a){var h=i.baseState;for(o=0,u=c=l=null,s=a;;){var p=-536870913&s.lane,d=p!==s.lane;if(d?(nc&p)===p:(n&p)===p){0!==p&&p===Hi&&(Rs=!0),null!==u&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});e:{var f=e,m=s;p=t;var g=r;switch(m.tag){case 1:if("function"===typeof(f=m.payload)){h=f.call(g,h,p);break e}h=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(p="function"===typeof(f=m.payload)?f.call(g,h,p):f)||void 0===p)break e;h=L({},h,p);break e;case 2:Es=!0}}null!==(p=s.callback)&&(e.flags|=64,d&&(e.flags|=8192),null===(d=i.callbacks)?i.callbacks=[p]:d.push(p))}else d={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===u?(c=u=d,l=h):u=u.next=d,o|=p;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(d=s).next,d.next=null,i.lastBaseUpdate=d,i.shared.pending=null}}null===u&&(l=h),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,null===a&&(i.shared.lanes=0),hc|=o,e.lanes=o,e.memoizedState=h}}function Fs(e,t){if("function"!==typeof e)throw Error(o(191,e));e.call(t)}function Bs(e,t){var r=e.callbacks;if(null!==r)for(e.callbacks=null,e=0;e<r.length;e++)Fs(r[e],t)}function Ns(e,t){try{var r=t.updateQueue,n=null!==r?r.lastEffect:null;if(null!==n){var i=n.next;r=i;do{if((r.tag&e)===e){n=void 0;var a=r.create,o=r.inst;n=a(),o.destroy=n}r=r.next}while(r!==i)}}catch(s){nu(t,t.return,s)}}function Us(e,t,r){try{var n=t.updateQueue,i=null!==n?n.lastEffect:null;if(null!==i){var a=i.next;n=a;do{if((n.tag&e)===e){var o=n.inst,s=o.destroy;if(void 0!==s){o.destroy=void 0,i=t;var l=r;try{s()}catch(c){nu(i,l,c)}}}n=n.next}while(n!==a)}}catch(c){nu(t,t.return,c)}}function Vs(e){var t=e.updateQueue;if(null!==t){var r=e.stateNode;try{Bs(t,r)}catch(n){nu(e,e.return,n)}}}function qs(e,t,r){r.props=zo(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(n){nu(e,t,n)}}function Hs(e,t){try{var r=e.ref;if(null!==r){var n=e.stateNode;switch(e.tag){case 26:case 27:case 5:var i=n;break;default:i=n}"function"===typeof r?e.refCleanup=r(i):r.current=i}}catch(a){nu(e,t,a)}}function Gs(e,t){var r=e.ref,n=e.refCleanup;if(null!==r)if("function"===typeof n)try{n()}catch(i){nu(e,t,i)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof r)try{r(null)}catch(a){nu(e,t,a)}else r.current=null}function Ws(e){var t=e.type,r=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":r.autoFocus&&n.focus();break e;case"img":r.src?n.src=r.src:r.srcSet&&(n.srcset=r.srcSet)}}catch(i){nu(e,e.return,i)}}function $s(e,t,r){try{var n=e.stateNode;!function(e,t,r,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,a=null,s=null,l=null,c=null,u=null,h=null;for(f in r){var p=r[f];if(r.hasOwnProperty(f)&&null!=p)switch(f){case"checked":case"value":break;case"defaultValue":c=p;default:n.hasOwnProperty(f)||Hu(e,t,f,null,n,p)}}for(var d in n){var f=n[d];if(p=r[d],n.hasOwnProperty(d)&&(null!=f||null!=p))switch(d){case"type":a=f;break;case"name":i=f;break;case"checked":u=f;break;case"defaultChecked":h=f;break;case"value":s=f;break;case"defaultValue":l=f;break;case"children":case"dangerouslySetInnerHTML":if(null!=f)throw Error(o(137,t));break;default:f!==p&&Hu(e,t,d,f,n,p)}}return void gt(e,s,l,c,u,h,a,i);case"select":for(a in f=s=l=d=null,r)if(c=r[a],r.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":f=c;default:n.hasOwnProperty(a)||Hu(e,t,a,null,n,c)}for(i in n)if(a=n[i],c=r[i],n.hasOwnProperty(i)&&(null!=a||null!=c))switch(i){case"value":d=a;break;case"defaultValue":l=a;break;case"multiple":s=a;default:a!==c&&Hu(e,t,i,a,n,c)}return t=l,r=s,n=f,void(null!=d?xt(e,!!r,d,!1):!!n!==!!r&&(null!=t?xt(e,!!r,t,!0):xt(e,!!r,r?[]:"",!1)));case"textarea":for(l in f=d=null,r)if(i=r[l],r.hasOwnProperty(l)&&null!=i&&!n.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Hu(e,t,l,null,n,i)}for(s in n)if(i=n[s],a=r[s],n.hasOwnProperty(s)&&(null!=i||null!=a))switch(s){case"value":d=i;break;case"defaultValue":f=i;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=i)throw Error(o(91));break;default:i!==a&&Hu(e,t,s,i,n,a)}return void bt(e,d,f);case"option":for(var m in r)if(d=r[m],r.hasOwnProperty(m)&&null!=d&&!n.hasOwnProperty(m))if("selected"===m)e.selected=!1;else Hu(e,t,m,null,n,d);for(c in n)if(d=n[c],f=r[c],n.hasOwnProperty(c)&&d!==f&&(null!=d||null!=f))if("selected"===c)e.selected=d&&"function"!==typeof d&&"symbol"!==typeof d;else Hu(e,t,c,d,n,f);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in r)d=r[g],r.hasOwnProperty(g)&&null!=d&&!n.hasOwnProperty(g)&&Hu(e,t,g,null,n,d);for(u in n)if(d=n[u],f=r[u],n.hasOwnProperty(u)&&d!==f&&(null!=d||null!=f))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(o(137,t));break;default:Hu(e,t,u,d,n,f)}return;default:if(At(t)){for(var y in r)d=r[y],r.hasOwnProperty(y)&&void 0!==d&&!n.hasOwnProperty(y)&&Gu(e,t,y,void 0,n,d);for(h in n)d=n[h],f=r[h],!n.hasOwnProperty(h)||d===f||void 0===d&&void 0===f||Gu(e,t,h,d,n,f);return}}for(var v in r)d=r[v],r.hasOwnProperty(v)&&null!=d&&!n.hasOwnProperty(v)&&Hu(e,t,v,null,n,d);for(p in n)d=n[p],f=r[p],!n.hasOwnProperty(p)||d===f||null==d&&null==f||Hu(e,t,p,d,n,f)}(n,e.type,r,t),n[Be]=t}catch(i){nu(e,e.return,i)}}function Zs(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag||4===e.tag}function Xs(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Zs(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&27!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Ys(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=qu));else if(4!==n&&27!==n&&null!==(e=e.child))for(Ys(e,t,r),e=e.sibling;null!==e;)Ys(e,t,r),e=e.sibling}function Ks(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&27!==n&&null!==(e=e.child))for(Ks(e,t,r),e=e.sibling;null!==e;)Ks(e,t,r),e=e.sibling}var Js=!1,Qs=!1,el=!1,tl="function"===typeof WeakSet?WeakSet:Set,rl=null,nl=!1;function il(e,t,r){var n=r.flags;switch(r.tag){case 0:case 11:case 15:yl(e,r),4&n&&Ns(5,r);break;case 1:if(yl(e,r),4&n)if(e=r.stateNode,null===t)try{e.componentDidMount()}catch(s){nu(r,r.return,s)}else{var i=zo(r.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(l){nu(r,r.return,l)}}64&n&&Vs(r),512&n&&Hs(r,r.return);break;case 3:if(yl(e,r),64&n&&null!==(n=r.updateQueue)){if(e=null,null!==r.child)switch(r.child.tag){case 27:case 5:case 1:e=r.child.stateNode}try{Bs(n,e)}catch(s){nu(r,r.return,s)}}break;case 26:yl(e,r),512&n&&Hs(r,r.return);break;case 27:case 5:yl(e,r),null===t&&4&n&&Ws(r),512&n&&Hs(r,r.return);break;case 12:default:yl(e,r);break;case 13:yl(e,r),4&n&&ul(e,r);break;case 22:if(!(i=null!==r.memoizedState||Js)){t=null!==t&&null!==t.memoizedState||Qs;var a=Js,o=Qs;Js=i,(Qs=t)&&!o?xl(e,r,0!==(8772&r.subtreeFlags)):yl(e,r),Js=a,Qs=o}512&n&&("manual"===r.memoizedProps.mode?Hs(r,r.return):Gs(r,r.return))}}function al(e){var t=e.alternate;null!==t&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&We(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ol=null,sl=!1;function ll(e,t,r){for(r=r.child;null!==r;)cl(e,t,r),r=r.sibling}function cl(e,t,r){if(ve&&"function"===typeof ve.onCommitFiberUnmount)try{ve.onCommitFiberUnmount(ye,r)}catch(o){}switch(r.tag){case 26:Qs||Gs(r,t),ll(e,t,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode).parentNode.removeChild(r);break;case 27:Qs||Gs(r,t);var n=ol,i=sl;for(ol=r.stateNode,ll(e,t,r),t=(r=r.stateNode).attributes;t.length;)r.removeAttributeNode(t[0]);We(r),ol=n,sl=i;break;case 5:Qs||Gs(r,t);case 6:i=ol;var a=sl;if(ol=null,ll(e,t,r),sl=a,null!==(ol=i))if(sl)try{e=ol,n=r.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)}catch(s){nu(r,t,s)}else try{ol.removeChild(r.stateNode)}catch(s){nu(r,t,s)}break;case 18:null!==ol&&(sl?(t=ol,r=r.stateNode,8===t.nodeType?ah(t.parentNode,r):1===t.nodeType&&ah(t,r),mp(t)):ah(ol,r.stateNode));break;case 4:n=ol,i=sl,ol=r.stateNode.containerInfo,sl=!0,ll(e,t,r),ol=n,sl=i;break;case 0:case 11:case 14:case 15:Qs||Us(2,r,t),Qs||Us(4,r,t),ll(e,t,r);break;case 1:Qs||(Gs(r,t),"function"===typeof(n=r.stateNode).componentWillUnmount&&qs(r,t,n)),ll(e,t,r);break;case 21:ll(e,t,r);break;case 22:Qs||Gs(r,t),Qs=(n=Qs)||null!==r.memoizedState,ll(e,t,r),Qs=n;break;default:ll(e,t,r)}}function ul(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{mp(e)}catch(r){nu(t,t.return,r)}}function hl(e,t){var r=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new tl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new tl),t;default:throw Error(o(435,e.tag))}}(e);t.forEach((function(t){var n=lu.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}function pl(e,t){var r=t.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n],a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 27:case 5:ol=l.stateNode,sl=!1;break e;case 3:case 4:ol=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===ol)throw Error(o(160));cl(a,s,i),ol=null,sl=!1,null!==(a=i.alternate)&&(a.return=null),i.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)fl(t,e),t=t.sibling}var dl=null;function fl(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),ml(e),4&n&&(Us(3,e,e.return),Ns(3,e),Us(5,e,e.return));break;case 1:pl(t,e),ml(e),512&n&&(Qs||null===r||Gs(r,r.return)),64&n&&Js&&(null!==(e=e.updateQueue)&&(null!==(n=e.callbacks)&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===r?n:r.concat(n))));break;case 26:var i=dl;if(pl(t,e),ml(e),512&n&&(Qs||null===r||Gs(r,r.return)),4&n){var a=null!==r?r.memoizedState:null;if(n=e.memoizedState,null===r)if(null===n)if(null===e.stateNode){e:{n=e.type,r=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":(!(a=i.getElementsByTagName("title")[0])||a[Ge]||a[Fe]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=i.createElement(n),i.head.insertBefore(a,i.querySelector("head > title"))),Wu(a,n,r),a[Fe]=e,Ke(a),n=a;break e;case"link":var s=Mh("link","href",i).get(n+(r.href||""));if(s)for(var l=0;l<s.length;l++)if((a=s[l]).getAttribute("href")===(null==r.href?null:r.href)&&a.getAttribute("rel")===(null==r.rel?null:r.rel)&&a.getAttribute("title")===(null==r.title?null:r.title)&&a.getAttribute("crossorigin")===(null==r.crossOrigin?null:r.crossOrigin)){s.splice(l,1);break t}Wu(a=i.createElement(n),n,r),i.head.appendChild(a);break;case"meta":if(s=Mh("meta","content",i).get(n+(r.content||"")))for(l=0;l<s.length;l++)if((a=s[l]).getAttribute("content")===(null==r.content?null:""+r.content)&&a.getAttribute("name")===(null==r.name?null:r.name)&&a.getAttribute("property")===(null==r.property?null:r.property)&&a.getAttribute("http-equiv")===(null==r.httpEquiv?null:r.httpEquiv)&&a.getAttribute("charset")===(null==r.charSet?null:r.charSet)){s.splice(l,1);break t}Wu(a=i.createElement(n),n,r),i.head.appendChild(a);break;default:throw Error(o(468,n))}a[Fe]=e,Ke(a),n=a}e.stateNode=n}else Eh(i,e.type,e.stateNode);else e.stateNode=wh(i,n,e.memoizedProps);else a!==n?(null===a?null!==r.stateNode&&(r=r.stateNode).parentNode.removeChild(r):a.count--,null===n?Eh(i,e.type,e.stateNode):wh(i,n,e.memoizedProps)):null===n&&null!==e.stateNode&&$s(e,e.memoizedProps,r.memoizedProps)}break;case 27:if(4&n&&null===e.alternate){i=e.stateNode,a=e.memoizedProps;try{for(var c=i.firstChild;c;){var u=c.nextSibling,h=c.nodeName;c[Ge]||"HEAD"===h||"BODY"===h||"SCRIPT"===h||"STYLE"===h||"LINK"===h&&"stylesheet"===c.rel.toLowerCase()||i.removeChild(c),c=u}for(var p=e.type,d=i.attributes;d.length;)i.removeAttributeNode(d[0]);Wu(i,p,a),i[Fe]=e,i[Be]=a}catch(m){nu(e,e.return,m)}}case 5:if(pl(t,e),ml(e),512&n&&(Qs||null===r||Gs(r,r.return)),32&e.flags){i=e.stateNode;try{wt(i,"")}catch(m){nu(e,e.return,m)}}4&n&&null!=e.stateNode&&$s(e,i=e.memoizedProps,null!==r?r.memoizedProps:i),1024&n&&(el=!0);break;case 6:if(pl(t,e),ml(e),4&n){if(null===e.stateNode)throw Error(o(162));n=e.memoizedProps,r=e.stateNode;try{r.nodeValue=n}catch(m){nu(e,e.return,m)}}break;case 3:if(Ah=null,i=dl,dl=ph(t.containerInfo),pl(t,e),dl=i,ml(e),4&n&&null!==r&&r.memoizedState.isDehydrated)try{mp(t.containerInfo)}catch(m){nu(e,e.return,m)}el&&(el=!1,gl(e));break;case 4:n=dl,dl=ph(e.stateNode.containerInfo),pl(t,e),ml(e),dl=n;break;case 12:pl(t,e),ml(e);break;case 13:pl(t,e),ml(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==r&&null!==r.memoizedState)&&(xc=le()),4&n&&(null!==(n=e.updateQueue)&&(e.updateQueue=null,hl(e,n)));break;case 22:if(512&n&&(Qs||null===r||Gs(r,r.return)),c=null!==e.memoizedState,u=null!==r&&null!==r.memoizedState,Js=(h=Js)||c,Qs=(p=Qs)||u,pl(t,e),Qs=p,Js=h,ml(e),(t=e.stateNode)._current=e,t._visibility&=-3,t._visibility|=2&t._pendingVisibility,8192&n&&(t._visibility=c?-2&t._visibility:1|t._visibility,c&&(t=Js||Qs,null===r||u||t||vl(e)),null===e.memoizedProps||"manual"!==e.memoizedProps.mode))e:for(r=null,t=e;;){if(5===t.tag||26===t.tag||27===t.tag){if(null===r){u=r=t;try{if(i=u.stateNode,c)"function"===typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none";else{s=u.stateNode;var f=void 0!==(l=u.memoizedProps.style)&&null!==l&&l.hasOwnProperty("display")?l.display:null;s.style.display=null==f||"boolean"===typeof f?"":(""+f).trim()}}catch(m){nu(u,u.return,m)}}}else if(6===t.tag){if(null===r){u=t;try{u.stateNode.nodeValue=c?"":u.memoizedProps}catch(m){nu(u,u.return,m)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;r===t&&(r=null),t=t.return}r===t&&(r=null),t.sibling.return=t.return,t=t.sibling}4&n&&(null!==(n=e.updateQueue)&&(null!==(r=n.retryQueue)&&(n.retryQueue=null,hl(e,r))));break;case 19:pl(t,e),ml(e),4&n&&(null!==(n=e.updateQueue)&&(e.updateQueue=null,hl(e,n)));break;case 21:break;default:pl(t,e),ml(e)}}function ml(e){var t=e.flags;if(2&t){try{if(27!==e.tag){e:{for(var r=e.return;null!==r;){if(Zs(r)){var n=r;break e}r=r.return}throw Error(o(160))}switch(n.tag){case 27:var i=n.stateNode;Ks(e,Xs(e),i);break;case 5:var a=n.stateNode;32&n.flags&&(wt(a,""),n.flags&=-33),Ks(e,Xs(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Ys(e,Xs(e),s);break;default:throw Error(o(161))}}}catch(l){nu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function gl(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;gl(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function yl(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)il(e,t.alternate,t),t=t.sibling}function vl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Us(4,t,t.return),vl(t);break;case 1:Gs(t,t.return);var r=t.stateNode;"function"===typeof r.componentWillUnmount&&qs(t,t.return,r),vl(t);break;case 26:case 27:case 5:Gs(t,t.return),vl(t);break;case 22:Gs(t,t.return),null===t.memoizedState&&vl(t);break;default:vl(t)}e=e.sibling}}function xl(e,t,r){for(r=r&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var n=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:xl(i,a,r),Ns(4,a);break;case 1:if(xl(i,a,r),"function"===typeof(i=(n=a).stateNode).componentDidMount)try{i.componentDidMount()}catch(c){nu(n,n.return,c)}if(null!==(i=(n=a).updateQueue)){var s=n.stateNode;try{var l=i.shared.hiddenCallbacks;if(null!==l)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Fs(l[i],s)}catch(c){nu(n,n.return,c)}}r&&64&o&&Vs(a),Hs(a,a.return);break;case 26:case 27:case 5:xl(i,a,r),r&&null===n&&4&o&&Ws(a),Hs(a,a.return);break;case 12:default:xl(i,a,r);break;case 13:xl(i,a,r),r&&4&o&&ul(i,a);break;case 22:null===a.memoizedState&&xl(i,a,r),Hs(a,a.return)}t=t.sibling}}function bl(e,t){var r=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(r=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==r&&(null!=e&&e.refCount++,null!=r&&Ui(r))}function _l(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ui(e))}function wl(e,t,r,n){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)kl(e,t,r,n),t=t.sibling}function kl(e,t,r,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:wl(e,t,r,n),2048&i&&Ns(9,t);break;case 3:wl(e,t,r,n),2048&i&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ui(e)));break;case 12:if(2048&i){wl(e,t,r,n),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;"function"===typeof s&&s(o,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){nu(t,t.return,l)}}else wl(e,t,r,n);break;case 23:break;case 22:a=t.stateNode,null!==t.memoizedState?4&a._visibility?wl(e,t,r,n):Sl(e,t):4&a._visibility?wl(e,t,r,n):(a._visibility|=4,Tl(e,t,r,n,0!==(10256&t.subtreeFlags))),2048&i&&bl(t.alternate,t);break;case 24:wl(e,t,r,n),2048&i&&_l(t.alternate,t);break;default:wl(e,t,r,n)}}function Tl(e,t,r,n,i){for(i=i&&0!==(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,o=t,s=r,l=n,c=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,l,i),Ns(8,o);break;case 23:break;case 22:var u=o.stateNode;null!==o.memoizedState?4&u._visibility?Tl(a,o,s,l,i):Sl(a,o):(u._visibility|=4,Tl(a,o,s,l,i)),i&&2048&c&&bl(o.alternate,o);break;case 24:Tl(a,o,s,l,i),i&&2048&c&&_l(o.alternate,o);break;default:Tl(a,o,s,l,i)}t=t.sibling}}function Sl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var r=e,n=t,i=n.flags;switch(n.tag){case 22:Sl(r,n),2048&i&&bl(n.alternate,n);break;case 24:Sl(r,n),2048&i&&_l(n.alternate,n);break;default:Sl(r,n)}t=t.sibling}}var Al=8192;function Ml(e){if(e.subtreeFlags&Al)for(e=e.child;null!==e;)El(e),e=e.sibling}function El(e){switch(e.tag){case 26:Ml(e),e.flags&Al&&null!==e.memoizedState&&function(e,t,r){if(null===Ph)throw Error(o(475));var n=Ph;if("stylesheet"===t.type&&("string"!==typeof r.media||!1!==matchMedia(r.media).matches)&&0===(4&t.state.loading)){if(null===t.instance){var i=yh(r.href),a=e.querySelector(vh(i));if(a)return null!==(e=a._p)&&"object"===typeof e&&"function"===typeof e.then&&(n.count++,n=Ih.bind(n),e.then(n,n)),t.state.loading|=4,t.instance=a,void Ke(a);a=e.ownerDocument||e,r=xh(r),(i=uh.get(i))&&Th(r,i),Ke(a=a.createElement("link"));var s=a;s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Wu(a,"link",r),t.instance=a}null===n.stylesheets&&(n.stylesheets=new Map),n.stylesheets.set(t,e),(e=t.state.preload)&&0===(3&t.state.loading)&&(n.count++,t=Ih.bind(n),e.addEventListener("load",t),e.addEventListener("error",t))}}(dl,e.memoizedState,e.memoizedProps);break;case 5:default:Ml(e);break;case 3:case 4:var t=dl;dl=ph(e.stateNode.containerInfo),Ml(e),dl=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Al,Al=16777216,Ml(e),Al=t):Ml(e))}}function Cl(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Pl(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var r=0;r<t.length;r++){var n=t[r];rl=n,zl(n,e)}Cl(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)Ll(e),e=e.sibling}function Ll(e){switch(e.tag){case 0:case 11:case 15:Pl(e),2048&e.flags&&Us(9,e,e.return);break;case 3:case 12:default:Pl(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&4&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-5,Il(e)):Pl(e)}}function Il(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var r=0;r<t.length;r++){var n=t[r];rl=n,zl(n,e)}Cl(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:Us(8,t,t.return),Il(t);break;case 22:4&(r=t.stateNode)._visibility&&(r._visibility&=-5,Il(t));break;default:Il(t)}e=e.sibling}}function zl(e,t){for(;null!==rl;){var r=rl;switch(r.tag){case 0:case 11:case 15:Us(8,r,t);break;case 23:case 22:if(null!==r.memoizedState&&null!==r.memoizedState.cachePool){var n=r.memoizedState.cachePool.pool;null!=n&&n.refCount++}break;case 24:Ui(r.memoizedState.cache)}if(null!==(n=r.child))n.return=r,rl=n;else e:for(r=e;null!==rl;){var i=(n=rl).sibling,a=n.return;if(al(n),n===r){rl=null;break e}if(null!==i){i.return=a,rl=i;break e}rl=a}}}function Ol(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rl(e,t,r,n){return new Ol(e,t,r,n)}function Dl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function jl(e,t){var r=e.alternate;return null===r?((r=Rl(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=31457280&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function Fl(e,t){e.flags&=31457282;var r=e.alternate;return null===r?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,t=r.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Bl(e,t,r,n,i,a){var s=0;if(n=e,"function"===typeof e)Dl(e)&&(s=1);else if("string"===typeof e)s=function(e,t,r){if(1===r||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,r,X.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case h:return Nl(r.children,i,a,t);case p:s=8,i|=24;break;case d:return(e=Rl(12,r,t,2|i)).elementType=d,e.lanes=a,e;case v:return(e=Rl(13,r,t,i)).elementType=v,e.lanes=a,e;case x:return(e=Rl(19,r,t,i)).elementType=x,e.lanes=a,e;case w:return Ul(r,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case f:case g:s=10;break e;case m:s=9;break e;case y:s=11;break e;case b:s=14;break e;case _:s=16,n=null;break e}s=29,r=Error(o(130,null===e?"null":typeof e,"")),n=null}return(t=Rl(s,r,t,i)).elementType=e,t.type=n,t.lanes=a,t}function Nl(e,t,r,n){return(e=Rl(7,e,n,t)).lanes=r,e}function Ul(e,t,r,n){(e=Rl(22,e,n,t)).elementType=w,e.lanes=r;var i={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var e=i._current;if(null===e)throw Error(o(456));if(0===(2&i._pendingVisibility)){var t=Cn(e,2);null!==t&&(i._pendingVisibility|=2,Ic(t,e,2))}},attach:function(){var e=i._current;if(null===e)throw Error(o(456));if(0!==(2&i._pendingVisibility)){var t=Cn(e,2);null!==t&&(i._pendingVisibility&=-3,Ic(t,e,2))}}};return e.stateNode=i,e}function Vl(e,t,r){return(e=Rl(6,e,null,t)).lanes=r,e}function ql(e,t,r){return(t=Rl(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hl(e){e.flags|=4}function Gl(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!Ch(t)){if(null!==(t=Ei.current)&&((4194176&nc)===nc?null!==Ci:(62914560&nc)!==nc&&0===(536870912&nc)||t!==Ci))throw pi=li,si;e.flags|=8192}}function Wl(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?Pe():536870912,e.lanes|=t,mc|=t)}function $l(e,t){if(!Yn)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Zl(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=31457280&i.subtreeFlags,n|=31457280&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Xl(e,t,r){var n=t.pendingProps;switch($n(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return Zl(t),null;case 3:return r=t.stateNode,n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xs(Bi),ee(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(ni(t)?Hl(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==Kn&&(Oc(Kn),Kn=null))),Zl(t),null;case 26:return r=t.memoizedState,null===e?(Hl(t),null!==r?(Zl(t),Gl(t,r)):(Zl(t),t.flags&=-16777217)):r?r!==e.memoizedState?(Hl(t),Zl(t),Gl(t,r)):(Zl(t),t.flags&=-16777217):(e.memoizedProps!==n&&Hl(t),Zl(t),t.flags&=-16777217),null;case 27:re(t),r=K.current;var i=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==n&&Hl(t);else{if(!n){if(null===t.stateNode)throw Error(o(166));return Zl(t),null}e=X.current,ni(t)?ti(t):(e=ch(i,n,r),t.stateNode=e,Hl(t))}return Zl(t),null;case 5:if(re(t),r=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==n&&Hl(t);else{if(!n){if(null===t.stateNode)throw Error(o(166));return Zl(t),null}if(e=X.current,ni(t))ti(t);else{switch(i=Xu(K.current),e){case 1:e=i.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:e=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":e=i.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":e=i.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof n.is?i.createElement("select",{is:n.is}):i.createElement("select"),n.multiple?e.multiple=!0:n.size&&(e.size=n.size);break;default:e="string"===typeof n.is?i.createElement(r,{is:n.is}):i.createElement(r)}}e[Fe]=t,e[Be]=n;e:for(i=t.child;null!==i;){if(5===i.tag||6===i.tag)e.appendChild(i.stateNode);else if(4!==i.tag&&27!==i.tag&&null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;null===i.sibling;){if(null===i.return||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=e;e:switch(Wu(e,r,n),r){case"button":case"input":case"select":case"textarea":e=!!n.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Hl(t)}}return Zl(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==n&&Hl(t);else{if("string"!==typeof n&&null===t.stateNode)throw Error(o(166));if(e=K.current,ni(t)){if(e=t.stateNode,r=t.memoizedProps,n=null,null!==(i=Zn))switch(i.tag){case 27:case 5:n=i.memoizedProps}e[Fe]=t,(e=!!(e.nodeValue===r||null!==n&&!0===n.suppressHydrationWarning||Vu(e.nodeValue,r)))||ei(t)}else(e=Xu(e).createTextNode(n))[Fe]=t,t.stateNode=e}return Zl(t),null;case 13:if(n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(i=ni(t),null!==n&&null!==n.dehydrated){if(null===e){if(!i)throw Error(o(318));if(!(i=null!==(i=t.memoizedState)?i.dehydrated:null))throw Error(o(317));i[Fe]=t}else ii(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Zl(t),i=!1}else null!==Kn&&(Oc(Kn),Kn=null),i=!0;if(!i)return 256&t.flags?(zi(t),t):(zi(t),null)}if(zi(t),0!==(128&t.flags))return t.lanes=r,t;if(r=null!==n,e=null!==e&&null!==e.memoizedState,r){i=null,null!==(n=t.child).alternate&&null!==n.alternate.memoizedState&&null!==n.alternate.memoizedState.cachePool&&(i=n.alternate.memoizedState.cachePool.pool);var a=null;null!==n.memoizedState&&null!==n.memoizedState.cachePool&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048)}return r!==e&&r&&(t.child.flags|=8192),Wl(t,t.updateQueue),Zl(t),null;case 4:return ee(),null===e&&Iu(t.stateNode.containerInfo),Zl(t),null;case 10:return xs(t.type),Zl(t),null;case 19:if($(Oi),null===(i=t.memoizedState))return Zl(t),null;if(n=0!==(128&t.flags),null===(a=i.rendering))if(n)$l(i,!1);else{if(0!==uc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=Ri(e))){for(t.flags|=128,$l(i,!1),e=a.updateQueue,t.updateQueue=e,Wl(t,e),t.subtreeFlags=0,e=r,r=t.child;null!==r;)Fl(r,e),r=r.sibling;return Z(Oi,1&Oi.current|2),t.child}e=e.sibling}null!==i.tail&&le()>bc&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=Ri(a))){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Wl(t,e),$l(i,!0),null===i.tail&&"hidden"===i.tailMode&&!a.alternate&&!Yn)return Zl(t),null}else 2*le()-i.renderingStartTime>bc&&536870912!==r&&(t.flags|=128,n=!0,$l(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=i.last)?e.sibling=a:t.child=a,i.last=a)}return null!==i.tail?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=le(),t.sibling=null,e=Oi.current,Z(Oi,n?1&e|2:1&e),t):(Zl(t),null);case 22:case 23:return zi(t),Mi(),n=null!==t.memoizedState,null!==e?null!==e.memoizedState!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?0!==(536870912&r)&&0===(128&t.flags)&&(Zl(t),6&t.subtreeFlags&&(t.flags|=8192)):Zl(t),null!==(r=t.updateQueue)&&Wl(t,r.retryQueue),r=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(r=e.memoizedState.cachePool.pool),n=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(n=t.memoizedState.cachePool.pool),n!==r&&(t.flags|=2048),null!==e&&$(Zi),null;case 24:return r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xs(Bi),Zl(t),null;case 25:return null}throw Error(o(156,t.tag))}function Yl(e,t){switch($n(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return xs(Bi),ee(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return re(t),null;case 13:if(zi(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));ii()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return $(Oi),null;case 4:return ee(),null;case 10:return xs(t.type),null;case 22:case 23:return zi(t),Mi(),null!==e&&$(Zi),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return xs(Bi),null;default:return null}}function Kl(e,t){switch($n(t),t.tag){case 3:xs(Bi),ee();break;case 26:case 27:case 5:re(t);break;case 4:ee();break;case 13:zi(t);break;case 19:$(Oi);break;case 10:xs(t.type);break;case 22:case 23:zi(t),Mi(),null!==e&&$(Zi);break;case 24:xs(Bi)}}var Jl={getCacheForType:function(e){var t=Ss(Bi),r=t.data.get(e);return void 0===r&&(r=e(),t.data.set(e,r)),r}},Ql="function"===typeof WeakMap?WeakMap:Map,ec=0,tc=null,rc=null,nc=0,ic=0,ac=null,oc=!1,sc=!1,lc=!1,cc=0,uc=0,hc=0,pc=0,dc=0,fc=0,mc=0,gc=null,yc=null,vc=!1,xc=0,bc=1/0,_c=null,wc=null,kc=!1,Tc=null,Sc=0,Ac=0,Mc=null,Ec=0,Cc=null;function Pc(){if(0!==(2&ec)&&0!==nc)return nc&-nc;if(null!==P.T){return 0!==Hi?Hi:_u()}return De()}function Lc(){0===fc&&(fc=0===(536870912&nc)||Yn?Ce():536870912);var e=Ei.current;return null!==e&&(e.flags|=32),fc}function Ic(e,t,r){(e===tc&&2===ic||null!==e.cancelPendingCommit)&&(Nc(e,0),jc(e,nc,fc,!1)),Ie(e,r),0!==(2&ec)&&e===tc||(e===tc&&(0===(2&ec)&&(pc|=r),4===uc&&jc(e,nc,fc,!1)),mu(e))}function zc(e,t,r){if(0!==(6&ec))throw Error(o(327));for(var n=!r&&0===(60&t)&&0===(t&e.expiredLanes)||Me(e,t),i=n?function(e,t){var r=ec;ec|=2;var n=Vc(),i=qc();tc!==e||nc!==t?(_c=null,bc=le()+500,Nc(e,t)):sc=Me(e,t);e:for(;;)try{if(0!==ic&&null!==rc){t=rc;var a=ac;t:switch(ic){case 1:ic=0,ac=null,Yc(e,t,a,1);break;case 2:if(ci(a)){ic=0,ac=null,Xc(t);break}t=function(){2===ic&&tc===e&&(ic=7),mu(e)},a.then(t,t);break e;case 3:ic=7;break e;case 4:ic=5;break e;case 7:ci(a)?(ic=0,ac=null,Xc(t)):(ic=0,ac=null,Yc(e,t,a,7));break;case 5:var s=null;switch(rc.tag){case 26:s=rc.memoizedState;case 5:case 27:var l=rc;if(!s||Ch(s)){ic=0,ac=null;var c=l.sibling;if(null!==c)rc=c;else{var u=l.return;null!==u?(rc=u,Kc(u)):rc=null}break t}}ic=0,ac=null,Yc(e,t,a,5);break;case 6:ic=0,ac=null,Yc(e,t,a,6);break;case 8:Bc(),uc=6;break e;default:throw Error(o(462))}}$c();break}catch(h){Uc(e,h)}return ys=gs=null,P.H=n,P.A=i,ec=r,null!==rc?0:(tc=null,nc=0,An(),uc)}(e,t):Gc(e,t,!0),a=n;;){if(0===i){sc&&!n&&jc(e,t,0,!1);break}if(6===i)jc(e,t,0,!oc);else{if(r=e.current.alternate,a&&!Dc(r)){i=Gc(e,t,!1),a=!1;continue}if(2===i){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=0!==(s=-536870913&e.pendingLanes)?s:536870912&s?536870912:0;if(0!==s){t=s;e:{var l=e;i=gc;var c=l.current.memoizedState.isDehydrated;if(c&&(Nc(l,s).flags|=256),2!==(s=Gc(l,s,!1))){if(lc&&!c){l.errorRecoveryDisabledLanes|=a,pc|=a,i=4;break e}a=yc,yc=i,null!==a&&Oc(a)}i=s}if(a=!1,2!==i)continue}}if(1===i){Nc(e,0),jc(e,t,0,!0);break}e:{switch(n=e,i){case 0:case 1:throw Error(o(345));case 4:if((4194176&t)===t){jc(n,t,fc,!oc);break e}break;case 2:yc=null;break;case 3:case 5:break;default:throw Error(o(329))}if(n.finishedWork=r,n.finishedLanes=t,(62914560&t)===t&&10<(a=xc+300-le())){if(jc(n,t,fc,!oc),0!==Ae(n,0))break e;n.timeoutHandle=eh(Rc.bind(null,n,r,yc,_c,vc,t,fc,pc,mc,oc,2,-0,0),a)}else Rc(n,r,yc,_c,vc,t,fc,pc,mc,oc,0,-0,0)}}break}mu(e)}function Oc(e){null===yc?yc=e:yc.push.apply(yc,e)}function Rc(e,t,r,n,i,a,s,l,c,u,h,p,d){var f=t.subtreeFlags;if((8192&f||16785408===(16785408&f))&&(Ph={stylesheets:null,count:0,unsuspend:Lh},El(t),null!==(t=function(){if(null===Ph)throw Error(o(475));var e=Ph;return e.stylesheets&&0===e.count&&Oh(e,e.stylesheets),0<e.count?function(t){var r=setTimeout((function(){if(e.stylesheets&&Oh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}),6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(r)}}:null}())))return e.cancelPendingCommit=t(Qc.bind(null,e,r,n,i,s,l,c,1,p,d)),void jc(e,a,s,!u);Qc(e,r,n,i,s,l,c,h,p,d)}function Dc(e){for(var t=e;;){var r=t.tag;if((0===r||11===r||15===r)&&16384&t.flags&&(null!==(r=t.updateQueue)&&null!==(r=r.stores)))for(var n=0;n<r.length;n++){var i=r[n],a=i.getSnapshot;i=i.value;try{if(!$r(a(),i))return!1}catch(o){return!1}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function jc(e,t,r,n){t&=~dc,t&=~pc,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var a=31-be(i),o=1<<a;n[a]=-1,i&=~o}0!==r&&ze(e,r,t)}function Fc(){return 0!==(6&ec)||(gu(0,!1),!1)}function Bc(){if(null!==rc){if(0===ic)var e=rc.return;else ys=gs=null,ya(e=rc),fi=null,mi=0,e=rc;for(;null!==e;)Kl(e.alternate,e),e=e.return;rc=null}}function Nc(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;-1!==r&&(e.timeoutHandle=-1,th(r)),null!==(r=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,r()),Bc(),tc=e,rc=r=jl(e.current,null),nc=t,ic=0,ac=null,oc=!1,sc=Me(e,t),lc=!1,mc=fc=dc=pc=hc=uc=0,yc=gc=null,vc=!1,0!==(8&t)&&(t|=32&t);var n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=t;0<n;){var i=31-be(n),a=1<<i;t|=e[i],n&=~a}return cc=t,An(),r}function Uc(e,t){Qi=null,P.H=So,t===oi?(t=di(),ic=3):t===si?(t=di(),ic=4):ic=t===qo?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,ac=t,null===rc&&(uc=1,Fo(e,On(t,e.current)))}function Vc(){var e=P.H;return P.H=So,null===e?So:e}function qc(){var e=P.A;return P.A=Jl,e}function Hc(){uc=4,oc||(4194176&nc)!==nc&&null!==Ei.current||(sc=!0),0===(134217727&hc)&&0===(134217727&pc)||null===tc||jc(tc,nc,fc,!1)}function Gc(e,t,r){var n=ec;ec|=2;var i=Vc(),a=qc();tc===e&&nc===t||(_c=null,Nc(e,t)),t=!1;var o=uc;e:for(;;)try{if(0!==ic&&null!==rc){var s=rc,l=ac;switch(ic){case 8:Bc(),o=6;break e;case 3:case 2:case 6:null===Ei.current&&(t=!0);var c=ic;if(ic=0,ac=null,Yc(e,s,l,c),r&&sc){o=0;break e}break;default:c=ic,ic=0,ac=null,Yc(e,s,l,c)}}Wc(),o=uc;break}catch(u){Uc(e,u)}return t&&e.shellSuspendCounter++,ys=gs=null,ec=n,P.H=i,P.A=a,null===rc&&(tc=null,nc=0,An()),o}function Wc(){for(;null!==rc;)Zc(rc)}function $c(){for(;null!==rc&&!oe();)Zc(rc)}function Zc(e){var t=fs(e.alternate,e,cc);e.memoizedProps=e.pendingProps,null===t?Kc(e):rc=t}function Xc(e){var t=e,r=t.alternate;switch(t.tag){case 15:case 0:t=Qo(r,t,t.pendingProps,t.type,void 0,nc);break;case 11:t=Qo(r,t,t.pendingProps,t.type.render,t.ref,nc);break;case 5:ya(t);default:Kl(r,t),t=fs(r,t=rc=Fl(t,cc),cc)}e.memoizedProps=e.pendingProps,null===t?Kc(e):rc=t}function Yc(e,t,r,n){ys=gs=null,ya(t),fi=null,mi=0;var i=t.return;try{if(function(e,t,r,n,i){if(r.flags|=32768,null!==n&&"object"===typeof n&&"function"===typeof n.then){if(null!==(t=r.alternate)&&ws(t,r,i,!0),null!==(r=Ei.current)){switch(r.tag){case 13:return null===Ci?Hc():null===r.alternate&&0===uc&&(uc=3),r.flags&=-257,r.flags|=65536,r.lanes=i,n===li?r.flags|=16384:(null===(t=r.updateQueue)?r.updateQueue=new Set([n]):t.add(n),iu(e,n,i)),!1;case 22:return r.flags|=65536,n===li?r.flags|=16384:(null===(t=r.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},r.updateQueue=t):null===(r=t.retryQueue)?t.retryQueue=new Set([n]):r.add(n),iu(e,n,i)),!1}throw Error(o(435,r.tag))}return iu(e,n,i),Hc(),!1}if(Yn)return null!==(t=Ei.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==Qn&&ai(On(e=Error(o(422),{cause:n}),r))):(n!==Qn&&ai(On(t=Error(o(423),{cause:n}),r)),(e=e.current.alternate).flags|=65536,i&=-i,e.lanes|=i,n=On(n,r),Os(e,i=No(e.stateNode,n,i)),4!==uc&&(uc=2)),!1;var a=Error(o(520),{cause:n});if(a=On(a,r),null===gc?gc=[a]:gc.push(a),4!==uc&&(uc=2),null===t)return!0;n=On(n,r),r=t;do{switch(r.tag){case 3:return r.flags|=65536,e=i&-i,r.lanes|=e,Os(r,e=No(r.stateNode,n,e)),!1;case 1:if(t=r.type,a=r.stateNode,0===(128&r.flags)&&("function"===typeof t.getDerivedStateFromError||null!==a&&"function"===typeof a.componentDidCatch&&(null===wc||!wc.has(a))))return r.flags|=65536,i&=-i,r.lanes|=i,Vo(i=Uo(i),e,r,n),Os(r,i),!1}r=r.return}while(null!==r);return!1}(e,i,t,r,nc))return uc=1,Fo(e,On(r,e.current)),void(rc=null)}catch(a){if(null!==i)throw rc=i,a;return uc=1,Fo(e,On(r,e.current)),void(rc=null)}32768&t.flags?(Yn||1===n?e=!0:sc||0!==(536870912&nc)?e=!1:(oc=e=!0,(2===n||3===n||6===n)&&(null!==(n=Ei.current)&&13===n.tag&&(n.flags|=16384))),Jc(t,e)):Kc(t)}function Kc(e){var t=e;do{if(0!==(32768&t.flags))return void Jc(t,oc);e=t.return;var r=Xl(t.alternate,t,cc);if(null!==r)return void(rc=r);if(null!==(t=t.sibling))return void(rc=t);rc=t=e}while(null!==t);0===uc&&(uc=5)}function Jc(e,t){do{var r=Yl(e.alternate,e);if(null!==r)return r.flags&=32767,void(rc=r);if(null!==(r=e.return)&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!t&&null!==(e=e.sibling))return void(rc=e);rc=e=r}while(null!==e);uc=6,rc=null}function Qc(e,t,r,n,i,a,s,l,c,u){var h=P.T,p=V.p;try{V.p=2,P.T=null,function(e,t,r,n,i,a,s,l){do{tu()}while(null!==Tc);if(0!==(6&ec))throw Error(o(327));var c=e.finishedWork;if(n=e.finishedLanes,null===c)return null;if(e.finishedWork=null,e.finishedLanes=0,c===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var u=c.lanes|c.childLanes;if(function(e,t,r,n,i,a){var o=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var s=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(r=o&~r;0<r;){var u=31-be(r),h=1<<u;s[u]=0,l[u]=-1;var p=c[u];if(null!==p)for(c[u]=null,u=0;u<p.length;u++){var d=p[u];null!==d&&(d.lane&=-536870913)}r&=~h}0!==n&&ze(e,n,0),0!==a&&0===i&&0!==e.tag&&(e.suspendedLanes|=a&~(o&~t))}(e,n,u|=Sn,a,s,l),e===tc&&(rc=tc=null,nc=0),0===(10256&c.subtreeFlags)&&0===(10256&c.flags)||kc||(kc=!0,Ac=u,Mc=r,function(e,t){ie(e,t)}(pe,(function(){return tu(),null}))),r=0!==(15990&c.flags),0!==(15990&c.subtreeFlags)||r?(r=P.T,P.T=null,a=V.p,V.p=2,s=ec,ec|=4,function(e,t){if(e=e.containerInfo,$u=Hh,Qr(e=Jr(e))){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch(g){r=null;break e}var s=0,l=-1,c=-1,u=0,h=0,p=e,d=null;t:for(;;){for(var f;p!==r||0!==i&&3!==p.nodeType||(l=s+i),p!==a||0!==n&&3!==p.nodeType||(c=s+n),3===p.nodeType&&(s+=p.nodeValue.length),null!==(f=p.firstChild);)d=p,p=f;for(;;){if(p===e)break t;if(d===r&&++u===i&&(l=s),d===a&&++h===n&&(c=s),null!==(f=p.nextSibling))break;d=(p=d).parentNode}p=f}r=-1===l||-1===c?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Zu={focusedElem:e,selectionRange:r},Hh=!1,rl=t;null!==rl;)if(e=(t=rl).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,rl=e;else for(;null!==rl;){switch(a=(t=rl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==a){e=void 0,r=t,i=a.memoizedProps,a=a.memoizedState,n=r.stateNode;try{var m=zo(r.type,i,(r.elementType,r.type));e=n.getSnapshotBeforeUpdate(m,a),n.__reactInternalSnapshotBeforeUpdate=e}catch(y){nu(r,r.return,y)}}break;case 3:if(0!==(1024&e))if(9===(r=(e=t.stateNode.containerInfo).nodeType))oh(e);else if(1===r)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":oh(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(o(163))}if(null!==(e=t.sibling)){e.return=t.return,rl=e;break}rl=t.return}m=nl,nl=!1}(e,c),fl(c,e),en(Zu,e.containerInfo),Hh=!!$u,Zu=$u=null,e.current=c,il(e,c.alternate,c),se(),ec=s,V.p=a,P.T=r):e.current=c,kc?(kc=!1,Tc=e,Sc=n):eu(e,u),u=e.pendingLanes,0===u&&(wc=null),function(e){if(ve&&"function"===typeof ve.onCommitFiberRoot)try{ve.onCommitFiberRoot(ye,e,void 0,128===(128&e.current.flags))}catch(t){}}(c.stateNode),mu(e),null!==t)for(i=e.onRecoverableError,c=0;c<t.length;c++)u=t[c],i(u.value,{componentStack:u.stack});0!==(3&Sc)&&tu(),u=e.pendingLanes,0!==(4194218&n)&&0!==(42&u)?e===Cc?Ec++:(Ec=0,Cc=e):Ec=0,gu(0,!1)}(e,t,r,n,p,i,a,s)}finally{P.T=h,V.p=p}}function eu(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Ui(t)))}function tu(){if(null!==Tc){var e=Tc,t=Ac;Ac=0;var r=Re(Sc),n=P.T,i=V.p;try{if(V.p=32>r?32:r,P.T=null,null===Tc)var a=!1;else{r=Mc,Mc=null;var s=Tc,l=Sc;if(Tc=null,Sc=0,0!==(6&ec))throw Error(o(331));var c=ec;if(ec|=4,Ll(s.current),kl(s,s.current,l,r),ec=c,gu(0,!1),ve&&"function"===typeof ve.onPostCommitFiberRoot)try{ve.onPostCommitFiberRoot(ye,s)}catch(u){}a=!0}return a}finally{V.p=i,P.T=n,eu(e,t)}}return!1}function ru(e,t,r){t=On(r,t),null!==(e=Is(e,t=No(e.stateNode,t,2),2))&&(Ie(e,2),mu(e))}function nu(e,t,r){if(3===e.tag)ru(e,e,r);else for(;null!==t;){if(3===t.tag){ru(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===wc||!wc.has(n))){e=On(r,e),null!==(n=Is(t,r=Uo(2),2))&&(Vo(r,n,t,e),Ie(n,2),mu(n));break}}t=t.return}}function iu(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new Ql;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(lc=!0,i.add(r),e=au.bind(null,e,t,r),t.then(e,e))}function au(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,tc===e&&(nc&r)===r&&(4===uc||3===uc&&(62914560&nc)===nc&&300>le()-xc?0===(2&ec)&&Nc(e,0):dc|=r,mc===nc&&(mc=0)),mu(e)}function ou(e,t){0===t&&(t=Pe()),null!==(e=Cn(e,t))&&(Ie(e,t),mu(e))}function su(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),ou(e,r)}function lu(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}null!==n&&n.delete(t),ou(e,r)}var cu=null,uu=null,hu=!1,pu=!1,du=!1,fu=0;function mu(e){var t;e!==uu&&null===e.next&&(null===uu?cu=uu=e:uu=uu.next=e),pu=!0,hu||(hu=!0,t=yu,nh((function(){0!==(6&ec)?ie(ue,t):t()})))}function gu(e,t){if(!du&&pu){du=!0;do{for(var r=!1,n=cu;null!==n;){if(!t)if(0!==e){var i=n.pendingLanes;if(0===i)var a=0;else{var o=n.suspendedLanes,s=n.pingedLanes;a=(1<<31-be(42|e)+1)-1,a=201326677&(a&=i&~(o&~s))?201326677&a|1:a?2|a:0}0!==a&&(r=!0,bu(n,a))}else a=nc,0===(3&(a=Ae(n,n===tc?a:0)))||Me(n,a)||(r=!0,bu(n,a));n=n.next}}while(r);du=!1}}function yu(){pu=hu=!1;var e=0;0!==fu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==Qu&&(Qu=e,!0);return Qu=null,!1}()&&(e=fu),fu=0);for(var t=le(),r=null,n=cu;null!==n;){var i=n.next,a=vu(n,t);0===a?(n.next=null,null===r?cu=i:r.next=i,null===i&&(uu=r)):(r=n,(0!==e||0!==(3&a))&&(pu=!0)),n=i}gu(e,!1)}function vu(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var o=31-be(a),s=1<<o,l=i[o];-1===l?0!==(s&r)&&0===(s&n)||(i[o]=Ee(s,t)):l<=t&&(e.expiredLanes|=s),a&=~s}if(r=nc,r=Ae(e,e===(t=tc)?r:0),n=e.callbackNode,0===r||e===t&&2===ic||null!==e.cancelPendingCommit)return null!==n&&null!==n&&ae(n),e.callbackNode=null,e.callbackPriority=0;if(0===(3&r)||Me(e,r)){if((t=r&-r)===e.callbackPriority)return t;switch(null!==n&&ae(n),Re(r)){case 2:case 8:r=he;break;case 32:default:r=pe;break;case 268435456:r=fe}return n=xu.bind(null,e),r=ie(r,n),e.callbackPriority=t,e.callbackNode=r,t}return null!==n&&null!==n&&ae(n),e.callbackPriority=2,e.callbackNode=null,2}function xu(e,t){var r=e.callbackNode;if(tu()&&e.callbackNode!==r)return null;var n=nc;return 0===(n=Ae(e,e===tc?n:0))?null:(zc(e,n,t),vu(e,le()),null!=e.callbackNode&&e.callbackNode===r?xu.bind(null,e):null)}function bu(e,t){if(tu())return null;zc(e,t,!0)}function _u(){return 0===fu&&(fu=Ce()),fu}function wu(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:Ct(""+e)}function ku(e,t){var r=t.ownerDocument.createElement("input");return r.name=t.name,r.value=t.value,e.id&&r.setAttribute("form",e.id),t.parentNode.insertBefore(r,t),e=new FormData(e),r.parentNode.removeChild(r),e}for(var Tu=0;Tu<_n.length;Tu++){var Su=_n[Tu];wn(Su.toLowerCase(),"on"+(Su[0].toUpperCase()+Su.slice(1)))}wn(dn,"onAnimationEnd"),wn(fn,"onAnimationIteration"),wn(mn,"onAnimationStart"),wn("dblclick","onDoubleClick"),wn("focusin","onFocus"),wn("focusout","onBlur"),wn(gn,"onTransitionRun"),wn(yn,"onTransitionStart"),wn(vn,"onTransitionCancel"),wn(xn,"onTransitionEnd"),tt("onMouseEnter",["mouseout","mouseover"]),tt("onMouseLeave",["mouseout","mouseover"]),tt("onPointerEnter",["pointerout","pointerover"]),tt("onPointerLeave",["pointerout","pointerover"]),et("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),et("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),et("onBeforeInput",["compositionend","keypress","textInput","paste"]),et("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),et("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Mu=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Au));function Eu(e,t){t=0!==(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var o=n.length-1;0<=o;o--){var s=n[o],l=s.instance,c=s.currentTarget;if(s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Oo(u)}i.currentTarget=null,a=l}else for(o=0;o<n.length;o++){if(l=(s=n[o]).instance,c=s.currentTarget,s=s.listener,l!==a&&i.isPropagationStopped())break e;a=s,i.currentTarget=c;try{a(i)}catch(u){Oo(u)}i.currentTarget=null,a=l}}}}function Cu(e,t){var r=t[Ue];void 0===r&&(r=t[Ue]=new Set);var n=e+"__bubble";r.has(n)||(zu(t,e,2,!1),r.add(n))}function Pu(e,t,r){var n=0;t&&(n|=4),zu(r,e,n,t)}var Lu="_reactListening"+Math.random().toString(36).slice(2);function Iu(e){if(!e[Lu]){e[Lu]=!0,Je.forEach((function(t){"selectionchange"!==t&&(Mu.has(t)||Pu(t,!1,e),Pu(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Lu]||(t[Lu]=!0,Pu("selectionchange",!1,t))}}function zu(e,t,r,n){switch(Kh(t)){case 2:var i=Gh;break;case 8:i=Wh;break;default:i=$h}r=i.bind(null,t,r,e),i=void 0,!Ft||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Ou(e,t,r,n,i){var a=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var o=n.tag;if(3===o||4===o){var s=n.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===o)for(o=n.return;null!==o;){var l=o.tag;if((3===l||4===l)&&((l=o.stateNode.containerInfo)===i||8===l.nodeType&&l.parentNode===i))return;o=o.return}for(;null!==s;){if(null===(o=$e(s)))return;if(5===(l=o.tag)||6===l||26===l||27===l){n=a=o;continue e}s=s.parentNode}}n=n.return}Dt((function(){var n=a,i=Lt(r),o=[];e:{var s=bn.get(e);if(void 0!==s){var l=Jt,c=e;switch(e){case"keypress":if(0===Ht(r))break e;case"keydown":case"keyup":l=dr;break;case"focusin":c="focus",l=ir;break;case"focusout":c="blur",l=ir;break;case"beforeblur":case"afterblur":l=ir;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=nr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=mr;break;case dn:case fn:case mn:l=ar;break;case xn:l=gr;break;case"scroll":case"scrollend":l=er;break;case"wheel":l=yr;break;case"copy":case"cut":case"paste":l=or;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=fr;break;case"toggle":case"beforetoggle":l=vr}var u=0!==(4&t),h=!u&&("scroll"===e||"scrollend"===e),p=u?null!==s?s+"Capture":null:s;u=[];for(var d,f=n;null!==f;){var m=f;if(d=m.stateNode,5!==(m=m.tag)&&26!==m&&27!==m||null===d||null===p||null!=(m=jt(f,p))&&u.push(Ru(f,m,d)),h)break;f=f.return}0<u.length&&(s=new l(s,c,null,r,i),o.push({event:s,listeners:u}))}}if(0===(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||r===Pt||!(c=r.relatedTarget||r.fromElement)||!$e(c)&&!c[Ne])&&(l||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=n,null!==(c=(c=r.relatedTarget||r.toElement)?$e(c):null)&&(h=j(c),u=c.tag,c!==h||5!==u&&27!==u&&6!==u)&&(c=null)):(l=null,c=n),l!==c)){if(u=rr,m="onMouseLeave",p="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(u=fr,m="onPointerLeave",p="onPointerEnter",f="pointer"),h=null==l?s:Xe(l),d=null==c?s:Xe(c),(s=new u(m,f+"leave",l,r,i)).target=h,s.relatedTarget=d,m=null,$e(i)===n&&((u=new u(p,f+"enter",c,r,i)).target=d,u.relatedTarget=h,m=u),h=m,l&&c)e:{for(p=c,f=0,d=u=l;d;d=ju(d))f++;for(d=0,m=p;m;m=ju(m))d++;for(;0<f-d;)u=ju(u),f--;for(;0<d-f;)p=ju(p),d--;for(;f--;){if(u===p||null!==p&&u===p.alternate)break e;u=ju(u),p=ju(p)}u=null}else u=null;null!==l&&Fu(o,s,l,u,!1),null!==c&&null!==h&&Fu(o,h,c,u,!0)}if("select"===(l=(s=n?Xe(n):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var g=Dr;else if(Pr(s))if(jr)g=Wr;else{g=Hr;var y=qr}else!(l=s.nodeName)||"input"!==l.toLowerCase()||"checkbox"!==s.type&&"radio"!==s.type?n&&At(n.elementType)&&(g=Dr):g=Gr;switch(g&&(g=g(e,n))?Lr(o,g,r,i):(y&&y(e,s,n),"focusout"===e&&n&&"number"===s.type&&null!=n.memoizedProps.value&&vt(s,"number",s.value)),y=n?Xe(n):window,e){case"focusin":(Pr(y)||"true"===y.contentEditable)&&(rn=y,nn=n,an=null);break;case"focusout":an=nn=rn=null;break;case"mousedown":on=!0;break;case"contextmenu":case"mouseup":case"dragend":on=!1,sn(o,r,i);break;case"selectionchange":if(tn)break;case"keydown":case"keyup":sn(o,r,i)}var v;if(br)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Er?Ar(e,r)&&(x="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(x="onCompositionStart");x&&(kr&&"ko"!==r.locale&&(Er||"onCompositionStart"!==x?"onCompositionEnd"===x&&Er&&(v=qt()):(Ut="value"in(Nt=i)?Nt.value:Nt.textContent,Er=!0)),0<(y=Du(n,x)).length&&(x=new sr(x,e,null,r,i),o.push({event:x,listeners:y}),v?x.data=v:null!==(v=Mr(r))&&(x.data=v))),(v=wr?function(e,t){switch(e){case"compositionend":return Mr(t);case"keypress":return 32!==t.which?null:(Sr=!0,Tr);case"textInput":return(e=t.data)===Tr&&Sr?null:e;default:return null}}(e,r):function(e,t){if(Er)return"compositionend"===e||!br&&Ar(e,t)?(e=qt(),Vt=Ut=Nt=null,Er=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return kr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(x=Du(n,"onBeforeInput")).length&&(y=new sr("onBeforeInput","beforeinput",null,r,i),o.push({event:y,listeners:x}),y.data=v)),function(e,t,r,n,i){if("submit"===t&&r&&r.stateNode===i){var a=wu((i[Be]||null).action),o=n.submitter;o&&null!==(t=(t=o[Be]||null)?wu(t.formAction):o.getAttribute("formAction"))&&(a=t,o=null);var s=new Jt("action","action",null,n,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(0!==fu){var e=o?ku(i,o):new FormData(i);uo(r,{pending:!0,data:e,method:i.method,action:a},null,e)}}else"function"===typeof a&&(s.preventDefault(),e=o?ku(i,o):new FormData(i),uo(r,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}(o,e,n,r,i)}Eu(o,t)}))}function Ru(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Du(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,a=i.stateNode;5!==(i=i.tag)&&26!==i&&27!==i||null===a||(null!=(i=jt(e,r))&&n.unshift(Ru(e,i,a)),null!=(i=jt(e,t))&&n.push(Ru(e,i,a))),e=e.return}return n}function ju(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}function Fu(e,t,r,n,i){for(var a=t._reactName,o=[];null!==r&&r!==n;){var s=r,l=s.alternate,c=s.stateNode;if(s=s.tag,null!==l&&l===n)break;5!==s&&26!==s&&27!==s||null===c||(l=c,i?null!=(c=jt(r,a))&&o.unshift(Ru(r,c,l)):i||null!=(c=jt(r,a))&&o.push(Ru(r,c,l))),r=r.return}0!==o.length&&e.push({event:t,listeners:o})}var Bu=/\r\n?/g,Nu=/\u0000|\uFFFD/g;function Uu(e){return("string"===typeof e?e:""+e).replace(Bu,"\n").replace(Nu,"")}function Vu(e,t){return t=Uu(t),Uu(e)===t}function qu(){}function Hu(e,t,r,n,i,a){switch(r){case"children":"string"===typeof n?"body"===t||"textarea"===t&&""===n||wt(e,n):("number"===typeof n||"bigint"===typeof n)&&"body"!==t&&wt(e,""+n);break;case"className":st(e,"class",n);break;case"tabIndex":st(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":st(e,r,n);break;case"style":St(e,n,a);break;case"data":if("object"!==t){st(e,"data",n);break}case"src":case"href":if(""===n&&("a"!==t||"href"!==r)){e.removeAttribute(r);break}if(null==n||"function"===typeof n||"symbol"===typeof n||"boolean"===typeof n){e.removeAttribute(r);break}n=Ct(""+n),e.setAttribute(r,n);break;case"action":case"formAction":if("function"===typeof n){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof a&&("formAction"===r?("input"!==t&&Hu(e,t,"name",i.name,i,null),Hu(e,t,"formEncType",i.formEncType,i,null),Hu(e,t,"formMethod",i.formMethod,i,null),Hu(e,t,"formTarget",i.formTarget,i,null)):(Hu(e,t,"encType",i.encType,i,null),Hu(e,t,"method",i.method,i,null),Hu(e,t,"target",i.target,i,null))),null==n||"symbol"===typeof n||"boolean"===typeof n){e.removeAttribute(r);break}n=Ct(""+n),e.setAttribute(r,n);break;case"onClick":null!=n&&(e.onclick=qu);break;case"onScroll":null!=n&&Cu("scroll",e);break;case"onScrollEnd":null!=n&&Cu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(o(61));if(null!=(r=n.__html)){if(null!=i.children)throw Error(o(60));e.innerHTML=r}}break;case"multiple":e.multiple=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"muted":e.muted=n&&"function"!==typeof n&&"symbol"!==typeof n;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==n||"function"===typeof n||"boolean"===typeof n||"symbol"===typeof n){e.removeAttribute("xlink:href");break}r=Ct(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(r,""+n):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":!0===n?e.setAttribute(r,""):!1!==n&&null!=n&&"function"!==typeof n&&"symbol"!==typeof n?e.setAttribute(r,n):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":null!=n&&"function"!==typeof n&&"symbol"!==typeof n&&!isNaN(n)&&1<=n?e.setAttribute(r,n):e.removeAttribute(r);break;case"rowSpan":case"start":null==n||"function"===typeof n||"symbol"===typeof n||isNaN(n)?e.removeAttribute(r):e.setAttribute(r,n);break;case"popover":Cu("beforetoggle",e),Cu("toggle",e),ot(e,"popover",n);break;case"xlinkActuate":lt(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":lt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":lt(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":lt(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":lt(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":lt(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":lt(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":lt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":lt(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":ot(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<r.length)||"o"!==r[0]&&"O"!==r[0]||"n"!==r[1]&&"N"!==r[1])&&ot(e,r=Mt.get(r)||r,n)}}function Gu(e,t,r,n,i,a){switch(r){case"style":St(e,n,a);break;case"dangerouslySetInnerHTML":if(null!=n){if("object"!==typeof n||!("__html"in n))throw Error(o(61));if(null!=(r=n.__html)){if(null!=i.children)throw Error(o(60));e.innerHTML=r}}break;case"children":"string"===typeof n?wt(e,n):("number"===typeof n||"bigint"===typeof n)&&wt(e,""+n);break;case"onScroll":null!=n&&Cu("scroll",e);break;case"onScrollEnd":null!=n&&Cu("scrollend",e);break;case"onClick":null!=n&&(e.onclick=qu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Qe.hasOwnProperty(r)||("o"!==r[0]||"n"!==r[1]||(i=r.endsWith("Capture"),t=r.slice(2,i?r.length-7:void 0),"function"===typeof(a=null!=(a=e[Be]||null)?a[r]:null)&&e.removeEventListener(t,a,i),"function"!==typeof n)?r in e?e[r]=n:!0===n?e.setAttribute(r,""):ot(e,r,n):("function"!==typeof a&&null!==a&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(t,n,i)))}}function Wu(e,t,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Cu("error",e),Cu("load",e);var n,i=!1,a=!1;for(n in r)if(r.hasOwnProperty(n)){var s=r[n];if(null!=s)switch(n){case"src":i=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Hu(e,t,n,s,r,null)}}return a&&Hu(e,t,"srcSet",r.srcSet,r,null),void(i&&Hu(e,t,"src",r.src,r,null));case"input":Cu("invalid",e);var l=n=s=a=null,c=null,u=null;for(i in r)if(r.hasOwnProperty(i)){var h=r[i];if(null!=h)switch(i){case"name":a=h;break;case"type":s=h;break;case"checked":c=h;break;case"defaultChecked":u=h;break;case"value":n=h;break;case"defaultValue":l=h;break;case"children":case"dangerouslySetInnerHTML":if(null!=h)throw Error(o(137,t));break;default:Hu(e,t,i,h,r,null)}}return yt(e,n,l,c,u,s,a,!1),void ht(e);case"select":for(a in Cu("invalid",e),i=s=n=null,r)if(r.hasOwnProperty(a)&&null!=(l=r[a]))switch(a){case"value":n=l;break;case"defaultValue":s=l;break;case"multiple":i=l;default:Hu(e,t,a,l,r,null)}return t=n,r=s,e.multiple=!!i,void(null!=t?xt(e,!!i,t,!1):null!=r&&xt(e,!!i,r,!0));case"textarea":for(s in Cu("invalid",e),n=a=i=null,r)if(r.hasOwnProperty(s)&&null!=(l=r[s]))switch(s){case"value":i=l;break;case"defaultValue":a=l;break;case"children":n=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(o(91));break;default:Hu(e,t,s,l,r,null)}return _t(e,i,a,n),void ht(e);case"option":for(c in r)if(r.hasOwnProperty(c)&&null!=(i=r[c]))if("selected"===c)e.selected=i&&"function"!==typeof i&&"symbol"!==typeof i;else Hu(e,t,c,i,r,null);return;case"dialog":Cu("cancel",e),Cu("close",e);break;case"iframe":case"object":Cu("load",e);break;case"video":case"audio":for(i=0;i<Au.length;i++)Cu(Au[i],e);break;case"image":Cu("error",e),Cu("load",e);break;case"details":Cu("toggle",e);break;case"embed":case"source":case"link":Cu("error",e),Cu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in r)if(r.hasOwnProperty(u)&&null!=(i=r[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Hu(e,t,u,i,r,null)}return;default:if(At(t)){for(h in r)r.hasOwnProperty(h)&&(void 0!==(i=r[h])&&Gu(e,t,h,i,r,void 0));return}}for(l in r)r.hasOwnProperty(l)&&(null!=(i=r[l])&&Hu(e,t,l,i,r,null))}var $u=null,Zu=null;function Xu(e){return 9===e.nodeType?e:e.ownerDocument}function Yu(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ku(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function Ju(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Qu=null;var eh="function"===typeof setTimeout?setTimeout:void 0,th="function"===typeof clearTimeout?clearTimeout:void 0,rh="function"===typeof Promise?Promise:void 0,nh="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof rh?function(e){return rh.resolve(null).then(e).catch(ih)}:eh;function ih(e){setTimeout((function(){throw e}))}function ah(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void mp(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);mp(t)}function oh(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var r=t;switch(t=t.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":oh(r),We(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===r.rel.toLowerCase())continue}e.removeChild(r)}}function sh(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}function lh(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}function ch(e,t,r){switch(t=Xu(r),e){case"html":if(!(e=t.documentElement))throw Error(o(452));return e;case"head":if(!(e=t.head))throw Error(o(453));return e;case"body":if(!(e=t.body))throw Error(o(454));return e;default:throw Error(o(451))}}var uh=new Map,hh=new Set;function ph(e){return"function"===typeof e.getRootNode?e.getRootNode():e.ownerDocument}var dh=V.d;V.d={f:function(){var e=dh.f(),t=Fc();return e||t},r:function(e){var t=Ze(e);null!==t&&5===t.tag&&"form"===t.type?po(t):dh.r(e)},D:function(e){dh.D(e),mh("dns-prefetch",e,null)},C:function(e,t){dh.C(e,t),mh("preconnect",e,t)},L:function(e,t,r){dh.L(e,t,r);var n=fh;if(n&&e&&t){var i='link[rel="preload"][as="'+mt(t)+'"]';"image"===t&&r&&r.imageSrcSet?(i+='[imagesrcset="'+mt(r.imageSrcSet)+'"]',"string"===typeof r.imageSizes&&(i+='[imagesizes="'+mt(r.imageSizes)+'"]')):i+='[href="'+mt(e)+'"]';var a=i;switch(t){case"style":a=yh(e);break;case"script":a=bh(e)}uh.has(a)||(e=L({rel:"preload",href:"image"===t&&r&&r.imageSrcSet?void 0:e,as:t},r),uh.set(a,e),null!==n.querySelector(i)||"style"===t&&n.querySelector(vh(a))||"script"===t&&n.querySelector(_h(a))||(Wu(t=n.createElement("link"),"link",e),Ke(t),n.head.appendChild(t)))}},m:function(e,t){dh.m(e,t);var r=fh;if(r&&e){var n=t&&"string"===typeof t.as?t.as:"script",i='link[rel="modulepreload"][as="'+mt(n)+'"][href="'+mt(e)+'"]',a=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=bh(e)}if(!uh.has(a)&&(e=L({rel:"modulepreload",href:e},t),uh.set(a,e),null===r.querySelector(i))){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(_h(a)))return}Wu(n=r.createElement("link"),"link",e),Ke(n),r.head.appendChild(n)}}},X:function(e,t){dh.X(e,t);var r=fh;if(r&&e){var n=Ye(r).hoistableScripts,i=bh(e),a=n.get(i);a||((a=r.querySelector(_h(i)))||(e=L({src:e,async:!0},t),(t=uh.get(i))&&Sh(e,t),Ke(a=r.createElement("script")),Wu(a,"link",e),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}},S:function(e,t,r){dh.S(e,t,r);var n=fh;if(n&&e){var i=Ye(n).hoistableStyles,a=yh(e);t=t||"default";var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=n.querySelector(vh(a)))s.loading=5;else{e=L({rel:"stylesheet",href:e,"data-precedence":t},r),(r=uh.get(a))&&Th(e,r);var l=o=n.createElement("link");Ke(l),Wu(l,"link",e),l._p=new Promise((function(e,t){l.onload=e,l.onerror=t})),l.addEventListener("load",(function(){s.loading|=1})),l.addEventListener("error",(function(){s.loading|=2})),s.loading|=4,kh(o,t,n)}o={type:"stylesheet",instance:o,count:1,state:s},i.set(a,o)}}},M:function(e,t){dh.M(e,t);var r=fh;if(r&&e){var n=Ye(r).hoistableScripts,i=bh(e),a=n.get(i);a||((a=r.querySelector(_h(i)))||(e=L({src:e,async:!0,type:"module"},t),(t=uh.get(i))&&Sh(e,t),Ke(a=r.createElement("script")),Wu(a,"link",e),r.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},n.set(i,a))}}};var fh="undefined"===typeof document?null:document;function mh(e,t,r){var n=fh;if(n&&"string"===typeof t&&t){var i=mt(t);i='link[rel="'+e+'"][href="'+i+'"]',"string"===typeof r&&(i+='[crossorigin="'+r+'"]'),hh.has(i)||(hh.add(i),e={rel:e,crossOrigin:r,href:t},null===n.querySelector(i)&&(Wu(t=n.createElement("link"),"link",e),Ke(t),n.head.appendChild(t)))}}function gh(e,t,r,n){var i,a,s,l,c=(c=K.current)?ph(c):null;if(!c)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof r.precedence&&"string"===typeof r.href?(t=yh(r.href),(n=(r=Ye(c).hoistableStyles).get(t))||(n={type:"style",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===r.rel&&"string"===typeof r.href&&"string"===typeof r.precedence){e=yh(r.href);var u=Ye(c).hoistableStyles,h=u.get(e);if(h||(c=c.ownerDocument||c,h={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,h),(u=c.querySelector(vh(e)))&&!u._p&&(h.instance=u,h.state.loading=5),uh.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},uh.set(e,r),u||(i=c,a=e,s=r,l=h.state,i.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=i.createElement("link"),l.preload=a,a.addEventListener("load",(function(){return l.loading|=1})),a.addEventListener("error",(function(){return l.loading|=2})),Wu(a,"link",s),Ke(a),i.head.appendChild(a))))),t&&null===n)throw Error(o(528,""));return h}if(t&&null!==n)throw Error(o(529,""));return null;case"script":return t=r.async,"string"===typeof(r=r.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=bh(r),(n=(r=Ye(c).hoistableScripts).get(t))||(n={type:"script",instance:null,count:0,state:null},r.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function yh(e){return'href="'+mt(e)+'"'}function vh(e){return'link[rel="stylesheet"]['+e+"]"}function xh(e){return L({},e,{"data-precedence":e.precedence,precedence:null})}function bh(e){return'[src="'+mt(e)+'"]'}function _h(e){return"script[async]"+e}function wh(e,t,r){if(t.count++,null===t.instance)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+mt(r.href)+'"]');if(n)return t.instance=n,Ke(n),n;var i=L({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return Ke(n=(e.ownerDocument||e).createElement("style")),Wu(n,"style",i),kh(n,r.precedence,e),t.instance=n;case"stylesheet":i=yh(r.href);var a=e.querySelector(vh(i));if(a)return t.state.loading|=4,t.instance=a,Ke(a),a;n=xh(r),(i=uh.get(i))&&Th(n,i),Ke(a=(e.ownerDocument||e).createElement("link"));var s=a;return s._p=new Promise((function(e,t){s.onload=e,s.onerror=t})),Wu(a,"link",n),t.state.loading|=4,kh(a,r.precedence,e),t.instance=a;case"script":return a=bh(r.src),(i=e.querySelector(_h(a)))?(t.instance=i,Ke(i),i):(n=r,(i=uh.get(a))&&Sh(n=L({},r),i),Ke(i=(e=e.ownerDocument||e).createElement("script")),Wu(i,"link",n),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(n=t.instance,t.state.loading|=4,kh(n,r.precedence,e));return t.instance}function kh(e,t,r){for(var n=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,a=i,o=0;o<n.length;o++){var s=n[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===r.nodeType?r.head:r).insertBefore(e,t.firstChild)}function Th(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Sh(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Ah=null;function Mh(e,t,r){if(null===Ah){var n=new Map,i=Ah=new Map;i.set(r,n)}else(n=(i=Ah).get(r))||(n=new Map,i.set(r,n));if(n.has(e))return n;for(n.set(e,null),r=r.getElementsByTagName(e),i=0;i<r.length;i++){var a=r[i];if(!(a[Ge]||a[Fe]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var o=a.getAttribute(t)||"";o=e+o;var s=n.get(o);s?s.push(a):n.set(o,[a])}}return n}function Eh(e,t,r){(e=e.ownerDocument||e).head.insertBefore(r,"title"===t?e.querySelector("head > title"):null)}function Ch(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var Ph=null;function Lh(){}function Ih(){if(this.count--,0===this.count)if(this.stylesheets)Oh(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var zh=null;function Oh(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,zh=new Map,t.forEach(Rh,e),zh=null,Ih.call(e))}function Rh(e,t){if(!(4&t.state.loading)){var r=zh.get(e);if(r)var n=r.get(null);else{r=new Map,zh.set(e,r);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<i.length;a++){var o=i[a];"LINK"!==o.nodeName&&"not all"===o.getAttribute("media")||(r.set(o.dataset.precedence,o),n=o)}n&&r.set(null,n)}o=(i=t.instance).getAttribute("data-precedence"),(a=r.get(o)||n)===n&&r.set(null,i),r.set(o,i),this.count++,n=Ih.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),a?a.parentNode.insertBefore(i,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(i,e.firstChild),t.state.loading|=4}}var Dh={$$typeof:g,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function jh(e,t,r,n,i,a,o,s){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Le(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Le(0),this.hiddenUpdates=Le(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=s,this.incompleteTransitions=new Map}function Fh(e,t,r,n,i,a,o,s,l,c,u,h){return e=new jh(e,t,r,o,s,l,c,h),t=1,!0===a&&(t|=24),a=Rl(3,null,null,t),e.current=a,a.stateNode=e,(t=Ni()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:n,isDehydrated:r,cache:t},Cs(a),e}function Bh(e){return e?e=In:In}function Nh(e,t,r,n,i,a){i=Bh(i),null===n.context?n.context=i:n.pendingContext=i,(n=Ls(t)).payload={element:r},null!==(a=void 0===a?null:a)&&(n.callback=a),null!==(r=Is(e,n,t))&&(Ic(r,0,t),zs(r,e,t))}function Uh(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Vh(e,t){Uh(e,t),(e=e.alternate)&&Uh(e,t)}function qh(e){if(13===e.tag){var t=Cn(e,67108864);null!==t&&Ic(t,0,67108864),Vh(e,67108864)}}var Hh=!0;function Gh(e,t,r,n){var i=P.T;P.T=null;var a=V.p;try{V.p=2,$h(e,t,r,n)}finally{V.p=a,P.T=i}}function Wh(e,t,r,n){var i=P.T;P.T=null;var a=V.p;try{V.p=8,$h(e,t,r,n)}finally{V.p=a,P.T=i}}function $h(e,t,r,n){if(Hh){var i=Zh(n);if(null===i)Ou(e,t,n,Xh,r),op(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Qh=sp(Qh,e,t,r,n,i),!0;case"dragenter":return ep=sp(ep,e,t,r,n,i),!0;case"mouseover":return tp=sp(tp,e,t,r,n,i),!0;case"pointerover":var a=i.pointerId;return rp.set(a,sp(rp.get(a)||null,e,t,r,n,i)),!0;case"gotpointercapture":return a=i.pointerId,np.set(a,sp(np.get(a)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(op(e,n),4&t&&-1<ap.indexOf(e)){for(;null!==i;){var a=Ze(i);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var o=Se(a.pendingLanes);if(0!==o){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var l=1<<31-be(o);s.entanglements[1]|=l,o&=~l}mu(a),0===(6&ec)&&(bc=le()+500,gu(0,!1))}}break;case 13:null!==(s=Cn(a,2))&&Ic(s,0,2),Fc(),Vh(a,2)}if(null===(a=Zh(n))&&Ou(e,t,n,Xh,r),a===i)break;i=a}null!==i&&n.stopPropagation()}else Ou(e,t,n,null,r)}}function Zh(e){return Yh(e=Lt(e))}var Xh=null;function Yh(e){if(Xh=null,null!==(e=$e(e))){var t=j(e);if(null===t)e=null;else{var r=t.tag;if(13===r){if(null!==(e=F(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Xh=e,null}function Kh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ce()){case ue:return 2;case he:return 8;case pe:case de:return 32;case fe:return 268435456;default:return 32}default:return 32}}var Jh=!1,Qh=null,ep=null,tp=null,rp=new Map,np=new Map,ip=[],ap="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function op(e,t){switch(e){case"focusin":case"focusout":Qh=null;break;case"dragenter":case"dragleave":ep=null;break;case"mouseover":case"mouseout":tp=null;break;case"pointerover":case"pointerout":rp.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":np.delete(t.pointerId)}}function sp(e,t,r,n,i,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[i]},null!==t&&(null!==(t=Ze(t))&&qh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function lp(e){var t=$e(e.target);if(null!==t){var r=j(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=F(r)))return e.blockedOn=t,void function(e,t){var r=V.p;try{return V.p=e,t()}finally{V.p=r}}(e.priority,(function(){if(13===r.tag){var e=Pc(),t=Cn(r,e);null!==t&&Ic(t,0,e),Vh(r,e)}}))}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function cp(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Zh(e.nativeEvent);if(null!==r)return null!==(t=Ze(r))&&qh(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);Pt=n,r.target.dispatchEvent(n),Pt=null,t.shift()}return!0}function up(e,t,r){cp(e)&&r.delete(t)}function hp(){Jh=!1,null!==Qh&&cp(Qh)&&(Qh=null),null!==ep&&cp(ep)&&(ep=null),null!==tp&&cp(tp)&&(tp=null),rp.forEach(up),np.forEach(up)}function pp(e,t){e.blockedOn===t&&(e.blockedOn=null,Jh||(Jh=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,hp)))}var dp=null;function fp(e){dp!==e&&(dp=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,(function(){dp===e&&(dp=null);for(var t=0;t<e.length;t+=3){var r=e[t],n=e[t+1],i=e[t+2];if("function"!==typeof n){if(null===Yh(n||r))continue;break}var a=Ze(r);null!==a&&(e.splice(t,3),t-=3,uo(a,{pending:!0,data:i,method:r.method,action:n},n,i))}})))}function mp(e){function t(t){return pp(t,e)}null!==Qh&&pp(Qh,e),null!==ep&&pp(ep,e),null!==tp&&pp(tp,e),rp.forEach(t),np.forEach(t);for(var r=0;r<ip.length;r++){var n=ip[r];n.blockedOn===e&&(n.blockedOn=null)}for(;0<ip.length&&null===(r=ip[0]).blockedOn;)lp(r),null===r.blockedOn&&ip.shift();if(null!=(r=(e.ownerDocument||e).$$reactFormReplay))for(n=0;n<r.length;n+=3){var i=r[n],a=r[n+1],o=i[Be]||null;if("function"===typeof a)o||fp(r);else if(o){var s=null;if(a&&a.hasAttribute("formAction")){if(i=a,o=a[Be]||null)s=o.formAction;else if(null!==Yh(i))continue}else s=o.action;"function"===typeof s?r[n+1]=s:(r.splice(n,3),n-=3),fp(r)}}}function gp(e){this._internalRoot=e}function yp(e){this._internalRoot=e}yp.prototype.render=gp.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Nh(t.current,Pc(),e,t,null,null)},yp.prototype.unmount=gp.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;0===e.tag&&tu(),Nh(e.current,2,null,e,null,null),Fc(),t[Ne]=null}},yp.prototype.unstable_scheduleHydration=function(e){if(e){var t=De();e={blockedOn:null,target:e,priority:t};for(var r=0;r<ip.length&&0!==t&&t<ip[r].priority;r++);ip.splice(r,0,e),0===r&&lp(e)}};var vp=i.version;if("19.0.0"!==vp)throw Error(o(527,vp,"19.0.0"));V.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=j(e)))throw Error(o(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return B(i),e;if(a===n)return B(i),t;a=a.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,n=a;break}if(l===n){s=!0,n=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,n=i;break}if(l===n){s=!0,n=a,r=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?e:t}(t),e=null===(e=null!==e?N(e):null)?null:e.stateNode};var xp={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:P,findFiberByHostInstance:$e,reconcilerVersion:"19.0.0"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var bp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bp.isDisabled&&bp.supportsFiber)try{ye=bp.inject(xp),ve=bp}catch(wp){}}t.createRoot=function(e,t){if(!s(e))throw Error(o(299));var r=!1,n="",i=Ro,a=Do,l=jo;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onUncaughtError&&(i=t.onUncaughtError),void 0!==t.onCaughtError&&(a=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=Fh(e,1,!1,null,0,r,n,i,a,l,0,null),e[Ne]=t.current,Iu(8===e.nodeType?e.parentNode:e),new gp(t)},t.hydrateRoot=function(e,t,r){if(!s(e))throw Error(o(299));var n=!1,i="",a=Ro,l=Do,c=jo,u=null;return null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(n=!0),void 0!==r.identifierPrefix&&(i=r.identifierPrefix),void 0!==r.onUncaughtError&&(a=r.onUncaughtError),void 0!==r.onCaughtError&&(l=r.onCaughtError),void 0!==r.onRecoverableError&&(c=r.onRecoverableError),void 0!==r.unstable_transitionCallbacks&&r.unstable_transitionCallbacks,void 0!==r.formState&&(u=r.formState)),(t=Fh(e,1,!0,t,0,n,i,a,l,c,0,u)).context=Bh(null),r=t.current,(i=Ls(n=Pc())).callback=null,Is(r,i,n),t.current.lanes=n,Ie(t,n),mu(t),e[Ne]=t.current,Iu(e),new yp(t)},t.version="19.0.0"},43:(e,t,r)=>{"use strict";e.exports=r(288)},96:function(e){var t,r;t="undefined"!==typeof self?self:this,r=()=>{"use strict";var e=(()=>{var e=Object.create,t=Object.defineProperty,r=Object.defineProperties,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyDescriptors,a=Object.getOwnPropertyNames,o=Object.getOwnPropertySymbols,s=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(e,r,n)=>r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,h=(e,t)=>function(){return e&&(t=(0,e[a(e)[0]])(e=0)),t},p=(e,t)=>function(){return t||(0,e[a(e)[0]])((t={exports:{}}).exports,t),t.exports},d=(e,r)=>{for(var n in r)t(e,n,{get:r[n],enumerable:!0})},f=(e,r,i,o)=>{if(r&&"object"===typeof r||"function"===typeof r)for(let s of a(r))l.call(e,s)||s===i||t(e,s,{get:()=>r[s],enumerable:!(o=n(r,s))||o.enumerable});return e},m=e=>f(t({},"__esModule",{value:!0}),e),g=p({"src/version.js"(e){e.version="3.0.1"}}),y=p({"node_modules/native-promise-only/lib/npo.src.js"(e,t){var r,n,i;r="Promise",n="undefined"!=typeof window?window:e,i=function(){var e,t,r,n=Object.prototype.toString,i="undefined"!=typeof setImmediate?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,r,n){return Object.defineProperty(e,t,{value:r,writable:!0,configurable:!1!==n})}}catch(g){e=function(e,t,r){return e[t]=r,e}}function a(e,n){r.add(e,n),t||(t=i(r.drain))}function o(e){var t,r=typeof e;return null==e||"object"!=r&&"function"!=r||(t=e.then),"function"==typeof t&&t}function s(){for(var e=0;e<this.chain.length;e++)l(this,1===this.state?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}function l(e,t,r){var n,i;try{!1===t?r.reject(e.msg):(n=!0===t?e.msg:t.call(void 0,e.msg))===r.promise?r.reject(TypeError("Promise-chain cycle")):(i=o(n))?i.call(n,r.resolve,r.reject):r.resolve(n)}catch(g){r.reject(g)}}function c(e){var t,r=this;if(!r.triggered){r.triggered=!0,r.def&&(r=r.def);try{(t=o(e))?a((function(){var n=new p(r);try{t.call(e,(function(){c.apply(n,arguments)}),(function(){u.apply(n,arguments)}))}catch(g){u.call(n,g)}})):(r.msg=e,r.state=1,r.chain.length>0&&a(s,r))}catch(g){u.call(new p(r),g)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function h(e,t,r,n){for(var i=0;i<t.length;i++)!function(i){e.resolve(t[i]).then((function(e){r(i,e)}),n)}(i)}function p(e){this.def=e,this.triggered=!1}function d(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function f(e){if("function"!=typeof e)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var t=new d(this);this.then=function(e,r){var n={success:"function"!=typeof e||e,failure:"function"==typeof r&&r};return n.promise=new this.constructor((function(e,t){if("function"!=typeof e||"function"!=typeof t)throw TypeError("Not a function");n.resolve=e,n.reject=t})),t.chain.push(n),0!==t.state&&a(s,t),n.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,(function(e){c.call(t,e)}),(function(e){u.call(t,e)}))}catch(g){u.call(t,g)}}r=function(){var e,r,n;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){n=new i(t,a),r?r.next=n:e=n,r=n,n=void 0},drain:function(){var n=e;for(e=r=t=void 0;n;)n.fn.call(n.self),n=n.next}}}();var m=e({},"constructor",f,!1);return f.prototype=m,e(m,"__NPO__",0,!1),e(f,"resolve",(function(e){return e&&"object"==typeof e&&1===e.__NPO__?e:new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");t(e)}))})),e(f,"reject",(function(e){return new this((function(t,r){if("function"!=typeof t||"function"!=typeof r)throw TypeError("Not a function");r(e)}))})),e(f,"all",(function(e){var t=this;return"[object Array]"!=n.call(e)?t.reject(TypeError("Not an array")):0===e.length?t.resolve([]):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");var i=e.length,a=Array(i),o=0;h(t,e,(function(e,t){a[e]=t,++o===i&&r(a)}),n)}))})),e(f,"race",(function(e){var t=this;return"[object Array]"!=n.call(e)?t.reject(TypeError("Not an array")):new t((function(r,n){if("function"!=typeof r||"function"!=typeof n)throw TypeError("Not a function");h(t,e,(function(e,t){r(t)}),n)}))})),f},n[r]=n[r]||i(),"undefined"!=typeof t&&t.exports&&(t.exports=n[r])}}),v=p({"node_modules/@plotly/d3/d3.js"(e,t){(function(){var e={version:"3.8.2"},r=[].slice,n=function(e){return r.call(e)},i=self.document;function a(e){return e&&(e.ownerDocument||e.document||e).documentElement}function o(e){return e&&(e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView)}if(i)try{n(i.documentElement.childNodes)[0].nodeType}catch(ha){n=function(e){for(var t=e.length,r=new Array(t);t--;)r[t]=e[t];return r}}if(Date.now||(Date.now=function(){return+new Date}),i)try{i.createElement("DIV").style.setProperty("opacity",0,"")}catch(pa){var s=this.Element.prototype,l=s.setAttribute,c=s.setAttributeNS,u=this.CSSStyleDeclaration.prototype,h=u.setProperty;s.setAttribute=function(e,t){l.call(this,e,t+"")},s.setAttributeNS=function(e,t,r){c.call(this,e,t,r+"")},u.setProperty=function(e,t,r){h.call(this,e,t+"",r)}}function p(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function d(e){return null===e?NaN:+e}function f(e){return!isNaN(e)}function m(e){return{left:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(arguments.length<3&&(n=0),arguments.length<4&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}e.ascending=p,e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.min=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=e[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=e[i])&&r>n&&(r=n)}else{for(;++i<a;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=t.call(e,e[i],i))&&r>n&&(r=n)}return r},e.max=function(e,t){var r,n,i=-1,a=e.length;if(1===arguments.length){for(;++i<a;)if(null!=(n=e[i])&&n>=n){r=n;break}for(;++i<a;)null!=(n=e[i])&&n>r&&(r=n)}else{for(;++i<a;)if(null!=(n=t.call(e,e[i],i))&&n>=n){r=n;break}for(;++i<a;)null!=(n=t.call(e,e[i],i))&&n>r&&(r=n)}return r},e.extent=function(e,t){var r,n,i,a=-1,o=e.length;if(1===arguments.length){for(;++a<o;)if(null!=(n=e[a])&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=e[a])&&(r>n&&(r=n),i<n&&(i=n))}else{for(;++a<o;)if(null!=(n=t.call(e,e[a],a))&&n>=n){r=i=n;break}for(;++a<o;)null!=(n=t.call(e,e[a],a))&&(r>n&&(r=n),i<n&&(i=n))}return[r,i]},e.sum=function(e,t){var r,n=0,i=e.length,a=-1;if(1===arguments.length)for(;++a<i;)f(r=+e[a])&&(n+=r);else for(;++a<i;)f(r=+t.call(e,e[a],a))&&(n+=r);return n},e.mean=function(e,t){var r,n=0,i=e.length,a=-1,o=i;if(1===arguments.length)for(;++a<i;)f(r=d(e[a]))?n+=r:--o;else for(;++a<i;)f(r=d(t.call(e,e[a],a)))?n+=r:--o;if(o)return n/o},e.quantile=function(e,t){var r=(e.length-1)*t+1,n=Math.floor(r),i=+e[n-1],a=r-n;return a?i+a*(e[n]-i):i},e.median=function(t,r){var n,i=[],a=t.length,o=-1;if(1===arguments.length)for(;++o<a;)f(n=d(t[o]))&&i.push(n);else for(;++o<a;)f(n=d(r.call(t,t[o],o)))&&i.push(n);if(i.length)return e.quantile(i.sort(p),.5)},e.variance=function(e,t){var r,n,i=e.length,a=0,o=0,s=-1,l=0;if(1===arguments.length)for(;++s<i;)f(r=d(e[s]))&&(o+=(n=r-a)*(r-(a+=n/++l)));else for(;++s<i;)f(r=d(t.call(e,e[s],s)))&&(o+=(n=r-a)*(r-(a+=n/++l)));if(l>1)return o/(l-1)},e.deviation=function(){var t=e.variance.apply(this,arguments);return t?Math.sqrt(t):t};var g=m(p);function y(e){return e.length}e.bisectLeft=g.left,e.bisect=e.bisectRight=g.right,e.bisector=function(e){return m(1===e.length?function(t,r){return p(e(t),r)}:e)},e.shuffle=function(e,t,r){(a=arguments.length)<3&&(r=e.length,a<2&&(t=0));for(var n,i,a=r-t;a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.pairs=function(e){for(var t=0,r=e.length-1,n=e[0],i=new Array(r<0?0:r);t<r;)i[t]=[n,n=e[++t]];return i},e.transpose=function(t){if(!(a=t.length))return[];for(var r=-1,n=e.min(t,y),i=new Array(n);++r<n;)for(var a,o=-1,s=i[r]=new Array(a);++o<a;)s[o]=t[o][r];return i},e.zip=function(){return e.transpose(arguments)},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},e.merge=function(e){for(var t,r,n,i=e.length,a=-1,o=0;++a<i;)o+=e[a].length;for(r=new Array(o);--i>=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r};var v=Math.abs;function x(e,t){for(var r in t)Object.defineProperty(e.prototype,r,{value:t[r],enumerable:!1})}function b(){this._=Object.create(null)}function _(e){return"__proto__"===(e+="")||"\0"===e[0]?"\0"+e:e}function w(e){return"\0"===(e+="")[0]?e.slice(1):e}function k(e){return _(e)in this._}function T(e){return(e=_(e))in this._&&delete this._[e]}function S(){var e=[];for(var t in this._)e.push(w(t));return e}function A(){var e=0;for(var t in this._)++e;return e}function M(){for(var e in this._)return!1;return!0}function E(){this._=Object.create(null)}function C(e){return e}function P(e,t,r){return function(){var n=r.apply(t,arguments);return n===t?e:n}}function L(e,t){if(t in e)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var r=0,n=I.length;r<n;++r){var i=I[r]+t;if(i in e)return i}}e.range=function(e,t,r){if(arguments.length<3&&(r=1,arguments.length<2&&(t=e,e=0)),(t-e)/r===1/0)throw new Error("infinite range");var n,i=[],a=function(e){for(var t=1;e*t%1;)t*=10;return t}(v(r)),o=-1;if(e*=a,t*=a,(r*=a)<0)for(;(n=e+r*++o)>t;)i.push(n/a);else for(;(n=e+r*++o)<t;)i.push(n/a);return i},e.map=function(e,t){var r=new b;if(e instanceof b)e.forEach((function(e,t){r.set(e,t)}));else if(Array.isArray(e)){var n,i=-1,a=e.length;if(1===arguments.length)for(;++i<a;)r.set(i,e[i]);else for(;++i<a;)r.set(t.call(e,n=e[i],i),n)}else for(var o in e)r.set(o,e[o]);return r},x(b,{has:k,get:function(e){return this._[_(e)]},set:function(e,t){return this._[_(e)]=t},remove:T,keys:S,values:function(){var e=[];for(var t in this._)e.push(this._[t]);return e},entries:function(){var e=[];for(var t in this._)e.push({key:w(t),value:this._[t]});return e},size:A,empty:M,forEach:function(e){for(var t in this._)e.call(this,w(t),this._[t])}}),e.nest=function(){var t,r,n={},i=[],a=[];function o(e,a,s){if(s>=i.length)return r?r.call(n,a):t?a.sort(t):a;for(var l,c,u,h,p=-1,d=a.length,f=i[s++],m=new b;++p<d;)(h=m.get(l=f(c=a[p])))?h.push(c):m.set(l,[c]);return e?(c=e(),u=function(t,r){c.set(t,o(e,r,s))}):(c={},u=function(t,r){c[t]=o(e,r,s)}),m.forEach(u),c}function s(e,t){if(t>=i.length)return e;var r=[],n=a[t++];return e.forEach((function(e,n){r.push({key:e,values:s(n,t)})})),n?r.sort((function(e,t){return n(e.key,t.key)})):r}return n.map=function(e,t){return o(t,e,0)},n.entries=function(t){return s(o(e.map,t,0),0)},n.key=function(e){return i.push(e),n},n.sortKeys=function(e){return a[i.length-1]=e,n},n.sortValues=function(e){return t=e,n},n.rollup=function(e){return r=e,n},n},e.set=function(e){var t=new E;if(e)for(var r=0,n=e.length;r<n;++r)t.add(e[r]);return t},x(E,{has:k,add:function(e){return this._[_(e+="")]=!0,e},remove:T,values:S,size:A,empty:M,forEach:function(e){for(var t in this._)e.call(this,w(t))}}),e.behavior={},e.rebind=function(e,t){for(var r,n=1,i=arguments.length;++n<i;)e[r=arguments[n]]=P(e,t,t[r]);return e};var I=["webkit","ms","moz","Moz","o","O"];function z(){}function O(){}function R(e){var t=[],r=new b;function n(){for(var r,n=t,i=-1,a=n.length;++i<a;)(r=n[i].on)&&r.apply(this,arguments);return e}return n.on=function(n,i){var a,o=r.get(n);return arguments.length<2?o&&o.on:(o&&(o.on=null,t=t.slice(0,a=t.indexOf(o)).concat(t.slice(a+1)),r.remove(n)),i&&t.push(r.set(n,{on:i})),e)},n}function D(){e.event.preventDefault()}function j(){for(var t,r=e.event;t=r.sourceEvent;)r=t;return r}function F(t){for(var r=new O,n=0,i=arguments.length;++n<i;)r[arguments[n]]=R(r);return r.of=function(n,i){return function(a){try{var o=a.sourceEvent=e.event;a.target=t,e.event=a,r[a.type].apply(n,i)}finally{e.event=o}}},r}e.dispatch=function(){for(var e=new O,t=-1,r=arguments.length;++t<r;)e[arguments[t]]=R(e);return e},O.prototype.on=function(e,t){var r=e.indexOf("."),n="";if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e)return arguments.length<2?this[e].on(n):this[e].on(n,t);if(2===arguments.length){if(null==t)for(e in this)this.hasOwnProperty(e)&&this[e].on(n,null);return this}},e.event=null,e.requote=function(e){return e.replace(B,"\\$&")};var B=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,N={}.__proto__?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)e[r]=t[r]};function U(e){return N(e,G),e}var V=function(e,t){return t.querySelector(e)},q=function(e,t){return t.querySelectorAll(e)},H=function(e,t){var r=e.matches||e[L(e,"matchesSelector")];return(H=function(e,t){return r.call(e,t)})(e,t)};"function"===typeof Sizzle&&(V=function(e,t){return Sizzle(e,t)[0]||null},q=Sizzle,H=Sizzle.matchesSelector),e.selection=function(){return e.select(i.documentElement)};var G=e.selection.prototype=[];function W(e){return"function"===typeof e?e:function(){return V(e,this)}}function $(e){return"function"===typeof e?e:function(){return q(e,this)}}G.select=function(e){var t,r,n,i,a=[];e=W(e);for(var o=-1,s=this.length;++o<s;){a.push(t=[]),t.parentNode=(n=this[o]).parentNode;for(var l=-1,c=n.length;++l<c;)(i=n[l])?(t.push(r=e.call(i,i.__data__,l,o)),r&&"__data__"in i&&(r.__data__=i.__data__)):t.push(null)}return U(a)},G.selectAll=function(e){var t,r,i=[];e=$(e);for(var a=-1,o=this.length;++a<o;)for(var s=this[a],l=-1,c=s.length;++l<c;)(r=s[l])&&(i.push(t=n(e.call(r,r.__data__,l,a))),t.parentNode=r);return U(i)};var Z="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Z,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Y(t,r){return t=e.ns.qualify(t),null==r?t.local?function(){this.removeAttributeNS(t.space,t.local)}:function(){this.removeAttribute(t)}:"function"===typeof r?t.local?function(){var e=r.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}:function(){var e=r.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}:t.local?function(){this.setAttributeNS(t.space,t.local,r)}:function(){this.setAttribute(t,r)}}function K(e){return e.trim().replace(/\s+/g," ")}function J(t){return new RegExp("(?:^|\\s+)"+e.requote(t)+"(?:\\s+|$)","g")}function Q(e){return(e+"").trim().split(/^|\s+/)}function ee(e,t){var r=(e=Q(e).map(te)).length;return"function"===typeof t?function(){for(var n=-1,i=t.apply(this,arguments);++n<r;)e[n](this,i)}:function(){for(var n=-1;++n<r;)e[n](this,t)}}function te(e){var t=J(e);return function(r,n){if(i=r.classList)return n?i.add(e):i.remove(e);var i=r.getAttribute("class")||"";n?(t.lastIndex=0,t.test(i)||r.setAttribute("class",K(i+" "+e))):r.setAttribute("class",K(i.replace(t," ")))}}function re(e,t,r){return null==t?function(){this.style.removeProperty(e)}:"function"===typeof t?function(){var n=t.apply(this,arguments);null==n?this.style.removeProperty(e):this.style.setProperty(e,n,r)}:function(){this.style.setProperty(e,t,r)}}function ne(e,t){return null==t?function(){delete this[e]}:"function"===typeof t?function(){var r=t.apply(this,arguments);null==r?delete this[e]:this[e]=r}:function(){this[e]=t}}function ie(t){return"function"===typeof t?t:(t=e.ns.qualify(t)).local?function(){return this.ownerDocument.createElementNS(t.space,t.local)}:function(){var e=this.ownerDocument,r=this.namespaceURI;return r===Z&&e.documentElement.namespaceURI===Z?e.createElement(t):e.createElementNS(r,t)}}function ae(){var e=this.parentNode;e&&e.removeChild(this)}function oe(e){return{__data__:e}}function se(e){return function(){return H(this,e)}}function le(e){return arguments.length||(e=p),function(t,r){return t&&r?e(t.__data__,r.__data__):!t-!r}}function ce(e,t){for(var r=0,n=e.length;r<n;r++)for(var i,a=e[r],o=0,s=a.length;o<s;o++)(i=a[o])&&t(i,o,r);return e}function ue(e){return N(e,he),e}e.ns={prefix:X,qualify:function(e){var t=e.indexOf(":"),r=e;return t>=0&&"xmlns"!==(r=e.slice(0,t))&&(e=e.slice(t+1)),X.hasOwnProperty(r)?{space:X[r],local:e}:e}},G.attr=function(t,r){if(arguments.length<2){if("string"===typeof t){var n=this.node();return(t=e.ns.qualify(t)).local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(r in t)this.each(Y(r,t[r]));return this}return this.each(Y(t,r))},G.classed=function(e,t){if(arguments.length<2){if("string"===typeof e){var r=this.node(),n=(e=Q(e)).length,i=-1;if(t=r.classList){for(;++i<n;)if(!t.contains(e[i]))return!1}else for(t=r.getAttribute("class");++i<n;)if(!J(e[i]).test(t))return!1;return!0}for(t in e)this.each(ee(t,e[t]));return this}return this.each(ee(e,t))},G.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!==typeof e){for(r in n<2&&(t=""),e)this.each(re(r,e[r],t));return this}if(n<2){var i=this.node();return o(i).getComputedStyle(i,null).getPropertyValue(e)}r=""}return this.each(re(e,t,r))},G.property=function(e,t){if(arguments.length<2){if("string"===typeof e)return this.node()[e];for(t in e)this.each(ne(t,e[t]));return this}return this.each(ne(e,t))},G.text=function(e){return arguments.length?this.each("function"===typeof e?function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}:null==e?function(){this.textContent=""}:function(){this.textContent=e}):this.node().textContent},G.html=function(e){return arguments.length?this.each("function"===typeof e?function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}:null==e?function(){this.innerHTML=""}:function(){this.innerHTML=e}):this.node().innerHTML},G.append=function(e){return e=ie(e),this.select((function(){return this.appendChild(e.apply(this,arguments))}))},G.insert=function(e,t){return e=ie(e),t=W(t),this.select((function(){return this.insertBefore(e.apply(this,arguments),t.apply(this,arguments)||null)}))},G.remove=function(){return this.each(ae)},G.data=function(e,t){var r,n,i=-1,a=this.length;if(!arguments.length){for(e=new Array(a=(r=this[0]).length);++i<a;)(n=r[i])&&(e[i]=n.__data__);return e}function o(e,r){var n,i,a,o=e.length,u=r.length,h=Math.min(o,u),p=new Array(u),d=new Array(u),f=new Array(o);if(t){var m,g=new b,y=new Array(o);for(n=-1;++n<o;)(i=e[n])&&(g.has(m=t.call(i,i.__data__,n))?f[n]=i:g.set(m,i),y[n]=m);for(n=-1;++n<u;)(i=g.get(m=t.call(r,a=r[n],n)))?!0!==i&&(p[n]=i,i.__data__=a):d[n]=oe(a),g.set(m,!0);for(n=-1;++n<o;)n in y&&!0!==g.get(y[n])&&(f[n]=e[n])}else{for(n=-1;++n<h;)i=e[n],a=r[n],i?(i.__data__=a,p[n]=i):d[n]=oe(a);for(;n<u;++n)d[n]=oe(r[n]);for(;n<o;++n)f[n]=e[n]}d.update=p,d.parentNode=p.parentNode=f.parentNode=e.parentNode,s.push(d),l.push(p),c.push(f)}var s=ue([]),l=U([]),c=U([]);if("function"===typeof e)for(;++i<a;)o(r=this[i],e.call(r,r.parentNode.__data__,i));else for(;++i<a;)o(r=this[i],e);return l.enter=function(){return s},l.exit=function(){return c},l},G.datum=function(e){return arguments.length?this.property("__data__",e):this.property("__data__")},G.filter=function(e){var t,r,n,i=[];"function"!==typeof e&&(e=se(e));for(var a=0,o=this.length;a<o;a++){i.push(t=[]),t.parentNode=(r=this[a]).parentNode;for(var s=0,l=r.length;s<l;s++)(n=r[s])&&e.call(n,n.__data__,s,a)&&t.push(n)}return U(i)},G.order=function(){for(var e=-1,t=this.length;++e<t;)for(var r,n=this[e],i=n.length-1,a=n[i];--i>=0;)(r=n[i])&&(a&&a!==r.nextSibling&&a.parentNode.insertBefore(r,a),a=r);return this},G.sort=function(e){e=le.apply(this,arguments);for(var t=-1,r=this.length;++t<r;)this[t].sort(e);return this.order()},G.each=function(e){return ce(this,(function(t,r,n){e.call(t,t.__data__,r,n)}))},G.call=function(e){var t=n(arguments);return e.apply(t[0]=this,t),this},G.empty=function(){return!this.node()},G.node=function(){for(var e=0,t=this.length;e<t;e++)for(var r=this[e],n=0,i=r.length;n<i;n++){var a=r[n];if(a)return a}return null},G.size=function(){var e=0;return ce(this,(function(){++e})),e};var he=[];function pe(t,r,i){var a="__on"+t,o=t.indexOf("."),s=fe;o>0&&(t=t.slice(0,o));var l=de.get(t);function c(){var e=this[a];e&&(this.removeEventListener(t,e,e.$),delete this[a])}return l&&(t=l,s=me),o?r?function(){var e=s(r,n(arguments));c.call(this),this.addEventListener(t,this[a]=e,e.$=i),e._=r}:c:r?z:function(){var r,n=new RegExp("^__on([^.]+)"+e.requote(t)+"$");for(var i in this)if(r=i.match(n)){var a=this[i];this.removeEventListener(r[1],a,a.$),delete this[i]}}}e.selection.enter=ue,e.selection.enter.prototype=he,he.append=G.append,he.empty=G.empty,he.node=G.node,he.call=G.call,he.size=G.size,he.select=function(e){for(var t,r,n,i,a,o=[],s=-1,l=this.length;++s<l;){n=(i=this[s]).update,o.push(t=[]),t.parentNode=i.parentNode;for(var c=-1,u=i.length;++c<u;)(a=i[c])?(t.push(n[c]=r=e.call(i.parentNode,a.__data__,c,s)),r.__data__=a.__data__):t.push(null)}return U(o)},he.insert=function(e,t){return arguments.length<2&&(t=function(e){var t,r;return function(n,i,a){var o,s=e[a].update,l=s.length;for(a!=r&&(r=a,t=0),i>=t&&(t=i+1);!(o=s[t])&&++t<l;);return o}}(this)),G.insert.call(this,e,t)},e.select=function(e){var t;return"string"===typeof e?(t=[V(e,i)]).parentNode=i.documentElement:(t=[e]).parentNode=a(e),U([t])},e.selectAll=function(e){var t;return"string"===typeof e?(t=n(q(e,i))).parentNode=i.documentElement:(t=n(e)).parentNode=null,U([t])},G.on=function(e,t,r){var n=arguments.length;if(n<3){if("string"!==typeof e){for(r in n<2&&(t=!1),e)this.each(pe(r,e[r],t));return this}if(n<2)return(n=this.node()["__on"+e])&&n._;r=!1}return this.each(pe(e,t,r))};var de=e.map({mouseenter:"mouseover",mouseleave:"mouseout"});function fe(t,r){return function(n){var i=e.event;e.event=n,r[0]=this.__data__;try{t.apply(this,r)}finally{e.event=i}}}function me(e,t){var r=fe(e,t);return function(e){var t=this,n=e.relatedTarget;n&&(n===t||8&n.compareDocumentPosition(t))||r.call(t,e)}}i&&de.forEach((function(e){"on"+e in i&&de.remove(e)}));var ge,ye=0;function ve(t){var r=".dragsuppress-"+ ++ye,n="click"+r,i=e.select(o(t)).on("touchmove"+r,D).on("dragstart"+r,D).on("selectstart"+r,D);if(null==ge&&(ge=!("onselectstart"in t)&&L(t.style,"userSelect")),ge){var s=a(t).style,l=s[ge];s[ge]="none"}return function(e){if(i.on(r,null),ge&&(s[ge]=l),e){var t=function(){i.on(n,null)};i.on(n,(function(){D(),t()}),!0),setTimeout(t,0)}}}e.mouse=function(e){return be(e,j())};var xe=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;function be(t,r){r.changedTouches&&(r=r.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(xe<0){var a=o(t);if(a.scrollX||a.scrollY){var s=(n=e.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();xe=!(s.f||s.e),n.remove()}}return xe?(i.x=r.pageX,i.y=r.pageY):(i.x=r.clientX,i.y=r.clientY),[(i=i.matrixTransform(t.getScreenCTM().inverse())).x,i.y]}var l=t.getBoundingClientRect();return[r.clientX-l.left-t.clientLeft,r.clientY-l.top-t.clientTop]}function _e(){return e.event.changedTouches[0].identifier}e.touch=function(e,t,r){if(arguments.length<3&&(r=t,t=j().changedTouches),t)for(var n,i=0,a=t.length;i<a;++i)if((n=t[i]).identifier===r)return be(e,n)},e.behavior.drag=function(){var t=F(a,"drag","dragstart","dragend"),r=null,n=s(z,e.mouse,o,"mousemove","mouseup"),i=s(_e,e.touch,C,"touchmove","touchend");function a(){this.on("mousedown.drag",n).on("touchstart.drag",i)}function s(n,i,a,o,s){return function(){var l,c=this,u=e.event.target.correspondingElement||e.event.target,h=c.parentNode,p=t.of(c,arguments),d=0,f=n(),m=".drag"+(null==f?"":"-"+f),g=e.select(a(u)).on(o+m,(function(){var e,t,r=i(h,f);r&&(e=r[0]-v[0],t=r[1]-v[1],d|=e|t,v=r,p({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:e,dy:t}))})).on(s+m,(function(){i(h,f)&&(g.on(o+m,null).on(s+m,null),y(d),p({type:"dragend"}))})),y=ve(u),v=i(h,f);l=r?[(l=r.apply(c,arguments)).x-v[0],l.y-v[1]]:[0,0],p({type:"dragstart"})}}return a.origin=function(e){return arguments.length?(r=e,a):r},e.rebind(a,t,"on")},e.touches=function(e,t){return arguments.length<2&&(t=j().touches),t?n(t).map((function(t){var r=be(e,t);return r.identifier=t.identifier,r})):[]};var we=1e-6,ke=we*we,Te=Math.PI,Se=2*Te,Ae=Se-we,Me=Te/2,Ee=Te/180,Ce=180/Te;function Pe(e){return e>1?Me:e<-1?-Me:Math.asin(e)}function Le(e){return((e=Math.exp(e))+1/e)/2}var Ie=Math.SQRT2;e.interpolateZoom=function(e,t){var r,n,i=e[0],a=e[1],o=e[2],s=t[0],l=t[1],c=t[2],u=s-i,h=l-a,p=u*u+h*h;if(p<ke)n=Math.log(c/o)/Ie,r=function(e){return[i+e*u,a+e*h,o*Math.exp(Ie*e*n)]};else{var d=Math.sqrt(p),f=(c*c-o*o+4*p)/(2*o*2*d),m=(c*c-o*o-4*p)/(2*c*2*d),g=Math.log(Math.sqrt(f*f+1)-f),y=Math.log(Math.sqrt(m*m+1)-m);n=(y-g)/Ie,r=function(e){var t,r=e*n,s=Le(g),l=o/(2*d)*(s*(t=Ie*r+g,((t=Math.exp(2*t))-1)/(t+1))-function(e){return((e=Math.exp(e))-1/e)/2}(g));return[i+l*u,a+l*h,o*s/Le(Ie*r+g)]}}return r.duration=1e3*n,r},e.behavior.zoom=function(){var t,r,n,a,s,l,c,u,h,p={x:0,y:0,k:1},d=[960,500],f=Re,m=250,g=0,y="mousedown.zoom",v="mousemove.zoom",x="mouseup.zoom",b="touchstart.zoom",_=F(w,"zoomstart","zoom","zoomend");function w(e){e.on(y,L).on(Oe+".zoom",z).on("dblclick.zoom",O).on(b,I)}function k(e){return[(e[0]-p.x)/p.k,(e[1]-p.y)/p.k]}function T(e){p.k=Math.max(f[0],Math.min(f[1],e))}function S(e,t){t=function(e){return[e[0]*p.k+p.x,e[1]*p.k+p.y]}(t),p.x+=e[0]-t[0],p.y+=e[1]-t[1]}function A(t,n,i,a){t.__chart__={x:p.x,y:p.y,k:p.k},T(Math.pow(2,a)),S(r=n,i),t=e.select(t),m>0&&(t=t.transition().duration(m)),t.call(w.event)}function M(){c&&c.domain(l.range().map((function(e){return(e-p.x)/p.k})).map(l.invert)),h&&h.domain(u.range().map((function(e){return(e-p.y)/p.k})).map(u.invert))}function E(e){g++||e({type:"zoomstart"})}function C(e){M(),e({type:"zoom",scale:p.k,translate:[p.x,p.y]})}function P(e){--g||(e({type:"zoomend"}),r=null)}function L(){var t=this,r=_.of(t,arguments),n=0,i=e.select(o(t)).on(v,(function(){n=1,S(e.mouse(t),a),C(r)})).on(x,(function(){i.on(v,null).on(x,null),s(n),P(r)})),a=k(e.mouse(t)),s=ve(t);Wi.call(t),E(r)}function I(){var t,r=this,n=_.of(r,arguments),i={},a=0,o=".zoom-"+e.event.changedTouches[0].identifier,l="touchmove"+o,c="touchend"+o,u=[],h=e.select(r),d=ve(r);function f(){var n=e.touches(r);return t=p.k,n.forEach((function(e){e.identifier in i&&(i[e.identifier]=k(e))})),n}function m(){var t=e.event.target;e.select(t).on(l,g).on(c,v),u.push(t);for(var n=e.event.changedTouches,o=0,h=n.length;o<h;++o)i[n[o].identifier]=null;var d=f(),m=Date.now();if(1===d.length){if(m-s<500){var y=d[0];A(r,y,i[y.identifier],Math.floor(Math.log(p.k)/Math.LN2)+1),D()}s=m}else if(d.length>1){y=d[0];var x=d[1],b=y[0]-x[0],_=y[1]-x[1];a=b*b+_*_}}function g(){var o,l,c,u,h=e.touches(r);Wi.call(r);for(var p=0,d=h.length;p<d;++p,u=null)if(c=h[p],u=i[c.identifier]){if(l)break;o=c,l=u}if(u){var f=(f=c[0]-o[0])*f+(f=c[1]-o[1])*f,m=a&&Math.sqrt(f/a);o=[(o[0]+c[0])/2,(o[1]+c[1])/2],l=[(l[0]+u[0])/2,(l[1]+u[1])/2],T(m*t)}s=null,S(o,l),C(n)}function v(){if(e.event.touches.length){for(var t=e.event.changedTouches,r=0,a=t.length;r<a;++r)delete i[t[r].identifier];for(var s in i)return void f()}e.selectAll(u).on(o,null),h.on(y,L).on(b,I),d(),P(n)}m(),E(n),h.on(y,null).on(b,m)}function z(){var i=_.of(this,arguments);a?clearTimeout(a):(Wi.call(this),t=k(r=n||e.mouse(this)),E(i)),a=setTimeout((function(){a=null,P(i)}),50),D(),T(Math.pow(2,.002*ze())*p.k),S(r,t),C(i)}function O(){var t=e.mouse(this),r=Math.log(p.k)/Math.LN2;A(this,t,k(t),e.event.shiftKey?Math.ceil(r)-1:Math.floor(r)+1)}return Oe||(Oe="onwheel"in i?(ze=function(){return-e.event.deltaY*(e.event.deltaMode?120:1)},"wheel"):"onmousewheel"in i?(ze=function(){return e.event.wheelDelta},"mousewheel"):(ze=function(){return-e.event.detail},"MozMousePixelScroll")),w.event=function(t){t.each((function(){var t=_.of(this,arguments),n=p;Xi?e.select(this).transition().each("start.zoom",(function(){p=this.__chart__||{x:0,y:0,k:1},E(t)})).tween("zoom:zoom",(function(){var i=d[0],a=d[1],o=r?r[0]:i/2,s=r?r[1]:a/2,l=e.interpolateZoom([(o-p.x)/p.k,(s-p.y)/p.k,i/p.k],[(o-n.x)/n.k,(s-n.y)/n.k,i/n.k]);return function(e){var r=l(e),n=i/r[2];this.__chart__=p={x:o-r[0]*n,y:s-r[1]*n,k:n},C(t)}})).each("interrupt.zoom",(function(){P(t)})).each("end.zoom",(function(){P(t)})):(this.__chart__=p,E(t),C(t),P(t))}))},w.translate=function(e){return arguments.length?(p={x:+e[0],y:+e[1],k:p.k},M(),w):[p.x,p.y]},w.scale=function(e){return arguments.length?(p={x:p.x,y:p.y,k:null},T(+e),M(),w):p.k},w.scaleExtent=function(e){return arguments.length?(f=null==e?Re:[+e[0],+e[1]],w):f},w.center=function(e){return arguments.length?(n=e&&[+e[0],+e[1]],w):n},w.size=function(e){return arguments.length?(d=e&&[+e[0],+e[1]],w):d},w.duration=function(e){return arguments.length?(m=+e,w):m},w.x=function(e){return arguments.length?(c=e,l=e.copy(),p={x:0,y:0,k:1},w):c},w.y=function(e){return arguments.length?(h=e,u=e.copy(),p={x:0,y:0,k:1},w):h},e.rebind(w,_,"on")};var ze,Oe,Re=[0,1/0];function De(){}function je(e,t,r){return this instanceof je?(this.h=+e,this.s=+t,void(this.l=+r)):arguments.length<2?e instanceof je?new je(e.h,e.s,e.l):at(""+e,ot,je):new je(e,t,r)}e.color=De,De.prototype.toString=function(){return this.rgb()+""},e.hsl=je;var Fe=je.prototype=new De;function Be(e,t,r){var n,i;function a(e){return Math.round(255*function(e){return e>360?e-=360:e<0&&(e+=360),e<60?n+(i-n)*e/60:e<180?i:e<240?n+(i-n)*(240-e)/60:n}(e))}return e=isNaN(e)?0:(e%=360)<0?e+360:e,t=isNaN(t)||t<0?0:t>1?1:t,n=2*(r=r<0?0:r>1?1:r)-(i=r<=.5?r*(1+t):r+t-r*t),new et(a(e+120),a(e),a(e-120))}function Ne(t,r,n){return this instanceof Ne?(this.h=+t,this.c=+r,void(this.l=+n)):arguments.length<2?t instanceof Ne?new Ne(t.h,t.c,t.l):Ye(t instanceof qe?t.l:(t=st((t=e.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new Ne(t,r,n)}Fe.brighter=function(e){return e=Math.pow(.7,arguments.length?e:1),new je(this.h,this.s,this.l/e)},Fe.darker=function(e){return e=Math.pow(.7,arguments.length?e:1),new je(this.h,this.s,e*this.l)},Fe.rgb=function(){return Be(this.h,this.s,this.l)},e.hcl=Ne;var Ue=Ne.prototype=new De;function Ve(e,t,r){return isNaN(e)&&(e=0),isNaN(t)&&(t=0),new qe(r,Math.cos(e*=Ee)*t,Math.sin(e)*t)}function qe(e,t,r){return this instanceof qe?(this.l=+e,this.a=+t,void(this.b=+r)):arguments.length<2?e instanceof qe?new qe(e.l,e.a,e.b):e instanceof Ne?Ve(e.h,e.c,e.l):st((e=et(e)).r,e.g,e.b):new qe(e,t,r)}Ue.brighter=function(e){return new Ne(this.h,this.c,Math.min(100,this.l+He*(arguments.length?e:1)))},Ue.darker=function(e){return new Ne(this.h,this.c,Math.max(0,this.l-He*(arguments.length?e:1)))},Ue.rgb=function(){return Ve(this.h,this.c,this.l).rgb()},e.lab=qe;var He=18,Ge=.95047,We=1,$e=1.08883,Ze=qe.prototype=new De;function Xe(e,t,r){var n=(e+16)/116,i=n+t/500,a=n-r/200;return new et(Qe(3.2404542*(i=Ke(i)*Ge)-1.5371385*(n=Ke(n)*We)-.4985314*(a=Ke(a)*$e)),Qe(-.969266*i+1.8760108*n+.041556*a),Qe(.0556434*i-.2040259*n+1.0572252*a))}function Ye(e,t,r){return e>0?new Ne(Math.atan2(r,t)*Ce,Math.sqrt(t*t+r*r),e):new Ne(NaN,NaN,e)}function Ke(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Je(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Qe(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function et(e,t,r){return this instanceof et?(this.r=~~e,this.g=~~t,void(this.b=~~r)):arguments.length<2?e instanceof et?new et(e.r,e.g,e.b):at(""+e,et,Be):new et(e,t,r)}function tt(e){return new et(e>>16,e>>8&255,255&e)}function rt(e){return tt(e)+""}Ze.brighter=function(e){return new qe(Math.min(100,this.l+He*(arguments.length?e:1)),this.a,this.b)},Ze.darker=function(e){return new qe(Math.max(0,this.l-He*(arguments.length?e:1)),this.a,this.b)},Ze.rgb=function(){return Xe(this.l,this.a,this.b)},e.rgb=et;var nt=et.prototype=new De;function it(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function at(e,t,r){var n,i,a,o=0,s=0,l=0;if(n=/([a-z]+)\((.*)\)/.exec(e=e.toLowerCase()))switch(i=n[2].split(","),n[1]){case"hsl":return r(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return t(ct(i[0]),ct(i[1]),ct(i[2]))}return(a=ut.get(e))?t(a.r,a.g,a.b):(null==e||"#"!==e.charAt(0)||isNaN(a=parseInt(e.slice(1),16))||(4===e.length?(o=(3840&a)>>4,o|=o>>4,s=240&a,s|=s>>4,l=15&a,l|=l<<4):7===e.length&&(o=(16711680&a)>>16,s=(65280&a)>>8,l=255&a)),t(o,s,l))}function ot(e,t,r){var n,i,a=Math.min(e/=255,t/=255,r/=255),o=Math.max(e,t,r),s=o-a,l=(o+a)/2;return s?(i=l<.5?s/(o+a):s/(2-o-a),n=e==o?(t-r)/s+(t<r?6:0):t==o?(r-e)/s+2:(e-t)/s+4,n*=60):(n=NaN,i=l>0&&l<1?0:n),new je(n,i,l)}function st(e,t,r){var n=Je((.4124564*(e=lt(e))+.3575761*(t=lt(t))+.1804375*(r=lt(r)))/Ge),i=Je((.2126729*e+.7151522*t+.072175*r)/We);return qe(116*i-16,500*(n-i),200*(i-Je((.0193339*e+.119192*t+.9503041*r)/$e)))}function lt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function ct(e){var t=parseFloat(e);return"%"===e.charAt(e.length-1)?Math.round(2.55*t):t}nt.brighter=function(e){e=Math.pow(.7,arguments.length?e:1);var t=this.r,r=this.g,n=this.b,i=30;return t||r||n?(t&&t<i&&(t=i),r&&r<i&&(r=i),n&&n<i&&(n=i),new et(Math.min(255,t/e),Math.min(255,r/e),Math.min(255,n/e))):new et(i,i,i)},nt.darker=function(e){return new et((e=Math.pow(.7,arguments.length?e:1))*this.r,e*this.g,e*this.b)},nt.hsl=function(){return ot(this.r,this.g,this.b)},nt.toString=function(){return"#"+it(this.r)+it(this.g)+it(this.b)};var ut=e.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});function ht(e){return"function"===typeof e?e:function(){return e}}function pt(e){return function(t,r,n){return 2===arguments.length&&"function"===typeof r&&(n=r,r=null),dt(t,r,e,n)}}function dt(t,r,i,a){var o={},s=e.dispatch("beforesend","progress","load","error"),l={},c=new XMLHttpRequest,u=null;function h(){var e,t=c.status;if(!t&&function(e){var t=e.responseType;return t&&"text"!==t?e.response:e.responseText}(c)||t>=200&&t<300||304===t){try{e=i.call(o,c)}catch(ha){return void s.error.call(o,ha)}s.load.call(o,e)}else s.error.call(o,c)}return self.XDomainRequest&&!("withCredentials"in c)&&/^(http(s)?:)?\/\//.test(t)&&(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=h:c.onreadystatechange=function(){c.readyState>3&&h()},c.onprogress=function(t){var r=e.event;e.event=t;try{s.progress.call(o,c)}finally{e.event=r}},o.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?l[e]:(null==t?delete l[e]:l[e]=t+"",o)},o.mimeType=function(e){return arguments.length?(r=null==e?null:e+"",o):r},o.responseType=function(e){return arguments.length?(u=e,o):u},o.response=function(e){return i=e,o},["get","post"].forEach((function(e){o[e]=function(){return o.send.apply(o,[e].concat(n(arguments)))}})),o.send=function(e,n,i){if(2===arguments.length&&"function"===typeof n&&(i=n,n=null),c.open(e,t,!0),null==r||"accept"in l||(l.accept=r+",*/*"),c.setRequestHeader)for(var a in l)c.setRequestHeader(a,l[a]);return null!=r&&c.overrideMimeType&&c.overrideMimeType(r),null!=u&&(c.responseType=u),null!=i&&o.on("error",i).on("load",(function(e){i(null,e)})),s.beforesend.call(o,c),c.send(null==n?null:n),o},o.abort=function(){return c.abort(),o},e.rebind(o,s,"on"),null==a?o:o.get(function(e){return 1===e.length?function(t,r){e(null==t?r:null)}:e}(a))}ut.forEach((function(e,t){ut.set(e,tt(t))})),e.functor=ht,e.xhr=pt(C),e.dsv=function(e,t){var r=new RegExp('["'+e+"\n]"),n=e.charCodeAt(0);function i(e,r,n){arguments.length<3&&(n=r,r=null);var i=dt(e,t,null==r?a:o(r),n);return i.row=function(e){return arguments.length?i.response(null==(r=e)?a:o(e)):r},i}function a(e){return i.parse(e.responseText)}function o(e){return function(t){return i.parse(t.responseText,e)}}function s(t){return t.map(l).join(e)}function l(e){return r.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}return i.parse=function(e,t){var r;return i.parseRows(e,(function(e,n){if(r)return r(e,n-1);var i=function(t){for(var r={},n=e.length,i=0;i<n;++i)r[e[i]]=t[i];return r};r=t?function(e,r){return t(i(e),r)}:i}))},i.parseRows=function(e,t){var r,i,a={},o={},s=[],l=e.length,c=0,u=0;function h(){if(c>=l)return o;if(i)return i=!1,a;var t=c;if(34===e.charCodeAt(t)){for(var r=t;r++<l;)if(34===e.charCodeAt(r)){if(34!==e.charCodeAt(r+1))break;++r}return c=r+2,13===(s=e.charCodeAt(r+1))?(i=!0,10===e.charCodeAt(r+2)&&++c):10===s&&(i=!0),e.slice(t+1,r).replace(/""/g,'"')}for(;c<l;){var s,u=1;if(10===(s=e.charCodeAt(c++)))i=!0;else if(13===s)i=!0,10===e.charCodeAt(c)&&(++c,++u);else if(s!==n)continue;return e.slice(t,c-u)}return e.slice(t)}for(;(r=h())!==o;){for(var p=[];r!==a&&r!==o;)p.push(r),r=h();t&&null==(p=t(p,u++))||s.push(p)}return s},i.format=function(t){if(Array.isArray(t[0]))return i.formatRows(t);var r=new E,n=[];return t.forEach((function(e){for(var t in e)r.has(t)||n.push(r.add(t))})),[n.map(l).join(e)].concat(t.map((function(t){return n.map((function(e){return l(t[e])})).join(e)}))).join("\n")},i.formatRows=function(e){return e.map(s).join("\n")},i},e.csv=e.dsv(",","text/csv"),e.tsv=e.dsv("\t","text/tab-separated-values");var ft,mt,gt,yt,vt=this[L(this,"requestAnimationFrame")]||function(e){setTimeout(e,17)};function xt(e,t,r){var n=arguments.length;n<2&&(t=0),n<3&&(r=Date.now());var i={c:e,t:r+t,n:null};return mt?mt.n=i:ft=i,mt=i,gt||(yt=clearTimeout(yt),gt=1,vt(bt)),i}function bt(){var e=_t(),t=wt()-e;t>24?(isFinite(t)&&(clearTimeout(yt),yt=setTimeout(bt,t)),gt=0):(gt=1,vt(bt))}function _t(){for(var e=Date.now(),t=ft;t;)e>=t.t&&t.c(e-t.t)&&(t.c=null),t=t.n;return e}function wt(){for(var e,t=ft,r=1/0;t;)t.c?(t.t<r&&(r=t.t),t=(e=t).n):t=e?e.n=t.n:ft=t.n;return mt=e,r}function kt(e){return e[0]}function Tt(e){return e[1]}function St(e){for(var t,r,n,i=e.length,a=[0,1],o=2,s=2;s<i;s++){for(;o>1&&(t=e[a[o-2]],r=e[a[o-1]],n=e[s],(r[0]-t[0])*(n[1]-t[1])-(r[1]-t[1])*(n[0]-t[0])<=0);)--o;a[o++]=s}return a.slice(0,o)}function At(e,t){return e[0]-t[0]||e[1]-t[1]}e.timer=function(){xt.apply(this,arguments)},e.timer.flush=function(){_t(),wt()},e.round=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},e.geom={},e.geom.hull=function(e){var t=kt,r=Tt;if(arguments.length)return n(e);function n(e){if(e.length<3)return[];var n,i=ht(t),a=ht(r),o=e.length,s=[],l=[];for(n=0;n<o;n++)s.push([+i.call(this,e[n],n),+a.call(this,e[n],n),n]);for(s.sort(At),n=0;n<o;n++)l.push([s[n][0],-s[n][1]]);var c=St(s),u=St(l),h=u[0]===c[0],p=u[u.length-1]===c[c.length-1],d=[];for(n=c.length-1;n>=0;--n)d.push(e[s[c[n]][2]]);for(n=+h;n<u.length-p;++n)d.push(e[s[u[n]][2]]);return d}return n.x=function(e){return arguments.length?(t=e,n):t},n.y=function(e){return arguments.length?(r=e,n):r},n},e.geom.polygon=function(e){return N(e,Mt),e};var Mt=e.geom.polygon.prototype=[];function Et(e,t,r){return(r[0]-t[0])*(e[1]-t[1])<(r[1]-t[1])*(e[0]-t[0])}function Ct(e,t,r,n){var i=e[0],a=r[0],o=t[0]-i,s=n[0]-a,l=e[1],c=r[1],u=t[1]-l,h=n[1]-c,p=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+p*o,l+p*u]}function Pt(e){var t=e[0],r=e[e.length-1];return!(t[0]-r[0]||t[1]-r[1])}Mt.area=function(){for(var e,t=-1,r=this.length,n=this[r-1],i=0;++t<r;)e=n,n=this[t],i+=e[1]*n[0]-e[0]*n[1];return.5*i},Mt.centroid=function(e){var t,r,n=-1,i=this.length,a=0,o=0,s=this[i-1];for(arguments.length||(e=-1/(6*this.area()));++n<i;)t=s,s=this[n],r=t[0]*s[1]-s[0]*t[1],a+=(t[0]+s[0])*r,o+=(t[1]+s[1])*r;return[a*e,o*e]},Mt.clip=function(e){for(var t,r,n,i,a,o,s=Pt(e),l=-1,c=this.length-Pt(this),u=this[c-1];++l<c;){for(t=e.slice(),e.length=0,i=this[l],a=t[(n=t.length-s)-1],r=-1;++r<n;)Et(o=t[r],u,i)?(Et(a,u,i)||e.push(Ct(a,o,u,i)),e.push(o)):Et(a,u,i)&&e.push(Ct(a,o,u,i)),a=o;s&&e.push(e[0]),u=i}return e};var Lt,It,zt,Ot,Rt,Dt=[],jt=[];function Ft(){nr(this),this.edge=this.site=this.circle=null}function Bt(e){var t=Dt.pop()||new Ft;return t.site=e,t}function Nt(e){Xt(e),zt.remove(e),Dt.push(e),nr(e)}function Ut(e){var t=e.circle,r=t.x,n=t.cy,i={x:r,y:n},a=e.P,o=e.N,s=[e];Nt(e);for(var l=a;l.circle&&v(r-l.circle.x)<we&&v(n-l.circle.cy)<we;)a=l.P,s.unshift(l),Nt(l),l=a;s.unshift(l),Xt(l);for(var c=o;c.circle&&v(r-c.circle.x)<we&&v(n-c.circle.cy)<we;)o=c.N,s.push(c),Nt(c),c=o;s.push(c),Xt(c);var u,h=s.length;for(u=1;u<h;++u)c=s[u],l=s[u-1],er(c.edge,l.site,c.site,i);l=s[0],(c=s[h-1]).edge=Jt(l.site,c.site,null,i),Zt(l),Zt(c)}function Vt(e){for(var t,r,n,i,a=e.x,o=e.y,s=zt._;s;)if((n=qt(s,o)-a)>we)s=s.L;else{if(!((i=a-Ht(s,o))>we)){n>-we?(t=s.P,r=s):i>-we?(t=s,r=s.N):t=r=s;break}if(!s.R){t=s;break}s=s.R}var l=Bt(e);if(zt.insert(t,l),t||r){if(t===r)return Xt(t),r=Bt(t.site),zt.insert(l,r),l.edge=r.edge=Jt(t.site,l.site),Zt(t),void Zt(r);if(r){Xt(t),Xt(r);var c=t.site,u=c.x,h=c.y,p=e.x-u,d=e.y-h,f=r.site,m=f.x-u,g=f.y-h,y=2*(p*g-d*m),v=p*p+d*d,x=m*m+g*g,b={x:(g*v-d*x)/y+u,y:(p*x-m*v)/y+h};er(r.edge,c,f,b),l.edge=Jt(c,e,null,b),r.edge=Jt(e,f,null,b),Zt(t),Zt(r)}else l.edge=Jt(t.site,l.site)}}function qt(e,t){var r=e.site,n=r.x,i=r.y,a=i-t;if(!a)return n;var o=e.P;if(!o)return-1/0;var s=(r=o.site).x,l=r.y,c=l-t;if(!c)return s;var u=s-n,h=1/a-1/c,p=u/c;return h?(-p+Math.sqrt(p*p-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function Ht(e,t){var r=e.N;if(r)return qt(r,t);var n=e.site;return n.y===t?n.x:1/0}function Gt(e){this.site=e,this.edges=[]}function Wt(e,t){return t.angle-e.angle}function $t(){nr(this),this.x=this.y=this.arc=this.site=this.cy=null}function Zt(e){var t=e.P,r=e.N;if(t&&r){var n=t.site,i=e.site,a=r.site;if(n!==a){var o=i.x,s=i.y,l=n.x-o,c=n.y-s,u=a.x-o,h=2*(l*(g=a.y-s)-c*u);if(!(h>=-ke)){var p=l*l+c*c,d=u*u+g*g,f=(g*p-c*d)/h,m=(l*d-u*p)/h,g=m+s,y=jt.pop()||new $t;y.arc=e,y.site=i,y.x=f+o,y.y=g+Math.sqrt(f*f+m*m),y.cy=g,e.circle=y;for(var v=null,x=Rt._;x;)if(y.y<x.y||y.y===x.y&&y.x<=x.x){if(!x.L){v=x.P;break}x=x.L}else{if(!x.R){v=x;break}x=x.R}Rt.insert(v,y),v||(Ot=y)}}}}function Xt(e){var t=e.circle;t&&(t.P||(Ot=t.N),Rt.remove(t),jt.push(t),nr(t),e.circle=null)}function Yt(e,t){var r=e.b;if(r)return!0;var n,i,a=e.a,o=t[0][0],s=t[1][0],l=t[0][1],c=t[1][1],u=e.l,h=e.r,p=u.x,d=u.y,f=h.x,m=h.y,g=(p+f)/2,y=(d+m)/2;if(m===d){if(g<o||g>=s)return;if(p>f){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y<l)return}else a={x:g,y:c};r={x:g,y:l}}}else if(i=y-(n=(p-f)/(m-d))*g,n<-1||n>1)if(p>f){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}else{if(a){if(a.y<l)return}else a={x:(c-i)/n,y:c};r={x:(l-i)/n,y:l}}else if(d<m){if(a){if(a.x>=s)return}else a={x:o,y:n*o+i};r={x:s,y:n*s+i}}else{if(a){if(a.x<o)return}else a={x:s,y:n*s+i};r={x:o,y:n*o+i}}return e.a=a,e.b=r,!0}function Kt(e,t){this.l=e,this.r=t,this.a=this.b=null}function Jt(e,t,r,n){var i=new Kt(e,t);return Lt.push(i),r&&er(i,e,t,r),n&&er(i,t,e,n),It[e.i].edges.push(new tr(i,e,t)),It[t.i].edges.push(new tr(i,t,e)),i}function Qt(e,t,r){var n=new Kt(e,null);return n.a=t,n.b=r,Lt.push(n),n}function er(e,t,r,n){e.a||e.b?e.l===r?e.b=n:e.a=n:(e.a=n,e.l=t,e.r=r)}function tr(e,t,r){var n=e.a,i=e.b;this.edge=e,this.site=t,this.angle=r?Math.atan2(r.y-t.y,r.x-t.x):e.l===t?Math.atan2(i.x-n.x,n.y-i.y):Math.atan2(n.x-i.x,i.y-n.y)}function rr(){this._=null}function nr(e){e.U=e.C=e.L=e.R=e.P=e.N=null}function ir(e,t){var r=t,n=t.R,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.R=n.L,r.R&&(r.R.U=r),n.L=r}function ar(e,t){var r=t,n=t.L,i=r.U;i?i.L===r?i.L=n:i.R=n:e._=n,n.U=i,r.U=n,r.L=n.R,r.L&&(r.L.U=r),n.R=r}function or(e){for(;e.L;)e=e.L;return e}function sr(e,t){var r,n,i,a=e.sort(lr).pop();for(Lt=[],It=new Array(e.length),zt=new rr,Rt=new rr;;)if(i=Ot,a&&(!i||a.y<i.y||a.y===i.y&&a.x<i.x))a.x===r&&a.y===n||(It[a.i]=new Gt(a),Vt(a),r=a.x,n=a.y),a=e.pop();else{if(!i)break;Ut(i.arc)}t&&(function(e){for(var t,r,n,i,a,o=Lt,s=(r=e[0][0],n=e[0][1],i=e[1][0],a=e[1][1],function(e){var t,o=e.a,s=e.b,l=o.x,c=o.y,u=0,h=1,p=s.x-l,d=s.y-c;if(t=r-l,p||!(t>0)){if(t/=p,p<0){if(t<u)return;t<h&&(h=t)}else if(p>0){if(t>h)return;t>u&&(u=t)}if(t=i-l,p||!(t<0)){if(t/=p,p<0){if(t>h)return;t>u&&(u=t)}else if(p>0){if(t<u)return;t<h&&(h=t)}if(t=n-c,d||!(t>0)){if(t/=d,d<0){if(t<u)return;t<h&&(h=t)}else if(d>0){if(t>h)return;t>u&&(u=t)}if(t=a-c,d||!(t<0)){if(t/=d,d<0){if(t>h)return;t>u&&(u=t)}else if(d>0){if(t<u)return;t<h&&(h=t)}return u>0&&(e.a={x:l+u*p,y:c+u*d}),h<1&&(e.b={x:l+h*p,y:c+h*d}),e}}}}}),l=o.length;l--;)(!Yt(t=o[l],e)||!s(t)||v(t.a.x-t.b.x)<we&&v(t.a.y-t.b.y)<we)&&(t.a=t.b=null,o.splice(l,1))}(t),function(e){for(var t,r,n,i,a,o,s,l,c,u,h=e[0][0],p=e[1][0],d=e[0][1],f=e[1][1],m=It,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;o<l;)n=(u=s[o].end()).x,i=u.y,t=(c=s[++o%l].start()).x,r=c.y,(v(n-t)>we||v(i-r)>we)&&(s.splice(o,0,new tr(Qt(a.site,u,v(n-h)<we&&f-i>we?{x:h,y:v(t-h)<we?r:f}:v(i-f)<we&&p-n>we?{x:v(r-f)<we?t:p,y:f}:v(n-p)<we&&i-d>we?{x:p,y:v(t-p)<we?r:d}:v(i-d)<we&&n-h>we?{x:v(r-d)<we?t:h,y:d}:null),a.site,null)),++l)}(t));var o={cells:It,edges:Lt};return zt=Rt=Lt=It=null,o}function lr(e,t){return t.y-e.y||t.x-e.x}Gt.prototype.prepare=function(){for(var e,t=this.edges,r=t.length;r--;)(e=t[r].edge).b&&e.a||t.splice(r,1);return t.sort(Wt),t.length},tr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},rr.prototype={insert:function(e,t){var r,n,i;if(e){if(t.P=e,t.N=e.N,e.N&&(e.N.P=t),e.N=t,e.R){for(e=e.R;e.L;)e=e.L;e.L=t}else e.R=t;r=e}else this._?(e=or(this._),t.P=null,t.N=e,e.P=e.L=t,r=e):(t.P=t.N=null,this._=t,r=null);for(t.L=t.R=null,t.U=r,t.C=!0,e=t;r&&r.C;)r===(n=r.U).L?(i=n.R)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.R&&(ir(this,r),r=(e=r).U),r.C=!1,n.C=!0,ar(this,n)):(i=n.L)&&i.C?(r.C=i.C=!1,n.C=!0,e=n):(e===r.L&&(ar(this,r),r=(e=r).U),r.C=!1,n.C=!0,ir(this,n)),r=e.U;this._.C=!1},remove:function(e){e.N&&(e.N.P=e.P),e.P&&(e.P.N=e.N),e.N=e.P=null;var t,r,n,i=e.U,a=e.L,o=e.R;if(r=a?o?or(o):a:o,i?i.L===e?i.L=r:i.R=r:this._=r,a&&o?(n=r.C,r.C=e.C,r.L=a,a.U=r,r!==o?(i=r.U,r.U=e.U,e=r.R,i.L=e,r.R=o,o.U=r):(r.U=i,i=r,e=r.R)):(n=e.C,e=r),e&&(e.U=i),!n)if(e&&e.C)e.C=!1;else{do{if(e===this._)break;if(e===i.L){if((t=i.R).C&&(t.C=!1,i.C=!0,ir(this,i),t=i.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ar(this,t),t=i.R),t.C=i.C,i.C=t.R.C=!1,ir(this,i),e=this._;break}}else if((t=i.L).C&&(t.C=!1,i.C=!0,ar(this,i),t=i.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ir(this,t),t=i.L),t.C=i.C,i.C=t.L.C=!1,ar(this,i),e=this._;break}t.C=!0,e=i,i=i.U}while(!e.C);e&&(e.C=!1)}}},e.geom.voronoi=function(e){var t=kt,r=Tt,n=t,i=r,a=cr;if(e)return o(e);function o(e){var t=new Array(e.length),r=a[0][0],n=a[0][1],i=a[1][0],o=a[1][1];return sr(s(e),a).cells.forEach((function(a,s){var l=a.edges,c=a.site;(t[s]=l.length?l.map((function(e){var t=e.start();return[t.x,t.y]})):c.x>=r&&c.x<=i&&c.y>=n&&c.y<=o?[[r,o],[i,o],[i,n],[r,n]]:[]).point=e[s]})),t}function s(e){return e.map((function(e,t){return{x:Math.round(n(e,t)/we)*we,y:Math.round(i(e,t)/we)*we,i:t}}))}return o.links=function(e){return sr(s(e)).edges.filter((function(e){return e.l&&e.r})).map((function(t){return{source:e[t.l.i],target:e[t.r.i]}}))},o.triangles=function(e){var t=[];return sr(s(e)).cells.forEach((function(r,n){for(var i,a,o,s,l=r.site,c=r.edges.sort(Wt),u=-1,h=c.length,p=c[h-1].edge,d=p.l===l?p.r:p.l;++u<h;)i=d,d=(p=c[u].edge).l===l?p.r:p.l,n<i.i&&n<d.i&&(o=i,s=d,((a=l).x-s.x)*(o.y-a.y)-(a.x-o.x)*(s.y-a.y)<0)&&t.push([e[n],e[i.i],e[d.i]])})),t},o.x=function(e){return arguments.length?(n=ht(t=e),o):t},o.y=function(e){return arguments.length?(i=ht(r=e),o):r},o.clipExtent=function(e){return arguments.length?(a=null==e?cr:e,o):a===cr?null:a},o.size=function(e){return arguments.length?o.clipExtent(e&&[[0,0],e]):a===cr?null:a&&a[1]},o};var cr=[[-1e6,-1e6],[1e6,1e6]];function ur(e){return e.x}function hr(e){return e.y}function pr(e,t,r,n,i,a){if(!e(t,r,n,i,a)){var o=.5*(r+i),s=.5*(n+a),l=t.nodes;l[0]&&pr(e,l[0],r,n,o,s),l[1]&&pr(e,l[1],o,n,i,s),l[2]&&pr(e,l[2],r,s,o,a),l[3]&&pr(e,l[3],o,s,i,a)}}function dr(t,r){t=e.rgb(t),r=e.rgb(r);var n=t.r,i=t.g,a=t.b,o=r.r-n,s=r.g-i,l=r.b-a;return function(e){return"#"+it(Math.round(n+o*e))+it(Math.round(i+s*e))+it(Math.round(a+l*e))}}function fr(e,t){var r,n={},i={};for(r in e)r in t?n[r]=xr(e[r],t[r]):i[r]=e[r];for(r in t)r in e||(i[r]=t[r]);return function(e){for(r in n)i[r]=n[r](e);return i}}function mr(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}function gr(e,t){var r,n,i,a=yr.lastIndex=vr.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=yr.exec(e))&&(n=vr.exec(t));)(i=n.index)>a&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:mr(r,n)})),a=vr.lastIndex;return a<t.length&&(i=t.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?(t=l[0].x,function(e){return t(e)+""}):function(){return t}:(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}e.geom.delaunay=function(t){return e.geom.voronoi().triangles(t)},e.geom.quadtree=function(e,t,r,n,i){var a,o=kt,s=Tt;if(a=arguments.length)return o=ur,s=hr,3===a&&(i=r,n=t,r=t=0),l(e);function l(e){var l,c,u,h,p,d,f,m,g,y=ht(o),x=ht(s);if(null!=t)d=t,f=r,m=n,g=i;else if(m=g=-(d=f=1/0),c=[],u=[],p=e.length,a)for(h=0;h<p;++h)(l=e[h]).x<d&&(d=l.x),l.y<f&&(f=l.y),l.x>m&&(m=l.x),l.y>g&&(g=l.y),c.push(l.x),u.push(l.y);else for(h=0;h<p;++h){var b=+y(l=e[h],h),_=+x(l,h);b<d&&(d=b),_<f&&(f=_),b>m&&(m=b),_>g&&(g=_),c.push(b),u.push(_)}var w=m-d,k=g-f;function T(e,t,r,n,i,a,o,s){if(!isNaN(r)&&!isNaN(n))if(e.leaf){var l=e.x,c=e.y;if(null!=l)if(v(l-r)+v(c-n)<.01)S(e,t,r,n,i,a,o,s);else{var u=e.point;e.x=e.y=e.point=null,S(e,u,l,c,i,a,o,s),S(e,t,r,n,i,a,o,s)}else e.x=r,e.y=n,e.point=t}else S(e,t,r,n,i,a,o,s)}function S(e,t,r,n,i,a,o,s){var l=.5*(i+o),c=.5*(a+s),u=r>=l,h=n>=c,p=h<<1|u;e.leaf=!1,u?i=l:o=l,h?a=c:s=c,T(e=e.nodes[p]||(e.nodes[p]={leaf:!0,nodes:[],point:null,x:null,y:null}),t,r,n,i,a,o,s)}w>k?g=f+w:m=d+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null,add:function(e){T(A,e,+y(e,++h),+x(e,h),d,f,m,g)},visit:function(e){pr(e,A,d,f,m,g)},find:function(e){return function(e,t,r,n,i,a,o){var s,l=1/0;return function e(c,u,h,p,d){if(!(u>a||h>o||p<n||d<i)){if(f=c.point){var f,m=t-c.x,g=r-c.y,y=m*m+g*g;if(y<l){var v=Math.sqrt(l=y);n=t-v,i=r-v,a=t+v,o=r+v,s=f}}for(var x=c.nodes,b=.5*(u+p),_=.5*(h+d),w=(r>=_)<<1|t>=b,k=w+4;w<k;++w)if(c=x[3&w])switch(3&w){case 0:e(c,u,h,b,_);break;case 1:e(c,b,h,p,_);break;case 2:e(c,u,_,b,d);break;case 3:e(c,b,_,p,d)}}}(e,n,i,a,o),s}(A,e[0],e[1],d,f,m,g)}};if(h=-1,null==t){for(;++h<p;)T(A,e[h],c[h],u[h],d,f,m,g);--h}else e.forEach(A.add);return c=u=e=l=null,A}return l.x=function(e){return arguments.length?(o=e,l):o},l.y=function(e){return arguments.length?(s=e,l):s},l.extent=function(e){return arguments.length?(null==e?t=r=n=i=null:(t=+e[0][0],r=+e[0][1],n=+e[1][0],i=+e[1][1]),l):null==t?null:[[t,r],[n,i]]},l.size=function(e){return arguments.length?(null==e?t=r=n=i=null:(t=r=0,n=+e[0],i=+e[1]),l):null==t?null:[n-t,i-r]},l},e.interpolateRgb=dr,e.interpolateObject=fr,e.interpolateNumber=mr,e.interpolateString=gr;var yr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,vr=new RegExp(yr.source,"g");function xr(t,r){for(var n,i=e.interpolators.length;--i>=0&&!(n=e.interpolators[i](t,r)););return n}function br(e,t){var r,n=[],i=[],a=e.length,o=t.length,s=Math.min(e.length,t.length);for(r=0;r<s;++r)n.push(xr(e[r],t[r]));for(;r<a;++r)i[r]=e[r];for(;r<o;++r)i[r]=t[r];return function(e){for(r=0;r<s;++r)i[r]=n[r](e);return i}}e.interpolate=xr,e.interpolators=[function(e,t){var r=typeof t;return("string"===r?ut.has(t.toLowerCase())||/^(#|rgb\(|hsl\()/i.test(t)?dr:gr:t instanceof De?dr:Array.isArray(t)?br:"object"===r&&isNaN(t)?fr:mr)(e,t)}],e.interpolateArray=br;var _r=function(){return C},wr=e.map({linear:_r,poly:function(e){return function(t){return Math.pow(t,e)}},quad:function(){return Ar},cubic:function(){return Mr},sin:function(){return Cr},exp:function(){return Pr},circle:function(){return Lr},elastic:function(e,t){var r;return arguments.length<2&&(t=.45),arguments.length?r=t/Se*Math.asin(1/e):(e=1,r=t/4),function(n){return 1+e*Math.pow(2,-10*n)*Math.sin((n-r)*Se/t)}},back:function(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}},bounce:function(){return Ir}}),kr=e.map({in:C,out:Tr,"in-out":Sr,"out-in":function(e){return Sr(Tr(e))}});function Tr(e){return function(t){return 1-e(1-t)}}function Sr(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Ar(e){return e*e}function Mr(e){return e*e*e}function Er(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function Cr(e){return 1-Math.cos(e*Me)}function Pr(e){return Math.pow(2,10*(e-1))}function Lr(e){return 1-Math.sqrt(1-e*e)}function Ir(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function zr(e,t){return t-=e,function(r){return Math.round(e+t*r)}}function Or(e){var t,r,n,i=[e.a,e.b],a=[e.c,e.d],o=Dr(i),s=Rr(i,a),l=Dr(((t=a)[0]+=(n=-s)*(r=i)[0],t[1]+=n*r[1],t))||0;i[0]*a[1]<a[0]*i[1]&&(i[0]*=-1,i[1]*=-1,o*=-1,s*=-1),this.rotate=(o?Math.atan2(i[1],i[0]):Math.atan2(-a[0],a[1]))*Ce,this.translate=[e.e,e.f],this.scale=[o,l],this.skew=l?Math.atan2(s,l)*Ce:0}function Rr(e,t){return e[0]*t[0]+e[1]*t[1]}function Dr(e){var t=Math.sqrt(Rr(e,e));return t&&(e[0]/=t,e[1]/=t),t}e.ease=function(e){var t,n=e.indexOf("-"),i=n>=0?e.slice(0,n):e,a=n>=0?e.slice(n+1):"in";return i=wr.get(i)||_r,a=kr.get(a)||C,t=a(i.apply(null,r.call(arguments,1))),function(e){return e<=0?0:e>=1?1:t(e)}},e.interpolateHcl=function(t,r){t=e.hcl(t),r=e.hcl(r);var n=t.h,i=t.c,a=t.l,o=r.h-n,s=r.c-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.c:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Ve(n+o*e,i+s*e,a+l*e)+""}},e.interpolateHsl=function(t,r){t=e.hsl(t),r=e.hsl(r);var n=t.h,i=t.s,a=t.l,o=r.h-n,s=r.s-i,l=r.l-a;return isNaN(s)&&(s=0,i=isNaN(i)?r.s:i),isNaN(o)?(o=0,n=isNaN(n)?r.h:n):o>180?o-=360:o<-180&&(o+=360),function(e){return Be(n+o*e,i+s*e,a+l*e)+""}},e.interpolateLab=function(t,r){t=e.lab(t),r=e.lab(r);var n=t.l,i=t.a,a=t.b,o=r.l-n,s=r.a-i,l=r.b-a;return function(e){return Xe(n+o*e,i+s*e,a+l*e)+""}},e.interpolateRound=zr,e.transform=function(t){var r=i.createElementNS(e.ns.prefix.svg,"g");return(e.transform=function(e){if(null!=e){r.setAttribute("transform",e);var t=r.transform.baseVal.consolidate()}return new Or(t?t.matrix:jr)})(t)},Or.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var jr={a:1,b:0,c:0,d:1,e:0,f:0};function Fr(e){return e.length?e.pop()+",":""}function Br(t,r){var n=[],i=[];return t=e.transform(t),r=e.transform(r),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push("translate(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else(t[0]||t[1])&&r.push("translate("+t+")")}(t.translate,r.translate,n,i),function(e,t,r,n){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),n.push({i:r.push(Fr(r)+"rotate(",null,")")-2,x:mr(e,t)})):t&&r.push(Fr(r)+"rotate("+t+")")}(t.rotate,r.rotate,n,i),function(e,t,r,n){e!==t?n.push({i:r.push(Fr(r)+"skewX(",null,")")-2,x:mr(e,t)}):t&&r.push(Fr(r)+"skewX("+t+")")}(t.skew,r.skew,n,i),function(e,t,r,n){if(e[0]!==t[0]||e[1]!==t[1]){var i=r.push(Fr(r)+"scale(",null,",",null,")");n.push({i:i-4,x:mr(e[0],t[0])},{i:i-2,x:mr(e[1],t[1])})}else 1===t[0]&&1===t[1]||r.push(Fr(r)+"scale("+t+")")}(t.scale,r.scale,n,i),t=r=null,function(e){for(var t,r=-1,a=i.length;++r<a;)n[(t=i[r]).i]=t.x(e);return n.join("")}}function Nr(e,t){return t=(t-=e=+e)||1/t,function(r){return(r-e)/t}}function Ur(e,t){return t=(t-=e=+e)||1/t,function(r){return Math.max(0,Math.min(1,(r-e)/t))}}function Vr(e){for(var t=e.source,r=e.target,n=function(e,t){if(e===t)return e;for(var r=qr(e),n=qr(t),i=r.pop(),a=n.pop(),o=null;i===a;)o=i,i=r.pop(),a=n.pop();return o}(t,r),i=[t];t!==n;)t=t.parent,i.push(t);for(var a=i.length;r!==n;)i.splice(a,0,r),r=r.parent;return i}function qr(e){for(var t=[],r=e.parent;null!=r;)t.push(e),e=r,r=r.parent;return t.push(e),t}function Hr(e){e.fixed|=2}function Gr(e){e.fixed&=-7}function Wr(e){e.fixed|=4,e.px=e.x,e.py=e.y}function $r(e){e.fixed&=-5}function Zr(e,t,r){var n=0,i=0;if(e.charge=0,!e.leaf)for(var a,o=e.nodes,s=o.length,l=-1;++l<s;)null!=(a=o[l])&&(Zr(a,t,r),e.charge+=a.charge,n+=a.charge*a.cx,i+=a.charge*a.cy);if(e.point){e.leaf||(e.point.x+=Math.random()-.5,e.point.y+=Math.random()-.5);var c=t*r[e.point.index];e.charge+=e.pointCharge=c,n+=c*e.point.x,i+=c*e.point.y}e.cx=n/e.charge,e.cy=i/e.charge}e.interpolateTransform=Br,e.layout={},e.layout.bundle=function(){return function(e){for(var t=[],r=-1,n=e.length;++r<n;)t.push(Vr(e[r]));return t}},e.layout.chord=function(){var t,r,n,i,a,o,s,l={},c=0;function u(){var l,u,p,d,f,m={},g=[],y=e.range(i),v=[];for(t=[],r=[],l=0,d=-1;++d<i;){for(u=0,f=-1;++f<i;)u+=n[d][f];g.push(u),v.push(e.range(i)),l+=u}for(a&&y.sort((function(e,t){return a(g[e],g[t])})),o&&v.forEach((function(e,t){e.sort((function(e,r){return o(n[t][e],n[t][r])}))})),l=(Se-c*i)/l,u=0,d=-1;++d<i;){for(p=u,f=-1;++f<i;){var x=y[d],b=v[x][f],_=n[x][b],w=u,k=u+=_*l;m[x+"-"+b]={index:x,subindex:b,startAngle:w,endAngle:k,value:_}}r[x]={index:x,startAngle:p,endAngle:u,value:g[x]},u+=c}for(d=-1;++d<i;)for(f=d-1;++f<i;){var T=m[d+"-"+f],S=m[f+"-"+d];(T.value||S.value)&&t.push(T.value<S.value?{source:S,target:T}:{source:T,target:S})}s&&h()}function h(){t.sort((function(e,t){return s((e.source.value+e.target.value)/2,(t.source.value+t.target.value)/2)}))}return l.matrix=function(e){return arguments.length?(i=(n=e)&&n.length,t=r=null,l):n},l.padding=function(e){return arguments.length?(c=e,t=r=null,l):c},l.sortGroups=function(e){return arguments.length?(a=e,t=r=null,l):a},l.sortSubgroups=function(e){return arguments.length?(o=e,t=null,l):o},l.sortChords=function(e){return arguments.length?(s=e,t&&h(),l):s},l.chords=function(){return t||u(),t},l.groups=function(){return r||u(),r},l},e.layout.force=function(){var t,r,n,i,a,o,s={},l=e.dispatch("start","tick","end"),c=[1,1],u=.9,h=Xr,p=Yr,d=-30,f=Kr,m=.1,g=.64,y=[],v=[];function x(e){return function(t,r,n,i){if(t.point!==e){var a=t.cx-e.x,o=t.cy-e.y,s=i-r,l=a*a+o*o;if(s*s/g<l){if(l<f){var c=t.charge/l;e.px-=a*c,e.py-=o*c}return!0}t.point&&l&&l<f&&(c=t.pointCharge/l,e.px-=a*c,e.py-=o*c)}return!t.charge}}function b(t){t.px=e.event.x,t.py=e.event.y,s.resume()}return s.tick=function(){if((n*=.99)<.005)return t=null,l.end({type:"end",alpha:n=0}),!0;var r,s,h,p,f,g,b,_,w,k=y.length,T=v.length;for(s=0;s<T;++s)p=(h=v[s]).source,(g=(_=(f=h.target).x-p.x)*_+(w=f.y-p.y)*w)&&(_*=g=n*a[s]*((g=Math.sqrt(g))-i[s])/g,w*=g,f.x-=_*(b=p.weight+f.weight?p.weight/(p.weight+f.weight):.5),f.y-=w*b,p.x+=_*(b=1-b),p.y+=w*b);if((b=n*m)&&(_=c[0]/2,w=c[1]/2,s=-1,b))for(;++s<k;)(h=y[s]).x+=(_-h.x)*b,h.y+=(w-h.y)*b;if(d)for(Zr(r=e.geom.quadtree(y),n,o),s=-1;++s<k;)(h=y[s]).fixed||r.visit(x(h));for(s=-1;++s<k;)(h=y[s]).fixed?(h.x=h.px,h.y=h.py):(h.x-=(h.px-(h.px=h.x))*u,h.y-=(h.py-(h.py=h.y))*u);l.tick({type:"tick",alpha:n})},s.nodes=function(e){return arguments.length?(y=e,s):y},s.links=function(e){return arguments.length?(v=e,s):v},s.size=function(e){return arguments.length?(c=e,s):c},s.linkDistance=function(e){return arguments.length?(h="function"===typeof e?e:+e,s):h},s.distance=s.linkDistance,s.linkStrength=function(e){return arguments.length?(p="function"===typeof e?e:+e,s):p},s.friction=function(e){return arguments.length?(u=+e,s):u},s.charge=function(e){return arguments.length?(d="function"===typeof e?e:+e,s):d},s.chargeDistance=function(e){return arguments.length?(f=e*e,s):Math.sqrt(f)},s.gravity=function(e){return arguments.length?(m=+e,s):m},s.theta=function(e){return arguments.length?(g=e*e,s):Math.sqrt(g)},s.alpha=function(e){return arguments.length?(e=+e,n?e>0?n=e:(t.c=null,t.t=NaN,t=null,l.end({type:"end",alpha:n=0})):e>0&&(l.start({type:"start",alpha:n=e}),t=xt(s.tick)),s):n},s.start=function(){var e,t,r,n=y.length,l=v.length,u=c[0],f=c[1];for(e=0;e<n;++e)(r=y[e]).index=e,r.weight=0;for(e=0;e<l;++e)"number"==typeof(r=v[e]).source&&(r.source=y[r.source]),"number"==typeof r.target&&(r.target=y[r.target]),++r.source.weight,++r.target.weight;for(e=0;e<n;++e)r=y[e],isNaN(r.x)&&(r.x=m("x",u)),isNaN(r.y)&&(r.y=m("y",f)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(i=[],"function"===typeof h)for(e=0;e<l;++e)i[e]=+h.call(this,v[e],e);else for(e=0;e<l;++e)i[e]=h;if(a=[],"function"===typeof p)for(e=0;e<l;++e)a[e]=+p.call(this,v[e],e);else for(e=0;e<l;++e)a[e]=p;if(o=[],"function"===typeof d)for(e=0;e<n;++e)o[e]=+d.call(this,y[e],e);else for(e=0;e<n;++e)o[e]=d;function m(r,i){if(!t){for(t=new Array(n),c=0;c<n;++c)t[c]=[];for(c=0;c<l;++c){var a=v[c];t[a.source.index].push(a.target),t[a.target.index].push(a.source)}}for(var o,s=t[e],c=-1,u=s.length;++c<u;)if(!isNaN(o=s[c][r]))return o;return Math.random()*i}return s.resume()},s.resume=function(){return s.alpha(.1)},s.stop=function(){return s.alpha(0)},s.drag=function(){if(r||(r=e.behavior.drag().origin(C).on("dragstart.force",Hr).on("drag.force",b).on("dragend.force",Gr)),!arguments.length)return r;this.on("mouseover.force",Wr).on("mouseout.force",$r).call(r)},e.rebind(s,l,"on")};var Xr=20,Yr=1,Kr=1/0;function Jr(t,r){return e.rebind(t,r,"sort","children","value"),t.nodes=t,t.links=an,t}function Qr(e,t){for(var r=[e];null!=(e=r.pop());)if(t(e),(i=e.children)&&(n=i.length))for(var n,i;--n>=0;)r.push(i[n])}function en(e,t){for(var r=[e],n=[];null!=(e=r.pop());)if(n.push(e),(a=e.children)&&(i=a.length))for(var i,a,o=-1;++o<i;)r.push(a[o]);for(;null!=(e=n.pop());)t(e)}function tn(e){return e.children}function rn(e){return e.value}function nn(e,t){return t.value-e.value}function an(t){return e.merge(t.map((function(e){return(e.children||[]).map((function(t){return{source:e,target:t}}))})))}e.layout.hierarchy=function(){var e=nn,t=tn,r=rn;function n(i){var a,o=[i],s=[];for(i.depth=0;null!=(a=o.pop());)if(s.push(a),(c=t.call(n,a,a.depth))&&(l=c.length)){for(var l,c,u;--l>=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;r&&(a.value=0),a.children=c}else r&&(a.value=+r.call(n,a,a.depth)||0),delete a.children;return en(i,(function(t){var n,i;e&&(n=t.children)&&n.sort(e),r&&(i=t.parent)&&(i.value+=t.value)})),s}return n.sort=function(t){return arguments.length?(e=t,n):e},n.children=function(e){return arguments.length?(t=e,n):t},n.value=function(e){return arguments.length?(r=e,n):r},n.revalue=function(e){return r&&(Qr(e,(function(e){e.children&&(e.value=0)})),en(e,(function(e){var t;e.children||(e.value=+r.call(n,e,e.depth)||0),(t=e.parent)&&(t.value+=e.value)}))),e},n},e.layout.partition=function(){var t=e.layout.hierarchy(),r=[1,1];function n(e,t,r,i){var a=e.children;if(e.x=t,e.y=e.depth*i,e.dx=r,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(r=e.value?r/e.value:0;++c<o;)n(s=a[c],t,l=s.value*r,i),t+=l}}function i(e){var t=e.children,r=0;if(t&&(n=t.length))for(var n,a=-1;++a<n;)r=Math.max(r,i(t[a]));return 1+r}function a(e,a){var o=t.call(this,e,a);return n(o[0],0,r[0],r[1]/i(o[0])),o}return a.size=function(e){return arguments.length?(r=e,a):r},Jr(a,t)},e.layout.pie=function(){var t=Number,r=on,n=0,i=Se,a=0;function o(s){var l,c=s.length,u=s.map((function(e,r){return+t.call(o,e,r)})),h=+("function"===typeof n?n.apply(this,arguments):n),p=("function"===typeof i?i.apply(this,arguments):i)-h,d=Math.min(Math.abs(p)/c,+("function"===typeof a?a.apply(this,arguments):a)),f=d*(p<0?-1:1),m=e.sum(u),g=m?(p-c*f)/m:0,y=e.range(c),v=[];return null!=r&&y.sort(r===on?function(e,t){return u[t]-u[e]}:function(e,t){return r(s[e],s[t])}),y.forEach((function(e){v[e]={data:s[e],value:l=u[e],startAngle:h,endAngle:h+=l*g+f,padAngle:d}})),v}return o.value=function(e){return arguments.length?(t=e,o):t},o.sort=function(e){return arguments.length?(r=e,o):r},o.startAngle=function(e){return arguments.length?(n=e,o):n},o.endAngle=function(e){return arguments.length?(i=e,o):i},o.padAngle=function(e){return arguments.length?(a=e,o):a},o};var on={};function sn(e){return e.x}function ln(e){return e.y}function cn(e,t,r){e.y0=t,e.y=r}e.layout.stack=function(){var t=C,r=pn,n=dn,i=cn,a=sn,o=ln;function s(l,c){if(!(d=l.length))return l;var u=l.map((function(e,r){return t.call(s,e,r)})),h=u.map((function(e){return e.map((function(e,t){return[a.call(s,e,t),o.call(s,e,t)]}))})),p=r.call(s,h,c);u=e.permute(u,p),h=e.permute(h,p);var d,f,m,g,y=n.call(s,h,c),v=u[0].length;for(m=0;m<v;++m)for(i.call(s,u[0][m],g=y[m],h[0][m][1]),f=1;f<d;++f)i.call(s,u[f][m],g+=h[f-1][m][1],h[f][m][1]);return l}return s.values=function(e){return arguments.length?(t=e,s):t},s.order=function(e){return arguments.length?(r="function"===typeof e?e:un.get(e)||pn,s):r},s.offset=function(e){return arguments.length?(n="function"===typeof e?e:hn.get(e)||dn,s):n},s.x=function(e){return arguments.length?(a=e,s):a},s.y=function(e){return arguments.length?(o=e,s):o},s.out=function(e){return arguments.length?(i=e,s):i},s};var un=e.map({"inside-out":function(t){var r,n,i=t.length,a=t.map(fn),o=t.map(mn),s=e.range(i).sort((function(e,t){return a[e]-a[t]})),l=0,c=0,u=[],h=[];for(r=0;r<i;++r)n=s[r],l<c?(l+=o[n],u.push(n)):(c+=o[n],h.push(n));return h.reverse().concat(u)},reverse:function(t){return e.range(t.length).reverse()},default:pn}),hn=e.map({silhouette:function(e){var t,r,n,i=e.length,a=e[0].length,o=[],s=0,l=[];for(r=0;r<a;++r){for(t=0,n=0;t<i;t++)n+=e[t][r][1];n>s&&(s=n),o.push(n)}for(r=0;r<a;++r)l[r]=(s-o[r])/2;return l},wiggle:function(e){var t,r,n,i,a,o,s,l,c,u=e.length,h=e[0],p=h.length,d=[];for(d[0]=l=c=0,r=1;r<p;++r){for(t=0,i=0;t<u;++t)i+=e[t][r][1];for(t=0,a=0,s=h[r][0]-h[r-1][0];t<u;++t){for(n=0,o=(e[t][r][1]-e[t][r-1][1])/(2*s);n<t;++n)o+=(e[n][r][1]-e[n][r-1][1])/s;a+=o*e[t][r][1]}d[r]=l-=i?a/i*s:0,l<c&&(c=l)}for(r=0;r<p;++r)d[r]-=c;return d},expand:function(e){var t,r,n,i=e.length,a=e[0].length,o=1/i,s=[];for(r=0;r<a;++r){for(t=0,n=0;t<i;t++)n+=e[t][r][1];if(n)for(t=0;t<i;t++)e[t][r][1]/=n;else for(t=0;t<i;t++)e[t][r][1]=o}for(r=0;r<a;++r)s[r]=0;return s},zero:dn});function pn(t){return e.range(t.length)}function dn(e){for(var t=-1,r=e[0].length,n=[];++t<r;)n[t]=0;return n}function fn(e){for(var t,r=1,n=0,i=e[0][1],a=e.length;r<a;++r)(t=e[r][1])>i&&(n=r,i=t);return n}function mn(e){return e.reduce(gn,0)}function gn(e,t){return e+t[1]}function yn(e,t){return vn(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function vn(e,t){for(var r=-1,n=+e[0],i=(e[1]-n)/t,a=[];++r<=t;)a[r]=i*r+n;return a}function xn(t){return[e.min(t),e.max(t)]}function bn(e,t){return e.value-t.value}function _n(e,t){var r=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=r,r._pack_prev=t}function wn(e,t){e._pack_next=t,t._pack_prev=e}function kn(e,t){var r=t.x-e.x,n=t.y-e.y,i=e.r+t.r;return.999*i*i>r*r+n*n}function Tn(e){if((t=e.children)&&(l=t.length)){var t,r,n,i,a,o,s,l,c=1/0,u=-1/0,h=1/0,p=-1/0;if(t.forEach(Sn),(r=t[0]).x=-r.r,r.y=0,x(r),l>1&&((n=t[1]).x=n.r,n.y=0,x(n),l>2))for(En(r,n,i=t[2]),x(i),_n(r,i),r._pack_prev=i,_n(i,n),n=r._pack_next,a=3;a<l;a++){En(r,n,i=t[a]);var d=0,f=1,m=1;for(o=n._pack_next;o!==n;o=o._pack_next,f++)if(kn(o,i)){d=1;break}if(1==d)for(s=r._pack_prev;s!==o._pack_prev&&!kn(s,i);s=s._pack_prev,m++);d?(f<m||f==m&&n.r<r.r?wn(r,n=o):wn(r=s,n),a--):(_n(r,i),n=i,x(i))}var g=(c+u)/2,y=(h+p)/2,v=0;for(a=0;a<l;a++)(i=t[a]).x-=g,i.y-=y,v=Math.max(v,i.r+Math.sqrt(i.x*i.x+i.y*i.y));e.r=v,t.forEach(An)}function x(e){c=Math.min(e.x-e.r,c),u=Math.max(e.x+e.r,u),h=Math.min(e.y-e.r,h),p=Math.max(e.y+e.r,p)}}function Sn(e){e._pack_next=e._pack_prev=e}function An(e){delete e._pack_next,delete e._pack_prev}function Mn(e,t,r,n){var i=e.children;if(e.x=t+=n*e.x,e.y=r+=n*e.y,e.r*=n,i)for(var a=-1,o=i.length;++a<o;)Mn(i[a],t,r,n)}function En(e,t,r){var n=e.r+r.r,i=t.x-e.x,a=t.y-e.y;if(n&&(i||a)){var o=t.r+r.r,s=i*i+a*a,l=.5+((n*=n)-(o*=o))/(2*s),c=Math.sqrt(Math.max(0,2*o*(n+s)-(n-=s)*n-o*o))/(2*s);r.x=e.x+l*i+c*a,r.y=e.y+l*a-c*i}else r.x=e.x+n,r.y=e.y}function Cn(e,t){return e.parent==t.parent?1:2}function Pn(e){var t=e.children;return t.length?t[0]:e.t}function Ln(e){var t,r=e.children;return(t=r.length)?r[t-1]:e.t}function In(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function zn(e,t,r){return e.a.parent===t.parent?e.a:r}function On(e){var t=e.children;return t&&t.length?On(t[0]):e}function Rn(e){var t,r=e.children;return r&&(t=r.length)?Rn(r[t-1]):e}function Dn(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function jn(e,t){var r=e.x+t[3],n=e.y+t[0],i=e.dx-t[1]-t[3],a=e.dy-t[0]-t[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Fn(e){var t=e[0],r=e[e.length-1];return t<r?[t,r]:[r,t]}function Bn(e){return e.rangeExtent?e.rangeExtent():Fn(e.range())}function Nn(e,t,r,n){var i=r(e[0],e[1]),a=n(t[0],t[1]);return function(e){return a(i(e))}}function Un(e,t){var r,n=0,i=e.length-1,a=e[n],o=e[i];return o<a&&(r=n,n=i,i=r,r=a,a=o,o=r),e[n]=t.floor(a),e[i]=t.ceil(o),e}function Vn(e){return e?{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}:qn}e.layout.histogram=function(){var t=!0,r=Number,n=xn,i=yn;function a(a,o){for(var s,l,c=[],u=a.map(r,this),h=n.call(this,u,o),p=i.call(this,h,u,o),d=(o=-1,u.length),f=p.length-1,m=t?1:1/d;++o<f;)(s=c[o]=[]).dx=p[o+1]-(s.x=p[o]),s.y=0;if(f>0)for(o=-1;++o<d;)(l=u[o])>=h[0]&&l<=h[1]&&((s=c[e.bisect(p,l,1,f)-1]).y+=m,s.push(a[o]));return c}return a.value=function(e){return arguments.length?(r=e,a):r},a.range=function(e){return arguments.length?(n=ht(e),a):n},a.bins=function(e){return arguments.length?(i="number"===typeof e?function(t){return vn(t,e)}:ht(e),a):i},a.frequency=function(e){return arguments.length?(t=!!e,a):t},a},e.layout.pack=function(){var t,r=e.layout.hierarchy().sort(bn),n=0,i=[1,1];function a(e,a){var o=r.call(this,e,a),s=o[0],l=i[0],c=i[1],u=null==t?Math.sqrt:"function"===typeof t?t:function(){return t};if(s.x=s.y=0,en(s,(function(e){e.r=+u(e.value)})),en(s,Tn),n){var h=n*(t?1:Math.max(2*s.r/l,2*s.r/c))/2;en(s,(function(e){e.r+=h})),en(s,Tn),en(s,(function(e){e.r-=h}))}return Mn(s,l/2,c/2,t?1:1/Math.max(2*s.r/l,2*s.r/c)),o}return a.size=function(e){return arguments.length?(i=e,a):i},a.radius=function(e){return arguments.length?(t=null==e||"function"===typeof e?e:+e,a):t},a.padding=function(e){return arguments.length?(n=+e,a):n},Jr(a,r)},e.layout.tree=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=null;function a(e,a){var c=t.call(this,e,a),u=c[0],h=function(e){for(var t,r={A:null,children:[e]},n=[r];null!=(t=n.pop());)for(var i,a=t.children,o=0,s=a.length;o<s;++o)n.push((a[o]=i={_:a[o],parent:t,children:(i=a[o].children)&&i.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=i);return r.children[0]}(u);if(en(h,o),h.parent.m=-h.z,Qr(h,s),i)Qr(u,l);else{var p=u,d=u,f=u;Qr(u,(function(e){e.x<p.x&&(p=e),e.x>d.x&&(d=e),e.depth>f.depth&&(f=e)}));var m=r(p,d)/2-p.x,g=n[0]/(d.x+r(d,p)/2+m),y=n[1]/(f.depth||1);Qr(u,(function(e){e.x=(e.x+m)*g,e.y=e.depth*y}))}return c}function o(e){var t=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(t.length){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var a=(t[0].z+t[t.length-1].z)/2;i?(e.z=i.z+r(e._,i._),e.m=e.z-a):e.z=a}else i&&(e.z=i.z+r(e._,i._));e.parent.A=function(e,t,n){if(t){for(var i,a=e,o=e,s=t,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=Ln(s),a=Pn(a),s&&a;)l=Pn(l),(o=Ln(o)).a=e,(i=s.z+h-a.z-c+r(s._,a._))>0&&(In(zn(s,e,n),e,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!Ln(o)&&(o.t=s,o.m+=h-u),a&&!Pn(l)&&(l.t=a,l.m+=c-p,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=n[0],e.y=e.depth*n[1]}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e)?l:null,a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null==(n=e)?null:l,a):i?n:null},Jr(a,t)},e.layout.cluster=function(){var t=e.layout.hierarchy().sort(null).value(null),r=Cn,n=[1,1],i=!1;function a(a,o){var s,l=t.call(this,a,o),c=l[0],u=0;en(c,(function(t){var n=t.children;n&&n.length?(t.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(n),t.y=function(t){return 1+e.max(t,(function(e){return e.y}))}(n)):(t.x=s?u+=r(t,s):0,t.y=0,s=t)}));var h=On(c),p=Rn(c),d=h.x-r(h,p)/2,f=p.x+r(p,h)/2;return en(c,i?function(e){e.x=(e.x-c.x)*n[0],e.y=(c.y-e.y)*n[1]}:function(e){e.x=(e.x-d)/(f-d)*n[0],e.y=(1-(c.y?e.y/c.y:1))*n[1]}),l}return a.separation=function(e){return arguments.length?(r=e,a):r},a.size=function(e){return arguments.length?(i=null==(n=e),a):i?null:n},a.nodeSize=function(e){return arguments.length?(i=null!=(n=e),a):i?n:null},Jr(a,t)},e.layout.treemap=function(){var t,r=e.layout.hierarchy(),n=Math.round,i=[1,1],a=null,o=Dn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,i=-1,a=e.length;++i<a;)n=(r=e[i]).value*(t<0?0:t),r.area=isNaN(n)||n<=0?0:n}function h(e){var t=e.children;if(t&&t.length){var r,n,i,a=o(e),s=[],c=t.slice(),p=1/0,m="slice"===l?a.dx:"dice"===l?a.dy:"slice-dice"===l?1&e.depth?a.dy:a.dx:Math.min(a.dx,a.dy);for(u(c,a.dx*a.dy/e.value),s.area=0;(i=c.length)>0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=d(s,m))<=p?(c.pop(),p=n):(s.area-=s.pop().area,f(s,m,a,!1),m=Math.min(a.dx,a.dy),s.length=s.area=0,p=1/0);s.length&&(f(s,m,a,!0),s.length=s.area=0),t.forEach(h)}}function p(e){var t=e.children;if(t&&t.length){var r,n=o(e),i=t.slice(),a=[];for(u(i,n.dx*n.dy/e.value),a.area=0;r=i.pop();)a.push(r),a.area+=r.area,null!=r.z&&(f(a,r.z?n.dx:n.dy,n,!i.length),a.length=a.area=0);t.forEach(p)}}function d(e,t){for(var r,n=e.area,i=0,a=1/0,o=-1,s=e.length;++o<s;)(r=e[o].area)&&(r<a&&(a=r),r>i&&(i=r));return t*=t,(n*=n)?Math.max(t*i*c/n,n/(t*a*c)):1/0}function f(e,t,r,i){var a,o=-1,s=e.length,l=r.x,c=r.y,u=t?n(e.area/t):0;if(t==r.dx){for((i||u>r.dy)&&(u=r.dy);++o<s;)(a=e[o]).x=l,a.y=c,a.dy=u,l+=a.dx=Math.min(r.x+r.dx-l,u?n(a.area/u):0);a.z=!0,a.dx+=r.x+r.dx-l,r.y+=u,r.dy-=u}else{for((i||u>r.dx)&&(u=r.dx);++o<s;)(a=e[o]).x=l,a.y=c,a.dx=u,c+=a.dy=Math.min(r.y+r.dy-c,u?n(a.area/u):0);a.z=!1,a.dy+=r.y+r.dy-c,r.x+=u,r.dx-=u}}function m(e){var n=t||r(e),a=n[0];return a.x=a.y=0,a.value?(a.dx=i[0],a.dy=i[1]):a.dx=a.dy=0,t&&r.revalue(a),u([a],a.dx*a.dy/a.value),(t?p:h)(a),s&&(t=n),n}return m.size=function(e){return arguments.length?(i=e,m):i},m.padding=function(e){if(!arguments.length)return a;function t(t){return jn(t,e)}var r;return o=null==(a=e)?Dn:"function"===(r=typeof e)?function(t){var r=e.call(m,t,t.depth);return null==r?Dn(t):jn(t,"number"===typeof r?[r,r,r,r]:r)}:"number"===r?(e=[e,e,e,e],t):t,m},m.round=function(e){return arguments.length?(n=e?Math.round:Number,m):n!=Number},m.sticky=function(e){return arguments.length?(s=e,t=null,m):s},m.ratio=function(e){return arguments.length?(c=e,m):c},m.mode=function(e){return arguments.length?(l=e+"",m):l},Jr(m,r)},e.random={normal:function(e,t){var r=arguments.length;return r<2&&(t=1),r<1&&(e=0),function(){var r,n,i;do{i=(r=2*Math.random()-1)*r+(n=2*Math.random()-1)*n}while(!i||i>1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=e.random.normal.apply(e,arguments);return function(){return Math.exp(t())}},bates:function(t){var r=e.random.irwinHall(t);return function(){return r()/t}},irwinHall:function(e){return function(){for(var t=0,r=0;r<e;r++)t+=Math.random();return t}}},e.scale={};var qn={floor:C,ceil:C};function Hn(t,r,n,i){var a=[],o=[],s=0,l=Math.min(t.length,r.length)-1;for(t[l]<t[0]&&(t=t.slice().reverse(),r=r.slice().reverse());++s<=l;)a.push(n(t[s-1],t[s])),o.push(i(r[s-1],r[s]));return function(r){var n=e.bisect(t,r,1,l)-1;return o[n](a[n](r))}}function Gn(e,t,r,n){var i,a;function o(){var o=Math.min(e.length,t.length)>2?Hn:Nn,l=n?Ur:Nr;return i=o(e,t,l,r),a=o(t,e,l,xr),s}function s(e){return i(e)}return s.invert=function(e){return a(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},s.range=function(e){return arguments.length?(t=e,o()):t},s.rangeRound=function(e){return s.range(e).interpolate(zr)},s.clamp=function(e){return arguments.length?(n=e,o()):n},s.interpolate=function(e){return arguments.length?(r=e,o()):r},s.ticks=function(t){return Xn(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return $n(e,t),o()},s.copy=function(){return Gn(e,t,r,n)},o()}function Wn(t,r){return e.rebind(t,r,"range","rangeRound","interpolate","clamp")}function $n(e,t){return Un(e,Vn(Zn(e,t)[2])),Un(e,Vn(Zn(e,t)[2])),e}function Zn(e,t){null==t&&(t=10);var r=Fn(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),a=t/n*i;return a<=.15?i*=10:a<=.35?i*=5:a<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Xn(t,r){return e.range.apply(e,Zn(t,r))}function Yn(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function a(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function o(t){return e(i(t))}return o.invert=function(t){return a(e.invert(t))},o.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),o):n},o.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),o):t},o.nice=function(){var t=Un(n.map(i),r?Math:Kn);return e.domain(t),n=t.map(a),o},o.ticks=function(){var e=Fn(n),o=[],s=e[0],l=e[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=t%1?2:t;if(isFinite(u-c)){if(r){for(;c<u;c++)for(var p=1;p<h;p++)o.push(a(c)*p);o.push(a(c))}else for(o.push(a(c));c++<u;)for(p=h-1;p>0;p--)o.push(a(c)*p);for(c=0;o[c]<s;c++);for(u=o.length;o[u-1]>l;u--);o=o.slice(c,u)}return o},o.copy=function(){return Yn(e.copy(),t,r,n)},Wn(o,e)}e.scale.linear=function(){return Gn([0,1],[0,1],xr,!1)},e.scale.log=function(){return Yn(e.scale.linear().domain([0,1]),10,!0,[1,10])};var Kn={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function Jn(e,t,r){var n=Qn(t),i=Qn(1/t);function a(t){return e(n(t))}return a.invert=function(t){return i(e.invert(t))},a.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),a):r},a.ticks=function(e){return Xn(r,e)},a.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},a.nice=function(e){return a.domain($n(r,e))},a.exponent=function(o){return arguments.length?(n=Qn(t=o),i=Qn(1/t),e.domain(r.map(n)),a):t},a.copy=function(){return Jn(e.copy(),t,r)},Wn(a,e)}function Qn(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ei(t,r){var n,i,a;function o(e){return i[((n.get(e)||("range"===r.t?n.set(e,t.push(e)):NaN))-1)%i.length]}function s(r,n){return e.range(t.length).map((function(e){return r+n*e}))}return o.domain=function(e){if(!arguments.length)return t;t=[],n=new b;for(var i,a=-1,s=e.length;++a<s;)n.has(i=e[a])||n.set(i,t.push(i));return o[r.t].apply(o,r.a)},o.range=function(e){return arguments.length?(i=e,a=0,r={t:"range",a:arguments},o):i},o.rangePoints=function(e,n){arguments.length<2&&(n=0);var l=e[0],c=e[1],u=t.length<2?(l=(l+c)/2,0):(c-l)/(t.length-1+n);return i=s(l+u*n/2,u),a=0,r={t:"rangePoints",a:arguments},o},o.rangeRoundPoints=function(e,n){arguments.length<2&&(n=0);var l=e[0],c=e[1],u=t.length<2?(l=c=Math.round((l+c)/2),0):(c-l)/(t.length-1+n)|0;return i=s(l+Math.round(u*n/2+(c-l-(t.length-1+n)*u)/2),u),a=0,r={t:"rangeRoundPoints",a:arguments},o},o.rangeBands=function(e,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=e[1]<e[0],u=e[c-0],h=(e[1-c]-u)/(t.length-n+2*l);return i=s(u+h*l,h),c&&i.reverse(),a=h*(1-n),r={t:"rangeBands",a:arguments},o},o.rangeRoundBands=function(e,n,l){arguments.length<2&&(n=0),arguments.length<3&&(l=n);var c=e[1]<e[0],u=e[c-0],h=e[1-c],p=Math.floor((h-u)/(t.length-n+2*l));return i=s(u+Math.round((h-u-(t.length-n)*p)/2),p),c&&i.reverse(),a=Math.round(p*(1-n)),r={t:"rangeRoundBands",a:arguments},o},o.rangeBand=function(){return a},o.rangeExtent=function(){return Fn(r.a[0])},o.copy=function(){return ei(t,r)},o.domain(t)}e.scale.pow=function(){return Jn(e.scale.linear(),1,[0,1])},e.scale.sqrt=function(){return e.scale.pow().exponent(.5)},e.scale.ordinal=function(){return ei([],{t:"range",a:[[]]})},e.scale.category10=function(){return e.scale.ordinal().range(ti)},e.scale.category20=function(){return e.scale.ordinal().range(ri)},e.scale.category20b=function(){return e.scale.ordinal().range(ni)},e.scale.category20c=function(){return e.scale.ordinal().range(ii)};var ti=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(rt),ri=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(rt),ni=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(rt),ii=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(rt);function ai(t,r){var n;function i(){var i=0,o=r.length;for(n=[];++i<o;)n[i-1]=e.quantile(t,i/o);return a}function a(t){if(!isNaN(t=+t))return r[e.bisect(n,t)]}return a.domain=function(e){return arguments.length?(t=e.map(d).filter(f).sort(p),i()):t},a.range=function(e){return arguments.length?(r=e,i()):r},a.quantiles=function(){return n},a.invertExtent=function(e){return(e=r.indexOf(e))<0?[NaN,NaN]:[e>0?n[e-1]:t[0],e<n.length?n[e]:t[t.length-1]]},a.copy=function(){return ai(t,r)},i()}function oi(e,t,r){var n,i;function a(t){return r[Math.max(0,Math.min(i,Math.floor(n*(t-e))))]}function o(){return n=r.length/(t-e),i=r.length-1,a}return a.domain=function(r){return arguments.length?(e=+r[0],t=+r[r.length-1],o()):[e,t]},a.range=function(e){return arguments.length?(r=e,o()):r},a.invertExtent=function(t){return[t=(t=r.indexOf(t))<0?NaN:t/n+e,t+1/n]},a.copy=function(){return oi(e,t,r)},o()}function si(t,r){function n(n){if(n<=n)return r[e.bisect(t,n)]}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(e){return arguments.length?(r=e,n):r},n.invertExtent=function(e){return e=r.indexOf(e),[t[e-1],t[e]]},n.copy=function(){return si(t,r)},n}function li(e){function t(e){return+e}return t.invert=t,t.domain=t.range=function(r){return arguments.length?(e=r.map(t),t):e},t.ticks=function(t){return Xn(e,t)},t.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},t.copy=function(){return li(e)},t}function ci(){return 0}e.scale.quantile=function(){return ai([],[])},e.scale.quantize=function(){return oi(0,1,[0,1])},e.scale.threshold=function(){return si([.5],[0,1])},e.scale.identity=function(){return li([0,1])},e.svg={},e.svg.arc=function(){var e=hi,t=pi,r=ci,n=ui,i=di,a=fi,o=mi;function s(){var s=Math.max(0,+e.apply(this,arguments)),c=Math.max(0,+t.apply(this,arguments)),u=i.apply(this,arguments)-Me,h=a.apply(this,arguments)-Me,p=Math.abs(h-u),d=u>h?0:1;if(c<s&&(f=c,c=s,s=f),p>=Ae)return l(c,d)+(s?l(s,1-d):"")+"Z";var f,m,g,y,v,x,b,_,w,k,T,S,A=0,M=0,E=[];if((y=(+o.apply(this,arguments)||0)/2)&&(g=n===ui?Math.sqrt(s*s+c*c):+n.apply(this,arguments),d||(M*=-1),c&&(M=Pe(g/c*Math.sin(y))),s&&(A=Pe(g/s*Math.sin(y)))),c){v=c*Math.cos(u+M),x=c*Math.sin(u+M),b=c*Math.cos(h-M),_=c*Math.sin(h-M);var C=Math.abs(h-u-2*M)<=Te?0:1;if(M&&gi(v,x,b,_)===d^C){var P=(u+h)/2;v=c*Math.cos(P),x=c*Math.sin(P),b=_=null}}else v=x=0;if(s){w=s*Math.cos(h-A),k=s*Math.sin(h-A),T=s*Math.cos(u+A),S=s*Math.sin(u+A);var L=Math.abs(u-h+2*A)<=Te?0:1;if(A&&gi(w,k,T,S)===1-d^L){var I=(u+h)/2;w=s*Math.cos(I),k=s*Math.sin(I),T=S=null}}else w=k=0;if(p>we&&(f=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s<c^d?0:1;var z=f,O=f;if(p<Te){var R=null==T?[w,k]:null==b?[v,x]:Ct([v,x],[T,S],[b,_],[w,k]),D=v-R[0],j=x-R[1],F=b-R[0],B=_-R[1],N=1/Math.sin(Math.acos((D*F+j*B)/(Math.sqrt(D*D+j*j)*Math.sqrt(F*F+B*B)))/2),U=Math.sqrt(R[0]*R[0]+R[1]*R[1]);O=Math.min(f,(s-U)/(N-1)),z=Math.min(f,(c-U)/(N+1))}if(null!=b){var V=yi(null==T?[w,k]:[T,S],[v,x],c,z,d),q=yi([b,_],[w,k],c,z,d);f===z?E.push("M",V[0],"A",z,",",z," 0 0,",m," ",V[1],"A",c,",",c," 0 ",1-d^gi(V[1][0],V[1][1],q[1][0],q[1][1]),",",d," ",q[1],"A",z,",",z," 0 0,",m," ",q[0]):E.push("M",V[0],"A",z,",",z," 0 1,",m," ",q[0])}else E.push("M",v,",",x);if(null!=T){var H=yi([v,x],[T,S],s,-O,d),G=yi([w,k],null==b?[v,x]:[b,_],s,-O,d);f===O?E.push("L",G[0],"A",O,",",O," 0 0,",m," ",G[1],"A",s,",",s," 0 ",d^gi(G[1][0],G[1][1],H[1][0],H[1][1]),",",1-d," ",H[1],"A",O,",",O," 0 0,",m," ",H[0]):E.push("L",G[0],"A",O,",",O," 0 0,",m," ",H[0])}else E.push("L",w,",",k)}else E.push("M",v,",",x),null!=b&&E.push("A",c,",",c," 0 ",C,",",d," ",b,",",_),E.push("L",w,",",k),null!=T&&E.push("A",s,",",s," 0 ",L,",",1-d," ",T,",",S);return E.push("Z"),E.join("")}function l(e,t){return"M0,"+e+"A"+e+","+e+" 0 1,"+t+" 0,"+-e+"A"+e+","+e+" 0 1,"+t+" 0,"+e}return s.innerRadius=function(t){return arguments.length?(e=ht(t),s):e},s.outerRadius=function(e){return arguments.length?(t=ht(e),s):t},s.cornerRadius=function(e){return arguments.length?(r=ht(e),s):r},s.padRadius=function(e){return arguments.length?(n=e==ui?ui:ht(e),s):n},s.startAngle=function(e){return arguments.length?(i=ht(e),s):i},s.endAngle=function(e){return arguments.length?(a=ht(e),s):a},s.padAngle=function(e){return arguments.length?(o=ht(e),s):o},s.centroid=function(){var r=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,n=(+i.apply(this,arguments)+ +a.apply(this,arguments))/2-Me;return[Math.cos(n)*r,Math.sin(n)*r]},s};var ui="auto";function hi(e){return e.innerRadius}function pi(e){return e.outerRadius}function di(e){return e.startAngle}function fi(e){return e.endAngle}function mi(e){return e&&e.padAngle}function gi(e,t,r,n){return(e-r)*t-(t-n)*e>0?0:1}function yi(e,t,r,n,i){var a=e[0]-t[0],o=e[1]-t[1],s=(i?n:-n)/Math.sqrt(a*a+o*o),l=s*o,c=-s*a,u=e[0]+l,h=e[1]+c,p=t[0]+l,d=t[1]+c,f=(u+p)/2,m=(h+d)/2,g=p-u,y=d-h,v=g*g+y*y,x=r-n,b=u*d-p*h,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-b*b)),w=(b*y-g*_)/v,k=(-b*g-y*_)/v,T=(b*y+g*_)/v,S=(-b*g+y*_)/v,A=w-f,M=k-m,E=T-f,C=S-m;return A*A+M*M>E*E+C*C&&(w=T,k=S),[[w-l,k-c],[w*r/x,k*r/x]]}function vi(){return!0}function xi(e){var t=kt,r=Tt,n=vi,i=_i,a=i.key,o=.7;function s(a){var s,l=[],c=[],u=-1,h=a.length,p=ht(t),d=ht(r);function f(){l.push("M",i(e(c),o))}for(;++u<h;)n.call(this,s=a[u],u)?c.push([+p.call(this,s,u),+d.call(this,s,u)]):c.length&&(f(),c=[]);return c.length&&f(),l.length?l.join(""):null}return s.x=function(e){return arguments.length?(t=e,s):t},s.y=function(e){return arguments.length?(r=e,s):r},s.defined=function(e){return arguments.length?(n=e,s):n},s.interpolate=function(e){return arguments.length?(a="function"===typeof e?i=e:(i=bi.get(e)||_i).key,s):a},s.tension=function(e){return arguments.length?(o=e,s):o},s}e.svg.line=function(){return xi(C)};var bi=e.map({linear:_i,"linear-closed":wi,step:function(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("H",(n[0]+(n=e[t])[0])/2,"V",n[1]);return r>1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ti,basis:Mi,"basis-open":function(e){if(e.length<4)return _i(e);for(var t,r=[],n=-1,i=e.length,a=[0],o=[0];++n<3;)t=e[n],a.push(t[0]),o.push(t[1]);for(r.push(Ei(Li,a)+","+Ei(Li,o)),--n;++n<i;)t=e[n],a.shift(),a.push(t[0]),o.shift(),o.push(t[1]),Ii(r,a,o);return r.join("")},"basis-closed":function(e){for(var t,r,n=-1,i=e.length,a=i+4,o=[],s=[];++n<4;)r=e[n%i],o.push(r[0]),s.push(r[1]);for(t=[Ei(Li,o),",",Ei(Li,s)],--n;++n<a;)r=e[n%i],o.shift(),o.push(r[0]),s.shift(),s.push(r[1]),Ii(t,o,s);return t.join("")},bundle:function(e,t){var r=e.length-1;if(r)for(var n,i,a=e[0][0],o=e[0][1],s=e[r][0]-a,l=e[r][1]-o,c=-1;++c<=r;)i=c/r,(n=e[c])[0]=t*n[0]+(1-t)*(a+i*s),n[1]=t*n[1]+(1-t)*(o+i*l);return Mi(e)},cardinal:function(e,t){return e.length<3?_i(e):e[0]+Si(e,Ai(e,t))},"cardinal-open":function(e,t){return e.length<4?_i(e):e[1]+Si(e.slice(1,-1),Ai(e,t))},"cardinal-closed":function(e,t){return e.length<3?wi(e):e[0]+Si((e.push(e[0]),e),Ai([e[e.length-2]].concat(e,[e[1]]),t))},monotone:function(e){return e.length<3?_i(e):e[0]+Si(e,function(e){for(var t,r,n,i,a=[],o=function(e){for(var t=0,r=e.length-1,n=[],i=e[0],a=e[1],o=n[0]=zi(i,a);++t<r;)n[t]=(o+(o=zi(i=a,a=e[t+1])))/2;return n[t]=o,n}(e),s=-1,l=e.length-1;++s<l;)t=zi(e[s],e[s+1]),v(t)<we?o[s]=o[s+1]=0:(i=(r=o[s]/t)*r+(n=o[s+1]/t)*n)>9&&(i=3*t/Math.sqrt(i),o[s]=i*r,o[s+1]=i*n);for(s=-1;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+o[s]*o[s])),a.push([i||0,o[s]*i||0]);return a}(e))}});function _i(e){return e.length>1?e.join("L"):e+"Z"}function wi(e){return e.join("L")+"Z"}function ki(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("V",(n=e[t])[1],"H",n[0]);return i.join("")}function Ti(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t<r;)i.push("H",(n=e[t])[0],"V",n[1]);return i.join("")}function Si(e,t){if(t.length<1||e.length!=t.length&&e.length!=t.length+2)return _i(e);var r=e.length!=t.length,n="",i=e[0],a=e[1],o=t[0],s=o,l=1;if(r&&(n+="Q"+(a[0]-2*o[0]/3)+","+(a[1]-2*o[1]/3)+","+a[0]+","+a[1],i=e[1],l=2),t.length>1){s=t[1],a=e[l],l++,n+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1];for(var c=2;c<t.length;c++,l++)a=e[l],s=t[c],n+="S"+(a[0]-s[0])+","+(a[1]-s[1])+","+a[0]+","+a[1]}if(r){var u=e[l];n+="Q"+(a[0]+2*s[0]/3)+","+(a[1]+2*s[1]/3)+","+u[0]+","+u[1]}return n}function Ai(e,t){for(var r,n=[],i=(1-t)/2,a=e[0],o=e[1],s=1,l=e.length;++s<l;)r=a,a=o,o=e[s],n.push([i*(o[0]-r[0]),i*(o[1]-r[1])]);return n}function Mi(e){if(e.length<3)return _i(e);var t=1,r=e.length,n=e[0],i=n[0],a=n[1],o=[i,i,i,(n=e[1])[0]],s=[a,a,a,n[1]],l=[i,",",a,"L",Ei(Li,o),",",Ei(Li,s)];for(e.push(e[r-1]);++t<=r;)n=e[t],o.shift(),o.push(n[0]),s.shift(),s.push(n[1]),Ii(l,o,s);return e.pop(),l.push("L",n),l.join("")}function Ei(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}bi.forEach((function(e,t){t.key=e,t.closed=/-closed$/.test(e)}));var Ci=[0,2/3,1/3,0],Pi=[0,1/3,2/3,0],Li=[0,1/6,2/3,1/6];function Ii(e,t,r){e.push("C",Ei(Ci,t),",",Ei(Ci,r),",",Ei(Pi,t),",",Ei(Pi,r),",",Ei(Li,t),",",Ei(Li,r))}function zi(e,t){return(t[1]-e[1])/(t[0]-e[0])}function Oi(e){for(var t,r,n,i=-1,a=e.length;++i<a;)r=(t=e[i])[0],n=t[1]-Me,t[0]=r*Math.cos(n),t[1]=r*Math.sin(n);return e}function Ri(e){var t=kt,r=kt,n=0,i=Tt,a=vi,o=_i,s=o.key,l=o,c="L",u=.7;function h(s){var h,p,d,f=[],m=[],g=[],y=-1,v=s.length,x=ht(t),b=ht(n),_=t===r?function(){return p}:ht(r),w=n===i?function(){return d}:ht(i);function k(){f.push("M",o(e(g),u),c,l(e(m.reverse()),u),"Z")}for(;++y<v;)a.call(this,h=s[y],y)?(m.push([p=+x.call(this,h,y),d=+b.call(this,h,y)]),g.push([+_.call(this,h,y),+w.call(this,h,y)])):m.length&&(k(),m=[],g=[]);return m.length&&k(),f.length?f.join(""):null}return h.x=function(e){return arguments.length?(t=r=e,h):r},h.x0=function(e){return arguments.length?(t=e,h):t},h.x1=function(e){return arguments.length?(r=e,h):r},h.y=function(e){return arguments.length?(n=i=e,h):i},h.y0=function(e){return arguments.length?(n=e,h):n},h.y1=function(e){return arguments.length?(i=e,h):i},h.defined=function(e){return arguments.length?(a=e,h):a},h.interpolate=function(e){return arguments.length?(s="function"===typeof e?o=e:(o=bi.get(e)||_i).key,l=o.reverse||o,c=o.closed?"M":"L",h):s},h.tension=function(e){return arguments.length?(u=e,h):u},h}function Di(e){return e.source}function ji(e){return e.target}function Fi(e){return e.radius}function Bi(e){return[e.x,e.y]}function Ni(){return 64}function Ui(){return"circle"}function Vi(e){var t=Math.sqrt(e/Te);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}e.svg.line.radial=function(){var e=xi(Oi);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},ki.reverse=Ti,Ti.reverse=ki,e.svg.area=function(){return Ri(C)},e.svg.area.radial=function(){var e=Ri(Oi);return e.radius=e.x,delete e.x,e.innerRadius=e.x0,delete e.x0,e.outerRadius=e.x1,delete e.x1,e.angle=e.y,delete e.y,e.startAngle=e.y0,delete e.y0,e.endAngle=e.y1,delete e.y1,e},e.svg.chord=function(){var e=Di,t=ji,r=Fi,n=di,i=fi;function a(r,n){var i,a,c=o(this,e,r,n),u=o(this,t,r,n);return"M"+c.p0+s(c.r,c.p1,c.a1-c.a0)+(a=u,((i=c).a0==a.a0&&i.a1==a.a1?l(c.r,c.p1,c.r,c.p0):l(c.r,c.p1,u.r,u.p0)+s(u.r,u.p1,u.a1-u.a0)+l(u.r,u.p1,c.r,c.p0))+"Z")}function o(e,t,a,o){var s=t.call(e,a,o),l=r.call(e,s,o),c=n.call(e,s,o)-Me,u=i.call(e,s,o)-Me;return{r:l,a0:c,a1:u,p0:[l*Math.cos(c),l*Math.sin(c)],p1:[l*Math.cos(u),l*Math.sin(u)]}}function s(e,t,r){return"A"+e+","+e+" 0 "+ +(r>Te)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return a.radius=function(e){return arguments.length?(r=ht(e),a):r},a.source=function(t){return arguments.length?(e=ht(t),a):e},a.target=function(e){return arguments.length?(t=ht(e),a):t},a.startAngle=function(e){return arguments.length?(n=ht(e),a):n},a.endAngle=function(e){return arguments.length?(i=ht(e),a):i},a},e.svg.diagonal=function(){var e=Di,t=ji,r=Bi;function n(n,i){var a=e.call(this,n,i),o=t.call(this,n,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=ht(t),n):e},n.target=function(e){return arguments.length?(t=ht(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},e.svg.diagonal.radial=function(){var t=e.svg.diagonal(),r=Bi,n=t.projection;return t.projection=function(e){return arguments.length?n(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Me;return[r*Math.cos(n),r*Math.sin(n)]}}(r=e)):r},t},e.svg.symbol=function(){var e=Ui,t=Ni;function r(r,n){return(qi.get(e.call(this,r,n))||Vi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=ht(t),r):e},r.size=function(e){return arguments.length?(t=ht(e),r):t},r};var qi=e.map({circle:Vi,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Gi)),r=t*Gi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Hi),r=t*Hi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Hi),r=t*Hi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});e.svg.symbolTypes=qi.keys();var Hi=Math.sqrt(3),Gi=Math.tan(30*Ee);G.transition=function(e){for(var t,r,n=Xi||++Ji,i=ta(e),a=[],o=Yi||{time:Date.now(),ease:Er,delay:0,duration:250},s=-1,l=this.length;++s<l;){a.push(t=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(r=c[u])&&ra(r,u,i,n,o),t.push(r)}return Zi(a,i,n)},G.interrupt=function(e){return this.each(null==e?Wi:$i(ta(e)))};var Wi=$i(ta());function $i(e){return function(){var t,r,n;(t=this[e])&&(n=t[r=t.active])&&(n.timer.c=null,n.timer.t=NaN,--t.count?delete t[r]:delete this[e],t.active+=.5,n.event&&n.event.interrupt.call(this,this.__data__,n.index))}}function Zi(e,t,r){return N(e,Ki),e.namespace=t,e.id=r,e}var Xi,Yi,Ki=[],Ji=0;function Qi(e,t,r,n){var i=e.id,a=e.namespace;return ce(e,"function"===typeof r?function(e,o,s){e[a][i].tween.set(t,n(r.call(e,e.__data__,o,s)))}:(r=n(r),function(e){e[a][i].tween.set(t,r)}))}function ea(e){return null==e&&(e=""),function(){this.textContent=e}}function ta(e){return null==e?"__transition__":"__transition_"+e+"__"}function ra(e,t,r,n,i){var a,o,s,l,c,u=e[r]||(e[r]={active:0,count:0}),h=u[n];function p(r){var i=u.active,p=u[i];for(var f in p&&(p.timer.c=null,p.timer.t=NaN,--u.count,delete u[i],p.event&&p.event.interrupt.call(e,e.__data__,p.index)),u)if(+f<n){var m=u[f];m.timer.c=null,m.timer.t=NaN,--u.count,delete u[f]}o.c=d,xt((function(){return o.c&&d(r||1)&&(o.c=null,o.t=NaN),1}),0,a),u.active=n,h.event&&h.event.start.call(e,e.__data__,t),c=[],h.tween.forEach((function(r,n){(n=n.call(e,e.__data__,t))&&c.push(n)})),l=h.ease,s=h.duration}function d(i){for(var a=i/s,o=l(a),p=c.length;p>0;)c[--p].call(e,o);if(a>=1)return h.event&&h.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}h||(a=i.time,o=xt((function(e){var t=h.delay;if(o.t=t+a,t<=e)return p(e-t);o.c=p}),0,a),h=u[n]={tween:new b,time:a,timer:o,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++u.count)}Ki.call=G.call,Ki.empty=G.empty,Ki.node=G.node,Ki.size=G.size,e.transition=function(t,r){return t&&t.transition?Xi?t.transition(r):t:e.selection().transition(t)},e.transition.prototype=Ki,Ki.select=function(e){var t,r,n,i=this.id,a=this.namespace,o=[];e=W(e);for(var s=-1,l=this.length;++s<l;){o.push(t=[]);for(var c=this[s],u=-1,h=c.length;++u<h;)(n=c[u])&&(r=e.call(n,n.__data__,u,s))?("__data__"in n&&(r.__data__=n.__data__),ra(r,u,a,i,n[a][i]),t.push(r)):t.push(null)}return Zi(o,a,i)},Ki.selectAll=function(e){var t,r,n,i,a,o=this.id,s=this.namespace,l=[];e=$(e);for(var c=-1,u=this.length;++c<u;)for(var h=this[c],p=-1,d=h.length;++p<d;)if(n=h[p]){a=n[s][o],r=e.call(n,n.__data__,p,c),l.push(t=[]);for(var f=-1,m=r.length;++f<m;)(i=r[f])&&ra(i,f,s,o,a),t.push(i)}return Zi(l,s,o)},Ki.filter=function(e){var t,r,n=[];"function"!==typeof e&&(e=se(e));for(var i=0,a=this.length;i<a;i++){n.push(t=[]);for(var o,s=0,l=(o=this[i]).length;s<l;s++)(r=o[s])&&e.call(r,r.__data__,s,i)&&t.push(r)}return Zi(n,this.namespace,this.id)},Ki.tween=function(e,t){var r=this.id,n=this.namespace;return arguments.length<2?this.node()[n][r].tween.get(e):ce(this,null==t?function(t){t[n][r].tween.remove(e)}:function(i){i[n][r].tween.set(e,t)})},Ki.attr=function(t,r){if(arguments.length<2){for(r in t)this.attr(r,t[r]);return this}var n="transform"==t?Br:xr,i=e.ns.qualify(t);function a(){this.removeAttribute(i)}function o(){this.removeAttributeNS(i.space,i.local)}return Qi(this,"attr."+t,r,i.local?function(e){return null==e?o:(e+="",function(){var t,r=this.getAttributeNS(i.space,i.local);return r!==e&&(t=n(r,e),function(e){this.setAttributeNS(i.space,i.local,t(e))})})}:function(e){return null==e?a:(e+="",function(){var t,r=this.getAttribute(i);return r!==e&&(t=n(r,e),function(e){this.setAttribute(i,t(e))})})})},Ki.attrTween=function(t,r){var n=e.ns.qualify(t);return this.tween("attr."+t,n.local?function(e,t){var i=r.call(this,e,t,this.getAttributeNS(n.space,n.local));return i&&function(e){this.setAttributeNS(n.space,n.local,i(e))}}:function(e,t){var i=r.call(this,e,t,this.getAttribute(n));return i&&function(e){this.setAttribute(n,i(e))}})},Ki.style=function(e,t,r){var n=arguments.length;if(n<3){if("string"!==typeof e){for(r in n<2&&(t=""),e)this.style(r,e[r],t);return this}r=""}function i(){this.style.removeProperty(e)}return Qi(this,"style."+e,t,(function(t){return null==t?i:(t+="",function(){var n,i=o(this).getComputedStyle(this,null).getPropertyValue(e);return i!==t&&(n=xr(i,t),function(t){this.style.setProperty(e,n(t),r)})})}))},Ki.styleTween=function(e,t,r){return arguments.length<3&&(r=""),this.tween("style."+e,(function(n,i){var a=t.call(this,n,i,o(this).getComputedStyle(this,null).getPropertyValue(e));return a&&function(t){this.style.setProperty(e,a(t),r)}}))},Ki.text=function(e){return Qi(this,"text",e,ea)},Ki.remove=function(){var e=this.namespace;return this.each("end.transition",(function(){var t;this[e].count<2&&(t=this.parentNode)&&t.removeChild(this)}))},Ki.ease=function(t){var r=this.id,n=this.namespace;return arguments.length<1?this.node()[n][r].ease:("function"!==typeof t&&(t=e.ease.apply(e,arguments)),ce(this,(function(e){e[n][r].ease=t})))},Ki.delay=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].delay:ce(this,"function"===typeof e?function(n,i,a){n[r][t].delay=+e.call(n,n.__data__,i,a)}:(e=+e,function(n){n[r][t].delay=e}))},Ki.duration=function(e){var t=this.id,r=this.namespace;return arguments.length<1?this.node()[r][t].duration:ce(this,"function"===typeof e?function(n,i,a){n[r][t].duration=Math.max(1,e.call(n,n.__data__,i,a))}:(e=Math.max(1,e),function(n){n[r][t].duration=e}))},Ki.each=function(t,r){var n=this.id,i=this.namespace;if(arguments.length<2){var a=Yi,o=Xi;try{Xi=n,ce(this,(function(e,r,a){Yi=e[i][n],t.call(e,e.__data__,r,a)}))}finally{Yi=a,Xi=o}}else ce(this,(function(a){var o=a[i][n];(o.event||(o.event=e.dispatch("start","end","interrupt"))).on(t,r)}));return this},Ki.transition=function(){for(var e,t,r,n=this.id,i=++Ji,a=this.namespace,o=[],s=0,l=this.length;s<l;s++){o.push(e=[]);for(var c,u=0,h=(c=this[s]).length;u<h;u++)(t=c[u])&&ra(t,u,a,i,{time:(r=t[a][n]).time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration}),e.push(t)}return Zi(o,a,i)},e.svg.axis=function(){var t,r=e.scale.linear(),i=na,a=6,o=6,s=3,l=[10],c=null;function u(n){n.each((function(){var n,u=e.select(this),h=this.__chart__||r,p=this.__chart__=r.copy(),d=null==c?p.ticks?p.ticks.apply(p,l):p.domain():c,f=null==t?p.tickFormat?p.tickFormat.apply(p,l):C:t,m=u.selectAll(".tick").data(d,p),g=m.enter().insert("g",".domain").attr("class","tick").style("opacity",we),y=e.transition(m.exit()).style("opacity",we).remove(),v=e.transition(m.order()).style("opacity",1),x=Math.max(a,0)+s,b=Bn(p),_=u.selectAll(".domain").data([0]),w=(_.enter().append("path").attr("class","domain"),e.transition(_));g.append("line"),g.append("text");var k,T,S,A,M=g.select("line"),E=v.select("line"),P=m.select("text").text(f),L=g.select("text"),I=v.select("text"),z="top"===i||"left"===i?-1:1;if("bottom"===i||"top"===i?(n=aa,k="x",S="y",T="x2",A="y2",P.attr("dy",z<0?"0em":".71em").style("text-anchor","middle"),w.attr("d","M"+b[0]+","+z*o+"V0H"+b[1]+"V"+z*o)):(n=oa,k="y",S="x",T="y2",A="x2",P.attr("dy",".32em").style("text-anchor",z<0?"end":"start"),w.attr("d","M"+z*o+","+b[0]+"H0V"+b[1]+"H"+z*o)),M.attr(A,z*a),L.attr(S,z*x),E.attr(T,0).attr(A,z*a),I.attr(k,0).attr(S,z*x),p.rangeBand){var O=p,R=O.rangeBand()/2;h=p=function(e){return O(e)+R}}else h.rangeBand?h=p:y.call(n,p,h);g.call(n,h,p),v.call(n,p,p)}))}return u.scale=function(e){return arguments.length?(r=e,u):r},u.orient=function(e){return arguments.length?(i=e in ia?e+"":na,u):i},u.ticks=function(){return arguments.length?(l=n(arguments),u):l},u.tickValues=function(e){return arguments.length?(c=e,u):c},u.tickFormat=function(e){return arguments.length?(t=e,u):t},u.tickSize=function(e){var t=arguments.length;return t?(a=+e,o=+arguments[t-1],u):a},u.innerTickSize=function(e){return arguments.length?(a=+e,u):a},u.outerTickSize=function(e){return arguments.length?(o=+e,u):o},u.tickPadding=function(e){return arguments.length?(s=+e,u):s},u.tickSubdivide=function(){return arguments.length&&u},u};var na="bottom",ia={top:1,right:1,bottom:1,left:1};function aa(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate("+(isFinite(n)?n:r(e))+",0)"}))}function oa(e,t,r){e.attr("transform",(function(e){var n=t(e);return"translate(0,"+(isFinite(n)?n:r(e))+")"}))}e.svg.brush=function(){var t,r,n=F(p,"brushstart","brush","brushend"),i=null,a=null,s=[0,0],l=[0,0],c=!0,u=!0,h=la[0];function p(t){t.each((function(){var t=e.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",g).on("touchstart.brush",g),r=t.selectAll(".background").data([0]);r.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var n=t.selectAll(".resize").data(h,C);n.exit().remove(),n.enter().append("g").attr("class",(function(e){return"resize "+e})).style("cursor",(function(e){return sa[e]})).append("rect").attr("x",(function(e){return/[ew]$/.test(e)?-3:null})).attr("y",(function(e){return/^[ns]/.test(e)?-3:null})).attr("width",6).attr("height",6).style("visibility","hidden"),n.style("display",p.empty()?"none":null);var o,s=e.transition(t),l=e.transition(r);i&&(o=Bn(i),l.attr("x",o[0]).attr("width",o[1]-o[0]),f(s)),a&&(o=Bn(a),l.attr("y",o[0]).attr("height",o[1]-o[0]),m(s)),d(s)}))}function d(e){e.selectAll(".resize").attr("transform",(function(e){return"translate("+s[+/e$/.test(e)]+","+l[+/^s/.test(e)]+")"}))}function f(e){e.select(".extent").attr("x",s[0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function m(e){e.select(".extent").attr("y",l[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1]-l[0])}function g(){var h,g,y=this,v=e.select(e.event.target),x=n.of(y,arguments),b=e.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&i,k=!/^(e|w)$/.test(_)&&a,T=v.classed("extent"),S=ve(y),A=e.mouse(y),M=e.select(o(y)).on("keydown.brush",(function(){32==e.event.keyCode&&(T||(h=null,A[0]-=s[1],A[1]-=l[1],T=2),D())})).on("keyup.brush",(function(){32==e.event.keyCode&&2==T&&(A[0]+=s[1],A[1]+=l[1],T=0,D())}));if(e.event.changedTouches?M.on("touchmove.brush",P).on("touchend.brush",I):M.on("mousemove.brush",P).on("mouseup.brush",I),b.interrupt().selectAll("*").interrupt(),T)A[0]=s[0]-A[0],A[1]=l[0]-A[1];else if(_){var E=+/w$/.test(_),C=+/^n/.test(_);g=[s[1-E]-A[0],l[1-C]-A[1]],A[0]=s[E],A[1]=l[C]}else e.event.altKey&&(h=A.slice());function P(){var t=e.mouse(y),r=!1;g&&(t[0]+=g[0],t[1]+=g[1]),T||(e.event.altKey?(h||(h=[(s[0]+s[1])/2,(l[0]+l[1])/2]),A[0]=s[+(t[0]<h[0])],A[1]=l[+(t[1]<h[1])]):h=null),w&&L(t,i,0)&&(f(b),r=!0),k&&L(t,a,1)&&(m(b),r=!0),r&&(d(b),x({type:"brush",mode:T?"move":"resize"}))}function L(e,n,i){var a,o,p=Bn(n),d=p[0],f=p[1],m=A[i],g=i?l:s,y=g[1]-g[0];if(T&&(d-=m,f-=y+m),a=(i?u:c)?Math.max(d,Math.min(f,e[i])):e[i],T?o=(a+=m)+y:(h&&(m=Math.max(d,Math.min(f,2*h[i]-a))),m<a?(o=a,a=m):o=m),g[0]!=a||g[1]!=o)return i?r=null:t=null,g[0]=a,g[1]=o,!0}function I(){P(),b.style("pointer-events","all").selectAll(".resize").style("display",p.empty()?"none":null),e.select("body").style("cursor",null),M.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),S(),x({type:"brushend"})}b.style("pointer-events","none").selectAll(".resize").style("display",null),e.select("body").style("cursor",v.style("cursor")),x({type:"brushstart"}),P()}return p.event=function(i){i.each((function(){var i=n.of(this,arguments),a={x:s,y:l,i:t,j:r},o=this.__chart__||a;this.__chart__=a,Xi?e.select(this).transition().each("start.brush",(function(){t=o.i,r=o.j,s=o.x,l=o.y,i({type:"brushstart"})})).tween("brush:brush",(function(){var e=br(s,a.x),n=br(l,a.y);return t=r=null,function(t){s=a.x=e(t),l=a.y=n(t),i({type:"brush",mode:"resize"})}})).each("end.brush",(function(){t=a.i,r=a.j,i({type:"brush",mode:"resize"}),i({type:"brushend"})})):(i({type:"brushstart"}),i({type:"brush",mode:"resize"}),i({type:"brushend"}))}))},p.x=function(e){return arguments.length?(h=la[!(i=e)<<1|!a],p):i},p.y=function(e){return arguments.length?(h=la[!i<<1|!(a=e)],p):a},p.clamp=function(e){return arguments.length?(i&&a?(c=!!e[0],u=!!e[1]):i?c=!!e:a&&(u=!!e),p):i&&a?[c,u]:i?c:a?u:null},p.extent=function(e){var n,o,c,u,h;return arguments.length?(i&&(n=e[0],o=e[1],a&&(n=n[0],o=o[0]),t=[n,o],i.invert&&(n=i(n),o=i(o)),o<n&&(h=n,n=o,o=h),n==s[0]&&o==s[1]||(s=[n,o])),a&&(c=e[0],u=e[1],i&&(c=c[1],u=u[1]),r=[c,u],a.invert&&(c=a(c),u=a(u)),u<c&&(h=c,c=u,u=h),c==l[0]&&u==l[1]||(l=[c,u])),p):(i&&(t?(n=t[0],o=t[1]):(n=s[0],o=s[1],i.invert&&(n=i.invert(n),o=i.invert(o)),o<n&&(h=n,n=o,o=h))),a&&(r?(c=r[0],u=r[1]):(c=l[0],u=l[1],a.invert&&(c=a.invert(c),u=a.invert(u)),u<c&&(h=c,c=u,u=h))),i&&a?[[n,c],[o,u]]:i?[n,o]:a&&[c,u])},p.clear=function(){return p.empty()||(s=[0,0],l=[0,0],t=r=null),p},p.empty=function(){return!!i&&s[0]==s[1]||!!a&&l[0]==l[1]},e.rebind(p,n,"on")};var sa={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},la=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];function ca(e){return JSON.parse(e.responseText)}function ua(e){var t=i.createRange();return t.selectNode(i.body),t.createContextualFragment(e.responseText)}e.text=pt((function(e){return e.responseText})),e.json=function(e,t){return dt(e,"application/json",ca,t)},e.html=function(e,t){return dt(e,"text/html",ua,t)},e.xml=pt((function(e){return e.responseXML})),"object"===typeof t&&t.exports?t.exports=e:this.d3=e}).apply(self)}}),x=p({"node_modules/d3-time/dist/d3-time.js"(e,t){var r,n;r=e,n=function(e){var t=new Date,r=new Date;function n(e,i,a,o){function s(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return s.floor=function(t){return e(t=new Date(+t)),t},s.ceil=function(t){return e(t=new Date(t-1)),i(t,1),e(t),t},s.round=function(e){var t=s(e),r=s.ceil(e);return e-t<r-e?t:r},s.offset=function(e,t){return i(e=new Date(+e),null==t?1:Math.floor(t)),e},s.range=function(t,r,n){var a,o=[];if(t=s.ceil(t),n=null==n?1:Math.floor(n),!(t<r)||!(n>0))return o;do{o.push(a=new Date(+t)),i(t,n),e(t)}while(a<t&&t<r);return o},s.filter=function(t){return n((function(r){if(r>=r)for(;e(r),!t(r);)r.setTime(r-1)}),(function(e,r){if(e>=e)if(r<0)for(;++r<=0;)for(;i(e,-1),!t(e););else for(;--r>=0;)for(;i(e,1),!t(e););}))},a&&(s.count=function(n,i){return t.setTime(+n),r.setTime(+i),e(t),e(r),Math.floor(a(t,r))},s.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?s.filter(o?function(t){return o(t)%e===0}:function(t){return s.count(0,t)%e===0}):s:null}),s}var i=n((function(){}),(function(e,t){e.setTime(+e+t)}),(function(e,t){return t-e}));i.every=function(e){return e=Math.floor(e),isFinite(e)&&e>0?e>1?n((function(t){t.setTime(Math.floor(t/e)*e)}),(function(t,r){t.setTime(+t+r*e)}),(function(t,r){return(r-t)/e})):i:null};var a=i.range,o=1e3,s=6e4,l=36e5,c=864e5,u=6048e5,h=n((function(e){e.setTime(e-e.getMilliseconds())}),(function(e,t){e.setTime(+e+t*o)}),(function(e,t){return(t-e)/o}),(function(e){return e.getUTCSeconds()})),p=h.range,d=n((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o)}),(function(e,t){e.setTime(+e+t*s)}),(function(e,t){return(t-e)/s}),(function(e){return e.getMinutes()})),f=d.range,m=n((function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*o-e.getMinutes()*s)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getHours()})),g=m.range,y=n((function(e){e.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/c}),(function(e){return e.getDate()-1})),v=y.range;function x(e){return n((function(t){t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)}),(function(e,t){e.setDate(e.getDate()+7*t)}),(function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*s)/u}))}var b=x(0),_=x(1),w=x(2),k=x(3),T=x(4),S=x(5),A=x(6),M=b.range,E=_.range,C=w.range,P=k.range,L=T.range,I=S.range,z=A.range,O=n((function(e){e.setDate(1),e.setHours(0,0,0,0)}),(function(e,t){e.setMonth(e.getMonth()+t)}),(function(e,t){return t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear())}),(function(e){return e.getMonth()})),R=O.range,D=n((function(e){e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,t){e.setFullYear(e.getFullYear()+t)}),(function(e,t){return t.getFullYear()-e.getFullYear()}),(function(e){return e.getFullYear()}));D.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,r){t.setFullYear(t.getFullYear()+r*e)})):null};var j=D.range,F=n((function(e){e.setUTCSeconds(0,0)}),(function(e,t){e.setTime(+e+t*s)}),(function(e,t){return(t-e)/s}),(function(e){return e.getUTCMinutes()})),B=F.range,N=n((function(e){e.setUTCMinutes(0,0,0)}),(function(e,t){e.setTime(+e+t*l)}),(function(e,t){return(t-e)/l}),(function(e){return e.getUTCHours()})),U=N.range,V=n((function(e){e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+t)}),(function(e,t){return(t-e)/c}),(function(e){return e.getUTCDate()-1})),q=V.range;function H(e){return n((function(t){t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCDate(e.getUTCDate()+7*t)}),(function(e,t){return(t-e)/u}))}var G=H(0),W=H(1),$=H(2),Z=H(3),X=H(4),Y=H(5),K=H(6),J=G.range,Q=W.range,ee=$.range,te=Z.range,re=X.range,ne=Y.range,ie=K.range,ae=n((function(e){e.setUTCDate(1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCMonth(e.getUTCMonth()+t)}),(function(e,t){return t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear())}),(function(e){return e.getUTCMonth()})),oe=ae.range,se=n((function(e){e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,t){e.setUTCFullYear(e.getUTCFullYear()+t)}),(function(e,t){return t.getUTCFullYear()-e.getUTCFullYear()}),(function(e){return e.getUTCFullYear()}));se.every=function(e){return isFinite(e=Math.floor(e))&&e>0?n((function(t){t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,r){t.setUTCFullYear(t.getUTCFullYear()+r*e)})):null};var le=se.range;e.timeDay=y,e.timeDays=v,e.timeFriday=S,e.timeFridays=I,e.timeHour=m,e.timeHours=g,e.timeInterval=n,e.timeMillisecond=i,e.timeMilliseconds=a,e.timeMinute=d,e.timeMinutes=f,e.timeMonday=_,e.timeMondays=E,e.timeMonth=O,e.timeMonths=R,e.timeSaturday=A,e.timeSaturdays=z,e.timeSecond=h,e.timeSeconds=p,e.timeSunday=b,e.timeSundays=M,e.timeThursday=T,e.timeThursdays=L,e.timeTuesday=w,e.timeTuesdays=C,e.timeWednesday=k,e.timeWednesdays=P,e.timeWeek=b,e.timeWeeks=M,e.timeYear=D,e.timeYears=j,e.utcDay=V,e.utcDays=q,e.utcFriday=Y,e.utcFridays=ne,e.utcHour=N,e.utcHours=U,e.utcMillisecond=i,e.utcMilliseconds=a,e.utcMinute=F,e.utcMinutes=B,e.utcMonday=W,e.utcMondays=Q,e.utcMonth=ae,e.utcMonths=oe,e.utcSaturday=K,e.utcSaturdays=ie,e.utcSecond=h,e.utcSeconds=p,e.utcSunday=G,e.utcSundays=J,e.utcThursday=X,e.utcThursdays=re,e.utcTuesday=$,e.utcTuesdays=ee,e.utcWednesday=Z,e.utcWednesdays=te,e.utcWeek=G,e.utcWeeks=J,e.utcYear=se,e.utcYears=le,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),b=p({"node_modules/d3-time-format/dist/d3-time-format.js"(e,t){var r,n;r=e,n=function(e,t){function r(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function n(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function i(e,t,r){return{y:e,m:t,d:r,H:0,M:0,S:0,L:0}}function a(e){var a=e.dateTime,o=e.date,l=e.time,c=e.periods,u=e.days,h=e.shortDays,p=e.months,ve=e.shortMonths,xe=d(c),be=f(c),_e=d(u),we=f(u),ke=d(h),Te=f(h),Se=d(p),Ae=f(p),Me=d(ve),Ee=f(ve),Ce={a:function(e){return h[e.getDay()]},A:function(e){return u[e.getDay()]},b:function(e){return ve[e.getMonth()]},B:function(e){return p[e.getMonth()]},c:null,d:R,e:R,f:N,H:D,I:j,j:F,L:B,m:U,M:V,p:function(e){return c[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:ge,s:ye,S:q,u:H,U:G,V:W,w:$,W:Z,x:null,X:null,y:X,Y:Y,Z:K,"%":me},Pe={a:function(e){return h[e.getUTCDay()]},A:function(e){return u[e.getUTCDay()]},b:function(e){return ve[e.getUTCMonth()]},B:function(e){return p[e.getUTCMonth()]},c:null,d:J,e:J,f:ne,H:Q,I:ee,j:te,L:re,m:ie,M:ae,p:function(e){return c[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:ge,s:ye,S:oe,u:se,U:le,V:ce,w:ue,W:he,x:null,X:null,y:pe,Y:de,Z:fe,"%":me},Le={a:function(e,t,r){var n=ke.exec(t.slice(r));return n?(e.w=Te[n[0].toLowerCase()],r+n[0].length):-1},A:function(e,t,r){var n=_e.exec(t.slice(r));return n?(e.w=we[n[0].toLowerCase()],r+n[0].length):-1},b:function(e,t,r){var n=Me.exec(t.slice(r));return n?(e.m=Ee[n[0].toLowerCase()],r+n[0].length):-1},B:function(e,t,r){var n=Se.exec(t.slice(r));return n?(e.m=Ae[n[0].toLowerCase()],r+n[0].length):-1},c:function(e,t,r){return Oe(e,a,t,r)},d:S,e:S,f:L,H:M,I:M,j:A,L:P,m:T,M:E,p:function(e,t,r){var n=xe.exec(t.slice(r));return n?(e.p=be[n[0].toLowerCase()],r+n[0].length):-1},q:k,Q:z,s:O,S:C,u:g,U:y,V:v,w:m,W:x,x:function(e,t,r){return Oe(e,o,t,r)},X:function(e,t,r){return Oe(e,l,t,r)},y:_,Y:b,Z:w,"%":I};function Ie(e,t){return function(r){var n,i,a,o=[],l=-1,c=0,u=e.length;for(r instanceof Date||(r=new Date(+r));++l<u;)37===e.charCodeAt(l)&&(o.push(e.slice(c,l)),null!=(i=s[n=e.charAt(++l)])?n=e.charAt(++l):i="e"===n?" ":"0",(a=t[n])&&(n=a(r,i)),o.push(n),c=l+1);return o.push(e.slice(c,l)),o.join("")}}function ze(e,a){return function(o){var s,l,c=i(1900,void 0,1);if(Oe(c,e,o+="",0)!=o.length)return null;if("Q"in c)return new Date(c.Q);if("s"in c)return new Date(1e3*c.s+("L"in c?c.L:0));if(a&&!("Z"in c)&&(c.Z=0),"p"in c&&(c.H=c.H%12+12*c.p),void 0===c.m&&(c.m="q"in c?c.q:0),"V"in c){if(c.V<1||c.V>53)return null;"w"in c||(c.w=1),"Z"in c?(l=(s=n(i(c.y,0,1))).getUTCDay(),s=l>4||0===l?t.utcMonday.ceil(s):t.utcMonday(s),s=t.utcDay.offset(s,7*(c.V-1)),c.y=s.getUTCFullYear(),c.m=s.getUTCMonth(),c.d=s.getUTCDate()+(c.w+6)%7):(l=(s=r(i(c.y,0,1))).getDay(),s=l>4||0===l?t.timeMonday.ceil(s):t.timeMonday(s),s=t.timeDay.offset(s,7*(c.V-1)),c.y=s.getFullYear(),c.m=s.getMonth(),c.d=s.getDate()+(c.w+6)%7)}else("W"in c||"U"in c)&&("w"in c||(c.w="u"in c?c.u%7:"W"in c?1:0),l="Z"in c?n(i(c.y,0,1)).getUTCDay():r(i(c.y,0,1)).getDay(),c.m=0,c.d="W"in c?(c.w+6)%7+7*c.W-(l+5)%7:c.w+7*c.U-(l+6)%7);return"Z"in c?(c.H+=c.Z/100|0,c.M+=c.Z%100,n(c)):r(c)}}function Oe(e,t,r,n){for(var i,a,o=0,l=t.length,c=r.length;o<l;){if(n>=c)return-1;if(37===(i=t.charCodeAt(o++))){if(i=t.charAt(o++),!(a=Le[i in s?t.charAt(o++):i])||(n=a(e,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}return Ce.x=Ie(o,Ce),Ce.X=Ie(l,Ce),Ce.c=Ie(a,Ce),Pe.x=Ie(o,Pe),Pe.X=Ie(l,Pe),Pe.c=Ie(a,Pe),{format:function(e){var t=Ie(e+="",Ce);return t.toString=function(){return e},t},parse:function(e){var t=ze(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=Ie(e+="",Pe);return t.toString=function(){return e},t},utcParse:function(e){var t=ze(e+="",!0);return t.toString=function(){return e},t}}}var o,s={"-":"",_:" ",0:"0"},l=/^\s*\d+/,c=/^%/,u=/[\\^$*+?|[\]().{}]/g;function h(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a<r?new Array(r-a+1).join(t)+i:i)}function p(e){return e.replace(u,"\\$&")}function d(e){return new RegExp("^(?:"+e.map(p).join("|")+")","i")}function f(e){for(var t={},r=-1,n=e.length;++r<n;)t[e[r].toLowerCase()]=r;return t}function m(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function g(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function y(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function v(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function x(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function b(e,t,r){var n=l.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function _(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function w(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function k(e,t,r){var n=l.exec(t.slice(r,r+1));return n?(e.q=3*n[0]-3,r+n[0].length):-1}function T(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function S(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function A(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function M(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function E(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function C(e,t,r){var n=l.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function P(e,t,r){var n=l.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function L(e,t,r){var n=l.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function I(e,t,r){var n=c.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function z(e,t,r){var n=l.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function O(e,t,r){var n=l.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function R(e,t){return h(e.getDate(),t,2)}function D(e,t){return h(e.getHours(),t,2)}function j(e,t){return h(e.getHours()%12||12,t,2)}function F(e,r){return h(1+t.timeDay.count(t.timeYear(e),e),r,3)}function B(e,t){return h(e.getMilliseconds(),t,3)}function N(e,t){return B(e,t)+"000"}function U(e,t){return h(e.getMonth()+1,t,2)}function V(e,t){return h(e.getMinutes(),t,2)}function q(e,t){return h(e.getSeconds(),t,2)}function H(e){var t=e.getDay();return 0===t?7:t}function G(e,r){return h(t.timeSunday.count(t.timeYear(e)-1,e),r,2)}function W(e,r){var n=e.getDay();return e=n>=4||0===n?t.timeThursday(e):t.timeThursday.ceil(e),h(t.timeThursday.count(t.timeYear(e),e)+(4===t.timeYear(e).getDay()),r,2)}function $(e){return e.getDay()}function Z(e,r){return h(t.timeMonday.count(t.timeYear(e)-1,e),r,2)}function X(e,t){return h(e.getFullYear()%100,t,2)}function Y(e,t){return h(e.getFullYear()%1e4,t,4)}function K(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+h(t/60|0,"0",2)+h(t%60,"0",2)}function J(e,t){return h(e.getUTCDate(),t,2)}function Q(e,t){return h(e.getUTCHours(),t,2)}function ee(e,t){return h(e.getUTCHours()%12||12,t,2)}function te(e,r){return h(1+t.utcDay.count(t.utcYear(e),e),r,3)}function re(e,t){return h(e.getUTCMilliseconds(),t,3)}function ne(e,t){return re(e,t)+"000"}function ie(e,t){return h(e.getUTCMonth()+1,t,2)}function ae(e,t){return h(e.getUTCMinutes(),t,2)}function oe(e,t){return h(e.getUTCSeconds(),t,2)}function se(e){var t=e.getUTCDay();return 0===t?7:t}function le(e,r){return h(t.utcSunday.count(t.utcYear(e)-1,e),r,2)}function ce(e,r){var n=e.getUTCDay();return e=n>=4||0===n?t.utcThursday(e):t.utcThursday.ceil(e),h(t.utcThursday.count(t.utcYear(e),e)+(4===t.utcYear(e).getUTCDay()),r,2)}function ue(e){return e.getUTCDay()}function he(e,r){return h(t.utcMonday.count(t.utcYear(e)-1,e),r,2)}function pe(e,t){return h(e.getUTCFullYear()%100,t,2)}function de(e,t){return h(e.getUTCFullYear()%1e4,t,4)}function fe(){return"+0000"}function me(){return"%"}function ge(e){return+e}function ye(e){return Math.floor(+e/1e3)}function ve(t){return o=a(t),e.timeFormat=o.format,e.timeParse=o.parse,e.utcFormat=o.utcFormat,e.utcParse=o.utcParse,o}ve({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var xe="%Y-%m-%dT%H:%M:%S.%LZ",be=Date.prototype.toISOString?function(e){return e.toISOString()}:e.utcFormat(xe),_e=+new Date("2000-01-01T00:00:00.000Z")?function(e){var t=new Date(e);return isNaN(t)?null:t}:e.utcParse(xe);e.isoFormat=be,e.isoParse=_e,e.timeFormatDefaultLocale=ve,e.timeFormatLocale=a,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,x()):n((r=r||self).d3=r.d3||{},r.d3)}}),_=p({"node_modules/d3-format/dist/d3-format.js"(e,t){var r;r=e,function(e){function t(e,t){if((r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var r,n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function r(e){return(e=t(Math.abs(e)))?e[1]:NaN}var n,i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function a(e){if(!(t=i.exec(e)))throw new Error("invalid format: "+e);var t;return new o({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function o(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function s(e,r){var n=t(e,r);if(!n)return e+"";var i=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+i:i.length>a+1?i.slice(0,a+1)+"."+i.slice(a+1):i+new Array(a-i.length+2).join("0")}a.prototype=o.prototype,o.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var l={"%":function(e,t){return(100*e).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},g:function(e,t){return e.toPrecision(t)},o:function(e){return Math.round(e).toString(8)},p:function(e,t){return s(100*e,t)},r:s,s:function(e,r){var i=t(e,r);if(!i)return e+"";var a=i[0],o=i[1],s=o-(n=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,l=a.length;return s===l?a:s>l?a+new Array(s-l+1).join("0"):s>0?a.slice(0,s)+"."+a.slice(s):"0."+new Array(1-s).join("0")+t(e,Math.max(0,r+s-1))[0]},X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function c(e){return e}var u,h=Array.prototype.map,p=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"];function d(e){var t,i,o=void 0===e.grouping||void 0===e.thousands?c:(t=h.call(e.grouping,Number),i=e.thousands+"",function(e,r){for(var n=e.length,a=[],o=0,s=t[0],l=0;n>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),a.push(e.substring(n-=s,n+s)),!((l+=s+1)>r));)s=t[o=(o+1)%t.length];return a.reverse().join(i)}),s=void 0===e.currency?"":e.currency[0]+"",u=void 0===e.currency?"":e.currency[1]+"",d=void 0===e.decimal?".":e.decimal+"",f=void 0===e.numerals?c:function(e){return function(t){return t.replace(/[0-9]/g,(function(t){return e[+t]}))}}(h.call(e.numerals,String)),m=void 0===e.percent?"%":e.percent+"",g=void 0===e.minus?"-":e.minus+"",y=void 0===e.nan?"NaN":e.nan+"";function v(e){var t=(e=a(e)).fill,r=e.align,i=e.sign,c=e.symbol,h=e.zero,v=e.width,x=e.comma,b=e.precision,_=e.trim,w=e.type;"n"===w?(x=!0,w="g"):l[w]||(void 0===b&&(b=12),_=!0,w="g"),(h||"0"===t&&"="===r)&&(h=!0,t="0",r="=");var k="$"===c?s:"#"===c&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",T="$"===c?u:/[%p]/.test(w)?m:"",S=l[w],A=/[defgprs%]/.test(w);function M(e){var a,s,l,c=k,u=T;if("c"===w)u=S(e)+u,e="";else{var m=(e=+e)<0||1/e<0;if(e=isNaN(e)?y:S(Math.abs(e),b),_&&(e=function(e){e:for(var t,r=e.length,n=1,i=-1;n<r;++n)switch(e[n]){case".":i=t=n;break;case"0":0===i&&(i=n),t=n;break;default:if(!+e[n])break e;i>0&&(i=0)}return i>0?e.slice(0,i)+e.slice(t+1):e}(e)),m&&0===+e&&"+"!==i&&(m=!1),c=(m?"("===i?i:g:"-"===i||"("===i?"":i)+c,u=("s"===w?p[8+n/3]:"")+u+(m&&"("===i?")":""),A)for(a=-1,s=e.length;++a<s;)if(48>(l=e.charCodeAt(a))||l>57){u=(46===l?d+e.slice(a+1):e.slice(a))+u,e=e.slice(0,a);break}}x&&!h&&(e=o(e,1/0));var M=c.length+e.length+u.length,E=M<v?new Array(v-M+1).join(t):"";switch(x&&h&&(e=o(E+e,E.length?v-u.length:1/0),E=""),r){case"<":e=c+e+u+E;break;case"=":e=c+E+e+u;break;case"^":e=E.slice(0,M=E.length>>1)+c+e+u+E.slice(M);break;default:e=E+c+e+u}return f(e)}return b=void 0===b?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),M.toString=function(){return e+""},M}return{format:v,formatPrefix:function(e,t){var n=v(((e=a(e)).type="f",e)),i=3*Math.max(-8,Math.min(8,Math.floor(r(t)/3))),o=Math.pow(10,-i),s=p[8+i/3];return function(e){return n(o*e)+s}}}}function f(t){return u=d(t),e.format=u.format,e.formatPrefix=u.formatPrefix,u}f({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"}),e.FormatSpecifier=o,e.formatDefaultLocale=f,e.formatLocale=d,e.formatSpecifier=a,e.precisionFixed=function(e){return Math.max(0,-r(Math.abs(e)))},e.precisionPrefix=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(r(t)/3)))-r(Math.abs(e)))},e.precisionRound=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,r(t)-r(e))+1},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r="undefined"!==typeof globalThis?globalThis:r||self).d3=r.d3||{})}}),w=p({"node_modules/is-string-blank/index.js"(e,t){t.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}}}),k=p({"node_modules/fast-isnumeric/index.js"(e,t){var r=w();t.exports=function(e){var t=typeof e;if("string"===t){var n=e;if(0===(e=+e)&&r(n))return!1}else if("number"!==t)return!1;return e-e<1}}}),T=p({"src/constants/numerical.js"(e,t){t.exports={BADNUM:void 0,FP_SAFE:1e-4*Number.MAX_VALUE,ONEMAXYEAR:316224e5,ONEAVGYEAR:315576e5,ONEMINYEAR:31536e6,ONEMAXQUARTER:79488e5,ONEAVGQUARTER:78894e5,ONEMINQUARTER:76896e5,ONEMAXMONTH:26784e5,ONEAVGMONTH:26298e5,ONEMINMONTH:24192e5,ONEWEEK:6048e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,ONEMILLI:1,ONEMICROSEC:.001,EPOCHJD:2440587.5,ALMOST_EQUAL:.999999,LOG_CLIP:10,MINUS_SIGN:"\u2212"}}}),S=p({"node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js"(e,t){var r;r=e,function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="undefined"===typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)r[t.charCodeAt(n)]=n;e.decode=function(e){var t,n,i,a,o,s=.75*e.length,l=e.length,c=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var u=new ArrayBuffer(s),h=new Uint8Array(u);for(t=0;t<l;t+=4)n=r[e.charCodeAt(t)],i=r[e.charCodeAt(t+1)],a=r[e.charCodeAt(t+2)],o=r[e.charCodeAt(t+3)],h[c++]=n<<2|i>>4,h[c++]=(15&i)<<4|a>>2,h[c++]=(3&a)<<6|63&o;return u},e.encode=function(e){var r,n=new Uint8Array(e),i=n.length,a="";for(r=0;r<i;r+=3)a+=t[n[r]>>2],a+=t[(3&n[r])<<4|n[r+1]>>4],a+=t[(15&n[r+1])<<2|n[r+2]>>6],a+=t[63&n[r+2]];return i%3===2?a=a.substring(0,a.length-1)+"=":i%3===1&&(a=a.substring(0,a.length-2)+"=="),a},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r="undefined"!==typeof globalThis?globalThis:r||self)["base64-arraybuffer"]={})}}),A=p({"src/lib/is_plain_object.js"(e,t){t.exports=function(e){return window&&window.process&&window.process.versions?"[object Object]"===Object.prototype.toString.call(e):"[object Object]"===Object.prototype.toString.call(e)&&Object.getPrototypeOf(e).hasOwnProperty("hasOwnProperty")}}}),M=p({"src/lib/array.js"(e){var t=S().decode,r=A(),n=Array.isArray,i=ArrayBuffer,a=DataView;function o(e){return i.isView(e)&&!(e instanceof a)}function s(e){return n(e)||o(e)}e.isTypedArray=o,e.isArrayOrTypedArray=s,e.isArray1D=function(e){return!s(e[0])},e.ensureArray=function(e,t){return n(e)||(e=[]),e.length=t,e};var l={u1c:"undefined"===typeof Uint8ClampedArray?void 0:Uint8ClampedArray,i1:"undefined"===typeof Int8Array?void 0:Int8Array,u1:"undefined"===typeof Uint8Array?void 0:Uint8Array,i2:"undefined"===typeof Int16Array?void 0:Int16Array,u2:"undefined"===typeof Uint16Array?void 0:Uint16Array,i4:"undefined"===typeof Int32Array?void 0:Int32Array,u4:"undefined"===typeof Uint32Array?void 0:Uint32Array,f4:"undefined"===typeof Float32Array?void 0:Float32Array,f8:"undefined"===typeof Float64Array?void 0:Float64Array};function c(e){return e.constructor===ArrayBuffer}function u(e,t,r){if(s(e)){if(s(e[0])){for(var n=r,i=0;i<e.length;i++)n=t(n,e[i].length);return n}return e.length}return 0}l.uint8c=l.u1c,l.uint8=l.u1,l.int8=l.i1,l.uint16=l.u2,l.int16=l.i2,l.uint32=l.u4,l.int32=l.i4,l.float32=l.f4,l.float64=l.f8,e.isArrayBuffer=c,e.decodeTypedArraySpec=function(e){var r=[],n=function(e){return{bdata:e.bdata,dtype:e.dtype,shape:e.shape}}(e),i=n.dtype,a=l[i];if(!a)throw new Error('Error in dtype: "'+i+'"');var o=a.BYTES_PER_ELEMENT,s=n.bdata;c(s)||(s=t(s));var u=void 0===n.shape?[s.byteLength/o]:(""+n.shape).split(",");u.reverse();var h,p,d=u.length,f=+u[0],m=o*f,g=0;if(1===d)r=new a(s);else if(2===d)for(h=+u[1],p=0;p<h;p++)r[p]=new a(s,g,f),g+=m;else{if(3!==d)throw new Error("ndim: "+d+'is not supported with the shape:"'+n.shape+'"');h=+u[1];for(var y=+u[2],v=0;v<y;v++)for(r[v]=[],p=0;p<h;p++)r[v][p]=new a(s,g,f),g+=m}return r.bdata=n.bdata,r.dtype=n.dtype,r.shape=u.reverse().join(","),e._inputArray=r,r},e.isTypedArraySpec=function(e){return r(e)&&e.hasOwnProperty("dtype")&&"string"===typeof e.dtype&&e.hasOwnProperty("bdata")&&("string"===typeof e.bdata||c(e.bdata))&&(void 0===e.shape||e.hasOwnProperty("shape")&&("string"===typeof e.shape||"number"===typeof e.shape))},e.concat=function(){var e,t,r,i,a,o,s,l,c=[],u=!0,h=0;for(r=0;r<arguments.length;r++)(o=(i=arguments[r]).length)&&(t?c.push(i):(t=i,a=o),n(i)?e=!1:(u=!1,h?e!==i.constructor&&(e=!1):e=i.constructor),h+=o);if(!h)return[];if(!c.length)return t;if(u)return t.concat.apply(t,c);if(e){for((s=new e(h)).set(t),r=0;r<c.length;r++)i=c[r],s.set(i,a),a+=i.length;return s}for(s=new Array(h),l=0;l<t.length;l++)s[l]=t[l];for(r=0;r<c.length;r++){for(i=c[r],l=0;l<i.length;l++)s[a+l]=i[l];a+=l}return s},e.maxRowLength=function(e){return u(e,Math.max,0)},e.minRowLength=function(e){return u(e,Math.min,1/0)}}}),E=p({"src/lib/nested_property.js"(e,t){var r=k(),n=M().isArrayOrTypedArray;function i(e,t){return function(r){var a,o,s,l,c,u=e;for(l=0;l<t.length-1;l++){if(-1===(a=t[l])){for(o=!0,s=[],c=0;c<u.length;c++)s[c]=i(u[c],t.slice(l+1))(r),s[c]!==s[0]&&(o=!1);return o?s[0]:s}if("number"===typeof a&&!n(u))return;if("object"!==typeof(u=u[a])||null===u)return}if("object"===typeof u&&null!==u&&(s=u[t[l]],r||null!==s))return s}}t.exports=function(e,t){if(r(t))t=String(t);else if("string"!==typeof t||"[-1]"===t.substr(t.length-4))throw"bad property string";var n,a,o,l,c=t.split(".");for(l=0;l<c.length;l++)if("__"===String(c[l]).slice(0,2))throw"bad property string";for(l=0;l<c.length;){if(n=String(c[l]).match(/^([^\[\]]*)((\[\-?[0-9]*\])+)$/)){if(n[1])c[l]=n[1];else{if(0!==l)throw"bad property string";c.splice(0,1)}for(a=n[2].substr(1,n[2].length-2).split("]["),o=0;o<a.length;o++)l++,c.splice(l,0,Number(a[o]))}l++}return"object"!==typeof e?function(e,t,r){return{set:function(){throw"bad container"},get:function(){},astr:t,parts:r,obj:e}}(e,t,c):{set:s(e,c,t),get:i(e,c),astr:t,parts:c,obj:e}};var a=/(^|\.)args\[/;function o(e,t){return void 0===e||null===e&&!t.match(a)}function s(e,t,r){return function(i){var a,s,h=e,p="",d=[[e,p]],f=o(i,r);for(s=0;s<t.length-1;s++){if("number"===typeof(a=t[s])&&!n(h))throw"array index but container is not an array";if(-1===a){if(f=!c(h,t.slice(s+1),i,r))break;return}if(!u(h,a,t[s+1],f))break;if("object"!==typeof(h=h[a])||null===h)throw"container is not an object";p=l(p,a),d.push([h,p])}if(f){if(s===t.length-1&&(delete h[t[s]],Array.isArray(h)&&+t[s]===h.length-1))for(;h.length&&void 0===h[h.length-1];)h.pop()}else h[t[s]]=i}}function l(e,t){var n=t;return r(t)?n="["+t+"]":e&&(n="."+t),e+n}function c(e,t,r,i){var a,l=n(r),c=!0,h=r,p=i.replace("-1",0),d=!l&&o(r,p),f=t[0];for(a=0;a<e.length;a++)p=i.replace("-1",a),l&&(d=o(h=r[a%r.length],p)),d&&(c=!1),u(e,a,f,d)&&s(e[a],t,i.replace("-1",a))(h);return c}function u(e,t,r,n){if(void 0===e[t]){if(n)return!1;e[t]="number"===typeof r?[]:{}}return!0}}}),C=p({"src/lib/keyed_container.js"(e,t){var r=E(),n=/^\w*$/;t.exports=function(e,t,i,a){var o,s,l;i=i||"name",a=a||"value";var c={};t&&t.length?(l=r(e,t),s=l.get()):s=e,t=t||"";var u={};if(s)for(o=0;o<s.length;o++)u[s[o][i]]=o;var h=n.test(a),p={set:function(e,t){var n=null===t?4:0;if(!s){if(!l||4===n)return;s=[],l.set(s)}var o=u[e];if(void 0===o){if(4===n)return;n|=3,o=s.length,u[e]=o}else t!==(h?s[o][a]:r(s[o],a).get())&&(n|=2);var d=s[o]=s[o]||{};return d[i]=e,h?d[a]=t:r(d,a).set(t),null!==t&&(n&=-5),c[o]=c[o]|n,p},get:function(e){if(s){var t=u[e];return void 0===t?void 0:h?s[t][a]:r(s[t],a).get()}},rename:function(e,t){var r=u[e];return void 0===r||(c[r]=1|c[r],u[t]=r,delete u[e],s[r][i]=t),p},remove:function(e){var t=u[e];if(void 0===t)return p;var n=s[t];if(Object.keys(n).length>2)return c[t]=2|c[t],p.set(e,null);if(h){for(o=t;o<s.length;o++)c[o]=3|c[o];for(o=t;o<s.length;o++)u[s[o][i]]--;s.splice(t,1),delete u[e]}else r(n,a).set(null),c[t]=6|c[t];return p},constructUpdate:function(){for(var e,n,o={},l=Object.keys(c),u=0;u<l.length;u++)n=l[u],e=t+"["+n+"]",s[n]?(1&c[n]&&(o[e+"."+i]=s[n][i]),2&c[n]&&(o[e+"."+a]=h?4&c[n]?null:s[n][a]:4&c[n]?null:r(s[n],a).get())):o[e]=null;return o}};return p}}}),P=p({"src/lib/relative_attr.js"(e,t){var r=/^(.*)(\.[^\.\[\]]+|\[\d\])$/,n=/^[^\.\[\]]+$/;t.exports=function(e,t){for(;t;){var i=e.match(r);if(i)e=i[1];else{if(!e.match(n))throw new Error("bad relativeAttr call:"+[e,t]);e=""}if("^"!==t.charAt(0))break;t=t.slice(1)}return e&&"["!==t.charAt(0)?e+"."+t:e+t}}}),L=p({"src/lib/to_log_range.js"(e,t){var r=k();t.exports=function(e,t){if(e>0)return Math.log(e)/Math.LN10;var n=Math.log(Math.min(t[0],t[1]))/Math.LN10;return r(n)||(n=Math.log(Math.max(t[0],t[1]))/Math.LN10-6),n}}}),I=p({"src/lib/relink_private.js"(e,t){var r=M().isArrayOrTypedArray,n=A();t.exports=function e(t,i){for(var a in i){var o=i[a],s=t[a];if(s!==o)if("_"===a.charAt(0)||"function"===typeof o){if(a in t)continue;t[a]=o}else if(r(o)&&r(s)&&n(o[0])){if("customdata"===a||"ids"===a)continue;for(var l=Math.min(o.length,s.length),c=0;c<l;c++)s[c]!==o[c]&&n(o[c])&&n(s[c])&&e(s[c],o[c])}else n(o)&&n(s)&&(e(s,o),Object.keys(s).length||delete t[a])}}}}),z=p({"src/lib/mod.js"(e,t){t.exports={mod:function(e,t){var r=e%t;return r<0?r+t:r},modHalf:function(e,t){return Math.abs(e)>t/2?e-Math.round(e/t)*t:e}}}}),O=p({"node_modules/tinycolor2/tinycolor.js"(e,t){!function(e){var r=/^\s+/,n=/\s+$/,i=0,a=e.round,o=e.min,s=e.max,l=e.random;function c(t,l){if(l=l||{},(t=t||"")instanceof c)return t;if(!(this instanceof c))return new c(t,l);var u=function(t){var i,a,l,c={r:0,g:0,b:0},u=1,h=null,p=null,d=null,f=!1,m=!1;return"string"==typeof t&&(t=function(e){e=e.replace(r,"").replace(n,"").toLowerCase();var t,i=!1;if(M[e])e=M[e],i=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=j.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),a:D(t[4]),format:i?"name":"hex8"}:(t=j.hex6.exec(e))?{r:I(t[1]),g:I(t[2]),b:I(t[3]),format:i?"name":"hex"}:(t=j.hex4.exec(e))?{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),a:D(t[4]+""+t[4]),format:i?"name":"hex8"}:!!(t=j.hex3.exec(e))&&{r:I(t[1]+""+t[1]),g:I(t[2]+""+t[2]),b:I(t[3]+""+t[3]),format:i?"name":"hex"}}(t)),"object"==typeof t&&(F(t.r)&&F(t.g)&&F(t.b)?(i=t.r,a=t.g,l=t.b,c={r:255*P(i,255),g:255*P(a,255),b:255*P(l,255)},f=!0,m="%"===String(t.r).substr(-1)?"prgb":"rgb"):F(t.h)&&F(t.s)&&F(t.v)?(h=O(t.s),p=O(t.v),c=function(t,r,n){t=6*P(t,360),r=P(r,100),n=P(n,100);var i=e.floor(t),a=t-i,o=n*(1-r),s=n*(1-a*r),l=n*(1-(1-a)*r),c=i%6,u=[n,s,o,o,l,n][c],h=[l,n,n,s,o,o][c],p=[o,o,l,n,n,s][c];return{r:255*u,g:255*h,b:255*p}}(t.h,h,p),f=!0,m="hsv"):F(t.h)&&F(t.s)&&F(t.l)&&(h=O(t.s),d=O(t.l),c=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(t.h,h,d),f=!0,m="hsl"),t.hasOwnProperty("a")&&(u=t.a)),u=C(u),{ok:f,format:t.format||m,r:o(255,s(c.r,0)),g:o(255,s(c.g,0)),b:o(255,s(c.b,0)),a:u}}(t);this._originalInput=t,this._r=u.r,this._g=u.g,this._b=u.b,this._a=u.a,this._roundA=a(100*this._a)/100,this._format=l.format||u.format,this._gradientType=l.gradientType,this._r<1&&(this._r=a(this._r)),this._g<1&&(this._g=a(this._g)),this._b<1&&(this._b=a(this._b)),this._ok=u.ok,this._tc_id=i++}function u(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,i,a=s(e,t,r),l=o(e,t,r),c=(a+l)/2;if(a==l)n=i=0;else{var u=a-l;switch(i=c>.5?u/(2-a-l):u/(a+l),a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:i,l:c}}function h(e,t,r){e=P(e,255),t=P(t,255),r=P(r,255);var n,i,a=s(e,t,r),l=o(e,t,r),c=a,u=a-l;if(i=0===a?0:u/a,a==l)n=0;else{switch(a){case e:n=(t-r)/u+(t<r?6:0);break;case t:n=(r-e)/u+2;break;case r:n=(e-t)/u+4}n/=6}return{h:n,s:i,v:c}}function p(e,t,r,n){var i=[z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function d(e,t,r,n){return[z(R(n)),z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16))].join("")}function f(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s-=t/100,r.s=L(r.s),c(r)}function m(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.s+=t/100,r.s=L(r.s),c(r)}function g(e){return c(e).desaturate(100)}function y(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l+=t/100,r.l=L(r.l),c(r)}function v(e,t){t=0===t?0:t||10;var r=c(e).toRgb();return r.r=s(0,o(255,r.r-a(-t/100*255))),r.g=s(0,o(255,r.g-a(-t/100*255))),r.b=s(0,o(255,r.b-a(-t/100*255))),c(r)}function x(e,t){t=0===t?0:t||10;var r=c(e).toHsl();return r.l-=t/100,r.l=L(r.l),c(r)}function b(e,t){var r=c(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,c(r)}function _(e){var t=c(e).toHsl();return t.h=(t.h+180)%360,c(t)}function w(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+120)%360,s:t.s,l:t.l}),c({h:(r+240)%360,s:t.s,l:t.l})]}function k(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+90)%360,s:t.s,l:t.l}),c({h:(r+180)%360,s:t.s,l:t.l}),c({h:(r+270)%360,s:t.s,l:t.l})]}function T(e){var t=c(e).toHsl(),r=t.h;return[c(e),c({h:(r+72)%360,s:t.s,l:t.l}),c({h:(r+216)%360,s:t.s,l:t.l})]}function S(e,t,r){t=t||6,r=r||30;var n=c(e).toHsl(),i=360/r,a=[c(e)];for(n.h=(n.h-(i*t>>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(c(n));return a}function A(e,t){t=t||6;for(var r=c(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(c({h:n,s:i,v:a})),a=(a+s)%1;return o}c.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var t,r,n,i=this.toRgb();return t=i.r/255,r=i.g/255,n=i.b/255,.2126*(t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:e.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:e.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=a(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=u(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=u(this._r,this._g,this._b),t=a(360*e.h),r=a(100*e.s),n=a(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return p(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var o=[z(a(e).toString(16)),z(a(t).toString(16)),z(a(r).toString(16)),z(R(n))];return i&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:a(this._r),g:a(this._g),b:a(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+a(this._r)+", "+a(this._g)+", "+a(this._b)+")":"rgba("+a(this._r)+", "+a(this._g)+", "+a(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:a(100*P(this._r,255))+"%",g:a(100*P(this._g,255))+"%",b:a(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+a(100*P(this._r,255))+"%, "+a(100*P(this._g,255))+"%, "+a(100*P(this._b,255))+"%)":"rgba("+a(100*P(this._r,255))+"%, "+a(100*P(this._g,255))+"%, "+a(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(E[p(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+d(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=c(e);r="#"+d(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return c(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(v,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(m,arguments)},greyscale:function(){return this._applyModification(g,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(S,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(A,arguments)},splitcomplement:function(){return this._applyCombination(T,arguments)},triad:function(){return this._applyCombination(w,arguments)},tetrad:function(){return this._applyCombination(k,arguments)}},c.fromRatio=function(e,t){if("object"==typeof e){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:O(e[n]));e=r}return c(e,t)},c.equals=function(e,t){return!(!e||!t)&&c(e).toRgbString()==c(t).toRgbString()},c.random=function(){return c.fromRatio({r:l(),g:l(),b:l()})},c.mix=function(e,t,r){r=0===r?0:r||50;var n=c(e).toRgb(),i=c(t).toRgb(),a=r/100;return c({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},c.readability=function(t,r){var n=c(t),i=c(r);return(e.max(n.getLuminance(),i.getLuminance())+.05)/(e.min(n.getLuminance(),i.getLuminance())+.05)},c.isReadable=function(e,t,r){var n,i,a=c.readability(e,t);switch(i=!1,(n=function(e){var t,r;return t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},c.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;u<t.length;u++)(n=c.readability(e,t[u]))>l&&(l=n,s=c(t[u]));return c.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,c.mostReadable(e,["#fff","#000"],r))};var M=c.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},E=c.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(M);function C(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(t,r){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(t)&&(t="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(t);return t=o(r,s(0,parseFloat(t))),n&&(t=parseInt(t*r,10)/100),e.abs(t-r)<1e-6?1:t%r/parseFloat(r)}function L(e){return o(1,s(0,e))}function I(e){return parseInt(e,16)}function z(e){return 1==e.length?"0"+e:""+e}function O(e){return e<=1&&(e=100*e+"%"),e}function R(t){return e.round(255*parseFloat(t)).toString(16)}function D(e){return I(e)/255}var j=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",r="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function F(e){return!!j.CSS_UNIT.exec(e)}"undefined"!==typeof t&&t.exports?t.exports=c:window.tinycolor=c}(Math)}}),R=p({"src/lib/extend.js"(e){var t=A(),r=Array.isArray;function n(e,i,a,o){var s,l,c,u,h,p,d,f=e[0],m=e.length;if(2===m&&r(f)&&r(e[1])&&0===f.length){if(d=function(e,t){var r,n;for(r=0;r<e.length;r++){if(null!==(n=e[r])&&"object"===typeof n)return!1;void 0!==n&&(t[r]=n)}return!0}(e[1],f),d)return f;f.splice(0,f.length)}for(var g=1;g<m;g++)for(l in s=e[g])c=f[l],u=s[l],o&&r(u)?f[l]=u:i&&u&&(t(u)||(h=r(u)))?(h?(h=!1,p=c&&r(c)?c:[]):p=c&&t(c)?c:{},f[l]=n([p,u],i,a,o)):("undefined"!==typeof u||a)&&(f[l]=u);return f}e.extendFlat=function(){return n(arguments,!1,!1,!1)},e.extendDeep=function(){return n(arguments,!0,!1,!1)},e.extendDeepAll=function(){return n(arguments,!0,!0,!1)},e.extendDeepNoArrays=function(){return n(arguments,!0,!1,!0)}}}),D=p({"src/plots/font_attributes.js"(e,t){t.exports=function(e){var t=e.variantValues,r=e.editType,n=e.colorEditType;void 0===n&&(n=r);var i={editType:r,valType:"integer",min:1,max:1e3,extras:["normal","bold"],dflt:"normal"};e.noNumericWeightValues&&(i.valType="enumerated",i.values=i.extras,i.extras=void 0,i.min=void 0,i.max=void 0);var a={family:{valType:"string",noBlank:!0,strict:!0,editType:r},size:{valType:"number",min:1,editType:r},color:{valType:"color",editType:n},weight:i,style:{editType:r,valType:"enumerated",values:["normal","italic"],dflt:"normal"},variant:e.noFontVariant?void 0:{editType:r,valType:"enumerated",values:t||["normal","small-caps","all-small-caps","all-petite-caps","petite-caps","unicase"],dflt:"normal"},textcase:e.noFontTextcase?void 0:{editType:r,valType:"enumerated",values:["normal","word caps","upper","lower"],dflt:"normal"},lineposition:e.noFontLineposition?void 0:{editType:r,valType:"flaglist",flags:["under","over","through"],extras:["none"],dflt:"none"},shadow:e.noFontShadow?void 0:{editType:r,valType:"string",dflt:e.autoShadowDflt?"auto":"none"},editType:r};return e.autoSize&&(a.size.dflt="auto"),e.autoColor&&(a.color.dflt="auto"),e.arrayOk&&(a.family.arrayOk=!0,a.weight.arrayOk=!0,a.style.arrayOk=!0,e.noFontVariant||(a.variant.arrayOk=!0),e.noFontTextcase||(a.textcase.arrayOk=!0),e.noFontLineposition||(a.lineposition.arrayOk=!0),e.noFontShadow||(a.shadow.arrayOk=!0),a.size.arrayOk=!0,a.color.arrayOk=!0),a}}}),j=p({"src/components/fx/constants.js"(e,t){t.exports={YANGLE:60,HOVERARROWSIZE:6,HOVERTEXTPAD:3,HOVERFONTSIZE:13,HOVERFONT:"Arial, sans-serif",HOVERMINTIME:50,HOVERID:"-hover"}}}),F=p({"src/components/fx/layout_attributes.js"(e,t){var r=j(),n=D(),i=n({editType:"none"});i.family.dflt=r.HOVERFONT,i.size.dflt=r.HOVERFONTSIZE,t.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:i,grouptitlefont:n({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"}}}}),B=p({"src/components/fx/attributes.js"(e,t){var r=D(),n=F().hoverlabel,i=R().extendFlat;t.exports={hoverlabel:{bgcolor:i({},n.bgcolor,{arrayOk:!0}),bordercolor:i({},n.bordercolor,{arrayOk:!0}),font:r({arrayOk:!0,editType:"none"}),align:i({},n.align,{arrayOk:!0}),namelength:i({},n.namelength,{arrayOk:!0}),editType:"none"}}}}),N=p({"src/plots/attributes.js"(e,t){var r=D(),n=B();t.exports={type:{valType:"enumerated",values:[],dflt:"scatter",editType:"calc+clearAxisTypes",_noTemplating:!0},visible:{valType:"enumerated",values:[!0,!1,"legendonly"],dflt:!0,editType:"calc"},showlegend:{valType:"boolean",dflt:!0,editType:"style"},legend:{valType:"subplotid",dflt:"legend",editType:"style"},legendgroup:{valType:"string",dflt:"",editType:"style"},legendgrouptitle:{text:{valType:"string",dflt:"",editType:"style"},font:r({editType:"style"}),editType:"style"},legendrank:{valType:"number",dflt:1e3,editType:"style"},legendwidth:{valType:"number",min:0,editType:"style"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"style"},name:{valType:"string",editType:"style"},uid:{valType:"string",editType:"plot",anim:!0},ids:{valType:"data_array",editType:"calc",anim:!0},customdata:{valType:"data_array",editType:"calc"},meta:{valType:"any",arrayOk:!0,editType:"plot"},selectedpoints:{valType:"any",editType:"calc"},hoverinfo:{valType:"flaglist",flags:["x","y","z","text","name"],extras:["all","none","skip"],arrayOk:!0,dflt:"all",editType:"none"},hoverlabel:n.hoverlabel,stream:{token:{valType:"string",noBlank:!0,strict:!0,editType:"calc"},maxpoints:{valType:"number",min:0,max:1e4,dflt:500,editType:"calc"},editType:"calc"},uirevision:{valType:"any",editType:"none"}}}}),U=p({"src/components/colorscale/scales.js"(e,t){var r=O(),n={Greys:[[0,"rgb(0,0,0)"],[1,"rgb(255,255,255)"]],YlGnBu:[[0,"rgb(8,29,88)"],[.125,"rgb(37,52,148)"],[.25,"rgb(34,94,168)"],[.375,"rgb(29,145,192)"],[.5,"rgb(65,182,196)"],[.625,"rgb(127,205,187)"],[.75,"rgb(199,233,180)"],[.875,"rgb(237,248,217)"],[1,"rgb(255,255,217)"]],Greens:[[0,"rgb(0,68,27)"],[.125,"rgb(0,109,44)"],[.25,"rgb(35,139,69)"],[.375,"rgb(65,171,93)"],[.5,"rgb(116,196,118)"],[.625,"rgb(161,217,155)"],[.75,"rgb(199,233,192)"],[.875,"rgb(229,245,224)"],[1,"rgb(247,252,245)"]],YlOrRd:[[0,"rgb(128,0,38)"],[.125,"rgb(189,0,38)"],[.25,"rgb(227,26,28)"],[.375,"rgb(252,78,42)"],[.5,"rgb(253,141,60)"],[.625,"rgb(254,178,76)"],[.75,"rgb(254,217,118)"],[.875,"rgb(255,237,160)"],[1,"rgb(255,255,204)"]],Bluered:[[0,"rgb(0,0,255)"],[1,"rgb(255,0,0)"]],RdBu:[[0,"rgb(5,10,172)"],[.35,"rgb(106,137,247)"],[.5,"rgb(190,190,190)"],[.6,"rgb(220,170,132)"],[.7,"rgb(230,145,90)"],[1,"rgb(178,10,28)"]],Reds:[[0,"rgb(220,220,220)"],[.2,"rgb(245,195,157)"],[.4,"rgb(245,160,105)"],[1,"rgb(178,10,28)"]],Blues:[[0,"rgb(5,10,172)"],[.35,"rgb(40,60,190)"],[.5,"rgb(70,100,245)"],[.6,"rgb(90,120,245)"],[.7,"rgb(106,137,247)"],[1,"rgb(220,220,220)"]],Picnic:[[0,"rgb(0,0,255)"],[.1,"rgb(51,153,255)"],[.2,"rgb(102,204,255)"],[.3,"rgb(153,204,255)"],[.4,"rgb(204,204,255)"],[.5,"rgb(255,255,255)"],[.6,"rgb(255,204,255)"],[.7,"rgb(255,153,255)"],[.8,"rgb(255,102,204)"],[.9,"rgb(255,102,102)"],[1,"rgb(255,0,0)"]],Rainbow:[[0,"rgb(150,0,90)"],[.125,"rgb(0,0,200)"],[.25,"rgb(0,25,255)"],[.375,"rgb(0,152,255)"],[.5,"rgb(44,255,150)"],[.625,"rgb(151,255,0)"],[.75,"rgb(255,234,0)"],[.875,"rgb(255,111,0)"],[1,"rgb(255,0,0)"]],Portland:[[0,"rgb(12,51,131)"],[.25,"rgb(10,136,186)"],[.5,"rgb(242,211,56)"],[.75,"rgb(242,143,56)"],[1,"rgb(217,30,30)"]],Jet:[[0,"rgb(0,0,131)"],[.125,"rgb(0,60,170)"],[.375,"rgb(5,255,255)"],[.625,"rgb(255,255,0)"],[.875,"rgb(250,0,0)"],[1,"rgb(128,0,0)"]],Hot:[[0,"rgb(0,0,0)"],[.3,"rgb(230,0,0)"],[.6,"rgb(255,210,0)"],[1,"rgb(255,255,255)"]],Blackbody:[[0,"rgb(0,0,0)"],[.2,"rgb(230,0,0)"],[.4,"rgb(230,210,0)"],[.7,"rgb(255,255,255)"],[1,"rgb(160,200,255)"]],Earth:[[0,"rgb(0,0,130)"],[.1,"rgb(0,180,180)"],[.2,"rgb(40,210,40)"],[.4,"rgb(230,230,50)"],[.6,"rgb(120,70,20)"],[1,"rgb(255,255,255)"]],Electric:[[0,"rgb(0,0,0)"],[.15,"rgb(30,0,100)"],[.4,"rgb(120,0,100)"],[.6,"rgb(160,90,0)"],[.8,"rgb(230,200,0)"],[1,"rgb(255,250,220)"]],Viridis:[[0,"#440154"],[.06274509803921569,"#48186a"],[.12549019607843137,"#472d7b"],[.18823529411764706,"#424086"],[.25098039215686274,"#3b528b"],[.3137254901960784,"#33638d"],[.3764705882352941,"#2c728e"],[.4392156862745098,"#26828e"],[.5019607843137255,"#21918c"],[.5647058823529412,"#1fa088"],[.6274509803921569,"#28ae80"],[.6901960784313725,"#3fbc73"],[.7529411764705882,"#5ec962"],[.8156862745098039,"#84d44b"],[.8784313725490196,"#addc30"],[.9411764705882353,"#d8e219"],[1,"#fde725"]],Cividis:[[0,"rgb(0,32,76)"],[.058824,"rgb(0,42,102)"],[.117647,"rgb(0,52,110)"],[.176471,"rgb(39,63,108)"],[.235294,"rgb(60,74,107)"],[.294118,"rgb(76,85,107)"],[.352941,"rgb(91,95,109)"],[.411765,"rgb(104,106,112)"],[.470588,"rgb(117,117,117)"],[.529412,"rgb(131,129,120)"],[.588235,"rgb(146,140,120)"],[.647059,"rgb(161,152,118)"],[.705882,"rgb(176,165,114)"],[.764706,"rgb(192,177,109)"],[.823529,"rgb(209,191,102)"],[.882353,"rgb(225,204,92)"],[.941176,"rgb(243,219,79)"],[1,"rgb(255,233,69)"]]},i=n.RdBu;function a(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!==+e[0][0]||1!==+e[e.length-1][0])return!1;for(var n=0;n<e.length;n++){var i=e[n];if(2!==i.length||+i[0]<t||!r(i[1]).isValid())return!1;t=+i[0]}return!0}t.exports={scales:n,defaultScale:i,get:function(e,t){if(t||(t=i),!e)return t;function r(){try{e=n[e]||JSON.parse(e)}catch(r){e=t}}return"string"===typeof e&&(r(),"string"===typeof e&&r()),a(e)?e:t},isValid:function(e){return void 0!==n[e]||a(e)}}}}),V=p({"src/components/color/attributes.js"(e){e.defaults=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],e.defaultLine="#444",e.lightLine="#eee",e.background="#fff",e.borderLine="#BEC8D9",e.lightFraction=1e3/11}}),q=p({"src/components/color/index.js"(e,t){var r=O(),n=k(),i=M().isTypedArray,a=t.exports={},o=V();a.defaults=o.defaults;var s=a.defaultLine=o.defaultLine;a.lightLine=o.lightLine;var l=a.background=o.background;function c(e){if(n(e)||"string"!==typeof e)return e;var t=e.trim();if("rgb"!==t.substr(0,3))return e;var r=t.match(/^rgba?\s*\(([^()]*)\)$/);if(!r)return e;var i=r[1].trim().split(/\s*[\s,]\s*/),a="a"===t.charAt(3)&&4===i.length;if(!a&&3!==i.length)return e;for(var o=0;o<i.length;o++){if(!i[o].length)return e;if(i[o]=Number(i[o]),!(i[o]>=0))return e;if(3===o)i[o]>1&&(i[o]=1);else if(i[o]>=1)return e}var s=Math.round(255*i[0])+", "+Math.round(255*i[1])+", "+Math.round(255*i[2]);return a?"rgba("+s+", "+i[3]+")":"rgb("+s+")"}a.tinyRGB=function(e){var t=e.toRgb();return"rgb("+Math.round(t.r)+", "+Math.round(t.g)+", "+Math.round(t.b)+")"},a.rgb=function(e){return a.tinyRGB(r(e))},a.opacity=function(e){return e?r(e).getAlpha():0},a.addOpacity=function(e,t){var n=r(e).toRgb();return"rgba("+Math.round(n.r)+", "+Math.round(n.g)+", "+Math.round(n.b)+", "+t+")"},a.combine=function(e,t){var n=r(e).toRgb();if(1===n.a)return r(e).toRgbString();var i=r(t||l).toRgb(),a=1===i.a?i:{r:255*(1-i.a)+i.r*i.a,g:255*(1-i.a)+i.g*i.a,b:255*(1-i.a)+i.b*i.a},o={r:a.r*(1-n.a)+n.r*n.a,g:a.g*(1-n.a)+n.g*n.a,b:a.b*(1-n.a)+n.b*n.a};return r(o).toRgbString()},a.interpolate=function(e,t,n){var i=r(e).toRgb(),a=r(t).toRgb(),o={r:n*i.r+(1-n)*a.r,g:n*i.g+(1-n)*a.g,b:n*i.b+(1-n)*a.b};return r(o).toRgbString()},a.contrast=function(e,t,n){var i=r(e);return 1!==i.getAlpha()&&(i=r(a.combine(e,l))),(i.isDark()?t?i.lighten(t):l:n?i.darken(n):s).toString()},a.stroke=function(e,t){var n=r(t);e.style({stroke:a.tinyRGB(n),"stroke-opacity":n.getAlpha()})},a.fill=function(e,t){var n=r(t);e.style({fill:a.tinyRGB(n),"fill-opacity":n.getAlpha()})},a.clean=function(e){if(e&&"object"===typeof e){var t,r,n,o,s=Object.keys(e);for(t=0;t<s.length;t++)if(o=e[n=s[t]],"color"===n.substr(n.length-5))if(Array.isArray(o))for(r=0;r<o.length;r++)o[r]=c(o[r]);else e[n]=c(o);else if("colorscale"===n.substr(n.length-10)&&Array.isArray(o))for(r=0;r<o.length;r++)Array.isArray(o[r])&&(o[r][1]=c(o[r][1]));else if(Array.isArray(o)){var l=o[0];if(!Array.isArray(l)&&l&&"object"===typeof l)for(r=0;r<o.length;r++)a.clean(o[r])}else o&&"object"===typeof o&&!i(o)&&a.clean(o)}}}}),H=p({"src/constants/interactions.js"(e,t){t.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DESELECTDIM:.2}}}),G=p({"src/lib/regex.js"(e){e.counter=function(e,t,r,n){var i=(t||"")+(r?"":"$"),a=!1===n?"":"^";return"xy"===e?new RegExp(a+"x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?"+i):new RegExp(a+e+"([2-9]|[1-9][0-9]+)?"+i)}}}),W=p({"src/lib/coerce.js"(e){var t=k(),r=O(),n=R().extendFlat,i=N(),a=U(),o=q(),s=H().DESELECTDIM,l=E(),c=G().counter,u=z().modHalf,h=M().isArrayOrTypedArray,p=M().isTypedArraySpec,d=M().decodeTypedArraySpec;function f(t,r){var n=e.valObjectMeta[r.valType];if(r.arrayOk&&h(t))return!0;if(n.validateFunction)return n.validateFunction(t,r);var i={},a=i,o={set:function(e){a=e}};return n.coerceFunction(t,o,i,r),a!==i}e.valObjectMeta={data_array:{coerceFunction:function(e,t,r){t.set(h(e)?e:p(e)?d(e):r)}},enumerated:{coerceFunction:function(e,t,r,n){n.coerceNumber&&(e=+e),-1===n.values.indexOf(e)?t.set(r):t.set(e)},validateFunction:function(e,t){t.coerceNumber&&(e=+e);for(var r=t.values,n=0;n<r.length;n++){var i=String(r[n]);if("/"===i.charAt(0)&&"/"===i.charAt(i.length-1)){if(new RegExp(i.substr(1,i.length-2)).test(e))return!0}else if(e===r[n])return!0}return!1}},boolean:{coerceFunction:function(e,t,r){!0===e||!1===e?t.set(e):t.set(r)}},number:{coerceFunction:function(e,r,n,i){p(e)&&(e=d(e)),!t(e)||void 0!==i.min&&e<i.min||void 0!==i.max&&e>i.max?r.set(n):r.set(+e)}},integer:{coerceFunction:function(e,r,n,i){-1===(i.extras||[]).indexOf(e)?(p(e)&&(e=d(e)),e%1||!t(e)||void 0!==i.min&&e<i.min||void 0!==i.max&&e>i.max?r.set(n):r.set(+e)):r.set(e)}},string:{coerceFunction:function(e,t,r,n){if("string"!==typeof e){var i="number"===typeof e;!0!==n.strict&&i?t.set(String(e)):t.set(r)}else n.noBlank&&!e?t.set(r):t.set(e)}},color:{coerceFunction:function(e,t,n){p(e)&&(e=d(e)),r(e).isValid()?t.set(e):t.set(n)}},colorlist:{coerceFunction:function(e,t,n){Array.isArray(e)&&e.length&&e.every((function(e){return r(e).isValid()}))?t.set(e):t.set(n)}},colorscale:{coerceFunction:function(e,t,r){t.set(a.get(e,r))}},angle:{coerceFunction:function(e,r,n){p(e)&&(e=d(e)),"auto"===e?r.set("auto"):t(e)?r.set(u(+e,360)):r.set(n)}},subplotid:{coerceFunction:function(e,t,r,n){var i=n.regex||c(r);"string"===typeof e&&i.test(e)?t.set(e):t.set(r)},validateFunction:function(e,t){var r=t.dflt;return e===r||"string"===typeof e&&!!c(r).test(e)}},flaglist:{coerceFunction:function(e,t,r,n){if(-1===(n.extras||[]).indexOf(e))if("string"===typeof e){for(var i=e.split("+"),a=0;a<i.length;){var o=i[a];-1===n.flags.indexOf(o)||i.indexOf(o)<a?i.splice(a,1):a++}i.length?t.set(i.join("+")):t.set(r)}else t.set(r);else t.set(e)}},any:{coerceFunction:function(e,t,r){void 0===e?t.set(r):t.set(p(e)?d(e):e)}},info_array:{coerceFunction:function(t,r,n,i){function a(t,r,n){var i,a={set:function(e){i=e}};return void 0===n&&(n=r.dflt),e.valObjectMeta[r.valType].coerceFunction(t,a,n,r),i}if(p(t)&&(t=d(t)),h(t)){var o,s,l,c,u,f,m=2===i.dimensions||"1-2"===i.dimensions&&Array.isArray(t)&&h(t[0]),g=i.items,y=[],v=Array.isArray(g),x=v&&m&&h(g[0]),b=m&&v&&!x,_=v&&!b?g.length:t.length;if(n=Array.isArray(n)?n:[],m)for(o=0;o<_;o++)for(y[o]=[],l=h(t[o])?t[o]:[],u=b?g.length:v?g[o].length:l.length,s=0;s<u;s++)c=b?g[s]:v?g[o][s]:g,void 0!==(f=a(l[s],c,(n[o]||[])[s]))&&(y[o][s]=f);else for(o=0;o<_;o++)void 0!==(f=a(t[o],v?g[o]:g,n[o]))&&(y[o]=f);r.set(y)}else r.set(n)},validateFunction:function(e,t){if(!h(e))return!1;var r=t.items,n=Array.isArray(r),i=2===t.dimensions;if(!t.freeLength&&e.length!==r.length)return!1;for(var a=0;a<e.length;a++)if(i){if(!h(e[a])||!t.freeLength&&e[a].length!==r[a].length)return!1;for(var o=0;o<e[a].length;o++)if(!f(e[a][o],n?r[a][o]:r))return!1}else if(!f(e[a],n?r[a]:r))return!1;return!0}}},e.coerce=function(t,r,n,i,a){var o=l(n,i).get(),s=l(t,i),c=l(r,i),u=s.get(),m=r._template;if(void 0===u&&m&&(u=l(m,i).get(),m=0),void 0===a&&(a=o.dflt),o.arrayOk){if(h(u))return c.set(u),u;if(p(u))return u=d(u),c.set(u),u}var g=e.valObjectMeta[o.valType].coerceFunction;g(u,c,a,o);var y=c.get();return m&&y===a&&!f(u,o)&&(g(u=l(m,i).get(),c,a,o),y=c.get()),y},e.coerce2=function(t,r,n,i,a){var o=l(t,i),s=e.coerce(t,r,n,i,a),c=o.get();return void 0!==c&&null!==c&&s},e.coerceFont=function(e,t,r,i){i||(i={}),r=n({},r);var a={family:e(t+".family",(r=n(r,i.overrideDflt||{})).family),size:e(t+".size",r.size),color:e(t+".color",r.color),weight:e(t+".weight",r.weight),style:e(t+".style",r.style)};if(i.noFontVariant||(a.variant=e(t+".variant",r.variant)),i.noFontLineposition||(a.lineposition=e(t+".lineposition",r.lineposition)),i.noFontTextcase||(a.textcase=e(t+".textcase",r.textcase)),!i.noFontShadow){var o=r.shadow;"none"===o&&i.autoShadowDflt&&(o="auto"),a.shadow=e(t+".shadow",o)}return a},e.coercePattern=function(e,t,r,n){if(e(t+".shape")){e(t+".solidity"),e(t+".size");var i="overlay"===e(t+".fillmode");if(!n){var a=e(t+".bgcolor",i?r:void 0);e(t+".fgcolor",i?o.contrast(a):r)}e(t+".fgopacity",i?.5:1)}},e.coerceHoverinfo=function(t,r,n){var a,o=r._module.attributes,s=o.hoverinfo?o:i,l=s.hoverinfo;if(1===n._dataLength){var c="all"===l.dflt?l.flags.slice():l.dflt.split("+");c.splice(c.indexOf("name"),1),a=c.join("+")}return e.coerce(t,r,s,"hoverinfo",a)},e.coerceSelectionMarkerOpacity=function(e,t){if(e.marker){var r,n,i=e.marker.opacity;void 0!==i&&(h(i)||e.selected||e.unselected||(r=i,n=s*i),t("selected.marker.opacity",r),t("unselected.marker.opacity",n))}},e.validate=f}}),$=p({"src/plot_api/plot_config.js"(e,t){var r={staticPlot:{valType:"boolean",dflt:!1},typesetMath:{valType:"boolean",dflt:!0},plotlyServerURL:{valType:"string",dflt:""},editable:{valType:"boolean",dflt:!1},edits:{annotationPosition:{valType:"boolean",dflt:!1},annotationTail:{valType:"boolean",dflt:!1},annotationText:{valType:"boolean",dflt:!1},axisTitleText:{valType:"boolean",dflt:!1},colorbarPosition:{valType:"boolean",dflt:!1},colorbarTitleText:{valType:"boolean",dflt:!1},legendPosition:{valType:"boolean",dflt:!1},legendText:{valType:"boolean",dflt:!1},shapePosition:{valType:"boolean",dflt:!1},titleText:{valType:"boolean",dflt:!1}},editSelection:{valType:"boolean",dflt:!0},autosizable:{valType:"boolean",dflt:!1},responsive:{valType:"boolean",dflt:!1},fillFrame:{valType:"boolean",dflt:!1},frameMargins:{valType:"number",dflt:0,min:0,max:.5},scrollZoom:{valType:"flaglist",flags:["cartesian","gl3d","geo","mapbox","map"],extras:[!0,!1],dflt:"gl3d+geo+map"},doubleClick:{valType:"enumerated",values:[!1,"reset","autosize","reset+autosize"],dflt:"reset+autosize"},doubleClickDelay:{valType:"number",dflt:300,min:0},showAxisDragHandles:{valType:"boolean",dflt:!0},showAxisRangeEntryBoxes:{valType:"boolean",dflt:!0},showTips:{valType:"boolean",dflt:!0},showLink:{valType:"boolean",dflt:!1},linkText:{valType:"string",dflt:"Edit chart",noBlank:!0},sendData:{valType:"boolean",dflt:!0},showSources:{valType:"any",dflt:!1},displayModeBar:{valType:"enumerated",values:["hover",!0,!1],dflt:"hover"},showSendToCloud:{valType:"boolean",dflt:!1},showEditInChartStudio:{valType:"boolean",dflt:!1},modeBarButtonsToRemove:{valType:"any",dflt:[]},modeBarButtonsToAdd:{valType:"any",dflt:[]},modeBarButtons:{valType:"any",dflt:!1},toImageButtonOptions:{valType:"any",dflt:{}},displaylogo:{valType:"boolean",dflt:!0},watermark:{valType:"boolean",dflt:!1},plotGlPixelRatio:{valType:"number",dflt:2,min:1,max:4},setBackground:{valType:"any",dflt:"transparent"},topojsonURL:{valType:"string",noBlank:!0,dflt:"https://cdn.plot.ly/"},mapboxAccessToken:{valType:"string",dflt:null},logging:{valType:"integer",min:0,max:2,dflt:1},notifyOnLogging:{valType:"integer",min:0,max:2,dflt:0},queueLength:{valType:"integer",min:0,dflt:0},locale:{valType:"string",dflt:"en-US"},locales:{valType:"any",dflt:{}}},n={};!function e(t,r){for(var n in t){var i=t[n];i.valType?r[n]=i.dflt:(r[n]||(r[n]={}),e(i,r[n]))}}(r,n),t.exports={configAttributes:r,dfltConfig:n}}}),Z=p({"src/lib/notifier.js"(e,t){var r=v(),n=k(),i=[];t.exports=function(e,t){if(-1===i.indexOf(e)){i.push(e);var a=1e3;n(t)?a=t:"long"===t&&(a=3e3);var o=r.select("body").selectAll(".plotly-notifier").data([0]);o.enter().append("div").classed("plotly-notifier",!0),o.selectAll(".notifier-note").data(i).enter().append("div").classed("notifier-note",!0).style("opacity",0).each((function(e){var n=r.select(this);n.append("button").classed("notifier-close",!0).html("&times;").on("click",(function(){n.transition().call(s)}));for(var i=n.append("p"),o=e.split(/<br\s*\/?>/g),l=0;l<o.length;l++)l&&i.append("br"),i.append("span").text(o[l]);"stick"===t?n.transition().duration(350).style("opacity",1):n.transition().duration(700).style("opacity",1).transition().delay(a).call(s)}))}function s(e){e.duration(700).style("opacity",0).each("end",(function(e){var t=i.indexOf(e);-1!==t&&i.splice(t,1),r.select(this).remove()}))}}}}),X=p({"src/lib/loggers.js"(e,t){var r=$().dfltConfig,n=Z(),i=t.exports={};i.log=function(){var e;if(r.logging>1){var t=["LOG:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(r.notifyOnLogging>1){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"long")}},i.warn=function(){var e;if(r.logging>0){var t=["WARN:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.trace.apply(console,t)}if(r.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"stick")}},i.error=function(){var e;if(r.logging>0){var t=["ERROR:"];for(e=0;e<arguments.length;e++)t.push(arguments[e]);console.error.apply(console,t)}if(r.notifyOnLogging>0){var i=[];for(e=0;e<arguments.length;e++)i.push(arguments[e]);n(i.join("<br>"),"stick")}}}}),Y=p({"src/lib/noop.js"(e,t){t.exports=function(){}}}),K=p({"src/lib/push_unique.js"(e,t){t.exports=function(e,t){if(t instanceof RegExp){for(var r=t.toString(),n=0;n<e.length;n++)if(e[n]instanceof RegExp&&e[n].toString()===r)return e;e.push(t)}else!t&&0!==t||-1!==e.indexOf(t)||e.push(t);return e}}}),J=p({"node_modules/gl-mat4/create.js"(e,t){t.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),Q=p({"node_modules/gl-mat4/clone.js"(e,t){t.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}}}),ee=p({"node_modules/gl-mat4/copy.js"(e,t){t.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}}),te=p({"node_modules/gl-mat4/identity.js"(e,t){t.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),re=p({"node_modules/gl-mat4/transpose.js"(e,t){t.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}}}),ne=p({"node_modules/gl-mat4/invert.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-p*f,A=u*y-d*f,M=h*g-p*m,E=h*y-d*m,C=p*y-d*g,P=v*C-x*E+b*M+_*A-w*S+k*T;return P?(P=1/P,e[0]=(s*C-l*E+c*M)*P,e[1]=(i*E-n*C-a*M)*P,e[2]=(m*k-g*w+y*_)*P,e[3]=(p*w-h*k-d*_)*P,e[4]=(l*A-o*C-c*S)*P,e[5]=(r*C-i*A+a*S)*P,e[6]=(g*b-f*k-y*x)*P,e[7]=(u*k-p*b+d*x)*P,e[8]=(o*E-s*A+c*T)*P,e[9]=(n*A-r*E-a*T)*P,e[10]=(f*w-m*b+y*v)*P,e[11]=(h*b-u*w-d*v)*P,e[12]=(s*S-o*M-l*T)*P,e[13]=(r*M-n*S+i*T)*P,e[14]=(m*x-f*_-g*v)*P,e[15]=(u*_-h*x+p*v)*P,e):null}}}),ie=p({"node_modules/gl-mat4/adjoint.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15];return e[0]=s*(p*y-d*g)-h*(l*y-c*g)+m*(l*d-c*p),e[1]=-(n*(p*y-d*g)-h*(i*y-a*g)+m*(i*d-a*p)),e[2]=n*(l*y-c*g)-s*(i*y-a*g)+m*(i*c-a*l),e[3]=-(n*(l*d-c*p)-s*(i*d-a*p)+h*(i*c-a*l)),e[4]=-(o*(p*y-d*g)-u*(l*y-c*g)+f*(l*d-c*p)),e[5]=r*(p*y-d*g)-u*(i*y-a*g)+f*(i*d-a*p),e[6]=-(r*(l*y-c*g)-o*(i*y-a*g)+f*(i*c-a*l)),e[7]=r*(l*d-c*p)-o*(i*d-a*p)+u*(i*c-a*l),e[8]=o*(h*y-d*m)-u*(s*y-c*m)+f*(s*d-c*h),e[9]=-(r*(h*y-d*m)-u*(n*y-a*m)+f*(n*d-a*h)),e[10]=r*(s*y-c*m)-o*(n*y-a*m)+f*(n*c-a*s),e[11]=-(r*(s*d-c*h)-o*(n*d-a*h)+u*(n*c-a*s)),e[12]=-(o*(h*g-p*m)-u*(s*g-l*m)+f*(s*p-l*h)),e[13]=r*(h*g-p*m)-u*(n*g-i*m)+f*(n*p-i*h),e[14]=-(r*(s*g-l*m)-o*(n*g-i*m)+f*(n*l-i*s)),e[15]=r*(s*p-l*h)-o*(n*p-i*h)+u*(n*l-i*s),e}}}),ae=p({"node_modules/gl-mat4/determinant.js"(e,t){t.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],f=e[13],m=e[14],g=e[15];return(t*o-r*a)*(h*g-p*m)-(t*s-n*a)*(u*g-p*f)+(t*l-i*a)*(u*m-h*f)+(r*s-n*o)*(c*g-p*d)-(r*l-i*o)*(c*m-h*d)+(n*l-i*s)*(c*f-u*d)}}}),oe=p({"node_modules/gl-mat4/multiply.js"(e,t){t.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*h+w*m,e[1]=x*i+b*l+_*p+w*g,e[2]=x*a+b*c+_*d+w*y,e[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*h+w*m,e[5]=x*i+b*l+_*p+w*g,e[6]=x*a+b*c+_*d+w*y,e[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*h+w*m,e[9]=x*i+b*l+_*p+w*g,e[10]=x*a+b*c+_*d+w*y,e[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*h+w*m,e[13]=x*i+b*l+_*p+w*g,e[14]=x*a+b*c+_*d+w*y,e[15]=x*o+b*u+_*f+w*v,e}}}),se=p({"node_modules/gl-mat4/translate.js"(e,t){t.exports=function(e,t,r){var n,i,a,o,s,l,c,u,h,p,d,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+p*y+t[13],e[14]=a*m+c*g+d*y+t[14],e[15]=o*m+u*g+f*y+t[15]),e}}}),le=p({"node_modules/gl-mat4/scale.js"(e,t){t.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}}}),ce=p({"node_modules/gl-mat4/rotate.js"(e,t){t.exports=function(e,t,r,n){var i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E=n[0],C=n[1],P=n[2],L=Math.sqrt(E*E+C*C+P*P);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,P*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],c=t[2],u=t[3],h=t[4],p=t[5],d=t[6],f=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,b=C*E*o+P*i,_=P*E*o-C*i,w=E*C*o-P*i,k=C*C*o+a,T=P*C*o+E*i,S=E*P*o+C*i,A=C*P*o-E*i,M=P*P*o+a,e[0]=s*x+h*b+m*_,e[1]=l*x+p*b+g*_,e[2]=c*x+d*b+y*_,e[3]=u*x+f*b+v*_,e[4]=s*w+h*k+m*T,e[5]=l*w+p*k+g*T,e[6]=c*w+d*k+y*T,e[7]=u*w+f*k+v*T,e[8]=s*S+h*A+m*M,e[9]=l*S+p*A+g*M,e[10]=c*S+d*A+y*M,e[11]=u*S+f*A+v*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}}}),ue=p({"node_modules/gl-mat4/rotateX.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+p*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=p*i-l*n,e}}}),he=p({"node_modules/gl-mat4/rotateY.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-u*n,e[2]=s*i-h*n,e[3]=l*i-p*n,e[8]=a*n+c*i,e[9]=o*n+u*i,e[10]=s*n+h*i,e[11]=l*n+p*i,e}}}),pe=p({"node_modules/gl-mat4/rotateZ.js"(e,t){t.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+p*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=p*i-l*n,e}}}),de=p({"node_modules/gl-mat4/fromRotation.js"(e,t){t.exports=function(e,t,r){var n,i,a,o=r[0],s=r[1],l=r[2],c=Math.sqrt(o*o+s*s+l*l);return Math.abs(c)<1e-6?null:(o*=c=1/c,s*=c,l*=c,n=Math.sin(t),i=Math.cos(t),a=1-i,e[0]=o*o*a+i,e[1]=s*o*a+l*n,e[2]=l*o*a-s*n,e[3]=0,e[4]=o*s*a-l*n,e[5]=s*s*a+i,e[6]=l*s*a+o*n,e[7]=0,e[8]=o*l*a+s*n,e[9]=s*l*a-o*n,e[10]=l*l*a+i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}}}),fe=p({"node_modules/gl-mat4/fromRotationTranslation.js"(e,t){t.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,p=n*c,d=i*l,f=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(d+m),e[1]=h+v,e[2]=p-y,e[3]=0,e[4]=h-v,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=p+y,e[9]=f-g,e[10]=1-(u+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}}}),me=p({"node_modules/gl-mat4/fromScaling.js"(e,t){t.exports=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),ge=p({"node_modules/gl-mat4/fromTranslation.js"(e,t){t.exports=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}}}),ye=p({"node_modules/gl-mat4/fromXRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),ve=p({"node_modules/gl-mat4/fromYRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),xe=p({"node_modules/gl-mat4/fromZRotation.js"(e,t){t.exports=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),be=p({"node_modules/gl-mat4/fromQuat.js"(e,t){t.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,p=i*o,d=i*s,f=i*l,m=a*o,g=a*s,y=a*l;return e[0]=1-h-f,e[1]=u+y,e[2]=p-g,e[3]=0,e[4]=u-y,e[5]=1-c-f,e[6]=d+m,e[7]=0,e[8]=p+g,e[9]=d-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}}}),_e=p({"node_modules/gl-mat4/frustum.js"(e,t){t.exports=function(e,t,r,n,i,a,o){var s=1/(r-t),l=1/(i-n),c=1/(a-o);return e[0]=2*a*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*l,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}}}),we=p({"node_modules/gl-mat4/perspective.js"(e,t){t.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}}}),ke=p({"node_modules/gl-mat4/perspectiveFromFieldOfView.js"(e,t){t.exports=function(e,t,r,n){var i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(o-s)*l*.5,e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}}}),Te=p({"node_modules/gl-mat4/ortho.js"(e,t){t.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e}}}),Se=p({"node_modules/gl-mat4/lookAt.js"(e,t){var r=te();t.exports=function(e,t,n,i){var a,o,s,l,c,u,h,p,d,f,m=t[0],g=t[1],y=t[2],v=i[0],x=i[1],b=i[2],_=n[0],w=n[1],k=n[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?r(e):(h=m-_,p=g-w,d=y-k,f=1/Math.sqrt(h*h+p*p+d*d),a=x*(d*=f)-b*(p*=f),o=b*(h*=f)-v*d,s=v*p-x*h,(f=Math.sqrt(a*a+o*o+s*s))?(a*=f=1/f,o*=f,s*=f):(a=0,o=0,s=0),l=p*s-d*o,c=d*a-h*s,u=h*o-p*a,(f=Math.sqrt(l*l+c*c+u*u))?(l*=f=1/f,c*=f,u*=f):(l=0,c=0,u=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=u,e[10]=d,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(h*m+p*g+d*y),e[15]=1,e)}}}),Ae=p({"node_modules/gl-mat4/str.js"(e,t){t.exports=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}}}),Me=p({"node_modules/gl-mat4/index.js"(e,t){t.exports={create:J(),clone:Q(),copy:ee(),identity:te(),transpose:re(),invert:ne(),adjoint:ie(),determinant:ae(),multiply:oe(),translate:se(),scale:le(),rotate:ce(),rotateX:ue(),rotateY:he(),rotateZ:pe(),fromRotation:de(),fromRotationTranslation:fe(),fromScaling:me(),fromTranslation:ge(),fromXRotation:ye(),fromYRotation:ve(),fromZRotation:xe(),fromQuat:be(),frustum:_e(),perspective:we(),perspectiveFromFieldOfView:ke(),ortho:Te(),lookAt:Se(),str:Ae()}}}),Ee=p({"src/lib/matrix.js"(e){var t=Me();e.init2dArray=function(e,t){for(var r=new Array(e),n=0;n<e;n++)r[n]=new Array(t);return r},e.transposeRagged=function(e){var t,r,n=0,i=e.length;for(t=0;t<i;t++)n=Math.max(n,e[t].length);var a=new Array(n);for(t=0;t<n;t++)for(a[t]=new Array(i),r=0;r<i;r++)a[t][r]=e[r][t];return a},e.dot=function(t,r){if(!t.length||!r.length||t.length!==r.length)return null;var n,i,a=t.length;if(t[0].length)for(n=new Array(a),i=0;i<a;i++)n[i]=e.dot(t[i],r);else if(r[0].length){var o=e.transposeRagged(r);for(n=new Array(o.length),i=0;i<o.length;i++)n[i]=e.dot(t,o[i])}else for(n=0,i=0;i<a;i++)n+=t[i]*r[i];return n},e.translationMatrix=function(e,t){return[[1,0,e],[0,1,t],[0,0,1]]},e.rotationMatrix=function(e){var t=e*Math.PI/180;return[[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]]},e.rotationXYMatrix=function(t,r,n){return e.dot(e.dot(e.translationMatrix(r,n),e.rotationMatrix(t)),e.translationMatrix(-r,-n))},e.apply3DTransform=function(t){return function(){var r=arguments,n=1===arguments.length?r[0]:[r[0],r[1],r[2]||0];return e.dot(t,[n[0],n[1],n[2],1]).slice(0,3)}},e.apply2DTransform=function(t){return function(){var r=arguments;3===r.length&&(r=r[0]);var n=1===arguments.length?r[0]:[r[0],r[1]];return e.dot(t,[n[0],n[1],1]).slice(0,2)}},e.apply2DTransform2=function(t){var r=e.apply2DTransform(t);return function(e){return r(e.slice(0,2)).concat(r(e.slice(2,4)))}},e.convertCssMatrix=function(e){if(e){var t=e.length;if(16===t)return e;if(6===t)return[e[0],e[1],0,0,e[2],e[3],0,0,0,0,1,0,e[4],e[5],0,1]}return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},e.inverseTransformMatrix=function(e){var r=[];return t.invert(r,e),[[r[0],r[1],r[2],r[3]],[r[4],r[5],r[6],r[7]],[r[8],r[9],r[10],r[11]],[r[12],r[13],r[14],r[15]]]}}}),Ce=p({"src/lib/dom.js"(e,t){var r=v(),n=X(),i=Ee(),a=Me();function o(e){var t=e&&e.parentNode;t&&t.removeChild(e)}function s(e,t,r){var i="plotly.js-style-"+e,a=document.getElementById(i);if(!a||!a.matches(".no-inline-styles")){a||((a=document.createElement("style")).setAttribute("id",i),a.appendChild(document.createTextNode("")),document.head.appendChild(a));var o=a.sheet;o?o.insertRule?o.insertRule(t+"{"+r+"}",0):o.addRule?o.addRule(t,r,0):n.warn("addStyleRule failed"):n.warn("Cannot addRelatedStyleRule, probably due to strict CSP...")}}function l(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("-webkit-transform")||t.getPropertyValue("-moz-transform")||t.getPropertyValue("-ms-transform")||t.getPropertyValue("-o-transform")||t.getPropertyValue("transform");return"none"===r?null:r.replace("matrix","").replace("3d","").slice(1,-1).split(",").map((function(e){return+e}))}function c(e){for(var t=[];u(e);)t.push(e),e=e.parentNode,"function"===typeof ShadowRoot&&e instanceof ShadowRoot&&(e=e.host);return t}function u(e){return e&&(e instanceof Element||e instanceof HTMLElement)}t.exports={getGraphDiv:function(e){var t;if("string"===typeof e){if(null===(t=document.getElementById(e)))throw new Error("No DOM element with id '"+e+"' exists on the page.");return t}if(null===e||void 0===e)throw new Error("DOM element provided is null or undefined");return e},isPlotDiv:function(e){var t=r.select(e);return t.node()instanceof HTMLElement&&t.size()&&t.classed("js-plotly-plot")},removeElement:o,addStyleRule:function(e,t){s("global",e,t)},addRelatedStyleRule:s,deleteRelatedStyleRule:function(e){var t="plotly.js-style-"+e,r=document.getElementById(t);r&&o(r)},setStyleOnHover:function(e,t,r,n,i,a){var o=n.split(":"),s=i.split(":"),l="data-btn-style-event-added";a||(a=document),a.querySelectorAll(e).forEach((function(e){e.getAttribute(l)||(e.addEventListener("mouseenter",(function(){var e=this.querySelector(r);e&&(e.style[o[0]]=o[1])})),e.addEventListener("mouseleave",(function(){var e=this.querySelector(r);e&&(t&&this.matches(t)?e.style[o[0]]=o[1]:e.style[s[0]]=s[1])})),e.setAttribute(l,!0))}))},getFullTransformMatrix:function(e){var t=c(e),r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];return t.forEach((function(e){var t=l(e);if(t){var n=i.convertCssMatrix(t);r=a.multiply(r,r,n)}})),r},getElementTransformMatrix:l,getElementAndAncestors:c,equalDomRects:function(e,t){return e&&t&&e.top===t.top&&e.left===t.left&&e.right===t.right&&e.bottom===t.bottom}}}}),Pe=p({"src/plots/animation_attributes.js"(e,t){t.exports={mode:{valType:"enumerated",dflt:"afterall",values:["immediate","next","afterall"]},direction:{valType:"enumerated",values:["forward","reverse"],dflt:"forward"},fromcurrent:{valType:"boolean",dflt:!1},frame:{duration:{valType:"number",min:0,dflt:500},redraw:{valType:"boolean",dflt:!0}},transition:{duration:{valType:"number",min:0,dflt:500,editType:"none"},easing:{valType:"enumerated",dflt:"cubic-in-out",values:["linear","quad","cubic","sin","exp","circle","elastic","back","bounce","linear-in","quad-in","cubic-in","sin-in","exp-in","circle-in","elastic-in","back-in","bounce-in","linear-out","quad-out","cubic-out","sin-out","exp-out","circle-out","elastic-out","back-out","bounce-out","linear-in-out","quad-in-out","cubic-in-out","sin-in-out","exp-in-out","circle-in-out","elastic-in-out","back-in-out","bounce-in-out"],editType:"none"},ordering:{valType:"enumerated",values:["layout first","traces first"],dflt:"layout first",editType:"none"}}}}}),Le=p({"src/plot_api/edit_types.js"(e,t){var r=R().extendFlat,n=A(),i={valType:"flaglist",extras:["none"],flags:["calc","clearAxisTypes","plot","style","markerSize","colorbars"]},a={valType:"flaglist",extras:["none"],flags:["calc","plot","legend","ticks","axrange","layoutstyle","modebar","camera","arraydraw","colorbars"]},o=i.flags.slice().concat(["fullReplot"]),s=a.flags.slice().concat("layoutReplot");function l(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!1;return t}function c(e,t,i){var a=r({},e);for(var o in a){var s=a[o];n(s)&&(a[o]=u(s,t,0,o))}return"from-root"===i&&(a.editType=t),a}function u(e,t,n,i){if(e.valType){var a=r({},e);if(a.editType=t,Array.isArray(e.items)){a.items=new Array(e.items.length);for(var o=0;o<e.items.length;o++)a.items[o]=u(e.items[o],t)}return a}return c(e,t,"_"===i.charAt(0)?"nested":"from-root")}t.exports={traces:i,layout:a,traceFlags:function(){return l(o)},layoutFlags:function(){return l(s)},update:function(e,t){var r=t.editType;if(r&&"none"!==r)for(var n=r.split("+"),i=0;i<n.length;i++)e[n[i]]=!0},overrideAll:c}}}),Ie=p({"src/components/drawing/attributes.js"(e){e.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"},e.pattern={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"}}}),ze=p({"src/constants/docs.js"(e,t){t.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"}}}),Oe=p({"src/plots/template_attributes.js"(e){var t=ze();function r(e){var t=e.description?" "+e.description:"",r=e.keys||[];if(r.length>0){for(var n=[],i=0;i<r.length;i++)n[i]="`"+r[i]+"`";t+="Finally, the template string has access to ",t=1===r.length?t+"variable "+n[0]:t+"variables "+n.slice(0,-1).join(", ")+" and "+n.slice(-1)+"."}return t}t.FORMAT_LINK,t.DATE_FORMAT_LINK,e.hovertemplateAttrs=function(e,t){e=e||{},r(t=t||{});var n={valType:"string",dflt:"",editType:e.editType||"none"};return!1!==e.arrayOk&&(n.arrayOk=!0),n},e.texttemplateAttrs=function(e,t){e=e||{},r(t=t||{});var n={valType:"string",dflt:"",editType:e.editType||"calc"};return!1!==e.arrayOk&&(n.arrayOk=!0),n},e.shapeTexttemplateAttrs=function(e,t){return t=t||{},(e=e||{}).newshape,r(t),{valType:"string",dflt:"",editType:e.editType||"arraydraw"}}}}),Re=p({"src/components/shapes/label_texttemplate.js"(e,t){function r(e,t){return t?t.d2l(e):e}function n(e,t){return t?t.l2d(e):e}function i(e){return e.x0shift||0}function a(e){return e.x1shift||0}function o(e){return e.y0shift||0}function s(e){return e.y1shift||0}function l(e,t){return r(e.x1,t)+a(e)-r(e.x0,t)-i(e)}function c(e,t,n){return r(e.y1,n)+s(e)-r(e.y0,n)-o(e)}t.exports={x0:function(e){return e.x0},x1:function(e){return e.x1},y0:function(e){return e.y0},y1:function(e){return e.y1},slope:function(e,t,r){return"line"!==e.type?void 0:c(e,0,r)/l(e,t)},dx:l,dy:c,width:function(e,t){return Math.abs(l(e,t))},height:function(e,t,r){return Math.abs(c(e,0,r))},length:function(e,t,r){return"line"!==e.type?void 0:Math.sqrt(Math.pow(l(e,t),2)+Math.pow(c(e,0,r),2))},xcenter:function(e,t){return n((r(e.x1,t)+a(e)+r(e.x0,t)+i(e))/2,t)},ycenter:function(e,t,i){return n((r(e.y1,i)+s(e)+r(e.y0,i)+o(e))/2,i)}}}}),De=p({"src/components/shapes/draw_newshape/attributes.js"(e,t){var r=Le().overrideAll,n=N(),i=D(),a=Ie().dash,o=R().extendFlat,s=Oe().shapeTexttemplateAttrs,l=Re();t.exports=r({newshape:{visible:o({},n.visible,{}),showlegend:{valType:"boolean",dflt:!1},legend:o({},n.legend,{}),legendgroup:o({},n.legendgroup,{}),legendgrouptitle:{text:o({},n.legendgrouptitle.text,{}),font:i({})},legendrank:o({},n.legendrank,{}),legendwidth:o({},n.legendwidth,{}),line:{color:{valType:"color"},width:{valType:"number",min:0,dflt:4},dash:o({},a,{dflt:"solid"})},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd"},opacity:{valType:"number",min:0,max:1,dflt:1},layer:{valType:"enumerated",values:["below","above","between"],dflt:"above"},drawdirection:{valType:"enumerated",values:["ortho","horizontal","vertical","diagonal"],dflt:"diagonal"},name:o({},n.name,{}),label:{text:{valType:"string",dflt:""},texttemplate:s({newshape:!0},{keys:Object.keys(l)}),font:i({}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right","start","middle","end"]},textangle:{valType:"angle",dflt:"auto"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},padding:{valType:"number",dflt:3,min:0}}},activeshape:{fillcolor:{valType:"color",dflt:"rgb(255,0,255)"},opacity:{valType:"number",min:0,max:1,dflt:.5}}},"none","from-root")}}),je=p({"src/components/selections/draw_newselection/attributes.js"(e,t){var r=Ie().dash,n=R().extendFlat;t.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:n({},r,{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"}}}}),Fe=p({"src/plots/pad_attributes.js"(e,t){t.exports=function(e){var t=e.editType;return{t:{valType:"number",dflt:0,editType:t},r:{valType:"number",dflt:0,editType:t},b:{valType:"number",dflt:0,editType:t},l:{valType:"number",dflt:0,editType:t},editType:t}}}}),Be=p({"src/plots/layout_attributes.js"(e,t){var r=D(),n=Pe(),i=V(),a=De(),o=je(),s=Fe(),l=R().extendFlat,c=r({editType:"calc"});c.family.dflt='"Open Sans", verdana, arial, sans-serif',c.size.dflt=12,c.color.dflt=i.defaultLine,t.exports={font:c,title:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),subtitle:{text:{valType:"string",editType:"layoutstyle"},font:r({editType:"layoutstyle"}),editType:"layoutstyle"},xref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},yref:{valType:"enumerated",dflt:"container",values:["container","paper"],editType:"layoutstyle"},x:{valType:"number",min:0,max:1,dflt:.5,editType:"layoutstyle"},y:{valType:"number",min:0,max:1,dflt:"auto",editType:"layoutstyle"},xanchor:{valType:"enumerated",dflt:"auto",values:["auto","left","center","right"],editType:"layoutstyle"},yanchor:{valType:"enumerated",dflt:"auto",values:["auto","top","middle","bottom"],editType:"layoutstyle"},pad:l(s({editType:"layoutstyle"}),{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},editType:"layoutstyle"},uniformtext:{mode:{valType:"enumerated",values:[!1,"hide","show"],dflt:!1,editType:"plot"},minsize:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"},autosize:{valType:"boolean",dflt:!1,editType:"none"},width:{valType:"number",min:10,dflt:700,editType:"plot"},height:{valType:"number",min:10,dflt:450,editType:"plot"},minreducedwidth:{valType:"number",min:2,dflt:64,editType:"plot"},minreducedheight:{valType:"number",min:2,dflt:64,editType:"plot"},margin:{l:{valType:"number",min:0,dflt:80,editType:"plot"},r:{valType:"number",min:0,dflt:80,editType:"plot"},t:{valType:"number",min:0,dflt:100,editType:"plot"},b:{valType:"number",min:0,dflt:80,editType:"plot"},pad:{valType:"number",min:0,dflt:0,editType:"plot"},autoexpand:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},computed:{valType:"any",editType:"none"},paper_bgcolor:{valType:"color",dflt:i.background,editType:"plot"},plot_bgcolor:{valType:"color",dflt:i.background,editType:"layoutstyle"},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},separators:{valType:"string",editType:"plot"},hidesources:{valType:"boolean",dflt:!1,editType:"plot"},showlegend:{valType:"boolean",editType:"legend"},colorway:{valType:"colorlist",dflt:i.defaults,editType:"calc"},datarevision:{valType:"any",editType:"calc"},uirevision:{valType:"any",editType:"none"},editrevision:{valType:"any",editType:"none"},selectionrevision:{valType:"any",editType:"none"},template:{valType:"any",editType:"calc"},newshape:a.newshape,activeshape:a.activeshape,newselection:o.newselection,activeselection:o.activeselection,meta:{valType:"any",arrayOk:!0,editType:"plot"},transition:l({},n.transition,{editType:"none"})}}}),Ne=h({"temp_stylePlugin:node_modules/maplibre-gl/dist/maplibre-gl.css"(){}}),Ue=h({"stylePlugin:/Users/ekl/code/plotly.js/node_modules/maplibre-gl/dist/maplibre-gl.css"(){Ne()}}),Ve=p({"src/registry.js"(e){var t=X(),r=Y(),n=K(),i=A(),a=Ce().addStyleRule,o=R(),s=N(),l=Be(),c=o.extendFlat,u=o.extendDeepAll;function h(r){var n=r.name,i=r.categories,o=r.meta;if(e.modules[n])t.log("Type "+n+" already registered");else{e.subplotsRegistry[r.basePlotModule.name]||function(r){var n=r.name;if(e.subplotsRegistry[n])t.log("Plot type "+n+" already registered.");else for(var i in m(r),e.subplotsRegistry[n]=r,e.componentsRegistry)y(i,r.name)}(r.basePlotModule);for(var s={},l=0;l<i.length;l++)s[i[l]]=!0,e.allCategories[i[l]]=!0;for(var u in e.modules[n]={_module:r,categories:s},o&&Object.keys(o).length&&(e.modules[n].meta=o),e.allTypes.push(n),e.componentsRegistry)g(u,n);r.layoutAttributes&&c(e.traceLayoutAttributes,r.layoutAttributes);var h=r.basePlotModule,p=h.name;if("mapbox"===p){var d=h.constants.styleRules;for(var f in d)a(".js-plotly-plot .plotly .mapboxgl-"+f,d[f])}"map"===p&&Ue(),"geo"!==p&&"mapbox"!==p&&"map"!==p||void 0!==window.PlotlyGeoAssets||(window.PlotlyGeoAssets={topojson:{}})}}function p(t){if("string"!==typeof t.name)throw new Error("Component module *name* must be a string.");var r=t.name;for(var i in e.componentsRegistry[r]=t,t.layoutAttributes&&(t.layoutAttributes._isLinkedToArray&&n(e.layoutArrayContainers,r),m(t)),e.modules)g(r,i);for(var a in e.subplotsRegistry)y(r,a);t.schema&&t.schema.layout&&u(l,t.schema.layout)}function d(e){if("string"!==typeof e.name)throw new Error("Transform module *name* must be a string.");var r="Transform module "+e.name,n="function"===typeof e.transform,a="function"===typeof e.calcTransform;if(!n&&!a)throw new Error(r+" is missing a *transform* or *calcTransform* method.");n&&a&&t.log([r+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),i(e.attributes)||t.log(r+" registered without an *attributes* object."),"function"!==typeof e.supplyDefaults&&t.log(r+" registered without a *supplyDefaults* method.")}function f(t){var r=t.name,n=r.split("-")[0],i=t.dictionary,a=t.format,o=i&&Object.keys(i).length,s=a&&Object.keys(a).length,l=e.localeRegistry,c=l[r];if(c||(l[r]=c={}),n!==r){var u=l[n];u||(l[n]=u={}),o&&u.dictionary===c.dictionary&&(u.dictionary=i),s&&u.format===c.format&&(u.format=a)}o&&(c.dictionary=i),s&&(c.format=a)}function m(t){if(t.layoutAttributes){var r=t.layoutAttributes._arrayAttrRegexps;if(r)for(var i=0;i<r.length;i++)n(e.layoutArrayRegexes,r[i])}}function g(t,r){var n=e.componentsRegistry[t].schema;if(n&&n.traces){var i=n.traces[r];i&&u(e.modules[r]._module.attributes,i)}}function y(t,r){var n=e.componentsRegistry[t].schema;if(n&&n.subplots){var i=e.subplotsRegistry[r],a=i.layoutAttributes,o="subplot"===i.attr?i.name:i.attr;Array.isArray(o)&&(o=o[0]);var s=n.subplots[o];a&&s&&u(a,s)}}function v(e){return"object"===typeof e&&(e=e.type),e}e.modules={},e.allCategories={},e.allTypes=[],e.subplotsRegistry={},e.componentsRegistry={},e.layoutArrayContainers=[],e.layoutArrayRegexes=[],e.traceLayoutAttributes={},e.localeRegistry={},e.apiMethodRegistry={},e.collectableSubplotTypes=null,e.register=function(t){if(e.collectableSubplotTypes=null,!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var r=0;r<t.length;r++){var n=t[r];if(!n)throw new Error("Invalid module was attempted to be registered!");switch(n.moduleType){case"trace":h(n);break;case"transform":d(n);break;case"component":p(n);break;case"locale":f(n);break;case"apiMethod":var i=n.name;e.apiMethodRegistry[i]=n.fn;break;default:throw new Error("Invalid module was attempted to be registered!")}}},e.getModule=function(t){var r=e.modules[v(t)];return!!r&&r._module},e.traceIs=function(r,n){if("various"===(r=v(r)))return!1;var i=e.modules[r];return i||(r&&t.log("Unrecognized trace type "+r+"."),i=e.modules[s.type.dflt]),!!i.categories[n]},e.getComponentMethod=function(t,n){var i=e.componentsRegistry[t];return i&&i[n]||r},e.call=function(){var t=arguments[0],r=[].slice.call(arguments,1);return e.apiMethodRegistry[t].apply(null,r)}}}),qe=p({"src/lib/dates.js"(e){var t,r,n=b().timeFormat,i=k(),a=X(),o=z().mod,s=T(),l=s.BADNUM,c=s.ONEDAY,u=s.ONEHOUR,h=s.ONEMIN,p=s.ONESEC,d=s.EPOCHJD,f=Ve(),m=b().utcFormat,g=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,y=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d(:?\d\d)?)?)?)?)?)?\s*$/m,v=(new Date).getFullYear()-70;function x(e){return e&&f.componentsRegistry.calendars&&"string"===typeof e&&"gregorian"!==e}function _(e,t){return String(e+Math.pow(10,t)).substr(1)}e.dateTick0=function(t,r){var n=function(e,t){return x(e)?t?f.getComponentMethod("calendars","CANONICAL_SUNDAY")[e]:f.getComponentMethod("calendars","CANONICAL_TICK")[e]:t?"2000-01-02":"2000-01-01"}(t,!!r);if(r<2)return n;var i=e.dateTime2ms(n,t);return i+=c*(r-1),e.ms2DateTime(i,0,t)},e.dfltRange=function(e){return x(e)?f.getComponentMethod("calendars","DFLTRANGE")[e]:["2000-01-01","2001-01-01"]},e.isJSDate=function(e){return"object"===typeof e&&null!==e&&"function"===typeof e.getTime},e.dateTime2ms=function(n,i){if(e.isJSDate(n)){var a=n.getTimezoneOffset()*h,s=(n.getUTCMinutes()-n.getMinutes())*h+(n.getUTCSeconds()-n.getSeconds())*p+(n.getUTCMilliseconds()-n.getMilliseconds());if(s){var m=3*h;a=a-m/2+o(s-a+m/2,m)}return(n=Number(n)-a)>=t&&n<=r?n:l}if("string"!==typeof n&&"number"!==typeof n)return l;n=String(n);var b=x(i),_=n.charAt(0);!b||"G"!==_&&"g"!==_||(n=n.substr(1),i="");var w=b&&"chinese"===i.substr(0,7),k=n.match(w?y:g);if(!k)return l;var T=k[1],S=k[3]||"1",A=Number(k[5]||1),M=Number(k[7]||0),E=Number(k[9]||0),C=Number(k[11]||0);if(b){if(2===T.length)return l;var P;T=Number(T);try{var L=f.getComponentMethod("calendars","getCal")(i);if(w){var I="i"===S.charAt(S.length-1);S=parseInt(S,10),P=L.newDate(T,L.toMonthIndex(T,S,I),A)}else P=L.newDate(T,Number(S),A)}catch(O){return l}return P?(P.toJD()-d)*c+M*u+E*h+C*p:l}T=2===T.length?(Number(T)+2e3-v)%100+v:Number(T),S-=1;var z=new Date(Date.UTC(2e3,S,A,M,E));return z.setUTCFullYear(T),z.getUTCMonth()!==S||z.getUTCDate()!==A?l:z.getTime()+C*p},t=e.MIN_MS=e.dateTime2ms("-9999"),r=e.MAX_MS=e.dateTime2ms("9999-12-31 23:59:59.9999"),e.isDateTime=function(t,r){return e.dateTime2ms(t,r)!==l};var w=90*c,S=3*u,A=5*h;function M(e,t,r,n,i){if((t||r||n||i)&&(e+=" "+_(t,2)+":"+_(r,2),(n||i)&&(e+=":"+_(n,2),i))){for(var a=4;i%10===0;)a-=1,i/=10;e+="."+_(i,a)}return e}e.ms2DateTime=function(e,n,i){if("number"!==typeof e||!(e>=t&&e<=r))return l;n||(n=0);var a,s,g,y,v,b,_=Math.floor(10*o(e+.05,1)),k=Math.round(e-_/10);if(x(i)){var T=Math.floor(k/c)+d,E=Math.floor(o(e,c));try{a=f.getComponentMethod("calendars","getCal")(i).fromJD(T).formatDate("yyyy-mm-dd")}catch(C){a=m("G%Y-%m-%d")(new Date(k))}if("-"===a.charAt(0))for(;a.length<11;)a="-0"+a.substr(1);else for(;a.length<10;)a="0"+a;s=n<w?Math.floor(E/u):0,g=n<w?Math.floor(E%u/h):0,y=n<S?Math.floor(E%h/p):0,v=n<A?E%p*10+_:0}else b=new Date(k),a=m("%Y-%m-%d")(b),s=n<w?b.getUTCHours():0,g=n<w?b.getUTCMinutes():0,y=n<S?b.getUTCSeconds():0,v=n<A?10*b.getUTCMilliseconds()+_:0;return M(a,s,g,y,v)},e.ms2DateTimeLocal=function(e){if(!(e>=t+c&&e<=r-c))return l;var i=Math.floor(10*o(e+.05,1)),a=new Date(Math.round(e-i/10));return M(n("%Y-%m-%d")(a),a.getHours(),a.getMinutes(),a.getSeconds(),10*a.getUTCMilliseconds()+i)},e.cleanDate=function(t,r,n){if(t===l)return r;if(e.isJSDate(t)||"number"===typeof t&&isFinite(t)){if(x(n))return a.error("JS Dates and milliseconds are incompatible with world calendars",t),r;if(!(t=e.ms2DateTimeLocal(+t))&&void 0!==r)return r}else if(!e.isDateTime(t,n))return a.error("unrecognized date",t),r;return t};var E=/%\d?f/g,C=/%h/g,P={1:"1",2:"1",3:"2",4:"2"};function L(e,t,r,n){e=e.replace(E,(function(e){var r=Math.min(+e.charAt(1)||6,6);return(t/1e3%1+2).toFixed(r).substr(2).replace(/0+$/,"")||"0"}));var i=new Date(Math.floor(t+.05));if(e=e.replace(C,(function(){return P[r("%q")(i)]})),x(n))try{e=f.getComponentMethod("calendars","worldCalFmt")(e,t,n)}catch(a){return"Invalid"}return r(e)(i)}var I=[59,59.9,59.99,59.999,59.9999];e.formatDate=function(e,t,r,n,a,s){if(a=x(a)&&a,!t)if("y"===r)t=s.year;else if("m"===r)t=s.month;else{if("d"!==r)return function(e,t){var r=o(e+.05,c),n=_(Math.floor(r/u),2)+":"+_(o(Math.floor(r/h),60),2);if("M"!==t){i(t)||(t=0);var a=(100+Math.min(o(e/p,60),I[t])).toFixed(t).substr(1);t>0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}(e,r)+"\n"+L(s.dayMonthYear,e,n,a);t=s.dayMonth+"\n"+s.year}return L(t,e,n,a)};var O=3*c;e.incrementMonth=function(e,t,r){r=x(r)&&r;var n=o(e,c);if(e=Math.round(e-n),r)try{var i=Math.round(e/c)+d,s=f.getComponentMethod("calendars","getCal")(r),l=s.fromJD(i);return t%12?s.add(l,t,"m"):s.add(l,t/12,"y"),(l.toJD()-d)*c+n}catch(h){a.error("invalid ms "+e+" in calendar "+r)}var u=new Date(e+O);return u.setUTCMonth(u.getUTCMonth()+t)+n-O},e.findExactDates=function(e,t){for(var r,n,a=0,o=0,s=0,l=0,u=x(t)&&f.getComponentMethod("calendars","getCal")(t),h=0;h<e.length;h++)if(n=e[h],i(n)){if(!(n%c))if(u)try{1===(r=u.fromJD(n/c+d)).day()?1===r.month()?a++:o++:s++}catch(m){}else 1===(r=new Date(n)).getUTCDate()?0===r.getUTCMonth()?a++:o++:s++}else l++;s+=o+=a;var p=e.length-l;return{exactYears:a/p,exactMonths:o/p,exactDays:s/p}}}}),He=p({"src/lib/identity.js"(e,t){t.exports=function(e){return e}}}),Ge=p({"src/lib/search.js"(e){var t=k(),r=X(),n=He(),i=T().BADNUM,a=1e-9;function o(e,t){return e<t}function s(e,t){return e<=t}function l(e,t){return e>t}function c(e,t){return e>=t}e.findBin=function(e,n,i){if(t(n.start))return i?Math.ceil((e-n.start)/n.size-a)-1:Math.floor((e-n.start)/n.size+a);var u,h,p=0,d=n.length,f=0,m=d>1?(n[d-1]-n[0])/(d-1):1;for(h=m>=0?i?o:s:i?c:l,e+=m*a*(i?-1:1)*(m>=0?1:-1);p<d&&f++<100;)h(n[u=Math.floor((p+d)/2)],e)?p=u+1:d=u;return f>90&&r.log("Long binary search..."),p-1},e.sorterAsc=function(e,t){return e-t},e.sorterDes=function(e,t){return t-e},e.distinctVals=function(t){var r,n=t.slice();for(n.sort(e.sorterAsc),r=n.length-1;r>-1&&n[r]===i;r--);for(var a,o=n[r]-n[0]||1,s=o/(r||1)/1e4,l=[],c=0;c<=r;c++){var u=n[c],h=u-a;void 0===a?(l.push(u),a=u):h>s&&(o=Math.min(o,h),l.push(u),a=u)}return{vals:l,minDiff:o}},e.roundUp=function(e,t,r){for(var n,i=0,a=t.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;i<a&&o++<100;)t[n=c((i+a)/2)]<=e?i=n+s:a=n-l;return t[i]},e.sort=function(e,t){for(var r=0,n=0,i=1;i<e.length;i++){var a=t(e[i],e[i-1]);if(a<0?r=1:a>0&&(n=1),r&&n)return e.sort(t)}return n?e:e.reverse()},e.findIndexOfMin=function(e,t){t=t||n;for(var r,i=1/0,a=0;a<e.length;a++){var o=t(e[a]);o<i&&(i=o,r=a)}return r}}}),We=p({"src/lib/sort_object_keys.js"(e,t){t.exports=function(e){return Object.keys(e).sort()}}}),$e=p({"src/lib/stats.js"(e){var t=k(),r=M().isArrayOrTypedArray;e.aggNums=function(n,i,a,o){var s,l;if((!o||o>a.length)&&(o=a.length),t(i)||(i=!1),r(a[0])){for(l=new Array(o),s=0;s<o;s++)l[s]=e.aggNums(n,i,a[s]);a=l}for(s=0;s<o;s++)t(i)?t(a[s])&&(i=n(+i,+a[s])):i=a[s];return i},e.len=function(t){return e.aggNums((function(e){return e+1}),0,t)},e.mean=function(t,r){return r||(r=e.len(t)),e.aggNums((function(e,t){return e+t}),0,t)/r},e.geometricMean=function(t,r){return r||(r=e.len(t)),Math.pow(e.aggNums((function(e,t){return e*t}),1,t),1/r)},e.midRange=function(t){if(void 0!==t&&0!==t.length)return(e.aggNums(Math.max,null,t)+e.aggNums(Math.min,null,t))/2},e.variance=function(r,n,i){return n||(n=e.len(r)),t(i)||(i=e.mean(r,n)),e.aggNums((function(e,t){return e+Math.pow(t-i,2)}),0,r)/n},e.stdev=function(t,r,n){return Math.sqrt(e.variance(t,r,n))},e.median=function(t){var r=t.slice().sort();return e.interp(r,.5)},e.interp=function(e,r){if(!t(r))throw"n should be a finite number";if((r=r*e.length-.5)<0)return e[0];if(r>e.length-1)return e[e.length-1];var n=r%1;return n*e[Math.ceil(r)]+(1-n)*e[Math.floor(r)]}}}),Ze=p({"src/lib/angles.js"(e,t){var r=z(),n=r.mod,i=r.modHalf,a=Math.PI,o=2*a;function s(e){return Math.abs(e[1]-e[0])>o-1e-14}function l(e,t){return i(t-e,o)}function c(e,t){if(s(t))return!0;var r,i;t[0]<t[1]?(r=t[0],i=t[1]):(r=t[1],i=t[0]),(r=n(r,o))>(i=n(i,o))&&(i+=o);var a=n(e,o),l=a+o;return a>=r&&a<=i||l>=r&&l<=i}function u(e,t,r,n,i,l,c){i=i||0,l=l||0;var u,h,p,d,f,m=s([r,n]);function g(e,t){return[e*Math.cos(t)+i,l-e*Math.sin(t)]}m?(u=0,h=a,p=o):r<n?(u=r,p=n):(u=n,p=r),e<t?(d=e,f=t):(d=t,f=e);var y,v=Math.abs(p-u)<=a?0:1;function x(e,t,r){return"A"+[e,e]+" "+[0,v,r]+" "+g(e,t)}return m?y=null===d?"M"+g(f,u)+x(f,h,0)+x(f,p,0)+"Z":"M"+g(d,u)+x(d,h,0)+x(d,p,0)+"ZM"+g(f,u)+x(f,h,1)+x(f,p,1)+"Z":null===d?(y="M"+g(f,u)+x(f,p,0),c&&(y+="L0,0Z")):y="M"+g(d,u)+"L"+g(f,u)+x(f,p,0)+"L"+g(d,p)+x(d,u,1)+"Z",y}t.exports={deg2rad:function(e){return e/180*a},rad2deg:function(e){return e/a*180},angleDelta:l,angleDist:function(e,t){return Math.abs(l(e,t))},isFullCircle:s,isAngleInsideSector:c,isPtInsideSector:function(e,t,r,n){return!!c(t,n)&&(r[0]<r[1]?(i=r[0],a=r[1]):(i=r[1],a=r[0]),e>=i&&e<=a);var i,a},pathArc:function(e,t,r,n,i){return u(null,e,t,r,n,i,0)},pathSector:function(e,t,r,n,i){return u(null,e,t,r,n,i,1)},pathAnnulus:function(e,t,r,n,i,a){return u(e,t,r,n,i,a,1)}}}}),Xe=p({"src/lib/anchor_utils.js"(e){e.isLeftAnchor=function(e){return"left"===e.xanchor||"auto"===e.xanchor&&e.x<=1/3},e.isCenterAnchor=function(e){return"center"===e.xanchor||"auto"===e.xanchor&&e.x>1/3&&e.x<2/3},e.isRightAnchor=function(e){return"right"===e.xanchor||"auto"===e.xanchor&&e.x>=2/3},e.isTopAnchor=function(e){return"top"===e.yanchor||"auto"===e.yanchor&&e.y>=2/3},e.isMiddleAnchor=function(e){return"middle"===e.yanchor||"auto"===e.yanchor&&e.y>1/3&&e.y<2/3},e.isBottomAnchor=function(e){return"bottom"===e.yanchor||"auto"===e.yanchor&&e.y<=1/3}}}),Ye=p({"src/lib/geometry2d.js"(e){var t,r,n,i=z().mod;function a(e,t,r,n,i,a,o,s){var l=r-e,c=i-e,u=o-i,h=n-t,p=a-t,d=s-a,f=l*d-u*h;if(0===f)return null;var m=(c*d-u*p)/f,g=(c*h-l*p)/f;return g<0||g>1||m<0||m>1?null:{x:e+l*m,y:t+h*m}}function o(e,t,r,n,i){var a=n*e+i*t;if(a<0)return n*n+i*i;if(a>r){var o=n-e,s=i-t;return o*o+s*s}var l=n*t-i*e;return l*l/r}e.segmentsIntersect=a,e.segmentDistance=function(e,t,r,n,i,s,l,c){if(a(e,t,r,n,i,s,l,c))return 0;var u=r-e,h=n-t,p=l-i,d=c-s,f=u*u+h*h,m=p*p+d*d,g=Math.min(o(u,h,f,i-e,s-t),o(u,h,f,l-e,c-t),o(p,d,m,e-i,t-s),o(p,d,m,r-i,n-s));return Math.sqrt(g)},e.getTextLocation=function(e,a,o,s){if(e===r&&s===n||(t={},r=e,n=s),t[o])return t[o];var l=e.getPointAtLength(i(o-s/2,a)),c=e.getPointAtLength(i(o+s/2,a)),u=Math.atan((c.y-l.y)/(c.x-l.x)),h=e.getPointAtLength(i(o,a)),p={x:(4*h.x+l.x+c.x)/6,y:(4*h.y+l.y+c.y)/6,theta:u};return t[o]=p,p},e.clearLocationCache=function(){r=null},e.getVisibleSegment=function(e,t,r){var n,i,a=t.left,o=t.right,s=t.top,l=t.bottom,c=0,u=e.getTotalLength(),h=u;function p(t){var r=e.getPointAtLength(t);0===t?n=r:t===u&&(i=r);var c=r.x<a?a-r.x:r.x>o?r.x-o:0,h=r.y<s?s-r.y:r.y>l?r.y-l:0;return Math.sqrt(c*c+h*h)}for(var d=p(c);d;){if((c+=d+r)>h)return;d=p(c)}for(d=p(h);d;){if(c>(h-=d+r))return;d=p(h)}return{min:c,max:h,len:h-c,total:u,isClosed:0===c&&h===u&&Math.abs(n.x-i.x)<.1&&Math.abs(n.y-i.y)<.1}},e.findPointOnPath=function(e,t,r,n){for(var i,a,o,s=(n=n||{}).pathLength||e.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=e.getPointAtLength(0)[r]>e.getPointAtLength(s)[r]?-1:1,h=0,p=0,d=s;h<c;){if(i=(p+d)/2,o=(a=e.getPointAtLength(i))[r]-t,Math.abs(o)<l)return a;u*o>0?d=i:p=i,h++}return a}}}),Ke=p({"src/lib/throttle.js"(e){var t={};function r(e){e&&null!==e.timer&&(clearTimeout(e.timer),e.timer=null)}e.throttle=function(e,n,i){var a=t[e],o=Date.now();if(!a){for(var s in t)t[s].ts<o-6e4&&delete t[s];a=t[e]={ts:0,timer:null}}function l(){i(),a.ts=Date.now(),a.onDone&&(a.onDone(),a.onDone=null)}r(a),o>a.ts+n?l():a.timer=setTimeout((function(){l(),a.timer=null}),n)},e.done=function(e){var r=t[e];return r&&r.timer?new Promise((function(e){var t=r.onDone;r.onDone=function(){t&&t(),e(),r.onDone=null}})):Promise.resolve()},e.clear=function(n){if(n)r(t[n]),delete t[n];else for(var i in t)e.clear(i)}}}),Je=p({"src/lib/clear_responsive.js"(e,t){t.exports=function(e){e._responsiveChartHandler&&(window.removeEventListener("resize",e._responsiveChartHandler),delete e._responsiveChartHandler)}}}),Qe=p({"node_modules/is-mobile/index.js"(e,t){t.exports=a,t.exports.isMobile=a,t.exports.default=a;var r=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,i=/android|ipad|playbook|silk/i;function a(e){e||(e={});let t=e.ua;if(t||"undefined"===typeof navigator||(t=navigator.userAgent),t&&t.headers&&"string"===typeof t.headers["user-agent"]&&(t=t.headers["user-agent"]),"string"!==typeof t)return!1;let a=r.test(t)&&!n.test(t)||!!e.tablet&&i.test(t);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==t.indexOf("Macintosh")&&-1!==t.indexOf("Safari")&&(a=!0),a}}}),et=p({"src/lib/preserve_drawing_buffer.js"(e,t){var r=k(),n=Qe();t.exports=function(e){var t;if("string"!==typeof(t=e&&e.hasOwnProperty("userAgent")?e.userAgent:function(){var e;return"undefined"!==typeof navigator&&(e=navigator.userAgent),e&&e.headers&&"string"===typeof e.headers["user-agent"]&&(e=e.headers["user-agent"]),e}()))return!0;var i=n({ua:{headers:{"user-agent":t}},tablet:!0,featureDetect:!1});if(!i)for(var a=t.split(" "),o=1;o<a.length;o++)if(-1!==a[o].indexOf("Safari"))for(var s=o-1;s>-1;s--){var l=a[s];if("Version/"===l.substr(0,8)){var c=l.substr(8).split(".")[0];if(r(c)&&(c=+c),c>=13)return!0}}return i}}}),tt=p({"src/lib/make_trace_groups.js"(e,t){var r=v();t.exports=function(e,t,n){var i=e.selectAll("g."+n.replace(/\s/g,".")).data(t,(function(e){return e[0].trace.uid}));i.exit().remove(),i.enter().append("g").attr("class",n),i.order();var a=e.classed("rangeplot")?"nodeRangePlot3":"node3";return i.each((function(e){e[0][a]=r.select(this)})),i}}}),rt=p({"src/lib/localize.js"(e,t){var r=Ve();t.exports=function(e,t){for(var n=e._context.locale,i=0;i<2;i++){for(var a=e._context.locales,o=0;o<2;o++){var s=(a[n]||{}).dictionary;if(s){var l=s[t];if(l)return l}a=r.localeRegistry}var c=n.split("-")[0];if(c===n)break;n=c}return t}}}),nt=p({"src/lib/filter_unique.js"(e,t){t.exports=function(e){for(var t={},r=[],n=0,i=0;i<e.length;i++){var a=e[i];1!==t[a]&&(t[a]=1,r[n++]=a)}return r}}}),it=p({"src/lib/filter_visible.js"(e,t){function r(e){return!0===e.visible}function n(e){var t=e[0].trace;return!0===t.visible&&0!==t._length}t.exports=function(e){for(var t,i=(t=e,Array.isArray(t)&&Array.isArray(t[0])&&t[0][0]&&t[0][0].trace?n:r),a=[],o=0;o<e.length;o++){var s=e[o];i(s)&&a.push(s)}return a}}}),at=p({"src/lib/increment.js"(e,t){t.exports=function(e,t){if(!t)return e;var r=1/Math.abs(t),n=r>1?(r*e+r*t)/r:e+t,i=String(n).length;if(i>16){var a=String(t).length;if(i>=String(e).length+a){var o=parseFloat(n).toPrecision(12);-1===o.indexOf("e+")&&(n=+o)}}return n}}}),ot=p({"src/lib/clean_number.js"(e,t){var r=k(),n=T().BADNUM,i=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;t.exports=function(e){return"string"===typeof e&&(e=e.replace(i,"")),r(e)?Number(e):n}}}),st=p({"src/lib/index.js"(e,t){var r=v(),n=b().utcFormat,i=_().format,a=k(),o=T(),s=o.FP_SAFE,l=-s,c=o.BADNUM,u=t.exports={};u.adjustFormat=function(e){return!e||/^\d[.]\df/.test(e)||/[.]\d%/.test(e)?e:"0.f"===e?"~f":/^\d%/.test(e)?"~%":/^\ds/.test(e)?"~s":!/^[~,.0$]/.test(e)&&/[&fps]/.test(e)?"~"+e:e};var h={};u.warnBadFormat=function(e){var t=String(e);h[t]||(h[t]=1,u.warn('encountered bad format: "'+t+'"'))},u.noFormat=function(e){return String(e)},u.numberFormat=function(e){var t;try{t=i(u.adjustFormat(e))}catch(r){return u.warnBadFormat(e),u.noFormat}return t},u.nestedProperty=E(),u.keyedContainer=C(),u.relativeAttr=P(),u.isPlainObject=A(),u.toLogRange=L(),u.relinkPrivateKeys=I();var p=M();u.isArrayBuffer=p.isArrayBuffer,u.isTypedArray=p.isTypedArray,u.isArrayOrTypedArray=p.isArrayOrTypedArray,u.isArray1D=p.isArray1D,u.ensureArray=p.ensureArray,u.concat=p.concat,u.maxRowLength=p.maxRowLength,u.minRowLength=p.minRowLength;var d=z();u.mod=d.mod,u.modHalf=d.modHalf;var f=W();u.valObjectMeta=f.valObjectMeta,u.coerce=f.coerce,u.coerce2=f.coerce2,u.coerceFont=f.coerceFont,u.coercePattern=f.coercePattern,u.coerceHoverinfo=f.coerceHoverinfo,u.coerceSelectionMarkerOpacity=f.coerceSelectionMarkerOpacity,u.validate=f.validate;var m=qe();u.dateTime2ms=m.dateTime2ms,u.isDateTime=m.isDateTime,u.ms2DateTime=m.ms2DateTime,u.ms2DateTimeLocal=m.ms2DateTimeLocal,u.cleanDate=m.cleanDate,u.isJSDate=m.isJSDate,u.formatDate=m.formatDate,u.incrementMonth=m.incrementMonth,u.dateTick0=m.dateTick0,u.dfltRange=m.dfltRange,u.findExactDates=m.findExactDates,u.MIN_MS=m.MIN_MS,u.MAX_MS=m.MAX_MS;var g=Ge();u.findBin=g.findBin,u.sorterAsc=g.sorterAsc,u.sorterDes=g.sorterDes,u.distinctVals=g.distinctVals,u.roundUp=g.roundUp,u.sort=g.sort,u.findIndexOfMin=g.findIndexOfMin,u.sortObjectKeys=We();var y=$e();u.aggNums=y.aggNums,u.len=y.len,u.mean=y.mean,u.geometricMean=y.geometricMean,u.median=y.median,u.midRange=y.midRange,u.variance=y.variance,u.stdev=y.stdev,u.interp=y.interp;var x=Ee();u.init2dArray=x.init2dArray,u.transposeRagged=x.transposeRagged,u.dot=x.dot,u.translationMatrix=x.translationMatrix,u.rotationMatrix=x.rotationMatrix,u.rotationXYMatrix=x.rotationXYMatrix,u.apply3DTransform=x.apply3DTransform,u.apply2DTransform=x.apply2DTransform,u.apply2DTransform2=x.apply2DTransform2,u.convertCssMatrix=x.convertCssMatrix,u.inverseTransformMatrix=x.inverseTransformMatrix;var w=Ze();u.deg2rad=w.deg2rad,u.rad2deg=w.rad2deg,u.angleDelta=w.angleDelta,u.angleDist=w.angleDist,u.isFullCircle=w.isFullCircle,u.isAngleInsideSector=w.isAngleInsideSector,u.isPtInsideSector=w.isPtInsideSector,u.pathArc=w.pathArc,u.pathSector=w.pathSector,u.pathAnnulus=w.pathAnnulus;var S=Xe();u.isLeftAnchor=S.isLeftAnchor,u.isCenterAnchor=S.isCenterAnchor,u.isRightAnchor=S.isRightAnchor,u.isTopAnchor=S.isTopAnchor,u.isMiddleAnchor=S.isMiddleAnchor,u.isBottomAnchor=S.isBottomAnchor;var O=Ye();u.segmentsIntersect=O.segmentsIntersect,u.segmentDistance=O.segmentDistance,u.getTextLocation=O.getTextLocation,u.clearLocationCache=O.clearLocationCache,u.getVisibleSegment=O.getVisibleSegment,u.findPointOnPath=O.findPointOnPath;var D=R();u.extendFlat=D.extendFlat,u.extendDeep=D.extendDeep,u.extendDeepAll=D.extendDeepAll,u.extendDeepNoArrays=D.extendDeepNoArrays;var j=X();u.log=j.log,u.warn=j.warn,u.error=j.error;var F=G();u.counterRegex=F.counter;var B=Ke();u.throttle=B.throttle,u.throttleDone=B.done,u.clearThrottle=B.clear;var N=Ce();function U(e){var t={};for(var r in e)for(var n=e[r],i=0;i<n.length;i++)t[n[i]]=+r;return t}u.getGraphDiv=N.getGraphDiv,u.isPlotDiv=N.isPlotDiv,u.removeElement=N.removeElement,u.addStyleRule=N.addStyleRule,u.addRelatedStyleRule=N.addRelatedStyleRule,u.deleteRelatedStyleRule=N.deleteRelatedStyleRule,u.setStyleOnHover=N.setStyleOnHover,u.getFullTransformMatrix=N.getFullTransformMatrix,u.getElementTransformMatrix=N.getElementTransformMatrix,u.getElementAndAncestors=N.getElementAndAncestors,u.equalDomRects=N.equalDomRects,u.clearResponsive=Je(),u.preserveDrawingBuffer=et(),u.makeTraceGroups=tt(),u._=rt(),u.notifier=Z(),u.filterUnique=nt(),u.filterVisible=it(),u.pushUnique=K(),u.increment=at(),u.cleanNumber=ot(),u.ensureNumber=function(e){return a(e)?(e=Number(e))>s||e<l?c:e:c},u.isIndex=function(e,t){return!(void 0!==t&&e>=t)&&a(e)&&e>=0&&e%1===0},u.noop=Y(),u.identity=He(),u.repeat=function(e,t){for(var r=new Array(t),n=0;n<t;n++)r[n]=e;return r},u.swapAttrs=function(e,t,r,n){r||(r="x"),n||(n="y");for(var i=0;i<t.length;i++){var a=t[i],o=u.nestedProperty(e,a.replace("?",r)),s=u.nestedProperty(e,a.replace("?",n)),l=o.get();o.set(s.get()),s.set(l)}},u.raiseToTop=function(e){e.parentNode.appendChild(e)},u.cancelTransition=function(e){return e.transition().duration(0)},u.constrain=function(e,t,r){return t>r?Math.max(r,Math.min(t,e)):Math.max(t,Math.min(r,e))},u.bBoxIntersect=function(e,t,r){return r=r||0,e.left<=t.right+r&&t.left<=e.right+r&&e.top<=t.bottom+r&&t.top<=e.bottom+r},u.simpleMap=function(e,t,r,n,i){for(var a=e.length,o=new Array(a),s=0;s<a;s++)o[s]=t(e[s],r,n,i);return o},u.randstr=function e(t,r,n,i){if(n||(n=16),void 0===r&&(r=24),r<=0)return"0";var a,o,s=Math.log(Math.pow(2,r))/Math.log(n),l="";for(a=2;s===1/0;a*=2)s=Math.log(Math.pow(2,r/a))/Math.log(n)*a;var c=s-Math.floor(s);for(a=0;a<Math.floor(s);a++)l=Math.floor(Math.random()*n).toString(n)+l;c&&(o=Math.pow(n,c),l=Math.floor(Math.random()*o).toString(n)+l);var h=parseInt(l,n);return t&&t[l]||h!==1/0&&h>=Math.pow(2,r)?i>10?(u.warn("randstr failed uniqueness"),l):e(t,r,n,(i||0)+1):l},u.OptionControl=function(e,t){e||(e={}),t||(t="opt");var r={optionList:[],_newoption:function(n){n[t]=e,r[n.name]=n,r.optionList.push(n)}};return r["_"+t]=e,r},u.smooth=function(e,t){if((t=Math.round(t)||0)<2)return e;var r,n,i,a,o=e.length,s=2*o,l=2*t-1,c=new Array(l),u=new Array(o);for(r=0;r<l;r++)c[r]=(1-Math.cos(Math.PI*(r+1)/t))/(2*t);for(r=0;r<o;r++){for(a=0,n=0;n<l;n++)(i=r+n+1-t)<-o?i-=s*Math.round(i/s):i>=s&&(i-=s*Math.floor(i/s)),i<0?i=-1-i:i>=o&&(i=s-1-i),a+=e[i]*c[n];u[r]=a}return u},u.syncOrAsync=function(e,t,r){var n;function i(){return u.syncOrAsync(e,t,r)}for(;e.length;)if((n=(0,e.splice(0,1)[0])(t))&&n.then)return n.then(i);return r&&r(t)},u.stripTrailingSlash=function(e){return"/"===e.substr(-1)?e.substr(0,e.length-1):e},u.noneOrAll=function(e,t,r){if(e){var n,i,a=!1,o=!0;for(n=0;n<r.length;n++)void 0!==(i=e[r[n]])&&null!==i?a=!0:o=!1;if(a&&!o)for(n=0;n<r.length;n++)e[r[n]]=t[r[n]]}},u.mergeArray=function(e,t,r,n){var i="function"===typeof n;if(u.isArrayOrTypedArray(e))for(var a=Math.min(e.length,t.length),o=0;o<a;o++){var s=e[o];t[o][r]=i?n(s):s}},u.mergeArrayCastPositive=function(e,t,r){return u.mergeArray(e,t,r,(function(e){var t=+e;return isFinite(t)&&t>0?t:0}))},u.fillArray=function(e,t,r,n){if(n=n||u.identity,u.isArrayOrTypedArray(e))for(var i=0;i<t.length;i++)t[i][r]=n(e[i])},u.castOption=function(e,t,r,n){n=n||u.identity;var i=u.nestedProperty(e,r).get();return u.isArrayOrTypedArray(i)?Array.isArray(t)&&u.isArrayOrTypedArray(i[t[0]])?n(i[t[0]][t[1]]):n(i[t]):i},u.extractOption=function(e,t,r,n){if(r in e)return e[r];var i=u.nestedProperty(t,n).get();return Array.isArray(i)?void 0:i},u.tagSelected=function(e,t,r){var n,i,a=t.selectedpoints,o=t._indexToPoints;o&&(n=U(o));for(var s=0;s<a.length;s++){var l=a[s];if(u.isIndex(l)||u.isArrayOrTypedArray(l)&&u.isIndex(l[0])&&u.isIndex(l[1])){var c=n?n[l]:l,h=r?r[c]:c;void 0!==(i=h)&&i<e.length&&(e[h].selected=1)}}},u.selIndices2selPoints=function(e){var t=e.selectedpoints,r=e._indexToPoints;if(r){for(var n=U(r),i=[],a=0;a<t.length;a++){var o=t[a];if(u.isIndex(o)){var s=n[o];u.isIndex(s)&&i.push(s)}}return i}return t},u.getTargetArray=function(e,t){var r=t.target;if("string"===typeof r&&r){var n=u.nestedProperty(e,r).get();return!!u.isArrayOrTypedArray(n)&&n}return!!u.isArrayOrTypedArray(r)&&r},u.minExtend=function e(t,r,n){var i={};"object"!==typeof r&&(r={});var a,o,s,l="pieLike"===n?-1:3,c=Object.keys(t);for(a=0;a<c.length;a++)s=t[o=c[a]],"_"!==o.charAt(0)&&"function"!==typeof s&&("module"===o?i[o]=s:Array.isArray(s)?i[o]="colorscale"===o||-1===l?s.slice():s.slice(0,l):u.isTypedArray(s)?i[o]=-1===l?s.subarray():s.subarray(0,l):i[o]=s&&"object"===typeof s?e(t[o],r[o],n):s);for(c=Object.keys(r),a=0;a<c.length;a++)"object"===typeof(s=r[o=c[a]])&&o in i&&"object"===typeof i[o]||(i[o]=s);return i},u.titleCase=function(e){return e.charAt(0).toUpperCase()+e.substr(1)},u.containsAny=function(e,t){for(var r=0;r<t.length;r++)if(-1!==e.indexOf(t[r]))return!0;return!1};var V=/Version\/[\d\.]+.*Safari/;u.isSafari=function(){return V.test(window.navigator.userAgent)};var q=/iPad|iPhone|iPod/;u.isIOS=function(){return q.test(window.navigator.userAgent)};var H=/Firefox\/(\d+)\.\d+/;u.getFirefoxVersion=function(){var e=H.exec(window.navigator.userAgent);if(e&&2===e.length){var t=parseInt(e[1]);if(!isNaN(t))return t}return null},u.isD3Selection=function(e){return e instanceof r.selection},u.ensureSingle=function(e,t,r,n){var i=e.select(t+(r?"."+r:""));if(i.size())return i;var a=e.append(t);return r&&a.classed(r,!0),n&&a.call(n),a},u.ensureSingleById=function(e,t,r,n){var i=e.select(t+"#"+r);if(i.size())return i;var a=e.append(t).attr("id",r);return n&&a.call(n),a},u.objectFromPath=function(e,t){for(var r,n=e.split("."),i=r={},a=0;a<n.length;a++){var o=n[a],s=null,l=n[a].match(/(.*)\[([0-9]+)\]/);l?(o=l[1],s=l[2],r=r[o]=[],a===n.length-1?r[s]=t:r[s]={},r=r[s]):(a===n.length-1?r[o]=t:r[o]={},r=r[o])}return i};var $=/^([^\[\.]+)\.(.+)?/,J=/^([^\.]+)\[([0-9]+)\](\.)?(.+)?/;function Q(e){return"__"===e.slice(0,2)}u.expandObjectPaths=function(e){var t,r,n,i,a,o,s;if("object"===typeof e&&!Array.isArray(e))for(r in e)if(e.hasOwnProperty(r))if(t=r.match($)){if(i=e[r],Q(n=t[1]))continue;delete e[r],e[n]=u.extendDeepNoArrays(e[n]||{},u.objectFromPath(r,u.expandObjectPaths(i))[n])}else if(t=r.match(J)){if(i=e[r],Q(n=t[1]))continue;if(a=parseInt(t[2]),delete e[r],e[n]=e[n]||[],"."===t[3])s=t[4],o=e[n][a]=e[n][a]||{},u.extendDeepNoArrays(o,u.objectFromPath(s,u.expandObjectPaths(i)));else{if(Q(n))continue;e[n][a]=u.expandObjectPaths(i)}}else{if(Q(r))continue;e[r]=u.expandObjectPaths(e[r])}return e},u.numSeparate=function(e,t,r){if(r||(r=!1),"string"!==typeof t||0===t.length)throw new Error("Separator string required for formatting!");"number"===typeof e&&(e=String(e));var n=/(\d+)(\d{3})/,i=t.charAt(0),a=t.charAt(1),o=e.split("."),s=o[0],l=o.length>1?i+o[1]:"";if(a&&(o.length>1||s.length>4||r))for(;n.test(s);)s=s.replace(n,"$1"+a+"$2");return s+l},u.TEMPLATE_STRING_REGEX=/%{([^\s%{}:]*)([:|\|][^}]*)?}/g;var ee=/^\w*$/;u.templateString=function(e,t){var r={};return e.replace(u.TEMPLATE_STRING_REGEX,(function(e,n){var i;return ee.test(n)?i=t[n]:(r[n]=r[n]||u.nestedProperty(t,n).get,i=r[n](!0)),void 0!==i?i:""}))};var te={max:10,count:0,name:"hovertemplate"};u.hovertemplateString=function(){return oe.apply(te,arguments)};var re={max:10,count:0,name:"texttemplate"};u.texttemplateString=function(){return oe.apply(re,arguments)};var ne=/^(\S+)([\*\/])(-?\d+(\.\d+)?)$/,ie={max:10,count:0,name:"texttemplate",parseMultDiv:!0};u.texttemplateStringForShapes=function(){return oe.apply(ie,arguments)};var ae=/^[:|\|]/;function oe(e,t,r){var i=this,a=arguments;return t||(t={}),e.replace(u.TEMPLATE_STRING_REGEX,(function(e,o,s){var l="_xother"===o||"_yother"===o,c="_xother_"===o||"_yother_"===o,h="xother_"===o||"yother_"===o,p="xother"===o||"yother"===o||l||h||c,d=o;(l||c)&&(d=d.substring(1)),(h||c)&&(d=d.substring(0,d.length-1));var f,m,g,y=null,v=null;if(i.parseMultDiv){var x=function(e){var t=e.match(ne);return t?{key:t[1],op:t[2],number:Number(t[3])}:{key:e,op:null,number:null}}(d);d=x.key,y=x.op,v=x.number}if(p){if(void 0===(f=t[d]))return""}else for(g=3;g<a.length;g++)if(m=a[g]){if(m.hasOwnProperty(d)){f=m[d];break}if(ee.test(d)||(f=u.nestedProperty(m,d).get(!0)),void 0!==f)break}if(void 0!==f&&("*"===y&&(f*=v),"/"===y&&(f/=v)),void 0===f&&i)return i.count<i.max&&(u.warn("Variable '"+d+"' in "+i.name+" could not be found!"),f=e),i.count===i.max&&u.warn("Too many "+i.name+" warnings - additional warnings will be suppressed"),i.count++,e;if(s){var b;if(":"===s[0]&&(b=r?r.numberFormat:u.numberFormat,""!==f&&(f=b(s.replace(ae,""))(f))),"|"===s[0]){b=r?r.timeFormat:n;var _=u.dateTime2ms(f);f=u.formatDate(_,s.replace(ae,""),!1,b)}}else{var w=d+"Label";t.hasOwnProperty(w)&&(f=t[w])}return p&&(f="("+f+")",(l||c)&&(f=" "+f),(h||c)&&(f+=" ")),f}))}u.subplotSort=function(e,t){for(var r=Math.min(e.length,t.length)+1,n=0,i=0,a=0;a<r;a++){var o=e.charCodeAt(a)||0,s=t.charCodeAt(a)||0,l=o>=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n};var se=2e9;u.seedPseudoRandom=function(){se=2e9},u.pseudoRandom=function(){var e=se;return se=(69069*se+1)%4294967296,Math.abs(se-e)<429496729?u.pseudoRandom():se/4294967296},u.fillText=function(e,t,r){var n=Array.isArray(r)?function(e){r.push(e)}:function(e){r.text=e},i=u.extractOption(e,t,"htx","hovertext");if(u.isValidTextValue(i))return n(i);var a=u.extractOption(e,t,"tx","text");return u.isValidTextValue(a)?n(a):void 0},u.isValidTextValue=function(e){return e||0===e},u.formatPercent=function(e,t){t=t||0;for(var r=(Math.round(100*e*Math.pow(10,t))*Math.pow(.1,t)).toFixed(t)+"%",n=0;n<t;n++)-1!==r.indexOf(".")&&(r=(r=r.replace("0%","%")).replace(".%","%"));return r},u.isHidden=function(e){var t=window.getComputedStyle(e).display;return!t||"none"===t},u.strTranslate=function(e,t){return e||t?"translate("+e+","+t+")":""},u.strRotate=function(e){return e?"rotate("+e+")":""},u.strScale=function(e){return 1!==e?"scale("+e+")":""},u.getTextTransform=function(e){var t=e.noCenter,r=e.textX,n=e.textY,i=e.targetX,a=e.targetY,o=e.anchorX||0,s=e.anchorY||0,l=e.rotate,c=e.scale;return c?c>1&&(c=1):c=0,u.strTranslate(i-c*(r+o),a-c*(n+s))+u.strScale(c)+(l?"rotate("+l+(t?"":" "+r+" "+n)+")":"")},u.setTransormAndDisplay=function(e,t){e.attr("transform",u.getTextTransform(t)),e.style("display",t.scale?null:"none")},u.ensureUniformFontSize=function(e,t){var r=u.extendFlat({},t);return r.size=Math.max(t.size,e._fullLayout.uniformtext.minsize||0),r},u.join2=function(e,t,r){var n=e.length;return n>1?e.slice(0,-1).join(t)+r+e[n-1]:e.join(t)},u.bigFont=function(e){return Math.round(1.2*e)};var le=u.getFirefoxVersion(),ce=null!==le&&le<86;u.getPositionFromD3Event=function(){return ce?[r.event.layerX,r.event.layerY]:[r.event.offsetX,r.event.offsetY]}}}),lt=p({"build/plotcss.js"(){var e,t,r=st(),n={"X,X div":'direction:ltr;font-family:"Open Sans",verdana,arial,sans-serif;margin:0;padding:0;',"X input,X button":'font-family:"Open Sans",verdana,arial,sans-serif;',"X input:focus,X button:focus":"outline:none;","X a":"text-decoration:none;","X a:hover":"text-decoration:none;","X .crisp":"shape-rendering:crispEdges;","X .user-select-none":"-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;","X svg a":"fill:#447adb;","X svg a:hover":"fill:#3c6dc5;","X .main-svg":"position:absolute;top:0;left:0;pointer-events:none;","X .main-svg .draglayer":"pointer-events:all;","X .cursor-default":"cursor:default;","X .cursor-pointer":"cursor:pointer;","X .cursor-crosshair":"cursor:crosshair;","X .cursor-move":"cursor:move;","X .cursor-col-resize":"cursor:col-resize;","X .cursor-row-resize":"cursor:row-resize;","X .cursor-ns-resize":"cursor:ns-resize;","X .cursor-ew-resize":"cursor:ew-resize;","X .cursor-sw-resize":"cursor:sw-resize;","X .cursor-s-resize":"cursor:s-resize;","X .cursor-se-resize":"cursor:se-resize;","X .cursor-w-resize":"cursor:w-resize;","X .cursor-e-resize":"cursor:e-resize;","X .cursor-nw-resize":"cursor:nw-resize;","X .cursor-n-resize":"cursor:n-resize;","X .cursor-ne-resize":"cursor:ne-resize;","X .cursor-grab":"cursor:-webkit-grab;cursor:grab;","X .modebar":"position:absolute;top:2px;right:2px;","X .ease-bg":"-webkit-transition:background-color .3s ease 0s;-moz-transition:background-color .3s ease 0s;-ms-transition:background-color .3s ease 0s;-o-transition:background-color .3s ease 0s;transition:background-color .3s ease 0s;","X .modebar--hover>:not(.watermark)":"opacity:0;-webkit-transition:opacity .3s ease 0s;-moz-transition:opacity .3s ease 0s;-ms-transition:opacity .3s ease 0s;-o-transition:opacity .3s ease 0s;transition:opacity .3s ease 0s;","X:hover .modebar--hover .modebar-group":"opacity:1;","X .modebar-group":"float:left;display:inline-block;box-sizing:border-box;padding-left:8px;position:relative;vertical-align:middle;white-space:nowrap;","X .modebar-btn":"position:relative;font-size:16px;padding:3px 4px;height:22px;cursor:pointer;line-height:normal;box-sizing:border-box;","X .modebar-btn svg":"position:relative;top:2px;","X .modebar.vertical":"display:flex;flex-direction:column;flex-wrap:wrap;align-content:flex-end;max-height:100%;","X .modebar.vertical svg":"top:-1px;","X .modebar.vertical .modebar-group":"display:block;float:none;padding-left:0px;padding-bottom:8px;","X .modebar.vertical .modebar-group .modebar-btn":"display:block;text-align:center;","X [data-title]:before,X [data-title]:after":"position:absolute;-webkit-transform:translate3d(0, 0, 0);-moz-transform:translate3d(0, 0, 0);-ms-transform:translate3d(0, 0, 0);-o-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:none;opacity:0;z-index:1001;pointer-events:none;top:110%;right:50%;","X [data-title]:hover:before,X [data-title]:hover:after":"display:block;opacity:1;","X [data-title]:before":'content:"";position:absolute;background:rgba(0,0,0,0);border:6px solid rgba(0,0,0,0);z-index:1002;margin-top:-12px;border-bottom-color:#69738a;margin-right:-6px;',"X [data-title]:after":"content:attr(data-title);background:#69738a;color:#fff;padding:8px 10px;font-size:12px;line-height:12px;white-space:nowrap;margin-right:-18px;border-radius:2px;","X .vertical [data-title]:before,X .vertical [data-title]:after":"top:0%;right:200%;","X .vertical [data-title]:before":"border:6px solid rgba(0,0,0,0);border-left-color:#69738a;margin-top:8px;margin-right:-30px;",Y:'font-family:"Open Sans",verdana,arial,sans-serif;position:fixed;top:50px;right:20px;z-index:10000;font-size:10pt;max-width:180px;',"Y p":"margin:0;","Y .notifier-note":"min-width:180px;max-width:250px;border:1px solid #fff;z-index:3000;margin:0;background-color:#8c97af;background-color:rgba(140,151,175,.9);color:#fff;padding:10px;overflow-wrap:break-word;word-wrap:break-word;-ms-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;","Y .notifier-close":"color:#fff;opacity:.8;float:right;padding:0 5px;background:none;border:none;font-size:20px;font-weight:bold;line-height:20px;","Y .notifier-close:hover":"color:#444;text-decoration:none;cursor:pointer;"};for(t in n)e=t.replace(/^,/," ,").replace(/X/g,".js-plotly-plot .plotly").replace(/Y/g,".plotly-notifier"),r.addStyleRule(e,n[t])}}),ct=p({"node_modules/is-browser/client.js"(e,t){t.exports=!0}}),ut=p({"node_modules/has-hover/index.js"(e,t){var r,n=ct();r="function"===typeof window.matchMedia?!window.matchMedia("(hover: none)").matches:n,t.exports=r}}),ht=p({"node_modules/events/events.js"(e,t){var r,n="object"===typeof Reflect?Reflect:null,i=n&&"function"===typeof n.apply?n.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};r=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,a),n(r)}function a(){"function"===typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,a,{once:!0}),"error"!==t&&function(e,t,r){"function"===typeof e.on&&g(e,"error",t,r)}(e,i,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function l(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var i,a,o,s;if(l(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),o=a[t]),void 0===o)o=a[t]=r,++e._eventsCount;else if("function"===typeof o?o=a[t]=n?[r,o]:[o,r]:n?o.unshift(r):o.push(r),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"===typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"===typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(a){n.once&&e.removeEventListener(t,i),r(a)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,a=this._events;if(void 0!==a)n=n&&void 0===a.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var l=a[e];if(void 0===l)return!1;if("function"===typeof l)i(l,this,t);else{var c=l.length,u=m(l,c);for(r=0;r<c;++r)i(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,a,o;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!==typeof r){for(i=-1,a=r.length-1;a>=0;a--)if(r[a]===t||r[a].listener===t){o=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,o||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,a=Object.keys(r);for(n=0;n<a.length;++n)"removeListener"!==(i=a[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"===typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}}}),pt=p({"src/lib/events.js"(e,t){var r=ht().EventEmitter,n={init:function(e){if(e._ev instanceof r)return e;var t=new r,n=new r;return e._ev=t,e._internalEv=n,e.on=t.on.bind(t),e.once=t.once.bind(t),e.removeListener=t.removeListener.bind(t),e.removeAllListeners=t.removeAllListeners.bind(t),e._internalOn=n.on.bind(n),e._internalOnce=n.once.bind(n),e._removeInternalListener=n.removeListener.bind(n),e._removeAllInternalListeners=n.removeAllListeners.bind(n),e.emit=function(e,r){t.emit(e,r),n.emit(e,r)},e},triggerHandler:function(e,t,r){var n=e._ev;if(n){var i=n._events[t];if(i){var a;for(i=Array.isArray(i)?i:[i],a=0;a<i.length-1;a++)o(i[a]);return o(i[a])}}function o(e){return e.listener?(n.removeListener(t,e.listener),e.fired?void 0:(e.fired=!0,e.listener.apply(n,[r]))):e.apply(n,[r])}},purge:function(e){return delete e._ev,delete e.on,delete e.once,delete e.removeListener,delete e.removeAllListeners,delete e.emit,delete e._ev,delete e._internalEv,delete e._internalOn,delete e._internalOnce,delete e._removeInternalListener,delete e._removeAllInternalListeners,e}};t.exports=n}}),dt=p({"src/lib/queue.js"(e,t){var r=st(),n=$().dfltConfig,i={add:function(e,t,r,i,a){var o,s;e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},s=e.undoQueue.index,e.autoplay?e.undoQueue.inSequence||(e.autoplay=!1):(!e.undoQueue.sequence||e.undoQueue.beginSequence?(o={undo:{calls:[],args:[]},redo:{calls:[],args:[]}},e.undoQueue.queue.splice(s,e.undoQueue.queue.length-s,o),e.undoQueue.index+=1):o=e.undoQueue.queue[s-1],e.undoQueue.beginSequence=!1,o&&(o.undo.calls.unshift(t),o.undo.args.unshift(r),o.redo.calls.push(i),o.redo.args.push(a)),e.undoQueue.queue.length>n.queueLength&&(e.undoQueue.queue.shift(),e.undoQueue.index--))},startSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!0,e.undoQueue.beginSequence=!0},stopSequence:function(e){e.undoQueue=e.undoQueue||{index:0,queue:[],sequence:!1},e.undoQueue.sequence=!1,e.undoQueue.beginSequence=!1},undo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index<=0)){for(e.undoQueue.index--,t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.undo.calls.length;r++)i.plotDo(e,t.undo.calls[r],t.undo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1}},redo:function(e){var t,r;if(!(void 0===e.undoQueue||isNaN(e.undoQueue.index)||e.undoQueue.index>=e.undoQueue.queue.length)){for(t=e.undoQueue.queue[e.undoQueue.index],e.undoQueue.inSequence=!0,r=0;r<t.redo.calls.length;r++)i.plotDo(e,t.redo.calls[r],t.redo.args[r]);e.undoQueue.inSequence=!1,e.autoplay=!1,e.undoQueue.index++}},plotDo:function(e,t,n){e.autoplay=!0,n=function(e,t){for(var n,i=[],a=0;a<t.length;a++)n=t[a],i[a]=n===e?n:"object"===typeof n?Array.isArray(n)?r.extendDeep([],n):r.extendDeepAll({},n):n;return i}(e,n),t.apply(null,n)}};t.exports=i}}),ft=p({"src/plots/frame_attributes.js"(e,t){t.exports={_isLinkedToArray:"frames_entry",group:{valType:"string"},name:{valType:"string"},traces:{valType:"any"},baseframe:{valType:"string"},data:{valType:"any"},layout:{valType:"any"}}}}),mt=p({"src/plot_api/plot_schema.js"(e){var t=Ve(),r=st(),n=N(),i=Be(),a=ft(),o=Pe(),s=$().configAttributes,l=Le(),c=r.extendDeepAll,u=r.isPlainObject,h=r.isArrayOrTypedArray,p=r.nestedProperty,d=r.valObjectMeta,f="_isSubplotObj",m="_isLinkedToArray",g="_deprecated",y=[f,m,"_arrayAttrRegexps",g];function v(e,t,r){if(!e)return!1;if(e._isLinkedToArray)if(x(t[r]))r++;else if(r<t.length)return!1;for(;r<t.length;r++){var n=e[t[r]];if(!u(n))break;if(e=n,r===t.length-1)break;if(e._isLinkedToArray){if(!x(t[++r]))return!1}else if("info_array"===e.valType){var i=t[++r];if(!x(i))return!1;var a=e.items;if(Array.isArray(a)){if(i>=a.length)return!1;if(2===e.dimensions){if(r++,t.length===r)return e;var o=t[r];if(!x(o))return!1;e=a[i][o]}else e=a[i]}else e=a}}return e}function x(e){return e===Math.round(e)&&e>=0}function b(){var e,r,n={};for(e in c(n,i),t.subplotsRegistry)if((r=t.subplotsRegistry[e]).layoutAttributes)if(Array.isArray(r.attr))for(var a=0;a<r.attr.length;a++)k(n,r,r.attr[a]);else k(n,r,"subplot"===r.attr?r.name:r.attr);for(e in t.componentsRegistry){var o=(r=t.componentsRegistry[e]).schema;if(o&&(o.subplots||o.layout)){var s=o.subplots;if(s&&s.xaxis&&!s.yaxis)for(var l in s.xaxis)delete n.yaxis[l];delete n.xaxis.shift,delete n.xaxis.autoshift}else"colorscale"===r.name?c(n,r.layoutAttributes):r.layoutAttributes&&T(n,r.layoutAttributes,r.name)}return{layoutAttributes:w(n)}}function _(){var e={frames:c({},a)};return w(e),e.frames}function w(t){return function(t){function r(e){return{valType:"string",editType:"none"}}function n(t,n,i){e.isValObject(t)?!0!==t.arrayOk&&"data_array"!==t.valType||(i[n+"src"]=r(n)):u(t)&&(t.role="object")}e.crawl(t,n)}(t),function(t){function r(e,t,r){if(e){var n=e[m];n&&(delete e[m],r[t]={items:{}},r[t].items[n]=e,r[t].role="object")}}e.crawl(t,r)}(t),function(e){function t(e){for(var r in e)if(u(e[r]))t(e[r]);else if(Array.isArray(e[r]))for(var n=0;n<e[r].length;n++)t(e[r][n]);else e[r]instanceof RegExp&&(e[r]=e[r].toString())}t(e)}(t),t}function k(e,t,r){var n=p(e,r),i=c({},t.layoutAttributes);i[f]=!0,n.set(i)}function T(e,t,r){var n=p(e,r);n.set(c(n.get()||{},t))}e.IS_SUBPLOT_OBJ=f,e.IS_LINKED_TO_ARRAY=m,e.DEPRECATED=g,e.UNDERSCORE_ATTRS=y,e.get=function(){var r={};return t.allTypes.forEach((function(i){r[i]=function(r){var i,a;i=t.modules[r]._module,a=i.basePlotModule;var o={type:null},s=c({},n),l=c({},i.attributes);e.crawl(l,(function(e,t,r,n,i){p(s,i).set(void 0),void 0===e&&p(l,i).set(void 0)})),c(o,s),t.traceIs(r,"noOpacity")&&delete o.opacity,t.traceIs(r,"showLegend")||(delete o.showlegend,delete o.legendgroup),t.traceIs(r,"noHover")&&(delete o.hoverinfo,delete o.hoverlabel),i.selectPoints||delete o.selectedpoints,c(o,l),a.attributes&&c(o,a.attributes),o.type=r;var u={meta:i.meta||{},categories:i.categories||{},animatable:Boolean(i.animatable),type:r,attributes:w(o)};if(i.layoutAttributes){var h={};c(h,i.layoutAttributes),u.layoutAttributes=w(h)}return i.animatable||e.crawl(u,(function(t){e.isValObject(t)&&"anim"in t&&delete t.anim})),u}(i)})),{defs:{valObjects:d,metaKeys:y.concat(["description","role","editType","impliedEdits"]),editType:{traces:l.traces,layout:l.layout},impliedEdits:{}},traces:r,layout:b(),frames:_(),animation:w(o),config:w(s)}},e.crawl=function(t,r,n,i){var a=n||0;i=i||"",Object.keys(t).forEach((function(n){var o=t[n];if(-1===y.indexOf(n)){var s=(i?i+".":"")+n;r(o,n,t,a,s),e.isValObject(o)||u(o)&&"impliedEdits"!==n&&e.crawl(o,r,a+1,s)}}))},e.isValObject=function(e){return e&&void 0!==e.valType},e.findArrayAttributes=function(t){var r,i,a=[],o=[],s=[];function l(e,t,n,i){o=o.slice(0,i).concat([t]),s=s.slice(0,i).concat([e&&e._isLinkedToArray]),e&&("data_array"===e.valType||!0===e.arrayOk)&&("colorbar"!==o[i-1]||"ticktext"!==t&&"tickvals"!==t)&&c(r,0,"")}function c(e,t,r){var n=e[o[t]],l=r+o[t];if(t===o.length-1)h(n)&&a.push(i+l);else if(s[t]){if(Array.isArray(n))for(var p=0;p<n.length;p++)u(n[p])&&c(n[p],t+1,l+"["+p+"].")}else u(n)&&c(n,t+1,l+".")}return r=t,i="",e.crawl(n,l),t._module&&t._module.attributes&&e.crawl(t._module.attributes,l),a},e.getTraceValObject=function(e,r){var i,a,o=r[0],s=e._module;if(s||(s=(t.modules[e.type||n.type.dflt]||{})._module),!s)return!1;if(!(a=(i=s.attributes)&&i[o])){var l=s.basePlotModule;l&&l.attributes&&(a=l.attributes[o])}return a||(a=n[o]),v(a,r,1)},e.getLayoutValObject=function(e,r){var n=function(e,r){var n,a,o,s,l=e._basePlotModules;if(l){var c;for(n=0;n<l.length;n++){if((o=l[n]).attrRegex&&o.attrRegex.test(r)){if(o.layoutAttrOverrides)return o.layoutAttrOverrides;!c&&o.layoutAttributes&&(c=o.layoutAttributes)}var u=o.baseLayoutAttrOverrides;if(u&&r in u)return u[r]}if(c)return c}var h=e._modules;if(h)for(n=0;n<h.length;n++)if((s=h[n].layoutAttributes)&&r in s)return s[r];for(a in t.componentsRegistry){if("colorscale"===(o=t.componentsRegistry[a]).name&&0===r.indexOf("coloraxis"))return o.layoutAttributes[r];if(!o.schema&&r===o.name)return o.layoutAttributes}return r in i&&i[r]}(e,r[0]);return v(n,r,1)}}}),gt=p({"src/plot_api/plot_template.js"(e){var t=st(),r=N(),n="templateitemname",i={name:{valType:"string",editType:"none"}};function a(e){return e&&"string"===typeof e}function o(e){var r=e.length-1;return"s"!==e.charAt(r)&&t.warn("bad argument to arrayDefaultKey: "+e),e.substr(0,e.length-1)+"defaults"}i[n]={valType:"string",editType:"calc"},e.templatedArray=function(e,t){return t._isLinkedToArray=e,t.name=i.name,t[n]=i[n],t},e.traceTemplater=function(e){var n,i,a={};for(n in e)i=e[n],Array.isArray(i)&&i.length&&(a[n]=0);return{newTrace:function(o){var s={type:n=t.coerce(o,{},r,"type"),_template:null};if(n in a){i=e[n];var l=a[n]%i.length;a[n]++,s._template=i[l]}return s}}},e.newContainer=function(e,r,n){var i=e._template,a=i&&(i[r]||n&&i[n]);return t.isPlainObject(a)||(a=null),e[r]={_template:a}},e.arrayTemplater=function(e,t,r){var i=e._template,s=i&&i[o(t)],l=i&&i[t];Array.isArray(l)&&l.length||(l=[]);var c={};return{newItem:function(e){var t={name:e.name,_input:e},i=t[n]=e[n];if(!a(i))return t._template=s,t;for(var o=0;o<l.length;o++){var u=l[o];if(u.name===i)return c[i]=1,t._template=u,t}return t[r]=e[r]||!1,t._template=!1,t},defaultItems:function(){for(var e=[],t=0;t<l.length;t++){var r=l[t],i=r.name;if(a(i)&&!c[i]){var o={_template:r,name:i,_input:{_templateitemname:i}};o[n]=r[n],e.push(o),c[i]=1}}return e}}},e.arrayDefaultKey=o,e.arrayEditor=function(e,r,i){var a=(t.nestedProperty(e,r).get()||[]).length,o=i._index,s=o>=a&&(i._input||{})._templateitemname;s&&(o=a);var l,c=r+"["+o+"]";function u(){l={},s&&(l[c]={},l[c][n]=s)}function h(e,r){s?t.nestedProperty(l[c],e).set(r):l[c+"."+e]=r}function p(){var e=l;return u(),e}return u(),{modifyBase:function(e,t){l[e]=t},modifyItem:h,getUpdateObj:p,applyUpdate:function(r,n){r&&h(r,n);var i=p();for(var a in i)t.nestedProperty(e,a).set(i[a])}}}}}),yt=p({"src/plots/cartesian/constants.js"(e,t){var r=G().counter;t.exports={idRegex:{x:r("x","( domain)?"),y:r("y","( domain)?")},attrRegex:r("[xy]axis"),xAxisMatch:r("xaxis"),yAxisMatch:r("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*( domain)?$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,HOUR_PATTERN:"hour",WEEKDAY_PATTERN:"day of week",MINDRAG:8,MINZOOM:20,DRAGGERSIZE:20,REDRAWDELAY:50,DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","heatmaplayer","contourcarpetlayer","contourlayer","funnellayer","waterfalllayer","barlayer","carpetlayer","violinlayer","boxlayer","ohlclayer","scattercarpetlayer","scatterlayer"],clipOnAxisFalseQuery:[".scatterlayer",".barlayer",".funnellayer",".waterfalllayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"},zindexSeparator:"z"}}}),vt=p({"src/plots/cartesian/axis_ids.js"(e){var t=Ve(),r=yt();function n(e,t){if(t&&t.length)for(var r=0;r<t.length;r++)if(t[r][e])return!0;return!1}e.id2name=function(e){if("string"===typeof e&&e.match(r.AX_ID_PATTERN)){var t=e.split(" ")[0].substr(1);return"1"===t&&(t=""),e.charAt(0)+"axis"+t}},e.name2id=function(e){if(e.match(r.AX_NAME_PATTERN)){var t=e.substr(5);return"1"===t&&(t=""),e.charAt(0)+t}},e.cleanId=function(e,t,n){var i=/( domain)$/.test(e);if("string"===typeof e&&e.match(r.AX_ID_PATTERN)&&(!t||e.charAt(0)===t)&&(!i||n)){var a=e.split(" ")[0].substr(1).replace(/^0+/,"");return"1"===a&&(a=""),e.charAt(0)+a+(i&&n?" domain":"")}},e.list=function(t,r,n){var i=t._fullLayout;if(!i)return[];var a,o=e.listIds(t,r),s=new Array(o.length);for(a=0;a<o.length;a++){var l=o[a];s[a]=i[l.charAt(0)+"axis"+l.substr(1)]}if(!n){var c=i._subplots.gl3d||[];for(a=0;a<c.length;a++){var u=i[c[a]];r?s.push(u[r+"axis"]):s.push(u.xaxis,u.yaxis,u.zaxis)}}return s},e.listIds=function(e,t){var r=e._fullLayout;if(!r)return[];var n=r._subplots;return t?n[t+"axis"]:n.xaxis.concat(n.yaxis)},e.getFromId=function(t,r,n){var i=t._fullLayout;return r=void 0===r||"string"!==typeof r?r:r.replace(" domain",""),"x"===n?r=r.replace(/y[0-9]*/,""):"y"===n&&(r=r.replace(/x[0-9]*/,"")),i[e.id2name(r)]},e.getFromTrace=function(r,n,i){var a=r._fullLayout,o=null;if(t.traceIs(n,"gl3d")){var s=n.scene;"scene"===s.substr(0,5)&&(o=a[s][i+"axis"])}else o=e.getFromId(r,n[i+"axis"]||i);return o},e.idSort=function(e,t){var r=e.charAt(0),n=t.charAt(0);return r!==n?r>n?1:-1:+(e.substr(1)||1)-+(t.substr(1)||1)},e.ref2id=function(e){return!!/^[xyz]/.test(e)&&e.split(" ")[0]},e.isLinked=function(e,t){return n(t,e._axisMatchGroups)||n(t,e._axisConstraintGroups)}}}),xt=p({"src/components/shapes/handle_outline.js"(e,t){t.exports={clearOutlineControllers:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".outline-controllers").remove()},clearOutline:function(e){var t=e._fullLayout._zoomlayer;t&&t.selectAll(".select-outline").remove(),e._fullLayout._outlining=!1}}}}),bt=p({"src/traces/scatter/layout_attributes.js"(e,t){t.exports={scattermode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},scattergap:{valType:"number",min:0,max:1,editType:"calc"}}}}),_t=p({"src/plots/get_data.js"(e){var t=Ve();yt().SUBPLOT_PATTERN,e.getSubplotCalcData=function(e,r,n){var i=t.subplotsRegistry[r];if(!i)return[];for(var a=i.attr,o=[],s=0;s<e.length;s++){var l=e[s];l[0].trace[a]===n&&o.push(l)}return o},e.getModuleCalcData=function(e,r,n){var i,a=[],o=[];if(!(i="string"===typeof r?t.getModule(r).plot:"function"===typeof r?r:r.plot))return[a,e];for(var s=n,l=0;l<e.length;l++){var c=e[l],u=c[0].trace,h=void 0!==u.zorder;!0===u.visible&&0!==u._length&&(!u._module||u._module.plot!==i||h&&u.zorder!==s?o.push(c):a.push(c))}return[a,o]},e.getSubplotData=function(e,r,n){if(!t.subplotsRegistry[r])return[];for(var i,a=t.subplotsRegistry[r].attr,o=[],s=0;s<e.length;s++)(i=e[s])[a]===n&&o.push(i);return o}}}),wt=p({"src/plots/command.js"(e){var t=Ve(),r=st();function n(e,t,n){var i,a,o,s=!1;if("data"===t.type)i=e._fullData[null!==t.traces?t.traces[0]:0];else{if("layout"!==t.type)return!1;i=e._fullLayout}return a=r.nestedProperty(i,t.prop).get(),(o=n[t.type]=n[t.type]||{}).hasOwnProperty(t.prop)&&o[t.prop]!==a&&(s=!0),o[t.prop]=a,{changed:s,value:a}}function i(e,t){var n=[],i=t[0],a={};if("string"===typeof i)a[i]=t[1];else{if(!r.isPlainObject(i))return n;a=i}return o(a,(function(e,t,r){n.push({type:"layout",prop:e,value:r})}),"",0),n}function a(e,t){var n,i,a,s,l=[];if(i=t[0],a=t[1],n=t[2],s={},"string"===typeof i)s[i]=a;else{if(!r.isPlainObject(i))return l;s=i,void 0===n&&(n=a)}return void 0===n&&(n=null),o(s,(function(t,r,i){var a,o;if(Array.isArray(i)){o=i.slice();var s=Math.min(o.length,e.data.length);n&&(s=Math.min(s,n.length)),a=[];for(var c=0;c<s;c++)a[c]=n?n[c]:c}else o=i,a=n?n.slice():null;if(null===a)Array.isArray(o)&&(o=o[0]);else if(Array.isArray(a)){if(!Array.isArray(o)){var u=o;o=[];for(var h=0;h<a.length;h++)o[h]=u}o.length=Math.min(a.length,o.length)}l.push({type:"data",prop:t,traces:a,value:o})}),"",0),l}function o(e,t,n,i){Object.keys(e).forEach((function(a){var s=e[a];if("_"!==a[0]){var l=n+(i>0?".":"")+a;r.isPlainObject(s)?o(s,t,l,i+1):t(l,a,s)}}))}e.manageCommandObserver=function(t,i,a,o){var s={},l=!0;i&&i._commandObserver&&(s=i._commandObserver),s.cache||(s.cache={}),s.lookupTable={};var c=e.hasSimpleAPICommandBindings(t,a,s.lookupTable);if(i&&i._commandObserver){if(c)return s;if(i._commandObserver.remove)return i._commandObserver.remove(),i._commandObserver=null,s}if(c){n(t,c,s.cache),s.check=function(){if(l){var e=n(t,c,s.cache);return e.changed&&o&&void 0!==s.lookupTable[e.value]&&(s.disable(),Promise.resolve(o({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:s.lookupTable[e.value]})).then(s.enable,s.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;h<u.length;h++)t._internalOn(u[h],s.check);s.remove=function(){for(var e=0;e<u.length;e++)t._removeInternalListener(u[e],s.check)}}else r.log("Unable to automatically bind plot updates to API command"),s.lookupTable={},s.remove=function(){};return s.disable=function(){l=!1},s.enable=function(){l=!0},i&&(i._commandObserver=s),s},e.hasSimpleAPICommandBindings=function(t,r,n){var i,a,o=r.length;for(i=0;i<o;i++){var s,l=r[i],c=l.method,u=l.args;if(Array.isArray(u)||(u=[]),!c)return!1;var h=e.computeAPICommandBindings(t,c,u);if(1!==h.length)return!1;if(a){if((s=h[0]).type!==a.type)return!1;if(s.prop!==a.prop)return!1;if(Array.isArray(a.traces)){if(!Array.isArray(s.traces))return!1;s.traces.sort();for(var p=0;p<a.traces.length;p++)if(a.traces[p]!==s.traces[p])return!1}else if(s.prop!==a.prop)return!1}else a=h[0],Array.isArray(a.traces)&&a.traces.sort();var d=(s=h[0]).value;if(Array.isArray(d)){if(1!==d.length)return!1;d=d[0]}n&&(n[d]=i)}return a},e.executeAPICommand=function(e,n,i){if("skip"===n)return Promise.resolve();var a=t.apiMethodRegistry[n],o=[e];Array.isArray(i)||(i=[]);for(var s=0;s<i.length;s++)o.push(i[s]);return a.apply(null,o).catch((function(e){return r.warn("API call to Plotly."+n+" rejected.",e),Promise.reject(e)}))},e.computeAPICommandBindings=function(e,t,r){var n;switch(Array.isArray(r)||(r=[]),t){case"restyle":n=a(e,r);break;case"relayout":n=i(0,r);break;case"update":n=a(e,[r[0],r[2]]).concat(i(0,[r[1]]));break;case"animate":n=function(e,t){return Array.isArray(t[0])&&1===t[0].length&&-1!==["string","number"].indexOf(typeof t[0][0])?[{type:"layout",prop:"_currentFrame",value:t[0][0].toString()}]:[]}(0,r);break;default:n=[]}return n}}}),kt=p({"src/plots/plots.js"(e,t){var r=v(),n=b().timeFormatLocale,i=_().formatLocale,a=k(),o=S(),s=Ve(),l=mt(),c=gt(),u=st(),h=q(),p=T().BADNUM,d=vt(),f=xt().clearOutline,m=bt(),g=Pe(),y=ft(),x=_t().getModuleCalcData,w=u.relinkPrivateKeys,A=u._,M=t.exports={};u.extendFlat(M,s),M.attributes=N(),M.attributes.type.values=M.allTypes,M.fontAttrs=D(),M.layoutAttributes=Be();var E=wt();M.executeAPICommand=E.executeAPICommand,M.computeAPICommandBindings=E.computeAPICommandBindings,M.manageCommandObserver=E.manageCommandObserver,M.hasSimpleAPICommandBindings=E.hasSimpleAPICommandBindings,M.redrawText=function(e){return e=u.getGraphDiv(e),new Promise((function(t){setTimeout((function(){e._fullLayout&&(s.getComponentMethod("annotations","draw")(e),s.getComponentMethod("legend","draw")(e),s.getComponentMethod("colorbar","draw")(e),t(M.previousPromises(e)))}),300)}))},M.resize=function(e){var t;e=u.getGraphDiv(e);var r=new Promise((function(r,n){e&&!u.isHidden(e)||n(new Error("Resize must be passed a displayed plot div element.")),e._redrawTimer&&clearTimeout(e._redrawTimer),e._resolveResize&&(t=e._resolveResize),e._resolveResize=r,e._redrawTimer=setTimeout((function(){if(!e.layout||e.layout.width&&e.layout.height||u.isHidden(e))r(e);else{delete e.layout.width,delete e.layout.height;var t=e.changed;e.autoplay=!0,s.call("relayout",e,{autosize:!0}).then((function(){e.changed=t,e._resolveResize===r&&(delete e._resolveResize,r(e))}))}}),100)}));return t&&t(r),r},M.previousPromises=function(e){if((e._promises||[]).length)return Promise.all(e._promises).then((function(){e._promises=[]}))},M.addLinks=function(e){if(e._context.showLink||e._context.showSources){var t=e._fullLayout,n=u.ensureSingle(t._paper,"text","js-plot-link-container",(function(e){e.style({"font-family":'"Open Sans", Arial, sans-serif',"font-size":"12px",fill:h.defaultLine,"pointer-events":"all"}).each((function(){var e=r.select(this);e.append("tspan").classed("js-link-to-tool",!0),e.append("tspan").classed("js-link-spacer",!0),e.append("tspan").classed("js-sourcelinks",!0)}))})),i=n.node(),a={y:t._paper.attr("height")-9};document.body.contains(i)&&i.getComputedTextLength()>=t.width-20?(a["text-anchor"]="start",a.x=5):(a["text-anchor"]="end",a.x=t._paper.attr("width")-7),n.attr(a);var o=n.select(".js-link-to-tool"),s=n.select(".js-link-spacer"),l=n.select(".js-sourcelinks");e._context.showSources&&e._context.showSources(e),e._context.showLink&&function(e,t){t.text("");var r=t.append("a").attr({"xlink:xlink:href":"#",class:"link--impt link--embedview","font-weight":"bold"}).text(e._context.linkText+" "+String.fromCharCode(187));if(e._context.sendData)r.on("click",(function(){M.sendDataToCloud(e)}));else{var n=window.location.pathname.split("/"),i=window.location.search;r.attr({"xlink:xlink:show":"new","xlink:xlink:href":"/"+n[2].split(".")[0]+"/"+n[1]+i})}}(e,o),s.text(o.text()&&l.text()?" - ":"")}},M.sendDataToCloud=function(e){var t=(window.PLOTLYENV||{}).BASE_URL||e._context.plotlyServerURL;if(t){e.emit("plotly_beforeexport");var n=r.select(e).append("div").attr("id","hiddenform").style("display","none"),i=n.append("form").attr({action:t+"/external",method:"post",target:"_blank"});return i.append("input").attr({type:"text",name:"data"}).node().value=M.graphJson(e,!1,"keepdata"),i.node().submit(),n.remove(),e.emit("plotly_afterexport"),!1}};var C=["days","shortDays","months","shortMonths","periods","dateTime","date","time","decimal","thousands","grouping","currency"],P=["year","month","dayMonth","dayMonthYear"];function L(e,t){var r=e._context.locale;r||(r="en-US");var n=!1,i={};function a(e){for(var r=!0,a=0;a<t.length;a++){var o=t[a];i[o]||(e[o]?i[o]=e[o]:r=!1)}r&&(n=!0)}for(var o=0;o<2;o++){for(var l=e._context.locales,c=0;c<2;c++){var u=(l[r]||{}).format;if(u&&(a(u),n))break;l=s.localeRegistry}var h=r.split("-")[0];if(n||h===r)break;r=h}return n||a(s.localeRegistry.en.format),i}function I(e,t){var r={_fullLayout:t},n="x"===e._id.charAt(0),i=e._mainAxis._anchorAxis,a="",o="",s="";if(i&&(s=i._mainAxis._id,a=n?e._id+s:s+e._id),!a||!t._plots[a]){a="";for(var l=e._counterAxes,c=0;c<l.length;c++){var u=l[c],h=n?e._id+u:u+e._id;o||(o=h);var p=d.getFromId(r,u);if(s&&p.overlaying===s){a=h;break}}}return a||o}function z(e){return"string"===typeof e&&"px"===e.substr(e.length-2)&&parseFloat(e)}function O(e){var t=e.margin;if(!e._size){var r=e._size={l:Math.round(t.l),r:Math.round(t.r),t:Math.round(t.t),b:Math.round(t.b),p:Math.round(t.pad)};r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b}e._pushmargin||(e._pushmargin={}),e._pushmarginIds||(e._pushmarginIds={}),e._reservedMargin||(e._reservedMargin={})}M.supplyDefaults=function(e,t){var r=t&&t.skipUpdateCalc,a=e._fullLayout||{};if(a._skipDefaults)delete a._skipDefaults;else{var o,l=e._fullLayout={},c=e.layout||{},h=e._fullData||[],p=e._fullData=[],d=e.data||[],m=e.calcdata||[],g=e._context||{};e._transitionData||M.createTransitionData(e),l._dfltTitle={plot:A(e,"Click to enter Plot title"),subtitle:A(e,"Click to enter Plot subtitle"),x:A(e,"Click to enter X axis title"),y:A(e,"Click to enter Y axis title"),colorbar:A(e,"Click to enter Colorscale title"),annotation:A(e,"new text")},l._traceWord=A(e,"trace");var y=L(e,C);if(l._mapboxAccessToken=g.mapboxAccessToken,a._initialAutoSizeIsDone){var v=a.width,x=a.height;M.supplyLayoutGlobalDefaults(c,l,y),c.width||(l.width=v),c.height||(l.height=x),M.sanitizeMargins(l)}else{M.supplyLayoutGlobalDefaults(c,l,y);var b=!c.width||!c.height,_=l.autosize,k=g.autosizable;b&&(_||k)?M.plotAutoSize(e,c,l):b&&M.sanitizeMargins(l),!_&&b&&(c.width=l.width,c.height=l.height)}l._d3locale=function(e,t){return e.decimal=t.charAt(0),e.thousands=t.charAt(1),{numberFormat:function(t){try{t=i(e).format(u.adjustFormat(t))}catch(r){return u.warnBadFormat(t),u.noFormat}return t},timeFormat:n(e).utcFormat}}(y,l.separators),l._extraFormat=L(e,P),l._initialAutoSizeIsDone=!0,l._dataLength=d.length,l._modules=[],l._visibleModules=[],l._basePlotModules=[];var T=l._subplots=function(){var e,t,r=s.collectableSubplotTypes,n={};if(!r){r=[];var i=s.subplotsRegistry;for(var a in i){var o=i[a].attr;if(o&&(r.push(a),Array.isArray(o)))for(t=0;t<o.length;t++)u.pushUnique(r,o[t])}}for(e=0;e<r.length;e++)n[r[e]]=[];return n}(),S=l._splomAxes={x:{},y:{}},E=l._splomSubplots={};l._splomGridDflt={},l._scatterStackOpts={},l._firstScatter={},l._alignmentOpts={},l._colorAxes={},l._requestRangeslider={},l._traceUids=function(e,t){var r,n,i=t.length,a=[];for(r=0;r<e.length;r++){var o=e[r]._fullInput;o!==n&&a.push(o),n=o}var s=a.length,l=new Array(i),c={};function h(e,t){l[t]=e,c[e]=1}function p(e,t){if(e&&"string"===typeof e&&!c[e])return h(e,t),!0}for(r=0;r<i;r++){var d=t[r].uid;"number"===typeof d&&(d=String(d)),p(d,r)||r<s&&p(a[r].uid,r)||h(u.randstr(c),r)}return l}(h,d),M.supplyDataDefaults(d,p,c,l);var I=Object.keys(S.x),z=Object.keys(S.y);if(I.length>1&&z.length>1){for(s.getComponentMethod("grid","sizeDefaults")(c,l),o=0;o<I.length;o++)u.pushUnique(T.xaxis,I[o]);for(o=0;o<z.length;o++)u.pushUnique(T.yaxis,z[o]);for(var R in E)u.pushUnique(T.cartesian,R)}if(l._has=M._hasPlotType.bind(l),h.length===p.length)for(o=0;o<p.length;o++)w(p[o],h[o]);M.supplyLayoutModuleDefaults(c,l,p,e._transitionData);var D=l._visibleModules,j=[];for(o=0;o<D.length;o++){var F=D[o].crossTraceDefaults;F&&u.pushUnique(j,F)}for(o=0;o<j.length;o++)j[o](p,l);l._hasOnlyLargeSploms=1===l._basePlotModules.length&&"splom"===l._basePlotModules[0].name&&I.length>15&&z.length>15&&0===l.shapes.length&&0===l.images.length,M.linkSubplots(p,l,h,a),M.cleanPlot(p,l,h,a);var B=!(!a._has||!a._has("cartesian")),N=!(!l._has||!l._has("cartesian"));B&&!N?a._bgLayer.remove():N&&!B&&(l._shouldCreateBgLayer=!0),a._zoomlayer&&!e._dragging&&f({_fullLayout:a}),function(e,t){var r,n=[];t.meta&&(r=t._meta={meta:t.meta,layout:{meta:t.meta}});for(var i=0;i<e.length;i++){var a=e[i];a.meta?n[a.index]=a._meta={meta:a.meta}:t.meta&&(a._meta={meta:t.meta}),t.meta&&(a._meta.layout={meta:t.meta})}n.length&&(r||(r=t._meta={}),r.data=n)}(p,l),w(l,a),s.getComponentMethod("colorscale","crossTraceDefaults")(p,l),l._preGUI||(l._preGUI={}),l._tracePreGUI||(l._tracePreGUI={});var U,V=l._tracePreGUI,q={};for(U in V)q[U]="old";for(o=0;o<p.length;o++)q[U=p[o]._fullInput.uid]||(V[U]={}),q[U]="new";for(U in q)"old"===q[U]&&delete V[U];O(l),s.getComponentMethod("rangeslider","makeData")(l),r||m.length!==p.length||M.supplyDefaultsUpdateCalc(m,p)}},M.supplyDefaultsUpdateCalc=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=(e[r]||[])[0];if(i&&i.trace){var a=i.trace;if(a._hasCalcTransform){var o,s,l,c=a._arrayAttrs;for(o=0;o<c.length;o++)s=c[o],l=u.nestedProperty(a,s).get().slice(),u.nestedProperty(n,s).set(l)}i.trace=n}}},M.createTransitionData=function(e){e._transitionData||(e._transitionData={}),e._transitionData._frames||(e._transitionData._frames=[]),e._transitionData._frameHash||(e._transitionData._frameHash={}),e._transitionData._counter||(e._transitionData._counter=0),e._transitionData._interruptCallbacks||(e._transitionData._interruptCallbacks=[])},M._hasPlotType=function(e){var t,r=this._basePlotModules||[];for(t=0;t<r.length;t++)if(r[t].name===e)return!0;var n=this._modules||[];for(t=0;t<n.length;t++){var i=n[t].name;if(i===e)return!0;var a=s.modules[i];if(a&&a.categories[e])return!0}return!1},M.cleanPlot=function(e,t,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i<o.length;i++){var s=o[i];s.clean&&s.clean(e,t,r,n)}var l=n._has&&n._has("gl"),c=t._has&&t._has("gl");l&&!c&&void 0!==n._glcontainer&&(n._glcontainer.selectAll(".gl-canvas").remove(),n._glcontainer.selectAll(".no-webgl").remove(),n._glcanvas=null);var u=!!n._infolayer;e:for(i=0;i<r.length;i++){var h=r[i].uid;for(a=0;a<e.length;a++)if(h===e[a].uid)continue e;u&&n._infolayer.select(".cb"+h).remove()}},M.linkSubplots=function(e,t,r,n){var i,a,o=n._plots||{},l=t._plots={},c={_fullData:e,_fullLayout:t},h=t._subplots.cartesian||[];for(i=0;i<h.length;i++){var p,f=h[i],m=o[f],g=d.getFromId(c,f,"x"),y=d.getFromId(c,f,"y");for(m?p=l[f]=m:(p=l[f]={}).id=f,g._counterAxes.push(y._id),y._counterAxes.push(g._id),g._subplotsWith.push(f),y._subplotsWith.push(f),p.xaxis=g,p.yaxis=y,p._hasClipOnAxisFalse=!1,a=0;a<e.length;a++){var v=e[a];if(v.xaxis===p.xaxis._id&&v.yaxis===p.yaxis._id&&!1===v.cliponaxis){p._hasClipOnAxisFalse=!0;break}}}var x,b=d.list(c,null,!0);for(i=0;i<b.length;i++){var _=null;(x=b[i]).overlaying&&(_=d.getFromId(c,x.overlaying))&&_.overlaying&&(x.overlaying=!1,_=null),x._mainAxis=_||x,_&&(x.domain=_.domain.slice()),x._anchorAxis="free"===x.anchor?null:d.getFromId(c,x.anchor)}for(i=0;i<b.length;i++)if((x=b[i])._counterAxes.sort(d.idSort),x._subplotsWith.sort(u.subplotSort),x._mainSubplot=I(x,t),x._counterAxes.length&&(x.spikemode&&-1!==x.spikemode.indexOf("across")||x.automargin&&x.mirror&&"free"!==x.anchor||s.getComponentMethod("rangeslider","isVisible")(x))){var w=1,k=0;for(a=0;a<x._counterAxes.length;a++){var T=d.getFromId(c,x._counterAxes[a]);w=Math.min(w,T.domain[0]),k=Math.max(k,T.domain[1])}w<k&&(x._counterDomainMin=w,x._counterDomainMax=k)}},M.clearExpandedTraceDefaultColors=function(e){var t,r,n;for(r=[],(t=e._module._colorAttrs)||(e._module._colorAttrs=t=[],l.crawl(e._module.attributes,(function(e,n,i,a){r[a]=n,r.length=a+1,"color"===e.valType&&void 0===e.dflt&&t.push(r.join("."))}))),n=0;n<t.length;n++)u.nestedProperty(e,"_input."+t[n]).get()||u.nestedProperty(e,t[n]).set(null)},M.supplyDataDefaults=function(e,t,r,n){var i,a,o,l=n._modules,h=n._visibleModules,p=n._basePlotModules,d=0;function f(e){t.push(e);var r=e._module;r&&(u.pushUnique(l,r),!0===e.visible&&u.pushUnique(h,r),u.pushUnique(p,e._module.basePlotModule),!1!==e._input.visible&&d++)}n._transformModules=[];var m={},g=[],y=(r.template||{}).data||{},v=c.traceTemplater(y);for(i=0;i<e.length;i++)o=e[i],(a=v.newTrace(o)).uid=n._traceUids[i],M.supplyTraceDefaults(o,a,d,n,i),a.index=i,a._input=o,a._fullInput=a,f(a),s.traceIs(a,"carpetAxis")&&(m[a.carpet]=a),s.traceIs(a,"carpetDependent")&&g.push(i);for(i=0;i<g.length;i++)if((a=t[g[i]]).visible){var x=m[a.carpet];a._carpet=x,x&&x.visible?(a.xaxis=x.xaxis,a.yaxis=x.yaxis):a.visible=!1}},M.supplyAnimationDefaults=function(e){var t;e=e||{};var r={};function n(t,n){return u.coerce(e||{},r,g,t,n)}if(n("mode"),n("direction"),n("fromcurrent"),Array.isArray(e.frame))for(r.frame=[],t=0;t<e.frame.length;t++)r.frame[t]=M.supplyAnimationFrameDefaults(e.frame[t]||{});else r.frame=M.supplyAnimationFrameDefaults(e.frame||{});if(Array.isArray(e.transition))for(r.transition=[],t=0;t<e.transition.length;t++)r.transition[t]=M.supplyAnimationTransitionDefaults(e.transition[t]||{});else r.transition=M.supplyAnimationTransitionDefaults(e.transition||{});return r},M.supplyAnimationFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,g.frame,r,n)}return r("duration"),r("redraw"),t},M.supplyAnimationTransitionDefaults=function(e){var t={};function r(r,n){return u.coerce(e||{},t,g.transition,r,n)}return r("duration"),r("easing"),t},M.supplyFrameDefaults=function(e){var t={};function r(r,n){return u.coerce(e,t,y,r,n)}return r("group"),r("name"),r("traces"),r("baseframe"),r("data"),r("layout"),t},M.supplyTraceDefaults=function(e,t,r,n,i){var a,o=n.colorway||h.defaults,l=o[r%o.length];function c(r,n){return u.coerce(e,t,M.attributes,r,n)}var p=c("visible");c("type"),c("name",n._traceWord+" "+i),c("uirevision",n.uirevision);var d=M.getModule(t);if(t._module=d,d){var f=d.basePlotModule,m=f.attr,g=f.attributes;if(m&&g){var y=n._subplots,v="";if(Array.isArray(m))for(a=0;a<m.length;a++){var x=m[a],b=u.coerce(e,t,g,x);y[x]&&u.pushUnique(y[x],b),v+=b}else v=u.coerce(e,t,g,m);y[f.name]&&u.pushUnique(y[f.name],v)}}if(p&&(c("customdata"),c("ids"),c("meta"),s.traceIs(t,"showLegend")?(u.coerce(e,t,d.attributes.showlegend?d.attributes:M.attributes,"showlegend"),c("legend"),c("legendwidth"),c("legendgroup"),c("legendgrouptitle.text"),c("legendrank"),t._dfltShowLegend=!0):t._dfltShowLegend=!1,d&&d.supplyDefaults(e,t,l,n),s.traceIs(t,"noOpacity")||c("opacity"),s.traceIs(t,"notLegendIsolatable")&&(t.visible=!!t.visible),s.traceIs(t,"noHover")||(t.hovertemplate||u.coerceHoverinfo(e,t,n),"parcats"!==t.type&&s.getComponentMethod("fx","supplyDefaults")(e,t,l,n)),d&&d.selectPoints)){var _=c("selectedpoints");u.isTypedArray(_)&&(t.selectedpoints=Array.from(_))}return t},M.supplyLayoutGlobalDefaults=function(e,t,r){function n(r,n){return u.coerce(e,t,M.layoutAttributes,r,n)}var i=e.template;u.isPlainObject(i)&&(t.template=i,t._template=i.layout,t._dataTemplate=i.data),n("autotypenumbers");var a=u.coerceFont(n,"font"),o=a.size;u.coerceFont(n,"title.font",a,{overrideDflt:{size:Math.round(1.4*o)}}),n("title.text",t._dfltTitle.plot),n("title.xref");var l=n("title.yref");n("title.pad.t"),n("title.pad.r"),n("title.pad.b"),n("title.pad.l");var c=n("title.automargin");n("title.x"),n("title.xanchor"),n("title.y"),n("title.yanchor"),n("title.subtitle.text",t._dfltTitle.subtitle),u.coerceFont(n,"title.subtitle.font",a,{overrideDflt:{size:Math.round(.7*t.title.font.size)}}),c&&("paper"===l&&(0!==t.title.y&&(t.title.y=1),"auto"===t.title.yanchor&&(t.title.yanchor=0===t.title.y?"top":"bottom")),"container"===l&&("auto"===t.title.y&&(t.title.y=1),"auto"===t.title.yanchor&&(t.title.yanchor=t.title.y<.5?"bottom":"top"))),n("uniformtext.mode")&&n("uniformtext.minsize"),n("autosize",!(e.width&&e.height)),n("width"),n("height"),n("minreducedwidth"),n("minreducedheight"),n("margin.l"),n("margin.r"),n("margin.t"),n("margin.b"),n("margin.pad"),n("margin.autoexpand"),e.width&&e.height&&M.sanitizeMargins(t),s.getComponentMethod("grid","sizeDefaults")(e,t),n("paper_bgcolor"),n("separators",r.decimal+r.thousands),n("hidesources"),n("colorway"),n("datarevision");var h=n("uirevision");n("editrevision",h),n("selectionrevision",h),s.getComponentMethod("modebar","supplyLayoutDefaults")(e,t),s.getComponentMethod("shapes","supplyDrawNewShapeDefaults")(e,t,n),s.getComponentMethod("selections","supplyDrawNewSelectionDefaults")(e,t,n),n("meta"),u.isPlainObject(e.transition)&&(n("transition.duration"),n("transition.easing"),n("transition.ordering")),s.getComponentMethod("calendars","handleDefaults")(e,t,"calendar"),s.getComponentMethod("fx","supplyLayoutGlobalDefaults")(e,t,n),u.coerce(e,t,m,"scattermode")},M.plotAutoSize=function(e,t,r){var n,i,o=e._context||{},s=o.frameMargins,l=u.isPlotDiv(e);if(l&&e.emit("plotly_autosize"),o.fillFrame)n=window.innerWidth,i=window.innerHeight,document.body.style.overflow="hidden";else{var c=l?window.getComputedStyle(e):{};if(n=z(c.width)||z(c.maxWidth)||r.width,i=z(c.height)||z(c.maxHeight)||r.height,a(s)&&s>0){var h=1-2*s;n=Math.round(h*n),i=Math.round(h*i)}}var p=M.layoutAttributes.width.min,d=M.layoutAttributes.height.min;n<p&&(n=p),i<d&&(i=d);var f=!t.width&&Math.abs(r.width-n)>1,m=!t.height&&Math.abs(r.height-i)>1;(m||f)&&(f&&(r.width=n),m&&(r.height=i)),e._initialAutoSize||(e._initialAutoSize={width:n,height:i}),M.sanitizeMargins(r)},M.supplyLayoutModuleDefaults=function(e,t,r,n){var i,a,o,l=s.componentsRegistry,c=t._basePlotModules,h=s.subplotsRegistry.cartesian;for(i in l)(o=l[i]).includeBasePlot&&o.includeBasePlot(e,t);for(var p in c.length||c.push(h),t._has("cartesian")&&(s.getComponentMethod("grid","contentDefaults")(e,t),h.finalizeSubplots(e,t)),t._subplots)t._subplots[p].sort(u.subplotSort);for(a=0;a<c.length;a++)(o=c[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var d=t._modules;for(a=0;a<d.length;a++)(o=d[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r);var f=t._transformModules;for(a=0;a<f.length;a++)(o=f[a]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r,n);for(i in l)(o=l[i]).supplyLayoutDefaults&&o.supplyLayoutDefaults(e,t,r)},M.purge=function(e){var t=e._fullLayout||{};void 0!==t._glcontainer&&(t._glcontainer.selectAll(".gl-canvas").remove(),t._glcontainer.remove(),t._glcanvas=null),t._modeBar&&t._modeBar.destroy(),e._transitionData&&(e._transitionData._interruptCallbacks&&(e._transitionData._interruptCallbacks.length=0),e._transitionData._animationRaf&&window.cancelAnimationFrame(e._transitionData._animationRaf)),u.clearThrottle(),u.clearResponsive(e),delete e.data,delete e.layout,delete e._fullData,delete e._fullLayout,delete e.calcdata,delete e.empty,delete e.fid,delete e.undoqueue,delete e.undonum,delete e.autoplay,delete e.changed,delete e._promises,delete e._redrawTimer,delete e._hmlumcount,delete e._hmpixcount,delete e._transitionData,delete e._transitioning,delete e._initialAutoSize,delete e._transitioningWithDuration,delete e._dragging,delete e._dragged,delete e._dragdata,delete e._hoverdata,delete e._snapshotInProgress,delete e._editing,delete e._mouseDownTime,delete e._legendMouseDownTime,e.removeAllListeners&&e.removeAllListeners()},M.style=function(e){var t,r=e._fullLayout._visibleModules,n=[];for(t=0;t<r.length;t++){var i=r[t];i.style&&u.pushUnique(n,i.style)}for(t=0;t<n.length;t++)n[t](e)},M.sanitizeMargins=function(e){if(e&&e.margin){var t,r=e.width,n=e.height,i=e.margin,a=r-(i.l+i.r),o=n-(i.t+i.b);a<0&&(t=(r-1)/(i.l+i.r),i.l=Math.floor(t*i.l),i.r=Math.floor(t*i.r)),o<0&&(t=(n-1)/(i.t+i.b),i.t=Math.floor(t*i.t),i.b=Math.floor(t*i.b))}},M.clearAutoMarginIds=function(e){e._fullLayout._pushmarginIds={}},M.allowAutoMargin=function(e,t){e._fullLayout._pushmarginIds[t]=1},M.autoMargin=function(e,t,r){var n=e._fullLayout,i=n.width,a=n.height,o=n.margin,s=n.minreducedwidth,l=n.minreducedheight,c=u.constrain(i-o.l-o.r,2,s),h=u.constrain(a-o.t-o.b,2,l),p=Math.max(0,i-c),d=Math.max(0,a-h),f=n._pushmargin,m=n._pushmarginIds;if(!1!==o.autoexpand){if(r){var g=r.pad;if(void 0===g&&(g=Math.min(12,o.l,o.r,o.t,o.b)),p){var y=(r.l+r.r)/p;y>1&&(r.l/=y,r.r/=y)}if(d){var v=(r.t+r.b)/d;v>1&&(r.t/=v,r.b/=v)}var x=void 0!==r.xl?r.xl:r.x,b=void 0!==r.xr?r.xr:r.x,_=void 0!==r.yt?r.yt:r.y,w=void 0!==r.yb?r.yb:r.y;f[t]={l:{val:x,size:r.l+g},r:{val:b,size:r.r+g},b:{val:w,size:r.b+g},t:{val:_,size:r.t+g}},m[t]=1}else delete f[t],delete m[t];if(!n._replotting)return M.doAutoMargin(e)}},M.doAutoMargin=function(e){var t=e._fullLayout,r=t.width,n=t.height;t._size||(t._size={}),O(t);var i=t._size,o=t.margin,l={t:0,b:0,l:0,r:0},c=u.extendFlat({},i),h=o.l,p=o.r,f=o.t,m=o.b,g=t._pushmargin,y=t._pushmarginIds,v=t.minreducedwidth,x=t.minreducedheight;if(!1!==o.autoexpand){for(var b in g)y[b]||delete g[b];var _=e._fullLayout._reservedMargin;for(var w in _)for(var k in _[w]){var T=_[w][k];l[k]=Math.max(l[k],T)}for(var S in g.base={l:{val:0,size:h},r:{val:1,size:p},t:{val:1,size:f},b:{val:0,size:m}},l){var A=0;for(var E in g)"base"!==E&&a(g[E][S].size)&&(A=g[E][S].size>A?g[E][S].size:A);var C=Math.max(0,o[S]-A);l[S]=Math.max(0,l[S]-C)}for(var P in g){var L=g[P].l||{},I=g[P].b||{},z=L.val,R=L.size,D=I.val,j=I.size,F=r-l.r-l.l,B=n-l.t-l.b;for(var N in g){if(a(R)&&g[N].r){var U=g[N].r.val,V=g[N].r.size;if(U>z){var q=(R*U+(V-F)*z)/(U-z),H=(V*(1-z)+(R-F)*(1-U))/(U-z);q+H>h+p&&(h=q,p=H)}}if(a(j)&&g[N].t){var G=g[N].t.val,W=g[N].t.size;if(G>D){var $=(j*G+(W-B)*D)/(G-D),Z=(W*(1-D)+(j-B)*(1-G))/(G-D);$+Z>m+f&&(m=$,f=Z)}}}}}var X=u.constrain(r-o.l-o.r,2,v),Y=u.constrain(n-o.t-o.b,2,x),K=Math.max(0,r-X),J=Math.max(0,n-Y);if(K){var Q=(h+p)/K;Q>1&&(h/=Q,p/=Q)}if(J){var ee=(m+f)/J;ee>1&&(m/=ee,f/=ee)}if(i.l=Math.round(h)+l.l,i.r=Math.round(p)+l.r,i.t=Math.round(f)+l.t,i.b=Math.round(m)+l.b,i.p=Math.round(o.pad),i.w=Math.round(r)-i.l-i.r,i.h=Math.round(n)-i.t-i.b,!t._replotting&&(M.didMarginChange(c,i)||function(e){if("_redrawFromAutoMarginCount"in e._fullLayout)return!1;var t=d.list(e,"",!0);for(var r in t)if(t[r].autoshift||t[r].shift)return!0;return!1}(e))){"_redrawFromAutoMarginCount"in t?t._redrawFromAutoMarginCount++:t._redrawFromAutoMarginCount=1;var te=3*(1+Object.keys(y).length);if(t._redrawFromAutoMarginCount<te)return s.call("_doPlot",e);t._size=c,u.warn("Too many auto-margin redraws.")}!function(e){var t=d.list(e,"",!0);["_adjustTickLabelsOverflow","_hideCounterAxisInsideTickLabels"].forEach((function(e){for(var r=0;r<t.length;r++){var n=t[r][e];n&&n()}}))}(e)};var R=["l","r","t","b","p","w","h"];function j(e,t,r){var n=!1,i=[M.previousPromises,function(){if(e._transitionData)return e._transitioning=!1,function(e){var t=Promise.resolve();if(!e)return t;for(;e.length;)t=t.then(e.shift());return t}(e._transitionData._interruptCallbacks)},r.prepareFn,M.rehover,M.reselect,function(){return e.emit("plotly_transitioning",[]),new Promise((function(i){e._transitioning=!0,t.duration>0&&(e._transitioningWithDuration=!0),e._transitionData._interruptCallbacks.push((function(){n=!0})),r.redraw&&e._transitionData._interruptCallbacks.push((function(){return s.call("redraw",e)})),e._transitionData._interruptCallbacks.push((function(){e.emit("plotly_transitioninterrupted",[])}));var a=0,o=0;function l(){return a++,function(){var t;o++,n||o!==a||(t=i,e._transitionData&&(function(e){if(e)for(;e.length;)e.shift()}(e._transitionData._interruptCallbacks),Promise.resolve().then((function(){if(r.redraw)return s.call("redraw",e)})).then((function(){e._transitioning=!1,e._transitioningWithDuration=!1,e.emit("plotly_transitioned",[])})).then(t)))}}r.runFn(l),setTimeout(l())}))}],a=u.syncOrAsync(i,e);return a&&a.then||(a=Promise.resolve()),a.then((function(){return e}))}M.didMarginChange=function(e,t){for(var r=0;r<R.length;r++){var n=R[r],i=e[n],o=t[n];if(!a(i)||Math.abs(o-i)>1)return!0}return!1},M.graphJson=function(e,t,r,n,i,a){(i&&t&&!e._fullData||i&&!t&&!e._fullLayout)&&M.supplyDefaults(e);var s=i?e._fullData:e.data,l=i?e._fullLayout:e.layout,c=(e._transitionData||{})._frames;function h(e,t){if("function"===typeof e)return t?"_function_":null;if(u.isPlainObject(e)){var n,i={};return Object.keys(e).sort().forEach((function(a){if(-1===["_","["].indexOf(a.charAt(0)))if("function"!==typeof e[a]){if("keepdata"===r){if("src"===a.substr(a.length-3))return}else if("keepstream"===r){if("string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(e.stream))return}else if("keepall"!==r&&"string"===typeof(n=e[a+"src"])&&n.indexOf(":")>0)return;i[a]=h(e[a],t)}else t&&(i[a]="_function")})),i}var a=Array.isArray(e),s=u.isTypedArray(e);if((a||s)&&e.dtype&&e.shape){var l=e.bdata;return h({dtype:e.dtype,shape:e.shape,bdata:u.isArrayBuffer(l)?o.encode(l):l},t)}return a?e.map((function(e){return h(e,t)})):s?u.simpleMap(e,u.identity):u.isJSDate(e)?u.ms2DateTimeLocal(+e):e}var p={data:(s||[]).map((function(e){var r=h(e);return t&&delete r.fit,r}))};if(!t&&(p.layout=h(l),i)){var d=l._size;p.layout.computed={margin:{b:d.b,l:d.l,r:d.r,t:d.t}}}return c&&(p.frames=h(c)),a&&(p.config=h(e._context,!0)),"object"===n?p:JSON.stringify(p)},M.modifyFrames=function(e,t){var r,n,i,a=e._transitionData._frames,o=e._transitionData._frameHash;for(r=0;r<t.length;r++)switch((n=t[r]).type){case"replace":i=n.value;var s=(a[n.index]||{}).name,l=i.name;a[n.index]=o[l]=i,l!==s&&(delete o[s],o[l]=i);break;case"insert":o[(i=n.value).name]=i,a.splice(n.index,0,i);break;case"delete":delete o[(i=a[n.index]).name],a.splice(n.index,1)}return Promise.resolve()},M.computeFrame=function(e,t){var r,n,i,a,o=e._transitionData._frameHash;if(!t)throw new Error("computeFrame must be given a string frame name");var s=o[t.toString()];if(!s)return!1;for(var l=[s],c=[s.name];s.baseframe&&(s=o[s.baseframe.toString()])&&-1===c.indexOf(s.name);)l.push(s),c.push(s.name);for(var u={};s=l.pop();)if(s.layout&&(u.layout=M.extendLayout(u.layout,s.layout)),s.data){if(u.data||(u.data=[]),!(n=s.traces))for(n=[],r=0;r<s.data.length;r++)n[r]=r;for(u.traces||(u.traces=[]),r=0;r<s.data.length;r++)void 0!==(i=n[r])&&null!==i&&(-1===(a=u.traces.indexOf(i))&&(a=u.data.length,u.traces[a]=i),u.data[a]=M.extendTrace(u.data[a],s.data[r]))}return u},M.recomputeFrameHash=function(e){for(var t=e._transitionData._frameHash={},r=e._transitionData._frames,n=0;n<r.length;n++){var i=r[n];i&&i.name&&(t[i.name]=i)}},M.extendObjectWithContainers=function(e,t,r){var n,i,a,o,s,l,c,h=u.extendDeepNoArrays({},t||{}),p=u.expandObjectPaths(h),d={};if(r&&r.length)for(a=0;a<r.length;a++)void 0===(i=(n=u.nestedProperty(p,r[a])).get())?u.nestedProperty(d,r[a]).set(null):(n.set(null),u.nestedProperty(d,r[a]).set(i));if(e=u.extendDeepNoArrays(e||{},p),r&&r.length)for(a=0;a<r.length;a++)if(l=u.nestedProperty(d,r[a]).get()){for(c=(s=u.nestedProperty(e,r[a])).get(),Array.isArray(c)||(c=[],s.set(c)),o=0;o<l.length;o++){var f=l[o];c[o]=null===f?null:M.extendObjectWithContainers(c[o],f)}s.set(c)}return e},M.dataArrayContainers=["transforms","dimensions"],M.layoutArrayContainers=s.layoutArrayContainers,M.extendTrace=function(e,t){return M.extendObjectWithContainers(e,t,M.dataArrayContainers)},M.extendLayout=function(e,t){return M.extendObjectWithContainers(e,t,M.layoutArrayContainers)},M.transition=function(e,t,r,n,i,a){var o={redraw:i.redraw},s={},l=[];return o.prepareFn=function(){for(var i=Array.isArray(t)?t.length:0,a=n.slice(0,i),o=0;o<a.length;o++){var c=a[o],h=e._fullData[c]._module;if(h){if(h.animatable){var p=h.basePlotModule.name;s[p]||(s[p]=[]),s[p].push(c)}e.data[a[o]]=M.extendTrace(e.data[a[o]],t[o])}}var d=u.expandObjectPaths(u.extendDeepNoArrays({},r)),f=/^[xy]axis[0-9]*$/;for(var m in d)f.test(m)&&delete d[m].range;M.extendLayout(e.layout,d),delete e.calcdata,M.supplyDefaults(e),M.doCalcdata(e);var g=u.expandObjectPaths(r);if(g){var y=e._fullLayout._plots;for(var v in y){var x=y[v],b=x.xaxis,_=x.yaxis,w=b.range.slice(),k=_.range.slice(),T=null,S=null,A=null,E=null;Array.isArray(g[b._name+".range"])?T=g[b._name+".range"].slice():Array.isArray((g[b._name]||{}).range)&&(T=g[b._name].range.slice()),Array.isArray(g[_._name+".range"])?S=g[_._name+".range"].slice():Array.isArray((g[_._name]||{}).range)&&(S=g[_._name].range.slice()),w&&T&&(b.r2l(w[0])!==b.r2l(T[0])||b.r2l(w[1])!==b.r2l(T[1]))&&(A={xr0:w,xr1:T}),k&&S&&(_.r2l(k[0])!==_.r2l(S[0])||_.r2l(k[1])!==_.r2l(S[1]))&&(E={yr0:k,yr1:S}),(A||E)&&l.push(u.extendFlat({plotinfo:x},A,E))}}return Promise.resolve()},o.runFn=function(t){var n,i,o=e._fullLayout._basePlotModules,c=l.length;if(r)for(i=0;i<o.length;i++)o[i].transitionAxes&&o[i].transitionAxes(e,l,a,t);for(var h in c?((n=u.extendFlat({},a)).duration=0,delete s.cartesian):n=a,s){var p=s[h];e._fullData[p[0]]._module.basePlotModule.plot(e,p,n,t)}},j(e,a,o)},M.transitionFromReact=function(e,t,r,n){var i=e._fullLayout,a=i.transition,o={},s=[];return o.prepareFn=function(){var e=i._plots;for(var a in o.redraw=!1,"some"===t.anim&&(o.redraw=!0),"some"===r.anim&&(o.redraw=!0),e){var l=e[a],c=l.xaxis,h=l.yaxis,p=n[c._name].range.slice(),d=n[h._name].range.slice(),f=c.range.slice(),m=h.range.slice();c.setScale(),h.setScale();var g=null,y=null;c.r2l(p[0])===c.r2l(f[0])&&c.r2l(p[1])===c.r2l(f[1])||(g={xr0:p,xr1:f}),h.r2l(d[0])===h.r2l(m[0])&&h.r2l(d[1])===h.r2l(m[1])||(y={yr0:d,yr1:m}),(g||y)&&s.push(u.extendFlat({plotinfo:l},g,y))}return Promise.resolve()},o.runFn=function(r){for(var n,i,o,l=e._fullData,c=e._fullLayout._basePlotModules,h=[],p=0;p<l.length;p++)h.push(p);function d(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].transitionAxes&&c[t].transitionAxes(e,s,n,r)}function f(){if(e._fullLayout)for(var t=0;t<c.length;t++)c[t].plot(e,o,i,r)}s.length&&t.anim?"traces first"===a.ordering?(n=u.extendFlat({},a,{duration:0}),o=h,i=a,setTimeout(d,a.duration),f()):(n=a,o=null,i=u.extendFlat({},a,{duration:0}),setTimeout(f,n.duration),d()):s.length?(n=a,d()):t.anim&&(o=h,i=a,f())},j(e,a,o)},M.doCalcdata=function(e,t){var r,n,i,a,o=d.list(e),c=e._fullData,h=e._fullLayout,f=new Array(c.length),m=(e.calcdata||[]).slice();for(e.calcdata=f,h._numBoxes=0,h._numViolins=0,h._violinScaleGroupStats={},e._hmpixcount=0,e._hmlumcount=0,h._piecolormap={},h._sunburstcolormap={},h._treemapcolormap={},h._iciclecolormap={},h._funnelareacolormap={},i=0;i<c.length;i++)Array.isArray(t)&&-1===t.indexOf(i)&&(f[i]=m[i]);for(i=0;i<c.length;i++)(r=c[i])._arrayAttrs=l.findArrayAttributes(r),r._extremes={};var g=h._subplots.polar||[];for(i=0;i<g.length;i++)o.push(h[g[i]].radialaxis,h[g[i]].angularaxis);for(var y in h._colorAxes){var v=h[y];!1!==v.cauto&&(delete v.cmin,delete v.cmax)}var x=!1;function b(t){if(r=c[t],n=r._module,!0===r.visible&&r.transforms){if(n&&n.calc){var i=n.calc(e,r);i[0]&&i[0].t&&i[0].t._scene&&delete i[0].t._scene.dirty}for(a=0;a<r.transforms.length;a++){var o=r.transforms[a];(n=transformsRegistry[o.type])&&n.calcTransform&&(r._hasCalcTransform=!0,x=!0,n.calcTransform(e,r,o))}}}function _(t,i){if(r=c[t],!!(n=r._module).isContainer===i){var o=[];if(!0===r.visible&&0!==r._length){delete r._indexToPoints;var s=r.transforms||[];for(a=s.length-1;a>=0;a--)if(s[a].enabled){r._indexToPoints=s[a]._indexToPoints;break}n&&n.calc&&(o=n.calc(e,r))}Array.isArray(o)&&o[0]||(o=[{x:p,y:p}]),o[0].t||(o[0].t={}),o[0].trace=r,f[t]=o}}for(B(o,c,h),i=0;i<c.length;i++)_(i,!0);for(i=0;i<c.length;i++)b(i);for(x&&B(o,c,h),i=0;i<c.length;i++)_(i,!0);for(i=0;i<c.length;i++)_(i,!1);U(e);var w=function(e,t){var r,n,i,a,o,l=[];function c(e,r,n){var i=r._id.charAt(0);if("histogram2dcontour"===e){var a=r._counterAxes[0],o=d.getFromId(t,a),s="x"===i||"x"===a&&"category"===o.type,l="y"===i||"y"===a&&"category"===o.type;return function(e,t){return 0===e||0===t||s&&e===n[t].length-1||l&&t===n.length-1?-1:("y"===i?t:e)-1}}return function(e,t){return"y"===i?t:e}}var h={min:function(e){return u.aggNums(Math.min,null,e)},max:function(e){return u.aggNums(Math.max,null,e)},sum:function(e){return u.aggNums((function(e,t){return e+t}),null,e)},total:function(e){return u.aggNums((function(e,t){return e+t}),null,e)},mean:function(e){return u.mean(e)},"geometric mean":function(e){return u.geometricMean(e)},median:function(e){return u.median(e)}};function p(e,t){return e[1]-t[1]}function f(e,t){return t[1]-e[1]}for(r=0;r<e.length;r++){var m=e[r];if("category"===m.type){var g=m.categoryorder.match(F);if(g){var y=g[1],v=g[2],x=m._id.charAt(0),b="x"===x,_=[];for(n=0;n<m._categories.length;n++)_.push([m._categories[n],[]]);for(n=0;n<m._traceIndices.length;n++){var w=m._traceIndices[n],k=t._fullData[w];if(!0===k.visible){var T=k.type;s.traceIs(k,"histogram")&&(delete k._xautoBinFinished,delete k._yautoBinFinished);var S="splom"===T,A="scattergl"===T,M=t.calcdata[w];for(i=0;i<M.length;i++){var E,C,P=M[i];if(S){var L=k._axesDim[m._id];if(!b){var I=k._diag[L][0];I&&(m=t._fullLayout[d.id2name(I)])}var z=P.trace.dimensions[L].values;for(a=0;a<z.length;a++)for(E=m._categoriesMap[z[a]],o=0;o<P.trace.dimensions.length;o++)if(o!==L){var O=P.trace.dimensions[o];_[E][1].push(O.values[a])}}else if(A){for(a=0;a<P.t.x.length;a++)b?(E=P.t.x[a],C=P.t.y[a]):(E=P.t.y[a],C=P.t.x[a]),_[E][1].push(C);P.t&&P.t._scene&&delete P.t._scene.dirty}else if(P.hasOwnProperty("z")){C=P.z;var R=c(k.type,m,C);for(a=0;a<C.length;a++)for(o=0;o<C[a].length;o++)(E=R(o,a))+1&&_[E][1].push(C[a][o])}else for(void 0===(E=P.p)&&(E=P[x]),void 0===(C=P.s)&&(C=P.v),void 0===C&&(C=b?P.y:P.x),Array.isArray(C)||(C=void 0===C?[]:[C]),a=0;a<C.length;a++)_[E][1].push(C[a])}}}m._categoriesValue=_;var D=[];for(n=0;n<_.length;n++)D.push([_[n][0],h[y](_[n][1])]);D.sort("descending"===v?f:p),m._categoriesAggregatedValue=D,m._initialCategories=D.map((function(e){return e[0]})),l=l.concat(m.sortByInitialCategories())}}}return l}(o,e);if(w.length){for(h._numBoxes=0,h._numViolins=0,i=0;i<w.length;i++)_(w[i],!0);for(i=0;i<w.length;i++)_(w[i],!1);U(e)}s.getComponentMethod("fx","calc")(e),s.getComponentMethod("errorbars","calc")(e)};var F=/(total|sum|min|max|mean|geometric mean|median) (ascending|descending)/;function B(e,t,r){var n={};function i(e){e.clearCalc(),"multicategory"===e.type&&e.setupMultiCategory(t),n[e._id]=1}u.simpleMap(e,i);for(var a=r._axisMatchGroups||[],o=0;o<a.length;o++)for(var s in a[o])n[s]||i(r[d.id2name(s)])}function U(e){var t,r,n,i=e._fullLayout,a=i._visibleModules,o={};for(r=0;r<a.length;r++){var s=a[r],l=s.crossTraceCalc;if(l){var c=s.basePlotModule.name;o[c]?u.pushUnique(o[c],l):o[c]=[l]}}for(n in o){var h=o[n],p=i._subplots[n];if(Array.isArray(p))for(t=0;t<p.length;t++){var d=p[t],f="cartesian"===n?i._plots[d]:i[d];for(r=0;r<h.length;r++)h[r](e,f,d)}else for(r=0;r<h.length;r++)h[r](e)}}M.rehover=function(e){e._fullLayout._rehover&&e._fullLayout._rehover()},M.redrag=function(e){e._fullLayout._redrag&&e._fullLayout._redrag()},M.reselect=function(e){var t=e._fullLayout,r=(e.layout||{}).selections,n=t._previousSelections;t._previousSelections=r;var i=t._reselect||JSON.stringify(r)!==JSON.stringify(n);s.getComponentMethod("selections","reselect")(e,i)},M.generalUpdatePerTraceModule=function(e,t,r,n){var i,a=t.traceHash,o={};for(i=0;i<r.length;i++){var s=r[i],l=s[0].trace;l.visible&&(o[l.type]=o[l.type]||[],o[l.type].push(s))}for(var c in a)if(!o[c]){var h=a[c][0];h[0].trace.visible=!1,o[c]=[h]}for(var p in o){var d=o[p];d[0][0].trace._module.plot(e,t,u.filterVisible(d),n)}t.traceHash=o},M.plotBasePlot=function(e,t,r,n,i){var a=s.getModule(e),o=x(t.calcdata,a)[0];a.plot(t,o,n,i)},M.cleanBasePlot=function(e,t,r,n,i){var a=i._has&&i._has(e),o=r._has&&r._has(e);a&&!o&&i["_"+e+"layer"].selectAll("g.trace").remove()}}}),Tt=p({"src/constants/xmlns_namespaces.js"(e){e.xmlns="http://www.w3.org/2000/xmlns/",e.svg="http://www.w3.org/2000/svg",e.xlink="http://www.w3.org/1999/xlink",e.svgAttrs={xmlns:e.svg,"xmlns:xlink":e.xlink}}}),St=p({"src/constants/alignment.js"(e,t){t.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"}}}}),At=p({"src/lib/svg_text_utils.js"(e){var t=v(),r=st(),n=r.strTranslate,i=Tt(),a=St().LINE_SPACING,o=/([^$]*)([$]+[^$]*[$]+)([^$]*)/;e.convertToTspans=function(f,v,A){var M=f.text(),P=!f.attr("data-notex")&&v&&v._context.typesetMath&&"undefined"!==typeof MathJax&&M.match(o),L=t.select(f.node().parentNode);if(!L.empty()){var I=f.attr("class")?f.attr("class").split(" ")[0]:"text";return I+="-math",L.selectAll("svg."+I).remove(),L.selectAll("g."+I+"-group").remove(),f.style("display",null).attr({"data-unformatted":M,"data-math":"N"}),P?(v&&v._promises||[]).push(new Promise((function(e){f.style("display","none");var i=parseInt(f.node().style.fontSize,10),a={fontSize:i};!function(e,n,i){var a,o,u,h,p=parseInt((MathJax.version||"").split(".")[0]);if(2===p||3===p){var d=function(){return o=r.extendDeepAll({},MathJax.Hub.config),u=MathJax.Hub.processSectionDelay,void 0!==MathJax.Hub.processSectionDelay&&(MathJax.Hub.processSectionDelay=0),MathJax.Hub.Config({messageStyle:"none",tex2jax:{inlineMath:c},displayAlign:"left"})},f=function(){o=r.extendDeepAll({},MathJax.config),MathJax.config.tex||(MathJax.config.tex={}),MathJax.config.tex.inlineMath=c},m=function(){if("SVG"!==(a=MathJax.Hub.config.menuSettings.renderer))return MathJax.Hub.setRenderer("SVG")},g=function(){"svg"!==(a=MathJax.config.startup.output)&&(MathJax.config.startup.output="svg")},y=function(){var i="math-output-"+r.randstr({},64),a=(h=t.select("body").append("div").attr({id:i}).style({visibility:"hidden",position:"absolute","font-size":n.fontSize+"px"}).text(e.replace(s,"\\lt ").replace(l,"\\gt "))).node();return 2===p?MathJax.Hub.Typeset(a):MathJax.typeset([a])},v=function(){var n=h.select(2===p?".MathJax_SVG":".MathJax"),a=!n.empty()&&h.select("svg").node();if(a){var o,s=a.getBoundingClientRect();o=2===p?t.select("body").select("#MathJax_SVG_glyphs"):n.select("defs"),i(n,o,s)}else r.log("There was an error in the tex syntax.",e),i();h.remove()},x=function(){if("SVG"!==a)return MathJax.Hub.setRenderer(a)},b=function(){"svg"!==a&&(MathJax.config.startup.output=a)},_=function(){return void 0!==u&&(MathJax.Hub.processSectionDelay=u),MathJax.Hub.Config(o)},w=function(){MathJax.config=o};2===p?MathJax.Hub.Queue(d,m,y,v,x,_):3===p&&(f(),g(),MathJax.startup.defaultReady(),MathJax.startup.promise.then((function(){y(),v(),b(),w()})))}else r.warn("No MathJax version:",MathJax.version)}(P[2],a,(function(t,r,a){L.selectAll("svg."+I).remove(),L.selectAll("g."+I+"-group").remove();var o=t&&t.select("svg");if(!o||!o.node())return z(),void e();var s=L.append("g").classed(I+"-group",!0).attr({"pointer-events":"none","data-unformatted":M,"data-math":"Y"});s.node().appendChild(o.node()),r&&r.node()&&o.node().insertBefore(r.node().cloneNode(!0),o.node().firstChild);var l=a.width,c=a.height;o.attr({class:I,height:c,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var u=f.node().style.fill||"black",h=o.select("g");h.attr({fill:u,stroke:u});var p=h.node().getBoundingClientRect(),d=p.width,m=p.height;(d>l||m>c)&&(o.style("overflow","hidden"),d=(p=o.node().getBoundingClientRect()).width,m=p.height);var g=+f.attr("x"),y=+f.attr("y"),v=-(i||f.node().getBoundingClientRect().height)/4;if("y"===I[0])s.attr({transform:"rotate("+[-90,g,y]+")"+n(-d/2,v-m/2)});else if("l"===I[0])y=v-m/2;else if("a"===I[0]&&0!==I.indexOf("atitle"))g=0,y=v;else{var x=f.attr("text-anchor");g-=d*("middle"===x?.5:"end"===x?1:0),y=y+v-m/2}o.attr({x:g,y:y}),A&&A.call(f,s),e(s)}))}))):z(),f}function z(){L.empty()||(I=f.attr("class")+"-math",L.select("svg."+I).remove()),f.text("").style("white-space","pre");var n=function(e,n){n=n.replace(m," ");var o,s=!1,l=[],c=-1;function f(){c++;var r=document.createElementNS(i.svg,"tspan");t.select(r).attr({class:"line",dy:c*a+"em"}),e.appendChild(r),o=r;var n=l;if(l=[{node:r}],n.length>1)for(var s=1;s<n.length;s++)v(n[s])}function v(e){var r,n=e.type,a={};if("a"===n){r="a";var s=e.target,c=e.href,u=e.popup;c&&(a={"xlink:xlink:show":"_blank"===s||"_"!==s.charAt(0)?"new":"replace",target:s,"xlink:xlink:href":c},u&&(a.onclick='window.open(this.href.baseVal,this.target.baseVal,"'+u+'");return false;'))}else r="tspan";e.style&&(a.style=e.style);var f=document.createElementNS(i.svg,r);if("sup"===n||"sub"===n){A(o,d),o.appendChild(f);var m=document.createElementNS(i.svg,"tspan");A(m,d),t.select(m).attr("dy",p[n]),a.dy=h[n],o.appendChild(f),o.appendChild(m)}else o.appendChild(f);t.select(f).attr(a),o=e.node=f,l.push(e)}function A(e,t){e.appendChild(document.createTextNode(t))}function M(e){if(1!==l.length){var t=l.pop();e!==t.type&&r.log("Start tag <"+t.type+"> doesnt match end tag <"+e+">. Pretending it did match.",n),o=l[l.length-1].node}else r.log("Ignoring unexpected end tag </"+e+">.",n)}var P=x.test(n);P?f():(o=e,l=[{node:e}]);for(var L=n.split(g),I=0;I<L.length;I++){var z=L[I],O=z.match(y),R=O&&O[2].toLowerCase(),D=u[R];if("br"===R)f();else if(void 0===D)A(o,E(z));else if(O[1])M(R);else{var j=O[4],F={type:R},B=T(j,b);if(B?(B=B.replace(S,"$1 fill:"),D&&(B+=";"+D)):D&&(B=D),B&&(F.style=B),"a"===R){s=!0;var N=T(j,_);if(N){var U=C(N);U&&(F.href=U,F.target=T(j,w)||"_blank",F.popup=T(j,k))}}v(F)}}return s}(f.node(),M);n&&f.style("pointer-events","all"),e.positionText(f),A&&A.call(f)}};var s=/(<|&lt;|&#60;)/g,l=/(>|&gt;|&#62;)/g,c=[["$","$"],["\\(","\\)"]],u={sup:"font-size:70%",sub:"font-size:70%",s:"text-decoration:line-through",u:"text-decoration:underline",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},h={sub:"0.3em",sup:"-0.6em"},p={sub:"-0.21em",sup:"0.42em"},d="\u200b",f=["http:","https:","mailto:","",void 0,":"],m=e.NEWLINES=/(\r\n?|\n)/g,g=/(<[^<>]*>)/,y=/<(\/?)([^ >]*)(\s+(.*))?>/i,x=/<br(\s+.*)?>/i;e.BR_TAG_ALL=/<br(\s+.*)?>/gi;var b=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,_=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,w=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,k=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i;function T(e,t){if(!e)return null;var r=e.match(t),n=r&&(r[3]||r[4]);return n&&E(n)}var S=/(^|;)\s*color:/;e.plainText=function(e,t){for(var r=void 0!==(t=t||{}).len&&-1!==t.len?t.len:1/0,n=void 0!==t.allowedTags?t.allowedTags:["br"],i=e.split(g),a=[],o="",s=0,l=0;l<i.length;l++){var c=i[l],u=c.match(y),h=u&&u[2].toLowerCase();if(h)-1!==n.indexOf(h)&&(a.push(c),o=h);else{var p=c.length;if(s+p<r)a.push(c),s+=p;else if(s<r){var d=r-s;o&&("br"!==o||d<=3||p<=3)&&a.pop(),r>3?a.push(c.substr(0,d-3)+"..."):a.push(c.substr(0,d));break}o=""}}return a.join("")};var A={mu:"\u03bc",amp:"&",lt:"<",gt:">",nbsp:"\xa0",times:"\xd7",plusmn:"\xb1",deg:"\xb0"},M=/&(#\d+|#x[\da-fA-F]+|[a-z]+);/g;function E(e){return e.replace(M,(function(e,t){return("#"===t.charAt(0)?function(e){if(!(e>1114111)){var t=String.fromCodePoint;if(t)return t(e);var r=String.fromCharCode;return e<=65535?r(e):r(55232+(e>>10),e%1024+56320)}}("x"===t.charAt(1)?parseInt(t.substr(2),16):parseInt(t.substr(1),10)):A[t])||e}))}function C(e){var t=encodeURI(decodeURI(e)),r=document.createElement("a"),n=document.createElement("a");r.href=e,n.href=t;var i=r.protocol,a=n.protocol;return-1!==f.indexOf(i)&&-1!==f.indexOf(a)?t:""}function P(e,t,n){var i,a,o,s=n.horizontalAlign,l=n.verticalAlign||"top",c=e.node().getBoundingClientRect(),u=t.node().getBoundingClientRect();return a="bottom"===l?function(){return c.bottom-i.height}:"middle"===l?function(){return c.top+(c.height-i.height)/2}:function(){return c.top},o="right"===s?function(){return c.right-i.width}:"center"===s?function(){return c.left+(c.width-i.width)/2}:function(){return c.left},function(){i=this.node().getBoundingClientRect();var e=o()-u.left,t=a()-u.top,s=n.gd||{};if(n.gd){s._fullLayout._calcInverseTransform(s);var l=r.apply3DTransform(s._fullLayout._invTransform)(e,t);e=l[0],t=l[1]}return this.style({top:t+"px",left:e+"px","z-index":1e3}),this}}e.convertEntities=E,e.sanitizeHTML=function(e){e=e.replace(m," ");for(var r=document.createElement("p"),n=r,i=[],a=e.split(g),o=0;o<a.length;o++){var s=a[o],l=s.match(y),c=l&&l[2].toLowerCase();if(c in u)if(l[1])i.length&&(n=i.pop());else{var h=l[4],p=T(h,b),d=p?{style:p}:{};if("a"===c){var f=T(h,_);if(f){var v=C(f);if(v){d.href=v;var x=T(h,w);x&&(d.target=x)}}}var k=document.createElement(c);n.appendChild(k),t.select(k).attr(d),n=k,i.push(k)}else n.appendChild(document.createTextNode(E(s)))}return r.innerHTML},e.lineCount=function(e){return e.selectAll("tspan.line").size()||1},e.positionText=function(e,r,n){return e.each((function(){var e=t.select(this);function i(t,r){return void 0===r?null===(r=e.attr(t))&&(e.attr(t,0),r=0):e.attr(t,r),r}var a=i("x",r),o=i("y",n);"text"===this.nodeName&&e.selectAll("tspan.line").attr({x:a,y:o})}))};var L="1px ";e.makeTextShadow=function(e){return L+L+L+e+", -"+L+"-"+L+L+e+", "+L+"-"+L+L+e+", -"+L+L+L+e},e.makeEditable=function(e,r){var n=r.gd,i=r.delegate,a=t.dispatch("edit","input","cancel"),o=i||e;if(e.style({"pointer-events":i?"none":"all"}),1!==e.size())throw new Error("boo");function s(){!function(){var i=t.select(n).select(".svg-container"),o=i.append("div"),s=e.node().style,c=parseFloat(s.fontSize||12),u=r.text;void 0===u&&(u=e.attr("data-unformatted")),o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":s.fontFamily||"Arial","font-size":c,color:r.fill||s.fill||"black",opacity:1,"background-color":r.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(u).call(P(e,i,r)).on("blur",(function(){n._editing=!1,e.text(this.textContent).style({opacity:1});var r,i=t.select(this).attr("class");(r=i?"."+i.split(" ")[0]+"-math-group":"[class*=-math-group]")&&t.select(e.node().parentNode).select(r).style({opacity:0});var o=this.textContent;t.select(this).transition().duration(0).remove(),t.select(document).on("mouseup",null),a.edit.call(e,o)})).on("focus",(function(){var e=this;n._editing=!0,t.select(document).on("mouseup",(function(){if(t.event.target===e)return!1;document.activeElement===o.node()&&o.node().blur()}))})).on("keyup",(function(){27===t.event.which?(n._editing=!1,e.style({opacity:1}),t.select(this).style({opacity:0}).on("blur",(function(){return!1})).transition().remove(),a.cancel.call(e,this.textContent)):(a.input.call(e,this.textContent),t.select(this).call(P(e,i,r)))})).on("keydown",(function(){13===t.event.which&&this.blur()})).call(l)}(),e.style({opacity:0});var i,s=o.attr("class");(i=s?"."+s.split(" ")[0]+"-math-group":"[class*=-math-group]")&&t.select(e.node().parentNode).select(i).style({opacity:0})}function l(e){var t=e.node(),r=document.createRange();r.selectNodeContents(t);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),t.focus()}return r.immediate?s():o.on("click",s),t.rebind(e,a,"on")}}}),Mt=p({"src/components/colorscale/helpers.js"(e,t){var r=v(),n=O(),i=k(),a=st(),o=q(),s=U().isValid,l=["showscale","autocolorscale","colorscale","reversescale","colorbar"],c=["min","max","mid","auto"];function u(e){var t,r,n,i=e._colorAx,a=i||e,o={};for(r=0;r<l.length;r++)o[n=l[r]]=a[n];if(i)for(t="c",r=0;r<c.length;r++)o[n=c[r]]=a["c"+n];else{var s;for(r=0;r<c.length;r++)((s="c"+(n=c[r]))in a||(s="z"+n)in a)&&(o[n]=a[s]);t=s.charAt(0)}return o._sync=function(e,r){var n=-1!==c.indexOf(e)?t+e:e;a[n]=a["_"+n]=r},o}function h(e){for(var t=u(e),r=t.min,n=t.max,i=t.reversescale?p(t.colorscale):t.colorscale,a=i.length,o=new Array(a),s=new Array(a),l=0;l<a;l++){var c=i[l];o[l]=r+c[0]*(n-r),s[l]=c[1]}return{domain:o,range:s}}function p(e){for(var t=e.length,r=new Array(t),n=t-1,i=0;n>=0;n--,i++){var a=e[n];r[i]=[1-a[0],a[1]]}return r}function d(e,t){t=t||{};for(var a=e.domain,s=e.range,l=s.length,c=new Array(l),u=0;u<l;u++){var h=n(s[u]).toRgb();c[u]=[h.r,h.g,h.b,h.a]}var p,d=r.scale.linear().domain(a).range(c).clamp(!0),m=t.noNumericCheck,g=t.returnArray;return(p=m&&g?d:m?function(e){return f(d(e))}:g?function(e){return i(e)?d(e):n(e).isValid()?e:o.defaultLine}:function(e){return i(e)?f(d(e)):n(e).isValid()?e:o.defaultLine}).domain=d.domain,p.range=function(){return s},p}function f(e){var t={r:e[0],g:e[1],b:e[2],a:e[3]};return n(t).toRgbString()}t.exports={hasColorscale:function(e,t,r){var n=t?a.nestedProperty(e,t).get()||{}:e,o=n[r||"color"];o&&o._inputArray&&(o=o._inputArray);var l=!1;if(a.isArrayOrTypedArray(o))for(var c=0;c<o.length;c++)if(i(o[c])){l=!0;break}return a.isPlainObject(n)&&(l||!0===n.showscale||i(n.cmin)&&i(n.cmax)||s(n.colorscale)||a.isPlainObject(n.colorbar))},extractOpts:u,extractScale:h,flipScale:p,makeColorScaleFunc:d,makeColorScaleFuncFromTrace:function(e,t){return d(h(e),t)}}}}),Et=p({"src/plots/cartesian/axis_format_attributes.js"(e,t){var r=ze(),n=r.FORMAT_LINK,i=r.DATE_FORMAT_LINK;function a(e,t){return["Sets the "+e+" formatting rule"+(t?"for `"+t+"` ":""),"using d3 formatting mini-languages","which are very similar to those in Python. For numbers, see: "+n+"."].join(" ")}function o(e,t){return a(e,t)+[" And for dates see: "+i+".","We add two items to d3's date formatter:","*%h* for half of the year as a decimal number as well as","*%{n}f* for fractional seconds","with n digits. For example, *2016-10-13 09:15:23.456* with tickformat","*%H~%M~%S.%2f* would display *09~15~23.46*"].join(" ")}t.exports={axisHoverFormat:function(e,t){return{valType:"string",dflt:"",editType:"none",description:(t?a:o)("hover text",e)+["By default the values are formatted using "+(t?"generic number format":"`"+e+"axis.hoverformat`")+"."].join(" ")}},descriptionOnlyNumbers:a,descriptionWithDates:o}}}),Ct=p({"src/plots/cartesian/layout_attributes.js"(e,t){var r=D(),n=V(),i=Ie().dash,a=R().extendFlat,o=gt().templatedArray,s=Et().descriptionWithDates,l=T().ONEDAY,c=yt(),u=c.HOUR_PATTERN,h=c.WEEKDAY_PATTERN,p={valType:"enumerated",values:["auto","linear","array"],editType:"ticks",impliedEdits:{tick0:void 0,dtick:void 0}},d=a({},p,{values:p.values.slice().concat(["sync"])});function f(e){return{valType:"integer",min:0,dflt:e?5:0,editType:"ticks"}}var m={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},g={valType:"any",editType:"ticks",impliedEdits:{tickmode:"linear"}},y={valType:"data_array",editType:"ticks"},v={valType:"enumerated",values:["outside","inside",""],editType:"ticks"};function x(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=5),t}function b(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=1),t}var _={valType:"color",dflt:n.defaultLine,editType:"ticks"},w={valType:"color",dflt:n.lightLine,editType:"ticks"};function k(e){var t={valType:"number",min:0,editType:"ticks"};return e||(t.dflt=1),t}var S=a({},i,{editType:"ticks"}),A={valType:"boolean",editType:"ticks"};t.exports={visible:{valType:"boolean",editType:"plot"},color:{valType:"color",dflt:n.defaultLine,editType:"ticks"},title:{text:{valType:"string",editType:"ticks"},font:r({editType:"ticks"}),standoff:{valType:"number",min:0,editType:"ticks"},editType:"ticks"},type:{valType:"enumerated",values:["-","linear","log","date","category","multicategory"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:{valType:"enumerated",values:["convert types","strict"],dflt:"convert types",editType:"calc"},autorange:{valType:"enumerated",values:[!0,!1,"reversed","min reversed","max reversed","min","max"],dflt:!0,editType:"axrange",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},autorangeoptions:{minallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmin:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},clipmax:{valType:"any",editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},include:{valType:"any",arrayOk:!0,editType:"plot",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},editType:"plot"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"plot"},range:{valType:"info_array",items:[{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0},{valType:"any",editType:"axrange",impliedEdits:{"^autorange":!1},anim:!0}],editType:"axrange",impliedEdits:{autorange:!1},anim:!0},minallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},maxallowed:{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},insiderange:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},scaleanchor:{valType:"enumerated",values:[c.idRegex.x.toString(),c.idRegex.y.toString(),!1],editType:"plot"},scaleratio:{valType:"number",min:0,dflt:1,editType:"plot"},constrain:{valType:"enumerated",values:["range","domain"],editType:"plot"},constraintoward:{valType:"enumerated",values:["left","center","right","top","middle","bottom"],editType:"plot"},matches:{valType:"enumerated",values:[c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"calc"},rangebreaks:o("rangebreak",{enabled:{valType:"boolean",dflt:!0,editType:"calc"},bounds:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},pattern:{valType:"enumerated",values:[h,u,""],editType:"calc"},values:{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"any",editType:"calc"}},dvalue:{valType:"number",editType:"calc",min:0,dflt:l},editType:"calc"}),tickmode:d,nticks:f(),tick0:m,dtick:g,ticklabelstep:{valType:"integer",min:1,dflt:1,editType:"ticks"},tickvals:y,ticktext:{valType:"data_array",editType:"ticks"},ticks:v,tickson:{valType:"enumerated",values:["labels","boundaries"],dflt:"labels",editType:"ticks"},ticklabelmode:{valType:"enumerated",values:["instant","period"],dflt:"instant",editType:"ticks"},ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside",editType:"calc"},ticklabeloverflow:{valType:"enumerated",values:["allow","hide past div","hide past domain"],editType:"calc"},ticklabelshift:{valType:"integer",dflt:0,editType:"ticks"},ticklabelstandoff:{valType:"integer",dflt:0,editType:"ticks"},ticklabelindex:{valType:"integer",arrayOk:!0,editType:"calc"},mirror:{valType:"enumerated",values:[!0,"ticks",!1,"all","allticks"],dflt:!1,editType:"ticks+layoutstyle"},ticklen:x(),tickwidth:b(),tickcolor:_,showticklabels:{valType:"boolean",dflt:!0,editType:"ticks"},labelalias:{valType:"any",dflt:!1,editType:"ticks"},automargin:{valType:"flaglist",flags:["height","width","left","right","top","bottom"],extras:[!0,!1],dflt:!1,editType:"ticks"},showspikes:{valType:"boolean",dflt:!1,editType:"modebar"},spikecolor:{valType:"color",dflt:null,editType:"none"},spikethickness:{valType:"number",dflt:3,editType:"none"},spikedash:a({},i,{dflt:"dash",editType:"none"}),spikemode:{valType:"flaglist",flags:["toaxis","across","marker"],dflt:"toaxis",editType:"none"},spikesnap:{valType:"enumerated",values:["data","cursor","hovered data"],dflt:"hovered data",editType:"none"},tickfont:r({editType:"ticks"}),tickangle:{valType:"angle",dflt:"auto",editType:"ticks"},autotickangles:{valType:"info_array",freeLength:!0,items:{valType:"angle"},dflt:[0,30,90],editType:"ticks"},tickprefix:{valType:"string",dflt:"",editType:"ticks"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},ticksuffix:{valType:"string",dflt:"",editType:"ticks"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"ticks"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"ticks"},minexponent:{valType:"number",dflt:3,min:0,editType:"ticks"},separatethousands:{valType:"boolean",dflt:!1,editType:"ticks"},tickformat:{valType:"string",dflt:"",editType:"ticks",description:s("tick label")},tickformatstops:o("tickformatstop",{enabled:{valType:"boolean",dflt:!0,editType:"ticks"},dtickrange:{valType:"info_array",items:[{valType:"any",editType:"ticks"},{valType:"any",editType:"ticks"}],editType:"ticks"},value:{valType:"string",dflt:"",editType:"ticks"},editType:"ticks"}),hoverformat:{valType:"string",dflt:"",editType:"none",description:s("hover text")},showline:{valType:"boolean",dflt:!1,editType:"ticks+layoutstyle"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"layoutstyle"},linewidth:{valType:"number",min:0,dflt:1,editType:"ticks+layoutstyle"},showgrid:A,gridcolor:w,gridwidth:k(),griddash:S,zeroline:{valType:"boolean",editType:"ticks"},zerolinecolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},zerolinewidth:{valType:"number",dflt:1,editType:"ticks"},showdividers:{valType:"boolean",dflt:!0,editType:"ticks"},dividercolor:{valType:"color",dflt:n.defaultLine,editType:"ticks"},dividerwidth:{valType:"number",dflt:1,editType:"ticks"},anchor:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},side:{valType:"enumerated",values:["top","bottom","left","right"],editType:"plot"},overlaying:{valType:"enumerated",values:["free",c.idRegex.x.toString(),c.idRegex.y.toString()],editType:"plot"},minor:{tickmode:p,nticks:f("minor"),tick0:m,dtick:g,tickvals:y,ticks:v,ticklen:x("minor"),tickwidth:b("minor"),tickcolor:_,gridcolor:w,gridwidth:k("minor"),griddash:S,showgrid:A,editType:"ticks"},layer:{valType:"enumerated",values:["above traces","below traces"],dflt:"above traces",editType:"plot"},domain:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},position:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},autoshift:{valType:"boolean",dflt:!1,editType:"plot"},shift:{valType:"number",editType:"plot"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array","total ascending","total descending","min ascending","min descending","max ascending","max descending","sum ascending","sum descending","mean ascending","mean descending","geometric mean ascending","geometric mean descending","median ascending","median descending"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),Pt=p({"src/components/colorbar/attributes.js"(e,t){var r=Ct(),n=D(),i=R().extendFlat,a=Le().overrideAll;t.exports=a({orientation:{valType:"enumerated",values:["h","v"],dflt:"v"},thicknessmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels"},thickness:{valType:"number",min:0,dflt:30},lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["left","center","right"]},xpad:{valType:"number",min:0,dflt:10},y:{valType:"number"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["top","middle","bottom"]},ypad:{valType:"number",min:0,dflt:10},outlinecolor:r.linecolor,outlinewidth:r.linewidth,bordercolor:r.linecolor,borderwidth:{valType:"number",min:0,dflt:0},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)"},tickmode:r.minor.tickmode,nticks:r.nticks,tick0:r.tick0,dtick:r.dtick,tickvals:r.tickvals,ticktext:r.ticktext,ticks:i({},r.ticks,{dflt:""}),ticklabeloverflow:i({},r.ticklabeloverflow,{}),ticklabelposition:{valType:"enumerated",values:["outside","inside","outside top","inside top","outside left","inside left","outside right","inside right","outside bottom","inside bottom"],dflt:"outside"},ticklen:r.ticklen,tickwidth:r.tickwidth,tickcolor:r.tickcolor,ticklabelstep:r.ticklabelstep,showticklabels:r.showticklabels,labelalias:r.labelalias,tickfont:n({}),tickangle:r.tickangle,tickformat:r.tickformat,tickformatstops:r.tickformatstops,tickprefix:r.tickprefix,showtickprefix:r.showtickprefix,ticksuffix:r.ticksuffix,showticksuffix:r.showticksuffix,separatethousands:r.separatethousands,exponentformat:r.exponentformat,minexponent:r.minexponent,showexponent:r.showexponent,title:{text:{valType:"string"},font:n({}),side:{valType:"enumerated",values:["right","top","bottom"]}}},"colorbars","from-root")}}),Lt=p({"src/components/colorscale/attributes.js"(e,t){var r=Pt(),n=G().counter,i=We(),a=U().scales;function o(e){return"`"+e+"`"}i(a),t.exports=function(e,t){e=e||"";var i,s=(t=t||{}).cLetter||"c",l=("onlyIfNumerical"in t?t.onlyIfNumerical:Boolean(e),"noScale"in t?t.noScale:"marker.line"===e),c="showScaleDflt"in t?t.showScaleDflt:"z"===s,u="string"===typeof t.colorscaleDflt?a[t.colorscaleDflt]:null,h=t.editTypeOverride||"",p=e?e+".":"";"colorAttr"in t?(i=t.colorAttr,t.colorAttr):o(p+(i={z:"z",c:"color"}[s]));var d=s+"auto",f=s+"min",m=s+"max",g=s+"mid",y=(o(p+d),o(p+f),o(p+m),{});y[f]=y[m]=void 0;var v={};v[d]=!1;var x={};return"color"===i&&(x.color={valType:"color",arrayOk:!0,editType:h||"style"},t.anim&&(x.color.anim=!0)),x[d]={valType:"boolean",dflt:!0,editType:"calc",impliedEdits:y},x[f]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[m]={valType:"number",dflt:null,editType:h||"plot",impliedEdits:v},x[g]={valType:"number",dflt:null,editType:"calc",impliedEdits:y},x.colorscale={valType:"colorscale",editType:"calc",dflt:u,impliedEdits:{autocolorscale:!1}},x.autocolorscale={valType:"boolean",dflt:!1!==t.autoColorDflt,editType:"calc",impliedEdits:{colorscale:void 0}},x.reversescale={valType:"boolean",dflt:!1,editType:"plot"},l||(x.showscale={valType:"boolean",dflt:c,editType:"calc"},x.colorbar=r),t.noColorAxis||(x.coloraxis={valType:"subplotid",regex:n("coloraxis"),dflt:null,editType:"calc"}),x}}}),It=p({"src/components/colorscale/layout_attributes.js"(e,t){var r=R().extendFlat,n=Lt(),i=U().scales;t.exports={editType:"calc",colorscale:{editType:"calc",sequential:{valType:"colorscale",dflt:i.Reds,editType:"calc"},sequentialminus:{valType:"colorscale",dflt:i.Blues,editType:"calc"},diverging:{valType:"colorscale",dflt:i.RdBu,editType:"calc"}},coloraxis:r({_isSubplotObj:!0,editType:"calc"},n("",{colorAttr:"corresponding trace color array(s)",noColorAxis:!0,showScaleDflt:!0}))}}}),zt=p({"src/components/colorbar/has_colorbar.js"(e,t){var r=st();t.exports=function(e){return r.isPlainObject(e.colorbar)}}}),Ot=p({"src/plots/cartesian/clean_ticks.js"(e){var t=k(),r=st(),n=T(),i=n.ONEDAY,a=n.ONEWEEK;e.dtick=function(e,r){var n="log"===r,a="date"===r,o="category"===r,s=a?i:1;if(!e)return s;if(t(e))return(e=Number(e))<=0?s:o?Math.max(1,Math.round(e)):a?Math.max(.1,e):e;if("string"!==typeof e||!a&&!n)return s;var l=e.charAt(0),c=e.substr(1);return(c=t(c)?Number(c):0)<=0||!(a&&"M"===l&&c===Math.round(c)||n&&"L"===l||n&&"D"===l&&(1===c||2===c))?s:e},e.tick0=function(e,n,i,o){return"date"===n?r.cleanDate(e,r.dateTick0(i,o%a===0?1:0)):"D1"!==o&&"D2"!==o?t(e)?Number(e):0:void 0}}}),Rt=p({"src/plots/cartesian/tick_value_defaults.js"(e,t){var r=Ot(),n=st().isArrayOrTypedArray,i=M().isTypedArraySpec,a=M().decodeTypedArraySpec;t.exports=function(e,t,o,s,l){l||(l={});var c=l.isMinor,u=c?e.minor||{}:e,h=c?t.minor:t,p=c?"minor.":"";function d(e){var t=u[e];return i(t)&&(t=a(t)),void 0!==t?t:(h._template||{})[e]}var f=d("tick0"),m=d("dtick"),g=d("tickvals"),y=o(p+"tickmode",n(g)?"array":m?"linear":"auto");if("auto"===y||"sync"===y)o(p+"nticks");else if("linear"===y){var v=h.dtick=r.dtick(m,s);h.tick0=r.tick0(f,s,t.calendar,v)}else"multicategory"!==s&&(void 0===o(p+"tickvals")?h.tickmode="auto":c||o("ticktext"))}}}),Dt=p({"src/plots/cartesian/tick_mark_defaults.js"(e,t){var r=st(),n=Ct();t.exports=function(e,t,i,a){var o=a.isMinor,s=o?e.minor||{}:e,l=o?t.minor:t,c=o?n.minor:n,u=o?"minor.":"",h=r.coerce2(s,l,c,"ticklen",o?.6*(t.ticklen||5):void 0),p=r.coerce2(s,l,c,"tickwidth",o?t.tickwidth||1:void 0),d=r.coerce2(s,l,c,"tickcolor",(o?t.tickcolor:void 0)||l.color);i(u+"ticks",!o&&a.outerTicks||h||p||d?"outside":"")||(delete l.ticklen,delete l.tickwidth,delete l.tickcolor)}}}),jt=p({"src/plots/cartesian/show_dflt.js"(e,t){t.exports=function(e){var t=["showexponent","showtickprefix","showticksuffix"].filter((function(t){return void 0!==e[t]}));if(t.every((function(r){return e[r]===e[t[0]]}))||1===t.length)return e[t[0]]}}}),Ft=p({"src/plots/array_container_defaults.js"(e,t){var r=st(),n=gt();t.exports=function(e,t,i){var a,o,s=i.name,l=i.inclusionAttr||"visible",c=t[s],u=r.isArrayOrTypedArray(e[s])?e[s]:[],h=t[s]=[],p=n.arrayTemplater(t,s,l);for(a=0;a<u.length;a++){var d=u[a];r.isPlainObject(d)?o=p.newItem(d):(o=p.newItem({}))[l]=!1,o._index=a,!1!==o[l]&&i.handleItemDefaults(d,o,t,i),h.push(o)}var f=p.defaultItems();for(a=0;a<f.length;a++)(o=f[a])._index=h.length,i.handleItemDefaults({},o,t,i,{}),h.push(o);if(r.isArrayOrTypedArray(c)){var m=Math.min(c.length,h.length);for(a=0;a<m;a++)r.relinkPrivateKeys(h[a],c[a])}return h}}}),Bt=p({"src/plots/cartesian/tick_label_defaults.js"(e,t){var r=st(),n=q().contrast,i=Ct(),a=jt(),o=Ft();function s(e,t){function n(n,a){return r.coerce(e,t,i.tickformatstops,n,a)}n("enabled")&&(n("dtickrange"),n("value"))}t.exports=function(e,t,l,c,u){u||(u={});var h=l("labelalias");r.isPlainObject(h)||delete t.labelalias;var p=a(e);if(l("showticklabels")){u.noTicklabelshift||l("ticklabelshift"),u.noTicklabelstandoff||l("ticklabelstandoff");var d=u.font||{},f=t.color,m=-1!==(t.ticklabelposition||"").indexOf("inside")?n(u.bgColor):f&&f!==i.color.dflt?f:d.color;if(r.coerceFont(l,"tickfont",d,{overrideDflt:{color:m}}),u.noTicklabelstep||"multicategory"===c||"log"===c||l("ticklabelstep"),!u.noAng){var g=l("tickangle");u.noAutotickangles||"auto"!==g||l("autotickangles")}if("category"!==c){var y=l("tickformat");o(e,t,{name:"tickformatstops",inclusionAttr:"enabled",handleItemDefaults:s}),t.tickformatstops.length||delete t.tickformatstops,u.noExp||y||"date"===c||(l("showexponent",p),l("exponentformat"),l("minexponent"),l("separatethousands"))}}}}}),Nt=p({"src/plots/cartesian/prefix_suffix_defaults.js"(e,t){var r=jt();t.exports=function(e,t,n,i,a){a||(a={});var o=a.tickSuffixDflt,s=r(e);n("tickprefix")&&n("showtickprefix",s),n("ticksuffix",o)&&n("showticksuffix",s)}}}),Ut=p({"src/components/colorbar/defaults.js"(e,t){var r=st(),n=gt(),i=Rt(),a=Dt(),o=Bt(),s=Nt(),l=Pt();t.exports=function(e,t,c){var u=n.newContainer(t,"colorbar"),h=e.colorbar||{};function p(e,t){return r.coerce(h,u,l,e,t)}var d=c.margin||{t:0,b:0,l:0,r:0},f=c.width-d.l-d.r,m=c.height-d.t-d.b,g="v"===p("orientation"),y=p("thicknessmode");p("thickness","fraction"===y?30/(g?f:m):30);var v=p("lenmode");p("len","fraction"===v?1:g?m:f);var x,b,_,w="paper"===p("yref"),k="paper"===p("xref"),T="left";g?(_="middle",T=k?"left":"right",x=k?1.02:1,b=.5):(_=w?"bottom":"top",T="center",x=.5,b=w?1.02:1),r.coerce(h,u,{x:{valType:"number",min:k?-2:0,max:k?3:1,dflt:x}},"x"),r.coerce(h,u,{y:{valType:"number",min:w?-2:0,max:w?3:1,dflt:b}},"y"),p("xanchor",T),p("xpad"),p("yanchor",_),p("ypad"),r.noneOrAll(h,u,["x","y"]),p("outlinecolor"),p("outlinewidth"),p("bordercolor"),p("borderwidth"),p("bgcolor");var S=r.coerce(h,u,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:g?["outside","inside","outside top","inside top","outside bottom","inside bottom"]:["outside","inside","outside left","inside left","outside right","inside right"]}},"ticklabelposition");p("ticklabeloverflow",-1!==S.indexOf("inside")?"hide past domain":"hide past div"),i(h,u,p,"linear");var A=c.font,M={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,outerTicks:!1,font:A};-1!==S.indexOf("inside")&&(M.bgColor="black"),s(h,u,p,"linear",M),o(h,u,p,"linear",M),a(h,u,p,"linear",M),p("title.text",c._dfltTitle.colorbar);var E=u.showticklabels?u.tickfont:A,C=r.extendFlat({},A,{family:E.family,size:r.bigFont(E.size)});r.coerceFont(p,"title.font",C),p("title.side",g?"top":"right")}}}),Vt=p({"src/components/colorscale/defaults.js"(e,t){var r=k(),n=st(),i=zt(),a=Ut(),o=U().isValid,s=Ve().traceIs;function l(e,t){var r=t.slice(0,t.length-1);return t?n.nestedProperty(e,r).get()||{}:e}t.exports=function e(t,c,u,h,p){var d=p.prefix,f=p.cLetter,m="_module"in c,g=l(t,d),y=l(c,d),v=l(c._template||{},d)||{},x=function(){return delete t.coloraxis,delete c.coloraxis,e(t,c,u,h,p)};if(m){var b=u._colorAxes||{},_=h(d+"coloraxis");if(_){var w=s(c,"contour")&&n.nestedProperty(c,"contours.coloring").get()||"heatmap",k=b[_];return void(k?(k[2].push(x),k[0]!==w&&(k[0]=!1,n.warn(["Ignoring coloraxis:",_,"setting","as it is linked to incompatible colorscales."].join(" ")))):b[_]=[w,c,[x]])}}var T=g[f+"min"],S=g[f+"max"],A=r(T)&&r(S)&&T<S;h(d+f+"auto",!A)?h(d+f+"mid"):(h(d+f+"min"),h(d+f+"max"));var M,E,C=g.colorscale,P=v.colorscale;void 0!==C&&(M=!o(C)),void 0!==P&&(M=!o(P)),h(d+"autocolorscale",M),h(d+"colorscale"),h(d+"reversescale"),"marker.line."!==d&&(d&&m&&(E=i(g)),h(d+"showscale",E)&&(d&&v&&(y._template=v),a(g,y,u)))}}}),qt=p({"src/components/colorscale/layout_defaults.js"(e,t){var r=st(),n=gt(),i=It(),a=Vt();t.exports=function(e,t){function o(n,a){return r.coerce(e,t,i,n,a)}o("colorscale.sequential"),o("colorscale.sequentialminus"),o("colorscale.diverging");var s,l,c=t._colorAxes;function u(e,t){return r.coerce(s,l,i.coloraxis,e,t)}for(var h in c){var p=c[h];if(p[0])s=e[h]||{},(l=n.newContainer(t,h,"coloraxis"))._name=h,a(s,l,t,u,{prefix:"",cLetter:"c"});else{for(var d=0;d<p[2].length;d++)p[2][d]();delete t._colorAxes[h]}}}}}),Ht=p({"src/components/colorscale/cross_trace_defaults.js"(e,t){var r=st(),n=Mt().hasColorscale,i=Mt().extractOpts;t.exports=function(e,t){function a(e,t){var r=e["_"+t];void 0!==r&&(e[t]=r)}function o(e,n){var o=n.container?r.nestedProperty(e,n.container).get():e;if(o)if(o.coloraxis)o._colorAx=t[o.coloraxis];else{var s=i(o),l=s.auto;(l||void 0===s.min)&&a(o,n.min),(l||void 0===s.max)&&a(o,n.max),s.autocolorscale&&a(o,"colorscale")}}for(var s=0;s<e.length;s++){var l=e[s],c=l._module.colorbar;if(c)if(Array.isArray(c))for(var u=0;u<c.length;u++)o(l,c[u]);else o(l,c);n(l,"marker.line")&&o(l,{container:"marker.line",min:"cmin",max:"cmax"})}for(var h in t._colorAxes)o(t[h],{min:"cmin",max:"cmax"})}}}),Gt=p({"src/components/colorscale/calc.js"(e,t){var r=k(),n=st(),i=Mt().extractOpts;t.exports=function(e,t,a){var o,s=e._fullLayout,l=a.vals,c=a.containerStr,u=c?n.nestedProperty(t,c).get():t,h=i(u),p=!1!==h.auto,d=h.min,f=h.max,m=h.mid,g=function(){return n.aggNums(Math.min,null,l)},y=function(){return n.aggNums(Math.max,null,l)};void 0===d?d=g():p&&(d=u._colorAx&&r(d)?Math.min(d,g()):g()),void 0===f?f=y():p&&(f=u._colorAx&&r(f)?Math.max(f,y()):y()),p&&void 0!==m&&(f-m>m-d?d=m-(f-m):f-m<m-d&&(f=m+(m-d))),d===f&&(d-=.5,f+=.5),h._sync("min",d),h._sync("max",f),h.autocolorscale&&(o=d*f<0?s.colorscale.diverging:d>=0?s.colorscale.sequential:s.colorscale.sequentialminus,h._sync("colorscale",o))}}}),Wt=p({"src/components/colorscale/index.js"(e,t){var r=U(),n=Mt();t.exports={moduleType:"component",name:"colorscale",attributes:Lt(),layoutAttributes:It(),supplyLayoutDefaults:qt(),handleDefaults:Vt(),crossTraceDefaults:Ht(),calc:Gt(),scales:r.scales,defaultScale:r.defaultScale,getScale:r.get,isValidScale:r.isValid,hasColorscale:n.hasColorscale,extractOpts:n.extractOpts,extractScale:n.extractScale,flipScale:n.flipScale,makeColorScaleFunc:n.makeColorScaleFunc,makeColorScaleFuncFromTrace:n.makeColorScaleFuncFromTrace}}}),$t=p({"src/traces/scatter/subtypes.js"(e,t){var r=st(),n=M().isTypedArraySpec;t.exports={hasLines:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("lines")},hasMarkers:function(e){return e.visible&&(e.mode&&-1!==e.mode.indexOf("markers")||"splom"===e.type)},hasText:function(e){return e.visible&&e.mode&&-1!==e.mode.indexOf("text")},isBubble:function(e){var t=e.marker;return r.isPlainObject(t)&&(r.isArrayOrTypedArray(t.size)||n(t.size))}}}}),Zt=p({"src/traces/scatter/make_bubble_size_func.js"(e,t){var r=k();t.exports=function(e,t){t||(t=2);var n=e.marker,i=n.sizeref||1,a=n.sizemin||0,o="area"===n.sizemode?function(e){return Math.sqrt(e/i)}:function(e){return e/i};return function(e){var n=o(e/t);return r(n)&&n>0?Math.max(n,a):0}}}}),Xt=p({"src/components/fx/helpers.js"(e){var t=st();e.getSubplot=function(e){return e.subplot||e.xaxis+e.yaxis||e.geo},e.isTraceInSubplots=function(t,r){if("splom"===t.type){for(var n=t.xaxes||[],i=t.yaxes||[],a=0;a<n.length;a++)for(var o=0;o<i.length;o++)if(-1!==r.indexOf(n[a]+i[o]))return!0;return!1}return-1!==r.indexOf(e.getSubplot(t))},e.flat=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=t;return r},e.p2c=function(e,t){for(var r=new Array(e.length),n=0;n<e.length;n++)r[n]=e[n].p2c(t);return r},e.getDistanceFunction=function(t,r,n,i){return"closest"===t?i||e.quadrature(r,n):"x"===t.charAt(0)?r:n},e.getClosest=function(e,t,r){if(!1!==r.index)r.index>=0&&r.index<e.length?r.distance=0:r.index=!1;else for(var n=1/0,i=e.length,a=0;a<i;a++)(n=t(e[a]))<=r.distance&&(r.index=a,r.distance=n);return r},e.inbox=function(e,t,r){return e*t<0||0===e?r:1/0},e.quadrature=function(e,t){return function(r){var n=e(r),i=t(r);return Math.sqrt(n*n+i*i)}},e.makeEventData=function(t,r,n){var i="index"in t?t.index:t.pointNumber,a={data:r._input,fullData:r,curveNumber:r.index,pointNumber:i};if(r._indexToPoints){var o=r._indexToPoints[i];1===o.length?a.pointIndex=o[0]:a.pointIndices=o}else a.pointIndex=i;return r._module.eventData?a=r._module.eventData(a,t,r,n,i):("xVal"in t?a.x=t.xVal:"x"in t&&(a.x=t.x),"yVal"in t?a.y=t.yVal:"y"in t&&(a.y=t.y),t.xa&&(a.xaxis=t.xa),t.ya&&(a.yaxis=t.ya),void 0!==t.zLabelVal&&(a.z=t.zLabelVal)),e.appendArrayPointValue(a,r,i),a},e.appendArrayPointValue=function(e,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===e[c]){var u=i(t.nestedProperty(r,l).get(),a);void 0!==u&&(e[c]=u)}}},e.appendArrayMultiPointValues=function(e,r,a){var o=r._arrayAttrs;if(o)for(var s=0;s<o.length;s++){var l=o[s],c=n(l);if(void 0===e[c]){for(var u=t.nestedProperty(r,l).get(),h=new Array(a.length),p=0;p<a.length;p++)h[p]=i(u,a[p]);e[c]=h}}};var r={ids:"id",locations:"location",labels:"label",values:"value","marker.colors":"color",parents:"parent"};function n(e){return r[e]||e}function i(e,t){return Array.isArray(t)?Array.isArray(e)&&Array.isArray(e[t[0]])?e[t[0]][t[1]]:void 0:e[t]}var a={x:!0,y:!0},o={"x unified":!0,"y unified":!0};e.isUnifiedHover=function(e){return"string"===typeof e&&!!o[e]},e.isXYhover=function(e){return"string"===typeof e&&!!a[e]}}}),Yt=p({"node_modules/parse-svg-path/index.js"(e,t){t.exports=function(e){var t=[];return e.replace(n,(function(e,n,a){var o=n.toLowerCase();for(a=function(e){var t=e.match(i);return t?t.map(Number):[]}(a),"m"==o&&a.length>2&&(t.push([n].concat(a.splice(0,2))),o="l",n="m"==n?"l":"L");;){if(a.length==r[o])return a.unshift(n),t.push(a);if(a.length<r[o])throw new Error("malformed path data");t.push([n].concat(a.splice(0,r[o])))}})),t};var r={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},n=/([astvzqmhlc])([^astvzqmhlc]*)/gi,i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/gi}}),Kt=p({"src/components/drawing/symbol_defs.js"(e,t){var r,n,i,a,o=Yt(),s=function(e,t){return t?Math.round(e*(t=Math.pow(10,t)))/t:Math.round(e)},l="M0,0Z",c=Math.sqrt(2),u=Math.sqrt(3),h=Math.PI,p=Math.cos,d=Math.sin;function f(e){return null===e}function m(e,t,s){if((!e||e%360===0)&&!t)return s;if(i===e&&a===t&&r===s)return n;function l(e,r){var n=p(e),i=d(e),a=r[0],o=r[1]+(t||0);return[a*n-o*i,a*i+o*n]}i=e,a=t,r=s;for(var c=e/180*h,u=0,f=0,m=o(s),g="",y=0;y<m.length;y++){var v=m[y],x=v[0],b=u,_=f;if("M"===x||"L"===x)u=+v[1],f=+v[2];else if("m"===x||"l"===x)u+=+v[1],f+=+v[2];else if("H"===x)u=+v[1];else if("h"===x)u+=+v[1];else if("V"===x)f=+v[1];else if("v"===x)f+=+v[1];else if("A"===x){u=+v[1],f=+v[2];var w=l(c,[+v[6],+v[7]]);v[6]=w[0],v[7]=w[1],v[3]=+v[3]+e}"H"!==x&&"V"!==x||(x="L"),"h"!==x&&"v"!==x||(x="l"),"m"!==x&&"l"!==x||(u-=b,f-=_);var k=l(c,[u,f]);"H"!==x&&"V"!==x||(x="L"),"M"!==x&&"L"!==x&&"m"!==x&&"l"!==x||(v[1]=k[0],v[2]=k[1]),v[0]=x,g+=v[0]+v.slice(1).join(",")}return n=g,g}t.exports={circle:{n:0,f:function(e,t,r){if(f(t))return l;var n=s(e,2),i="M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z";return r?m(t,r,i):i}},square:{n:1,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")}},diamond:{n:2,f:function(e,t,r){if(f(t))return l;var n=s(1.3*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"Z")}},cross:{n:3,f:function(e,t,r){if(f(t))return l;var n=s(.4*e,2),i=s(1.2*e,2);return m(t,r,"M"+i+","+n+"H"+n+"V"+i+"H-"+n+"V"+n+"H-"+i+"V-"+n+"H-"+n+"V-"+i+"H"+n+"V-"+n+"H"+i+"Z")}},x:{n:4,f:function(e,t,r){if(f(t))return l;var n=s(.8*e/c,2),i="l"+n+","+n,a="l"+n+",-"+n,o="l-"+n+",-"+n,u="l-"+n+","+n;return m(t,r,"M0,"+n+i+a+o+a+o+u+o+u+i+u+i+"Z")}},"triangle-up":{n:5,f:function(e,t,r){if(f(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+n+","+s(e/2,2)+"H"+n+"L0,-"+s(e,2)+"Z")}},"triangle-down":{n:6,f:function(e,t,r){if(f(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+n+",-"+s(e/2,2)+"H"+n+"L0,"+s(e,2)+"Z")}},"triangle-left":{n:7,f:function(e,t,r){if(f(t))return l;var n=s(2*e/u,2);return m(t,r,"M"+s(e/2,2)+",-"+n+"V"+n+"L-"+s(e,2)+",0Z")}},"triangle-right":{n:8,f:function(e,t,r){if(f(t))return l;var n=s(2*e/u,2);return m(t,r,"M-"+s(e/2,2)+",-"+n+"V"+n+"L"+s(e,2)+",0Z")}},"triangle-ne":{n:9,f:function(e,t,r){if(f(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M-"+i+",-"+n+"H"+n+"V"+i+"Z")}},"triangle-se":{n:10,f:function(e,t,r){if(f(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M"+n+",-"+i+"V"+n+"H-"+i+"Z")}},"triangle-sw":{n:11,f:function(e,t,r){if(f(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M"+i+","+n+"H-"+n+"V-"+i+"Z")}},"triangle-nw":{n:12,f:function(e,t,r){if(f(t))return l;var n=s(.6*e,2),i=s(1.2*e,2);return m(t,r,"M-"+n+","+i+"V-"+n+"H"+i+"Z")}},pentagon:{n:13,f:function(e,t,r){if(f(t))return l;var n=s(.951*e,2),i=s(.588*e,2),a=s(-e,2),o=s(-.309*e,2);return m(t,r,"M"+n+","+o+"L"+i+","+s(.809*e,2)+"H-"+i+"L-"+n+","+o+"L0,"+a+"Z")}},hexagon:{n:14,f:function(e,t,r){if(f(t))return l;var n=s(e,2),i=s(e/2,2),a=s(e*u/2,2);return m(t,r,"M"+a+",-"+i+"V"+i+"L0,"+n+"L-"+a+","+i+"V-"+i+"L0,-"+n+"Z")}},hexagon2:{n:15,f:function(e,t,r){if(f(t))return l;var n=s(e,2),i=s(e/2,2),a=s(e*u/2,2);return m(t,r,"M-"+i+","+a+"H"+i+"L"+n+",0L"+i+",-"+a+"H-"+i+"L-"+n+",0Z")}},octagon:{n:16,f:function(e,t,r){if(f(t))return l;var n=s(.924*e,2),i=s(.383*e,2);return m(t,r,"M-"+i+",-"+n+"H"+i+"L"+n+",-"+i+"V"+i+"L"+i+","+n+"H-"+i+"L-"+n+","+i+"V-"+i+"Z")}},star:{n:17,f:function(e,t,r){if(f(t))return l;var n=1.4*e,i=s(.225*n,2),a=s(.951*n,2),o=s(.363*n,2),c=s(.588*n,2),u=s(-n,2),h=s(-.309*n,2),p=s(.118*n,2),d=s(.809*n,2);return m(t,r,"M"+i+","+h+"H"+a+"L"+o+","+p+"L"+c+","+d+"L0,"+s(.382*n,2)+"L-"+c+","+d+"L-"+o+","+p+"L-"+a+","+h+"H-"+i+"L0,"+u+"Z")}},hexagram:{n:18,f:function(e,t,r){if(f(t))return l;var n=s(.66*e,2),i=s(.38*e,2),a=s(.76*e,2);return m(t,r,"M-"+a+",0l-"+i+",-"+n+"h"+a+"l"+i+",-"+n+"l"+i+","+n+"h"+a+"l-"+i+","+n+"l"+i+","+n+"h-"+a+"l-"+i+","+n+"l-"+i+",-"+n+"h-"+a+"Z")}},"star-triangle-up":{n:19,f:function(e,t,r){if(f(t))return l;var n=s(e*u*.8,2),i=s(.8*e,2),a=s(1.6*e,2),o=s(4*e,2),c="A "+o+","+o+" 0 0 1 ";return m(t,r,"M-"+n+","+i+c+n+","+i+c+"0,-"+a+c+"-"+n+","+i+"Z")}},"star-triangle-down":{n:20,f:function(e,t,r){if(f(t))return l;var n=s(e*u*.8,2),i=s(.8*e,2),a=s(1.6*e,2),o=s(4*e,2),c="A "+o+","+o+" 0 0 1 ";return m(t,r,"M"+n+",-"+i+c+"-"+n+",-"+i+c+"0,"+a+c+n+",-"+i+"Z")}},"star-square":{n:21,f:function(e,t,r){if(f(t))return l;var n=s(1.1*e,2),i=s(2*e,2),a="A "+i+","+i+" 0 0 1 ";return m(t,r,"M-"+n+",-"+n+a+"-"+n+","+n+a+n+","+n+a+n+",-"+n+a+"-"+n+",-"+n+"Z")}},"star-diamond":{n:22,f:function(e,t,r){if(f(t))return l;var n=s(1.4*e,2),i=s(1.9*e,2),a="A "+i+","+i+" 0 0 1 ";return m(t,r,"M-"+n+",0"+a+"0,"+n+a+n+",0"+a+"0,-"+n+a+"-"+n+",0Z")}},"diamond-tall":{n:23,f:function(e,t,r){if(f(t))return l;var n=s(.7*e,2),i=s(1.4*e,2);return m(t,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},"diamond-wide":{n:24,f:function(e,t,r){if(f(t))return l;var n=s(1.4*e,2),i=s(.7*e,2);return m(t,r,"M0,"+i+"L"+n+",0L0,-"+i+"L-"+n+",0Z")}},hourglass:{n:25,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"H-"+n+"L"+n+",-"+n+"H-"+n+"Z")},noDot:!0},bowtie:{n:26,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"V-"+n+"L-"+n+","+n+"V-"+n+"Z")},noDot:!0},"circle-cross":{n:27,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(e,t,r){if(f(t))return l;var n=s(e,2),i=s(e/c,2);return m(t,r,"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i+"M"+n+",0A"+n+","+n+" 0 1,1 0,-"+n+"A"+n+","+n+" 0 0,1 "+n+",0Z")},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"square-x":{n:30,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n+"M"+n+","+n+"H-"+n+"V-"+n+"H"+n+"Z")},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(e,t,r){if(f(t))return l;var n=s(1.3*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM0,-"+n+"V"+n+"M-"+n+",0H"+n)},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(e,t,r){if(f(t))return l;var n=s(1.3*e,2),i=s(.65*e,2);return m(t,r,"M"+n+",0L0,"+n+"L-"+n+",0L0,-"+n+"ZM-"+i+",-"+i+"L"+i+","+i+"M-"+i+","+i+"L"+i+",-"+i)},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(e,t,r){if(f(t))return l;var n=s(1.4*e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n+"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(e,t,r){if(f(t))return l;var n=s(1.2*e,2),i=s(.85*e,2);return m(t,r,"M0,"+n+"V-"+n+"M"+n+",0H-"+n+"M"+i+","+i+"L-"+i+",-"+i+"M"+i+",-"+i+"L-"+i+","+i)},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(e,t,r){if(f(t))return l;var n=s(e/2,2),i=s(e,2);return m(t,r,"M"+n+","+i+"V-"+i+"M"+(n-i)+",-"+i+"V"+i+"M"+i+","+n+"H-"+i+"M-"+i+","+(n-i)+"H"+i)},needLine:!0,noFill:!0},"y-up":{n:37,f:function(e,t,r){if(f(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+n+","+a+"L0,0M"+n+","+a+"L0,0M0,-"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(e,t,r){if(f(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+n+",-"+a+"L0,0M"+n+",-"+a+"L0,0M0,"+i+"L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(e,t,r){if(f(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M"+a+","+n+"L0,0M"+a+",-"+n+"L0,0M-"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(e,t,r){if(f(t))return l;var n=s(1.2*e,2),i=s(1.6*e,2),a=s(.8*e,2);return m(t,r,"M-"+a+","+n+"L0,0M-"+a+",-"+n+"L0,0M"+i+",0L0,0")},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(e,t,r){if(f(t))return l;var n=s(1.4*e,2);return m(t,r,"M"+n+",0H-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(e,t,r){if(f(t))return l;var n=s(1.4*e,2);return m(t,r,"M0,"+n+"V-"+n)},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+",-"+n+"L-"+n+","+n)},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M"+n+","+n+"L-"+n+",-"+n)},needLine:!0,noDot:!0,noFill:!0},"arrow-up":{n:45,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M0,0L-"+n+","+s(2*e,2)+"H"+n+"Z")},backoff:1,noDot:!0},"arrow-down":{n:46,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M0,0L-"+n+",-"+s(2*e,2)+"H"+n+"Z")},noDot:!0},"arrow-left":{n:47,f:function(e,t,r){if(f(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,0L"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-right":{n:48,f:function(e,t,r){if(f(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,0L-"+n+",-"+i+"V"+i+"Z")},noDot:!0},"arrow-bar-up":{n:49,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M-"+n+",0H"+n+"M0,0L-"+n+","+s(2*e,2)+"H"+n+"Z")},backoff:1,needLine:!0,noDot:!0},"arrow-bar-down":{n:50,f:function(e,t,r){if(f(t))return l;var n=s(e,2);return m(t,r,"M-"+n+",0H"+n+"M0,0L-"+n+",-"+s(2*e,2)+"H"+n+"Z")},needLine:!0,noDot:!0},"arrow-bar-left":{n:51,f:function(e,t,r){if(f(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,-"+i+"V"+i+"M0,0L"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},"arrow-bar-right":{n:52,f:function(e,t,r){if(f(t))return l;var n=s(2*e,2),i=s(e,2);return m(t,r,"M0,-"+i+"V"+i+"M0,0L-"+n+",-"+i+"V"+i+"Z")},needLine:!0,noDot:!0},arrow:{n:53,f:function(e,t,r){if(f(t))return l;var n=h/2.5,i=2*e*p(n),a=2*e*d(n);return m(t,r,"M0,0L"+-i+","+a+"L"+i+","+a+"Z")},backoff:.9,noDot:!0},"arrow-wide":{n:54,f:function(e,t,r){if(f(t))return l;var n=h/4,i=2*e*p(n),a=2*e*d(n);return m(t,r,"M0,0L"+-i+","+a+"A "+2*e+","+2*e+" 0 0 1 "+i+","+a+"Z")},backoff:.4,noDot:!0}}}}),Jt=p({"src/components/drawing/index.js"(e,t){var r=v(),n=st(),i=n.numberFormat,a=k(),o=O(),s=Ve(),l=q(),c=Wt(),u=n.strTranslate,h=At(),p=Tt(),d=St().LINE_SPACING,f=H().DESELECTDIM,m=$t(),g=Zt(),y=Xt().appendArrayPointValue,x=t.exports={};function b(e){return"none"===e?void 0:e}x.font=function(e,t){var r=t.variant,n=t.style,i=t.weight,a=t.color,o=t.size,s=t.family,c=t.shadow,u=t.lineposition,p=t.textcase;s&&e.style("font-family",s),o+1&&e.style("font-size",o+"px"),a&&e.call(l.fill,a),i&&e.style("font-weight",i),n&&e.style("font-style",n),r&&e.style("font-variant",r),p&&e.style("text-transform",b(function(e){return _[e]}(p))),c&&e.style("text-shadow","auto"===c?h.makeTextShadow(l.contrast(a)):b(c)),u&&e.style("text-decoration-line",b(function(e){return e.replace("under","underline").replace("over","overline").replace("through","line-through").split("+").join(" ")}(u)))};var _={normal:"none",lower:"lowercase",upper:"uppercase","word caps":"capitalize"};function w(e,t,r,n){var i=t.fillpattern,a=t.fillgradient,o=i&&x.getPatternAttr(i.shape,0,"");if(o){var s=x.getPatternAttr(i.bgcolor,0,null),c=x.getPatternAttr(i.fgcolor,0,null),u=i.fgopacity,h=x.getPatternAttr(i.size,0,8),p=x.getPatternAttr(i.solidity,0,.3),d=t.uid;x.pattern(e,"point",r,d,o,h,p,void 0,i.fillmode,s,c,u)}else if(a&&"none"!==a.type){var f,m,g=a.type,y="scatterfill-"+t.uid;n&&(y="legendfill-"+t.uid),n||void 0===a.start&&void 0===a.stop?("horizontal"===g&&(g+="reversed"),e.call(x.gradient,r,y,g,a.colorscale,"fill")):("horizontal"===g?(f={x:a.start,y:0},m={x:a.stop,y:0}):"vertical"===g&&(f={x:0,y:a.start},m={x:0,y:a.stop}),f.x=t._xA.c2p(void 0===f.x?t._extremes.x.min[0].val:f.x,!0),f.y=t._yA.c2p(void 0===f.y?t._extremes.y.min[0].val:f.y,!0),m.x=t._xA.c2p(void 0===m.x?t._extremes.x.max[0].val:m.x,!0),m.y=t._yA.c2p(void 0===m.y?t._extremes.y.max[0].val:m.y,!0),e.call(C,r,y,"linear",a.colorscale,"fill",f,m,!0,!1))}else t.fillcolor&&e.call(l.fill,t.fillcolor)}x.setPosition=function(e,t,r){e.attr("x",t).attr("y",r)},x.setSize=function(e,t,r){e.attr("width",t).attr("height",r)},x.setRect=function(e,t,r,n,i){e.call(x.setPosition,t,r).call(x.setSize,n,i)},x.translatePoint=function(e,t,r,n){var i=r.c2p(e.x),o=n.c2p(e.y);return!!(a(i)&&a(o)&&t.node())&&("text"===t.node().nodeName?t.attr("x",i).attr("y",o):t.attr("transform",u(i,o)),!0)},x.translatePoints=function(e,t,n){e.each((function(e){var i=r.select(this);x.translatePoint(e,i,t,n)}))},x.hideOutsideRangePoint=function(e,t,r,n,i,a){t.attr("display",r.isPtWithinRange(e,i)&&n.isPtWithinRange(e,a)?null:"none")},x.hideOutsideRangePoints=function(e,t){if(t._hasClipOnAxisFalse){var n=t.xaxis,i=t.yaxis;e.each((function(t){var a=t[0].trace,o=a.xcalendar,l=a.ycalendar,c=s.traceIs(a,"bar-like")?".bartext":".point,.textpoint";e.selectAll(c).each((function(e){x.hideOutsideRangePoint(e,r.select(this),n,i,o,l)}))}))}},x.crispRound=function(e,t,r){return t&&a(t)?e._context.staticPlot?t:t<1?1:Math.round(t):r||0},x.singleLineStyle=function(e,t,r,n,i){t.style("fill","none");var a=(((e||[])[0]||{}).trace||{}).line||{},o=r||a.width||0,s=i||a.dash||"";l.stroke(t,n||a.color),x.dashLine(t,s,o)},x.lineGroupStyle=function(e,t,n,i){e.style("fill","none").each((function(e){var a=(((e||[])[0]||{}).trace||{}).line||{},o=t||a.width||0,s=i||a.dash||"";r.select(this).call(l.stroke,n||a.color).call(x.dashLine,s,o)}))},x.dashLine=function(e,t,r){r=+r||0,t=x.dashStyle(t,r),e.style({"stroke-dasharray":t,"stroke-width":r+"px"})},x.dashStyle=function(e,t){t=+t||1;var r=Math.max(t,3);return"solid"===e?e="":"dot"===e?e=r+"px,"+r+"px":"dash"===e?e=3*r+"px,"+3*r+"px":"longdash"===e?e=5*r+"px,"+5*r+"px":"dashdot"===e?e=3*r+"px,"+r+"px,"+r+"px,"+r+"px":"longdashdot"===e&&(e=5*r+"px,"+2*r+"px,"+r+"px,"+2*r+"px"),e},x.singleFillStyle=function(e,t){var n=r.select(e.node());w(e,((n.data()[0]||[])[0]||{}).trace||{},t,!1)},x.fillGroupStyle=function(e,t,n){e.style("stroke-width",0).each((function(e){var i=r.select(this);e[0].trace&&w(i,e[0].trace,t,n)}))};var T=Kt();x.symbolNames=[],x.symbolFuncs=[],x.symbolBackOffs=[],x.symbolNeedLines={},x.symbolNoDot={},x.symbolNoFill={},x.symbolList=[],Object.keys(T).forEach((function(e){var t=T[e],r=t.n;x.symbolList.push(r,String(r),e,r+100,String(r+100),e+"-open"),x.symbolNames[r]=e,x.symbolFuncs[r]=t.f,x.symbolBackOffs[r]=t.backoff||0,t.needLine&&(x.symbolNeedLines[r]=!0),t.noDot?x.symbolNoDot[r]=!0:x.symbolList.push(r+200,String(r+200),e+"-dot",r+300,String(r+300),e+"-open-dot"),t.noFill&&(x.symbolNoFill[r]=!0)}));var S=x.symbolNames.length;function A(e,t,r,n){var i=e%100;return x.symbolFuncs[i](t,r,n)+(e>=200?"M0,0.5L0.5,0L0,-0.5L-0.5,0Z":"")}x.symbolNumber=function(e){if(a(e))e=+e;else if("string"===typeof e){var t=0;e.indexOf("-open")>0&&(t=100,e=e.replace("-open","")),e.indexOf("-dot")>0&&(t+=200,e=e.replace("-dot","")),(e=x.symbolNames.indexOf(e))>=0&&(e+=t)}return e%100>=S||e>=400?0:Math.floor(Math.max(e,0))};var M=i("~f"),E={radial:{type:"radial"},radialreversed:{type:"radial",reversed:!0},horizontal:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0}},horizontalreversed:{type:"linear",start:{x:1,y:0},stop:{x:0,y:0},reversed:!0},vertical:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0}},verticalreversed:{type:"linear",start:{x:0,y:1},stop:{x:0,y:0},reversed:!0}};function C(e,t,i,a,s,c,u,h,p,d){var f,m=s.length;"linear"===a?f={node:"linearGradient",attrs:{x1:u.x,y1:u.y,x2:h.x,y2:h.y,gradientUnits:p?"userSpaceOnUse":"objectBoundingBox"},reversed:d}:"radial"===a&&(f={node:"radialGradient",reversed:d});for(var g=new Array(m),y=0;y<m;y++)f.reversed?g[m-1-y]=[M(100*(1-s[y][0])),s[y][1]]:g[y]=[M(100*s[y][0]),s[y][1]];var v=t._fullLayout,x="g"+v._uid+"-"+i,b=v._defs.select(".gradients").selectAll("#"+x).data([a+g.join(";")],n.identity);b.exit().remove(),b.enter().append(f.node).each((function(){var e=r.select(this);f.attrs&&e.attr(f.attrs),e.attr("id",x);var t=e.selectAll("stop").data(g);t.exit().remove(),t.enter().append("stop"),t.each((function(e){var t=o(e[1]);r.select(this).attr({offset:e[0]+"%","stop-color":l.tinyRGB(t),"stop-opacity":t.getAlpha()})}))})),e.style(c,$(x,t)).style(c+"-opacity",null),e.classed("gradient_filled",!0)}x.gradient=function(e,t,r,n,i,a){var o=E[n];return C(e,t,r,o.type,i,a,o.start,o.stop,!1,o.reversed)},x.pattern=function(e,t,i,a,s,c,u,h,p,d,f,m){var g="legend"===t;h&&("overlay"===p?(d=h,f=l.contrast(d)):(d=void 0,f=h));var y,v,x,b,_,w,k,T,S,A,M,E=i._fullLayout,C="p"+E._uid+"-"+a,P={},L=o(f),I=l.tinyRGB(L),z=m*L.getAlpha();switch(s){case"/":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",P={d:x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"\\":y=c*Math.sqrt(2),v=c*Math.sqrt(2),w="path",P={d:x="M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"x":y=c*Math.sqrt(2),v=c*Math.sqrt(2),x="M-"+y/4+","+v/4+"l"+y/2+",-"+v/2+"M0,"+v+"L"+y+",0M"+y/4*3+","+v/4*5+"l"+y/2+",-"+v/2+"M"+y/4*3+",-"+v/4+"l"+y/2+","+v/2+"M0,0L"+y+","+v+"M-"+y/4+","+v/4*3+"l"+y/2+","+v/2,b=c-c*Math.sqrt(1-u),w="path",P={d:x,opacity:z,stroke:I,"stroke-width":b+"px"};break;case"|":w="path",w="path",P={d:x="M"+(y=c)/2+",0L"+y/2+","+(v=c),opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"-":w="path",w="path",P={d:x="M0,"+(v=c)/2+"L"+(y=c)+","+v/2,opacity:z,stroke:I,"stroke-width":(b=u*c)+"px"};break;case"+":w="path",x="M"+(y=c)/2+",0L"+y/2+","+(v=c)+"M0,"+v/2+"L"+y+","+v/2,b=c-c*Math.sqrt(1-u),w="path",P={d:x,opacity:z,stroke:I,"stroke-width":b+"px"};break;case".":y=c,v=c,u<Math.PI/4?_=Math.sqrt(u*c*c/Math.PI):(k=u,T=Math.PI/4,S=1,A=c/2,M=c/Math.sqrt(2),_=A+(M-A)*(k-T)/(S-T)),w="circle",P={cx:y/2,cy:v/2,r:_,opacity:z,fill:I}}var O=[s||"noSh",d||"noBg",f||"noFg",c,u].join(";"),R=E._defs.select(".patterns").selectAll("#"+C).data([O],n.identity);R.exit().remove(),R.enter().append("pattern").each((function(){var e=r.select(this);if(e.attr({id:C,width:y+"px",height:v+"px",patternUnits:"userSpaceOnUse",patternTransform:g?"scale(0.8)":""}),d){var t=o(d),n=l.tinyRGB(t),i=t.getAlpha(),a=e.selectAll("rect").data([0]);a.exit().remove(),a.enter().append("rect").attr({width:y+"px",height:v+"px",fill:n,"fill-opacity":i})}var s=e.selectAll(w).data([0]);s.exit().remove(),s.enter().append(w).attr(P)})),e.style("fill",$(C,i)).style("fill-opacity",null),e.classed("pattern_filled",!0)},x.initGradients=function(e){var t=e._fullLayout;n.ensureSingle(t._defs,"g","gradients").selectAll("linearGradient,radialGradient").remove(),r.select(e).selectAll(".gradient_filled").classed("gradient_filled",!1)},x.initPatterns=function(e){var t=e._fullLayout;n.ensureSingle(t._defs,"g","patterns").selectAll("pattern").remove(),r.select(e).selectAll(".pattern_filled").classed("pattern_filled",!1)},x.getPatternAttr=function(e,t,r){return e&&n.isArrayOrTypedArray(e)?t<e.length?e[t]:r:e},x.pointStyle=function(e,t,n,i){if(e.size()){var a=x.makePointStyleFns(t);e.each((function(e){x.singlePointStyle(e,r.select(this),t,a,n,i)}))}},x.singlePointStyle=function(e,t,r,i,a,o){var s=r.marker,c=s.line;if(o&&o.i>=0&&void 0===e.i&&(e.i=o.i),t.style("opacity",i.selectedOpacityFn?i.selectedOpacityFn(e):void 0===e.mo?s.opacity:e.mo),i.ms2mrc){var u;u="various"===e.ms||"various"===s.size?3:i.ms2mrc(e.ms),e.mrc=u,i.selectedSizeFn&&(u=e.mrc=i.selectedSizeFn(e));var h=x.symbolNumber(e.mx||s.symbol)||0;e.om=h%200>=100;var p=se(e,r),d=Y(e,r);t.attr("d",A(h,u,p,d))}var f,m,g,y=!1;if(e.so)g=c.outlierwidth,m=c.outliercolor,f=s.outliercolor;else{var v=(c||{}).width;g=(e.mlw+1||v+1||(e.trace?(e.trace.marker.line||{}).width:0)+1)-1||0,m="mlc"in e?e.mlcc=i.lineScale(e.mlc):n.isArrayOrTypedArray(c.color)?l.defaultLine:c.color,n.isArrayOrTypedArray(s.color)&&(f=l.defaultLine,y=!0),f="mc"in e?e.mcc=i.markerScale(e.mc):s.color||s.colors||"rgba(0,0,0,0)",i.selectedColorFn&&(f=i.selectedColorFn(e))}if(e.om)t.call(l.stroke,f).style({"stroke-width":(g||1)+"px",fill:"none"});else{t.style("stroke-width",(e.isBlank?0:g)+"px");var b=s.gradient,_=e.mgt;_?y=!0:_=b&&b.type,n.isArrayOrTypedArray(_)&&(_=_[0],E[_]||(_=0));var w=s.pattern,k=w&&x.getPatternAttr(w.shape,e.i,"");if(_&&"none"!==_){var T=e.mgc;T?y=!0:T=b.color;var S=r.uid;y&&(S+="-"+e.i),x.gradient(t,a,S,_,[[0,T],[1,f]],"fill")}else if(k){var M=!1,C=w.fgcolor;!C&&o&&o.color&&(C=o.color,M=!0);var P=x.getPatternAttr(C,e.i,o&&o.color||null),L=x.getPatternAttr(w.bgcolor,e.i,null),I=w.fgopacity,z=x.getPatternAttr(w.size,e.i,8),O=x.getPatternAttr(w.solidity,e.i,.3);M=M||e.mcc||n.isArrayOrTypedArray(w.shape)||n.isArrayOrTypedArray(w.bgcolor)||n.isArrayOrTypedArray(w.fgcolor)||n.isArrayOrTypedArray(w.size)||n.isArrayOrTypedArray(w.solidity);var R=r.uid;M&&(R+="-"+e.i),x.pattern(t,"point",a,R,k,z,O,e.mcc,w.fillmode,L,P,I)}else n.isArrayOrTypedArray(f)?l.fill(t,f[e.i]):l.fill(t,f);g&&l.stroke(t,m)}},x.makePointStyleFns=function(e){var t={},r=e.marker;return t.markerScale=x.tryColorscale(r,""),t.lineScale=x.tryColorscale(r,"line"),s.traceIs(e,"symbols")&&(t.ms2mrc=m.isBubble(e)?g(e):function(){return(r.size||6)/2}),e.selectedpoints&&n.extendFlat(t,x.makeSelectedPointStyleFns(e)),t},x.makeSelectedPointStyleFns=function(e){var t={},r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},l=i.marker||{},c=a.opacity,u=o.opacity,h=l.opacity,p=void 0!==u,d=void 0!==h;(n.isArrayOrTypedArray(c)||p||d)&&(t.selectedOpacityFn=function(e){var t=void 0===e.mo?a.opacity:e.mo;return e.selected?p?u:t:d?h:f*t});var m=a.color,g=o.color,y=l.color;(g||y)&&(t.selectedColorFn=function(e){var t=e.mcc||m;return e.selected?g||t:y||t});var v=a.size,x=o.size,b=l.size,_=void 0!==x,w=void 0!==b;return s.traceIs(e,"symbols")&&(_||w)&&(t.selectedSizeFn=function(e){var t=e.mrc||v/2;return e.selected?_?x/2:t:w?b/2:t}),t},x.makeSelectedTextStyleFns=function(e){var t={},r=e.selected||{},n=e.unselected||{},i=e.textfont||{},a=r.textfont||{},o=n.textfont||{},s=i.color,c=a.color,u=o.color;return t.selectedTextColorFn=function(e){var t=e.tc||s;return e.selected?c||t:u||(c?t:l.addOpacity(t,f))},t},x.selectedPointStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=x.makeSelectedPointStyleFns(t),i=t.marker||{},a=[];n.selectedOpacityFn&&a.push((function(e,t){e.style("opacity",n.selectedOpacityFn(t))})),n.selectedColorFn&&a.push((function(e,t){l.fill(e,n.selectedColorFn(t))})),n.selectedSizeFn&&a.push((function(e,r){var a=r.mx||i.symbol||0,o=n.selectedSizeFn(r);e.attr("d",A(x.symbolNumber(a),o,se(r,t),Y(r,t))),r.mrc2=o})),a.length&&e.each((function(e){for(var t=r.select(this),n=0;n<a.length;n++)a[n](t,e)}))}},x.tryColorscale=function(e,t){var r=t?n.nestedProperty(e,t).get():e;if(r){var i=r.color;if((r.colorscale||r._colorAx)&&n.isArrayOrTypedArray(i))return c.makeColorScaleFuncFromTrace(r)}return n.identity};var P,L,I={start:1,end:-1,middle:0,bottom:1,top:-1};function z(e,t,n,i,a){var o=r.select(e.node().parentNode),s=-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle",l=-1!==t.indexOf("left")?"end":-1!==t.indexOf("right")?"start":"middle",c=i?i/.8+1:0,p=(h.lineCount(e)-1)*d+1,f=I[l]*c,m=.75*n+I[s]*c+(I[s]-1)*p*n/2;e.attr("text-anchor",l),a||o.attr("transform",u(f,m))}function R(e,t){var r=e.ts||t.textfont.size;return a(r)&&r>0?r:0}function D(e,t,r){return r&&(e=V(e)),t?F(e[1]):j(e[0])}function j(e){var t=r.round(e,2);return P=t,t}function F(e){var t=r.round(e,2);return L=t,t}function B(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=3*c*(l+c),d=3*l*(l+c);return[[j(t[0]+(p&&u/p)),F(t[1]+(p&&h/p))],[j(t[0]-(d&&u/d)),F(t[1]-(d&&h/d))]]}x.textPointStyle=function(e,t,i){if(e.size()){var a;if(t.selectedpoints){var o=x.makeSelectedTextStyleFns(t);a=o.selectedTextColorFn}var s=t.texttemplate,l=i._fullLayout;e.each((function(e){var o=r.select(this),c=s?n.extractOption(e,t,"txt","texttemplate"):n.extractOption(e,t,"tx","text");if(c||0===c){if(s){var u=t._module.formatLabels,p=u?u(e,t,l):{},d={};y(d,t,e.i);var f=t._meta||{};c=n.texttemplateString(c,p,l._d3locale,d,e,f)}var m=e.tp||t.textposition,g=R(e,t),v=a?a(e):e.tc||t.textfont.color;o.call(x.font,{family:e.tf||t.textfont.family,weight:e.tw||t.textfont.weight,style:e.ty||t.textfont.style,variant:e.tv||t.textfont.variant,textcase:e.tC||t.textfont.textcase,lineposition:e.tE||t.textfont.lineposition,shadow:e.tS||t.textfont.shadow,size:g,color:v}).text(c).call(h.convertToTspans,i).call(z,m,g,e.mrc)}else o.remove()}))}},x.selectedTextStyle=function(e,t){if(e.size()&&t.selectedpoints){var n=x.makeSelectedTextStyleFns(t);e.each((function(e){var i=r.select(this),a=n.selectedTextColorFn(e),o=e.tp||t.textposition,c=R(e,t);l.fill(i,a);var u=s.traceIs(t,"bar-like");z(i,o,c,e.mrc2||e.mrc,u)}))}},x.smoothopen=function(e,t){if(e.length<3)return"M"+e.join("L");var r,n="M"+e[0],i=[];for(r=1;r<e.length-1;r++)i.push(B(e[r-1],e[r],e[r+1],t));for(n+="Q"+i[0][0]+" "+e[1],r=2;r<e.length-1;r++)n+="C"+i[r-2][1]+" "+i[r-1][0]+" "+e[r];return n+="Q"+i[e.length-3][1]+" "+e[e.length-1]},x.smoothclosed=function(e,t){if(e.length<3)return"M"+e.join("L")+"Z";var r,n="M"+e[0],i=e.length-1,a=[B(e[i],e[0],e[1],t)];for(r=1;r<i;r++)a.push(B(e[r-1],e[r],e[r+1],t));for(a.push(B(e[i-1],e[i],e[0],t)),r=1;r<=i;r++)n+="C"+a[r-1][1]+" "+a[r][0]+" "+e[r];return n+="C"+a[i][1]+" "+a[0][0]+" "+e[0]+"Z"};var N={hv:function(e,t,r){return"H"+j(t[0])+"V"+D(t,1,r)},vh:function(e,t,r){return"V"+F(t[1])+"H"+D(t,0,r)},hvh:function(e,t,r){return"H"+j((e[0]+t[0])/2)+"V"+F(t[1])+"H"+D(t,0,r)},vhv:function(e,t,r){return"V"+F((e[1]+t[1])/2)+"H"+j(t[0])+"V"+D(t,1,r)}},U=function(e,t,r){return"L"+D(t,0,r)+","+D(t,1,r)};function V(e,t){var r=e.backoff,i=e.trace,a=e.d,o=e.i;if(r&&i&&i.marker&&i.marker.angle%360===0&&i.line&&"spline"!==i.line.shape){var s=n.isArrayOrTypedArray(r),l=e,c=t?t[0]:P||0,u=t?t[1]:L||0,h=l[0],p=l[1],d=h-c,f=p-u,m=Math.atan2(f,d),g=s?r[o]:r;if("auto"===g){var y=l.i;"scatter"===i.type&&y--;var v=l.marker,b=v.symbol;n.isArrayOrTypedArray(b)&&(b=b[y]);var _=v.size;n.isArrayOrTypedArray(_)&&(_=_[y]),g=v?x.symbolBackOffs[x.symbolNumber(b)]*_:0,g+=x.getMarkerStandoff(a[y],i)||0}var w=h-g*Math.cos(m),k=p-g*Math.sin(m);(w<=h&&w>=c||w>=h&&w<=c)&&(k<=p&&k>=u||k>=p&&k<=u)&&(e=[w,k])}return e}x.steps=function(e){var t=N[e]||U;return function(e){for(var r="M"+j(e[0][0])+","+F(e[0][1]),n=e.length,i=1;i<n;i++)r+=t(e[i-1],e[i],i===n-1);return r}},x.applyBackoff=V,x.makeTester=function(){var e=n.ensureSingleById(r.select("body"),"svg","js-plotly-tester",(function(e){e.attr(p.svgAttrs).style({position:"absolute",left:"-10000px",top:"-10000px",width:"9000px",height:"9000px","z-index":"1"})})),t=n.ensureSingle(e,"path","js-reference-point",(function(e){e.attr("d","M0,0H1V1H0Z").style({"stroke-width":0,fill:"black"})}));x.tester=e,x.testref=t},x.savedBBoxes={};var G=0;function W(e){var t=e.getAttribute("data-unformatted");if(null!==t)return t+e.getAttribute("data-math")+e.getAttribute("text-anchor")+e.getAttribute("style")}function $(e,t){if(!e)return null;var r=t._context,n=r._exportedPlot?"":r._baseUrl||"";return n?"url('"+n+"#"+e+"')":"url(#"+e+")"}x.bBox=function(e,t,i){var a,o,s;if(i||(i=W(e)),i){if(a=x.savedBBoxes[i])return n.extendFlat({},a)}else if(1===e.childNodes.length){var l=e.childNodes[0];if(i=W(l)){var c=+l.getAttribute("x")||0,u=+l.getAttribute("y")||0,p=l.getAttribute("transform");if(!p){var d=x.bBox(l,!1,i);return c&&(d.left+=c,d.right+=c),u&&(d.top+=u,d.bottom+=u),d}if(i+="~"+c+"~"+u+"~"+p,a=x.savedBBoxes[i])return n.extendFlat({},a)}}t?o=e:(s=x.tester.node(),o=e.cloneNode(!0),s.appendChild(o)),r.select(o).attr("transform",null).call(h.positionText,0,0);var f=o.getBoundingClientRect(),m=x.testref.node().getBoundingClientRect();t||s.removeChild(o);var g={height:f.height,width:f.width,left:f.left-m.left,top:f.top-m.top,right:f.right-m.left,bottom:f.bottom-m.top};return G>=1e4&&(x.savedBBoxes={},G=0),i&&(x.savedBBoxes[i]=g),G++,n.extendFlat({},g)},x.setClipUrl=function(e,t,r){e.attr("clip-path",$(t,r))},x.getTranslate=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||0,y:+t[1]||0}},x.setTranslate=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||0,r=r||0,a=a.replace(/(\btranslate\(.*?\);?)/,"").trim(),a=(a+=u(t,r)).trim(),e[i]("transform",a),a},x.getScale=function(e){var t=(e[e.attr?"attr":"getAttribute"]("transform")||"").replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,(function(e,t,r){return[t,r].join(" ")})).split(" ");return{x:+t[0]||1,y:+t[1]||1}},x.setScale=function(e,t,r){var n=e.attr?"attr":"getAttribute",i=e.attr?"attr":"setAttribute",a=e[n]("transform")||"";return t=t||1,r=r||1,a=a.replace(/(\bscale\(.*?\);?)/,"").trim(),a=(a+="scale("+t+","+r+")").trim(),e[i]("transform",a),a};var Z=/\s*sc.*/;x.setPointGroupScale=function(e,t,r){if(t=t||1,r=r||1,e){var n=1===t&&1===r?"":"scale("+t+","+r+")";e.each((function(){var e=(this.getAttribute("transform")||"").replace(Z,"");e=(e+=n).trim(),this.setAttribute("transform",e)}))}};var X=/translate\([^)]*\)\s*$/;function Y(e,t){var r;return e&&(r=e.mf),void 0===r&&(r=t.marker&&t.marker.standoff||0),t._geo||t._xA?r:-r}x.setTextPointsScale=function(e,t,n){e&&e.each((function(){var e,i=r.select(this),a=i.select("text");if(a.node()){var o=parseFloat(a.attr("x")||0),s=parseFloat(a.attr("y")||0),l=(i.attr("transform")||"").match(X);e=1===t&&1===n?[]:[u(o,s),"scale("+t+","+n+")",u(-o,-s)],l&&e.push(l),i.attr("transform",e.join(""))}}))},x.getMarkerStandoff=Y;var K,J,Q,ee,te,re,ne=Math.atan2,ie=Math.cos,ae=Math.sin;function oe(e,t){var r=t[0],n=t[1];return[r*ie(e)-n*ae(e),r*ae(e)+n*ie(e)]}function se(e,t){var r,i,o=e.ma;void 0===o&&((o=t.marker.angle)&&!n.isArrayOrTypedArray(o)||(o=0));var s=t.marker.angleref;if("previous"===s||"north"===s){if(t._geo){var l=t._geo.project(e.lonlat);r=l[0],i=l[1]}else{var c=t._xA,u=t._yA;if(!c||!u)return 90;r=c.c2p(e.x),i=u.c2p(e.y)}if(t._geo){var h,p=e.lonlat[0],d=e.lonlat[1],f=t._geo.project([p,d+1e-5]),m=t._geo.project([p+1e-5,d]),g=ne(m[1]-i,m[0]-r),y=ne(f[1]-i,f[0]-r);if("north"===s)h=o/180*Math.PI;else if("previous"===s){var v=p/180*Math.PI,x=d/180*Math.PI,b=K/180*Math.PI,_=J/180*Math.PI,w=b-v,k=ie(_)*ae(w),T=ae(_)*ie(x)-ie(_)*ae(x)*ie(w);h=-ne(k,T)-Math.PI,K=p,J=d}var S=oe(g,[ie(h),0]),A=oe(y,[ae(h),0]);o=ne(S[1]+A[1],S[0]+A[0])/Math.PI*180,"previous"!==s||re===t.uid&&e.i===te+1||(o=null)}if("previous"===s&&!t._geo)if(re===t.uid&&e.i===te+1&&a(r)&&a(i)){var M=r-Q,E=i-ee,C=t.line&&t.line.shape||"",P=C.slice(C.length-1);"h"===P&&(E=0),"v"===P&&(M=0),o+=ne(E,M)/Math.PI*180+90}else o=null}return Q=r,ee=i,te=e.i,re=t.uid,o}x.getMarkerAngle=se}}),Qt=p({"src/components/titles/index.js"(e,t){var r=v(),n=k(),i=kt(),a=Ve(),o=st(),s=o.strTranslate,l=Jt(),c=q(),u=At(),h=H(),p=St().OPPOSITE_SIDE,d=/ [XY][0-9]* /;t.exports={draw:function(e,t,f){var m,g=e._fullLayout,y=f.propContainer,v=f.propName,x=f.placeholder,b=f.traceIndex,_=f.avoid||{},w=f.attributes,k=f.transform,T=f.containerGroup,S=1,A=y.title,M=(A&&A.text?A.text:"").trim(),E=!1,C=A&&A.font?A.font:{},P=C.family,L=C.size,I=C.color,z=C.weight,O=C.style,R=C.variant,D=C.textcase,j=C.lineposition,F=C.shadow,B=!!f.subtitlePropName,N=f.subtitlePlaceholder,U=(y.title||{}).subtitle||{text:"",font:{}},V=U.text.trim(),q=!1,H=1,G=U.font,W=G.family,$=G.size,Z=G.color,X=G.weight,Y=G.style,K=G.variant,J=G.textcase,Q=G.lineposition,ee=G.shadow;"title.text"===v?m="titleText":-1!==v.indexOf("axis")?m="axisTitleText":v.indexOf(!0)&&(m="colorbarTitleText");var te=e._context.edits[m];function re(e,t){return void 0!==e&&void 0!==t&&e.replace(d," % ")===t.replace(d," % ")}""===M?S=0:re(M,x)&&(te||(M=""),S=.2,E=!0),B&&(""===V?H=0:re(V,N)&&(te||(V=""),H=.2,q=!0)),f._meta?M=o.templateString(M,f._meta):g._meta&&(M=o.templateString(M,g._meta));var ne,ie=M||V||te;T||(T=o.ensureSingle(g._infolayer,"g","g-"+t),ne=g._hColorbarMoveTitle);var ae=T.selectAll("text."+t).data(ie?[0]:[]);ae.enter().append("text"),ae.text(M).attr("class",t),ae.exit().remove();var oe=null,se=t+"-subtitle",le=V||te;if(B&&le&&((oe=T.selectAll("text."+se).data(le?[0]:[])).enter().append("text"),oe.text(V).attr("class",se),oe.exit().remove()),!ie)return T;function ce(e,t){o.syncOrAsync([ue,he],{title:e,subtitle:t})}function ue(n){var a,h=n.title,p=n.subtitle;if(!k&&ne&&(k={}),k?(a="",k.rotate&&(a+="rotate("+[k.rotate,w.x,w.y]+")"),(k.offset||ne)&&(a+=s(0,(k.offset||0)-(ne||0)))):a=null,h.attr("transform",a),h.style("opacity",S*c.opacity(I)).call(l.font,{color:c.rgb(I),size:r.round(L,2),family:P,weight:z,style:O,variant:R,textcase:D,shadow:F,lineposition:j}).attr(w).call(u.convertToTspans,e,(function(e){if(e){var t=r.select(e.node().parentNode).select("."+se);if(!t.empty()){var n=e.node().getBBox();if(n.height){var i=n.y+n.height+1.6*$;t.attr("y",i)}}}})),p){var d=T.select("."+t+"-math-group"),f=h.node().getBBox(),m=d.node()?d.node().getBBox():void 0,g=m?m.y+m.height+1.6*$:f.y+f.height+1.6*$,y=o.extendFlat({},w,{y:g});p.attr("transform",a),p.style("opacity",H*c.opacity(Z)).call(l.font,{color:c.rgb(Z),size:r.round($,2),family:W,weight:X,style:Y,variant:K,textcase:J,shadow:ee,lineposition:Q}).attr(y).call(u.convertToTspans,e)}return i.previousPromises(e)}function he(t){var i=t.title,a=r.select(i.node().parentNode);if(_&&_.selection&&_.side&&M){a.attr("transform",null);var c=p[_.side],u="left"===_.side||"top"===_.side?-1:1,h=n(_.pad)?_.pad:2,d=l.bBox(a.node()),f={t:0,b:0,l:0,r:0},m=e._fullLayout._reservedMargin;for(var v in m)for(var x in m[v]){var b=m[v][x];f[x]=Math.max(f[x],b)}var w={left:f.l,top:f.t,right:g.width-f.r,bottom:g.height-f.b},k=_.maxShift||u*(w[_.side]-d[_.side]),T=0;if(k<0)T=k;else{var S=_.offsetLeft||0,A=_.offsetTop||0;d.left-=S,d.right-=S,d.top-=A,d.bottom-=A,_.selection.each((function(){var e=l.bBox(this);o.bBoxIntersect(d,e,h)&&(T=Math.max(T,u*(e[_.side]-d[c])+h))})),T=Math.min(k,T),y._titleScoot=Math.abs(T)}if(T>0||k<0){var E={left:[-T,0],right:[T,0],top:[0,-T],bottom:[0,T]}[_.side];a.attr("transform",s(E[0],E[1]))}}}function pe(e,t){e.text(t).on("mouseover.opacity",(function(){r.select(this).transition().duration(h.SHOW_PLACEHOLDER).style("opacity",1)})).on("mouseout.opacity",(function(){r.select(this).transition().duration(h.HIDE_PLACEHOLDER).style("opacity",0)}))}if(ae.call(ce,oe),te&&(M?ae.on(".opacity",null):(pe(ae,x),E=!0),ae.call(u.makeEditable,{gd:e}).on("edit",(function(t){void 0!==b?a.call("_guiRestyle",e,v,t,b):a.call("_guiRelayout",e,v,t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,w.x,w.y)})),B)){if(B&&!M){var de=ae.node().getBBox(),fe=de.y+de.height+1.6*$;oe.attr("y",fe)}V?oe.on(".opacity",null):(pe(oe,N),q=!0),oe.call(u.makeEditable,{gd:e}).on("edit",(function(t){a.call("_guiRelayout",e,"title.subtitle.text",t)})).on("cancel",(function(){this.text(this.attr("data-unformatted")).call(ce)})).on("input",(function(e){this.text(e||" ").call(u.positionText,oe.attr("x"),oe.attr("y"))}))}return ae.classed("js-placeholder",E),oe&&oe.classed("js-placeholder",q),T},SUBTITLE_PADDING_EM:1.6,SUBTITLE_PADDING_MATHJAX_EM:1.6}}}),er=p({"src/plots/cartesian/set_convert.js"(e,t){var r=v(),n=b().utcFormat,i=st(),a=i.numberFormat,o=k(),s=i.cleanNumber,l=i.ms2DateTime,c=i.dateTime2ms,u=i.ensureNumber,h=i.isArrayOrTypedArray,p=T(),d=p.FP_SAFE,f=p.BADNUM,m=p.LOG_CLIP,g=p.ONEWEEK,y=p.ONEDAY,x=p.ONEHOUR,_=p.ONEMIN,w=p.ONESEC,S=vt(),A=yt(),M=A.HOUR_PATTERN,E=A.WEEKDAY_PATTERN;function C(e){return Math.pow(10,e)}function P(e){return null!==e&&void 0!==e}t.exports=function(e,t){t=t||{};var p=e._id||"x",v=p.charAt(0);function b(t,r){if(t>0)return Math.log(t)/Math.LN10;if(t<=0&&r&&e.range&&2===e.range.length){var n=e.range[0],i=e.range[1];return.5*(n+i-2*m*Math.abs(n-i))}return f}function k(t,r,n,a){if((a||{}).msUTC&&o(t))return+t;var s=c(t,n||e.calendar);if(s===f){if(!o(t))return f;t=+t;var l=Math.floor(10*i.mod(t+.05,1)),u=Math.round(t-l/10);s=c(new Date(u))+l/10}return s}function T(t,r,n){return l(t,r,n||e.calendar)}function L(t){return e._categories[Math.round(t)]}function I(t){if(P(t)){if(void 0===e._categoriesMap&&(e._categoriesMap={}),void 0!==e._categoriesMap[t])return e._categoriesMap[t];e._categories.push("number"===typeof t?String(t):t);var r=e._categories.length-1;return e._categoriesMap[t]=r,r}return f}function z(t){if(e._categoriesMap)return e._categoriesMap[t]}function O(e){var t=z(e);return void 0!==t?t:o(e)?+e:void 0}function R(e){return o(e)?+e:z(e)}function D(e,t,n){return r.round(n+t*e,2)}function j(e,t,r){return(e-r)/t}var F=function(t){return o(t)?D(t,e._m,e._b):f},B=function(t){return j(t,e._m,e._b)};if(e.rangebreaks){var N="y"===v;F=function(t){if(!o(t))return f;var r=e._rangebreaks.length;if(!r)return D(t,e._m,e._b);var n=N;e.range[0]>e.range[1]&&(n=!n);for(var i=n?-1:1,a=i*t,s=0,l=0;l<r;l++){var c=i*e._rangebreaks[l].min,u=i*e._rangebreaks[l].max;if(a<c)break;if(!(a>u)){s=a<(c+u)/2?l:l+1;break}s=l+1}var h=e._B[s]||0;return isFinite(h)?D(t,e._m2,h):0},B=function(t){var r=e._rangebreaks.length;if(!r)return j(t,e._m,e._b);for(var n=0,i=0;i<r&&!(t<e._rangebreaks[i].pmin);i++)t>e._rangebreaks[i].pmax&&(n=i+1);return j(t,e._m2,e._B[n])}}e.c2l="log"===e.type?b:u,e.l2c="log"===e.type?C:u,e.l2p=F,e.p2l=B,e.c2p="log"===e.type?function(e,t){return F(b(e,t))}:F,e.p2c="log"===e.type?function(e){return C(B(e))}:B,-1!==["linear","-"].indexOf(e.type)?(e.d2r=e.r2d=e.d2c=e.r2c=e.d2l=e.r2l=s,e.c2d=e.c2r=e.l2d=e.l2r=u,e.d2p=e.r2p=function(t){return e.l2p(s(t))},e.p2d=e.p2r=B,e.cleanPos=u):"log"===e.type?(e.d2r=e.d2l=function(e,t){return b(s(e),t)},e.r2d=e.r2c=function(e){return C(s(e))},e.d2c=e.r2l=s,e.c2d=e.l2r=u,e.c2r=b,e.l2d=C,e.d2p=function(t,r){return e.l2p(e.d2r(t,r))},e.p2d=function(e){return C(B(e))},e.r2p=function(t){return e.l2p(s(t))},e.p2r=B,e.cleanPos=u):"date"===e.type?(e.d2r=e.r2d=i.identity,e.d2c=e.r2c=e.d2l=e.r2l=k,e.c2d=e.c2r=e.l2d=e.l2r=T,e.d2p=e.r2p=function(t,r,n){return e.l2p(k(t,0,n))},e.p2d=e.p2r=function(e,t,r){return T(B(e),t,r)},e.cleanPos=function(t){return i.cleanDate(t,f,e.calendar)}):"category"===e.type?(e.d2c=e.d2l=I,e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=R(t);return void 0!==r?r:e.fraction2r(.5)},e.l2r=e.c2r=u,e.r2l=R,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return"string"===typeof e&&""!==e?e:u(e)}):"multicategory"===e.type&&(e.r2d=e.c2d=e.l2d=L,e.d2r=e.d2l_noadd=O,e.r2c=function(t){var r=O(t);return void 0!==r?r:e.fraction2r(.5)},e.r2c_just_indices=z,e.l2r=e.c2r=u,e.r2l=O,e.d2p=function(t){return e.l2p(e.r2c(t))},e.p2d=function(e){return L(B(e))},e.r2p=e.d2p,e.p2r=B,e.cleanPos=function(e){return Array.isArray(e)||"string"===typeof e&&""!==e?e:u(e)},e.setupMultiCategory=function(r){var n,a,o=e._traceIndices,s=e._matchGroup;if(s&&0===e._categories.length)for(var l in s)if(l!==p){var c=t[S.id2name(l)];o=o.concat(c._traceIndices)}var u=[[0,{}],[0,{}]],d=[];for(n=0;n<o.length;n++){var f=r[o[n]];if(v in f){var m=f[v],g=f._length||i.minRowLength(m);if(h(m[0])&&h(m[1]))for(a=0;a<g;a++){var y=m[0][a],x=m[1][a];P(y)&&P(x)&&(d.push([y,x]),y in u[0][1]||(u[0][1][y]=u[0][0]++),x in u[1][1]||(u[1][1][x]=u[1][0]++))}}}for(d.sort((function(e,t){var r=u[0][1],n=r[e[0]]-r[t[0]];if(n)return n;var i=u[1][1];return i[e[1]]-i[t[1]]})),n=0;n<d.length;n++)I(d[n])}),e.fraction2r=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return e.l2r(r+t*(n-r))},e.r2fraction=function(t){var r=e.r2l(e.range[0]),n=e.r2l(e.range[1]);return(e.r2l(t)-r)/(n-r)},e.limitRange=function(t){var r=e.minallowed,n=e.maxallowed;if(void 0!==r||void 0!==n){t||(t="range");var a=i.nestedProperty(e,t).get(),o=i.simpleMap(a,e.r2l),s=o[1]<o[0];s&&o.reverse();var l=i.simpleMap([r,n],e.r2l);if(void 0!==r&&o[0]<l[0]&&(a[s?1:0]=r),void 0!==n&&o[1]>l[1]&&(a[s?0:1]=n),a[0]===a[1]){var c=e.l2r(r),u=e.l2r(n);if(void 0!==r){var h=c+1;void 0!==n&&(h=Math.min(h,u)),a[s?1:0]=h}if(void 0!==n){var p=u+1;void 0!==r&&(p=Math.max(p,c)),a[s?0:1]=p}}}},e.cleanRange=function(t,r){e._cleanRange(t,r),e.limitRange(t)},e._cleanRange=function(t,r){r||(r={}),t||(t="range");var n,a,s=i.nestedProperty(e,t).get();if(a=(a="date"===e.type?i.dfltRange(e.calendar):"y"===v?A.DFLTRANGEY:"realaxis"===e._name?[0,1]:r.dfltRange||A.DFLTRANGEX).slice(),"tozero"!==e.rangemode&&"nonnegative"!==e.rangemode||(a[0]=0),s&&2===s.length){var l=null===s[0],c=null===s[1];for("date"!==e.type||e.autorange||(s[0]=i.cleanDate(s[0],f,e.calendar),s[1]=i.cleanDate(s[1],f,e.calendar)),n=0;n<2;n++)if("date"===e.type){if(!i.isDateTime(s[n],e.calendar)){e[t]=a;break}if(e.r2l(s[0])===e.r2l(s[1])){var u=i.constrain(e.r2l(s[0]),i.MIN_MS+1e3,i.MAX_MS-1e3);s[0]=e.l2r(u-1e3),s[1]=e.l2r(u+1e3);break}}else{if(!o(s[n])){if(l||c||!o(s[1-n])){e[t]=a;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-d?s[n]=-d:s[n]>d&&(s[n]=d),s[0]===s[1]){var h=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=h,s[1]+=h}}}else i.nestedProperty(e,t).set(a)},e.setScale=function(r){var n=t._size;if(e.overlaying){var i=S.getFromId({_fullLayout:t},e.overlaying);e.domain=i.domain}var a=r&&e._r?"_r":"range",o=e.calendar;e.cleanRange(a);var s,l,c=e.r2l(e[a][0],o),u=e.r2l(e[a][1],o),h="y"===v;if(h?(e._offset=n.t+(1-e.domain[1])*n.h,e._length=n.h*(e.domain[1]-e.domain[0]),e._m=e._length/(c-u),e._b=-e._m*u):(e._offset=n.l+e.domain[0]*n.w,e._length=n.w*(e.domain[1]-e.domain[0]),e._m=e._length/(u-c),e._b=-e._m*c),e._rangebreaks=[],e._lBreaks=0,e._m2=0,e._B=[],e.rangebreaks&&(e._rangebreaks=e.locateBreaks(Math.min(c,u),Math.max(c,u)),e._rangebreaks.length)){for(s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._lBreaks+=Math.abs(l.max-l.min);var p=h;c>u&&(p=!p),p&&e._rangebreaks.reverse();var d=p?-1:1;for(e._m2=d*e._length/(Math.abs(u-c)-e._lBreaks),e._B.push(-e._m2*(h?u:c)),s=0;s<e._rangebreaks.length;s++)l=e._rangebreaks[s],e._B.push(e._B[e._B.length-1]-d*e._m2*(l.max-l.min));for(s=0;s<e._rangebreaks.length;s++)(l=e._rangebreaks[s]).pmin=F(l.min),l.pmax=F(l.max)}if(!isFinite(e._m)||!isFinite(e._b)||e._length<0)throw t._replotting=!1,new Error("Something went wrong with axis scaling")},e.maskBreaks=function(t){var r,n,a,o,l,c=e.rangebreaks||[];c._cachedPatterns||(c._cachedPatterns=c.map((function(t){return t.enabled&&t.bounds?i.simpleMap(t.bounds,t.pattern?s:e.d2c):null}))),c._cachedValues||(c._cachedValues=c.map((function(t){return t.enabled&&t.values?i.simpleMap(t.values,e.d2c).sort(i.sorterAsc):null})));for(var u=0;u<c.length;u++){var h=c[u];if(h.enabled)if(h.bounds){var p=h.pattern;switch(n=(r=c._cachedPatterns[u])[0],a=r[1],p){case E:o=(l=new Date(t)).getUTCDay(),n>a&&(a+=7,o<n&&(o+=7));break;case M:o=(l=new Date(t)).getUTCHours()+(l.getUTCMinutes()/60+l.getUTCSeconds()/3600+l.getUTCMilliseconds()/36e5),n>a&&(a+=24,o<n&&(o+=24));break;case"":o=t}if(o>=n&&o<a)return f}else for(var d=c._cachedValues[u],m=0;m<d.length;m++)if(a=(n=d[m])+h.dvalue,t>=n&&t<a)return f}return t},e.locateBreaks=function(t,r){var n,a,o,l,c=[];if(!e.rangebreaks)return c;var u=e.rangebreaks.slice().sort((function(e,t){return e.pattern===E&&t.pattern===M?-1:t.pattern===E&&e.pattern===M?1:0})),h=function(e,n){if((e=i.constrain(e,t,r))!==(n=i.constrain(n,t,r))){for(var a=!0,o=0;o<c.length;o++){var s=c[o];e<s.max&&n>=s.min&&(e<s.min&&(s.min=e),n>s.max&&(s.max=n),a=!1)}a&&c.push({min:e,max:n})}};for(n=0;n<u.length;n++){var p=u[n];if(p.enabled)if(p.bounds){var d=t,f=r;p.pattern&&(d=Math.floor(d)),o=(a=i.simpleMap(p.bounds,p.pattern?s:e.r2l))[0],l=a[1];var m,v,b=new Date(d);switch(p.pattern){case E:v=g,m=(l-o+(l<o?7:0))*y,d+=o*y-(b.getUTCDay()*y+b.getUTCHours()*x+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;case M:v=y,m=(l-o+(l<o?24:0))*x,d+=o*x-(b.getUTCHours()*x+b.getUTCMinutes()*_+b.getUTCSeconds()*w+b.getUTCMilliseconds());break;default:d=Math.min(a[0],a[1]),m=v=(f=Math.max(a[0],a[1]))-d}for(var k=d;k<f;k+=v)h(k,k+m)}else for(var T=i.simpleMap(p.values,e.d2c),S=0;S<T.length;S++)h(o=T[S],l=o+p.dvalue)}return c.sort((function(e,t){return e.min-t.min})),c},e.makeCalcdata=function(t,r,n){var a,o,s,l,c=e.type,u="date"===c&&t[r+"calendar"];if(r in t){if(a=t[r],l=t._length||i.minRowLength(a),i.isTypedArray(a)&&("linear"===c||"log"===c)){if(l===a.length)return a;if(a.subarray)return a.subarray(0,l)}if("multicategory"===c)return function(e,t){for(var r=new Array(t),n=0;n<t;n++){var i=(e[0]||[])[n],a=(e[1]||[])[n];r[n]=z([i,a])}return r}(a,l);for(o=new Array(l),s=0;s<l;s++)o[s]=e.d2c(a[s],0,u,n)}else{var h=r+"0"in t?e.d2c(t[r+"0"],0,u):0,p=t["d"+r]?Number(t["d"+r]):1;for(a=t[{x:"y",y:"x"}[r]],l=t._length||a.length,o=new Array(l),s=0;s<l;s++)o[s]=h+s*p}if(e.rangebreaks)for(s=0;s<l;s++)o[s]=e.maskBreaks(o[s]);return o},e.isValidRange=function(t,r){return Array.isArray(t)&&2===t.length&&(r&&null===t[0]||o(e.r2l(t[0])))&&(r&&null===t[1]||o(e.r2l(t[1])))},e.getAutorangeDflt=function(t,r){var n=!e.isValidRange(t,"nullOk");return n&&r&&r.reverseDflt?n="reversed":t&&(null===t[0]&&null===t[1]?n=!0:null===t[0]&&null!==t[1]?n="min":null!==t[0]&&null===t[1]&&(n="max")),n},e.isReversed=function(){var t=e.autorange;return"reversed"===t||"min reversed"===t||"max reversed"===t},e.isPtWithinRange=function(t,r){var n=e.c2l(t[v],null,r),i=e.r2l(e.range[0]),a=e.r2l(e.range[1]);return i<a?i<=n&&n<=a:a<=n&&n<=i},e._emptyCategories=function(){e._categories=[],e._categoriesMap={}},e.clearCalc=function(){var r=e._matchGroup;if(r){var n=null,i=null;for(var a in r){var o=t[S.id2name(a)];if(o._categories){n=o._categories,i=o._categoriesMap;break}}n&&i?(e._categories=n,e._categoriesMap=i):e._emptyCategories()}else e._emptyCategories();if(e._initialCategories)for(var s=0;s<e._initialCategories.length;s++)I(e._initialCategories[s])},e.sortByInitialCategories=function(){var r=[];if(e._emptyCategories(),e._initialCategories)for(var n=0;n<e._initialCategories.length;n++)I(e._initialCategories[n]);r=r.concat(e._traceIndices);var i=e._matchGroup;for(var a in i)if(p!==a){var o=t[S.id2name(a)];o._categories=e._categories,o._categoriesMap=e._categoriesMap,r=r.concat(o._traceIndices)}return r};var U=t._d3locale;"date"===e.type&&(e._dateFormat=U?U.timeFormat:n,e._extraFormat=t._extraFormat),e._separators=t.separators,e._numFormat=U?U.numberFormat:a,delete e._minDtick,delete e._forceTick0}}}),tr=p({"src/plots/cartesian/axis_autotype.js"(e,t){var r=k(),n=st(),i=T().BADNUM,a=n.isArrayOrTypedArray,o=n.isDateTime,s=n.cleanNumber,l=Math.round;function c(e,t){return t?r(e):"number"===typeof e}function u(e){return Math.max(1,(e-1)/1e3)}t.exports=function(e,t,n){var h=e,p=n.noMultiCategory;if(a(h)&&!h.length)return"-";if(!p&&function(e){return a(e[0])&&a(e[1])}(h))return"multicategory";if(p&&Array.isArray(h[0])){for(var d=[],f=0;f<h.length;f++)if(a(h[f]))for(var m=0;m<h[f].length;m++)d.push(h[f][m]);h=d}if(function(e,t){for(var n=e.length,i=u(n),a=0,s=0,c={},h=0;h<n;h+=i){var p=e[l(h)],d=String(p);c[d]||(c[d]=1,o(p,t)&&a++,r(p)&&s++)}return a>2*s}(h,t))return"date";var g="strict"!==n.autotypenumbers;return function(e,t){for(var r=e.length,n=u(r),a=0,o=0,c={},h=0;h<r;h+=n){var p=e[l(h)],d=String(p);if(!c[d]){c[d]=1;var f=typeof p;"boolean"===f?o++:(t?s(p)!==i:"number"===f)?a++:"string"===f&&o++}}return o>2*a}(h,g)?"category":function(e,t){for(var r=e.length,n=0;n<r;n++)if(c(e[n],t))return!0;return!1}(h,g)?"linear":"-"}}}),rr=p({"src/plots/cartesian/autorange.js"(e,t){var r=v(),n=k(),i=st(),a=T().FP_SAFE,o=Ve(),s=Jt(),l=vt(),c=l.getFromId,u=l.isLinked;function h(e,t){var r,n,a=[],o=e._fullLayout,s=d(o,t,0),l=d(o,t,1),c=f(e,t),u=c.min,h=c.max;if(0===u.length||0===h.length)return i.simpleMap(t.range,t.r2l);var m=u[0].val,g=h[0].val;for(r=1;r<u.length&&m===g;r++)m=Math.min(m,u[r].val);for(r=1;r<h.length&&m===g;r++)g=Math.max(g,h[r].val);var y=t.autorange,v="reversed"===y||"min reversed"===y||"max reversed"===y;if(!v&&t.range){var x=i.simpleMap(t.range,t.r2l);v=x[1]<x[0]}"reversed"===t.autorange&&(t.autorange=!0);var b,_,w,k,T,A,M=t.rangemode,E="tozero"===M,C="nonnegative"===M,P=t._length,L=P/10,I=0;for(r=0;r<u.length;r++)for(b=u[r],n=0;n<h.length;n++)(A=(_=h[n]).val-b.val-p(t,b.val,_.val))>0&&((T=P-s(b)-l(_))>L?A/T>I&&(w=b,k=_,I=A/T):A/P>I&&(w={val:b.val,nopad:1},k={val:_.val,nopad:1},I=A/P));if(m===g){var z=m-1,O=m+1;if(E)if(0===m)a=[0,1];else{var R=(m>0?h:u).reduce((function(e,t){return Math.max(e,l(t))}),0),D=m/(1-Math.min(.5,R/P));a=m>0?[0,D]:[D,0]}else a=C?[Math.max(0,z),Math.max(1,O)]:[z,O]}else E?(w.val>=0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:0,nopad:1})):C&&(w.val-I*s(w)<0&&(w={val:0,nopad:1}),k.val<=0&&(k={val:1,nopad:1})),I=(k.val-w.val-p(t,b.val,_.val))/(P-s(w)-l(k)),a=[w.val-I*s(w),k.val+I*l(k)];return a=S(a,t),t.limitRange&&t.limitRange(),v&&a.reverse(),i.simpleMap(a,t.l2r||Number)}function p(e,t,r){var n=0;if(e.rangebreaks)for(var i=e.locateBreaks(t,r),a=0;a<i.length;a++){var o=i[a];n+=o.max-o.min}return n}function d(e,t,n){var a=.05*t._length,o=t._anchorAxis||{};if(-1!==(t.ticklabelposition||"").indexOf("inside")||-1!==(o.ticklabelposition||"").indexOf("inside")){var l=t.isReversed();if(!l){var c=i.simpleMap(t.range,t.r2l);l=c[1]<c[0]}l&&(n=!n)}var h=0;return u(e,t._id)||(h=function(e,t,n){var a=0,o="x"===t._id.charAt(0);for(var l in e._plots){var c=e._plots[l];if(t._id===c.xaxis._id||t._id===c.yaxis._id){var u=(o?c.yaxis:c.xaxis)||{};if(-1!==(u.ticklabelposition||"").indexOf("inside")&&(!n&&("left"===u.side||"bottom"===u.side)||n&&("top"===u.side||"right"===u.side))){if(u._vals){var h=i.deg2rad(u._tickAngles[u._id+"tick"]||0),p=Math.abs(Math.cos(h)),d=Math.abs(Math.sin(h));if(!u._vals[0].bb){var f=u._id+"tick";u._selections[f].each((function(e){var t=r.select(this);t.select(".text-math-group").empty()&&(e.bb=s.bBox(t.node()))}))}for(var m=0;m<u._vals.length;m++){var g=u._vals[m].bb;if(g){var y=6+g.width,v=6+g.height;a=Math.max(a,o?Math.max(y*p,v*d):Math.max(v*p,y*d))}}}"inside"===u.ticks&&"inside"===u.ticklabelposition&&(a+=u.ticklen||0)}}}return a}(e,t,n)),a=Math.max(h,a),"domain"===t.constrain&&t._inputDomain&&(a*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0])),function(e){return e.nopad?0:e.pad+(e.extrapad?a:h)}}function f(e,t,r){var n,i,a,o=t._id,s=e._fullData,l=e._fullLayout,u=[],h=[];function p(e,t){for(n=0;n<t.length;n++){var r=e[t[n]],s=(r._extremes||{})[o];if(!0===r.visible&&s){for(i=0;i<s.min.length;i++)a=s.min[i],m(u,a.val,a.pad,{extrapad:a.extrapad});for(i=0;i<s.max.length;i++)a=s.max[i],g(h,a.val,a.pad,{extrapad:a.extrapad})}}}if(p(s,t._traceIndices),p(l.annotations||[],t._annIndices||[]),p(l.shapes||[],t._shapeIndices||[]),t._matchGroup&&!r)for(var d in t._matchGroup)if(d!==t._id){var y=c(e,d),v=f(e,y,!0),x=t._length/y._length;for(i=0;i<v.min.length;i++)a=v.min[i],m(u,a.val,a.pad*x,{extrapad:a.extrapad});for(i=0;i<v.max.length;i++)a=v.max[i],g(h,a.val,a.pad*x,{extrapad:a.extrapad})}return{min:u,max:h}}function m(e,t,r,n){y(e,t,r,n,b)}function g(e,t,r,n){y(e,t,r,n,_)}function y(e,t,r,n,i){for(var a=n.tozero,o=n.extrapad,s=!0,l=0;l<e.length&&s;l++){var c=e[l];if(i(c.val,t)&&c.pad>=r&&(c.extrapad||!o)){s=!1;break}i(t,c.val)&&c.pad<=r&&(o||!c.extrapad)&&(e.splice(l,1),l--)}if(s){var u=a&&0===t;e.push({val:t,pad:u?0:r,extrapad:!u&&o})}}function x(e){return n(e)&&Math.abs(e)<a}function b(e,t){return e<=t}function _(e,t){return e>=t}function w(e,t,r){return void 0===t||void 0===r||(t=e.d2l(t))<(r=e.d2l(r))}function S(e,t){if(!t||!t.autorangeoptions)return e;var r=e[0],n=e[1],a=t.autorangeoptions.include;if(void 0!==a){var o=t.d2l(r),s=t.d2l(n);i.isArrayOrTypedArray(a)||(a=[a]);for(var l=0;l<a.length;l++){var c=t.d2l(a[l]);o>=c&&(o=c,r=c),s<=c&&(s=c,n=c)}}return r=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.minallowed&&w(t,r.minallowed,r.maxallowed)?r.minallowed:r&&void 0!==r.clipmin&&w(t,r.clipmin,r.clipmax)?Math.max(e,t.d2l(r.clipmin)):e}(r,t),n=function(e,t){var r=t.autorangeoptions;return r&&void 0!==r.maxallowed&&w(t,r.minallowed,r.maxallowed)?r.maxallowed:r&&void 0!==r.clipmax&&w(t,r.clipmin,r.clipmax)?Math.min(e,t.d2l(r.clipmax)):e}(n,t),[r,n]}t.exports={applyAutorangeOptions:S,getAutoRange:h,makePadFn:d,doAutoRange:function(e,t,r){if(t.setScale(),t.autorange){t.range=r?r.slice():h(e,t),t._r=t.range.slice(),t._rl=i.simpleMap(t._r,t.r2l);var n=t._input,a={};a[t._attr+".range"]=t.range,a[t._attr+".autorange"]=t.autorange,o.call("_storeDirectGUIEdit",e.layout,e._fullLayout._preGUI,a),n.range=t.range.slice(),n.autorange=t.autorange}var s=t._anchorAxis;if(s&&s.rangeslider){var l=s.rangeslider[t._name];l&&"auto"===l.rangemode&&(l.range=h(e,t)),s._input.rangeslider[t._name]=i.extendFlat({},l)}},findExtremes:function(e,t,r){r||(r={}),e._m||e.setScale();var i,o,s,l,c,u,h,p,d,f=[],y=[],v=t.length,b=r.padded||!1,_=r.tozero&&("linear"===e.type||"-"===e.type),w="log"===e.type,k=!1,T=r.vpadLinearized||!1;function S(e){if(Array.isArray(e))return k=!0,function(t){return Math.max(Number(e[t]||0),0)};var t=Math.max(Number(e||0),0);return function(){return t}}var A=S((e._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=S((e._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),E=S(r.vpadplus||r.vpad),C=S(r.vpadminus||r.vpad);if(!k){if(p=1/0,d=-1/0,w)for(i=0;i<v;i++)(o=t[i])<p&&o>0&&(p=o),o>d&&o<a&&(d=o);else for(i=0;i<v;i++)(o=t[i])<p&&o>-a&&(p=o),o>d&&o<a&&(d=o);t=[p,d],v=2}var P={tozero:_,extrapad:b};function L(r){s=t[r],n(s)&&(u=A(r),h=M(r),T?(l=e.c2l(s)-C(r),c=e.c2l(s)+E(r)):(p=s-C(r),d=s+E(r),w&&p<d/10&&(p=d/10),l=e.c2l(p),c=e.c2l(d)),_&&(l=Math.min(0,l),c=Math.max(0,c)),x(l)&&m(f,l,h,P),x(c)&&g(y,c,u,P))}var I=Math.min(6,v);for(i=0;i<I;i++)L(i);for(i=v-1;i>=I;i--)L(i);return{min:f,max:y,opts:r}},concatExtremes:f}}}),nr=p({"src/plots/cartesian/axes.js"(e,t){var r=v(),n=k(),i=kt(),a=Ve(),o=st(),s=o.strTranslate,l=At(),c=Qt(),u=q(),h=Jt(),p=Ct(),d=Ot(),f=T(),m=f.ONEMAXYEAR,g=f.ONEAVGYEAR,y=f.ONEMINYEAR,x=f.ONEMAXQUARTER,b=f.ONEAVGQUARTER,_=f.ONEMINQUARTER,w=f.ONEMAXMONTH,S=f.ONEAVGMONTH,A=f.ONEMINMONTH,M=f.ONEWEEK,E=f.ONEDAY,C=E/2,P=f.ONEHOUR,L=f.ONEMIN,I=f.ONESEC,z=f.ONEMILLI,O=f.ONEMICROSEC,R=f.MINUS_SIGN,D=f.BADNUM,j={K:"zeroline"},F={K:"gridline",L:"path"},B={K:"minor-gridline",L:"path"},N={K:"tick",L:"path"},U={K:"tick",L:"text"},V={width:["x","r","l","xl","xr"],height:["y","t","b","yt","yb"],right:["r","xr"],left:["l","xl"],top:["t","yt"],bottom:["b","yb"]},H=St(),G=H.MID_SHIFT,W=H.CAP_SHIFT,$=H.LINE_SPACING,Z=H.OPPOSITE_SIDE,X=t.exports={};X.setConvert=er();var Y=tr(),K=vt(),J=K.idSort,Q=K.isLinked;X.id2name=K.id2name,X.name2id=K.name2id,X.cleanId=K.cleanId,X.list=K.list,X.listIds=K.listIds,X.getFromId=K.getFromId,X.getFromTrace=K.getFromTrace;var ee=rr();function te(e){var t=1e-4*(e[1]-e[0]);return[e[0]-t,e[1]+t]}X.getAutoRange=ee.getAutoRange,X.findExtremes=ee.findExtremes,X.coerceRef=function(e,t,r,n,i,a){var s=n.charAt(n.length-1),l=r._fullLayout._subplots[s+"axis"],c=n+"ref",u={};return i||(i=l[0]||("string"===typeof a?a:a[0])),a||(a=i),l=l.concat(l.map((function(e){return e+" domain"}))),u[c]={valType:"enumerated",values:l.concat(a?"string"===typeof a?[a]:a:[]),dflt:i},o.coerce(e,t,u,c)},X.getRefType=function(e){return void 0===e?e:"paper"===e?"paper":"pixel"===e?"pixel":/( domain)$/.test(e)?"domain":"range"},X.coercePosition=function(e,t,r,n,i,a){var s,l;if("range"!==X.getRefType(n))s=o.ensureNumber,l=r(i,a);else{var c=X.getFromId(t,n);l=r(i,a=c.fraction2r(a)),s=c.cleanPos}e[i]=s(l)},X.cleanPosition=function(e,t,r){return("paper"===r||"pixel"===r?o.ensureNumber:X.getFromId(t,r).cleanPos)(e)},X.redrawComponents=function(e,t){t=t||X.listIds(e);var r=e._fullLayout;function n(n,i,o,s){for(var l=a.getComponentMethod(n,i),c={},u=0;u<t.length;u++)for(var h=r[X.id2name(t[u])][o],p=0;p<h.length;p++){var d=h[p];if(!c[d]&&(l(e,d),c[d]=1,s))return}}n("annotations","drawOne","_annIndices"),n("shapes","drawOne","_shapeIndices"),n("images","draw","_imgIndices",!0),n("selections","drawOne","_selectionIndices")};var re=X.getDataConversions=function(e,t,r,n){var i,a="x"===r||"y"===r||"z"===r?r:n;if(o.isArrayOrTypedArray(a)){if(i={type:Y(n,void 0,{autotypenumbers:e._fullLayout.autotypenumbers}),_categories:[]},X.setConvert(i),"category"===i.type)for(var s=0;s<n.length;s++)i.d2c(n[s])}else i=X.getFromTrace(e,t,a);return i?{d2c:i.d2c,c2d:i.c2d}:"ids"===a?{d2c:ie,c2d:ie}:{d2c:ne,c2d:ne}};function ne(e){return+e}function ie(e){return String(e)}function ae(e,t){return Math.abs((e/t+.5)%1-.5)<.001}function oe(e,t){return Math.abs(e/t-1)<.001}function se(e){return+e.substring(1)}function le(e,t){return e.rangebreaks&&(t=t.filter((function(t){return e.maskBreaks(t.x)!==D}))),t}function ce(e){var t=e._mainAxis,r=[];if(t._vals)for(var n=0;n<t._vals.length;n++)if(!t._vals[n].noTick){var i=t.l2p(t._vals[n].x),a=e.p2l(i),o=X.tickText(e,a);t._vals[n].minor&&(o.minor=!0,o.text=""),r.push(o)}return r=le(e,r)}function ue(e,t){var r=te(o.simpleMap(e.range,e.r2l)),n=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]),a="category"===e.type?e.d2l_noadd:e.d2l;"log"===e.type&&"L"!==String(e.dtick).charAt(0)&&(e.dtick="L"+Math.pow(10,Math.floor(Math.min(e.range[0],e.range[1]))-1));for(var s=[],l=0;l<=1;l++)if((void 0===t||!(t&&l||!1===t&&!l))&&(!l||e.minor)){var c=l?e.minor.tickvals:e.tickvals,u=l?[]:e.ticktext;if(c){o.isArrayOrTypedArray(u)||(u=[]);for(var h=0;h<c.length;h++){var p=a(c[h]);if(p>n&&p<i){var d=X.tickText(e,p,!1,String(u[h]));l&&(d.minor=!0,d.text=""),s.push(d)}}}}return s=le(e,s)}X.getDataToCoordFunc=function(e,t,r,n){return re(e,t,r,n).d2c},X.counterLetter=function(e){var t=e.charAt(0);return"x"===t?"y":"y"===t?"x":void 0},X.minDtick=function(e,t,r,n){-1===["log","category","multicategory"].indexOf(e.type)&&n?void 0===e._minDtick?(e._minDtick=t,e._forceTick0=r):e._minDtick&&((e._minDtick/t+1e-6)%1<2e-6&&((r-e._forceTick0)/t%1+1.000001)%1<2e-6?(e._minDtick=t,e._forceTick0=r):((t/e._minDtick+1e-6)%1>2e-6||((r-e._forceTick0)/e._minDtick%1+1.000001)%1>2e-6)&&(e._minDtick=0)):e._minDtick=0},X.saveRangeInitial=function(e,t){for(var r=X.list(e,"",!0),n=!1,i=0;i<r.length;i++){var a=r[i],o=void 0===a._rangeInitial0&&void 0===a._rangeInitial1,s=o||a.range[0]!==a._rangeInitial0||a.range[1]!==a._rangeInitial1,l=a.autorange;(o&&!0!==l||t&&s)&&(a._rangeInitial0="min"===l||"max reversed"===l?void 0:a.range[0],a._rangeInitial1="max"===l||"min reversed"===l?void 0:a.range[1],a._autorangeInitial=l,n=!0)}return n},X.saveShowSpikeInitial=function(e,t){for(var r=X.list(e,"",!0),n=!1,i="on",a=0;a<r.length;a++){var o=r[a],s=void 0===o._showSpikeInitial,l=s||!(o.showspikes===o._showspikes);(s||t&&l)&&(o._showSpikeInitial=o.showspikes,n=!0),"on"!==i||o.showspikes||(i="off")}return e._fullLayout._cartesianSpikesEnabled=i,n},X.autoBin=function(e,t,r,i,a,s){var l,c=o.aggNums(Math.min,null,e),u=o.aggNums(Math.max,null,e);if("category"===t.type||"multicategory"===t.type)return{start:c-.5,end:u+.5,size:Math.max(1,Math.round(s)||1),_dataSpan:u-c};if(a||(a=t.calendar),l="log"===t.type?{type:"linear",range:[c,u]}:{type:t.type,range:o.simpleMap([c,u],t.c2r,0,a),calendar:a},X.setConvert(l),s=s&&d.dtick(s,l.type))l.dtick=s,l.tick0=d.tick0(void 0,l.type,a);else{var h;if(r)h=(u-c)/r;else{var p=o.distinctVals(e),f=Math.pow(10,Math.floor(Math.log(p.minDiff)/Math.LN10)),m=f*o.roundUp(p.minDiff/f,[.9,1.9,4.9,9.9],!0);h=Math.max(m,2*o.stdev(e)/Math.pow(e.length,i?.25:.4)),n(h)||(h=1)}X.autoTicks(l,h)}var g,y=l.dtick,v=X.tickIncrement(X.tickFirst(l),y,"reverse",a);if("number"===typeof y)v=function(e,t,r,i,a){var o=0,s=0,l=0,c=0;function u(t){return(1+100*(t-e)/r.dtick)%100<2}for(var h=0;h<t.length;h++)t[h]%1===0?l++:n(t[h])||c++,u(t[h])&&o++,u(t[h]+r.dtick/2)&&s++;var p=t.length-c;if(l===p&&"date"!==r.type)r.dtick<1?e=i-.5*r.dtick:(e-=.5)+r.dtick<i&&(e+=r.dtick);else if(s<.1*p&&(o>.3*p||u(i)||u(a))){var d=r.dtick/2;e+=e+d<i?d:-d}return e}(v,e,l,c,u),g=v+(1+Math.floor((u-v)/y))*y;else for("M"===l.dtick.charAt(0)&&(v=function(e,t,r,n,i){var a=o.findExactDates(t,i),s=.8;if(a.exactDays>s){var l=Number(r.substr(1));a.exactYears>s&&l%12===0?e=X.tickIncrement(e,"M6","reverse")+1.5*E:a.exactMonths>s?e=X.tickIncrement(e,"M1","reverse")+15.5*E:e-=C;var c=X.tickIncrement(e,r);if(c<=n)return c}return e}(v,e,y,c,a)),g=v;g<=u;)g=X.tickIncrement(g,y,!1,a);return{start:t.c2r(v,0,a),end:t.c2r(g,0,a),size:y,_dataSpan:u-c}},X.prepMinorTicks=function(e,t,r){if(!t.minor.dtick){delete e.dtick;var i,a=t.dtick&&n(t._tmin);if(a){var s=X.tickIncrement(t._tmin,t.dtick,!0);i=[t._tmin,.99*s+.01*t._tmin]}else{var l=o.simpleMap(t.range,t.r2l);i=[l[0],.8*l[0]+.2*l[1]]}if(e.range=o.simpleMap(i,t.l2r),e._isMinor=!0,X.prepTicks(e,r),a){var c=n(t.dtick),u=n(e.dtick),h=c?t.dtick:+t.dtick.substring(1),p=u?e.dtick:+e.dtick.substring(1);c&&u?ae(h,p)?h===2*M&&p===2*E&&(e.dtick=M):h===2*M&&p===3*E?e.dtick=M:h!==M||(t._input.minor||{}).nticks?oe(h/p,2.5)?e.dtick=h/2:e.dtick=h:e.dtick=E:"M"===String(t.dtick).charAt(0)?u?e.dtick="M1":ae(h,p)?h>=12&&2===p&&(e.dtick="M3"):e.dtick=t.dtick:"L"===String(e.dtick).charAt(0)?"L"===String(t.dtick).charAt(0)?ae(h,p)||(e.dtick=oe(h/p,2.5)?t.dtick/2:t.dtick):e.dtick="D1":"D2"===e.dtick&&+t.dtick>1&&(e.dtick=1)}e.range=t.range}void 0===t.minor._tick0Init&&(e.tick0=t.tick0)},X.prepTicks=function(e,t){var r=o.simpleMap(e.range,e.r2l,void 0,void 0,t);if("auto"===e.tickmode||!e.dtick){var i,a=e.nticks;a||("category"===e.type||"multicategory"===e.type?(i=e.tickfont?o.bigFont(e.tickfont.size||12):15,a=e._length/i):(i="y"===e._id.charAt(0)?40:80,a=o.constrain(e._length/i,4,9)+1),"radialaxis"===e._name&&(a*=2)),e.minor&&"array"!==e.minor.tickmode||"array"===e.tickmode&&(a*=100),e._roughDTick=Math.abs(r[1]-r[0])/a,X.autoTicks(e,e._roughDTick),e._minDtick>0&&e.dtick<2*e._minDtick&&(e.dtick=e._minDtick,e.tick0=e.l2r(e._forceTick0))}"period"===e.ticklabelmode&&function(e){var t;function r(){return!(n(e.dtick)||"M"!==e.dtick.charAt(0))}var i=r(),a=X.getTickFormat(e);if(a){var o=e._dtickInit!==e.dtick;/%[fLQsSMX]/.test(a)||(/%[HI]/.test(a)?(t=P,o&&!i&&e.dtick<P&&(e.dtick=P)):/%p/.test(a)?(t=C,o&&!i&&e.dtick<C&&(e.dtick=C)):/%[Aadejuwx]/.test(a)?(t=E,o&&!i&&e.dtick<E&&(e.dtick=E)):/%[UVW]/.test(a)?(t=M,o&&!i&&e.dtick<M&&(e.dtick=M)):/%[Bbm]/.test(a)?(t=S,o&&(i?se(e.dtick)<1:e.dtick<A)&&(e.dtick="M1")):/%[q]/.test(a)?(t=b,o&&(i?se(e.dtick)<3:e.dtick<_)&&(e.dtick="M3")):/%[Yy]/.test(a)&&(t=g,o&&(i?se(e.dtick)<12:e.dtick<y)&&(e.dtick="M12")))}(i=r())&&e.tick0===e._dowTick0&&(e.tick0=e._rawTick0),e._definedDelta=t}(e),e.tick0||(e.tick0="date"===e.type?"2000-01-01":0),"date"===e.type&&e.dtick<.1&&(e.dtick=.1),xe(e)},X.calcTicks=function(e,t){for(var r,i,a,s,l=e.type,c=e.calendar,u=e.ticklabelstep,h="period"===e.ticklabelmode,p=e.range[0]>e.range[1],d=!e.ticklabelindex||o.isArrayOrTypedArray(e.ticklabelindex)?e.ticklabelindex:[e.ticklabelindex],f=o.simpleMap(e.range,e.r2l,void 0,void 0,t),v=f[1]<f[0],k=Math.min(f[0],f[1]),T=Math.max(f[0],f[1]),R=Math.max(1e3,e._length||0),j=[],F=[],B=[],N=[],U=[],V=e.minor&&(e.minor.ticks||e.minor.showgrid),q=1;q>=(V?0:1);q--){var H=!q;q?(e._dtickInit=e.dtick,e._tick0Init=e.tick0):(e.minor._dtickInit=e.minor.dtick,e.minor._tick0Init=e.minor.tick0);var G=q?e:o.extendFlat({},e,e.minor);if(H?X.prepMinorTicks(G,e,t):X.prepTicks(G,t),"array"!==G.tickmode)if("sync"!==G.tickmode){var W=te(f),$=W[0],Z=W[1],Y=n(G.dtick),K="log"===l&&!(Y||"L"===G.dtick.charAt(0)),J=X.tickFirst(G,t);if(q){if(e._tmin=J,J<$!==v)break;"category"!==l&&"multicategory"!==l||(Z=v?Math.max(-.5,Z):Math.min(e._categories.length-.5,Z))}var Q,ee,re=null,ne=J;q&&(Y?ee=e.dtick:"date"===l?"string"===typeof e.dtick&&"M"===e.dtick.charAt(0)&&(ee=S*e.dtick.substring(1)):ee=e._roughDTick,Q=Math.round((e.r2l(ne)-e.r2l(e.tick0))/ee)-1);var ie=G.dtick;for(G.rangebreaks&&G._tick0Init!==G.tick0&&(ne=Be(ne,e),v||(ne=X.tickIncrement(ne,ie,!v,c))),q&&h&&(ne=X.tickIncrement(ne,ie,!v,c),Q--);v?ne>=Z:ne<=Z;ne=X.tickIncrement(ne,ie,v,c)){if(q&&Q++,G.rangebreaks&&!v){if(ne<$)continue;if(G.maskBreaks(ne)===D&&Be(ne,G)>=T)break}if(B.length>R||ne===re)break;re=ne;var ae={value:ne};q?(K&&ne!==(0|ne)&&(ae.simpleLabel=!0),u>1&&Q%u&&(ae.skipLabel=!0),B.push(ae)):(ae.minor=!0,N.push(ae))}}else B=[],j=ce(e);else q?(B=[],j=ue(e,!H)):(N=[],F=ue(e,!H))}if(!N||N.length<2)d=!1;else{var oe=(N[1].value-N[0].value)*(p?-1:1);r=oe,i=e.tickformat,(/%f/.test(i)?r>=O:/%L/.test(i)?r>=z:/%[SX]/.test(i)?r>=I:/%M/.test(i)?r>=L:/%[HI]/.test(i)?r>=P:/%p/.test(i)?r>=C:/%[Aadejuwx]/.test(i)?r>=E:/%[UVW]/.test(i)?r>=M:/%[Bbm]/.test(i)?r>=A:/%[q]/.test(i)?r>=_:!/%[Yy]/.test(i)||r>=y)||(d=!1)}if(d){var se=B.concat(N);h&&B.length&&(se=se.slice(1)),(se=se.sort((function(e,t){return e.value-t.value})).filter((function(e,t,r){return 0===t||e.value!==r[t-1].value}))).map((function(e,t){return void 0!==e.minor||e.skipLabel?null:t})).filter((function(e){return null!==e})).forEach((function(e){d.map((function(t){var r=e+t;r>=0&&r<se.length&&o.pushUnique(U,se[r])}))}))}else U=B;if(V&&!("inside"===e.minor.ticks&&"outside"===e.ticks||"outside"===e.minor.ticks&&"inside"===e.ticks)){for(var le=B.map((function(e){return e.value})),he=[],pe=0;pe<N.length;pe++){var de=N[pe],fe=de.value;if(-1===le.indexOf(fe)){for(var me=!1,ge=0;!me&&ge<B.length;ge++)1e7+B[ge].value===1e7+fe&&(me=!0);me||he.push(de)}}N=he}if(h&&function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n].value,a=n,o=n+1;n<e.length-1?(a=n,o=n+1):n>0?(a=n-1,o=n):(a=n,o=n);var s,l=e[a].value,c=e[o].value,u=Math.abs(c-l),h=r||u,p=0;h>=y?p=u>=y&&u<=m?u:g:r===b&&h>=_?p=u>=_&&u<=x?u:b:h>=A?p=u>=A&&u<=w?u:S:r===M&&h>=M?p=M:h>=E?p=E:r===C&&h>=C?p=C:r===P&&h>=P&&(p=P),p>=u&&(p=u,s=!0);var d=i+p;if(t.rangebreaks&&p>0){for(var f=0,v=0;v<84;v++){var k=(v+.5)/84;t.maskBreaks(i*(1-k)+k*d)!==D&&f++}(p*=f/84)||(e[n].drop=!0),s&&u>M&&(p=u)}(p>0||0===n)&&(e[n].periodX=i+p/2)}}(U,e,e._definedDelta),e.rangebreaks){var ye="y"===e._id.charAt(0),ve=1;"auto"===e.tickmode&&(ve=e.tickfont?e.tickfont.size:12);var xe=NaN;for(a=B.length-1;a>-1;a--)if(B[a].drop)B.splice(a,1);else{B[a].value=Be(B[a].value,e);var be=e.c2p(B[a].value);(ye?xe>be-ve:xe<be+ve)?B.splice(v?a+1:a,1):xe=be}}Fe(e)&&360===Math.abs(f[1]-f[0])&&B.pop(),e._tmax=(B[B.length-1]||{}).value,e._prevDateHead="",e._inCalcTicks=!0;var _e,we=function(t){t.text="",e._prevDateHead=s};function ke(e,t){var r=X.tickText(e,t.value,!1,t.simpleLabel),n=t.periodX;return void 0!==n&&(r.periodX=n,(n>T||n<k)&&(n>T&&(r.periodX=T),n<k&&(r.periodX=k),we(r))),r}for(B=B.concat(N),a=0;a<B.length;a++){var Te=B[a].minor,Se=B[a].value;Te?((_e=d&&-1!==U.indexOf(B[a])?ke(e,B[a]):{x:Se}).minor=!0,F.push(_e)):(s=e._prevDateHead,_e=ke(e,B[a]),(B[a].skipLabel||d&&-1===U.indexOf(B[a]))&&we(_e),j.push(_e))}return j=j.concat(F),e._inCalcTicks=!1,h&&j.length&&(j[0].noTick=!0),j};var he=[2,5,10],pe=[1,2,3,6,12],de=[1,2,5,10,15,30],fe=[1,2,3,7,14],me=[-.046,0,.301,.477,.602,.699,.778,.845,.903,.954,1],ge=[-.301,0,.301,.699,1],ye=[15,30,45,90,180];function ve(e,t,r){return t*o.roundUp(e/t,r)}function xe(e){var t=e.dtick;if(e._tickexponent=0,n(t)||"string"===typeof t||(t=1),"category"!==e.type&&"multicategory"!==e.type||(e._tickround=null),"date"===e.type){var r=e.r2l(e.tick0),i=e.l2r(r).replace(/(^-|i)/g,""),a=i.length;if("M"===String(t).charAt(0))a>10||"01-01"!==i.substr(5)?e._tickround="d":e._tickround=+t.substr(1)%12===0?"y":"m";else if(t>=E&&a<=10||t>=15*E)e._tickround="d";else if(t>=L&&a<=16||t>=P)e._tickround="M";else if(t>=I&&a<=19||t>=L)e._tickround="S";else{var o=e.l2r(r+t).replace(/^-/,"").length;e._tickround=Math.max(a,o)-20,e._tickround<0&&(e._tickround=4)}}else if(n(t)||"L"===t.charAt(0)){var s=e.range.map(e.r2d||Number);n(t)||(t=Number(t.substr(1))),e._tickround=2-Math.floor(Math.log(t)/Math.LN10+.01);var l=Math.max(Math.abs(s[0]),Math.abs(s[1])),c=Math.floor(Math.log(l)/Math.LN10+.01),u=void 0===e.minexponent?3:e.minexponent;Math.abs(c)>u&&(we(e.exponentformat)&&!ke(c)?e._tickexponent=3*Math.round((c-1)/3):e._tickexponent=c)}else e._tickround=null}function be(e,t,r){var n=e.tickfont||{};return{x:t,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontTextcase:n.textcase,fontLineposition:n.lineposition,fontShadow:n.shadow,fontColor:n.color}}X.autoTicks=function(e,t,r){var i;function a(e){return Math.pow(e,Math.floor(Math.log(t)/Math.LN10))}if("date"===e.type){e.tick0=o.dateTick0(e.calendar,0);var s=2*t;if(s>g)t/=g,i=a(10),e.dtick="M"+12*ve(t,i,he);else if(s>S)t/=S,e.dtick="M"+ve(t,1,pe);else if(s>E){if(e.dtick=ve(t,E,e._hasDayOfWeekBreaks?[1,2,7,14]:fe),!r){var l=X.getTickFormat(e),c="period"===e.ticklabelmode;c&&(e._rawTick0=e.tick0),/%[uVW]/.test(l)?e.tick0=o.dateTick0(e.calendar,2):e.tick0=o.dateTick0(e.calendar,1),c&&(e._dowTick0=e.tick0)}}else s>P?e.dtick=ve(t,P,pe):s>L?e.dtick=ve(t,L,de):s>I?e.dtick=ve(t,I,de):(i=a(10),e.dtick=ve(t,i,he))}else if("log"===e.type){e.tick0=0;var u=o.simpleMap(e.range,e.r2l);if(e._isMinor&&(t*=1.5),t>.7)e.dtick=Math.ceil(t);else if(Math.abs(u[1]-u[0])<1){var h=1.5*Math.abs((u[1]-u[0])/t);t=Math.abs(Math.pow(10,u[1])-Math.pow(10,u[0]))/h,i=a(10),e.dtick="L"+ve(t,i,he)}else e.dtick=t>.3?"D2":"D1"}else"category"===e.type||"multicategory"===e.type?(e.tick0=0,e.dtick=Math.ceil(Math.max(t,1))):Fe(e)?(e.tick0=0,i=1,e.dtick=ve(t,i,ye)):(e.tick0=0,i=a(10),e.dtick=ve(t,i,he));if(0===e.dtick&&(e.dtick=1),!n(e.dtick)&&"string"!==typeof e.dtick){var p=e.dtick;throw e.dtick=1,"ax.dtick error: "+String(p)}},X.tickIncrement=function(e,t,i,a){var s=i?-1:1;if(n(t))return o.increment(e,s*t);var l=t.charAt(0),c=s*Number(t.substr(1));if("M"===l)return o.incrementMonth(e,c,a);if("L"===l)return Math.log(Math.pow(10,e)+c)/Math.LN10;if("D"===l){var u="D2"===t?ge:me,h=e+.01*s,p=o.roundUp(o.mod(h,1),u,i);return Math.floor(h)+Math.log(r.round(Math.pow(10,p),1))/Math.LN10}throw"unrecognized dtick "+String(t)},X.tickFirst=function(e,t){var i=e.r2l||Number,a=o.simpleMap(e.range,i,void 0,void 0,t),s=a[1]<a[0],l=s?Math.floor:Math.ceil,c=te(a)[0],u=e.dtick,h=i(e.tick0);if(n(u)){var p=l((c-h)/u)*u+h;return"category"!==e.type&&"multicategory"!==e.type||(p=o.constrain(p,0,e._categories.length-1)),p}var d=u.charAt(0),f=Number(u.substr(1));if("M"===d){for(var m,g,y,v=0,x=h;v<10;){if(((m=X.tickIncrement(x,u,s,e.calendar))-c)*(x-c)<=0)return s?Math.min(x,m):Math.max(x,m);g=(c-(x+m)/2)/(m-x),y=d+(Math.abs(Math.round(g))||1)*f,x=X.tickIncrement(x,y,g<0?!s:s,e.calendar),v++}return o.error("tickFirst did not converge",e),x}if("L"===d)return Math.log(l((Math.pow(10,c)-h)/f)*f+h)/Math.LN10;if("D"===d){var b="D2"===u?ge:me,_=o.roundUp(o.mod(c,1),b,s);return Math.floor(c)+Math.log(r.round(Math.pow(10,_),1))/Math.LN10}throw"unrecognized dtick "+String(u)},X.tickText=function(e,t,r,i){var a,s=be(e,t),l="array"===e.tickmode,c=r||l,u=e.type,h="category"===u?e.d2l_noadd:e.d2l,p=function(t){var r=e.l2p(t);return r>=0&&r<=e._length?t:null};if(l&&o.isArrayOrTypedArray(e.ticktext)){var d=o.simpleMap(e.range,e.r2l),f=(Math.abs(d[1]-d[0])-(e._lBreaks||0))/1e4;for(a=0;a<e.ticktext.length&&!(Math.abs(t-h(e.tickvals[a]))<f);a++);if(a<e.ticktext.length)return s.text=String(e.ticktext[a]),s.xbnd=[p(s.x-.5),p(s.x+e.dtick-.5)],s}function m(n){if(void 0===n)return!0;if(r)return"none"===n;var i={first:e._tmin,last:e._tmax}[n];return"all"!==n&&t!==i}var g=r?"never":"none"!==e.exponentformat&&m(e.showexponent)?"hide":"";if("date"===u?function(e,t,r,i){var a=e._tickround,s=r&&e.hoverformat||X.getTickFormat(e);(i=!s&&i)&&(a=n(a)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[a]);var l,c=o.formatDate(t.x,s,a,e._dateFormat,e.calendar,e._extraFormat),u=c.indexOf("\n");if(-1!==u&&(l=c.substr(u+1),c=c.substr(0,u)),i&&(void 0===l||"00:00:00"!==c&&"00:00"!==c?8===c.length&&(c=c.replace(/:00$/,"")):(c=l,l="")),l)if(r)"d"===a?c+=", "+l:c=l+(c?", "+c:"");else if(e._inCalcTicks&&e._prevDateHead===l){var h=Ne(e),p=e._trueSide||e.side;(!h&&"top"===p||h&&"bottom"===p)&&(c+="<br> ")}else e._prevDateHead=l,c+="<br>"+l;t.text=c}(e,s,r,c):"log"===u?function(e,t,r,i,a){var s=e.dtick,l=t.x,c=e.tickformat,u="string"===typeof s&&s.charAt(0);if("never"===a&&(a=""),i&&"L"!==u&&(s="L3",u="L"),c||"L"===u)t.text=Te(Math.pow(10,l),e,a,i);else if(n(s)||"D"===u&&o.mod(l+.01,1)<.1){var h=Math.round(l),p=Math.abs(h),d=e.exponentformat;"power"===d||we(d)&&ke(h)?(t.text=0===h?1:1===h?"10":"10<sup>"+(h>1?"":R)+p+"</sup>",t.fontSize*=1.25):("e"===d||"E"===d)&&p>2?t.text="1"+d+(h>0?"+":R)+p:(t.text=Te(Math.pow(10,l),e,"","fakehover"),"D1"===s&&"y"===e._id.charAt(0)&&(t.dy-=t.fontSize/6))}else{if("D"!==u)throw"unrecognized dtick "+String(s);t.text=String(Math.round(Math.pow(10,o.mod(l,1)))),t.fontSize*=.75}if("D1"===e.dtick){var f=String(t.text).charAt(0);"0"!==f&&"1"!==f||("y"===e._id.charAt(0)?t.dx-=t.fontSize/4:(t.dy+=t.fontSize/2,t.dx+=(e.range[1]>e.range[0]?1:-1)*t.fontSize*(l<0?.5:.25)))}}(e,s,0,c,g):"category"===u?function(e,t){var r=e._categories[Math.round(t.x)];void 0===r&&(r=""),t.text=String(r)}(e,s):"multicategory"===u?function(e,t,r){var n=Math.round(t.x),i=e._categories[n]||[],a=void 0===i[1]?"":String(i[1]),o=void 0===i[0]?"":String(i[0]);r?t.text=o+" - "+a:(t.text=a,t.text2=o)}(e,s,r):Fe(e)?function(e,t,r,n,i){if("radians"!==e.thetaunit||r)t.text=Te(t.x,e,i,n);else{var a=t.x/180;if(0===a)t.text="0";else{var s=function(e){function t(e,t){return Math.abs(e-t)<=1e-6}function r(e,n){return t(n,0)?e:r(n,e%n)}function n(e){for(var r=1;!t(Math.round(e*r)/r,e);)r*=10;return r}var i=n(e),a=e*i,o=Math.abs(r(a,i));return[Math.round(a/o),Math.round(i/o)]}(a);if(s[1]>=100)t.text=Te(o.deg2rad(t.x),e,i,n);else{var l=t.x<0;1===s[1]?1===s[0]?t.text="\u03c0":t.text=s[0]+"\u03c0":t.text=["<sup>",s[0],"</sup>","\u2044","<sub>",s[1],"</sub>","\u03c0"].join(""),l&&(t.text=R+t.text)}}}}(e,s,r,c,g):function(e,t,r,n,i){"never"===i?i="":"all"===e.showexponent&&Math.abs(t.x/e.dtick)<1e-6&&(i="hide"),t.text=Te(t.x,e,i,n)}(e,s,0,c,g),i||(e.tickprefix&&!m(e.showtickprefix)&&(s.text=e.tickprefix+s.text),e.ticksuffix&&!m(e.showticksuffix)&&(s.text+=e.ticksuffix)),e.labelalias&&e.labelalias.hasOwnProperty(s.text)){var y=e.labelalias[s.text];"string"===typeof y&&(s.text=y)}return("boundaries"===e.tickson||e.showdividers)&&(s.xbnd=[p(s.x-.5),p(s.x+e.dtick-.5)]),s},X.hoverLabelText=function(e,t,r){r&&(e=o.extendFlat({},e,{hoverformat:r}));var n=o.isArrayOrTypedArray(t)?t[0]:t,i=o.isArrayOrTypedArray(t)?t[1]:void 0;if(void 0!==i&&i!==n)return X.hoverLabelText(e,n,r)+" - "+X.hoverLabelText(e,i,r);var a="log"===e.type&&n<=0,s=X.tickText(e,e.c2l(a?-n:n),"hover").text;return a?0===n?"0":R+s:s};var _e=["f","p","n","\u03bc","m","","k","M","G","T"];function we(e){return"SI"===e||"B"===e}function ke(e){return e>14||e<-15}function Te(e,t,r,i){var a=e<0,s=t._tickround,l=r||t.exponentformat||"B",c=t._tickexponent,u=X.getTickFormat(t),h=t.separatethousands;if(i){var p={exponentformat:l,minexponent:t.minexponent,dtick:"none"===t.showexponent?t.dtick:n(e)&&Math.abs(e)||1,range:"none"===t.showexponent?t.range.map(t.r2d):[0,e||1]};xe(p),s=(Number(p._tickround)||0)+4,c=p._tickexponent,t.hoverformat&&(u=t.hoverformat)}if(u)return t._numFormat(u)(e).replace(/-/g,R);var d,f=Math.pow(10,-s)/2;if("none"===l&&(c=0),(e=Math.abs(e))<f)e="0",a=!1;else{if(e+=f,c&&(e*=Math.pow(10,-c),s+=c),0===s)e=String(Math.floor(e));else if(s<0){e=(e=String(Math.round(e))).substr(0,e.length+s);for(var m=s;m<0;m++)e+="0"}else{var g=(e=String(e)).indexOf(".")+1;g&&(e=e.substr(0,g+s).replace(/\.?0+$/,""))}e=o.numSeparate(e,t._separators,h)}return c&&"hide"!==l&&(we(l)&&ke(c)&&(l="power"),d=c<0?R+-c:"power"!==l?"+"+c:String(c),"e"===l||"E"===l?e+=l+d:"power"===l?e+="\xd710<sup>"+d+"</sup>":"B"===l&&9===c?e+="B":we(l)&&(e+=_e[c/3+5])),a?R+e:e}function Se(e,t){if(e){var r=Object.keys(V).reduce((function(e,r){return-1!==t.indexOf(r)&&V[r].forEach((function(t){e[t]=1})),e}),{});Object.keys(e).forEach((function(t){r[t]||(1===t.length?e[t]=0:delete e[t])}))}}function Ae(e,t){for(var r=[],n={},i=0;i<t.length;i++){var a=t[i];n[a.text2]?n[a.text2].push(a.x):n[a.text2]=[a.x]}for(var s in n)r.push(be(e,o.interp(n[s],.5),s));return r}function Me(e){return void 0!==e.periodX?e.periodX:e.x}function Ee(e){return[e.text,e.x,e.axInfo,e.font,e.fontSize,e.fontColor].join("_")}function Ce(e){var t=e.title.font.size,r=(e.title.text.match(l.BR_TAG_ALL)||[]).length;return e.title.hasOwnProperty("standoff")?t*(W+r*$):r?t*(r+1)*$:t}function Pe(e,t){var r=e.l2p(t);return r>1&&r<e._length-1}function Le(e){var t=r.select(e),n=t.select(".text-math-group");return n.empty()?t.select("text"):n}function Ie(e){return e._id+".automargin"}function ze(e){return Ie(e)+".mirror"}function Oe(e){return e._id+".rangeslider"}function Re(e,t){for(var r=0;r<t.length;r++)-1===e.indexOf(t[r])&&e.push(t[r])}function De(e,t,r){var n,i,a=[],s=[],l=e.layout;for(n=0;n<t.length;n++)a.push(X.getFromId(e,t[n]));for(n=0;n<r.length;n++)s.push(X.getFromId(e,r[n]));var c=Object.keys(p),u=["anchor","domain","overlaying","position","side","tickangle","editType"],h=["linear","log"];for(n=0;n<c.length;n++){var d=c[n],f=a[0][d],m=s[0][d],g=!0,y=!1,v=!1;if("_"!==d.charAt(0)&&"function"!==typeof f&&-1===u.indexOf(d)){for(i=1;i<a.length&&g;i++){var x=a[i][d];"type"===d&&-1!==h.indexOf(f)&&-1!==h.indexOf(x)&&f!==x?y=!0:x!==f&&(g=!1)}for(i=1;i<s.length&&g;i++){var b=s[i][d];"type"===d&&-1!==h.indexOf(m)&&-1!==h.indexOf(b)&&m!==b?v=!0:s[i][d]!==m&&(g=!1)}g&&(y&&(l[a[0]._name].type="linear"),v&&(l[s[0]._name].type="linear"),je(l,d,a,s,e._fullLayout._dfltTitle))}}for(n=0;n<e._fullLayout.annotations.length;n++){var _=e._fullLayout.annotations[n];-1!==t.indexOf(_.xref)&&-1!==r.indexOf(_.yref)&&o.swapAttrs(l.annotations[n],["?"])}}function je(e,t,r,n,i){var a,s=o.nestedProperty,l=s(e[r[0]._name],t).get(),c=s(e[n[0]._name],t).get();for("title"===t&&(l&&l.text===i.x&&(l.text=i.y),c&&c.text===i.y&&(c.text=i.x)),a=0;a<r.length;a++)s(e,r[a]._name+"."+t).set(c);for(a=0;a<n.length;a++)s(e,n[a]._name+"."+t).set(l)}function Fe(e){return"angularaxis"===e._id}function Be(e,t){for(var r=t._rangebreaks.length,n=0;n<r;n++){var i=t._rangebreaks[n];if(e>=i.min&&e<i.max)return i.max}return e}function Ne(e){return-1!==(e.ticklabelposition||"").indexOf("inside")}function Ue(e,t){Ne(e._anchorAxis||{})&&e._hideCounterAxisInsideTickLabels&&e._hideCounterAxisInsideTickLabels(t)}function qe(e,t,r,n){var i,a="free"===e.anchor||void 0!==e.overlaying&&!1!==e.overlaying?e.overlaying:e._id;i=n?"right"===e.side?t:-t:t,a in r||(r[a]={}),e.side in r[a]||(r[a][e.side]=0),r[a][e.side]+=i}X.getTickFormat=function(e){var t,r,n;function i(e){return"string"!==typeof e?e:Number(e.replace("M",""))*S}function a(e,t){var r=["L","D"];if(typeof e===typeof t){if("number"===typeof e)return e-t;var n=r.indexOf(e.charAt(0)),i=r.indexOf(t.charAt(0));return n===i?Number(e.replace(/(L|D)/g,""))-Number(t.replace(/(L|D)/g,"")):n-i}return"number"===typeof e?1:-1}function o(e,t,r){var n=r||function(e){return e},i=t[0],a=t[1];return(!i&&"number"!==typeof i||n(i)<=n(e))&&(!a&&"number"!==typeof a||n(a)>=n(e))}function s(e,t){var r=null===t[0],n=null===t[1],i=a(e,t[0])>=0,o=a(e,t[1])<=0;return(r||i)&&(n||o)}if(e.tickformatstops&&e.tickformatstops.length>0)switch(e.type){case"date":case"linear":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&o(e.dtick,n.dtickrange,i)){r=n;break}break;case"log":for(t=0;t<e.tickformatstops.length;t++)if((n=e.tickformatstops[t]).enabled&&s(e.dtick,n.dtickrange)){r=n;break}}return r?r.value:e.tickformat},X.getSubplots=function(e,t){var r=e._fullLayout._subplots,n=r.cartesian.concat(r.gl2d||[]),i=t?X.findSubplotsWithAxis(n,t):n;return i.sort((function(e,t){var r=e.substr(1).split("y"),n=t.substr(1).split("y");return r[0]===n[0]?+r[1]-+n[1]:+r[0]-+n[0]})),i},X.findSubplotsWithAxis=function(e,t){for(var r=new RegExp("x"===t._id.charAt(0)?"^"+t._id+"y":t._id+"$"),n=[],i=0;i<e.length;i++){var a=e[i];r.test(a)&&n.push(a)}return n},X.makeClipPaths=function(e){var t=e._fullLayout;if(!t._hasOnlyLargeSploms){var n,i,a={_offset:0,_length:t.width,_id:""},o={_offset:0,_length:t.height,_id:""},s=X.list(e,"x",!0),l=X.list(e,"y",!0),c=[];for(n=0;n<s.length;n++)for(c.push({x:s[n],y:o}),i=0;i<l.length;i++)0===n&&c.push({x:a,y:l[i]}),c.push({x:s[n],y:l[i]});var u=t._clips.selectAll(".axesclip").data(c,(function(e){return e.x._id+e.y._id}));u.enter().append("clipPath").classed("axesclip",!0).attr("id",(function(e){return"clip"+t._uid+e.x._id+e.y._id})).append("rect"),u.exit().remove(),u.each((function(e){r.select(this).select("rect").attr({x:e.x._offset||0,y:e.y._offset||0,width:e.x._length||1,height:e.y._length||1})}))}},X.draw=function(e,t,r){var n=e._fullLayout;"redraw"===t&&n._paper.selectAll("g.subplot").each((function(e){var t=e[0],r=n._plots[t];if(r){var i=r.xaxis,a=r.yaxis;r.xaxislayer.selectAll("."+i._id+"tick").remove(),r.yaxislayer.selectAll("."+a._id+"tick").remove(),r.xaxislayer.selectAll("."+i._id+"tick2").remove(),r.yaxislayer.selectAll("."+a._id+"tick2").remove(),r.xaxislayer.selectAll("."+i._id+"divider").remove(),r.yaxislayer.selectAll("."+a._id+"divider").remove(),r.minorGridlayer&&r.minorGridlayer.selectAll("path").remove(),r.gridlayer&&r.gridlayer.selectAll("path").remove(),r.zerolinelayer&&r.zerolinelayer.selectAll("path").remove(),n._infolayer.select(".g-"+i._id+"title").remove(),n._infolayer.select(".g-"+a._id+"title").remove()}}));var i=t&&"redraw"!==t?t:X.listIds(e),a=X.list(e).filter((function(e){return e.autoshift})).map((function(e){return e.overlaying}));i.map((function(t){var r=X.getFromId(e,t);if("sync"===r.tickmode&&r.overlaying){var n=i.findIndex((function(e){return e===r.overlaying}));n>=0&&i.unshift(i.splice(n,1).shift())}}));var s={false:{left:0,right:0}};return o.syncOrAsync(i.map((function(t){return function(){if(t){var n=X.getFromId(e,t);r||(r={}),r.axShifts=s,r.overlayingShiftedAx=a;var i=X.drawOne(e,n,r);return n._shiftPusher&&qe(n,n._fullDepth||0,s,!0),n._r=n.range.slice(),n._rl=o.simpleMap(n._r,n.r2l),i}}})))},X.drawOne=function(e,t,r){var n,s,p,d=(r=r||{}).axShifts||{},f=r.overlayingShiftedAx||[];t.setScale();var m=e._fullLayout,g=t._id,y=g.charAt(0),v=X.counterLetter(g),x=m._plots[t._mainSubplot];if(x){if(t._shiftPusher=t.autoshift||-1!==f.indexOf(t._id)||-1!==f.indexOf(t.overlaying),t._shiftPusher&"free"===t.anchor){var b=t.linewidth/2||0;"inside"===t.ticks&&(b+=t.ticklen),qe(t,b,d,!0),qe(t,t.shift||0,d,!1)}!0===r.skipTitle&&void 0!==t._shift||(t._shift=function(e,t){return e.autoshift?t[e.overlaying][e.side]:e.shift||0}(t,d));var _=x[y+"axislayer"],w=t._mainLinePosition,k=w+=t._shift,T=t._mainMirrorPosition,S=t._vals=X.calcTicks(t),A=[t.mirror,k,T].join("_");for(n=0;n<S.length;n++)S[n].axInfo=A;t._selections={},t._tickAngles&&(t._prevTickAngles=t._tickAngles),t._tickAngles={},t._depth=null;var M={};if(t.visible){var E,C,P=X.makeTransTickFn(t),L=X.makeTransTickLabelFn(t),I="inside"===t.ticks,z="outside"===t.ticks;if("boundaries"===t.tickson){var O=function(e,t){var r,n=[],i=function(e,t){var r=e.xbnd[t];null!==r&&n.push(o.extendFlat({},e,{x:r}))};if(t.length){for(r=0;r<t.length;r++)i(t[r],0);i(t[r-1],1)}return n}(0,S);C=X.clipEnds(t,O),E=I?C:O}else C=X.clipEnds(t,S),E=I&&"period"!==t.ticklabelmode?C:S;var R,D=t._gridVals=C,j=function(e,t){var r,n,i=[],a=t.length&&t[t.length-1].x<t[0].x,s=function(e,t){var r=e.xbnd[t];null!==r&&i.push(o.extendFlat({},e,{x:r}))};if(e.showdividers&&t.length){for(r=0;r<t.length;r++){var l=t[r];l.text2!==n&&s(l,a?1:0),n=l.text2}s(t[r-1],a?0:1)}return i}(t,S);if(!m._hasOnlyLargeSploms){var F=t._subplotsWith,B={};for(n=0;n<F.length;n++){s=F[n];var N=(p=m._plots[s])[v+"axis"],U=N._mainAxis._id;if(!B[U]){B[U]=1;var V="x"===y?"M0,"+N._offset+"v"+N._length:"M"+N._offset+",0h"+N._length;X.drawGrid(e,t,{vals:D,counterAxis:N,layer:p.gridlayer.select("."+g),minorLayer:p.minorGridlayer.select("."+g),path:V,transFn:P}),X.drawZeroLine(e,t,{counterAxis:N,layer:p.zerolinelayer,path:V,transFn:P})}}}var q=X.getTickSigns(t),H=X.getTickSigns(t,"minor");if(t.ticks||t.minor&&t.minor.ticks){var Y,K,J,Q,ee=X.makeTickPath(t,k,q[2]),te=X.makeTickPath(t,k,H[2],{minor:!0});if(t._anchorAxis&&t.mirror&&!0!==t.mirror?(Y=X.makeTickPath(t,T,q[3]),K=X.makeTickPath(t,T,H[3],{minor:!0}),J=ee+Y,Q=te+K):(Y="",K="",J=ee,Q=te),t.showdividers&&z&&"boundaries"===t.tickson){var re={};for(n=0;n<j.length;n++)re[j[n].x]=1;R=function(e){return re[e.x]?Y:J}}else R=function(e){return e.minor?Q:J}}if(X.drawTicks(e,t,{vals:E,layer:_,path:R,transFn:P}),"allticks"===t.mirror){var ne=Object.keys(t._linepositions||{});for(n=0;n<ne.length;n++){s=ne[n],p=m._plots[s];var ie=t._linepositions[s]||[],ae=ie[0],oe=ie[1],se=ie[2],le=X.makeTickPath(t,ae,se?q[0]:H[0],{minor:se})+X.makeTickPath(t,oe,se?q[1]:H[1],{minor:se});X.drawTicks(e,t,{vals:E,layer:p[y+"axislayer"],path:le,transFn:P})}}var ce=[];if(ce.push((function(){return X.drawLabels(e,t,{vals:S,layer:_,plotinfo:p,transFn:L,labelFns:X.makeLabelFns(t,k)})})),"multicategory"===t.type){var ue={x:2,y:10}[y];ce.push((function(){var r={x:"height",y:"width"}[y],n=pe()[r]+ue+(t._tickAngles[g+"tick"]?t.tickfont.size*$:0);return X.drawLabels(e,t,{vals:Ae(t,S),layer:_,cls:g+"tick2",repositionOnUpdate:!0,secondary:!0,transFn:P,labelFns:X.makeLabelFns(t,k+n*q[4])})})),ce.push((function(){return t._depth=q[4]*(pe("tick2")[t.side]-k),function(e,t,r){var n=t._id+"divider",i=r.vals,a=r.layer.selectAll("path."+n).data(i,Ee);a.exit().remove(),a.enter().insert("path",":first-child").classed(n,1).classed("crisp",1).call(u.stroke,t.dividercolor).style("stroke-width",h.crispRound(e,t.dividerwidth,1)+"px"),a.attr("transform",r.transFn).attr("d",r.path)}(e,t,{vals:j,layer:_,path:X.makeTickPath(t,k,q[4],{len:t._depth}),transFn:P})}))}else t.title.hasOwnProperty("standoff")&&ce.push((function(){t._depth=q[4]*(pe()[t.side]-k)}));var he=a.getComponentMethod("rangeslider","isVisible")(t);return r.skipTitle||he&&"bottom"===t.side||ce.push((function(){return function(e,t){var r,n=e._fullLayout,i=t._id,a=i.charAt(0),o=t.title.font.size,s=(t.title.text.match(l.BR_TAG_ALL)||[]).length;if(t.title.hasOwnProperty("standoff"))"bottom"===t.side||"right"===t.side?r=t._depth+t.title.standoff+o*W:"top"!==t.side&&"left"!==t.side||(r=t._depth+t.title.standoff+o*(G+s*$));else{var u=Ne(t);if("multicategory"===t.type)r=t._depth;else{var p=1.5*o;u&&(p=.5*o,"outside"===t.ticks&&(p+=t.ticklen)),r=10+p+(t.linewidth?t.linewidth-1:0)}u||(r+="x"===a?"top"===t.side?o*(t.showticklabels?1:0):o*(t.showticklabels?1.5:.5):"right"===t.side?o*(t.showticklabels?1:.5):o*(t.showticklabels?.5:0))}var d,f,m,g,y=X.getPxPosition(e,t);if("x"===a?(f=t._offset+t._length/2,m="top"===t.side?y-r:y+r):(m=t._offset+t._length/2,f="right"===t.side?y+r:y-r,d={rotate:"-90",offset:0}),"multicategory"!==t.type){var v=t._selections[t._id+"tick"];if(g={selection:v,side:t.side},v&&v.node()&&v.node().parentNode){var x=h.getTranslate(v.node().parentNode);g.offsetLeft=x.x,g.offsetTop=x.y}t.title.hasOwnProperty("standoff")&&(g.pad=0)}return t._titleStandoff=r,c.draw(e,i+"title",{propContainer:t,propName:t._name+".title.text",placeholder:n._dfltTitle[a],avoid:g,transform:d,attributes:{x:f,y:m,"text-anchor":"middle"}})}(e,t)})),ce.push((function(){var r,n,o,s,l=t.side.charAt(0),c=Z[t.side].charAt(0),u=X.getPxPosition(e,t),h=z?t.ticklen:0;(t.automargin||he||t._shiftPusher)&&("multicategory"===t.type?r=pe("tick2"):(r=pe(),"x"===y&&"b"===l&&(t._depth=Math.max(r.width>0?r.bottom-u:0,h))));var p=0,d=0;if(t._shiftPusher&&(p=Math.max(h,r.height>0?"l"===l?u-r.left:r.right-u:0),t.title.text!==m._dfltTitle[y]&&(d=(t._titleStandoff||0)+(t._titleScoot||0),"l"===l&&(d+=Ce(t))),t._fullDepth=Math.max(p,d)),t.automargin){n={x:0,y:0,r:0,l:0,t:0,b:0};var f=[0,1],g="number"===typeof t._shift?t._shift:0;if("x"===y){if("b"===l?n[l]=t._depth:(n[l]=t._depth=Math.max(r.width>0?u-r.top:0,h),f.reverse()),r.width>0){var x=r.right-(t._offset+t._length);x>0&&(n.xr=1,n.r=x);var b=t._offset-r.left;b>0&&(n.xl=0,n.l=b)}}else if("l"===l?(t._depth=Math.max(r.height>0?u-r.left:0,h),n[l]=t._depth-g):(t._depth=Math.max(r.height>0?r.right-u:0,h),n[l]=t._depth+g,f.reverse()),r.height>0){var _=r.bottom-(t._offset+t._length);_>0&&(n.yb=0,n.b=_);var w=t._offset-r.top;w>0&&(n.yt=1,n.t=w)}n[v]="free"===t.anchor?t.position:t._anchorAxis.domain[f[0]],t.title.text!==m._dfltTitle[y]&&(n[l]+=Ce(t)+(t.title.standoff||0)),t.mirror&&"free"!==t.anchor&&((o={x:0,y:0,r:0,l:0,t:0,b:0})[c]=t.linewidth,t.mirror&&!0!==t.mirror&&(o[c]+=h),!0===t.mirror||"ticks"===t.mirror?o[v]=t._anchorAxis.domain[f[1]]:"all"!==t.mirror&&"allticks"!==t.mirror||(o[v]=[t._counterDomainMin,t._counterDomainMax][f[1]]))}he&&(s=a.getComponentMethod("rangeslider","autoMarginOpts")(e,t)),"string"===typeof t.automargin&&(Se(n,t.automargin),Se(o,t.automargin)),i.autoMargin(e,Ie(t),n),i.autoMargin(e,ze(t),o),i.autoMargin(e,Oe(t),s)})),o.syncOrAsync(ce)}}function pe(e){var r=g+(e||"tick");return M[r]||(M[r]=function(e,t,r){var n,i,a,o;if(e._selections[t].size())n=1/0,i=-1/0,a=1/0,o=-1/0,e._selections[t].each((function(){var e=Le(this),t=h.bBox(e.node().parentNode);n=Math.min(n,t.top),i=Math.max(i,t.bottom),a=Math.min(a,t.left),o=Math.max(o,t.right)}));else{var s=X.makeLabelFns(e,r);n=i=s.yFn({dx:0,dy:0,fontSize:0}),a=o=s.xFn({dx:0,dy:0,fontSize:0})}return{top:n,bottom:i,left:a,right:o,height:i-n,width:o-a}}(t,r,k)),M[r]}},X.getTickSigns=function(e,t){var r=e._id.charAt(0),n={x:"top",y:"right"}[r],i=e.side===n?1:-1,a=[-1,1,i,-i];return"inside"!==(t?(e.minor||{}).ticks:e.ticks)===("x"===r)&&(a=a.map((function(e){return-e}))),e.side&&a.push({l:-1,t:-1,r:1,b:1}[e.side.charAt(0)]),a},X.makeTransTickFn=function(e){return"x"===e._id.charAt(0)?function(t){return s(e._offset+e.l2p(t.x),0)}:function(t){return s(0,e._offset+e.l2p(t.x))}},X.makeTransTickLabelFn=function(e){var t=function(e){var t=e.ticklabelposition||"",r=function(e){return-1!==t.indexOf(e)},n=r("top"),i=r("left"),a=r("right"),o=r("bottom"),s=r("inside"),l=o||i||n||a;if(!l&&!s)return[0,0];var c=e.side,u=l?(e.tickwidth||0)/2:0,h=3,p=e.tickfont?e.tickfont.size:12;return(o||n)&&(u+=p*W,h+=(e.linewidth||0)/2),(i||a)&&(u+=(e.linewidth||0)/2,h+=3),s&&"top"===c&&(h-=p*(1-W)),(i||n)&&(u=-u),"bottom"!==c&&"right"!==c||(h=-h),[l?u:0,s?h:0]}(e),r=e.ticklabelshift||0,n=e.ticklabelstandoff||0,i=t[0],a=t[1],o=e.range[0]>e.range[1],l=e.ticklabelposition&&-1!==e.ticklabelposition.indexOf("inside"),c=!l;if(r&&(r*=o?-1:1),n){var u=e.side;n*=l&&("top"===u||"left"===u)||c&&("bottom"===u||"right"===u)?1:-1}return"x"===e._id.charAt(0)?function(t){return s(i+e._offset+e.l2p(Me(t))+r,a+n)}:function(t){return s(a+n,i+e._offset+e.l2p(Me(t))+r)}},X.makeTickPath=function(e,t,r,n){n||(n={});var i=n.minor;if(i&&!e.minor)return"";var a=void 0!==n.len?n.len:i?e.minor.ticklen:e.ticklen,o=e._id.charAt(0),s=(e.linewidth||1)/2;return"x"===o?"M0,"+(t+s*r)+"v"+a*r:"M"+(t+s*r)+",0h"+a*r},X.makeLabelFns=function(e,t,r){var i=e.ticklabelposition||"",a=function(e){return-1!==i.indexOf(e)},s=a("top"),l=a("left"),c=a("right"),u=a("bottom")||l||s||c,h=a("inside"),p="inside"===i&&"inside"===e.ticks||!h&&"outside"===e.ticks&&"boundaries"!==e.tickson,d=0,f=0,m=p?e.ticklen:0;if(h?m*=-1:u&&(m=0),p&&(d+=m,r)){var g=o.deg2rad(r);d=m*Math.cos(g)+1,f=m*Math.sin(g)}e.showticklabels&&(p||e.showline)&&(d+=.2*e.tickfont.size);var y,v,x,b,_,w={labelStandoff:d+=(e.linewidth||1)/2*(h?-1:1),labelShift:f},k=0,T=e.side,S=e._id.charAt(0),A=e.tickangle;if("x"===S)b=(_=!h&&"bottom"===T||h&&"top"===T)?1:-1,h&&(b*=-1),y=f*b,v=t+d*b,x=_?1:-.2,90===Math.abs(A)&&(h?x+=G:x=-90===A&&"bottom"===T?W:90===A&&"top"===T?G:.5,k=G/2*(A/90)),w.xFn=function(e){return e.dx+y+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*x},w.anchorFn=function(e,t){if(u){if(l)return"end";if(c)return"start"}return n(t)&&0!==t&&180!==t?t*b<0!==h?"end":"start":"middle"},w.heightFn=function(t,r,n){return r<-60||r>60?-.5*n:"top"===e.side!==h?-n:0};else if("y"===S){if(b=(_=!h&&"left"===T||h&&"right"===T)?1:-1,h&&(b*=-1),y=d,v=f*b,x=0,h||90!==Math.abs(A)||(x=-90===A&&"left"===T||90===A&&"right"===T?W:.5),h){var M=n(A)?+A:0;if(0!==M){var E=o.deg2rad(M);k=Math.abs(Math.sin(E))*W*b,x=0}}w.xFn=function(e){return e.dx+t-(y+e.fontSize*x)*b+k*e.fontSize},w.yFn=function(e){return e.dy+v+e.fontSize*G},w.anchorFn=function(e,t){return n(t)&&90===Math.abs(t)?"middle":_?"end":"start"},w.heightFn=function(t,r,n){return"right"===e.side&&(r*=-1),r<-30?-n:r<30?-.5*n:0}}return w},X.drawTicks=function(e,t,n){n=n||{};var i=t._id+"tick",a=[].concat(t.minor&&t.minor.ticks?n.vals.filter((function(e){return e.minor&&!e.noTick})):[]).concat(t.ticks?n.vals.filter((function(e){return!e.minor&&!e.noTick})):[]),o=n.layer.selectAll("path."+i).data(a,Ee);o.exit().remove(),o.enter().append("path").classed(i,1).classed("ticks",1).classed("crisp",!1!==n.crisp).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.tickcolor:t.tickcolor)})).style("stroke-width",(function(r){return h.crispRound(e,r.minor?t.minor.tickwidth:t.tickwidth,1)+"px"})).attr("d",n.path).style("display",null),Ue(t,[N]),o.attr("transform",n.transFn)},X.drawGrid=function(e,t,n){if(n=n||{},"sync"!==t.tickmode){var i=t._id+"grid",a=t.minor&&t.minor.showgrid,o=a?n.vals.filter((function(e){return e.minor})):[],s=t.showgrid?n.vals.filter((function(e){return!e.minor})):[],l=n.counterAxis;if(l&&X.shouldShowZeroLine(e,t,l))for(var c="array"===t.tickmode,p=0;p<s.length;p++){var d=s[p].x;if(c?!d:Math.abs(d)<t.dtick/100){if(s=s.slice(0,p).concat(s.slice(p+1)),!c)break;p--}}t._gw=h.crispRound(e,t.gridwidth,1);for(var f=a?h.crispRound(e,t.minor.gridwidth,1):0,m=n.layer,g=n.minorLayer,y=1;y>=0;y--){var v=y?m:g;if(v){var x=v.selectAll("path."+i).data(y?s:o,Ee);x.exit().remove(),x.enter().append("path").classed(i,1).classed("crisp",!1!==n.crisp),x.attr("transform",n.transFn).attr("d",n.path).each((function(e){return u.stroke(r.select(this),e.minor?t.minor.gridcolor:t.gridcolor||"#ddd")})).style("stroke-dasharray",(function(e){return h.dashStyle(e.minor?t.minor.griddash:t.griddash,e.minor?t.minor.gridwidth:t.gridwidth)})).style("stroke-width",(function(e){return(e.minor?f:t._gw)+"px"})).style("display",null),"function"===typeof n.path&&x.attr("d",n.path)}}Ue(t,[F,B])}},X.drawZeroLine=function(e,t,r){r=r||r;var n=t._id+"zl",i=X.shouldShowZeroLine(e,t,r.counterAxis),a=r.layer.selectAll("path."+n).data(i?[{x:0,id:t._id}]:[]);a.exit().remove(),a.enter().append("path").classed(n,1).classed("zl",1).classed("crisp",!1!==r.crisp).each((function(){r.layer.selectAll("path").sort((function(e,t){return J(e.id,t.id)}))})),a.attr("transform",r.transFn).attr("d",r.path).call(u.stroke,t.zerolinecolor||u.defaultLine).style("stroke-width",h.crispRound(e,t.zerolinewidth,t._gw||1)+"px").style("display",null),Ue(t,[j])},X.drawLabels=function(e,t,i){i=i||{};var a=e._fullLayout,c=t._id,u=i.cls||c+"tick",p=i.vals.filter((function(e){return e.text})),d=i.labelFns,f=i.secondary?0:t.tickangle,m=(t._prevTickAngles||{})[u],g=i.layer.selectAll("g."+u).data(t.showticklabels?p:[],Ee),y=[];function v(e,a){e.each((function(e){var o=r.select(this),c=o.select(".text-math-group"),u=d.anchorFn(e,a),p=i.transFn.call(o.node(),e)+(n(a)&&0!==+a?" rotate("+a+","+d.xFn(e)+","+(d.yFn(e)-e.fontSize/2)+")":""),f=l.lineCount(o),m=$*e.fontSize,g=d.heightFn(e,n(a)?+a:0,(f-1)*m);if(g&&(p+=s(0,g)),c.empty()){var y=o.select("text");y.attr({transform:p,"text-anchor":u}),y.style("opacity",1),t._adjustTickLabelsOverflow&&t._adjustTickLabelsOverflow()}else{var v=h.bBox(c.node()).width*{end:-.5,start:.5}[u];c.attr("transform",p+s(v,0))}}))}g.enter().append("g").classed(u,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),i=e._promises.length;n.call(l.positionText,d.xFn(t),d.yFn(t)).call(h.font,{family:t.font,size:t.fontSize,color:t.fontColor,weight:t.fontWeight,style:t.fontStyle,variant:t.fontVariant,textcase:t.fontTextcase,lineposition:t.fontLineposition,shadow:t.fontShadow}).text(t.text).call(l.convertToTspans,e),e._promises[i]?y.push(e._promises.pop().then((function(){v(n,f)}))):v(n,f)})),Ue(t,[U]),g.exit().remove(),i.repositionOnUpdate&&g.each((function(e){r.select(this).select("text").call(l.positionText,d.xFn(e),d.yFn(e))})),t._adjustTickLabelsOverflow=function(){var n=t.ticklabeloverflow;if(n&&"allow"!==n){var i=-1!==n.indexOf("hide"),s="x"===t._id.charAt(0),l=0,c=s?e._fullLayout.width:e._fullLayout.height;if(-1!==n.indexOf("domain")){var u=o.simpleMap(t.range,t.r2l);l=t.l2p(u[0])+t._offset,c=t.l2p(u[1])+t._offset}var p=Math.min(l,c),d=Math.max(l,c),f=t.side,m=1/0,y=-1/0;for(var v in g.each((function(e){var n=r.select(this);if(n.select(".text-math-group").empty()){var a=h.bBox(n.node()),o=0;s?(a.right>d||a.left<p)&&(o=1):(a.bottom>d||a.top+(t.tickangle?0:e.fontSize/4)<p)&&(o=1);var l=n.select("text");o?i&&l.style("opacity",0):(l.style("opacity",1),m="bottom"===f||"right"===f?Math.min(m,s?a.top:a.left):-1/0,y="top"===f||"left"===f?Math.max(y,s?a.bottom:a.right):1/0)}})),a._plots){var x=a._plots[v];if(t._id===x.xaxis._id||t._id===x.yaxis._id){var b=s?x.yaxis:x.xaxis;b&&(b["_visibleLabelMin_"+t._id]=m,b["_visibleLabelMax_"+t._id]=y)}}}},t._hideCounterAxisInsideTickLabels=function(e){var n="x"===t._id.charAt(0),i=[];for(var o in a._plots){var s=a._plots[o];t._id!==s.xaxis._id&&t._id!==s.yaxis._id||i.push(n?s.yaxis:s.xaxis)}i.forEach((function(n,i){n&&Ne(n)&&(e||[j,B,F,N,U]).forEach((function(e){var o="tick"===e.K&&"text"===e.L&&"period"===t.ticklabelmode,s=a._plots[t._mainSubplot];(e.K===j.K?s.zerolinelayer.selectAll("."+t._id+"zl"):e.K===B.K?s.minorGridlayer.selectAll("."+t._id):e.K===F.K?s.gridlayer.selectAll("."+t._id):s[t._id.charAt(0)+"axislayer"]).each((function(){var a=r.select(this);e.L&&(a=a.selectAll(e.L)),a.each((function(a){var s=t.l2p(o?Me(a):a.x)+t._offset,l=r.select(this);s<t["_visibleLabelMax_"+n._id]&&s>t["_visibleLabelMin_"+n._id]?l.style("display","none"):"tick"!==e.K||i||l.style("display",null)}))}))}))}))},v(g,m+1?m:f);var x=null;t._selections&&(t._selections[u]=g);var b=[function(){return y.length&&Promise.all(y)}];t.automargin&&a._redrawFromAutoMarginCount&&90===m?(x=m,b.push((function(){v(g,m)}))):b.push((function(){if(v(g,f),p.length&&t.autotickangles&&("log"!==t.type||"D"!==String(t.dtick).charAt(0))){x=t.autotickangles[0];var e,r=0,n=[],a=1;g.each((function(e){r=Math.max(r,e.fontSize);var i=t.l2p(e.x),o=Le(this),s=h.bBox(o.node());a=Math.max(a,l.lineCount(o)),n.push({top:0,bottom:10,height:10,left:i-s.width/2,right:i+s.width/2+2,width:s.width+2})}));var s=("boundaries"===t.tickson||t.showdividers)&&!i.secondary,c=p.length,u=Math.abs((p[c-1].x-p[0].x)*t._m)/(c-1),d=s?u/2:u,m=s?t.ticklen:1.25*r*a,y=d/Math.sqrt(Math.pow(d,2)+Math.pow(m,2)),b=t.autotickangles.map((function(e){return e*Math.PI/180})),_=b.find((function(e){return Math.abs(Math.cos(e))<=y}));void 0===_&&(_=b.reduce((function(e,t){return Math.abs(Math.cos(e))<Math.abs(Math.cos(t))?e:t}),b[0]));var w=_*(180/Math.PI);if(s){var k=2;for(t.ticks&&(k+=t.tickwidth/2),e=0;e<n.length;e++){var T=p[e].xbnd,S=n[e];if(null!==T[0]&&S.left-t.l2p(T[0])<k||null!==T[1]&&t.l2p(T[1])-S.right<k){x=w;break}}}else{var A=t.ticklabelposition||"",M=function(e){return-1!==A.indexOf(e)},E=M("top"),C=M("left"),P=M("right"),L=M("bottom")||C||E||P?(t.tickwidth||0)+6:0;for(e=0;e<n.length-1;e++)if(o.bBoxIntersect(n[e],n[e+1],L)){x=w;break}}x&&v(g,x)}})),t._tickAngles&&b.push((function(){t._tickAngles[u]=null===x?n(f)?f:0:x}));var _=function(){var e=0,r=0;return g.each((function(n,i){var a,o=Le(this);o.select(".text-math-group").empty()&&(t._vals[i]&&(a=t._vals[i].bb||h.bBox(o.node()),t._vals[i].bb=a),e=Math.max(e,a.width),r=Math.max(r,a.height))})),{labelsMaxW:e,labelsMaxH:r}},w=t._anchorAxis;if(w&&(w.autorange||w.insiderange)&&Ne(t)&&!Q(a,t._id)&&(a._insideTickLabelsUpdaterange||(a._insideTickLabelsUpdaterange={}),w.autorange&&(a._insideTickLabelsUpdaterange[w._name+".autorange"]=w.autorange,b.push(_)),w.insiderange)){var k=_(),T="y"===t._id.charAt(0)?k.labelsMaxW:k.labelsMaxH;T+=6,"inside"===t.ticklabelposition&&(T+=t.ticklen||0);var S="right"===t.side||"top"===t.side?1:-1,A=1===S?1:0,M=1===S?0:1,E=[];E[M]=w.range[M];var C=w.range,P=w.r2p(C[A]),L=w.r2p(C[M]),I=a._insideTickLabelsUpdaterange[w._name+".range"];if(I){var z=w.r2p(I[A]),O=w.r2p(I[M]),R=S*("y"===t._id.charAt(0)?1:-1);R*P<R*z&&(P=z,E[A]=C[A]=I[A]),R*L>R*O&&(L=O,E[M]=C[M]=I[M])}var D=Math.abs(L-P);D-T>0?T*=1+T/(D-=T):T=0,"y"!==t._id.charAt(0)&&(T=-T),E[A]=w.p2r(w.r2p(C[A])+S*T),"min"===w.autorange||"max reversed"===w.autorange?(E[0]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0):"max"!==w.autorange&&"min reversed"!==w.autorange||(E[1]=null,w._rangeInitial0=void 0,w._rangeInitial1=void 0),a._insideTickLabelsUpdaterange[w._name+".range"]=E}var V=o.syncOrAsync(b);return V&&V.then&&e._promises.push(V),V},X.getPxPosition=function(e,t){var r,n=e._fullLayout._size,i=t._id.charAt(0),a=t.side;return"free"!==t.anchor?r=t._anchorAxis:"x"===i?r={_offset:n.t+(1-(t.position||0))*n.h,_length:0}:"y"===i&&(r={_offset:n.l+(t.position||0)*n.w+t._shift,_length:0}),"top"===a||"left"===a?r._offset:"bottom"===a||"right"===a?r._offset+r._length:void 0},X.shouldShowZeroLine=function(e,t,r){var n=o.simpleMap(t.range,t.r2l);return n[0]*n[1]<=0&&t.zeroline&&("linear"===t.type||"-"===t.type)&&!(t.rangebreaks&&t.maskBreaks(0)===D)&&(Pe(t,0)||!function(e,t,r,n){var i=r._mainAxis;if(i){var a=e._fullLayout,o=t._id.charAt(0),s=X.counterLetter(t._id),l=t._offset+(Math.abs(n[0])<Math.abs(n[1])===("x"===o)?0:t._length),c=a._plots[r._mainSubplot];if(!(c.mainplotinfo||c).overlays.length)return d(r,l);for(var u=X.list(e,s),h=0;h<u.length;h++){var p=u[h];if(p._mainAxis===i&&d(p,l))return!0}}function d(e){if(!e.showline||!e.linewidth)return!1;var r=Math.max((e.linewidth+t.zerolinewidth)/2,1);function n(e){return"number"===typeof e&&Math.abs(e-l)<r}if(n(e._mainLinePosition)||n(e._mainMirrorPosition))return!0;var i=e._linepositions||{};for(var a in i)if(n(i[a][0])||n(i[a][1]))return!0}}(e,t,r,n)||function(e,t){for(var r=e._fullData,n=t._mainSubplot,i=t._id.charAt(0),o=0;o<r.length;o++){var s=r[o];if(!0===s.visible&&s.xaxis+s.yaxis===n){if(a.traceIs(s,"bar-like")&&s.orientation==={x:"h",y:"v"}[i])return!0;if(s.fill&&s.fill.charAt(s.fill.length-1)===i)return!0}}return!1}(e,t))},X.clipEnds=function(e,t){return t.filter((function(t){return Pe(e,t.x)}))},X.allowAutoMargin=function(e){for(var t=X.list(e,"",!0),r=0;r<t.length;r++){var n=t[r];n.automargin&&(i.allowAutoMargin(e,Ie(n)),n.mirror&&i.allowAutoMargin(e,ze(n))),a.getComponentMethod("rangeslider","isVisible")(n)&&i.allowAutoMargin(e,Oe(n))}},X.swap=function(e,t){for(var r=function(e,t){var r,n,i=[];for(r=0;r<t.length;r++){var a=[],o=e._fullData[t[r]].xaxis,s=e._fullData[t[r]].yaxis;if(o&&s){for(n=0;n<i.length;n++)-1===i[n].x.indexOf(o)&&-1===i[n].y.indexOf(s)||a.push(n);if(a.length){var l,c=i[a[0]];if(a.length>1)for(n=1;n<a.length;n++)l=i[a[n]],Re(c.x,l.x),Re(c.y,l.y);Re(c.x,[o]),Re(c.y,[s])}else i.push({x:[o],y:[s]})}}return i}(e,t),n=0;n<r.length;n++)De(e,r[n].x,r[n].y)}}}),ir=p({"src/plots/cartesian/autorange_options_defaults.js"(e,t){t.exports=function(e,t,r){var n,i;if(r){var a="reversed"===t||"min reversed"===t||"max reversed"===t;n=r[a?1:0],i=r[a?0:1]}var o=e("autorangeoptions.minallowed",null===i?n:void 0),s=e("autorangeoptions.maxallowed",null===n?i:void 0);void 0===o&&e("autorangeoptions.clipmin"),void 0===s&&e("autorangeoptions.clipmax"),e("autorangeoptions.include")}}}),ar=p({"src/plots/cartesian/range_defaults.js"(e,t){var r=ir();t.exports=function(e,t,n,i){var a=t._template||{},o=t.type||a.type||"-";n("minallowed"),n("maxallowed");var s,l=n("range");l||i.noInsiderange||"log"===o||(!(s=n("insiderange"))||null!==s[0]&&null!==s[1]||(t.insiderange=!1,s=void 0),s&&(l=n("range",s)));var c,u=t.getAutorangeDflt(l,i),h=n("autorange",u);!l||(null!==l[0]||null!==l[1])&&(null!==l[0]&&null!==l[1]||"reversed"!==h&&!0!==h)&&(null===l[0]||"min"!==h&&"max reversed"!==h)&&(null===l[1]||"max"!==h&&"min reversed"!==h)||(l=void 0,delete t.range,t.autorange=!0,c=!0),c||(h=n("autorange",u=t.getAutorangeDflt(l,i))),h&&(r(n,h,l),"linear"!==o&&"-"!==o||n("rangemode")),t.cleanRange()}}}),or=p({"node_modules/mouse-event-offset/index.js"(e,t){var r={left:0,top:0};t.exports=function(e,t,n){t=t||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=t)===window||i===document||i===document.body?r:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}}}),sr=p({"node_modules/has-passive-events/index.js"(e,t){var r=ct();t.exports=r&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(r){e=!1}return e}()}}),lr=p({"src/components/dragelement/align.js"(e,t){t.exports=function(e,t,r,n,i){var a=(e-r)/(n-r),o=a+t/(n-r),s=(a+o)/2;return"left"===i||"bottom"===i?a:"center"===i||"middle"===i?s:"right"===i||"top"===i?o:a<2/3-s?a:o>4/3-s?o:s}}}),cr=p({"src/components/dragelement/cursor.js"(e,t){var r=st(),n=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];t.exports=function(e,t,i,a){return e="left"===i?0:"center"===i?1:"right"===i?2:r.constrain(Math.floor(3*e),0,2),t="bottom"===a?0:"middle"===a?1:"top"===a?2:r.constrain(Math.floor(3*t),0,2),n[t][e]}}}),ur=p({"src/components/dragelement/unhover.js"(e,t){var r=pt(),n=Ke(),i=Ce().getGraphDiv,a=j(),o=t.exports={};o.wrapped=function(e,t,r){(e=i(e))._fullLayout&&n.clear(e._fullLayout._uid+a.HOVERID),o.raw(e,t,r)},o.raw=function(e,t){var n=e._fullLayout,i=e._hoverdata;t||(t={}),t.target&&!e._dragged&&!1===r.triggerHandler(e,"plotly_beforehover",t)||(n._hoverlayer.selectAll("g").remove(),n._hoverlayer.selectAll("line").remove(),n._hoverlayer.selectAll("circle").remove(),e._hoverdata=void 0,t.target&&i&&e.emit("plotly_unhover",{event:t,points:i}))}}}),hr=p({"src/components/dragelement/index.js"(e,t){var r=or(),n=ut(),i=sr(),a=st().removeElement,o=yt(),s=t.exports={};s.align=lr(),s.getCursor=cr();var l=ur();function c(){var e=document.createElement("div");e.className="dragcover";var t=e.style;return t.position="fixed",t.left=0,t.right=0,t.top=0,t.bottom=0,t.zIndex=999999999,t.background="none",document.body.appendChild(e),e}function u(e){return r(e.changedTouches?e.changedTouches[0]:e,document.body)}s.unhover=l.wrapped,s.unhoverRaw=l.raw,s.init=function(e){var t,r,l,h,p,d,f,m,g=e.gd,y=1,v=g._context.doubleClickDelay,x=e.element;g._mouseDownTime||(g._mouseDownTime=0),x.style.pointerEvents="all",x.onmousedown=_,i?(x._ontouchstart&&x.removeEventListener("touchstart",x._ontouchstart),x._ontouchstart=_,x.addEventListener("touchstart",_,{passive:!1})):x.ontouchstart=_;var b=e.clampFn||function(e,t,r){return Math.abs(e)<r&&(e=0),Math.abs(t)<r&&(t=0),[e,t]};function _(i){g._dragged=!1,g._dragging=!0;var a=u(i);t=a[0],r=a[1],f=i.target,d=i,m=2===i.buttons||i.ctrlKey,"undefined"===typeof i.clientX&&"undefined"===typeof i.clientY&&(i.clientX=t,i.clientY=r),(l=(new Date).getTime())-g._mouseDownTime<v?y+=1:(y=1,g._mouseDownTime=l),e.prepFn&&e.prepFn(i,t,r),n&&!m?(p=c()).style.cursor=window.getComputedStyle(x).cursor:n||(p=document,h=window.getComputedStyle(document.documentElement).cursor,document.documentElement.style.cursor=window.getComputedStyle(x).cursor),document.addEventListener("mouseup",k),document.addEventListener("touchend",k),!1!==e.dragmode&&(i.preventDefault(),document.addEventListener("mousemove",w),document.addEventListener("touchmove",w,{passive:!1}))}function w(n){n.preventDefault();var i=u(n),a=e.minDrag||o.MINDRAG,l=b(i[0]-t,i[1]-r,a),c=l[0],h=l[1];(c||h)&&(g._dragged=!0,s.unhover(g,n)),g._dragged&&e.moveFn&&!m&&(g._dragdata={element:x,dx:c,dy:h},e.moveFn(c,h))}function k(t){var r;(delete g._dragdata,!1!==e.dragmode&&(t.preventDefault(),document.removeEventListener("mousemove",w),document.removeEventListener("touchmove",w)),document.removeEventListener("mouseup",k),document.removeEventListener("touchend",k),n?a(p):h&&(p.documentElement.style.cursor=h,h=null),g._dragging)?(g._dragging=!1,(new Date).getTime()-g._mouseDownTime>v&&(y=Math.max(y-1,1)),g._dragged?e.doneFn&&e.doneFn():(d.target===f?r=d:(r={target:f,srcElement:f,toElement:f},Object.keys(d).concat(Object.keys(d.__proto__)).forEach((e=>{var t=d[e];r[e]||"function"===typeof t||(r[e]=t)}))),e.clickFn&&e.clickFn(y,r),m||f.dispatchEvent(new MouseEvent("click",t))),g._dragging=!1,g._dragged=!1):g._dragged=!1}},s.coverSlip=c}}),pr=p({"src/lib/setcursor.js"(e,t){t.exports=function(e,t){(e.attr("class")||"").split(" ").forEach((function(t){0===t.indexOf("cursor-")&&e.classed(t,!1)})),t&&e.classed("cursor-"+t,!0)}}}),dr=p({"src/lib/override_cursor.js"(e,t){var r=pr(),n="data-savedcursor";t.exports=function(e,t){var i=e.attr(n);if(t){if(!i){for(var a=(e.attr("class")||"").split(" "),o=0;o<a.length;o++){var s=a[o];0===s.indexOf("cursor-")&&e.attr(n,s.substr(7)).classed(s,!1)}e.attr(n)||e.attr(n,"!!")}r(e,t)}else i&&(e.attr(n,null),"!!"===i?r(e):r(e,i))}}}),fr=p({"src/components/legend/attributes.js"(e,t){var r=D(),n=V();t.exports={_isSubplotObj:!0,visible:{valType:"boolean",dflt:!0,editType:"legend"},bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:r({editType:"legend"}),grouptitlefont:r({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},entrywidth:{valType:"number",min:0,editType:"legend"},entrywidthmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"pixels",editType:"legend"},indentation:{valType:"number",min:-15,dflt:0,editType:"legend"},itemsizing:{valType:"enumerated",values:["trace","constant"],dflt:"trace",editType:"legend"},itemwidth:{valType:"number",min:30,dflt:30,editType:"legend"},itemclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggle",editType:"legend"},itemdoubleclick:{valType:"enumerated",values:["toggle","toggleothers",!1],dflt:"toggleothers",editType:"legend"},groupclick:{valType:"enumerated",values:["toggleitem","togglegroup"],dflt:"togglegroup",editType:"legend"},x:{valType:"number",editType:"legend"},xref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",editType:"legend"},yref:{valType:"enumerated",dflt:"paper",values:["container","paper"],editType:"layoutstyle"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],editType:"legend"},uirevision:{valType:"any",editType:"none"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"legend"},title:{text:{valType:"string",dflt:"",editType:"legend"},font:r({editType:"legend"}),side:{valType:"enumerated",values:["top","left","top left","top center","top right"],editType:"legend"},editType:"legend"},editType:"legend"}}}),mr=p({"src/components/legend/helpers.js"(e){e.isGrouped=function(e){return-1!==(e.traceorder||"").indexOf("grouped")},e.isVertical=function(e){return"h"!==e.orientation},e.isReversed=function(e){return-1!==(e.traceorder||"").indexOf("reversed")}}}),gr=p({"src/components/legend/defaults.js"(e,t){var r=Ve(),n=st(),i=gt(),a=N(),o=fr(),s=Be(),l=mr();function c(e,t,c,u){var h=t[e]||{},p=i.newContainer(c,e);function d(e,t){return n.coerce(h,p,o,e,t)}var f=n.coerceFont(d,"font",c.font);if(d("bgcolor",c.paper_bgcolor),d("bordercolor"),d("visible")){for(var m,g=function(e,t){var r=m._input,i=m;return n.coerce(r,i,a,e,t)},y=c.font||{},v=n.coerceFont(d,"grouptitlefont",y,{overrideDflt:{size:Math.round(1.1*y.size)}}),x=0,b=!1,_="normal",w=(c.shapes||[]).filter((function(e){return e.showlegend})),k=u.concat(w).filter((function(t){return e===(t.legend||"legend")})),T=0;T<k.length;T++)if((m=k[T]).visible){var S=m._isShape;(m.showlegend||m._dfltShowLegend&&!(m._module&&m._module.attributes&&m._module.attributes.showlegend&&!1===m._module.attributes.showlegend.dflt))&&(x++,m.showlegend&&(b=!0,(!S&&r.traceIs(m,"pie-like")||!0===m._input.showlegend)&&x++),n.coerceFont(g,"legendgrouptitle.font",v)),(!S&&r.traceIs(m,"bar")&&"stack"===c.barmode||-1!==["tonextx","tonexty"].indexOf(m.fill))&&(_=l.isGrouped({traceorder:_})?"grouped+reversed":"reversed"),void 0!==m.legendgroup&&""!==m.legendgroup&&(_=l.isReversed({traceorder:_})?"reversed+grouped":"grouped")}var A=n.coerce(t,c,s,"showlegend",b&&x>("legend"===e?1:0));if(!1===A&&(c[e]=void 0),(!1!==A||h.uirevision)&&(d("uirevision",c.uirevision),!1!==A)){d("borderwidth");var M,E,C,P="h"===d("orientation"),L="paper"===d("yref"),I="paper"===d("xref"),z="left";if(P?(M=0,r.getComponentMethod("rangeslider","isVisible")(t.xaxis)?L?(E=1.1,C="bottom"):(E=1,C="top"):L?(E=-.1,C="top"):(E=0,C="bottom")):(E=1,C="auto",I?M=1.02:(M=1,z="right")),n.coerce(h,p,{x:{valType:"number",editType:"legend",min:I?-2:0,max:I?3:1,dflt:M}},"x"),n.coerce(h,p,{y:{valType:"number",editType:"legend",min:L?-2:0,max:L?3:1,dflt:E}},"y"),d("traceorder",_),l.isGrouped(c[e])&&d("tracegroupgap"),d("entrywidth"),d("entrywidthmode"),d("indentation"),d("itemsizing"),d("itemwidth"),d("itemclick"),d("itemdoubleclick"),d("groupclick"),d("xanchor",z),d("yanchor",C),d("valign"),n.noneOrAll(h,p,["x","y"]),d("title.text")){d("title.side",P?"left":"top");var O=n.extendFlat({},f,{size:n.bigFont(f.size)});n.coerceFont(d,"title.font",O)}}}}t.exports=function(e,t,r){var i,a=r.slice(),o=t.shapes;if(o)for(i=0;i<o.length;i++){var s=o[i];if(s.showlegend){var l={_input:s._input,visible:s.visible,showlegend:s.showlegend,legend:s.legend};a.push(l)}}var u=["legend"];for(i=0;i<a.length;i++)n.pushUnique(u,a[i].legend);for(t._legends=[],i=0;i<u.length;i++){var h=u[i];c(h,e,t,a),t[h]&&t[h].visible&&(t[h]._id=h),t._legends.push(h)}}}}),yr=p({"src/components/legend/handle_click.js"(e,t){var r=Ve(),n=st(),i=n.pushUnique,a=!0;t.exports=function(e,t,o){var s=t._fullLayout;if(!t._dragged&&!t._editing){var l,c=s.legend.itemclick,u=s.legend.itemdoubleclick,h=s.legend.groupclick;if(1===o&&"toggle"===c&&"toggleothers"===u&&a&&t.data&&t._context.showTips?(n.notifier(n._(t,"Double-click on legend to isolate one trace"),"long"),a=!1):a=!1,1===o?l=c:2===o&&(l=u),l){var p="togglegroup"===h,d=s.hiddenlabels?s.hiddenlabels.slice():[],f=e.data()[0][0];if(!f.groupTitle||!f.noClick){var m=t._fullData,g=(s.shapes||[]).filter((function(e){return e.showlegend})),y=m.concat(g),v=f.trace;v._isShape&&(v=v._fullInput);var x,b,_,w,k,T=v.legendgroup,S={},A=[],M=[],E=[],C=(s.shapes||[]).map((function(e){return e._input})),P=!1,L=v.legend,I=v._fullInput;if(I&&I._isShape||!r.traceIs(v,"pie-like")){var z,O=T&&T.length,R=[];if(O)for(x=0;x<y.length;x++)(z=y[x]).visible&&z.legendgroup===T&&R.push(x);if("toggle"===l){var D;switch(v.visible){case!0:D="legendonly";break;case!1:D=!1;break;case"legendonly":D=!0}if(O)if(p)for(x=0;x<y.length;x++){var j=y[x];!1!==j.visible&&j.legendgroup===T&&Q(j,D)}else Q(v,D);else Q(v,D)}else if("toggleothers"===l){var F,B,N,U,V=!0;for(x=0;x<y.length;x++)if(F=(U=y[x])===v,B=!0!==U.showlegend,!F&&!B&&(!O||U.legendgroup!==T)&&U.legend===L&&!0===U.visible&&!r.traceIs(U,"notLegendIsolatable")){V=!1;break}for(x=0;x<y.length;x++)if(!1!==(U=y[x]).visible&&U.legend===L&&!r.traceIs(U,"notLegendIsolatable"))switch(v.visible){case"legendonly":Q(U,!0);break;case!0:N=!!V||"legendonly",F=U===v,B=!0!==U.showlegend&&!U.legendgroup,Q(U,!(!(F||O&&U.legendgroup===T)&&!B)||N)}}for(x=0;x<M.length;x++)if(_=M[x]){var q=_.constructUpdate(),H=Object.keys(q);for(b=0;b<H.length;b++)w=H[b],(S[w]=S[w]||[])[E[x]]=q[w]}for(k=Object.keys(S),x=0;x<k.length;x++)for(w=k[x],b=0;b<A.length;b++)S[w].hasOwnProperty(b)||(S[w][b]=void 0);P?r.call("_guiUpdate",t,S,{shapes:C},A):r.call("_guiRestyle",t,S,A)}else{var G=f.label,W=d.indexOf(G);if("toggle"===l)-1===W?d.push(G):d.splice(W,1);else if("toggleothers"===l){var $=-1!==W,Z=[];for(x=0;x<t.calcdata.length;x++){var X=t.calcdata[x];for(b=0;b<X.length;b++){var Y=X[b].label;L===X[0].trace.legend&&G!==Y&&(-1===d.indexOf(Y)&&($=!0),i(d,Y),Z.push(Y))}}if(!$)for(var K=0;K<Z.length;K++){var J=d.indexOf(Z[K]);-1!==J&&d.splice(J,1)}}r.call("_guiRelayout",t,"hiddenlabels",d)}}}}function Q(e,t){if(!f.groupTitle||p){var r=e._fullInput||e,n=r._isShape,i=r.index;void 0===i&&(i=r._index);var a,o=!1!==r.visible&&t;n?(a=o,C[i].visible=a,P=!0):function(e,t){var r=A.indexOf(e),n=S.visible;n||(n=S.visible=[]),-1===A.indexOf(e)&&(A.push(e),r=A.length-1),n[r]=t}(i,o)}}}}}),vr=p({"src/components/legend/constants.js"(e,t){t.exports={scrollBarWidth:6,scrollBarMinHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4,scrollBarEnterAttrs:{rx:20,ry:3,width:0,height:0},titlePad:2,itemGap:5}}}),xr=p({"src/components/legend/get_legend_data.js"(e,t){var r=Ve(),n=mr();t.exports=function(e,t,i){var a,o,s=t._inHover,l=n.isGrouped(t),c=n.isReversed(t),u={},h=[],p=!1,d={},f=0,m=0;function g(e,r,a){if(!1!==t.visible&&(!i||e===t._id))if(""!==r&&n.isGrouped(t))-1===h.indexOf(r)?(h.push(r),p=!0,u[r]=[a]):u[r].push(a);else{var o="~~i"+f;h.push(o),u[o]=[a],f++}}for(a=0;a<e.length;a++){var y=e[a],v=y[0],x=v.trace,b=x.legend,_=x.legendgroup;if(s||x.visible&&x.showlegend)if(r.traceIs(x,"pie-like"))for(d[_]||(d[_]={}),o=0;o<y.length;o++){var w=y[o].label;d[_][w]||(g(b,_,{label:w,color:y[o].color,i:y[o].i,trace:x,pts:y[o].pts}),d[_][w]=!0,m=Math.max(m,(w||"").length))}else g(b,_,v),m=Math.max(m,(x.name||"").length)}if(!h.length)return[];var k=!p||!l,T=[];for(a=0;a<h.length;a++){var S=u[h[a]];k?T.push(S[0]):T.push(S)}for(k&&(T=[T]),a=0;a<T.length;a++){var A=1/0;for(o=0;o<T[a].length;o++){var M=T[a][o].trace.legendrank;A>M&&(A=M)}T[a][0]._groupMinRank=A,T[a][0]._preGroupSort=a}var E=function(e,t){return e.trace.legendrank-t.trace.legendrank||e._preSort-t._preSort};for(T.forEach((function(e,t){e[0]._preGroupSort=t})),T.sort((function(e,t){return e[0]._groupMinRank-t[0]._groupMinRank||e[0]._preGroupSort-t[0]._preGroupSort})),a=0;a<T.length;a++){T[a].forEach((function(e,t){e._preSort=t})),T[a].sort(E);var C=T[a][0].trace,P=null;for(o=0;o<T[a].length;o++){var L=T[a][o].trace.legendgrouptitle;if(L&&L.text){P=L,s&&(L.font=t._groupTitleFont);break}}if(c&&T[a].reverse(),P){var I=!1;for(o=0;o<T[a].length;o++)if(r.traceIs(T[a][o].trace,"pie-like")){I=!0;break}T[a].unshift({i:-1,groupTitle:P,noClick:I,trace:{showlegend:C.showlegend,legendgroup:C.legendgroup,visible:"toggleitem"===t.groupclick||C.visible}})}for(o=0;o<T[a].length;o++)T[a][o]=[T[a][o]]}return t._lgroupsLength=T.length,t._maxNameLength=m,T}}}),br=p({"src/traces/pie/helpers.js"(e){var t=st();function r(e){return-1!==e.indexOf("e")?e.replace(/[.]?0+e/,"e"):-1!==e.indexOf(".")?e.replace(/[.]?0+$/,""):e}e.formatPiePercent=function(e,n){var i=r((100*e).toPrecision(3));return t.numSeparate(i,n)+"%"},e.formatPieValue=function(e,n){var i=r(e.toPrecision(10));return t.numSeparate(i,n)},e.getFirstFilled=function(e,r){if(t.isArrayOrTypedArray(e))for(var n=0;n<r.length;n++){var i=e[r[n]];if(i||0===i||""===i)return i}},e.castOption=function(r,n){return t.isArrayOrTypedArray(r)?e.getFirstFilled(r,n):r||void 0},e.getRotationAngle=function(e){return("auto"===e?0:e)*Math.PI/180}}}),_r=p({"src/traces/pie/fill_one.js"(e,t){var r=Jt(),n=q();t.exports=function(e,t,i,a){var o=i.marker.pattern;o&&o.shape?r.pointStyle(e,i,a,t):n.fill(e,t.color)}}}),wr=p({"src/traces/pie/style_one.js"(e,t){var r=q(),n=br().castOption,i=_r();t.exports=function(e,t,a,o){var s=a.marker.line,l=n(s.color,t.pts)||r.defaultLine,c=n(s.width,t.pts)||0;e.call(i,t,a,o).style("stroke-width",c).call(r.stroke,l)}}}),kr=p({"src/components/legend/style.js"(e,t){var r=v(),n=Ve(),i=st(),a=i.strTranslate,o=Jt(),s=q(),l=Mt().extractOpts,c=$t(),u=wr(),h=br().castOption,p=vr();function d(e,t){return(t?"radial":"horizontal")+(e?"":"reversed")}function f(e){var t=e[0].trace,r=t.contours,n=c.hasLines(t),i=c.hasMarkers(t),a=t.visible&&t.fill&&"none"!==t.fill,o=!1,s=!1;if(r){var l=r.coloring;"lines"===l?o=!0:n="none"===l||"heatmap"===l||r.showlines,"constraint"===r.type?a="="!==r._operation:"fill"!==l&&"heatmap"!==l||(s=!0)}return{showMarker:i,showLine:n,showFill:a,showGradientLine:o,showGradientFill:s,anyLine:n||o,anyFill:a||s}}function m(e,t,r){return e&&i.isArrayOrTypedArray(e)?t:e>r?r:e}t.exports=function(e,t,g){var y=t._fullLayout;g||(g=y.legend);var v="constant"===g.itemsizing,x=g.itemwidth,b=(x+2*p.itemGap)/2,_=a(b,0),w=function(e,t,r,n){var i;if(e+1)i=e;else{if(!(t&&t.width>0))return 0;i=t.width}return v?n:Math.min(i,r)};function k(e,i,a){var c=e[0].trace,u=c.marker||{},h=u.line||{},p=u.cornerradius?"M6,3a3,3,0,0,1-3,3H-3a3,3,0,0,1-3-3V-3a3,3,0,0,1,3-3H3a3,3,0,0,1,3,3Z":"M6,6H-6V-6H6Z",d=a?c.visible&&c.type===a:n.traceIs(c,"bar"),f=r.select(i).select("g.legendpoints").selectAll("path.legend"+a).data(d?[e]:[]);f.enter().append("path").classed("legend"+a,!0).attr("d",p).attr("transform",_),f.exit().remove(),f.each((function(e){var n=r.select(this),i=e[0],a=w(i.mlw,u.line,5,2);n.style("stroke-width",a+"px");var p=i.mcc;if(!g._inHover&&"mc"in i){var d=l(u),f=d.mid;void 0===f&&(f=(d.max+d.min)/2),p=o.tryColorscale(u,"")(f)}var y=p||i.mc||u.color,v=u.pattern,x=v&&o.getPatternAttr(v.shape,0,"");if(x){var b=o.getPatternAttr(v.bgcolor,0,null),_=o.getPatternAttr(v.fgcolor,0,null),k=v.fgopacity,T=m(v.size,8,10),S=m(v.solidity,.5,1),A="legend-"+c.uid;n.call(o.pattern,"legend",t,A,x,T,S,p,v.fillmode,b,_,k)}else n.call(s.fill,y);a&&s.stroke(n,i.mlc||h.color)}))}function T(e,a,o){var s=e[0],l=s.trace,c=o?l.visible&&l.type===o:n.traceIs(l,o),p=r.select(a).select("g.legendpoints").selectAll("path.legend"+o).data(c?[e]:[]);if(p.enter().append("path").classed("legend"+o,!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),p.exit().remove(),p.size()){var d=l.marker||{},f=w(h(d.line.width,s.pts),d.line,5,2),m="pieLike",g=i.minExtend(l,{marker:{line:{width:f}}},m),y=i.minExtend(s,{trace:g},m);u(p,y,g,t)}}e.each((function(e){var t=r.select(this),n=i.ensureSingle(t,"g","layers");n.style("opacity",e[0].trace.opacity);var o=g.indentation,s=g.valign,l=e[0].lineHeight,c=e[0].height;if("middle"===s&&0===o||!l||!c)n.attr("transform",null);else{var u={top:1,bottom:-1}[s]*(.5*(l-c+3))||0,h=g.indentation;n.attr("transform",a(h,u))}n.selectAll("g.legendfill").data([e]).enter().append("g").classed("legendfill",!0),n.selectAll("g.legendlines").data([e]).enter().append("g").classed("legendlines",!0);var p=n.selectAll("g.legendsymbols").data([e]);p.enter().append("g").classed("legendsymbols",!0),p.selectAll("g.legendpoints").data([e]).enter().append("g").classed("legendpoints",!0)})).each((function(e){var n,a=e[0].trace,c=[];if(a.visible)switch(a.type){case"histogram2d":case"heatmap":c=[["M-15,-2V4H15V-2Z"]],n=!0;break;case"choropleth":case"choroplethmapbox":case"choroplethmap":c=[["M-6,-6V6H6V-6Z"]],n=!0;break;case"densitymapbox":case"densitymap":c=[["M-6,0 a6,6 0 1,0 12,0 a 6,6 0 1,0 -12,0"]],n="radial";break;case"cone":c=[["M-6,2 A2,2 0 0,0 -6,6 V6L6,4Z"],["M-6,-6 A2,2 0 0,0 -6,-2 L6,-4Z"],["M-6,-2 A2,2 0 0,0 -6,2 L6,0Z"]],n=!1;break;case"streamtube":c=[["M-6,2 A2,2 0 0,0 -6,6 H6 A2,2 0 0,1 6,2 Z"],["M-6,-6 A2,2 0 0,0 -6,-2 H6 A2,2 0 0,1 6,-6 Z"],["M-6,-2 A2,2 0 0,0 -6,2 H6 A2,2 0 0,1 6,-2 Z"]],n=!1;break;case"surface":c=[["M-6,-6 A2,3 0 0,0 -6,0 H6 A2,3 0 0,1 6,-6 Z"],["M-6,1 A2,3 0 0,1 -6,6 H6 A2,3 0 0,0 6,0 Z"]],n=!0;break;case"mesh3d":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!1;break;case"volume":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6H6L0,6Z"]],n=!0;break;case"isosurface":c=[["M-6,6H0L-6,-6Z"],["M6,6H0L6,-6Z"],["M-6,-6 A12,24 0 0,0 6,-6 L0,6Z"]],n=!1}var u=r.select(this).select("g.legendpoints").selectAll("path.legend3dandfriends").data(c);u.enter().append("path").classed("legend3dandfriends",!0).attr("transform",_).style("stroke-miterlimit",1),u.exit().remove(),u.each((function(e,c){var u,h=r.select(this),p=l(a),f=p.colorscale,m=p.reversescale;if(f){if(!n){var g=f.length;u=0===c?f[m?g-1:0][1]:1===c?f[m?0:g-1][1]:f[Math.floor((g-1)/2)][1]}}else{var y=a.vertexcolor||a.facecolor||a.color;u=i.isArrayOrTypedArray(y)?y[c]||y[0]:y}h.attr("d",e[0]),u?h.call(s.fill,u):h.call((function(e){if(e.size()){var r="legendfill-"+a.uid;o.gradient(e,t,r,d(m,"radial"===n),f,"fill")}}))}))})).each((function(e){var t=e[0].trace,n="waterfall"===t.type;if(e[0]._distinct&&n){var i=e[0].trace[e[0].dir].marker;return e[0].mc=i.color,e[0].mlw=i.line.width,e[0].mlc=i.line.color,k(e,this,"waterfall")}var a=[];t.visible&&n&&(a=e[0].hasTotals?[["increasing","M-6,-6V6H0Z"],["totals","M6,6H0L-6,-6H-0Z"],["decreasing","M6,6V-6H0Z"]]:[["increasing","M-6,-6V6H6Z"],["decreasing","M6,6V-6H-6Z"]]);var o=r.select(this).select("g.legendpoints").selectAll("path.legendwaterfall").data(a);o.enter().append("path").classed("legendwaterfall",!0).attr("transform",_).style("stroke-miterlimit",1),o.exit().remove(),o.each((function(e){var n=r.select(this),i=t[e[0]].marker,a=w(void 0,i.line,5,2);n.attr("d",e[1]).style("stroke-width",a+"px").call(s.fill,i.color),a&&n.call(s.stroke,i.line.color)}))})).each((function(e){k(e,this,"funnel")})).each((function(e){k(e,this)})).each((function(e){var a=e[0].trace,l=r.select(this).select("g.legendpoints").selectAll("path.legendbox").data(a.visible&&n.traceIs(a,"box-violin")?[e]:[]);l.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform",_),l.exit().remove(),l.each((function(){var e=r.select(this);if("all"!==a.boxpoints&&"all"!==a.points||0!==s.opacity(a.fillcolor)||0!==s.opacity((a.line||{}).color)){var n=w(void 0,a.line,5,2);e.style("stroke-width",n+"px").call(s.fill,a.fillcolor),n&&s.stroke(e,a.line.color)}else{var c=i.minExtend(a,{marker:{size:v?12:i.constrain(a.marker.size,2,16),sizeref:1,sizemin:1,sizemode:"diameter"}});l.call(o.pointStyle,c,t)}}))})).each((function(e){T(e,this,"funnelarea")})).each((function(e){T(e,this,"pie")})).each((function(e){var n,a,s=f(e),u=s.showFill,h=s.showLine,p=s.showGradientLine,m=s.showGradientFill,g=s.anyFill,y=s.anyLine,v=e[0],b=v.trace,_=l(b),k=_.colorscale,T=_.reversescale,S=c.hasMarkers(b)||!g?"M5,0":y?"M5,-2":"M5,-3",A=r.select(this),M=A.select(".legendfill").selectAll("path").data(u||m?[e]:[]);if(M.enter().append("path").classed("js-fill",!0),M.exit().remove(),M.attr("d",S+"h"+x+"v6h-"+x+"z").call((function(e){if(e.size())if(u)o.fillGroupStyle(e,t,!0);else{var r="legendfill-"+b.uid;o.gradient(e,t,r,d(T),k,"fill")}})),h||p){var E=w(void 0,b.line,10,5);a=i.minExtend(b,{line:{width:E}}),n=[i.minExtend(v,{trace:a})]}var C=A.select(".legendlines").selectAll("path").data(h||p?[n]:[]);C.enter().append("path").classed("js-line",!0),C.exit().remove(),C.attr("d",S+(p?"l"+x+",0.0001":"h"+x)).call(h?o.lineGroupStyle:function(e){if(e.size()){var r="legendline-"+b.uid;o.lineGroupStyle(e),o.gradient(e,t,r,d(T),k,"stroke")}})})).each((function(e){var n,a,s=f(e),l=s.anyFill,u=s.anyLine,h=s.showLine,p=s.showMarker,d=e[0],m=d.trace,g=!p&&!u&&!l&&c.hasText(m);function y(e,t,r,n){var a=i.nestedProperty(m,e).get(),o=i.isArrayOrTypedArray(a)&&t?t(a):a;if(v&&o&&void 0!==n&&(o=n),r){if(o<r[0])return r[0];if(o>r[1])return r[1]}return o}function x(e){return d._distinct&&d.index&&e[d.index]?e[d.index]:e[0]}if(p||g||h){var b={},w={};if(p){b.mc=y("marker.color",x),b.mx=y("marker.symbol",x),b.mo=y("marker.opacity",i.mean,[.2,1]),b.mlc=y("marker.line.color",x),b.mlw=y("marker.line.width",i.mean,[0,5],2),w.marker={sizeref:1,sizemin:1,sizemode:"diameter"};var k=y("marker.size",i.mean,[2,16],12);b.ms=k,w.marker.size=k}h&&(w.line={width:y("line.width",x,[0,10],5)}),g&&(b.tx="Aa",b.tp=y("textposition",x),b.ts=10,b.tc=y("textfont.color",x),b.tf=y("textfont.family",x),b.tw=y("textfont.weight",x),b.ty=y("textfont.style",x),b.tv=y("textfont.variant",x),b.tC=y("textfont.textcase",x),b.tE=y("textfont.lineposition",x),b.tS=y("textfont.shadow",x)),n=[i.minExtend(d,b)],(a=i.minExtend(m,w)).selectedpoints=null,a.texttemplate=null}var T=r.select(this).select("g.legendpoints"),S=T.selectAll("path.scatterpts").data(p?n:[]);S.enter().insert("path",":first-child").classed("scatterpts",!0).attr("transform",_),S.exit().remove(),S.call(o.pointStyle,a,t),p&&(n[0].mrc=3);var A=T.selectAll("g.pointtext").data(g?n:[]);A.enter().append("g").classed("pointtext",!0).append("text").attr("transform",_),A.exit().remove(),A.selectAll("text").call(o.textPointStyle,a,t)})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendcandle").data(t.visible&&"candlestick"===t.type?[e,e]:[]);n.enter().append("path").classed("legendcandle",!0).attr("d",(function(e,t){return t?"M-15,0H-8M-8,6V-6H8Z":"M15,0H8M8,-6V6H-8Z"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],o=w(void 0,a.line,5,2);i.style("stroke-width",o+"px").call(s.fill,a.fillcolor),o&&s.stroke(i,a.line.color)}))})).each((function(e){var t=e[0].trace,n=r.select(this).select("g.legendpoints").selectAll("path.legendohlc").data(t.visible&&"ohlc"===t.type?[e,e]:[]);n.enter().append("path").classed("legendohlc",!0).attr("d",(function(e,t){return t?"M-15,0H0M-8,-6V0":"M15,0H0M8,6V0"})).attr("transform",_).style("stroke-miterlimit",1),n.exit().remove(),n.each((function(e,n){var i=r.select(this),a=t[n?"increasing":"decreasing"],l=w(void 0,a.line,5,2);i.style("fill","none").call(o.dashLine,a.line.dash,l),l&&s.stroke(i,a.line.color)}))}))}}}),Tr=p({"src/components/legend/draw.js"(e,t){var r=v(),n=st(),i=kt(),a=Ve(),o=pt(),s=hr(),l=Jt(),c=q(),u=At(),h=yr(),p=vr(),d=St(),f=d.LINE_SPACING,m=d.FROM_TL,g=d.FROM_BR,y=xr(),x=kr(),b=mr(),_=/^legend[0-9]*$/;function w(e,t){var o,h,d=t||{},v=e._fullLayout,_=L(d),w=d._inHover;if(w?(h=d.layer,o="hover"):(h=v._infolayer,o=_),h){var A;if(o+=v._uid,e._legendMouseDownTime||(e._legendMouseDownTime=0),w){if(!d.entries)return;A=y(d.entries,d)}else{for(var I=(e.calcdata||[]).slice(),z=v.shapes,O=0;O<z.length;O++){var R=z[O];if(R.showlegend){var D={_isShape:!0,_fullInput:R,index:R._index,name:R.name||R.label.text||"shape "+R._index,legend:R.legend,legendgroup:R.legendgroup,legendgrouptitle:R.legendgrouptitle,legendrank:R.legendrank,legendwidth:R.legendwidth,showlegend:R.showlegend,visible:R.visible,opacity:R.opacity,mode:"line"===R.type?"lines":"markers",line:R.line,marker:{line:R.line,color:R.fillcolor,size:12,symbol:"rect"===R.type?"square":"circle"===R.type?"circle":"hexagon2"}};I.push([{trace:D}])}}A=v.showlegend&&y(I,d,v._legends.length>1)}var j=v.hiddenlabels||[];if(!w&&(!v.showlegend||!A.length))return h.selectAll("."+_).remove(),v._topdefs.select("#"+o).remove(),i.autoMargin(e,_);var F=n.ensureSingle(h,"g",_,(function(e){w||e.attr("pointer-events","all")})),B=n.ensureSingleById(v._topdefs,"clipPath",o,(function(e){e.append("rect")})),N=n.ensureSingle(F,"rect","bg",(function(e){e.attr("shape-rendering","crispEdges")}));N.call(c.stroke,d.bordercolor).call(c.fill,d.bgcolor).style("stroke-width",d.borderwidth+"px");var U,V=n.ensureSingle(F,"g","scrollbox"),q=d.title;d._titleWidth=0,d._titleHeight=0,q.text?((U=n.ensureSingle(V,"text",_+"titletext")).attr("text-anchor","start").call(l.font,q.font).text(q.text),E(U,V,e,d,1)):V.selectAll("."+_+"titletext").remove();var H=n.ensureSingle(F,"rect","scrollbar",(function(e){e.attr(p.scrollBarEnterAttrs).call(c.fill,p.scrollBarColor)})),G=V.selectAll("g.groups").data(A);G.enter().append("g").attr("class","groups"),G.exit().remove();var W=G.selectAll("g.traces").data(n.identity);W.enter().append("g").attr("class","traces"),W.exit().remove(),W.style("opacity",(function(e){var t=e[0].trace;return a.traceIs(t,"pie-like")?-1!==j.indexOf(e[0].label)?.5:1:"legendonly"===t.visible?.5:1})).each((function(){r.select(this).call(S,e,d)})).call(x,e,d).each((function(){w||r.select(this).call(M,e,_)})),n.syncOrAsync([i.previousPromises,function(){return function(e,t,n,i){var a=e._fullLayout,o=L(i);i||(i=a[o]);var s=a._size,c=b.isVertical(i),u=b.isGrouped(i),h="fraction"===i.entrywidthmode,d=i.borderwidth,f=2*d,m=p.itemGap,g=i.indentation+i.itemwidth+2*m,y=2*(d+m),v=P(i),x=i.y<0||0===i.y&&"top"===v,_=i.y>1||1===i.y&&"bottom"===v,w=i.tracegroupgap,T={};i._maxHeight=Math.max(x||_?a.height/2:s.h,30);var S=0;i._width=0,i._height=0;var A=function(e){var t=0,r=0,n=e.title.side;return n&&(-1!==n.indexOf("left")&&(t=e._titleWidth),-1!==n.indexOf("top")&&(r=e._titleHeight)),[t,r]}(i);if(c)n.each((function(e){var t=e[0].height;l.setTranslate(this,d+A[0],d+A[1]+i._height+t/2+m),i._height+=t,i._width=Math.max(i._width,e[0].width)})),S=g+i._width,i._width+=m+g+f,i._height+=y,u&&(t.each((function(e,t){l.setTranslate(this,0,t*i.tracegroupgap)})),i._height+=(i._lgroupsLength-1)*i.tracegroupgap);else{var M=C(i),E=i.x<0||0===i.x&&"right"===M,I=i.x>1||1===i.x&&"left"===M,z=_||x,O=a.width/2;i._maxWidth=Math.max(E?z&&"left"===M?s.l+s.w:O:I?z&&"right"===M?s.r+s.w:O:s.w,2*g);var R=0,D=0;n.each((function(e){var t=k(e,i,g);R=Math.max(R,t),D+=t})),S=null;var j=0;if(u){var F=0,B=0,N=0;t.each((function(){var e=0,t=0;r.select(this).selectAll("g.traces").each((function(r){var n=k(r,i,g),a=r[0].height;l.setTranslate(this,A[0],A[1]+d+m+a/2+t),t+=a,e=Math.max(e,n),T[r[0].trace.legendgroup]=e}));var n=e+m;B>0&&n+d+B>i._maxWidth?(j=Math.max(j,B),B=0,N+=F+w,F=t):F=Math.max(F,t),l.setTranslate(this,B,N),B+=n})),i._width=Math.max(j,B)+d,i._height=N+F+y}else{var U=n.size(),V=D+f+(U-1)*m<i._maxWidth,q=0,H=0,G=0,W=0;n.each((function(e){var t=e[0].height,r=k(e,i,g),n=V?r:R;h||(n+=m),n+d+H-m>=i._maxWidth&&(j=Math.max(j,W),H=0,G+=q,i._height+=q,q=0),l.setTranslate(this,A[0]+d+H,A[1]+d+G+t/2+m),W=H+r+m,H+=n,q=Math.max(q,t)})),V?(i._width=H+f,i._height=q+y):(i._width=Math.max(j,W)+f,i._height+=q+y)}}i._width=Math.ceil(Math.max(i._width+A[0],i._titleWidth+2*(d+p.titlePad))),i._height=Math.ceil(Math.max(i._height+A[1],i._titleHeight+2*(d+p.itemGap))),i._effHeight=Math.min(i._height,i._maxHeight);var $=e._context.edits,Z=$.legendText||$.legendPosition;n.each((function(e){var t=r.select(this).select("."+o+"toggle"),n=e[0].height,a=e[0].trace.legendgroup,s=k(e,i,g);u&&""!==a&&(s=T[a]);var p=Z?g:S||s;c||h||(p+=m/2),l.setRect(t,0,-n/2,p,n)}))}(e,G,W,d)},function(){var t,c,y,x,b=v._size,k=d.borderwidth,S="paper"===d.xref,A="paper"===d.yref;if(q.text&&function(e,t,r){if("top center"===t.title.side||"top right"===t.title.side){var n=t.title.font.size*f,i=0,a=e.node(),o=l.bBox(a).width;"top center"===t.title.side?i=.5*(t._width-2*r-2*p.titlePad-o):"top right"===t.title.side&&(i=t._width-2*r-2*p.titlePad-o),u.positionText(e,r+p.titlePad+i,r+n)}}(U,d,k),!w){var M,E;M=S?b.l+b.w*d.x-m[C(d)]*d._width:v.width*d.x-m[C(d)]*d._width,E=A?b.t+b.h*(1-d.y)-m[P(d)]*d._effHeight:v.height*(1-d.y)-m[P(d)]*d._effHeight;var L=function(e,t,r,n){var a=e._fullLayout,o=a[t],s=C(o),l=P(o),c="paper"===o.xref,u="paper"===o.yref;e._fullLayout._reservedMargin[t]={};var h=o.y<.5?"b":"t",p=o.x<.5?"l":"r",d={r:a.width-r,l:r+o._width,b:a.height-n,t:n+o._effHeight};if(c&&u)return i.autoMargin(e,t,{x:o.x,y:o.y,l:o._width*m[s],r:o._width*g[s],b:o._effHeight*g[l],t:o._effHeight*m[l]});c?e._fullLayout._reservedMargin[t][h]=d[h]:u||"v"===o.orientation?e._fullLayout._reservedMargin[t][p]=d[p]:e._fullLayout._reservedMargin[t][h]=d[h]}(e,_,M,E);if(L)return;if(v.margin.autoexpand){var I=M,z=E;M=S?n.constrain(M,0,v.width-d._width):I,E=A?n.constrain(E,0,v.height-d._effHeight):z,M!==I&&n.log("Constrain "+_+".x to make legend fit inside graph"),E!==z&&n.log("Constrain "+_+".y to make legend fit inside graph")}l.setTranslate(F,M,E)}if(H.on(".drag",null),F.on("wheel",null),w||d._height<=d._maxHeight||e._context.staticPlot){var O=d._effHeight;w&&(O=d._height),N.attr({width:d._width-k,height:O-k,x:k/2,y:k/2}),l.setTranslate(V,0,0),B.select("rect").attr({width:d._width-2*k,height:O-2*k,x:k,y:k}),l.setClipUrl(V,o,e),l.setRect(H,0,0,0,0),delete d._scrollY}else{var R,D,j,G=Math.max(p.scrollBarMinHeight,d._effHeight*d._effHeight/d._height),W=d._effHeight-G-2*p.scrollBarMargin,$=d._height-d._effHeight,Z=W/$,X=Math.min(d._scrollY||0,$);N.attr({width:d._width-2*k+p.scrollBarWidth+p.scrollBarMargin,height:d._effHeight-k,x:k/2,y:k/2}),B.select("rect").attr({width:d._width-2*k+p.scrollBarWidth+p.scrollBarMargin,height:d._effHeight-2*k,x:k,y:k+X}),l.setClipUrl(V,o,e),J(X,G,Z),F.on("wheel",(function(){J(X=n.constrain(d._scrollY+r.event.deltaY/W*$,0,$),G,Z),0!==X&&X!==$&&r.event.preventDefault()}));var Y=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;R="touchstart"===e.type?e.changedTouches[0].clientY:e.clientY,j=X})).on("drag",(function(){var e=r.event.sourceEvent;2===e.buttons||e.ctrlKey||(D="touchmove"===e.type?e.changedTouches[0].clientY:e.clientY,J(X=function(e,t,r){var i=(r-t)/Z+e;return n.constrain(i,0,$)}(j,R,D),G,Z))}));H.call(Y);var K=r.behavior.drag().on("dragstart",(function(){var e=r.event.sourceEvent;"touchstart"===e.type&&(R=e.changedTouches[0].clientY,j=X)})).on("drag",(function(){var e=r.event.sourceEvent;"touchmove"===e.type&&(D=e.changedTouches[0].clientY,J(X=function(e,t,r){var i=(t-r)/Z+e;return n.constrain(i,0,$)}(j,R,D),G,Z))}));V.call(K)}function J(t,r,n){d._scrollY=e._fullLayout[_]._scrollY=t,l.setTranslate(V,0,-t),l.setRect(H,d._width,p.scrollBarMargin+t*n,p.scrollBarWidth,r),B.select("rect").attr("y",k+t)}e._context.edits.legendPosition&&(F.classed("cursor-move",!0),s.init({element:F.node(),gd:e,prepFn:function(e){if(e.target!==H.node()){var t=l.getTranslate(F);y=t.x,x=t.y}},moveFn:function(e,r){if(void 0!==y&&void 0!==x){var n=y+e,i=x+r;l.setTranslate(F,n,i),t=s.align(n,d._width,b.l,b.l+b.w,d.xanchor),c=s.align(i+d._height,-d._height,b.t+b.h,b.t,d.yanchor)}},doneFn:function(){if(void 0!==t&&void 0!==c){var r={};r[_+".x"]=t,r[_+".y"]=c,a.call("_guiRelayout",e,r)}},clickFn:function(t,r){var n=h.selectAll("g.traces").filter((function(){var e=this.getBoundingClientRect();return r.clientX>=e.left&&r.clientX<=e.right&&r.clientY>=e.top&&r.clientY<=e.bottom}));n.size()>0&&T(e,F,n,t,r)}}))}],e)}}function k(e,t,r){var n=e[0],i=n.width,a=t.entrywidthmode,o=n.trace.legendwidth||t.entrywidth;return"fraction"===a?t._maxWidth*o:r+(o||i)}function T(e,t,r,n,i){var s=r.data()[0][0].trace,l={event:i,node:r.node(),curveNumber:s.index,expandedIndex:s.index,data:e.data,layout:e.layout,frames:e._transitionData._frames,config:e._context,fullData:e._fullData,fullLayout:e._fullLayout};s._group&&(l.group=s._group),a.traceIs(s,"pie-like")&&(l.label=r.datum()[0].label);var c=o.triggerHandler(e,"plotly_legendclick",l);if(1===n){if(!1===c)return;t._clickTimeout=setTimeout((function(){e._fullLayout&&h(r,e,n)}),e._context.doubleClickDelay)}else 2===n&&(t._clickTimeout&&clearTimeout(t._clickTimeout),e._legendMouseDownTime=0,!1!==o.triggerHandler(e,"plotly_legenddoubleclick",l)&&!1!==c&&h(r,e,n))}function S(e,t,r){var i,o,s=L(r),c=e.data()[0][0],h=c.trace,d=a.traceIs(h,"pie-like"),f=!r._inHover&&t._context.edits.legendText&&!d,m=r._maxNameLength;c.groupTitle?(i=c.groupTitle.text,o=c.groupTitle.font):(o=r.font,r.entries?i=c.text:(i=d?c.label:h.name,h._meta&&(i=n.templateString(i,h._meta))));var g=n.ensureSingle(e,"text",s+"text");g.attr("text-anchor","start").call(l.font,o).text(f?A(i,m):i);var y=r.indentation+r.itemwidth+2*p.itemGap;u.positionText(g,y,0),f?g.call(u.makeEditable,{gd:t,text:i}).call(E,e,t,r).on("edit",(function(n){this.text(A(n,m)).call(E,e,t,r);var i=c.trace._fullInput||{},o={};return o.name=n,i._isShape?a.call("_guiRelayout",t,"shapes["+h.index+"].name",o.name):a.call("_guiRestyle",t,o,h.index)})):E(g,e,t,r)}function A(e,t){var r=Math.max(4,t);if(e&&e.trim().length>=r/2)return e;for(var n=r-(e=e||"").length;n>0;n--)e+=" ";return e}function M(e,t,i){var a,o=t._context.doubleClickDelay,s=1,l=n.ensureSingle(e,"rect",i+"toggle",(function(e){t._context.staticPlot||e.style("cursor","pointer").attr("pointer-events","all"),e.call(c.fill,"rgba(0,0,0,0)")}));t._context.staticPlot||(l.on("mousedown",(function(){(a=(new Date).getTime())-t._legendMouseDownTime<o?s+=1:(s=1,t._legendMouseDownTime=a)})),l.on("mouseup",(function(){if(!t._dragged&&!t._editing){var n=t._fullLayout[i];(new Date).getTime()-t._legendMouseDownTime>o&&(s=Math.max(s-1,1)),T(t,n,e,s,r.event)}})))}function E(e,t,r,n,i){n._inHover&&e.attr("data-notex",!0),u.convertToTspans(e,r,(function(){!function(e,t,r,n){var i=e.data()[0][0];if(r._inHover||!i||i.trace.showlegend){var a=e.select("g[class*=math-group]"),o=a.node(),s=L(r);r||(r=t._fullLayout[s]);var c,h,d=r.borderwidth,m=(1===n?r.title.font:i.groupTitle?i.groupTitle.font:r.font).size*f;if(o){var g=l.bBox(o);c=g.height,h=g.width,1===n?l.setTranslate(a,d,d+.75*c):l.setTranslate(a,0,.25*c)}else{var y="."+s+(1===n?"title":"")+"text",v=e.select(y),x=u.lineCount(v),b=v.node();if(c=m*x,h=b?l.bBox(b).width:0,1===n)"left"===r.title.side&&(h+=2*p.itemGap),u.positionText(v,d+p.titlePad,d+m);else{var _=2*p.itemGap+r.indentation+r.itemwidth;i.groupTitle&&(_=p.itemGap,h-=r.indentation+r.itemwidth),u.positionText(v,_,-m*((x-1)/2-.3))}}1===n?(r._titleWidth=h,r._titleHeight=c):(i.lineHeight=m,i.height=Math.max(c,16)+3,i.width=h)}else e.remove()}(t,r,n,i)}))}function C(e){return n.isRightAnchor(e)?"right":n.isCenterAnchor(e)?"center":"left"}function P(e){return n.isBottomAnchor(e)?"bottom":n.isMiddleAnchor(e)?"middle":"top"}function L(e){return e._id||"legend"}t.exports=function(e,t){if(t)w(e,t);else{var n=e._fullLayout,i=n._legends;n._infolayer.selectAll('[class^="legend"]').each((function(){var e=r.select(this),t=e.attr("class").split(" ")[0];t.match(_)&&-1===i.indexOf(t)&&e.remove()}));for(var a=0;a<i.length;a++){var o=i[a];w(e,e._fullLayout[o])}}}}}),Sr=p({"src/components/fx/hover.js"(e){var t=v(),r=k(),n=O(),i=st(),a=i.pushUnique,o=i.strTranslate,s=i.strRotate,l=pt(),c=At(),u=dr(),h=Jt(),p=q(),d=hr(),f=nr(),m=yt().zindexSeparator,g=Ve(),y=Xt(),x=j(),b=gr(),_=Tr(),w=x.YANGLE,T=Math.PI*w/180,S=1/Math.sin(T),A=Math.cos(T),M=Math.sin(T),E=x.HOVERARROWSIZE,C=x.HOVERTEXTPAD,P={box:!0,ohlc:!0,violin:!0,candlestick:!0},L={scatter:!0,scattergl:!0,splom:!0};function I(e,t){return e.distance-t.distance}function z(e){return[e.trace.index,e.index,e.x0,e.y0,e.name,e.attr,e.xa?e.xa._id:"",e.ya?e.ya._id:""].join(",")}e.hover=function(e,n,o,s){e=i.getGraphDiv(e);var c=n.target;i.throttle(e._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,(function(){!function(e,n,o,s,c){o||(o="xy"),"string"===typeof o&&(o=o.split(m)[0]);var h,v,x,b=Array.isArray(o)?o:[o],_=e._fullLayout,w=_.hoversubplots,k=_._plots||[],T=k[o],A=_._has("cartesian"),M=n.hovermode||_.hovermode,C="x"===(M||"").charAt(0),O="y"===(M||"").charAt(0);if(A&&(C||O)&&"axis"===w)for(var R=b.length,j=0;j<R;j++)if(k[h=b[j]]){v=f.getFromId(e,h,"x"),x=f.getFromId(e,h,"y");var F=(C?v:x)._subplotsWith;if(F&&F.length)for(var q=0;q<F.length;q++)a(b,F[q])}if(T&&"single"!==w){var G=T.overlays.map((function(e){return e.id}));b=b.concat(G)}for(var X=b.length,Y=new Array(X),K=new Array(X),J=!1,Q=0;Q<X;Q++)if(k[h=b[Q]])J=!0,Y[Q]=k[h].xaxis,K[Q]=k[h].yaxis;else{if(!_[h]||!_[h]._subplot)return void i.warn("Unrecognized subplot: "+h);var ee=_[h]._subplot;Y[Q]=ee.xaxis,K[Q]=ee.yaxis}if(M&&!J&&(M="closest"),-1===["x","y","closest","x unified","y unified"].indexOf(M)||!e.calcdata||e.querySelector(".zoombox")||e._dragging)return d.unhoverRaw(e,n);var te=_.hoverdistance;-1===te&&(te=1/0);var re=_.spikedistance;-1===re&&(re=1/0);var ne,ie,ae,oe,se,le,ce,ue,he,pe,de,fe,me,ge=[],ye=[],ve={hLinePoint:null,vLinePoint:null},xe=!1;if(Array.isArray(n))for(M="array",ae=0;ae<n.length;ae++)(se=e.calcdata[n[ae].curveNumber||0])&&(le=se[0].trace,"skip"!==se[0].trace.hoverinfo&&(ye.push(se),"h"===le.orientation&&(xe=!0)));else{var be,_e,we=e.calcdata.slice();for(we.sort((function(e,t){return(e[0].trace.zorder||0)-(t[0].trace.zorder||0)})),oe=0;oe<we.length;oe++)se=we[oe],"skip"!==(le=se[0].trace).hoverinfo&&y.isTraceInSubplots(le,b)&&(ye.push(se),"h"===le.orientation&&(xe=!0));if(c){if(!1===l.triggerHandler(e,"plotly_beforehover",n))return;var ke=c.getBoundingClientRect();be=n.clientX-ke.left,_e=n.clientY-ke.top,_._calcInverseTransform(e);var Te=i.apply3DTransform(_._invTransform)(be,_e);if(be=Te[0],_e=Te[1],be<0||be>Y[0]._length||_e<0||_e>K[0]._length)return d.unhoverRaw(e,n)}else be="xpx"in n?n.xpx:Y[0]._length/2,_e="ypx"in n?n.ypx:K[0]._length/2;if(n.pointerX=be+Y[0]._offset,n.pointerY=_e+K[0]._offset,ne="xval"in n?y.flat(b,n.xval):y.p2c(Y,be),ie="yval"in n?y.flat(b,n.yval):y.p2c(K,_e),!r(ne[0])||!r(ie[0]))return i.warn("Fx.hover failed",n,e),d.unhoverRaw(e,n)}var Se=1/0;function Ae(t,a){for(oe=0;oe<ye.length;oe++)if((se=ye[oe])&&se[0]&&se[0].trace&&!0===(le=se[0].trace).visible&&0!==le._length&&-1===["carpet","contourcarpet"].indexOf(le._module.name)){if(he=M,y.isUnifiedHover(he)&&(he=he.charAt(0)),"splom"===le.type?ce=b[ue=0]:(ce=y.getSubplot(le),ue=b.indexOf(ce)),fe={cd:se,trace:le,xa:Y[ue],ya:K[ue],maxHoverDistance:te,maxSpikeDistance:re,index:!1,distance:Math.min(Se,te),spikeDistance:1/0,xSpike:void 0,ySpike:void 0,color:p.defaultLine,name:le.name,x0:void 0,x1:void 0,y0:void 0,y1:void 0,xLabelVal:void 0,yLabelVal:void 0,zLabelVal:void 0,text:void 0},_[ce]&&(fe.subplot=_[ce]._subplot),_._splomScenes&&_._splomScenes[le.uid]&&(fe.scene=_._splomScenes[le.uid]),"array"===he){var o=n[oe];"pointNumber"in o?(fe.index=o.pointNumber,he="closest"):(he="","xval"in o&&(pe=o.xval,he="x"),"yval"in o&&(de=o.yval,he=he?"closest":"y"))}else void 0!==t&&void 0!==a?(pe=t,de=a):(pe=ne[ue],de=ie[ue]);if(me=ge.length,0!==te)if(le._module&&le._module.hoverPoints){var s=le._module.hoverPoints(fe,pe,de,he,{finiteRange:!0,hoverLayer:_._hoverlayer,hoversubplots:w,gd:e});if(s)for(var l,c=0;c<s.length;c++)l=s[c],r(l.x0)&&r(l.y0)&&ge.push(U(l,M))}else i.log("Unrecognized trace type in hover:",le);if("closest"===M&&ge.length>me&&(ge.splice(0,me),Se=ge[0].distance),A&&0!==re&&0===ge.length){fe.distance=re,fe.index=!1;var u=le._module.hoverPoints(fe,pe,de,"closest",{hoverLayer:_._hoverlayer});if(u&&(u=u.filter((function(e){return e.spikeDistance<=re}))),u&&u.length){var h,d=u.filter((function(e){return e.xa.showspikes&&"hovered data"!==e.xa.spikesnap}));if(d.length){var f=d[0];r(f.x0)&&r(f.y0)&&(h=Ee(f),(!ve.vLinePoint||ve.vLinePoint.spikeDistance>h.spikeDistance)&&(ve.vLinePoint=h))}var m=u.filter((function(e){return e.ya.showspikes&&"hovered data"!==e.ya.spikesnap}));if(m.length){var g=m[0];r(g.x0)&&r(g.y0)&&(h=Ee(g),(!ve.hLinePoint||ve.hLinePoint.spikeDistance>h.spikeDistance)&&(ve.hLinePoint=h))}}}}}function Me(e,t,r){for(var n,i=null,a=1/0,o=0;o<e.length;o++)v&&v._id!==e[o].xa._id||x&&x._id!==e[o].ya._id||(n=e[o].spikeDistance,r&&0===o&&(n=-1/0),n<=a&&n<=t&&(i=e[o],a=n));return i}function Ee(e){return e?{xa:e.xa,ya:e.ya,x:void 0!==e.xSpike?e.xSpike:(e.x0+e.x1)/2,y:void 0!==e.ySpike?e.ySpike:(e.y0+e.y1)/2,distance:e.distance,spikeDistance:e.spikeDistance,curveNumber:e.trace.index,color:e.color,pointNumber:e.index}:null}Ae();var Ce={fullLayout:_,container:_._hoverlayer,event:n},Pe=e._spikepoints,Le={vLinePoint:ve.vLinePoint,hLinePoint:ve.hLinePoint};e._spikepoints=Le;var Ie=function(){var e=ge.filter((function(e){return v&&v._id===e.xa._id&&x&&x._id===e.ya._id})),t=ge.filter((function(e){return!(v&&v._id===e.xa._id&&x&&x._id===e.ya._id)}));e.sort(I),t.sort(I),ge=function(e,t){for(var r=t.charAt(0),n=[],i=[],a=[],o=0;o<e.length;o++){var s=e[o];g.traceIs(s.trace,"bar-like")||g.traceIs(s.trace,"box-violin")?a.push(s):s.trace[r+"period"]?i.push(s):n.push(s)}return n.concat(i).concat(a)}(ge=e.concat(t),M)};Ie();var ze=M.charAt(0),Oe=("x"===ze||"y"===ze)&&ge[0]&&L[ge[0].trace.type];if(A&&0!==re&&0!==ge.length){var Re=Me(ge.filter((function(e){return e.ya.showspikes})),re,Oe);ve.hLinePoint=Ee(Re);var De=Me(ge.filter((function(e){return e.xa.showspikes})),re,Oe);ve.vLinePoint=Ee(De)}if(0===ge.length){var je=d.unhoverRaw(e,n);return!A||null===ve.hLinePoint&&null===ve.vLinePoint||H(Pe)&&V(e,ve,Ce),je}if(A&&H(Pe)&&V(e,ve,Ce),y.isXYhover(he)&&0!==ge[0].length&&"splom"!==ge[0].trace.type){var Fe=ge[0],Be=(ge=P[Fe.trace.type]?ge.filter((function(e){return e.trace.index===Fe.trace.index})):[Fe]).length;Ae(W("x",Fe,_),W("y",Fe,_));var Ne,Ue=[],Ve={},qe=0,He=function(e){var t=P[e.trace.type]?z(e):e.trace.index;if(Ve[t]){var r=Ve[t]-1,n=Ue[r];r>0&&Math.abs(e.distance)<Math.abs(n.distance)&&(Ue[r]=e)}else qe++,Ve[t]=qe,Ue.push(e)};for(Ne=0;Ne<Be;Ne++)He(ge[Ne]);for(Ne=ge.length-1;Ne>Be-1;Ne--)He(ge[Ne]);ge=Ue,Ie()}var Ge=e._hoverdata,We=[],$e=$(e),Ze=Z(e);for(ae=0;ae<ge.length;ae++){var Xe=ge[ae],Ye=y.makeEventData(Xe,Xe.trace,Xe.cd);if(!1!==Xe.hovertemplate){var Ke=!1;Xe.cd[Xe.index]&&Xe.cd[Xe.index].ht&&(Ke=Xe.cd[Xe.index].ht),Xe.hovertemplate=Ke||Xe.trace.hovertemplate||!1}if(Xe.xa&&Xe.ya){var Je=Xe.x0+Xe.xa._offset,Qe=Xe.x1+Xe.xa._offset,et=Xe.y0+Xe.ya._offset,tt=Xe.y1+Xe.ya._offset,rt=Math.min(Je,Qe),nt=Math.max(Je,Qe),it=Math.min(et,tt),at=Math.max(et,tt);Ye.bbox={x0:rt+Ze,x1:nt+Ze,y0:it+$e,y1:at+$e}}Xe.eventData=[Ye],We.push(Ye)}e._hoverdata=We;var ot="y"===M&&(ye.length>1||ge.length>1)||"closest"===M&&xe&&ge.length>1,st=p.combine(_.plot_bgcolor||p.background,_.paper_bgcolor),lt=D(ge,{gd:e,hovermode:M,rotateLabels:ot,bgColor:st,container:_._hoverlayer,outerContainer:_._paper.node(),commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance}),ct=lt.hoverLabels;if(y.isUnifiedHover(M)||(function(e,t,r,n){var i,a,o,s,l,c,u,h=t?"xa":"ya",p=t?"ya":"xa",d=0,f=1,m=e.size(),g=new Array(m),y=0,v=n.minX,x=n.maxX,b=n.minY,_=n.maxY,w=function(e){return e*r._invScaleX},k=function(e){return e*r._invScaleY};function T(e){var t=e[0],r=e[e.length-1];if(a=t.pmin-t.pos-t.dp+t.size,o=r.pos+r.dp+r.size-t.pmax,a>.01){for(l=e.length-1;l>=0;l--)e[l].dp+=a;i=!1}if(!(o<.01)){if(a<-.01){for(l=e.length-1;l>=0;l--)e[l].dp-=o;i=!1}if(i){var n=0;for(s=0;s<e.length;s++)(c=e[s]).pos+c.dp+c.size>t.pmax&&n++;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos>t.pmax-1&&(c.del=!0,n--);for(s=0;s<e.length&&!(n<=0);s++)if((c=e[s]).pos<t.pmin+1)for(c.del=!0,n--,o=2*c.size,l=e.length-1;l>=0;l--)e[l].dp-=o;for(s=e.length-1;s>=0&&!(n<=0);s--)(c=e[s]).pos+c.dp+c.size>t.pmax&&(c.del=!0,n--)}}}for(e.each((function(e){var n=e[h],i=e[p],a="x"===n._id.charAt(0),o=n.range;0===y&&o&&o[0]>o[1]!==a&&(f=-1);var s=0,l=a?r.width:r.height;if("x"===r.hovermode||"y"===r.hovermode){var c,u,d=B(e,t),m=e.anchor,T="end"===m?-1:1;if("middle"===m)u=(c=e.crossPos+(a?k(d.y-e.by/2):w(e.bx/2+e.tx2width/2)))+(a?k(e.by):w(e.bx));else if(a)u=(c=e.crossPos+k(E+d.y)-k(e.by/2-E))+k(e.by);else{var A=w(T*E+d.x),M=A+w(T*e.bx);c=e.crossPos+Math.min(A,M),u=e.crossPos+Math.max(A,M)}a?void 0!==b&&void 0!==_&&Math.min(u,_)-Math.max(c,b)>1&&("left"===i.side?(s=i._mainLinePosition,l=r.width):l=i._mainLinePosition):void 0!==v&&void 0!==x&&Math.min(u,x)-Math.max(c,v)>1&&("top"===i.side?(s=i._mainLinePosition,l=r.height):l=i._mainLinePosition)}g[y++]=[{datum:e,traceIndex:e.trace.index,dp:0,pos:e.pos,posref:e.posref,size:e.by*(a?S:1)/2,pmin:s,pmax:l}]})),g.sort((function(e,t){return e[0].posref-t[0].posref||f*(t[0].traceIndex-e[0].traceIndex)}));!i&&d<=m;){for(d++,i=!0,s=0;s<g.length-1;){var A=g[s],M=g[s+1],C=A[A.length-1],P=M[0];if((a=C.pos+C.dp+C.size-P.pos-P.dp+P.size)>.01){for(l=M.length-1;l>=0;l--)M[l].dp+=a;for(A.push.apply(A,M),g.splice(s+1,1),u=0,l=A.length-1;l>=0;l--)u+=A[l].dp;for(o=u/A.length,l=A.length-1;l>=0;l--)A[l].dp-=o;i=!1}else s++}g.forEach(T)}for(s=g.length-1;s>=0;s--){var L=g[s];for(l=L.length-1;l>=0;l--){var I=L[l],z=I.datum;z.offset=I.dp,z.del=I.del}}}(ct,ot,_,lt.commonLabelBoundingBox),N(ct,ot,_._invScaleX,_._invScaleY)),c&&c.tagName){var ut=g.getComponentMethod("annotations","hasClickToShow")(e,We);u(t.select(c),ut?"pointer":"")}c&&!s&&function(e,t,r){if(!r||r.length!==e._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=e._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber)||String(i.pointNumbers)!==String(a.pointNumbers))return!0}return!1}(e,0,Ge)&&(Ge&&e.emit("plotly_unhover",{event:n,points:Ge}),e.emit("plotly_hover",{event:n,points:e._hoverdata,xaxes:Y,yaxes:K,xvals:ne,yvals:ie}))}(e,n,o,s,c)}))},e.loneHover=function(e,r){var n=!0;Array.isArray(e)||(n=!1,e=[e]);var i=r.gd,a=$(i),o=Z(i),s=!1,l=D(e.map((function(e){var t=e._x0||e.x0||e.x||0,n=e._x1||e.x1||e.x||0,s=e._y0||e.y0||e.y||0,l=e._y1||e.y1||e.y||0,c=e.eventData;if(c){var u=Math.min(t,n),h=Math.max(t,n),d=Math.min(s,l),f=Math.max(s,l),m=e.trace;if(g.traceIs(m,"gl3d")){var y=i._fullLayout[m.scene]._scene.container,v=y.offsetLeft,x=y.offsetTop;u+=v,h+=v,d+=x,f+=x}c.bbox={x0:u+o,x1:h+o,y0:d+a,y1:f+a},r.inOut_bbox&&r.inOut_bbox.push(c.bbox)}else c=!1;return{color:e.color||p.defaultLine,x0:e.x0||e.x||0,x1:e.x1||e.x||0,y0:e.y0||e.y||0,y1:e.y1||e.y||0,xLabel:e.xLabel,yLabel:e.yLabel,zLabel:e.zLabel,text:e.text,name:e.name,idealAlign:e.idealAlign,borderColor:e.borderColor,fontFamily:e.fontFamily,fontSize:e.fontSize,fontColor:e.fontColor,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontVariant:e.fontVariant,nameLength:e.nameLength,textAlign:e.textAlign,trace:e.trace||{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0,hovertemplate:e.hovertemplate||!1,hovertemplateLabels:e.hovertemplateLabels||!1,eventData:c}})),{gd:i,hovermode:"closest",rotateLabels:s,bgColor:r.bgColor||p.background,container:t.select(r.container),outerContainer:r.outerContainer||r.container}).hoverLabels,c=0,u=0;return l.sort((function(e,t){return e.y0-t.y0})).each((function(e,t){var n=e.y0-e.by/2;e.offset=n-5<c?c-n+5:0,c=n+e.by+e.offset,t===r.anchorIndex&&(u=e.offset)})).each((function(e){e.offset-=u})),N(l,s,i._fullLayout._invScaleX,i._fullLayout._invScaleY),n?l:l.node()};var R=/<extra>([\s\S]*)<\/extra>/;function D(e,r){var n=r.gd,a=n._fullLayout,l=r.hovermode,u=r.rotateLabels,d=r.bgColor,f=r.container,m=r.outerContainer,v=r.commonLabelOpts||{};if(0===e.length)return[[]];var k=r.fontFamily||x.HOVERFONT,T=r.fontSize||x.HOVERFONTSIZE,S=r.fontWeight||a.font.weight,A=r.fontStyle||a.font.style,M=r.fontVariant||a.font.variant,P=r.fontTextcase||a.font.textcase,L=r.fontLineposition||a.font.lineposition,I=r.fontShadow||a.font.shadow,O=e[0],R=O.xa,D=O.ya,j=l.charAt(0),B=j+"Label",N=O[B];if(void 0===N&&"multicategory"===R.type)for(var U=0;U<e.length&&void 0===(N=e[U][B]);U++);var V=X(n,m),q=V.top,H=V.width,G=V.height,W=void 0!==N&&O.distance<=r.hoverdistance&&("x"===l||"y"===l);if(W){var $,Z,Y=!0;for($=0;$<e.length;$++)if(Y&&void 0===e[$].zLabel&&(Y=!1),Z=e[$].hoverinfo||e[$].trace.hoverinfo){var K=Array.isArray(Z)?Z:Z.split("+");if(-1===K.indexOf("all")&&-1===K.indexOf(l)){W=!1;break}}Y&&(W=!1)}var J=f.selectAll("g.axistext").data(W?[0]:[]);J.enter().append("g").classed("axistext",!0),J.exit().remove();var Q={minX:0,maxX:0,minY:0,maxY:0};if(J.each((function(){var e=t.select(this),r=i.ensureSingle(e,"path","",(function(e){e.style({"stroke-width":"1px"})})),s=i.ensureSingle(e,"text","",(function(e){e.attr("data-notex",1)})),u=v.bgcolor||p.defaultLine,d=v.bordercolor||p.contrast(u),f=p.contrast(u),m=v.font,g={weight:m.weight||S,style:m.style||A,variant:m.variant||M,textcase:m.textcase||P,lineposition:m.lineposition||L,shadow:m.shadow||I,family:m.family||k,size:m.size||T,color:m.color||f};r.style({fill:u,stroke:d}),s.text(N).call(h.font,g).call(c.positionText,0,0).call(c.convertToTspans,n),e.attr("transform","");var y,x,b=X(n,s.node());if("x"===l){var _="top"===R.side?"-":"";s.attr("text-anchor","middle").call(c.positionText,0,"top"===R.side?q-b.bottom-E-C:q-b.top+E+C),y=R._offset+(O.x0+O.x1)/2,x=D._offset+("top"===R.side?0:D._length);var w=b.width/2+C,z=y;y<w?z=w:y>a.width-w&&(z=a.width-w),r.attr("d","M"+(y-z)+",0L"+(y-z+E)+","+_+E+"H"+w+"v"+_+(2*C+b.height)+"H"+-w+"V"+_+E+"H"+(y-z-E)+"Z"),y=z,Q.minX=y-w,Q.maxX=y+w,"top"===R.side?(Q.minY=x-(2*C+b.height),Q.maxY=x-C):(Q.minY=x+C,Q.maxY=x+(2*C+b.height))}else{var j,F,B;"right"===D.side?(j="start",F=1,B="",y=R._offset+R._length):(j="end",F=-1,B="-",y=R._offset),x=D._offset+(O.y0+O.y1)/2,s.attr("text-anchor",j),r.attr("d","M0,0L"+B+E+","+E+"V"+(C+b.height/2)+"h"+B+(2*C+b.width)+"V-"+(C+b.height/2)+"H"+B+E+"V-"+E+"Z"),Q.minY=x-(C+b.height/2),Q.maxY=x+(C+b.height/2),"right"===D.side?(Q.minX=y+E,Q.maxX=y+E+(2*C+b.width)):(Q.minX=y-E-(2*C+b.width),Q.maxX=y-E);var U,V=b.height/2,H=q-b.top-V,G="clip"+a._uid+"commonlabel"+D._id;if(y<b.width+2*C+E){U="M-"+(E+C)+"-"+V+"h-"+(b.width-C)+"V"+V+"h"+(b.width-C)+"Z";var W=b.width-y+C;c.positionText(s,W,H),"end"===j&&s.selectAll("tspan").each((function(){var e=t.select(this),r=h.tester.append("text").text(e.text()).call(h.font,g),i=X(n,r.node());Math.round(i.width)<Math.round(b.width)&&e.attr("x",W-i.width),r.remove()}))}else c.positionText(s,F*(C+E),H),U=null;var $=a._topclips.selectAll("#"+G).data(U?[0]:[]);$.enter().append("clipPath").attr("id",G).append("path"),$.exit().remove(),$.select("path").attr("d",U),h.setClipUrl(s,U?G:null,n)}e.attr("transform",o(y,x))})),y.isUnifiedHover(l)){f.selectAll("g.hovertext").remove();var ee=e.filter((function(e){return"none"!==e.hoverinfo}));if(0===ee.length)return[];var te=a.hoverlabel,re=te.font,ne={showlegend:!0,legend:{title:{text:N,font:re},font:re,bgcolor:te.bgcolor,bordercolor:te.bordercolor,borderwidth:1,tracegroupgap:7,traceorder:a.legend?a.legend.traceorder:void 0,orientation:"v"}},ie={font:re};b(ne,ie,n._fullData);var ae=ie.legend;ae.entries=[];for(var oe=0;oe<ee.length;oe++){var se=ee[oe];if("none"!==se.hoverinfo){var le=F(se,!0,l,a,N),ce=le[0],ue=le[1];se.name=ue,se.text=""!==ue?ue+" : "+ce:ce;var he=se.cd[se.index];he&&(he.mc&&(se.mc=he.mc),he.mcc&&(se.mc=he.mcc),he.mlc&&(se.mlc=he.mlc),he.mlcc&&(se.mlc=he.mlcc),he.mlw&&(se.mlw=he.mlw),he.mrc&&(se.mrc=he.mrc),he.dir&&(se.dir=he.dir)),se._distinct=!0,ae.entries.push([se])}}ae.entries.sort((function(e,t){return e[0].trace.index-t[0].trace.index})),ae.layer=f,ae._inHover=!0,ae._groupTitleFont=te.grouptitlefont,_(n,ae);var pe,de,fe,me,ge=f.select("g.legend"),ye=X(n,ge.node()),ve=ye.width+2*C,xe=ye.height+2*C,be=ee[0],_e=(be.x0+be.x1)/2,we=(be.y0+be.y1)/2,ke=!(g.traceIs(be.trace,"bar-like")||g.traceIs(be.trace,"box-violin"));"y"===j?ke?(de=we-C,pe=we+C):(de=Math.min.apply(null,ee.map((function(e){return Math.min(e.y0,e.y1)}))),pe=Math.max.apply(null,ee.map((function(e){return Math.max(e.y0,e.y1)})))):de=pe=i.mean(ee.map((function(e){return(e.y0+e.y1)/2})))-xe/2,"x"===j?ke?(fe=_e+C,me=_e-C):(fe=Math.max.apply(null,ee.map((function(e){return Math.max(e.x0,e.x1)}))),me=Math.min.apply(null,ee.map((function(e){return Math.min(e.x0,e.x1)})))):fe=me=i.mean(ee.map((function(e){return(e.x0+e.x1)/2})))-ve/2;var Te,Se,Ae=R._offset,Me=D._offset;return me+=Ae-ve,de+=Me-xe,Te=(fe+=Ae)+ve<H&&fe>=0?fe:me+ve<H&&me>=0?me:Ae+ve<H?Ae:fe-_e<_e-me+ve?H-ve:0,Te+=C,Se=(pe+=Me)+xe<G&&pe>=0?pe:de+xe<G&&de>=0?de:Me+xe<G?Me:pe-we<we-de+xe?G-xe:0,Se+=C,ge.attr("transform",o(Te-1,Se-1)),ge}var Ee=f.selectAll("g.hovertext").data(e,(function(e){return z(e)}));return Ee.enter().append("g").classed("hovertext",!0).each((function(){var e=t.select(this);e.append("rect").call(p.fill,p.addOpacity(d,.8)),e.append("text").classed("name",!0),e.append("path").style("stroke-width","1px"),e.append("text").classed("nums",!0).call(h.font,{weight:S,style:A,variant:M,textcase:P,lineposition:L,shadow:I,family:k,size:T})})),Ee.exit().remove(),Ee.each((function(e){var r=t.select(this).attr("transform",""),i=e.color;Array.isArray(i)&&(i=i[e.eventData[0].pointNumber]);var f=e.bgcolor||i,m=p.combine(p.opacity(f)?f:p.defaultLine,d),g=p.combine(p.opacity(i)?i:p.defaultLine,d),y=e.borderColor||p.contrast(m),v=F(e,W,l,a,N,r),x=v[0],b=v[1],_=r.select("text.nums").call(h.font,{family:e.fontFamily||k,size:e.fontSize||T,color:e.fontColor||y,weight:e.fontWeight||S,style:e.fontStyle||A,variant:e.fontVariant||M,textcase:e.fontTextcase||P,lineposition:e.fontLineposition||L,shadow:e.fontShadow||I}).text(x).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n),z=r.select("text.name"),O=0,R=0;if(b&&b!==x){z.call(h.font,{family:e.fontFamily||k,size:e.fontSize||T,color:g,weight:e.fontWeight||S,style:e.fontStyle||A,variant:e.fontVariant||M,textcase:e.fontTextcase||P,lineposition:e.fontLineposition||L,shadow:e.fontShadow||I}).text(b).attr("data-notex",1).call(c.positionText,0,0).call(c.convertToTspans,n);var D=X(n,z.node());O=D.width+2*C,R=D.height+2*C}else z.remove(),r.select("rect").remove();r.select("path").style({fill:m,stroke:y});var j=e.xa._offset+(e.x0+e.x1)/2,B=e.ya._offset+(e.y0+e.y1)/2,U=Math.abs(e.x1-e.x0),V=Math.abs(e.y1-e.y0),$=X(n,_.node()),Z=$.width/a._invScaleX,Y=$.height/a._invScaleY;e.ty0=(q-$.top)/a._invScaleY,e.bx=Z+2*C,e.by=Math.max(Y+2*C,R),e.anchor="start",e.txwidth=Z,e.tx2width=O,e.offset=0;var K,J,Q=(Z+E+C+O)*a._invScaleX;if(u)e.pos=j,K=B+V/2+Q<=G,J=B-V/2-Q>=0,"top"!==e.idealAlign&&K||!J?K?(B+=V/2,e.anchor="start"):e.anchor="middle":(B-=V/2,e.anchor="end"),e.crossPos=B;else{if(e.pos=B,K=j+U/2+Q<=H,J=j-U/2-Q>=0,"left"!==e.idealAlign&&K||!J)if(K)j+=U/2,e.anchor="start";else{e.anchor="middle";var ee=Q/2,te=j+ee-H,re=j-ee;te>0&&(j-=te),re<0&&(j+=-re)}else j-=U/2,e.anchor="end";e.crossPos=j}_.attr("text-anchor",e.anchor),O&&z.attr("text-anchor",e.anchor),r.attr("transform",o(j,B)+(u?s(w):""))})),{hoverLabels:Ee,commonLabelBoundingBox:Q}}function F(e,t,r,n,a,o){var s="",l="";void 0!==e.nameOverride&&(e.name=e.nameOverride),e.name&&(e.trace._meta&&(e.name=i.templateString(e.name,e.trace._meta)),s=G(e.name,e.nameLength));var c=r.charAt(0),u="x"===c?"y":"x";void 0!==e.zLabel?(void 0!==e.xLabel&&(l+="x: "+e.xLabel+"<br>"),void 0!==e.yLabel&&(l+="y: "+e.yLabel+"<br>"),"choropleth"!==e.trace.type&&"choroplethmapbox"!==e.trace.type&&"choroplethmap"!==e.trace.type&&(l+=(l?"z: ":"")+e.zLabel)):t&&e[c+"Label"]===a?l=e[u+"Label"]||"":void 0===e.xLabel?void 0!==e.yLabel&&"scattercarpet"!==e.trace.type&&(l=e.yLabel):l=void 0===e.yLabel?e.xLabel:"("+e.xLabel+", "+e.yLabel+")",!e.text&&0!==e.text||Array.isArray(e.text)||(l+=(l?"<br>":"")+e.text),void 0!==e.extraText&&(l+=(l?"<br>":"")+e.extraText),o&&""===l&&!e.hovertemplate&&(""===s&&o.remove(),l=s);var h=e.hovertemplate||!1;if(h){var p=e.hovertemplateLabels||e;e[c+"Label"]!==a&&(p[c+"other"]=p[c+"Val"],p[c+"otherLabel"]=p[c+"Label"]),l=(l=i.hovertemplateString(h,p,n._d3locale,e.eventData[0]||{},e.trace._meta)).replace(R,(function(t,r){return s=G(r,e.nameLength),""}))}return[l,s]}function B(e,t){var r=0,n=e.offset;return t&&(n*=-M,r=e.offset*A),{x:r,y:n}}function N(e,r,n,i){var a=function(e){return e*n},o=function(e){return e*i};e.each((function(e){var n=t.select(this);if(e.del)return n.remove();var i=n.select("text.nums"),s=e.anchor,l="end"===s?-1:1,u=function(e){var t={start:1,end:-1,middle:0}[e.anchor],r=t*(E+C),n=r+t*(e.txwidth+C);return"middle"===e.anchor&&(r-=e.tx2width/2,n+=e.txwidth/2+C),{alignShift:t,textShiftX:r,text2ShiftX:n}}(e),p=B(e,r),d=p.x,f=p.y,m="middle"===s;n.select("path").attr("d",m?"M-"+a(e.bx/2+e.tx2width/2)+","+o(f-e.by/2)+"h"+a(e.bx)+"v"+o(e.by)+"h-"+a(e.bx)+"Z":"M0,0L"+a(l*E+d)+","+o(E+f)+"v"+o(e.by/2-E)+"h"+a(l*e.bx)+"v-"+o(e.by)+"H"+a(l*E+d)+"V"+o(f-E)+"Z");var g=d+u.textShiftX,y=f+e.ty0-e.by/2+C,v=e.textAlign||"auto";"auto"!==v&&("left"===v&&"start"!==s?(i.attr("text-anchor","start"),g=m?-e.bx/2-e.tx2width/2+C:-e.bx-C):"right"===v&&"end"!==s&&(i.attr("text-anchor","end"),g=m?e.bx/2-e.tx2width/2-C:e.bx+C)),i.call(c.positionText,a(g),o(y)),e.tx2width&&(n.select("text.name").call(c.positionText,a(u.text2ShiftX+u.alignShift*C+d),o(f+e.ty0-e.by/2+C)),n.select("rect").call(h.setRect,a(u.text2ShiftX+(u.alignShift-1)*e.tx2width/2+d),o(f-e.by/2-1),a(e.tx2width),o(e.by+2)))}))}function U(e,t){var n=e.index,a=e.trace||{},o=e.cd[0],s=e.cd[n]||{};function l(e){return e||r(e)&&0===e}var c=Array.isArray(n)?function(e,t){var r=i.castOption(o,n,e);return l(r)?r:i.extractOption({},a,"",t)}:function(e,t){return i.extractOption(s,a,e,t)};function u(t,r,n){var i=c(r,n);l(i)&&(e[t]=i)}if(u("hoverinfo","hi","hoverinfo"),u("bgcolor","hbg","hoverlabel.bgcolor"),u("borderColor","hbc","hoverlabel.bordercolor"),u("fontFamily","htf","hoverlabel.font.family"),u("fontSize","hts","hoverlabel.font.size"),u("fontColor","htc","hoverlabel.font.color"),u("fontWeight","htw","hoverlabel.font.weight"),u("fontStyle","hty","hoverlabel.font.style"),u("fontVariant","htv","hoverlabel.font.variant"),u("nameLength","hnl","hoverlabel.namelength"),u("textAlign","hta","hoverlabel.align"),e.posref="y"===t||"closest"===t&&"h"===a.orientation?e.xa._offset+(e.x0+e.x1)/2:e.ya._offset+(e.y0+e.y1)/2,e.x0=i.constrain(e.x0,0,e.xa._length),e.x1=i.constrain(e.x1,0,e.xa._length),e.y0=i.constrain(e.y0,0,e.ya._length),e.y1=i.constrain(e.y1,0,e.ya._length),void 0!==e.xLabelVal&&(e.xLabel="xLabel"in e?e.xLabel:f.hoverLabelText(e.xa,e.xLabelVal,a.xhoverformat),e.xVal=e.xa.c2d(e.xLabelVal)),void 0!==e.yLabelVal&&(e.yLabel="yLabel"in e?e.yLabel:f.hoverLabelText(e.ya,e.yLabelVal,a.yhoverformat),e.yVal=e.ya.c2d(e.yLabelVal)),void 0!==e.zLabelVal&&void 0===e.zLabel&&(e.zLabel=String(e.zLabelVal)),!isNaN(e.xerr)&&!("log"===e.xa.type&&e.xerr<=0)){var h=f.tickText(e.xa,e.xa.c2l(e.xerr),"hover").text;void 0!==e.xerrneg?e.xLabel+=" +"+h+" / -"+f.tickText(e.xa,e.xa.c2l(e.xerrneg),"hover").text:e.xLabel+=" \xb1 "+h,"x"===t&&(e.distance+=1)}if(!isNaN(e.yerr)&&!("log"===e.ya.type&&e.yerr<=0)){var p=f.tickText(e.ya,e.ya.c2l(e.yerr),"hover").text;void 0!==e.yerrneg?e.yLabel+=" +"+p+" / -"+f.tickText(e.ya,e.ya.c2l(e.yerrneg),"hover").text:e.yLabel+=" \xb1 "+p,"y"===t&&(e.distance+=1)}var d=e.hoverinfo||e.trace.hoverinfo;return d&&"all"!==d&&(-1===(d=Array.isArray(d)?d:d.split("+")).indexOf("x")&&(e.xLabel=void 0),-1===d.indexOf("y")&&(e.yLabel=void 0),-1===d.indexOf("z")&&(e.zLabel=void 0),-1===d.indexOf("text")&&(e.text=void 0),-1===d.indexOf("name")&&(e.name=void 0)),e}function V(e,t,r){var i,a,o=r.container,s=r.fullLayout,l=s._size,c=r.event,u=!!t.hLinePoint,d=!!t.vLinePoint;if(o.selectAll(".spikeline").remove(),d||u){var m=p.combine(s.plot_bgcolor,s.paper_bgcolor);if(u){var g,y,v=t.hLinePoint;i=v&&v.xa,"cursor"===(a=v&&v.ya).spikesnap?(g=c.pointerX,y=c.pointerY):(g=i._offset+v.x,y=a._offset+v.y);var x,b,_=n.readability(v.color,m)<1.5?p.contrast(m):v.color,w=a.spikemode,k=a.spikethickness,T=a.spikecolor||_,S=f.getPxPosition(e,a);if(-1!==w.indexOf("toaxis")||-1!==w.indexOf("across")){if(-1!==w.indexOf("toaxis")&&(x=S,b=g),-1!==w.indexOf("across")){var A=a._counterDomainMin,M=a._counterDomainMax;"free"===a.anchor&&(A=Math.min(A,a.position),M=Math.max(M,a.position)),x=l.l+A*l.w,b=l.l+M*l.w}o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k,stroke:T,"stroke-dasharray":h.dashStyle(a.spikedash,k)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:x,x2:b,y1:y,y2:y,"stroke-width":k+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==w.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:S+("right"!==a.side?k:-k),cy:y,r:k,fill:T}).classed("spikeline",!0)}if(d){var E,C,P=t.vLinePoint;i=P&&P.xa,a=P&&P.ya,"cursor"===i.spikesnap?(E=c.pointerX,C=c.pointerY):(E=i._offset+P.x,C=a._offset+P.y);var L,I,z=n.readability(P.color,m)<1.5?p.contrast(m):P.color,O=i.spikemode,R=i.spikethickness,D=i.spikecolor||z,j=f.getPxPosition(e,i);if(-1!==O.indexOf("toaxis")||-1!==O.indexOf("across")){if(-1!==O.indexOf("toaxis")&&(L=j,I=C),-1!==O.indexOf("across")){var F=i._counterDomainMin,B=i._counterDomainMax;"free"===i.anchor&&(F=Math.min(F,i.position),B=Math.max(B,i.position)),L=l.t+(1-B)*l.h,I=l.t+(1-F)*l.h}o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:I,"stroke-width":R,stroke:D,"stroke-dasharray":h.dashStyle(i.spikedash,R)}).classed("spikeline",!0).classed("crisp",!0),o.insert("line",":first-child").attr({x1:E,x2:E,y1:L,y2:I,"stroke-width":R+2,stroke:m}).classed("spikeline",!0).classed("crisp",!0)}-1!==O.indexOf("marker")&&o.insert("circle",":first-child").attr({cx:E,cy:j-("top"!==i.side?R:-R),r:R,fill:D}).classed("spikeline",!0)}}}function H(e,t){return!t||t.vLinePoint!==e._spikepoints.vLinePoint||t.hLinePoint!==e._spikepoints.hLinePoint}function G(e,t){return c.plainText(e||"",{len:t,allowedTags:["br","sub","sup","b","i","em","s","u"]})}function W(e,t,r){var n=t[e+"a"],i=t[e+"Val"],a=t.cd[0];if("category"===n.type||"multicategory"===n.type)i=n._categoriesMap[i];else if("date"===n.type){var o=t.trace[e+"periodalignment"];if(o){var s=t.cd[t.index],l=s[e+"Start"];void 0===l&&(l=s[e]);var c=s[e+"End"];void 0===c&&(c=s[e]);var u=c-l;"end"===o?i+=u:"middle"===o&&(i+=u/2)}i=n.d2c(i)}return a&&a.t&&a.t.posLetter===n._id&&("group"!==r.boxmode&&"group"!==r.violinmode||(i+=a.t.dPos)),i}function $(e){return e.offsetTop+e.clientTop}function Z(e){return e.offsetLeft+e.clientLeft}function X(e,t){var r=e._fullLayout,n=t.getBoundingClientRect(),a=n.left,o=n.top,s=a+n.width,l=o+n.height,c=i.apply3DTransform(r._invTransform)(a,o),u=i.apply3DTransform(r._invTransform)(s,l),h=c[0],p=c[1],d=u[0],f=u[1];return{x:h,y:p,width:d-h,height:f-p,top:Math.min(p,f),left:Math.min(h,d),right:Math.max(h,d),bottom:Math.max(p,f)}}}}),Ar=p({"src/components/fx/hoverlabel_defaults.js"(e,t){var r=st(),n=q(),i=Xt().isUnifiedHover;t.exports=function(e,t,a,o){o=o||{};var s=t.legend;function l(e){o.font[e]||(o.font[e]=s?t.legend.font[e]:t.font[e])}t&&i(t.hovermode)&&(o.font||(o.font={}),l("size"),l("family"),l("color"),l("weight"),l("style"),l("variant"),s?(o.bgcolor||(o.bgcolor=n.combine(t.legend.bgcolor,t.paper_bgcolor)),o.bordercolor||(o.bordercolor=t.legend.bordercolor)):o.bgcolor||(o.bgcolor=t.paper_bgcolor)),a("hoverlabel.bgcolor",o.bgcolor),a("hoverlabel.bordercolor",o.bordercolor),a("hoverlabel.namelength",o.namelength),r.coerceFont(a,"hoverlabel.font",o.font),a("hoverlabel.align",o.align)}}}),Mr=p({"src/components/fx/layout_global_defaults.js"(e,t){var r=st(),n=Ar(),i=F();t.exports=function(e,t){n(e,t,(function(n,a){return r.coerce(e,t,i,n,a)}))}}}),Er=p({"src/components/fx/defaults.js"(e,t){var r=st(),n=B(),i=Ar();t.exports=function(e,t,a,o){var s=r.extendFlat({},o.hoverlabel);t.hovertemplate&&(s.namelength=-1),i(e,t,(function(i,a){return r.coerce(e,t,n,i,a)}),s)}}}),Cr=p({"src/components/fx/hovermode_defaults.js"(e,t){var r=st(),n=F();t.exports=function(e,t){function i(i,a){return void 0!==t[i]?t[i]:r.coerce(e,t,n,i,a)}return i("clickmode"),i("hoversubplots"),i("hovermode")}}}),Pr=p({"src/components/fx/layout_defaults.js"(e,t){var r=st(),n=F(),i=Cr(),a=Ar();t.exports=function(e,t){function o(i,a){return r.coerce(e,t,n,i,a)}i(e,t)&&(o("hoverdistance"),o("spikedistance")),"select"===o("dragmode")&&o("selectdirection");var s=t._has("mapbox"),l=t._has("map"),c=t._has("geo"),u=t._basePlotModules.length;"zoom"===t.dragmode&&((s||l||c)&&1===u||(s||l)&&c&&2===u)&&(t.dragmode="pan"),a(e,t,o),r.coerceFont(o,"hoverlabel.grouptitlefont",t.hoverlabel.font)}}}),Lr=p({"src/components/fx/calc.js"(e,t){var r=st(),n=Ve();function i(e,t,n,i){i=i||r.identity,Array.isArray(e)&&(t[0][n]=i(e))}t.exports=function(e){var t=e.calcdata,a=e._fullLayout;function o(e){return function(t){return r.coerceHoverinfo({hoverinfo:t},{_module:e._module},a)}}for(var s=0;s<t.length;s++){var l=t[s],c=l[0].trace;if(!n.traceIs(c,"pie-like")){var u=n.traceIs(c,"2dMap")?i:r.fillArray;u(c.hoverinfo,l,"hi",o(c)),c.hovertemplate&&u(c.hovertemplate,l,"ht"),c.hoverlabel&&(u(c.hoverlabel.bgcolor,l,"hbg"),u(c.hoverlabel.bordercolor,l,"hbc"),u(c.hoverlabel.font.size,l,"hts"),u(c.hoverlabel.font.color,l,"htc"),u(c.hoverlabel.font.family,l,"htf"),u(c.hoverlabel.font.weight,l,"htw"),u(c.hoverlabel.font.style,l,"hty"),u(c.hoverlabel.font.variant,l,"htv"),u(c.hoverlabel.namelength,l,"hnl"),u(c.hoverlabel.align,l,"hta"))}}}}}),Ir=p({"src/components/fx/click.js"(e,t){var r=Ve(),n=Sr().hover;t.exports=function(e,t,i){var a=r.getComponentMethod("annotations","onClick")(e,e._hoverdata);function o(){e.emit("plotly_click",{points:e._hoverdata,event:t})}void 0!==i&&n(e,t,i,!0),e._hoverdata&&t&&t.target&&(a&&a.then?a.then(o):o(),t.stopImmediatePropagation&&t.stopImmediatePropagation())}}}),zr=p({"src/components/fx/index.js"(e,t){var r=v(),n=st(),i=hr(),a=Xt(),o=F(),s=Sr();t.exports={moduleType:"component",name:"fx",constants:j(),schema:{layout:o},attributes:B(),layoutAttributes:o,supplyLayoutGlobalDefaults:Mr(),supplyDefaults:Er(),supplyLayoutDefaults:Pr(),calc:Lr(),getDistanceFunction:a.getDistanceFunction,getClosest:a.getClosest,inbox:a.inbox,quadrature:a.quadrature,appendArrayPointValue:a.appendArrayPointValue,castHoverOption:function(e,t,r){return n.castOption(e,t,"hoverlabel."+r)},castHoverinfo:function(e,t,r){return n.castOption(e,r,"hoverinfo",(function(r){return n.coerceHoverinfo({hoverinfo:r},{_module:e._module},t)}))},hover:s.hover,unhover:i.unhover,loneHover:s.loneHover,loneUnhover:function(e){var t=n.isD3Selection(e)?e:r.select(e);t.selectAll("g.hovertext").remove(),t.selectAll(".spikeline").remove()},click:Ir()}}}),Or=p({"src/components/dragelement/helpers.js"(e){e.selectMode=function(e){return"lasso"===e||"select"===e},e.drawMode=function(e){return"drawclosedpath"===e||"drawopenpath"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},e.openMode=function(e){return"drawline"===e||"drawopenpath"===e},e.rectMode=function(e){return"select"===e||"drawline"===e||"drawrect"===e||"drawcircle"===e},e.freeMode=function(e){return"lasso"===e||"drawclosedpath"===e||"drawopenpath"===e},e.selectingOrDrawing=function(t){return e.freeMode(t)||e.rectMode(t)}}}),Rr=p({"src/lib/clear_gl_canvases.js"(e,t){t.exports=function(e){var t=e._fullLayout;t._glcanvas&&t._glcanvas.size()&&t._glcanvas.each((function(e){e.regl&&e.regl.clear({color:!0,depth:!0})}))}}}),Dr=p({"src/fonts/ploticon.js"(e,t){t.exports={undo:{width:857.1,height:1e3,path:"m857 350q0-87-34-166t-91-137-137-92-166-34q-96 0-183 41t-147 114q-4 6-4 13t5 11l76 77q6 5 14 5 9-1 13-7 41-53 100-82t126-29q58 0 110 23t92 61 61 91 22 111-22 111-61 91-92 61-110 23q-55 0-105-20t-90-57l77-77q17-16 8-38-10-23-33-23h-250q-15 0-25 11t-11 25v250q0 24 22 33 22 10 39-8l72-72q60 57 137 88t159 31q87 0 166-34t137-92 91-137 34-166z",transform:"matrix(1 0 0 -1 0 850)"},home:{width:928.6,height:1e3,path:"m786 296v-267q0-15-11-26t-25-10h-214v214h-143v-214h-214q-15 0-25 10t-11 26v267q0 1 0 2t0 2l321 264 321-264q1-1 1-4z m124 39l-34-41q-5-5-12-6h-2q-7 0-12 3l-386 322-386-322q-7-4-13-4-7 2-12 7l-35 41q-4 5-3 13t6 12l401 334q18 15 42 15t43-15l136-114v109q0 8 5 13t13 5h107q8 0 13-5t5-13v-227l122-102q5-5 6-12t-4-13z",transform:"matrix(1 0 0 -1 0 850)"},"camera-retro":{width:1e3,height:1e3,path:"m518 386q0 8-5 13t-13 5q-37 0-63-27t-26-63q0-8 5-13t13-5 12 5 5 13q0 23 16 38t38 16q8 0 13 5t5 13z m125-73q0-59-42-101t-101-42-101 42-42 101 42 101 101 42 101-42 42-101z m-572-320h858v71h-858v-71z m643 320q0 89-62 152t-152 62-151-62-63-152 63-151 151-63 152 63 62 151z m-571 358h214v72h-214v-72z m-72-107h858v143h-462l-36-71h-360v-72z m929 143v-714q0-30-21-51t-50-21h-858q-29 0-50 21t-21 51v714q0 30 21 51t50 21h858q29 0 50-21t21-51z",transform:"matrix(1 0 0 -1 0 850)"},zoombox:{width:1e3,height:1e3,path:"m1000-25l-250 251c40 63 63 138 63 218 0 224-182 406-407 406-224 0-406-182-406-406s183-406 407-406c80 0 155 22 218 62l250-250 125 125z m-812 250l0 438 437 0 0-438-437 0z m62 375l313 0 0-312-313 0 0 312z",transform:"matrix(1 0 0 -1 0 850)"},pan:{width:1e3,height:1e3,path:"m1000 350l-187 188 0-125-250 0 0 250 125 0-188 187-187-187 125 0 0-250-250 0 0 125-188-188 186-187 0 125 252 0 0-250-125 0 187-188 188 188-125 0 0 250 250 0 0-126 187 188z",transform:"matrix(1 0 0 -1 0 850)"},zoom_plus:{width:875,height:1e3,path:"m1 787l0-875 875 0 0 875-875 0z m687-500l-187 0 0-187-125 0 0 187-188 0 0 125 188 0 0 187 125 0 0-187 187 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},zoom_minus:{width:875,height:1e3,path:"m0 788l0-876 875 0 0 876-875 0z m688-500l-500 0 0 125 500 0 0-125z",transform:"matrix(1 0 0 -1 0 850)"},autoscale:{width:1e3,height:1e3,path:"m250 850l-187 0-63 0 0-62 0-188 63 0 0 188 187 0 0 62z m688 0l-188 0 0-62 188 0 0-188 62 0 0 188 0 62-62 0z m-875-938l0 188-63 0 0-188 0-62 63 0 187 0 0 62-187 0z m875 188l0-188-188 0 0-62 188 0 62 0 0 62 0 188-62 0z m-125 188l-1 0-93-94-156 156 156 156 92-93 2 0 0 250-250 0 0-2 93-92-156-156-156 156 94 92 0 2-250 0 0-250 0 0 93 93 157-156-157-156-93 94 0 0 0-250 250 0 0 0-94 93 156 157 156-157-93-93 0 0 250 0 0 250z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_basic:{width:1500,height:1e3,path:"m375 725l0 0-375-375 375-374 0-1 1125 0 0 750-1125 0z",transform:"matrix(1 0 0 -1 0 850)"},tooltip_compare:{width:1125,height:1e3,path:"m187 786l0 2-187-188 188-187 0 0 937 0 0 373-938 0z m0-499l0 1-187-188 188-188 0 0 937 0 0 376-938-1z",transform:"matrix(1 0 0 -1 0 850)"},plotlylogo:{width:1542,height:1e3,path:"m0-10h182v-140h-182v140z m228 146h183v-286h-183v286z m225 714h182v-1000h-182v1000z m225-285h182v-715h-182v715z m225 142h183v-857h-183v857z m231-428h182v-429h-182v429z m225-291h183v-138h-183v138z",transform:"matrix(1 0 0 -1 0 850)"},"z-axis":{width:1e3,height:1e3,path:"m833 5l-17 108v41l-130-65 130-66c0 0 0 38 0 39 0-1 36-14 39-25 4-15-6-22-16-30-15-12-39-16-56-20-90-22-187-23-279-23-261 0-341 34-353 59 3 60 228 110 228 110-140-8-351-35-351-116 0-120 293-142 474-142 155 0 477 22 477 142 0 50-74 79-163 96z m-374 94c-58-5-99-21-99-40 0-24 65-43 144-43 79 0 143 19 143 43 0 19-42 34-98 40v216h87l-132 135-133-135h88v-216z m167 515h-136v1c16 16 31 34 46 52l84 109v54h-230v-71h124v-1c-16-17-28-32-44-51l-89-114v-51h245v72z",transform:"matrix(1 0 0 -1 0 850)"},"3d_rotate":{width:1e3,height:1e3,path:"m922 660c-5 4-9 7-14 11-359 263-580-31-580-31l-102 28 58-400c0 1 1 1 2 2 118 108 351 249 351 249s-62 27-100 42c88 83 222 183 347 122 16-8 30-17 44-27-2 1-4 2-6 4z m36-329c0 0 64 229-88 296-62 27-124 14-175-11 157-78 225-208 249-266 8-19 11-31 11-31 2 5 6 15 11 32-5-13-8-20-8-20z m-775-239c70-31 117-50 198-32-121 80-199 346-199 346l-96-15-58-12c0 0 55-226 155-287z m603 133l-317-139c0 0 4-4 19-14 7-5 24-15 24-15s-177-147-389 4c235-287 536-112 536-112l31-22 100 299-4-1z m-298-153c6-4 14-9 24-15 0 0-17 10-24 15z",transform:"matrix(1 0 0 -1 0 850)"},camera:{width:1e3,height:1e3,path:"m500 450c-83 0-150-67-150-150 0-83 67-150 150-150 83 0 150 67 150 150 0 83-67 150-150 150z m400 150h-120c-16 0-34 13-39 29l-31 93c-6 15-23 28-40 28h-340c-16 0-34-13-39-28l-31-94c-6-15-23-28-40-28h-120c-55 0-100-45-100-100v-450c0-55 45-100 100-100h800c55 0 100 45 100 100v450c0 55-45 100-100 100z m-400-550c-138 0-250 112-250 250 0 138 112 250 250 250 138 0 250-112 250-250 0-138-112-250-250-250z m365 380c-19 0-35 16-35 35 0 19 16 35 35 35 19 0 35-16 35-35 0-19-16-35-35-35z",transform:"matrix(1 0 0 -1 0 850)"},movie:{width:1e3,height:1e3,path:"m938 413l-188-125c0 37-17 71-44 94 64 38 107 107 107 187 0 121-98 219-219 219-121 0-219-98-219-219 0-61 25-117 66-156h-115c30 33 49 76 49 125 0 103-84 187-187 187s-188-84-188-187c0-57 26-107 65-141-38-22-65-62-65-109v-250c0-70 56-126 125-126h500c69 0 125 56 125 126l188-126c34 0 62 28 62 63v375c0 35-28 63-62 63z m-750 0c-69 0-125 56-125 125s56 125 125 125 125-56 125-125-56-125-125-125z m406-1c-87 0-157 70-157 157 0 86 70 156 157 156s156-70 156-156-70-157-156-157z",transform:"matrix(1 0 0 -1 0 850)"},question:{width:857.1,height:1e3,path:"m500 82v107q0 8-5 13t-13 5h-107q-8 0-13-5t-5-13v-107q0-8 5-13t13-5h107q8 0 13 5t5 13z m143 375q0 49-31 91t-77 65-95 23q-136 0-207-119-9-14 4-24l74-55q4-4 10-4 9 0 14 7 30 38 48 51 19 14 48 14 27 0 48-15t21-33q0-21-11-34t-38-25q-35-16-65-48t-29-70v-20q0-8 5-13t13-5h107q8 0 13 5t5 13q0 10 12 27t30 28q18 10 28 16t25 19 25 27 16 34 7 45z m214-107q0-117-57-215t-156-156-215-58-216 58-155 156-58 215 58 215 155 156 216 58 215-58 156-156 57-215z",transform:"matrix(1 0 0 -1 0 850)"},disk:{width:857.1,height:1e3,path:"m214-7h429v214h-429v-214z m500 0h72v500q0 8-6 21t-11 20l-157 156q-5 6-19 12t-22 5v-232q0-22-15-38t-38-16h-322q-22 0-37 16t-16 38v232h-72v-714h72v232q0 22 16 38t37 16h465q22 0 38-16t15-38v-232z m-214 518v178q0 8-5 13t-13 5h-107q-7 0-13-5t-5-13v-178q0-8 5-13t13-5h107q7 0 13 5t5 13z m357-18v-518q0-22-15-38t-38-16h-750q-23 0-38 16t-16 38v750q0 22 16 38t38 16h517q23 0 50-12t42-26l156-157q16-15 27-42t11-49z",transform:"matrix(1 0 0 -1 0 850)"},drawopenpath:{width:70,height:70,path:"M33.21,85.65a7.31,7.31,0,0,1-2.59-.48c-8.16-3.11-9.27-19.8-9.88-41.3-.1-3.58-.19-6.68-.35-9-.15-2.1-.67-3.48-1.43-3.79-2.13-.88-7.91,2.32-12,5.86L3,32.38c1.87-1.64,11.55-9.66,18.27-6.9,2.13.87,4.75,3.14,5.17,9,.17,2.43.26,5.59.36,9.25a224.17,224.17,0,0,0,1.5,23.4c1.54,10.76,4,12.22,4.48,12.4.84.32,2.79-.46,5.76-3.59L43,80.07C41.53,81.57,37.68,85.64,33.21,85.65ZM74.81,69a11.34,11.34,0,0,0,6.09-6.72L87.26,44.5,74.72,32,56.9,38.35c-2.37.86-5.57,3.42-6.61,6L38.65,72.14l8.42,8.43ZM55,46.27a7.91,7.91,0,0,1,3.64-3.17l14.8-5.3,8,8L76.11,60.6l-.06.19a6.37,6.37,0,0,1-3,3.43L48.25,74.59,44.62,71Zm16.57,7.82A6.9,6.9,0,1,0,64.64,61,6.91,6.91,0,0,0,71.54,54.09Zm-4.05,0a2.85,2.85,0,1,1-2.85-2.85A2.86,2.86,0,0,1,67.49,54.09Zm-4.13,5.22L60.5,56.45,44.26,72.7l2.86,2.86ZM97.83,35.67,84.14,22l-8.57,8.57L89.26,44.24Zm-13.69-8,8,8-2.85,2.85-8-8Z",transform:"matrix(1 0 0 1 -15 -15)"},drawclosedpath:{width:90,height:90,path:"M88.41,21.12a26.56,26.56,0,0,0-36.18,0l-2.07,2-2.07-2a26.57,26.57,0,0,0-36.18,0,23.74,23.74,0,0,0,0,34.8L48,90.12a3.22,3.22,0,0,0,4.42,0l36-34.21a23.73,23.73,0,0,0,0-34.79ZM84,51.24,50.16,83.35,16.35,51.25a17.28,17.28,0,0,1,0-25.47,20,20,0,0,1,27.3,0l4.29,4.07a3.23,3.23,0,0,0,4.44,0l4.29-4.07a20,20,0,0,1,27.3,0,17.27,17.27,0,0,1,0,25.46ZM66.76,47.68h-33v6.91h33ZM53.35,35H46.44V68h6.91Z",transform:"matrix(1 0 0 1 -5 -5)"},lasso:{width:1031,height:1e3,path:"m1018 538c-36 207-290 336-568 286-277-48-473-256-436-463 10-57 36-108 76-151-13-66 11-137 68-183 34-28 75-41 114-42l-55-70 0 0c-2-1-3-2-4-3-10-14-8-34 5-45 14-11 34-8 45 4 1 1 2 3 2 5l0 0 113 140c16 11 31 24 45 40 4 3 6 7 8 11 48-3 100 0 151 9 278 48 473 255 436 462z m-624-379c-80 14-149 48-197 96 42 42 109 47 156 9 33-26 47-66 41-105z m-187-74c-19 16-33 37-39 60 50-32 109-55 174-68-42-25-95-24-135 8z m360 75c-34-7-69-9-102-8 8 62-16 128-68 170-73 59-175 54-244-5-9 20-16 40-20 61-28 159 121 317 333 354s407-60 434-217c28-159-121-318-333-355z",transform:"matrix(1 0 0 -1 0 850)"},selectbox:{width:1e3,height:1e3,path:"m0 850l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-285l0-143 143 0 0 143-143 0z m857 0l0-143 143 0 0 143-143 0z m-857-286l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z m285 0l0-143 143 0 0 143-143 0z m286 0l0-143 143 0 0 143-143 0z",transform:"matrix(1 0 0 -1 0 850)"},drawline:{width:70,height:70,path:"M60.64,62.3a11.29,11.29,0,0,0,6.09-6.72l6.35-17.72L60.54,25.31l-17.82,6.4c-2.36.86-5.57,3.41-6.6,6L24.48,65.5l8.42,8.42ZM40.79,39.63a7.89,7.89,0,0,1,3.65-3.17l14.79-5.31,8,8L61.94,54l-.06.19a6.44,6.44,0,0,1-3,3.43L34.07,68l-3.62-3.63Zm16.57,7.81a6.9,6.9,0,1,0-6.89,6.9A6.9,6.9,0,0,0,57.36,47.44Zm-4,0a2.86,2.86,0,1,1-2.85-2.85A2.86,2.86,0,0,1,53.32,47.44Zm-4.13,5.22L46.33,49.8,30.08,66.05l2.86,2.86ZM83.65,29,70,15.34,61.4,23.9,75.09,37.59ZM70,21.06l8,8-2.84,2.85-8-8ZM87,80.49H10.67V87H87Z",transform:"matrix(1 0 0 1 -15 -15)"},drawrect:{width:80,height:80,path:"M78,22V79H21V22H78m9-9H12V88H87V13ZM68,46.22H31V54H68ZM53,32H45.22V69H53Z",transform:"matrix(1 0 0 1 -10 -10)"},drawcircle:{width:80,height:80,path:"M50,84.72C26.84,84.72,8,69.28,8,50.3S26.84,15.87,50,15.87,92,31.31,92,50.3,73.16,84.72,50,84.72Zm0-60.59c-18.6,0-33.74,11.74-33.74,26.17S31.4,76.46,50,76.46,83.74,64.72,83.74,50.3,68.6,24.13,50,24.13Zm17.15,22h-34v7.11h34Zm-13.8-13H46.24v34h7.11Z",transform:"matrix(1 0 0 1 -10 -10)"},eraseshape:{width:80,height:80,path:"M82.77,78H31.85L6,49.57,31.85,21.14H82.77a8.72,8.72,0,0,1,8.65,8.77V69.24A8.72,8.72,0,0,1,82.77,78ZM35.46,69.84H82.77a.57.57,0,0,0,.49-.6V29.91a.57.57,0,0,0-.49-.61H35.46L17,49.57Zm32.68-34.7-24,24,5,5,24-24Zm-19,.53-5,5,24,24,5-5Z",transform:"matrix(1 0 0 1 -10 -10)"},spikeline:{width:1e3,height:1e3,path:"M512 409c0-57-46-104-103-104-57 0-104 47-104 104 0 57 47 103 104 103 57 0 103-46 103-103z m-327-39l92 0 0 92-92 0z m-185 0l92 0 0 92-92 0z m370-186l92 0 0 93-92 0z m0-184l92 0 0 92-92 0z",transform:"matrix(1.5 0 0 -1.5 0 850)"},pencil:{width:1792,height:1792,path:"M491 1536l91-91-235-235-91 91v107h128v128h107zm523-928q0-22-22-22-10 0-17 7l-542 542q-7 7-7 17 0 22 22 22 10 0 17-7l542-542q7-7 7-17zm-54-192l416 416-832 832h-416v-416zm683 96q0 53-37 90l-166 166-416-416 166-165q36-38 90-38 53 0 91 38l235 234q37 39 37 91z",transform:"matrix(1 0 0 1 0 1)"},newplotlylogo:{name:"newplotlylogo",svg:["<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 132 132'>"," <title>plotly-logomark</title>"," <g id='symbol'>"," <rect fill='#000' x='0' y='0' width='132' height='132' rx='18' ry='18'/>"," <circle fill='#9EF' cx='102' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='30' r='6'/>"," <circle fill='#BAC' cx='78' cy='54' r='6'/>"," <circle fill='#D69' cx='54' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='30' r='6'/>"," <circle fill='#F26' cx='30' cy='54' r='6'/>"," <path fill='#FFF' d='M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z'/>"," <path fill='#FFF' d='M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z'/>"," <path fill='#FFF' d='M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z'/>"," <path fill='#FFF' d='M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z'/>"," </g>","</svg>"].join("")}}}}),jr=p({"src/components/shapes/draw_newshape/constants.js"(e,t){t.exports={CIRCLE_SIDES:32,i000:0,i090:8,i180:16,i270:24,cos45:Math.cos(Math.PI/4),sin45:Math.sin(Math.PI/4),SQRT2:Math.sqrt(2)}}}),Fr=p({"src/components/selections/helpers.js"(e,t){var r=st().strTranslate;function n(e,t){switch(e.type){case"log":return e.p2d(t);case"date":return e.p2r(t,0,e.calendar);default:return e.p2r(t)}}t.exports={p2r:n,r2p:function(e,t){switch(e.type){case"log":return e.d2p(t);case"date":return e.r2p(t,0,e.calendar);default:return e.r2p(t)}},axValue:function(e){var t="y"===e._id.charAt(0)?1:0;return function(r){return n(e,r[t])}},getTransform:function(e){return r(e.xaxis._offset,e.yaxis._offset)}}}}),Br=p({"src/components/shapes/draw_newshape/helpers.js"(e){var t=Yt(),r=jr(),n=r.CIRCLE_SIDES,i=r.SQRT2,a=Fr(),o=a.p2r,s=a.r2p,l=[0,3,4,5,6,1,2],c=[0,3,4,1,2];function u(e,t){return Math.abs(e-t)<=1e-6}function h(e,t){var r=t[1]-e[1],n=t[2]-e[2];return Math.sqrt(r*r+n*n)}e.writePaths=function(e){var t=e.length;if(!t)return"M0,0Z";for(var r="",n=0;n<t;n++)for(var i=e[n].length,a=0;a<i;a++){var o=e[n][a][0];if("Z"===o)r+="Z";else for(var s=e[n][a].length,u=0;u<s;u++){var h=u;"Q"===o||"S"===o?h=c[u]:"C"===o&&(h=l[u]),r+=e[n][a][h],u>0&&u<s-1&&(r+=",")}}return r},e.readPaths=function(e,r,i,a){var l,c,u,h=t(e),p=[],d=-1,f=0,m=0,g=function(){c=f,u=m};g();for(var y=0;y<h.length;y++){var v,x,b,_,w=[],k=h[y][0],T=k;switch(k){case"M":d++,p[d]=[],f=+h[y][1],m=+h[y][2],w.push([T,f,m]),g();break;case"Q":case"S":v=+h[y][1],b=+h[y][2],f=+h[y][3],m=+h[y][4],w.push([T,f,m,v,b]);break;case"C":v=+h[y][1],b=+h[y][2],x=+h[y][3],_=+h[y][4],f=+h[y][5],m=+h[y][6],w.push([T,f,m,v,b,x,_]);break;case"T":case"L":f=+h[y][1],m=+h[y][2],w.push([T,f,m]);break;case"H":T="L",f=+h[y][1],w.push([T,f,m]);break;case"V":T="L",m=+h[y][1],w.push([T,f,m]);break;case"A":T="L";var S=+h[y][1],A=+h[y][2];+h[y][4]||(S=-S,A=-A);var M=f-S,E=m;for(l=1;l<=n/2;l++){var C=2*Math.PI*l/n;w.push([T,M+S*Math.cos(C),E+A*Math.sin(C)])}break;case"Z":f===c&&m===u||(f=c,m=u,w.push([T,f,m]))}for(var P=(i||{}).domain,L=r._fullLayout._size,I=i&&"pixel"===i.xsizemode,z=i&&"pixel"===i.ysizemode,O=!1===a,R=0;R<w.length;R++){for(l=0;l+2<7;l+=2){var D=w[R][l+1],j=w[R][l+2];void 0!==D&&void 0!==j&&(f=D,m=j,i&&(i.xaxis&&i.xaxis.p2r?(O&&(D-=i.xaxis._offset),D=I?s(i.xaxis,i.xanchor)+D:o(i.xaxis,D)):(O&&(D-=L.l),P?D=P.x[0]+D/L.w:D/=L.w),i.yaxis&&i.yaxis.p2r?(O&&(j-=i.yaxis._offset),j=z?s(i.yaxis,i.yanchor)-j:o(i.yaxis,j)):(O&&(j-=L.t),j=P?P.y[1]-j/L.h:1-j/L.h)),w[R][l+1]=D,w[R][l+2]=j)}p[d].push(w[R].slice())}}return p},e.pointsOnRectangle=function(e){if(5!==e.length)return!1;for(var t=1;t<3;t++){if(!u(e[0][t]-e[1][t],e[3][t]-e[2][t]))return!1;if(!u(e[0][t]-e[3][t],e[1][t]-e[2][t]))return!1}return!(!u(e[0][1],e[1][1])&&!u(e[0][1],e[3][1]))&&!!(h(e[0],e[1])*h(e[0],e[3]))},e.pointsOnEllipse=function(e){var t=e.length;if(t!==n+1)return!1;t=n;for(var r=0;r<t;r++){var i=(2*t-r)%t,a=(t/2+i)%t,o=(t/2+r)%t;if(!u(h(e[r],e[o]),h(e[i],e[a])))return!1}return!0},e.handleEllipse=function(t,r,a){if(!t)return[r,a];var o=e.ellipseOver({x0:r[0],y0:r[1],x1:a[0],y1:a[1]}),s=(o.x1+o.x0)/2,l=(o.y1+o.y0)/2,c=(o.x1-o.x0)/2,u=(o.y1-o.y0)/2;c||(c=u/=i),u||(u=c/=i);for(var h=[],p=0;p<n;p++){var d=2*p*Math.PI/n;h.push([s+c*Math.cos(d),l+u*Math.sin(d)])}return h},e.ellipseOver=function(e){var t=e.x0,r=e.y0,n=e.x1,a=e.y1,o=n-t,s=a-r,l=((t-=o)+n)/2,c=((r-=s)+a)/2;return{x0:l-(o*=i),y0:c-(s*=i),x1:l+o,y1:c+s}},e.fixDatesForPaths=function(e,t,r){var n="date"===t.type,i="date"===r.type;if(!n&&!i)return e;for(var a=0;a<e.length;a++)for(var o=0;o<e[a].length;o++)for(var s=0;s+2<e[a][o].length;s+=2)n&&(e[a][o][s+1]=e[a][o][s+1].replace(" ","_")),i&&(e[a][o][s+2]=e[a][o][s+2].replace(" ","_"));return e}}}),Nr=p({"src/components/shapes/draw_newshape/newshapes.js"(e,t){var r=Or(),n=r.drawMode,i=r.openMode,a=jr(),o=a.i000,s=a.i090,l=a.i180,c=a.i270,u=a.cos45,h=a.sin45,p=Fr(),d=p.p2r,f=p.r2p,m=xt().clearOutline,g=Br(),y=g.readPaths,v=g.writePaths,x=g.ellipseOver,b=g.fixDatesForPaths;function _(e,t,r){var n,a=e[0][0],p=t.gd,m=a.getAttribute("d"),g=p._fullLayout.newshape,_=t.plotinfo,w=t.isActiveShape,k=_.xaxis,T=_.yaxis,S=!!_.domain||!_.xaxis,A=!!_.domain||!_.yaxis,M=i(r),E=y(m,p,_,w),C={editable:!0,visible:g.visible,name:g.name,showlegend:g.showlegend,legend:g.legend,legendwidth:g.legendwidth,legendgroup:g.legendgroup,legendgrouptitle:{text:g.legendgrouptitle.text,font:g.legendgrouptitle.font},legendrank:g.legendrank,label:g.label,xref:S?"paper":k._id,yref:A?"paper":T._id,layer:g.layer,opacity:g.opacity,line:{color:g.line.color,width:g.line.width,dash:g.line.dash}};if(M||(C.fillcolor=g.fillcolor,C.fillrule=g.fillrule),1===E.length&&(n=E[0]),n&&5===n.length&&"drawrect"===r)C.type="rect",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[2][1],C.y1=n[2][2];else if(n&&"drawline"===r)C.type="line",C.x0=n[0][1],C.y0=n[0][2],C.x1=n[1][1],C.y1=n[1][2];else if(n&&"drawcircle"===r){C.type="circle";var P=n[o][1],L=n[s][1],I=n[l][1],z=n[c][1],O=n[o][2],R=n[s][2],D=n[l][2],j=n[c][2],F=_.xaxis&&("date"===_.xaxis.type||"log"===_.xaxis.type),B=_.yaxis&&("date"===_.yaxis.type||"log"===_.yaxis.type);F&&(P=f(_.xaxis,P),L=f(_.xaxis,L),I=f(_.xaxis,I),z=f(_.xaxis,z)),B&&(O=f(_.yaxis,O),R=f(_.yaxis,R),D=f(_.yaxis,D),j=f(_.yaxis,j));var N=(L+z)/2,U=(O+D)/2,V=x({x0:N,y0:U,x1:N+(z-L+I-P)/2*u,y1:U+(j-R+D-O)/2*h});F&&(V.x0=d(_.xaxis,V.x0),V.x1=d(_.xaxis,V.x1)),B&&(V.y0=d(_.yaxis,V.y0),V.y1=d(_.yaxis,V.y1)),C.x0=V.x0,C.y0=V.y0,C.x1=V.x1,C.y1=V.y1}else C.type="path",k&&T&&b(E,k,T),C.path=v(E),n=null;return C}t.exports={newShapes:function(e,t){if(e.length&&e[0][0]){var r=t.gd,i=t.isActiveShape,a=t.dragmode,o=(r.layout||{}).shapes||[];if(!n(a)&&void 0!==i){var s=r._fullLayout._activeShapeIndex;if(s<o.length)switch(r._fullLayout.shapes[s].type){case"rect":a="drawrect";break;case"circle":a="drawcircle";break;case"line":a="drawline";break;case"path":var l=o[s].path||"";a="Z"===l[l.length-1]?"drawclosedpath":"drawopenpath"}}var c=_(e,t,a);m(r);for(var u=t.editHelpers,h=(u||{}).modifyItem,p=[],d=0;d<o.length;d++){var f=r._fullLayout.shapes[d];if(p[d]=f._input,void 0!==i&&d===r._fullLayout._activeShapeIndex){var g=c;switch(f.type){case"line":case"rect":case"circle":h("x0",g.x0-(f.x0shift||0)),h("x1",g.x1-(f.x1shift||0)),h("y0",g.y0-(f.y0shift||0)),h("y1",g.y1-(f.y1shift||0));break;case"path":h("path",g.path)}}}return void 0===i?(p.push(c),p):u?u.getUpdateObj():{}}},createShapeObj:_}}}),Ur=p({"src/components/selections/draw_newselection/newselections.js"(e,t){var r=Or().selectMode,n=xt().clearOutline,i=Br(),a=i.readPaths,o=i.writePaths,s=i.fixDatesForPaths;t.exports=function(e,t){if(e.length){var i=e[0][0];if(i){var l=i.getAttribute("d"),c=t.gd,u=c._fullLayout.newselection,h=t.plotinfo,p=h.xaxis,d=h.yaxis,f=t.isActiveSelection,m=t.dragmode,g=(c.layout||{}).selections||[];if(!r(m)&&void 0!==f){var y=c._fullLayout._activeSelectionIndex;if(y<g.length)switch(c._fullLayout.selections[y].type){case"rect":m="select";break;case"path":m="lasso"}}var v,x=a(l,c,h,f),b={xref:p._id,yref:d._id,opacity:u.opacity,line:{color:u.line.color,width:u.line.width,dash:u.line.dash}};1===x.length&&(v=x[0]),v&&5===v.length&&"select"===m?(b.type="rect",b.x0=v[0][1],b.y0=v[0][2],b.x1=v[2][1],b.y1=v[2][2]):(b.type="path",p&&d&&s(x,p,d),b.path=o(x),v=null),n(c);for(var _=t.editHelpers,w=(_||{}).modifyItem,k=[],T=0;T<g.length;T++){var S=c._fullLayout.selections[T];if(S){if(k[T]=S._input,void 0!==f&&T===c._fullLayout._activeSelectionIndex){var A=b;switch(S.type){case"rect":w("x0",A.x0),w("x1",A.x1),w("y0",A.y0),w("y1",A.y1);break;case"path":w("path",A.path)}}}else k[T]=S}return void 0===f?(k.push(b),k):_?_.getUpdateObj():{}}}}}}),Vr=p({"src/components/shapes/constants.js"(e,t){t.exports={segmentRE:/[MLHVQCTSZ][^MLHVQCTSZ]*/g,paramRE:/[^\s,]+/g,paramIsX:{M:{0:!0,drawn:0},L:{0:!0,drawn:0},H:{0:!0,drawn:0},V:{},Q:{0:!0,2:!0,drawn:2},C:{0:!0,2:!0,4:!0,drawn:4},T:{0:!0,drawn:0},S:{0:!0,2:!0,drawn:2},Z:{}},paramIsY:{M:{1:!0,drawn:1},L:{1:!0,drawn:1},H:{},V:{0:!0,drawn:0},Q:{1:!0,3:!0,drawn:3},C:{1:!0,3:!0,5:!0,drawn:5},T:{1:!0,drawn:1},S:{1:!0,3:!0,drawn:5},Z:{}},numParams:{M:2,L:2,H:1,V:1,Q:4,C:6,T:2,S:4,Z:0}}}}),qr=p({"src/components/shapes/helpers.js"(e){var t=Vr(),r=st(),n=nr();function i(e,t){var r=0;return(t=t||0)&&e&&("category"===e.type||"multicategory"===e.type)&&(r=(e.r2p(1)-e.r2p(0))*t),r}e.rangeToShapePosition=function(e){return"log"===e.type?e.r2d:function(e){return e}},e.shapePositionToRange=function(e){return"log"===e.type?e.d2r:function(e){return e}},e.decodeDate=function(e){return function(t){return t.replace&&(t=t.replace("_"," ")),e(t)}},e.encodeDate=function(e){return function(t){return e(t).replace(" ","_")}},e.extractPathCoords=function(e,n,i){var a=[];return e.match(t.segmentRE).forEach((function(e){var o=n[e.charAt(0)].drawn;if(void 0!==o){var s=e.substr(1).match(t.paramRE);if(s&&!(s.length<o)){var l=s[o],c=i?l:r.cleanNumber(l);a.push(c)}}})),a},e.getDataToPixel=function(t,r,n,a,o){var s,l=t._fullLayout._size;if(r)if("domain"===o)s=function(e){return r._length*(a?1-e:e)+r._offset};else{var c=e.shapePositionToRange(r);s=function(e){var t=i(r,n);return r._offset+r.r2p(c(e,!0))+t},"date"===r.type&&(s=e.decodeDate(s))}else s=a?function(e){return l.t+l.h*(1-e)}:function(e){return l.l+l.w*e};return s},e.getPixelToData=function(t,r,n,i){var a,o=t._fullLayout._size;if(r)if("domain"===i)a=function(e){var t=(e-r._offset)/r._length;return n?1-t:t};else{var s=e.rangeToShapePosition(r);a=function(e){return s(r.p2r(e-r._offset))}}else a=n?function(e){return 1-(e-o.t)/o.h}:function(e){return(e-o.l)/o.w};return a},e.roundPositionForSharpStrokeRendering=function(e,t){var r=1===Math.round(t%2),n=Math.round(e);return r?n+.5:n},e.makeShapesOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.shapes[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&"paper"!==r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&"paper"!==r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),n.xsizemode=r.xsizemode,n.ysizemode=r.ysizemode,n.xanchor=r.xanchor,n.yanchor=r.yanchor,{options:r,plotinfo:n}},e.makeSelectionsOptionsAndPlotinfo=function(e,t){var r=e._fullLayout.selections[t]||{},n=e._fullLayout._plots[r.xref+r.yref];return n?n._hadPlotinfo=!0:(n={},r.xref&&(n.xaxis=e._fullLayout[r.xref+"axis"]),r.yref&&(n.yaxis=e._fullLayout[r.yref+"axis"])),{options:r,plotinfo:n}},e.getPathString=function(a,o){var s,l,c,u,h,p,d,f,m=o.type,g=n.getRefType(o.xref),y=n.getRefType(o.yref),v=n.getFromId(a,o.xref),x=n.getFromId(a,o.yref),b=a._fullLayout._size,_=i(v,o.x0shift),w=i(v,o.x1shift),k=i(x,o.y0shift),T=i(x,o.y1shift);if(v?"domain"===g?l=function(e){return v._offset+v._length*e}:(s=e.shapePositionToRange(v),l=function(e){return v._offset+v.r2p(s(e,!0))}):l=function(e){return b.l+b.w*e},x?"domain"===y?u=function(e){return x._offset+x._length*(1-e)}:(c=e.shapePositionToRange(x),u=function(e){return x._offset+x.r2p(c(e,!0))}):u=function(e){return b.t+b.h*(1-e)},"path"===m)return v&&"date"===v.type&&(l=e.decodeDate(l)),x&&"date"===x.type&&(u=e.decodeDate(u)),function(e,n,i){var a=e.path,o=e.xsizemode,s=e.ysizemode,l=e.xanchor,c=e.yanchor;return a.replace(t.segmentRE,(function(e){var a=0,u=e.charAt(0),h=t.paramIsX[u],p=t.paramIsY[u],d=t.numParams[u],f=e.substr(1).replace(t.paramRE,(function(e){return h[a]?e="pixel"===o?n(l)+Number(e):n(e):p[a]&&(e="pixel"===s?i(c)-Number(e):i(e)),++a>d&&(e="X"),e}));return a>d&&(f=f.replace(/[\s,]*X.*/,""),r.log("Ignoring extra params in segment "+e)),u+f}))}(o,l,u);if("pixel"===o.xsizemode){var S=l(o.xanchor);h=S+o.x0+_,p=S+o.x1+w}else h=l(o.x0)+_,p=l(o.x1)+w;if("pixel"===o.ysizemode){var A=u(o.yanchor);d=A-o.y0+k,f=A-o.y1+T}else d=u(o.y0)+k,f=u(o.y1)+T;if("line"===m)return"M"+h+","+d+"L"+p+","+f;if("rect"===m)return"M"+h+","+d+"H"+p+"V"+f+"H"+h+"Z";var M=(h+p)/2,E=(d+f)/2,C=Math.abs(M-h),P=Math.abs(E-d),L="A"+C+","+P,I=M+C+","+E;return"M"+I+L+" 0 1,1 "+M+","+(E-P)+L+" 0 0,1 "+I+"Z"}}}),Hr=p({"src/components/shapes/display_labels.js"(e,t){var r=st(),n=nr(),i=At(),a=Jt(),o=Br().readPaths,s=qr(),l=s.getPathString,c=Re(),u=St().FROM_TL;t.exports=function(e,t,h,p){if(p.selectAll(".shape-label").remove(),h.label.text||h.label.texttemplate){var d;if(h.label.texttemplate){var f={};if("path"!==h.type){var m=n.getFromId(e,h.xref),g=n.getFromId(e,h.yref);for(var y in c){var v=c[y](h,m,g);void 0!==v&&(f[y]=v)}}d=r.texttemplateStringForShapes(h.label.texttemplate,{},e._fullLayout._d3locale,f)}else d=h.label.text;var x,b,_,w,k={"data-index":t},T=h.label.font,S=p.append("g").attr(k).classed("shape-label",!0).append("text").attr({"data-notex":1}).classed("shape-label-text",!0).text(d);if(h.path){var A=l(e,h),M=o(A,e);x=1/0,_=1/0,b=-1/0,w=-1/0;for(var E=0;E<M.length;E++)for(var C=0;C<M[E].length;C++)for(var P=M[E][C],L=1;L<P.length;L+=2){var I=P[L],z=P[L+1];x=Math.min(x,I),b=Math.max(b,I),_=Math.min(_,z),w=Math.max(w,z)}}else{var O=n.getFromId(e,h.xref),R=h.x0shift,D=h.x1shift,j=n.getRefType(h.xref),F=n.getFromId(e,h.yref),B=h.y0shift,N=h.y1shift,U=n.getRefType(h.yref),V=function(t,r){return s.getDataToPixel(e,O,r,!1,j)(t)},q=function(t,r){return s.getDataToPixel(e,F,r,!0,U)(t)};x=V(h.x0,R),b=V(h.x1,D),_=q(h.y0,B),w=q(h.y1,N)}var H=h.label.textangle;"auto"===H&&(H="line"===h.type?function(e,t,r,n){var i,a;return a=Math.abs(r-e),i=r>=e?t-n:n-t,-180/Math.PI*Math.atan2(i,a)}(x,_,b,w):0),S.call((function(t){return t.call(a.font,T).attr({}),i.convertToTspans(t,e),t}));var G=function(e,t,r,n,i,a,o){var s,l,c,h,p=i.label.textposition,d=i.label.textangle,f=i.label.padding,m=i.type,g=Math.PI/180*a,y=Math.sin(g),v=Math.cos(g),x=i.label.xanchor,b=i.label.yanchor;if("line"===m){"start"===p?(s=e,l=t):"end"===p?(s=r,l=n):(s=(e+r)/2,l=(t+n)/2),"auto"===x&&(x="start"===p?"auto"===d?r>e?"left":r<e?"right":"center":r>e?"right":r<e?"left":"center":"end"===p?"auto"===d?r>e?"right":r<e?"left":"center":r>e?"left":r<e?"right":"center":"center");var _={left:1,center:0,right:-1},w={bottom:-1,middle:0,top:1};if("auto"===d){var k=w[b];c=-f*y*k,h=f*v*k}else c=f*_[x],h=f*w[b];s+=c,l+=h}else c=f+3,-1!==p.indexOf("right")?(s=Math.max(e,r)-c,"auto"===x&&(x="right")):-1!==p.indexOf("left")?(s=Math.min(e,r)+c,"auto"===x&&(x="left")):(s=(e+r)/2,"auto"===x&&(x="center")),l=-1!==p.indexOf("top")?Math.min(t,n):-1!==p.indexOf("bottom")?Math.max(t,n):(t+n)/2,h=f,"bottom"===b?l-=h:"top"===b&&(l+=h);var T=u[b],S=i.label.font.size,A=o.height;return{textx:s+(A*T-S)*y,texty:l+-(A*T-S)*v,xanchor:x}}(x,_,b,w,h,H,a.bBox(S.node())),W=G.textx,$=G.texty,Z=G.xanchor;S.attr({"text-anchor":{left:"start",center:"middle",right:"end"}[Z],y:$,x:W,transform:"rotate("+H+","+W+","+$+")"}).call(i.positionText,W,$)}}}}),Gr=p({"src/components/shapes/display_outlines.js"(e,t){var r=st().strTranslate,n=hr(),i=Or(),a=i.drawMode,o=i.selectMode,s=Ve(),l=q(),c=jr(),u=c.i000,h=c.i090,p=c.i180,d=c.i270,f=xt().clearOutlineControllers,m=Br(),g=m.pointsOnRectangle,y=m.pointsOnEllipse,v=m.writePaths,x=Nr().newShapes,b=Nr().createShapeObj,_=Ur(),w=Hr();function k(e,t){var r,n,i,a=e[t][1],o=e[t][2],s=e.length;return n=e[r=(t+1)%s][1],i=e[r][2],n===a&&i===o&&(n=e[r=(t+2)%s][1],i=e[r][2]),[r,n,i]}t.exports=function e(t,i,c,m){m||(m=0);var T=c.gd;function S(){e(t,i,c,m++),(y(t[0])||c.hasText)&&A({redrawing:!0})}function A(e){var t={};void 0!==c.isActiveShape&&(c.isActiveShape=!1,t=x(i,c)),void 0!==c.isActiveSelection&&(c.isActiveSelection=!1,t=_(i,c),T._fullLayout._reselect=!0),Object.keys(t).length&&s.call((e||{}).redrawing?"relayout":"_guiRelayout",T,t)}var M,E,C,P,L,I=T._fullLayout._zoomlayer,z=c.dragmode,O=a(z),R=o(z);if((O||R)&&(T._fullLayout._outlining=!0),f(T),i.attr("d",v(t)),m||!c.isActiveShape&&!c.isActiveSelection||(L=function(e,t){for(var r=0;r<t.length;r++){var n=t[r];e[r]=[];for(var i=0;i<n.length;i++){e[r][i]=[];for(var a=0;a<n[i].length;a++)e[r][i][a]=n[i][a]}}return e}([],t),function(e){M=[];for(var i=0;i<t.length;i++){var a=t[i],o=g(a),s=!o&&y(a);M[i]=[];for(var f=a.length,m=0;m<f;m++)if("Z"!==a[m][0]&&(!s||m===u||m===h||m===p||m===d)){var v,x=o&&c.isActiveSelection;x&&(v=k(a,m));var b=a[m][1],_=a[m][2],w=e.append(x?"rect":"circle").attr("data-i",i).attr("data-j",m).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,"shape-rendering":"crispEdges"});if(x){var S=v[1]-b,A=v[2]-_,E=A?5:Math.max(Math.min(25,Math.abs(S)-5),5),C=S?5:Math.max(Math.min(25,Math.abs(A)-5),5);w.classed(A?"cursor-ew-resize":"cursor-ns-resize",!0).attr("width",E).attr("height",C).attr("x",b-E/2).attr("y",_-C/2).attr("transform",r(S/2,A/2))}else w.classed("cursor-grab",!0).attr("r",5).attr("cx",b).attr("cy",_);M[i][m]={element:w.node(),gd:T,prepFn:F,doneFn:N,clickFn:U},n.init(M[i][m])}}}(I.append("g").attr("class","outline-controllers")),function(){if(E=[],t.length){var e=0;E[e]={element:i[0][0],gd:T,prepFn:q,doneFn:H,clickFn:G},n.init(E[e])}}()),O&&c.hasText){var D=I.select(".label-temp"),j=b(i,c,c.dragmode);w(T,"label-temp",j,D)}function F(e){C=+e.srcElement.getAttribute("data-i"),P=+e.srcElement.getAttribute("data-j"),M[C][P].moveFn=B}function B(e,r){if(t.length){var n=L[C][P][1],i=L[C][P][2],a=t[C],o=a.length;if(g(a)){var s=e,l=r;c.isActiveSelection&&(k(a,P)[1]===a[P][1]?l=0:s=0);for(var u=0;u<o;u++)if(u!==P){var h=a[u];h[1]===a[P][1]&&(h[1]=n+s),h[2]===a[P][2]&&(h[2]=i+l)}if(a[P][1]=n+s,a[P][2]=i+l,!g(a))for(var p=0;p<o;p++)for(var d=0;d<a[p].length;d++)a[p][d]=L[C][p][d]}else a[P][1]=n+e,a[P][2]=i+r;S()}}function N(){A()}function U(e,r){if(2===e){C=+r.srcElement.getAttribute("data-i"),P=+r.srcElement.getAttribute("data-j");var n=t[C];g(n)||y(n)||function(){if(t.length&&t[C]&&t[C].length){for(var e=[],r=0;r<t[C].length;r++)r!==P&&e.push(t[C][r]);e.length>1&&(2!==e.length||"Z"!==e[1][0])&&(0===P&&(e[0][0]="M"),t[C]=e,S(),A())}}()}}function V(e,r){!function(e,r){if(t.length)for(var n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)for(var a=0;a+2<t[n][i].length;a+=2)t[n][i][a+1]=L[n][i][a+1]+e,t[n][i][a+2]=L[n][i][a+2]+r}(e,r),S()}function q(e){(C=+e.srcElement.getAttribute("data-i"))||(C=0),E[C].moveFn=V}function H(){A()}function G(e){2===e&&function(e){if(o(e._fullLayout.dragmode)){f(e);var t=e._fullLayout._activeSelectionIndex,r=(e.layout||{}).selections||[];if(t<r.length){for(var n=[],i=0;i<r.length;i++)i!==t&&n.push(r[i]);delete e._fullLayout._activeSelectionIndex;var a=e._fullLayout.selections[t];e._fullLayout._deselect={xref:a.xref,yref:a.yref},s.call("_guiRelayout",e,{selections:n})}}}(T)}}}}),Wr=p({"src/components/shapes/draw.js"(e,t){var r=v(),n=Ve(),i=st(),a=nr(),o=Br().readPaths,s=Gr(),l=Hr(),c=xt().clearOutlineControllers,u=q(),h=Jt(),p=gt().arrayEditor,d=hr(),f=pr(),m=Vr(),g=qr(),y=g.getPathString;function x(e){var t=e._fullLayout;for(var r in t._shapeUpperLayer.selectAll("path").remove(),t._shapeLowerLayer.selectAll("path").remove(),t._shapeUpperLayer.selectAll("text").remove(),t._shapeLowerLayer.selectAll("text").remove(),t._plots){var n=t._plots[r].shapelayer;n&&(n.selectAll("path").remove(),n.selectAll("text").remove())}for(var i=0;i<t.shapes.length;i++)!0===t.shapes[i].visible&&w(e,i)}function b(e){return!!e._fullLayout._outlining}function _(e){return!e._context.edits.shapePosition}function w(e,t){e._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+t+'"]').remove();var c=g.makeShapesOptionsAndPlotinfo(e,t),v=c.options,w=c.plotinfo;function A(c){var A=y(e,v),M={"data-index":t,"fill-rule":v.fillrule,d:A},E=v.opacity,C=v.fillcolor,P=v.line.width?v.line.color:"rgba(0,0,0,0)",L=v.line.width,I=v.line.dash;L||!0!==v.editable||(L=5,I="solid");var z="Z"!==A[A.length-1],O=_(e)&&v.editable&&e._fullLayout._activeShapeIndex===t;O&&(C=z?"rgba(0,0,0,0)":e._fullLayout.activeshape.fillcolor,E=e._fullLayout.activeshape.opacity);var R,D=c.append("g").classed("shape-group",!0).attr({"data-index":t}),j=D.append("path").attr(M).style("opacity",E).call(u.stroke,P).call(u.fill,C).call(h.dashLine,I,L);if(k(D,e,v),l(e,t,v,D),(O||e._context.edits.shapePosition)&&(R=p(e.layout,"shapes",v)),O){j.style({cursor:"move"});var F={element:j.node(),plotinfo:w,gd:e,editHelpers:R,hasText:v.label.text||v.label.texttemplate,isActiveShape:!0},B=o(A,e);s(B,j,F)}else e._context.edits.shapePosition?function(e,t,o,s,c,u){var p,v,x,_,w,S,A,M,E,C,P,L,I,z,O,R,D=10,j=10,F="pixel"===o.xsizemode,B="pixel"===o.ysizemode,N="line"===o.type,U="path"===o.type,V=u.modifyItem,q=r.select(t.node().parentNode),H=a.getFromId(e,o.xref),G=a.getRefType(o.xref),W=a.getFromId(e,o.yref),$=a.getRefType(o.yref),Z=o.x0shift,X=o.x1shift,Y=o.y0shift,K=o.y1shift,J=function(t,r){return g.getDataToPixel(e,H,r,!1,G)(t)},Q=function(t,r){return g.getDataToPixel(e,W,r,!0,$)(t)},ee=g.getPixelToData(e,H,!1,G),te=g.getPixelToData(e,W,!0,$),re=ie(),ne={element:re.node(),gd:e,prepFn:se,doneFn:le,clickFn:ce};function ie(){return N?ae():t}function ae(){var e=10,r=Math.max(o.line.width,e),n=c.append("g").attr("data-index",s).attr("drag-helper",!0);n.append("path").attr("d",t.attr("d")).style({cursor:"move","stroke-width":r,"stroke-opacity":"0"});var i={"fill-opacity":"0"},a=Math.max(r/2,e);return n.append("circle").attr({"data-line-point":"start-point",cx:F?J(o.xanchor)+o.x0:J(o.x0,Z),cy:B?Q(o.yanchor)-o.y0:Q(o.y0,Y),r:a}).style(i).classed("cursor-grab",!0),n.append("circle").attr({"data-line-point":"end-point",cx:F?J(o.xanchor)+o.x1:J(o.x1,X),cy:B?Q(o.yanchor)-o.y1:Q(o.y1,K),r:a}).style(i).classed("cursor-grab",!0),n}function oe(r){if(b(e))R=null;else if(N)R="path"===r.target.tagName?"move":"start-point"===r.target.attributes["data-line-point"].value?"resize-over-start-point":"resize-over-end-point";else{var n=ne.element.getBoundingClientRect(),i=n.right-n.left,a=n.bottom-n.top,o=r.clientX-n.left,s=r.clientY-n.top,l=!U&&i>D&&a>j&&!r.shiftKey?d.getCursor(o/i,1-s/a):"move";f(t,l),R=l.split("-")[0]}}function se(r){b(e)||(F&&(w=J(o.xanchor)),B&&(S=Q(o.yanchor)),"path"===o.type?O=o.path:(p=F?o.x0:J(o.x0),v=B?o.y0:Q(o.y0),x=F?o.x1:J(o.x1),_=B?o.y1:Q(o.y1)),p<x?(E=p,I="x0",C=x,z="x1"):(E=x,I="x1",C=p,z="x0"),!B&&v<_||B&&v>_?(A=v,P="y0",M=_,L="y1"):(A=_,P="y1",M=v,L="y0"),oe(r),pe(c,o),fe(t,o,e),ne.moveFn="move"===R?ue:he,ne.altKey=r.altKey)}function le(){b(e)||(f(t),de(c),k(t,e,o),n.call("_guiRelayout",e,u.getUpdateObj()))}function ce(){b(e)||de(c)}function ue(r,n){if("path"===o.type){var i=function(e){return e},a=i,u=i;F?V("xanchor",o.xanchor=ee(w+r)):(a=function(e){return ee(J(e)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=te(S+n)):(u=function(e){return te(Q(e)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else F?V("xanchor",o.xanchor=ee(w+r)):(V("x0",o.x0=ee(p+r)),V("x1",o.x1=ee(x+r))),B?V("yanchor",o.yanchor=te(S+n)):(V("y0",o.y0=te(v+n)),V("y1",o.y1=te(_+n)));t.attr("d",y(e,o)),pe(c,o),l(e,s,o,q)}function he(r,n){if(U){var i=function(e){return e},a=i,u=i;F?V("xanchor",o.xanchor=ee(w+r)):(a=function(e){return ee(J(e)+r)},H&&"date"===H.type&&(a=g.encodeDate(a))),B?V("yanchor",o.yanchor=te(S+n)):(u=function(e){return te(Q(e)+n)},W&&"date"===W.type&&(u=g.encodeDate(u))),V("path",o.path=T(O,a,u))}else if(N){if("resize-over-start-point"===R){var h=p+r,d=B?v-n:v+n;V("x0",o.x0=F?h:ee(h)),V("y0",o.y0=B?d:te(d))}else if("resize-over-end-point"===R){var f=x+r,m=B?_-n:_+n;V("x1",o.x1=F?f:ee(f)),V("y1",o.y1=B?m:te(m))}}else{var b=function(e){return-1!==R.indexOf(e)},k=b("n"),G=b("s"),$=b("w"),Z=b("e"),X=k?A+n:A,Y=G?M+n:M,K=$?E+r:E,re=Z?C+r:C;B&&(k&&(X=A-n),G&&(Y=M-n)),(!B&&Y-X>j||B&&X-Y>j)&&(V(P,o[P]=B?X:te(X)),V(L,o[L]=B?Y:te(Y))),re-K>D&&(V(I,o[I]=F?K:ee(K)),V(z,o[z]=F?re:ee(re)))}t.attr("d",y(e,o)),pe(c,o),l(e,s,o,q)}function pe(e,t){function r(){var r="path"!==t.type,n=e.selectAll(".visual-cue").data([0]),a=1;n.enter().append("path").attr({fill:"#fff","fill-rule":"evenodd",stroke:"#000","stroke-width":a}).classed("visual-cue",!0);var o=J(F?t.xanchor:i.midRange(r?[t.x0,t.x1]:g.extractPathCoords(t.path,m.paramIsX))),s=Q(B?t.yanchor:i.midRange(r?[t.y0,t.y1]:g.extractPathCoords(t.path,m.paramIsY)));if(o=g.roundPositionForSharpStrokeRendering(o,a),s=g.roundPositionForSharpStrokeRendering(s,a),F&&B){var l="M"+(o-1-a)+","+(s-1-a)+"h-8v2h8 v8h2v-8 h8v-2h-8 v-8h-2 Z";n.attr("d",l)}else if(F){var c="M"+(o-1-a)+","+(s-9-a)+"v18 h2 v-18 Z";n.attr("d",c)}else{var u="M"+(o-9-a)+","+(s-1-a)+"h18 v2 h-18 Z";n.attr("d",u)}}(F||B)&&r()}function de(e){e.selectAll(".visual-cue").remove()}function fe(e,t,r){var n=t.xref,i=t.yref,o=a.getFromId(r,n),s=a.getFromId(r,i),l="";"paper"===n||o.autorange||(l+=n),"paper"===i||s.autorange||(l+=i),h.setClipUrl(e,l?"clip"+r._fullLayout._uid+l:null,r)}d.init(ne),re.node().onmousemove=oe}(e,j,v,t,c,R):!0===v.editable&&j.style("pointer-events",z||u.opacity(C)*E<=.5?"stroke":"all");j.node().addEventListener("click",(function(){return function(e,t){if(_(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeShapeIndex)return void S(e);e._fullLayout._activeShapeIndex=n,e._fullLayout._deactivateShape=S,x(e)}}}(e,j)}))}v._input&&!0===v.visible&&("above"===v.layer?A(e._fullLayout._shapeUpperLayer):"paper"===v.xref||"paper"===v.yref?A(e._fullLayout._shapeLowerLayer):"between"===v.layer?A(w.shapelayerBetween):w._hadPlotinfo?A((w.mainplotinfo||w).shapelayer):A(e._fullLayout._shapeLowerLayer))}function k(e,t,r){var n=(r.xref+r.yref).replace(/paper/g,"").replace(/[xyz][1-9]* *domain/g,"");h.setClipUrl(e,n?"clip"+t._fullLayout._uid+n:null,t)}function T(e,t,r){return e.replace(m.segmentRE,(function(e){var n=0,i=e.charAt(0),a=m.paramIsX[i],o=m.paramIsY[i],s=m.numParams[i];return i+e.substr(1).replace(m.paramRE,(function(e){return n>=s||(a[n]?e=t(e):o[n]&&(e=r(e)),n++),e}))}))}function S(e){_(e)&&e._fullLayout._activeShapeIndex>=0&&(c(e),delete e._fullLayout._activeShapeIndex,x(e))}t.exports={draw:x,drawOne:w,eraseActiveShape:function(e){if(_(e)){c(e);var t=e._fullLayout._activeShapeIndex,r=(e.layout||{}).shapes||[];if(t<r.length){for(var i=[],a=0;a<r.length;a++)a!==t&&i.push(r[a]);return delete e._fullLayout._activeShapeIndex,n.call("_guiRelayout",e,{shapes:i})}}},drawLabel:l}}}),$r=p({"src/components/modebar/buttons.js"(e,t){var r=Ve(),n=kt(),i=vt(),a=Dr(),o=Wr().eraseActiveShape,s=st(),l=s._,c=t.exports={};function u(e,t){var n,a,o=t.currentTarget,s=o.getAttribute("data-attr"),l=o.getAttribute("data-val")||!0,c=e._fullLayout,u={},h=i.list(e,null,!0),p=c._cartesianSpikesEnabled;if("zoom"===s){var d,f="in"===l?.5:2,m=(1+f)/2,g=(1-f)/2;for(a=0;a<h.length;a++)if(!(n=h[a]).fixedrange)if(d=n._name,"auto"===l)u[d+".autorange"]=!0;else if("reset"===l)void 0===n._rangeInitial0&&void 0===n._rangeInitial1?u[d+".autorange"]=!0:void 0===n._rangeInitial0?(u[d+".autorange"]=n._autorangeInitial,u[d+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(u[d+".range"]=[n._rangeInitial0,null],u[d+".autorange"]=n._autorangeInitial):u[d+".range"]=[n._rangeInitial0,n._rangeInitial1],void 0!==n._showSpikeInitial&&(u[d+".showspikes"]=n._showSpikeInitial,"on"!==p||n._showSpikeInitial||(p="off"));else{var y=[n.r2l(n.range[0]),n.r2l(n.range[1])],v=[m*y[0]+g*y[1],m*y[1]+g*y[0]];u[d+".range[0]"]=n.l2r(v[0]),u[d+".range[1]"]=n.l2r(v[1])}}else"hovermode"!==s||"x"!==l&&"y"!==l||(l=c._isHoriz?"y":"x",o.setAttribute("data-val",l)),u[s]=l;c._cartesianSpikesEnabled=p,r.call("_guiRelayout",e,u)}function h(e,t){for(var n=t.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=e._fullLayout._subplots.gl3d||[],s={},l=i.split("."),c=0;c<o.length;c++)s[o[c]+"."+l[1]]=a;var u="pan"===a?a:"zoom";s.dragmode=u,r.call("_guiRelayout",e,s)}function p(e,t){for(var n=t.currentTarget.getAttribute("data-attr"),i="resetLastSave"===n,a="resetDefault"===n,o=e._fullLayout,s=o._subplots.gl3d||[],l={},c=0;c<s.length;c++){var u,h=s[c],p=h+".camera",d=h+".aspectratio",f=h+".aspectmode",m=o[h]._scene;i?(l[p+".up"]=m.viewInitial.up,l[p+".eye"]=m.viewInitial.eye,l[p+".center"]=m.viewInitial.center,u=!0):a&&(l[p+".up"]=null,l[p+".eye"]=null,l[p+".center"]=null,u=!0),u&&(l[d+".x"]=m.viewInitial.aspectratio.x,l[d+".y"]=m.viewInitial.aspectratio.y,l[d+".z"]=m.viewInitial.aspectratio.z,l[f]=m.viewInitial.aspectmode)}r.call("_guiRelayout",e,l)}function d(e,t){var r=t.currentTarget,n=r._previousVal,i=e._fullLayout,a=i._subplots.gl3d||[],o=["xaxis","yaxis","zaxis"],s={},l={};if(n)l=n,r._previousVal=null;else{for(var c=0;c<a.length;c++){var u=a[c],h=i[u],p=u+".hovermode";s[p]=h.hovermode,l[p]=!1;for(var d=0;d<3;d++){var f=o[d],m=u+"."+f+".showspikes";l[m]=!1,s[m]=h[f].showspikes}}r._previousVal=s}return l}function f(e,t){for(var n=t.currentTarget,i=n.getAttribute("data-attr"),a=n.getAttribute("data-val")||!0,o=e._fullLayout,s=o._subplots.geo||[],l=0;l<s.length;l++){var c=s[l],u=o[c];if("zoom"===i){var h=u.projection.scale,p="in"===a?2*h:.5*h;r.call("_guiRelayout",e,c+".projection.scale",p)}}"reset"===i&&b(e,"geo")}function m(e){var t=e._fullLayout;return!t.hovermode&&(t._has("cartesian")?t._isHoriz?"y":"x":"closest")}function g(e){var t=m(e);r.call("_guiRelayout",e,"hovermode",t)}function y(e,t){x(e,t,"mapbox")}function v(e,t){x(e,t,"map")}function x(e,t,n){for(var i=t.currentTarget.getAttribute("data-val"),a=e._fullLayout,o=a._subplots[n]||[],s={},l=0;l<o.length;l++){var c=o[l],u=a[c].zoom,h="in"===i?1.05*u:u/1.05;s[c+".zoom"]=h}r.call("_guiRelayout",e,s)}function b(e,t){for(var n=e._fullLayout,i=n._subplots[t]||[],a={},o=0;o<i.length;o++)for(var s=i[o],l=n[s]._subplot.viewInitial,c=Object.keys(l),u=0;u<c.length;u++){var h=c[u];a[s+"."+h]=l[h]}r.call("_guiRelayout",e,a)}c.toImage={name:"toImage",title:function(e){var t=(e._context.toImageButtonOptions||{}).format||"png";return l(e,"png"===t?"Download plot as a png":"Download plot")},icon:a.camera,click:function(e){var t=e._context.toImageButtonOptions,n={format:t.format||"png"};s.notifier(l(e,"Taking snapshot - this may take a few seconds"),"long"),["filename","width","height","scale"].forEach((function(e){e in t&&(n[e]=t[e])})),r.call("downloadImage",e,n).then((function(t){s.notifier(l(e,"Snapshot succeeded")+" - "+t,"long")})).catch((function(){s.notifier(l(e,"Sorry, there was a problem downloading your snapshot!"),"long")}))}},c.sendDataToCloud={name:"sendDataToCloud",title:function(e){return l(e,"Edit in Chart Studio")},icon:a.disk,click:function(e){n.sendDataToCloud(e)}},c.editInChartStudio={name:"editInChartStudio",title:function(e){return l(e,"Edit in Chart Studio")},icon:a.pencil,click:function(e){n.sendDataToCloud(e)}},c.zoom2d={name:"zoom2d",_cat:"zoom",title:function(e){return l(e,"Zoom")},attr:"dragmode",val:"zoom",icon:a.zoombox,click:u},c.pan2d={name:"pan2d",_cat:"pan",title:function(e){return l(e,"Pan")},attr:"dragmode",val:"pan",icon:a.pan,click:u},c.select2d={name:"select2d",_cat:"select",title:function(e){return l(e,"Box Select")},attr:"dragmode",val:"select",icon:a.selectbox,click:u},c.lasso2d={name:"lasso2d",_cat:"lasso",title:function(e){return l(e,"Lasso Select")},attr:"dragmode",val:"lasso",icon:a.lasso,click:u},c.drawclosedpath={name:"drawclosedpath",title:function(e){return l(e,"Draw closed freeform")},attr:"dragmode",val:"drawclosedpath",icon:a.drawclosedpath,click:u},c.drawopenpath={name:"drawopenpath",title:function(e){return l(e,"Draw open freeform")},attr:"dragmode",val:"drawopenpath",icon:a.drawopenpath,click:u},c.drawline={name:"drawline",title:function(e){return l(e,"Draw line")},attr:"dragmode",val:"drawline",icon:a.drawline,click:u},c.drawrect={name:"drawrect",title:function(e){return l(e,"Draw rectangle")},attr:"dragmode",val:"drawrect",icon:a.drawrect,click:u},c.drawcircle={name:"drawcircle",title:function(e){return l(e,"Draw circle")},attr:"dragmode",val:"drawcircle",icon:a.drawcircle,click:u},c.eraseshape={name:"eraseshape",title:function(e){return l(e,"Erase active shape")},icon:a.eraseshape,click:o},c.zoomIn2d={name:"zoomIn2d",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:u},c.zoomOut2d={name:"zoomOut2d",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:u},c.autoScale2d={name:"autoScale2d",_cat:"autoscale",title:function(e){return l(e,"Autoscale")},attr:"zoom",val:"auto",icon:a.autoscale,click:u},c.resetScale2d={name:"resetScale2d",_cat:"resetscale",title:function(e){return l(e,"Reset axes")},attr:"zoom",val:"reset",icon:a.home,click:u},c.hoverClosestCartesian={name:"hoverClosestCartesian",_cat:"hoverclosest",title:function(e){return l(e,"Show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:u},c.hoverCompareCartesian={name:"hoverCompareCartesian",_cat:"hoverCompare",title:function(e){return l(e,"Compare data on hover")},attr:"hovermode",val:function(e){return e._fullLayout._isHoriz?"y":"x"},icon:a.tooltip_compare,gravity:"ne",click:u},c.zoom3d={name:"zoom3d",_cat:"zoom",title:function(e){return l(e,"Zoom")},attr:"scene.dragmode",val:"zoom",icon:a.zoombox,click:h},c.pan3d={name:"pan3d",_cat:"pan",title:function(e){return l(e,"Pan")},attr:"scene.dragmode",val:"pan",icon:a.pan,click:h},c.orbitRotation={name:"orbitRotation",title:function(e){return l(e,"Orbital rotation")},attr:"scene.dragmode",val:"orbit",icon:a["3d_rotate"],click:h},c.tableRotation={name:"tableRotation",title:function(e){return l(e,"Turntable rotation")},attr:"scene.dragmode",val:"turntable",icon:a["z-axis"],click:h},c.resetCameraDefault3d={name:"resetCameraDefault3d",_cat:"resetCameraDefault",title:function(e){return l(e,"Reset camera to default")},attr:"resetDefault",icon:a.home,click:p},c.resetCameraLastSave3d={name:"resetCameraLastSave3d",_cat:"resetCameraLastSave",title:function(e){return l(e,"Reset camera to last save")},attr:"resetLastSave",icon:a.movie,click:p},c.hoverClosest3d={name:"hoverClosest3d",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(e,t){var n=d(e,t);r.call("_guiRelayout",e,n)}},c.zoomInGeo={name:"zoomInGeo",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:f},c.zoomOutGeo={name:"zoomOutGeo",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:f},c.resetGeo={name:"resetGeo",_cat:"reset",title:function(e){return l(e,"Reset")},attr:"reset",val:null,icon:a.autoscale,click:f},c.hoverClosestGeo={name:"hoverClosestGeo",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:g},c.hoverClosestPie={name:"hoverClosestPie",_cat:"hoverclosest",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:"closest",icon:a.tooltip_basic,gravity:"ne",click:g},c.resetViewSankey={name:"resetSankeyGroup",title:function(e){return l(e,"Reset view")},icon:a.home,click:function(e){for(var t={"node.groups":[],"node.x":[],"node.y":[]},n=0;n<e._fullData.length;n++){var i=e._fullData[n]._viewInitial;t["node.groups"].push(i.node.groups.slice()),t["node.x"].push(i.node.x.slice()),t["node.y"].push(i.node.y.slice())}r.call("restyle",e,t)}},c.toggleHover={name:"toggleHover",title:function(e){return l(e,"Toggle show closest data on hover")},attr:"hovermode",val:null,toggle:!0,icon:a.tooltip_basic,gravity:"ne",click:function(e,t){var n=d(e,t);n.hovermode=m(e),r.call("_guiRelayout",e,n)}},c.resetViews={name:"resetViews",title:function(e){return l(e,"Reset views")},icon:a.home,click:function(e,t){var r=t.currentTarget;r.setAttribute("data-attr","zoom"),r.setAttribute("data-val","reset"),u(e,t),r.setAttribute("data-attr","resetLastSave"),p(e,t),b(e,"geo"),b(e,"mapbox"),b(e,"map")}},c.toggleSpikelines={name:"toggleSpikelines",title:function(e){return l(e,"Toggle Spike Lines")},icon:a.spikeline,attr:"_cartesianSpikesEnabled",val:"on",click:function(e){var t=e._fullLayout,n=t._cartesianSpikesEnabled;t._cartesianSpikesEnabled="on"===n?"off":"on",r.call("_guiRelayout",e,function(e){for(var t="on"===e._fullLayout._cartesianSpikesEnabled,r=i.list(e,null,!0),n={},a=0;a<r.length;a++){var o=r[a];n[o._name+".showspikes"]=!!t||o._showSpikeInitial}return n}(e))}},c.resetViewMapbox={name:"resetViewMapbox",_cat:"resetView",title:function(e){return l(e,"Reset view")},attr:"reset",icon:a.home,click:function(e){b(e,"mapbox")}},c.resetViewMap={name:"resetViewMap",_cat:"resetView",title:function(e){return l(e,"Reset view")},attr:"reset",icon:a.home,click:function(e){b(e,"map")}},c.zoomInMapbox={name:"zoomInMapbox",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:y},c.zoomInMap={name:"zoomInMap",_cat:"zoomin",title:function(e){return l(e,"Zoom in")},attr:"zoom",val:"in",icon:a.zoom_plus,click:v},c.zoomOutMapbox={name:"zoomOutMapbox",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:y},c.zoomOutMap={name:"zoomOutMap",_cat:"zoomout",title:function(e){return l(e,"Zoom out")},attr:"zoom",val:"out",icon:a.zoom_minus,click:v}}}),Zr=p({"src/components/modebar/constants.js"(e,t){var r=$r(),n=Object.keys(r),i=["drawline","drawopenpath","drawclosedpath","drawcircle","drawrect","eraseshape"],a=["v1hovermode","hoverclosest","hovercompare","togglehover","togglespikelines"].concat(i),o=[];n.forEach((function(e){!function(e){if(-1===a.indexOf(e._cat||e.name)){var t=e.name,r=(e._cat||e.name).toLowerCase();-1===o.indexOf(t)&&o.push(t),-1===o.indexOf(r)&&o.push(r)}}(r[e])})),o.sort(),t.exports={DRAW_MODES:i,backButtons:a,foreButtons:o}}}),Xr=p({"src/components/modebar/attributes.js"(e,t){Zr(),t.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"}}}}),Yr=p({"src/components/modebar/defaults.js"(e,t){var r=st(),n=q(),i=gt(),a=Xr();t.exports=function(e,t){var o=e.modebar||{},s=i.newContainer(t,"modebar");function l(e,t){return r.coerce(o,s,a,e,t)}l("orientation"),l("bgcolor",n.addOpacity(t.paper_bgcolor,.5));var c=n.contrast(n.rgb(t.modebar.bgcolor));l("color",n.addOpacity(c,.3)),l("activecolor",n.addOpacity(c,.7)),l("uirevision",t.uirevision),l("add"),l("remove")}}}),Kr=p({"src/components/modebar/modebar.js"(e,t){var r=v(),n=k(),i=st(),a=Dr(),o=g().version,s=new DOMParser;function l(e){this.container=e.container,this.element=document.createElement("div"),this.update(e.graphInfo,e.buttons),this.container.appendChild(this.element)}var c=l.prototype;c.update=function(e,t){this.graphInfo=e;var r=this.graphInfo._context,n=this.graphInfo._fullLayout,a="modebar-"+n._uid;this.element.setAttribute("id",a),this._uid=a,this.element.className="modebar","hover"===r.displayModeBar&&(this.element.className+=" modebar--hover ease-bg"),"v"===n.modebar.orientation&&(this.element.className+=" vertical",t=t.reverse());var o=n.modebar,s="#"+a+" .modebar-group";document.querySelectorAll(s).forEach((function(e){e.style.backgroundColor=o.bgcolor}));var l=!this.hasButtons(t),c=this.hasLogo!==r.displaylogo,u=this.locale!==r.locale;if(this.locale=r.locale,(l||c||u)&&(this.removeAllButtons(),this.updateButtons(t),r.watermark||r.displaylogo)){var h=this.getLogo();r.watermark&&(h.className=h.className+" watermark"),"v"===n.modebar.orientation?this.element.insertBefore(h,this.element.childNodes[0]):this.element.appendChild(h),this.hasLogo=!0}this.updateActiveButton(),i.setStyleOnHover("#"+a+" .modebar-btn",".active",".icon path","fill: "+o.activecolor,"fill: "+o.color,this.element)},c.updateButtons=function(e){var t=this;this.buttons=e,this.buttonElements=[],this.buttonsNames=[],this.buttons.forEach((function(e){var r=t.createGroup();e.forEach((function(e){var n=e.name;if(!n)throw new Error("must provide button 'name' in button config");if(-1!==t.buttonsNames.indexOf(n))throw new Error("button name '"+n+"' is taken");t.buttonsNames.push(n);var i=t.createButton(e);t.buttonElements.push(i),r.appendChild(i)})),t.element.appendChild(r)}))},c.createGroup=function(){var e=document.createElement("div");e.className="modebar-group";var t=this.graphInfo._fullLayout.modebar;return e.style.backgroundColor=t.bgcolor,e},c.createButton=function(e){var t=this,n=document.createElement("a");n.setAttribute("rel","tooltip"),n.className="modebar-btn";var i=e.title;void 0===i?i=e.name:"function"===typeof i&&(i=i(this.graphInfo)),(i||0===i)&&n.setAttribute("data-title",i),void 0!==e.attr&&n.setAttribute("data-attr",e.attr);var o=e.val;if(void 0!==o&&("function"===typeof o&&(o=o(this.graphInfo)),n.setAttribute("data-val",o)),"function"!==typeof e.click)throw new Error("must provide button 'click' function in button config");n.addEventListener("click",(function(r){e.click(t.graphInfo,r),t.updateActiveButton(r.currentTarget)})),n.setAttribute("data-toggle",e.toggle||!1),e.toggle&&r.select(n).classed("active",!0);var s=e.icon;return"function"===typeof s?n.appendChild(s()):n.appendChild(this.createIcon(s||a.question)),n.setAttribute("data-gravity",e.gravity||"n"),n},c.createIcon=function(e){var t,r=n(e.height)?Number(e.height):e.ascent-e.descent,i="http://www.w3.org/2000/svg";if(e.path){(t=document.createElementNS(i,"svg")).setAttribute("viewBox",[0,0,e.width,r].join(" ")),t.setAttribute("class","icon");var a=document.createElementNS(i,"path");a.setAttribute("d",e.path),e.transform?a.setAttribute("transform",e.transform):void 0!==e.ascent&&a.setAttribute("transform","matrix(1 0 0 -1 0 "+e.ascent+")"),t.appendChild(a)}return e.svg&&(t=s.parseFromString(e.svg,"application/xml").childNodes[0]),t.setAttribute("height","1em"),t.setAttribute("width","1em"),t},c.updateActiveButton=function(e){var t=this.graphInfo._fullLayout,n=void 0!==e?e.getAttribute("data-attr"):null;this.buttonElements.forEach((function(e){var a=e.getAttribute("data-val")||!0,o=e.getAttribute("data-attr"),s="true"===e.getAttribute("data-toggle"),l=r.select(e),c=function(e,r){var n=t.modebar,i=e.querySelector(".icon path");i&&(r||e.matches(":hover")?i.style.fill=n.activecolor:i.style.fill=n.color)};if(s){if(o===n){var u=!l.classed("active");l.classed("active",u),c(e,u)}}else{var h=null===o?o:i.nestedProperty(t,o).get();l.classed("active",h===a),c(e,h===a)}}))},c.hasButtons=function(e){var t=this.buttons;if(!t)return!1;if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;n++)if(e[r][n].name!==t[r][n].name)return!1}return!0},c.getLogo=function(){var e=this.createGroup(),t=document.createElement("a");return t.href="https://plotly.com/",t.target="_blank",t.setAttribute("data-title",i._(this.graphInfo,"Produced with Plotly.js")+" (v"+o+")"),t.className="modebar-btn plotlyjsicon modebar-btn--logo",t.appendChild(this.createIcon(a.newplotlylogo)),e.appendChild(t),e},c.removeAllButtons=function(){for(;this.element.firstChild;)this.element.removeChild(this.element.firstChild);this.hasLogo=!1},c.destroy=function(){i.removeElement(this.container.querySelector(".modebar"))},t.exports=function(e,t){var n=e._fullLayout,i=new l({graphInfo:e,container:n._modebardiv.node(),buttons:t});return n._privateplot&&r.select(i.element).append("span").classed("badge-private float--left",!0).text("PRIVATE"),i}}}),Jr=p({"src/components/modebar/manage.js"(e,t){var r=vt(),n=$t(),i=Ve(),a=Xt().isUnifiedHover,o=Kr(),s=$r(),l=Zr().DRAW_MODES,c=st().extendDeep;t.exports=function(e){var t=e._fullLayout,u=e._context,h=t._modeBar;if(u.displayModeBar||u.watermark){if(!Array.isArray(u.modeBarButtonsToRemove))throw new Error(["*modeBarButtonsToRemove* configuration options","must be an array."].join(" "));if(!Array.isArray(u.modeBarButtonsToAdd))throw new Error(["*modeBarButtonsToAdd* configuration options","must be an array."].join(" "));var p,d=u.modeBarButtons;p=Array.isArray(d)&&d.length?function(e){for(var t=c([],e),r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;i++){var a=n[i];if("string"===typeof a){if(void 0===s[a])throw new Error(["*modeBarButtons* configuration options","invalid button name"].join(" "));t[r][i]=s[a]}}return t}(d):!u.displayModeBar&&u.watermark?[]:function(e){var t=e._fullLayout,o=e._fullData,c=e._context;function u(e,t){if("string"===typeof t){if(t.toLowerCase()===e.toLowerCase())return!0}else{var r=t.name,n=t._cat||t.name;if(r===e||n===e.toLowerCase())return!0}return!1}var h=t.modebar.add;"string"===typeof h&&(h=[h]);var p=t.modebar.remove;"string"===typeof p&&(p=[p]);var d=c.modeBarButtonsToAdd.concat(h.filter((function(e){for(var t=0;t<c.modeBarButtonsToRemove.length;t++)if(u(e,c.modeBarButtonsToRemove[t]))return!1;return!0}))),f=c.modeBarButtonsToRemove.concat(p.filter((function(e){for(var t=0;t<c.modeBarButtonsToAdd.length;t++)if(u(e,c.modeBarButtonsToAdd[t]))return!1;return!0}))),m=t._has("cartesian"),g=t._has("gl3d"),y=t._has("geo"),v=t._has("pie"),x=t._has("funnelarea"),b=t._has("ternary"),_=t._has("mapbox"),w=t._has("map"),k=t._has("polar"),T=t._has("smith"),S=t._has("sankey"),A=function(e){for(var t=r.list({_fullLayout:e},null,!0),n=0;n<t.length;n++)if(!t[n].fixedrange)return!1;return!0}(t),M=a(t.hovermode),E=[];function C(e){if(e.length){for(var t=[],r=0;r<e.length;r++){for(var n=e[r],i=s[n],a=i.name.toLowerCase(),o=(i._cat||i.name).toLowerCase(),l=!1,c=0;c<f.length;c++){var u=f[c].toLowerCase();if(u===a||u===o){l=!0;break}}l||t.push(s[n])}E.push(t)}}var P=["toImage"];c.showEditInChartStudio?P.push("editInChartStudio"):c.showSendToCloud&&P.push("sendDataToCloud"),C(P);var L=[],I=[],z=[],O=[];(m||v||x||b)+y+g+_+w+k+T>1?(I=["toggleHover"],z=["resetViews"]):y?(L=["zoomInGeo","zoomOutGeo"],I=["hoverClosestGeo"],z=["resetGeo"]):g?(I=["hoverClosest3d"],z=["resetCameraDefault3d","resetCameraLastSave3d"]):_?(L=["zoomInMapbox","zoomOutMapbox"],I=["toggleHover"],z=["resetViewMapbox"]):w?(L=["zoomInMap","zoomOutMap"],I=["toggleHover"],z=["resetViewMap"]):v?I=["hoverClosestPie"]:S?(I=["hoverClosestCartesian","hoverCompareCartesian"],z=["resetViewSankey"]):I=["toggleHover"],m&&I.push("toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"),(function(e){for(var t=0;t<e.length;t++)if(!i.traceIs(e[t],"noHover"))return!1;return!0}(o)||M)&&(I=[]),m&&!A&&(L=["zoomIn2d","zoomOut2d","autoScale2d"],"resetViews"!==z[0]&&(z=["resetScale2d"])),g?O=["zoom3d","pan3d","orbitRotation","tableRotation"]:m&&!A||b?O=["zoom2d","pan2d"]:_||w||y?O=["pan2d"]:k&&(O=["zoom2d"]),function(e){for(var t=!1,r=0;r<e.length&&!t;r++){var a=e[r];a._module&&a._module.selectPoints&&(i.traceIs(a,"scatter-like")?(n.hasMarkers(a)||n.hasText(a))&&(t=!0):i.traceIs(a,"box-violin")&&"all"!==a.boxpoints&&"all"!==a.points||(t=!0))}return t}(o)&&O.push("select2d","lasso2d");var R=[],D=function(e){-1===R.indexOf(e)&&-1!==I.indexOf(e)&&R.push(e)};if(Array.isArray(d)){for(var j=[],F=0;F<d.length;F++){var B=d[F];"string"===typeof B?(B=B.toLowerCase(),-1!==l.indexOf(B)?(t._has("mapbox")||t._has("map")||t._has("cartesian"))&&O.push(B):"togglespikelines"===B?D("toggleSpikelines"):"togglehover"===B?D("toggleHover"):"hovercompare"===B?D("hoverCompareCartesian"):"hoverclosest"===B?(D("hoverClosestCartesian"),D("hoverClosestGeo"),D("hoverClosest3d"),D("hoverClosestPie")):"v1hovermode"===B&&(D("hoverClosestCartesian"),D("hoverCompareCartesian"),D("hoverClosestGeo"),D("hoverClosest3d"),D("hoverClosestPie"))):j.push(B)}d=j}return C(O),C(L.concat(z)),C(R),function(e,t){if(t.length)if(Array.isArray(t[0]))for(var r=0;r<t.length;r++)e.push(t[r]);else e.push(t);return e}(E,d)}(e),h?h.update(e,p):t._modeBar=o(e,p)}else h&&(h.destroy(),delete t._modeBar)}}}),Qr=p({"src/components/modebar/index.js"(e,t){t.exports={moduleType:"component",name:"modebar",layoutAttributes:Xr(),supplyLayoutDefaults:Yr(),manage:Jr()}}}),en=p({"src/plots/cartesian/scale_zoom.js"(e,t){var r=St().FROM_BL;t.exports=function(e,t,n){void 0===n&&(n=r[e.constraintoward||"center"]);var i=[e.r2l(e.range[0]),e.r2l(e.range[1])],a=i[0]+(i[1]-i[0])*n;e.range=e._input.range=[e.l2r(a+(i[0]-a)*t),e.l2r(a+(i[1]-a)*t)],e.setScale()}}}),tn=p({"src/plots/cartesian/constraints.js"(e){var t=st(),r=rr(),n=vt().id2name,i=Ct(),a=en(),o=er(),s=T().ALMOST_EQUAL,l=St().FROM_BL;function c(e,r,a){var o=a.axIds,s=a.layoutOut,l=a.hasImage,c=s._axisConstraintGroups,d=s._axisMatchGroups,f=r._id,m=f.charAt(0),g=((s._splomAxes||{})[m]||{})[f]||{},y=r._id,v="x"===y.charAt(0);function x(n,a){return t.coerce(e,r,i,n,a)}r._matchGroup=null,r._constraintGroup=null,x("constrain",l?"domain":"range"),t.coerce(e,r,{constraintoward:{valType:"enumerated",values:v?["left","center","right"]:["bottom","middle","top"],dflt:v?"center":"middle"}},"constraintoward");var b,_,w=r.type,k=[];for(b=0;b<o.length;b++)(_=o[b])!==y&&s[n(_)].type===w&&k.push(_);var T=h(c,y);if(T){var S=[];for(b=0;b<k.length;b++)T[_=k[b]]||S.push(_);k=S}var A,M,E=k.length;E&&(e.matches||g.matches)&&(A=t.coerce(e,r,{matches:{valType:"enumerated",values:k,dflt:-1!==k.indexOf(g.matches)?g.matches:void 0}},"matches"));var C=l&&!v?r.anchor:void 0;if(E&&!A&&(e.scaleanchor||C)&&(M=t.coerce(e,r,{scaleanchor:{valType:"enumerated",values:k.concat([!1])}},"scaleanchor",C)),A){r._matchGroup=p(d,y,A,1);var P=s[n(A)],L=u(s,r)/u(s,P);v!==("x"===A.charAt(0))&&(L=(v?"x":"y")+L),p(c,y,A,L)}else e.matches&&-1!==o.indexOf(e.matches)&&t.warn("ignored "+r._name+'.matches: "'+e.matches+'" to avoid an infinite loop');if(M){var I=x("scaleratio");I||(I=r.scaleratio=1),p(c,y,M,I)}else e.scaleanchor&&-1!==o.indexOf(e.scaleanchor)&&t.warn("ignored "+r._name+'.scaleanchor: "'+e.scaleanchor+'" to avoid either an infinite loop and possibly inconsistent scaleratios, or because this axis declares a *matches* constraint.')}function u(e,t){var r=t.domain;return r||(r=e[n(t.overlaying)].domain),r[1]-r[0]}function h(e,t){for(var r=0;r<e.length;r++)if(e[r][t])return e[r];return null}function p(e,t,r,n){var i,a,o,s,l,c=h(e,t);null===c?((c={})[t]=1,l=e.length,e.push(c)):l=e.indexOf(c);var u=Object.keys(c);for(i=0;i<e.length;i++)if(o=e[i],i!==l&&o[r]){var p=o[r];for(a=0;a<u.length;a++)o[s=u[a]]=d(p,d(n,c[s]));return void e.splice(l,1)}if(1!==n)for(a=0;a<u.length;a++){var f=u[a];c[f]=d(n,c[f])}c[r]=1}function d(e,t){var r,n,i="",a="";"string"===typeof e&&(r=(i=e.match(/^[xy]*/)[0]).length,e=+e.substr(r)),"string"===typeof t&&(n=(a=t.match(/^[xy]*/)[0]).length,t=+t.substr(n));var o=e*t;return r||n?r&&n&&i.charAt(0)!==a.charAt(0)?r===n?o:(r>n?i.substr(n):a.substr(r))+o:i+a+e*t:o}function f(e,t){for(var r=t._size,n=r.h/r.w,i={},a=Object.keys(e),o=0;o<a.length;o++){var s=a[o],l=e[s];if("string"===typeof l){var c=l.match(/^[xy]*/)[0],u=c.length;l=+l.substr(u);for(var h="y"===c.charAt(0)?n:1/n,p=0;p<u;p++)l*=h}i[s]=l}return i}function m(e,t){var r=e._inputDomain,n=l[e.constraintoward],i=r[0]+(r[1]-r[0])*n;e.domain=e._input.domain=[i+(r[0]-i)/t,i+(r[1]-i)/t],e.setScale()}e.handleDefaults=function(e,r,i){var a,s,l,u,h,p,d,f,m=i.axIds,g=i.axHasImage,y=r._axisConstraintGroups=[],v=r._axisMatchGroups=[];for(a=0;a<m.length;a++)c(h=e[u=n(m[a])],p=r[u],{axIds:m,layoutOut:r,hasImage:g[u]});function x(e,t){for(a=0;a<e.length;a++)for(l in s=e[a])r[n(l)][t]=s}for(x(v,"_matchGroup"),a=0;a<y.length;a++)for(l in s=y[a])if((p=r[n(l)]).fixedrange){for(var b in s){var _=n(b);!1===(e[_]||{}).fixedrange&&t.warn("fixedrange was specified as false for axis "+_+" but was overridden because another axis in its constraint group has fixedrange true"),r[_].fixedrange=!0}break}for(a=0;a<y.length;){for(l in s=y[a]){(p=r[n(l)])._matchGroup&&Object.keys(p._matchGroup).length===Object.keys(s).length&&(y.splice(a,1),a--);break}a++}x(y,"_constraintGroup");var w=["constrain","range","autorange","rangemode","rangebreaks","categoryorder","categoryarray"],k=!1,T=!1;function S(){f=p[d],"rangebreaks"===d&&(T=p._hasDayOfWeekBreaks)}for(a=0;a<v.length;a++){s=v[a];for(var A=0;A<w.length;A++){var M;for(l in d=w[A],f=null,s)if(h=e[u=n(l)],p=r[u],d in p){if(!p.matches&&(M=p,d in h)){S();break}null===f&&d in h&&S()}if("range"===d&&f&&h.range&&2===h.range.length&&null!==h.range[0]&&null!==h.range[1]&&(k=!0),"autorange"===d&&null===f&&k&&(f=!1),null===f&&d in M&&(f=M[d]),null!==f)for(l in s)(p=r[n(l)])[d]="range"===d?f.slice():f,"rangebreaks"===d&&(p._hasDayOfWeekBreaks=T,o(p,r))}}},e.enforce=function(e){var t,i,o,l,c,u,h,p,d=e._fullLayout,g=d._axisConstraintGroups||[];for(t=0;t<g.length;t++){o=f(g[t],d);var y=Object.keys(o),v=1/0,x=0,b=1/0,_={},w={},k=!1;for(i=0;i<y.length;i++)w[l=y[i]]=c=d[n(l)],c._inputDomain?c.domain=c._inputDomain.slice():c._inputDomain=c.domain.slice(),c._inputRange||(c._inputRange=c.range.slice()),c.setScale(),_[l]=u=Math.abs(c._m)/o[l],v=Math.min(v,u),"domain"!==c.constrain&&c._constraintShrinkable||(b=Math.min(b,u)),delete c._constraintShrinkable,x=Math.max(x,u),"domain"===c.constrain&&(k=!0);if(!(v>s*x)||k)for(i=0;i<y.length;i++)if(u=_[l=y[i]],h=(c=w[l]).constrain,u!==b||"domain"===h)if(p=u/b,"range"===h)a(c,p);else{var T=c._inputDomain,S=(c.domain[1]-c.domain[0])/(T[1]-T[0]),A=(c.r2l(c.range[1])-c.r2l(c.range[0]))/(c.r2l(c._inputRange[1])-c.r2l(c._inputRange[0]));if((p/=S)*A<1){c.domain=c._input.domain=T.slice(),a(c,p);continue}if(A<1&&(c.range=c._input.range=c._inputRange.slice(),p*=A),c.autorange){var M=c.r2l(c.range[0]),E=c.r2l(c.range[1]),C=(M+E)/2,P=C,L=C,I=Math.abs(E-C),z=C-I*p*1.0001,O=C+I*p*1.0001,R=r.makePadFn(d,c,0),D=r.makePadFn(d,c,1);m(c,p);var j,F,B=Math.abs(c._m),N=r.concatExtremes(e,c),U=N.min,V=N.max;for(F=0;F<U.length;F++)(j=U[F].val-R(U[F])/B)>z&&j<P&&(P=j);for(F=0;F<V.length;F++)(j=V[F].val+D(V[F])/B)<O&&j>L&&(L=j);p/=(L-P)/(2*I),P=c.l2r(P),L=c.l2r(L),c.range=c._input.range=M<E?[P,L]:[L,P]}m(c,p)}}},e.getAxisGroup=function(e,t){for(var r=e._axisMatchGroups,n=0;n<r.length;n++)if(r[n][t])return"g"+n;return t},e.clean=function(e,t){if(t._inputDomain){for(var r=!1,n=t._id,i=e._fullLayout._axisConstraintGroups,a=0;a<i.length;a++)if(i[a][n]){r=!0;break}r&&"domain"===t.constrain||(t._input.domain=t.domain=t._inputDomain,delete t._inputDomain)}}}}),rn=p({"src/plot_api/subroutines.js"(e){var t=v(),r=Ve(),n=kt(),i=st(),a=At(),o=Rr(),s=q(),l=Jt(),c=Qt(),u=Qr(),h=nr(),p=St(),d=tn(),f=d.enforce,m=d.clean,g=rr().doAutoRange,y="start",x="middle",b="end",_=yt().zindexSeparator;function w(e,t,r){for(var n=0;n<r.length;n++){var i=r[n][0],a=r[n][1];if(!(i[0]>=e[1]||i[1]<=e[0])&&a[0]<t[1]&&a[1]>t[0])return!0}return!1}function k(r){var a,o,c,d,f,m,g=r._fullLayout,y=g._size,v=y.p,x=h.list(r,"",!0);if(g._paperdiv.style({width:r._context.responsive&&g.autosize&&!r._context._hasZeroWidth&&!r.layout.width?"100%":g.width+"px",height:r._context.responsive&&g.autosize&&!r._context._hasZeroHeight&&!r.layout.height?"100%":g.height+"px"}).selectAll(".main-svg").call(l.setSize,g.width,g.height),r._context.setBackground(r,g.paper_bgcolor),e.drawMainTitle(r),u.manage(r),!g._has("cartesian"))return n.previousPromises(r);function b(e,t,r){var n=e._lw/2;return"x"===e._id.charAt(0)?t?"top"===r?t._offset-v-n:t._offset+t._length+v+n:y.t+y.h*(1-(e.position||0))+n%1:t?"right"===r?t._offset+t._length+v+n:t._offset-v-n:y.l+y.w*(e.position||0)+n%1}for(a=0;a<x.length;a++){var k=(d=x[a])._anchorAxis;d._linepositions={},d._lw=l.crispRound(r,d.linewidth,1),d._mainLinePosition=b(d,k,d.side),d._mainMirrorPosition=d.mirror&&k?b(d,k,p.OPPOSITE_SIDE[d.side]):null}var S=[],M=[],E=[],C=1===s.opacity(g.paper_bgcolor)&&1===s.opacity(g.plot_bgcolor)&&g.paper_bgcolor===g.plot_bgcolor;for(o in g._plots)if((c=g._plots[o]).mainplot)c.bg&&c.bg.remove(),c.bg=void 0;else{var P=c.xaxis.domain,L=c.yaxis.domain,I=c.plotgroup;if(w(P,L,E)&&-1===o.indexOf(_)){var z=I.node(),O=c.bg=i.ensureSingle(I,"rect","bg");z.insertBefore(O.node(),z.childNodes[0]),M.push(o)}else I.select("rect.bg").remove(),E.push([P,L]),C||(S.push(o),M.push(o))}var R,D,j,F,B,N,U,V,q,H,G,W,$,Z=g._bgLayer.selectAll(".bg").data(S);for(Z.enter().append("rect").classed("bg",!0),Z.exit().remove(),Z.each((function(e){g._plots[e].bg=t.select(this)})),a=0;a<M.length;a++)c=g._plots[M[a]],f=c.xaxis,m=c.yaxis,c.bg&&void 0!==f._offset&&void 0!==m._offset&&c.bg.call(l.setRect,f._offset-v,m._offset-v,f._length+2*v,m._length+2*v).call(s.fill,g.plot_bgcolor).style("stroke-width",0);if(!g._hasOnlyLargeSploms)for(o in g._plots){c=g._plots[o],f=c.xaxis,m=c.yaxis;var X,Y,K=c.clipId="clip"+g._uid+o+"plot",J=i.ensureSingleById(g._clips,"clipPath",K,(function(e){e.classed("plotclip",!0).append("rect")}));c.clipRect=J.select("rect").attr({width:f._length,height:m._length}),l.setTranslate(c.plot,f._offset,m._offset),c._hasClipOnAxisFalse?(X=null,Y=K):(X=K,Y=null),l.setClipUrl(c.plot,X,r),c.layerClipId=Y}function Q(e){return"M"+R+","+e+"H"+D}function ee(e){return"M"+f._offset+","+e+"h"+f._length}function te(e){return"M"+e+","+V+"V"+U}function re(e){return void 0!==m._shift&&(e+=m._shift),"M"+e+","+m._offset+"v"+m._length}function ne(e,t,r){if(!e.showline||o!==e._mainSubplot)return"";if(!e._anchorAxis)return r(e._mainLinePosition);var n=t(e._mainLinePosition);return e.mirror&&(n+=t(e._mainMirrorPosition)),n}for(o in g._plots){c=g._plots[o],f=c.xaxis,m=c.yaxis;var ie="M0,0";T(f,o)&&(B=A(f,"left",m,x),R=f._offset-(B?v+B:0),N=A(f,"right",m,x),D=f._offset+f._length+(N?v+N:0),j=b(f,m,"bottom"),F=b(f,m,"top"),!($=!f._anchorAxis||o!==f._mainSubplot)||"allticks"!==f.mirror&&"all"!==f.mirror||(f._linepositions[o]=[j,F]),ie=ne(f,Q,ee),$&&f.showline&&("all"===f.mirror||"allticks"===f.mirror)&&(ie+=Q(j)+Q(F)),c.xlines.style("stroke-width",f._lw+"px").call(s.stroke,f.showline?f.linecolor:"rgba(0,0,0,0)")),c.xlines.attr("d",ie);var ae="M0,0";T(m,o)&&(G=A(m,"bottom",f,x),U=m._offset+m._length+(G?v:0),W=A(m,"top",f,x),V=m._offset-(W?v:0),q=b(m,f,"left"),H=b(m,f,"right"),!($=!m._anchorAxis||o!==m._mainSubplot)||"allticks"!==m.mirror&&"all"!==m.mirror||(m._linepositions[o]=[q,H]),ae=ne(m,te,re),$&&m.showline&&("all"===m.mirror||"allticks"===m.mirror)&&(ae+=te(q)+te(H)),c.ylines.style("stroke-width",m._lw+"px").call(s.stroke,m.showline?m.linecolor:"rgba(0,0,0,0)")),c.ylines.attr("d",ae)}return h.makeClipPaths(r),n.previousPromises(r)}function T(e,t){return(e.ticks||e.showline)&&(t===e._mainSubplot||"all"===e.mirror||"allticks"===e.mirror)}function S(e,t,r){if(!r.showline||!r._lw)return!1;if("all"===r.mirror||"allticks"===r.mirror)return!0;var n=r._anchorAxis;if(!n)return!1;var i=p.FROM_BL[t];return r.side===t?n.domain[i]===e.domain[i]:r.mirror&&n.domain[1-i]===e.domain[1-i]}function A(e,t,r,n){if(S(e,t,r))return r._lw;for(var i=0;i<n.length;i++){var a=n[i];if(a._mainAxis===r._mainAxis&&S(e,t,a))return a._lw}return 0}function M(e){return"top"===e?p.CAP_SHIFT+.3+"em":"bottom"===e?"-0.3em":p.MID_SHIFT+"em"}e.layoutStyles=function(e){return i.syncOrAsync([n.doAutoMargin,k],e)},e.drawMainTitle=function(e){var r=e._fullLayout.title,o=e._fullLayout,s=function(e){var t=e.title,r=x;return i.isRightAnchor(t)?r=b:i.isLeftAnchor(t)&&(r=y),r}(o),u=function(e){var t=e.title,r="0em";return i.isTopAnchor(t)?r=p.CAP_SHIFT+"em":i.isMiddleAnchor(t)&&(r=p.MID_SHIFT+"em"),r}(o),h=function(e,t){var r=e.title,n=e._size,i=0;return"0em"!==t&&t?t===p.CAP_SHIFT+"em"&&(i=r.pad.t):i=-r.pad.b,"auto"===r.y?n.t/2:"paper"===r.yref?n.t+n.h-n.h*r.y+i:e.height-e.height*r.y+i}(o,u),d=function(e,t){var r=e.title,n=e._size,i=0;return t===y?i=r.pad.l:t===b&&(i=-r.pad.r),"paper"===r.xref?n.l+n.w*r.x+i:e.width*r.x+i}(o,s);if(c.draw(e,"gtitle",{propContainer:o,propName:"title.text",subtitlePropName:"title.subtitle.text",placeholder:o._dfltTitle.plot,subtitlePlaceholder:o._dfltTitle.subtitle,attributes:{x:d,y:h,"text-anchor":s,dy:u}}),r.text&&r.automargin){var f=t.selectAll(".gtitle"),m=l.bBox(t.selectAll(".g-gtitle").node()).height,g=function(e,t,r){var n=t.y,i=t.yanchor,a=n>.5?"t":"b",o=e._fullLayout.margin[a],s=0;return"paper"===t.yref?s=r+t.pad.t+t.pad.b:"container"===t.yref&&(s=function(e,t,r,n,i){var a=0;return"middle"===r&&(a+=i/2),"t"===e?("top"===r&&(a+=i),a+=n-t*n):("bottom"===r&&(a+=i),a+=t*n),a}(a,n,i,e._fullLayout.height,r)+t.pad.t+t.pad.b),s>o?s:0}(e,r,m);if(g>0){!function(e,t,r,a){var o="title.automargin",s=e._fullLayout.title,l=s.y>.5?"t":"b",c={x:s.x,y:s.y,t:0,b:0},u={};"paper"===s.yref&&function(e,t,r,n,a){var o="paper"===t.yref?e._fullLayout._size.h:e._fullLayout.height,s=i.isTopAnchor(t)?n:n-a,l="b"===r?o-s:s;return!(i.isTopAnchor(t)&&"t"===r||i.isBottomAnchor(t)&&"b"===r)&&l<a}(e,s,l,t,a)?c[l]=r:"container"===s.yref&&(u[l]=r,e._fullLayout._reservedMargin[o]=u),n.allowAutoMargin(e,o),n.autoMargin(e,o,c)}(e,h,g,m),f.attr({x:d,y:h,"text-anchor":s,dy:M(r.yanchor)}).call(a.positionText,d,h);var v=(r.text.match(a.BR_TAG_ALL)||[]).length;if(v){var _=p.LINE_SPACING*v+p.MID_SHIFT;0===r.y&&(_=-_),f.selectAll(".line").each((function(){var e=+this.getAttribute("dy").slice(0,-2)-_+"em";this.setAttribute("dy",e)}))}var w=t.selectAll(".gtitle-subtitle");if(w.node()){var k=f.node().getBBox(),T=k.y+k.height+c.SUBTITLE_PADDING_EM*r.subtitle.font.size;w.attr({x:d,y:T,"text-anchor":s,dy:M(r.yanchor)}).call(a.positionText,d,T)}}}},e.doTraceStyle=function(t){var i,a=t.calcdata,s=[];for(i=0;i<a.length;i++){var l=a[i],c=l[0]||{},u=c.trace||{},h=u._module||{},p=h.arraysToCalcdata;p&&p(l,u);var d=h.editStyle;d&&s.push({fn:d,cd0:c})}if(s.length){for(i=0;i<s.length;i++){var f=s[i];f.fn(t,f.cd0)}o(t),e.redrawReglTraces(t)}return n.style(t),r.getComponentMethod("legend","draw")(t),n.previousPromises(t)},e.doColorBars=function(e){return r.getComponentMethod("colorbar","draw")(e),n.previousPromises(e)},e.layoutReplot=function(e){var t=e.layout;return e.layout=void 0,r.call("_doPlot",e,"",t)},e.doLegend=function(e){return r.getComponentMethod("legend","draw")(e),n.previousPromises(e)},e.doTicksRelayout=function(t){return h.draw(t,"redraw"),t._fullLayout._hasOnlyLargeSploms&&(r.subplotsRegistry.splom.updateGrid(t),o(t),e.redrawReglTraces(t)),e.drawMainTitle(t),n.previousPromises(t)},e.doModeBar=function(e){var t=e._fullLayout;u.manage(e);for(var r=0;r<t._basePlotModules.length;r++){var i=t._basePlotModules[r].updateFx;i&&i(e)}return n.previousPromises(e)},e.doCamera=function(e){for(var t=e._fullLayout,r=t._subplots.gl3d,n=0;n<r.length;n++){var i=t[r[n]];i._scene.setViewport(i)}},e.drawData=function(t){var i=t._fullLayout;o(t);for(var a=i._basePlotModules,s=0;s<a.length;s++)a[s].plot(t);return e.redrawReglTraces(t),n.style(t),r.getComponentMethod("selections","draw")(t),r.getComponentMethod("shapes","draw")(t),r.getComponentMethod("annotations","draw")(t),r.getComponentMethod("images","draw")(t),i._replotting=!1,n.previousPromises(t)},e.redrawReglTraces=function(e){var t=e._fullLayout;if(t._has("regl")){var r,n,a=e._fullData,o=[],s=[];for(t._hasOnlyLargeSploms&&t._splomGrid.draw(),r=0;r<a.length;r++){var l=a[r];!0===l.visible&&0!==l._length&&("splom"===l.type?t._splomScenes[l.uid].draw():"scattergl"===l.type?i.pushUnique(o,l.xaxis+l.yaxis):"scatterpolargl"===l.type&&i.pushUnique(s,l.subplot))}for(r=0;r<o.length;r++)(n=t._plots[o[r]])._scene&&n._scene.draw();for(r=0;r<s.length;r++)(n=t[s[r]]._subplot)._scene&&n._scene.draw()}},e.doAutoRangeAndConstraints=function(e){for(var t,r=h.list(e,"",!0),n={},i=0;i<r.length;i++)if(!n[(t=r[i])._id]){n[t._id]=1,m(e,t),g(e,t);var a=t._matchGroup;if(a)for(var o in a){var s=h.getFromId(e,o);g(e,s,t.range),n[o]=1}}f(e)},e.finalDraw=function(e){r.getComponentMethod("rangeslider","draw")(e),r.getComponentMethod("rangeselector","draw")(e)},e.drawMarginPushers=function(e){r.getComponentMethod("legend","draw")(e),r.getComponentMethod("rangeselector","draw")(e),r.getComponentMethod("sliders","draw")(e),r.getComponentMethod("updatemenus","draw")(e),r.getComponentMethod("colorbar","draw")(e)}}}),nn=p({"src/components/selections/draw.js"(e,t){var r=Br().readPaths,n=Gr(),i=xt().clearOutlineControllers,a=q(),o=Jt(),s=gt().arrayEditor,l=qr(),c=l.getPathString;function u(e){var t=e._fullLayout;for(var r in i(e),t._selectionLayer.selectAll("path").remove(),t._plots){var n=t._plots[r].selectionLayer;n&&n.selectAll("path").remove()}for(var a=0;a<t.selections.length;a++)p(e,a)}function h(e){return e._context.editSelection}function p(e,t){e._fullLayout._paperdiv.selectAll('.selectionlayer [data-index="'+t+'"]').remove();var i=l.makeSelectionsOptionsAndPlotinfo(e,t),p=i.options,m=i.plotinfo;p._input&&function(i){var l=c(e,p),g={"data-index":t,"fill-rule":"evenodd",d:l},y=p.opacity,v="rgba(0,0,0,0)",x=p.line.color||a.contrast(e._fullLayout.plot_bgcolor),b=p.line.width,_=p.line.dash;b||(b=5,_="solid");var w=h(e)&&e._fullLayout._activeSelectionIndex===t;w&&(v=e._fullLayout.activeselection.fillcolor,y=e._fullLayout.activeselection.opacity);for(var k=[],T=1;T>=0;T--){var S=i.append("path").attr(g).style("opacity",T?.1:y).call(a.stroke,x).call(a.fill,v).call(o.dashLine,T?"solid":_,T?4+b:b);if(d(S,e,p),w){var A=s(e.layout,"selections",p);S.style({cursor:"move"});var M={element:S.node(),plotinfo:m,gd:e,editHelpers:A,isActiveSelection:!0},E=r(l,e);n(E,S,M)}else S.style("pointer-events",T?"all":"none");k[T]=S}var C=k[0];k[1].node().addEventListener("click",(function(){return function(e,t){if(h(e)){var r=t.node(),n=+r.getAttribute("data-index");if(n>=0){if(n===e._fullLayout._activeSelectionIndex)return void f(e);e._fullLayout._activeSelectionIndex=n,e._fullLayout._deactivateSelection=f,u(e)}}}(e,C)}))}(e._fullLayout._selectionLayer)}function d(e,t,r){var n=r.xref+r.yref;o.setClipUrl(e,"clip"+t._fullLayout._uid+n,t)}function f(e){h(e)&&e._fullLayout._activeSelectionIndex>=0&&(i(e),delete e._fullLayout._activeSelectionIndex,u(e))}t.exports={draw:u,drawOne:p,activateLastSelection:function(e){if(h(e)){var t=e._fullLayout.selections.length-1;e._fullLayout._activeSelectionIndex=t,e._fullLayout._deactivateSelection=f,u(e)}}}}}),an=p({"node_modules/polybooljs/lib/build-log.js"(e,t){t.exports=function(){var e,t=0,r=!1;function n(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}return e={list:[],segmentId:function(){return t++},checkIntersection:function(e,t){return n("check",{seg1:e,seg2:t})},segmentChop:function(e,t){return n("div_seg",{seg:e,pt:t}),n("chop",{seg:e,pt:t})},statusRemove:function(e){return n("pop_seg",{seg:e})},segmentUpdate:function(e){return n("seg_update",{seg:e})},segmentNew:function(e,t){return n("new_seg",{seg:e,primary:t})},segmentRemove:function(e){return n("rem_seg",{seg:e})},tempStatus:function(e,t,r){return n("temp_status",{seg:e,above:t,below:r})},rewind:function(e){return n("rewind",{seg:e})},status:function(e,t,r){return n("status",{seg:e,above:t,below:r})},vert:function(t){return t===r?e:(r=t,n("vert",{x:t}))},log:function(e){return"string"!==typeof e&&(e=JSON.stringify(e,!1," ")),n("log",{txt:e})},reset:function(){return n("reset")},selected:function(e){return n("selected",{segs:e})},chainStart:function(e){return n("chain_start",{seg:e})},chainRemoveHead:function(e,t){return n("chain_rem_head",{index:e,pt:t})},chainRemoveTail:function(e,t){return n("chain_rem_tail",{index:e,pt:t})},chainNew:function(e,t){return n("chain_new",{pt1:e,pt2:t})},chainMatch:function(e){return n("chain_match",{index:e})},chainClose:function(e){return n("chain_close",{index:e})},chainAddHead:function(e,t){return n("chain_add_head",{index:e,pt:t})},chainAddTail:function(e,t){return n("chain_add_tail",{index:e,pt:t})},chainConnect:function(e,t){return n("chain_con",{index1:e,index2:t})},chainReverse:function(e){return n("chain_rev",{index:e})},chainJoin:function(e,t){return n("chain_join",{index1:e,index2:t})},done:function(){return n("done")}}}}}),on=p({"node_modules/polybooljs/lib/epsilon.js"(e,t){t.exports=function(e){"number"!==typeof e&&(e=1e-10);var t={epsilon:function(t){return"number"===typeof t&&(e=t),e},pointAboveOrOnLine:function(t,r,n){var i=r[0],a=r[1],o=n[0],s=n[1],l=t[0];return(o-i)*(t[1]-a)-(s-a)*(l-i)>=-e},pointBetween:function(t,r,n){var i=t[1]-r[1],a=n[0]-r[0],o=t[0]-r[0],s=n[1]-r[1],l=o*a+i*s;return!(l<e)&&!(l-(a*a+s*s)>-e)},pointsSameX:function(t,r){return Math.abs(t[0]-r[0])<e},pointsSameY:function(t,r){return Math.abs(t[1]-r[1])<e},pointsSame:function(e,r){return t.pointsSameX(e,r)&&t.pointsSameY(e,r)},pointsCompare:function(e,r){return t.pointsSameX(e,r)?t.pointsSameY(e,r)?0:e[1]<r[1]?-1:1:e[0]<r[0]?-1:1},pointsCollinear:function(t,r,n){var i=t[0]-r[0],a=t[1]-r[1],o=r[0]-n[0],s=r[1]-n[1];return Math.abs(i*s-o*a)<e},linesIntersect:function(t,r,n,i){var a=r[0]-t[0],o=r[1]-t[1],s=i[0]-n[0],l=i[1]-n[1],c=a*l-o*s;if(Math.abs(c)<e)return!1;var u=t[0]-n[0],h=t[1]-n[1],p=(s*h-l*u)/c,d=(a*h-o*u)/c,f={alongA:0,alongB:0,pt:[t[0]+p*a,t[1]+p*o]};return f.alongA=p<=-e?-2:p<e?-1:p-1<=-e?0:p-1<e?1:2,f.alongB=d<=-e?-2:d<e?-1:d-1<=-e?0:d-1<e?1:2,f},pointInsideRegion:function(t,r){for(var n=t[0],i=t[1],a=r[r.length-1][0],o=r[r.length-1][1],s=!1,l=0;l<r.length;l++){var c=r[l][0],u=r[l][1];u-i>e!=o-i>e&&(a-c)*(i-u)/(o-u)+c-n>e&&(s=!s),a=c,o=u}return s}};return t}}}),sn=p({"node_modules/polybooljs/lib/linked-list.js"(e,t){t.exports={create:function(){var e={root:{root:!0,next:null},exists:function(t){return null!==t&&t!==e.root},isEmpty:function(){return null===e.root.next},getHead:function(){return e.root.next},insertBefore:function(t,r){for(var n=e.root,i=e.root.next;null!==i;){if(r(i))return t.prev=i.prev,t.next=i,i.prev.next=t,void(i.prev=t);n=i,i=i.next}n.next=t,t.prev=n,t.next=null},findTransition:function(t){for(var r=e.root,n=e.root.next;null!==n&&!t(n);)r=n,n=n.next;return{before:r===e.root?null:r,after:n,insert:function(e){return e.prev=r,e.next=n,r.next=e,null!==n&&(n.prev=e),e}}}};return e},node:function(e){return e.prev=null,e.next=null,e.remove=function(){e.prev.next=e.next,e.next&&(e.next.prev=e.prev),e.prev=null,e.next=null},e}}}}),ln=p({"node_modules/polybooljs/lib/intersecter.js"(e,t){var r=sn();t.exports=function(e,t,n){function i(e,t,r){return{id:n?n.segmentId():-1,start:e,end:t,myFill:{above:r.myFill.above,below:r.myFill.below},otherFill:null}}var a=r.create();function o(e,r){a.insertBefore(e,(function(n){return function(e,r,n,i,a,o){var s=t.pointsCompare(r,a);return 0!==s?s:t.pointsSame(n,o)?0:e!==i?e?1:-1:t.pointAboveOrOnLine(n,i?a:o,i?o:a)?1:-1}(e.isStart,e.pt,r,n.isStart,n.pt,n.other.pt)<0}))}function s(e,t){var n=function(e,t){var n=r.node({isStart:!0,pt:e.start,seg:e,primary:t,other:null,status:null});return o(n,e.end),n}(e,t);return function(e,t,n){var i=r.node({isStart:!1,pt:t.end,seg:t,primary:n,other:e,status:null});e.other=i,o(i,e.pt)}(n,e,t),n}function l(e,t){var r=i(t,e.seg.end,e.seg);return function(e,t){n&&n.segmentChop(e.seg,t),e.other.remove(),e.seg.end=t,e.other.pt=t,o(e.other,e.pt)}(e,t),s(r,e.primary)}function c(i,o){var s=r.create();function c(e){return s.findTransition((function(r){var n=function(e,r){var n=e.seg.start,i=e.seg.end,a=r.seg.start,o=r.seg.end;return t.pointsCollinear(n,a,o)?t.pointsCollinear(i,a,o)||t.pointAboveOrOnLine(i,a,o)?1:-1:t.pointAboveOrOnLine(n,a,o)?1:-1}(e,r.ev);return n>0}))}function u(e,r){var i=e.seg,a=r.seg,o=i.start,s=i.end,c=a.start,u=a.end;n&&n.checkIntersection(i,a);var h=t.linesIntersect(o,s,c,u);if(!1===h){if(!t.pointsCollinear(o,s,c))return!1;if(t.pointsSame(o,u)||t.pointsSame(s,c))return!1;var p=t.pointsSame(o,c),d=t.pointsSame(s,u);if(p&&d)return r;var f=!p&&t.pointBetween(o,c,u),m=!d&&t.pointBetween(s,c,u);if(p)return m?l(r,s):l(e,u),r;f&&(d||(m?l(r,s):l(e,u)),l(r,o))}else 0===h.alongA&&(-1===h.alongB?l(e,c):0===h.alongB?l(e,h.pt):1===h.alongB&&l(e,u)),0===h.alongB&&(-1===h.alongA?l(r,o):0===h.alongA?l(r,h.pt):1===h.alongA&&l(r,s));return!1}for(var h=[];!a.isEmpty();){var p=a.getHead();if(n&&n.vert(p.pt[0]),p.isStart){let t=function(){if(f){var e=u(p,f);if(e)return e}return!!m&&u(p,m)};n&&n.segmentNew(p.seg,p.primary);var d=c(p),f=d.before?d.before.ev:null,m=d.after?d.after.ev:null;n&&n.tempStatus(p.seg,!!f&&f.seg,!!m&&m.seg);var g,y,v=t();if(v)e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below)&&(v.seg.myFill.above=!v.seg.myFill.above):v.seg.otherFill=p.seg.myFill,n&&n.segmentUpdate(v.seg),p.other.remove(),p.remove();if(a.getHead()!==p){n&&n.rewind(p.seg);continue}e?(y=null===p.seg.myFill.below||p.seg.myFill.above!==p.seg.myFill.below,p.seg.myFill.below=m?m.seg.myFill.above:i,p.seg.myFill.above=y?!p.seg.myFill.below:p.seg.myFill.below):null===p.seg.otherFill&&(g=m?p.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:p.primary?o:i,p.seg.otherFill={above:g,below:g}),n&&n.status(p.seg,!!f&&f.seg,!!m&&m.seg),p.other.status=d.insert(r.node({ev:p}))}else{var x=p.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(s.exists(x.prev)&&s.exists(x.next)&&u(x.prev.ev,x.next.ev),n&&n.statusRemove(x.ev.seg),x.remove(),!p.primary){var b=p.seg.myFill;p.seg.myFill=p.seg.otherFill,p.seg.otherFill=b}h.push(p.seg)}a.getHead().remove()}return n&&n.done(),h}return e?{addRegion:function(e){for(var r,i,a,o=e[e.length-1],l=0;l<e.length;l++){r=o,o=e[l];var c=t.pointsCompare(r,o);0!==c&&s((i=c<0?r:o,a=c<0?o:r,{id:n?n.segmentId():-1,start:i,end:a,myFill:{above:null,below:null},otherFill:null}),!0)}},calculate:function(e){return c(e,!1)}}:{calculate:function(e,t,r,n){return e.forEach((function(e){s(i(e.start,e.end,e),!0)})),r.forEach((function(e){s(i(e.start,e.end,e),!1)})),c(t,n)}}}}}),cn=p({"node_modules/polybooljs/lib/segment-chainer.js"(e,t){t.exports=function(e,t,r){var n=[],i=[];return e.forEach((function(e){var a=e.start,o=e.end;if(t.pointsSame(a,o))console.warn("PolyBool: Warning: Zero-length segment detected; your epsilon is probably too small or too large");else{r&&r.chainStart(e);for(var s={index:0,matches_head:!1,matches_pt1:!1},l={index:0,matches_head:!1,matches_pt1:!1},c=s,u=0;u<n.length;u++){var h=(g=n[u])[0],p=(g[1],g[g.length-1]);if(g[g.length-2],t.pointsSame(h,a)){if(T(u,!0,!0))break}else if(t.pointsSame(h,o)){if(T(u,!0,!1))break}else if(t.pointsSame(p,a)){if(T(u,!1,!0))break}else if(t.pointsSame(p,o)&&T(u,!1,!1))break}if(c===s)return n.push([a,o]),void(r&&r.chainNew(a,o));if(c===l){r&&r.chainMatch(s.index);var d=s.index,f=s.matches_pt1?o:a,m=s.matches_head,g=n[d],y=m?g[0]:g[g.length-1],v=m?g[1]:g[g.length-2],x=m?g[g.length-1]:g[0],b=m?g[g.length-2]:g[1];return t.pointsCollinear(v,y,f)&&(m?(r&&r.chainRemoveHead(s.index,f),g.shift()):(r&&r.chainRemoveTail(s.index,f),g.pop()),y=v),t.pointsSame(x,f)?(n.splice(d,1),t.pointsCollinear(b,x,y)&&(m?(r&&r.chainRemoveTail(s.index,y),g.pop()):(r&&r.chainRemoveHead(s.index,y),g.shift())),r&&r.chainClose(s.index),void i.push(g)):void(m?(r&&r.chainAddHead(s.index,f),g.unshift(f)):(r&&r.chainAddTail(s.index,f),g.push(f)))}var _=s.index,w=l.index;r&&r.chainConnect(_,w);var k=n[_].length<n[w].length;s.matches_head?l.matches_head?k?(S(_),A(_,w)):(S(w),A(w,_)):A(w,_):l.matches_head?A(_,w):k?(S(_),A(w,_)):(S(w),A(_,w))}function T(e,t,r){return c.index=e,c.matches_head=t,c.matches_pt1=r,c===s?(c=l,!1):(c=null,!0)}function S(e){r&&r.chainReverse(e),n[e].reverse()}function A(e,i){var a=n[e],o=n[i],s=a[a.length-1],l=a[a.length-2],c=o[0],u=o[1];t.pointsCollinear(l,s,c)&&(r&&r.chainRemoveTail(e,s),a.pop(),s=l),t.pointsCollinear(s,c,u)&&(r&&r.chainRemoveHead(i,c),o.shift()),r&&r.chainJoin(e,i),n[e]=a.concat(o),n.splice(i,1)}})),i}}}),un=p({"node_modules/polybooljs/lib/segment-selector.js"(e,t){function r(e,t,r){var n=[];return e.forEach((function(e){var i=(e.myFill.above?8:0)+(e.myFill.below?4:0)+(e.otherFill&&e.otherFill.above?2:0)+(e.otherFill&&e.otherFill.below?1:0);0!==t[i]&&n.push({id:r?r.segmentId():-1,start:e.start,end:e.end,myFill:{above:1===t[i],below:2===t[i]},otherFill:null})})),r&&r.selected(n),n}var n={union:function(e,t){return r(e,[0,2,1,0,2,2,0,0,1,0,1,0,0,0,0,0],t)},intersect:function(e,t){return r(e,[0,0,0,0,0,2,0,2,0,0,1,1,0,2,1,0],t)},difference:function(e,t){return r(e,[0,0,0,0,2,0,2,0,1,1,0,0,0,1,2,0],t)},differenceRev:function(e,t){return r(e,[0,2,1,0,0,0,1,1,0,2,0,2,0,0,0,0],t)},xor:function(e,t){return r(e,[0,2,1,0,2,0,0,1,1,0,0,2,0,1,2,0],t)}};t.exports=n}}),hn=p({"node_modules/polybooljs/lib/geojson.js"(e,t){var r={toPolygon:function(e,t){function r(t){if(t.length<=0)return e.segments({inverted:!1,regions:[]});function r(t){var r=t.slice(0,t.length-1);return e.segments({inverted:!1,regions:[r]})}for(var n=r(t[0]),i=1;i<t.length;i++)n=e.selectDifference(e.combine(n,r(t[i])));return n}if("Polygon"===t.type)return e.polygon(r(t.coordinates));if("MultiPolygon"===t.type){for(var n=e.segments({inverted:!1,regions:[]}),i=0;i<t.coordinates.length;i++)n=e.selectUnion(e.combine(n,r(t.coordinates[i])));return e.polygon(n)}throw new Error("PolyBool: Cannot convert GeoJSON object to PolyBool polygon")},fromPolygon:function(e,t,r){function n(e,r){return t.pointInsideRegion([.5*(e[0][0]+e[1][0]),.5*(e[0][1]+e[1][1])],r)}function i(e){return{region:e,children:[]}}r=e.polygon(e.segments(r));var a=i(null);function o(e,t){for(var r=0;r<e.children.length;r++)if(n(t,(s=e.children[r]).region))return void o(s,t);var a=i(t);for(r=0;r<e.children.length;r++){var s;n((s=e.children[r]).region,t)&&(a.children.push(s),e.children.splice(r,1),r--)}e.children.push(a)}for(var s=0;s<r.regions.length;s++){var l=r.regions[s];l.length<3||o(a,l)}function c(e,t){for(var r=0,n=e[e.length-1][0],i=e[e.length-1][1],a=[],o=0;o<e.length;o++){var s=e[o][0],l=e[o][1];a.push([s,l]),r+=l*n-s*i,n=s,i=l}return r<0!==t&&a.reverse(),a.push([a[0][0],a[0][1]]),a}var u=[];function h(e){var t=[c(e.region,!1)];u.push(t);for(var r=0;r<e.children.length;r++)t.push(p(e.children[r]))}function p(e){for(var t=0;t<e.children.length;t++)h(e.children[t]);return c(e.region,!0)}for(s=0;s<a.children.length;s++)h(a.children[s]);return u.length<=0?{type:"Polygon",coordinates:[]}:1==u.length?{type:"Polygon",coordinates:u[0]}:{type:"MultiPolygon",coordinates:u}}};t.exports=r}}),pn=p({"node_modules/polybooljs/index.js"(e,t){var r,n=an(),i=on(),a=ln(),o=cn(),s=un(),l=hn(),c=!1,u=i();function h(e,t,n){var i=r.segments(e),a=r.segments(t),o=n(r.combine(i,a));return r.polygon(o)}r={buildLog:function(e){return!0===e?c=n():!1===e&&(c=!1),!1!==c&&c.list},epsilon:function(e){return u.epsilon(e)},segments:function(e){var t=a(!0,u,c);return e.regions.forEach(t.addRegion),{segments:t.calculate(e.inverted),inverted:e.inverted}},combine:function(e,t){return{combined:a(!1,u,c).calculate(e.segments,e.inverted,t.segments,t.inverted),inverted1:e.inverted,inverted2:t.inverted}},selectUnion:function(e){return{segments:s.union(e.combined,c),inverted:e.inverted1||e.inverted2}},selectIntersect:function(e){return{segments:s.intersect(e.combined,c),inverted:e.inverted1&&e.inverted2}},selectDifference:function(e){return{segments:s.difference(e.combined,c),inverted:e.inverted1&&!e.inverted2}},selectDifferenceRev:function(e){return{segments:s.differenceRev(e.combined,c),inverted:!e.inverted1&&e.inverted2}},selectXor:function(e){return{segments:s.xor(e.combined,c),inverted:e.inverted1!==e.inverted2}},polygon:function(e){return{regions:o(e.segments,u,c),inverted:e.inverted}},polygonFromGeoJSON:function(e){return l.toPolygon(r,e)},polygonToGeoJSON:function(e){return l.fromPolygon(r,u,e)},union:function(e,t){return h(e,t,r.selectUnion)},intersect:function(e,t){return h(e,t,r.selectIntersect)},difference:function(e,t){return h(e,t,r.selectDifference)},differenceRev:function(e,t){return h(e,t,r.selectDifferenceRev)},xor:function(e,t){return h(e,t,r.selectXor)}},"object"===typeof window&&(window.PolyBool=r),t.exports=r}}),dn=p({"node_modules/point-in-polygon/nested.js"(e,t){t.exports=function(e,t,r,n){var i=e[0],a=e[1],o=!1;void 0===r&&(r=0),void 0===n&&(n=t.length);for(var s=n-r,l=0,c=s-1;l<s;c=l++){var u=t[l+r][0],h=t[l+r][1],p=t[c+r][0],d=t[c+r][1];h>a!==d>a&&i<(p-u)*(a-h)/(d-h)+u&&(o=!o)}return o}}}),fn=p({"src/lib/polygon.js"(e,t){var r=Ee().dot,n=T().BADNUM,i=t.exports={};i.tester=function(e){var t,r=e.slice(),i=r[0][0],a=i,o=r[0][1],s=o;for(r[r.length-1][0]===r[0][0]&&r[r.length-1][1]===r[0][1]||r.push(r[0]),t=1;t<r.length;t++)i=Math.min(i,r[t][0]),a=Math.max(a,r[t][0]),o=Math.min(o,r[t][1]),s=Math.max(s,r[t][1]);var l,c=!1;5===r.length&&(r[0][0]===r[1][0]?r[2][0]===r[3][0]&&r[0][1]===r[3][1]&&r[1][1]===r[2][1]&&(c=!0,l=function(e){return e[0]===r[0][0]}):r[0][1]===r[1][1]&&r[2][1]===r[3][1]&&r[0][0]===r[3][0]&&r[1][0]===r[2][0]&&(c=!0,l=function(e){return e[1]===r[0][1]}));var u=!0,h=r[0];for(t=1;t<r.length;t++)if(h[0]!==r[t][0]||h[1]!==r[t][1]){u=!1;break}return{xmin:i,xmax:a,ymin:o,ymax:s,pts:r,contains:c?function(e,t){var r=e[0],c=e[1];return!(r===n||r<i||r>a||c===n||c<o||c>s)&&(!t||!l(e))}:function(e,t){var l=e[0],c=e[1];if(l===n||l<i||l>a||c===n||c<o||c>s)return!1;var u,h,p,d,f,m=r.length,g=r[0][0],y=r[0][1],v=0;for(u=1;u<m;u++)if(h=g,p=y,g=r[u][0],y=r[u][1],!(l<(d=Math.min(h,g))||l>Math.max(h,g)||c>Math.max(p,y)))if(c<Math.min(p,y))l!==d&&v++;else{if(c===(f=g===h?c:p+(l-h)*(y-p)/(g-h)))return 1!==u||!t;c<=f&&l!==d&&v++}return v%2===1},isRect:c,degenerate:u}},i.isSegmentBent=function(e,t,n,i){var a,o,s,l=e[t],c=[e[n][0]-l[0],e[n][1]-l[1]],u=r(c,c),h=Math.sqrt(u),p=[-c[1]/h,c[0]/h];for(a=t+1;a<n;a++)if(o=[e[a][0]-l[0],e[a][1]-l[1]],(s=r(o,c))<0||s>u||Math.abs(r(o,p))>i)return!0;return!1},i.filter=function(e,t){var r=[e[0]],n=0,a=0;function o(o){e.push(o);var s=r.length,l=n;r.splice(a+1);for(var c=l+1;c<e.length;c++)(c===e.length-1||i.isSegmentBent(e,l,c+1,t))&&(r.push(e[c]),r.length<s-2&&(n=c,a=r.length-1),l=c)}return e.length>1&&o(e.pop()),{addPt:o,raw:e,filtered:r}}}}),mn=p({"src/components/selections/constants.js"(e,t){t.exports={BENDPX:1.5,MINSELECT:12,SELECTDELAY:100,SELECTID:"-select"}}}),gn=p({"src/components/selections/select.js"(e,t){var r=pn(),n=dn(),i=Ve(),a=Jt().dashStyle,o=q(),s=zr(),l=Xt().makeEventData,c=Or(),u=c.freeMode,h=c.rectMode,p=c.drawMode,d=c.openMode,f=c.selectMode,m=qr(),g=Vr(),y=Gr(),v=xt().clearOutline,x=Br(),b=x.handleEllipse,_=x.readPaths,w=Nr().newShapes,k=Ur(),T=nn().activateLastSelection,S=st(),A=S.sorterAsc,M=fn(),E=Ke(),C=vt().getFromId,P=Rr(),L=rn().redrawReglTraces,I=mn(),z=I.MINSELECT,O=M.filter,R=M.tester,D=Fr(),j=D.p2r,F=D.axValue,B=D.getTransform;function N(e){return void 0!==e.subplot}function U(e,t,r,n,i,a,o){var s,l,c,u,h,p,f,m,g,v=t._hoverdata,x=t._fullLayout.clickmode.indexOf("event")>-1,b=[];if(function(e){return e&&Array.isArray(e)&&!0!==e[0].hoverOnBox}(v)){W(e,t,a);var _=function(e,t){var r,n,i=e[0],a=-1,o=[];for(n=0;n<t.length;n++)if(r=t[n],i.fullData.index===r.cd[0].trace.index){if(!0===i.hoverOnBox)break;void 0!==i.pointNumber?a=i.pointNumber:void 0!==i.binNumber&&(a=i.binNumber,o=i.pointNumbers);break}return{pointNumber:a,pointNumbers:o,searchInfo:r}}(v,s=X(t,r,n,i));if(_.pointNumbers.length>0?function(e,t){var r,n,i,a=[];for(i=0;i<e.length;i++)(r=e[i]).cd[0].trace.selectedpoints&&r.cd[0].trace.selectedpoints.length>0&&a.push(r);if(1===a.length&&a[0]===t.searchInfo&&(n=t.searchInfo.cd[0].trace).selectedpoints.length===t.pointNumbers.length){for(i=0;i<t.pointNumbers.length;i++)if(n.selectedpoints.indexOf(t.pointNumbers[i])<0)return!1;return!0}return!1}(s,_):function(e){var t,r,n=0;for(r=0;r<e.length;r++)if((t=e[r].cd[0].trace).selectedpoints){if(t.selectedpoints.length>1)return!1;if((n+=t.selectedpoints.length)>1)return!1}return 1===n}(s)&&(p=K(_))){for(o&&o.remove(),g=0;g<s.length;g++)(l=s[g])._module.selectPoints(l,!1);J(t,s),$(a),x&&pe(t)}else{for(f=e.shiftKey&&(void 0!==p?p:K(_)),c=function(e,t,r){return{pointNumber:e,searchInfo:t,subtract:!!r}}(_.pointNumber,_.searchInfo,f),u=G(a.selectionDefs.concat([c])),g=0;g<s.length;g++)if(h=ee(s[g]._module.selectPoints(s[g],u),s[g]),b.length)for(var w=0;w<h.length;w++)b.push(h[w]);else b=h;if(J(t,s,m={points:b}),c&&a&&a.selectionDefs.push(c),o){var k=a.mergedPolygons,T=d(a.dragmode);y(te(k,T),o,a)}x&&he(t,m)}}}function V(e){return"pointNumber"in e&&"searchInfo"in e}function H(e){return{xmin:0,xmax:0,ymin:0,ymax:0,pts:[],contains:function(t,r,n,i){var a=e.searchInfo.cd[0].trace.index;return i.cd[0].trace.index===a&&n===e.pointNumber},isRect:!1,degenerate:!1,subtract:!!e.subtract}}function G(e){if(e.length){for(var t=[],r=V(e[0])?0:e[0][0][0],n=r,i=V(e[0])?0:e[0][0][1],a=i,o=0;o<e.length;o++)if(V(e[o]))t.push(H(e[o]));else{var s=R(e[o]);s.subtract=!!e[o].subtract,t.push(s),r=Math.min(r,s.xmin),n=Math.max(n,s.xmax),i=Math.min(i,s.ymin),a=Math.max(a,s.ymax)}return{xmin:r,xmax:n,ymin:i,ymax:a,pts:[],contains:function(e,r,n,i){for(var a=!1,o=0;o<t.length;o++)t[o].contains(e,r,n,i)&&(a=!t[o].subtract);return a},isRect:!1,degenerate:!1}}}function W(e,t,r){var n=t._fullLayout,i=r.plotinfo,a=r.dragmode,o=n._lastSelectedSubplot&&n._lastSelectedSubplot===i.id,s=(e.shiftKey||e.altKey)&&!(p(a)&&d(a));o&&s&&i.selection&&i.selection.selectionDefs&&!r.selectionDefs?(r.selectionDefs=i.selection.selectionDefs,r.mergedPolygons=i.selection.mergedPolygons):s&&i.selection||$(r),o||(v(t),n._lastSelectedSubplot=i.id)}function $(e,t){var r=e.dragmode,n=e.plotinfo,a=e.gd;(function(e){return e._fullLayout._activeShapeIndex>=0})(a)&&a._fullLayout._deactivateShape(a),function(e){return e._fullLayout._activeSelectionIndex>=0}(a)&&a._fullLayout._deactivateSelection(a);var o=a._fullLayout._zoomlayer,s=p(r),l=f(r);if(s||l){var c,u,h=o.selectAll(".select-outline-"+n.id);h&&a._fullLayout._outlining&&(s&&(c=w(h,e)),c&&i.call("_guiRelayout",a,{shapes:c}),l&&!N(e)&&(u=k(h,e)),u&&(a._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",a,{selections:u}).then((function(){t&&T(a)}))),a._fullLayout._outlining=!1)}n.selection={},n.selection.selectionDefs=e.selectionDefs=[],n.selection.mergedPolygons=e.mergedPolygons=[]}function Z(e){return e._id}function X(e,t,r,n){if(!e.calcdata)return[];var i,a,o,s=[],l=t.map(Z),c=r.map(Z);for(o=0;o<e.calcdata.length;o++)if(!0===(a=(i=e.calcdata[o])[0].trace).visible&&a._module&&a._module.selectPoints)if(!N({subplot:n})||a.subplot!==n&&a.geo!==n)if("splom"===a.type){if(a._xaxes[l[0]]&&a._yaxes[c[0]]){var u=Y(a._module,i,t[0],r[0]);u.scene=e._fullLayout._splomScenes[a.uid],s.push(u)}}else if("sankey"===a.type){var h=Y(a._module,i,t[0],r[0]);s.push(h)}else{if(-1===l.indexOf(a.xaxis)&&(!a._xA||!a._xA.overlaying))continue;if(-1===c.indexOf(a.yaxis)&&(!a._yA||!a._yA.overlaying))continue;s.push(Y(a._module,i,C(e,a.xaxis),C(e,a.yaxis)))}else s.push(Y(a._module,i,t[0],r[0]));return s}function Y(e,t,r,n){return{_module:e,cd:t,xaxis:r,yaxis:n}}function K(e){var t=e.searchInfo.cd[0].trace,r=e.pointNumber,n=e.pointNumbers,i=n.length>0?n[0]:r;return!!t.selectedpoints&&t.selectedpoints.indexOf(i)>-1}function J(e,t,r){var n,a;for(n=0;n<t.length;n++){var o=t[n].cd[0].trace._fullInput,s=e._fullLayout._tracePreGUI[o.uid]||{};void 0===s.selectedpoints&&(s.selectedpoints=o._input.selectedpoints||null)}if(r){var l=r.points||[];for(n=0;n<t.length;n++)(a=t[n].cd[0].trace)._input.selectedpoints=a._fullInput.selectedpoints=[],a._fullInput!==a&&(a.selectedpoints=[]);for(var c=0;c<l.length;c++){var u=l[c],h=u.data,p=u.fullData,d=u.pointIndex,f=u.pointIndices;f?([].push.apply(h.selectedpoints,f),a._fullInput!==a&&[].push.apply(p.selectedpoints,f)):(h.selectedpoints.push(d),a._fullInput!==a&&p.selectedpoints.push(d))}}else for(n=0;n<t.length;n++)delete(a=t[n].cd[0].trace).selectedpoints,delete a._input.selectedpoints,a._fullInput!==a&&delete a._fullInput.selectedpoints;!function(e,t){for(var r=!1,n=0;n<t.length;n++){var a=t[n],o=a.cd;i.traceIs(o[0].trace,"regl")&&(r=!0);var s=a._module,l=s.styleOnSelect||s.style;l&&(l(e,o,o[0].node3),o[0].nodeRangePlot3&&l(e,o,o[0].nodeRangePlot3))}r&&(P(e),L(e))}(e,t)}function Q(e,t,n){for(var i=(n?r.difference:r.union)({regions:e},{regions:[t]}).regions.reverse(),a=0;a<i.length;a++){var o=i[a];o.subtract=se(o,i.slice(0,a))}return i}function ee(e,t){if(Array.isArray(e))for(var r=t.cd,n=t.cd[0].trace,i=0;i<e.length;i++)e[i]=l(e[i],n,r);return e}function te(e,t){for(var r=[],n=0;n<e.length;n++){r[n]=[];for(var i=0;i<e[n].length;i++){r[n][i]=[],r[n][i][0]=i?"L":"M";for(var a=0;a<e[n][i].length;a++)r[n][i].push(e[n][i][a])}t||r[n].push(["Z",r[n][0][1],r[n][0][2]])}return r}function re(e,t){for(var r,n,i=[],a=[],o=0;o<t.length;o++){var s=t[o];n=s._module.selectPoints(s,e),a.push(n),r=ee(n,s),i=i.concat(r)}return i}function ne(e,t,r,n,i){var a,o,s,l=!!n;i&&(a=i.plotinfo,o=i.xaxes[0]._id,s=i.yaxes[0]._id);var c=[],u=[],h=oe(e),d=e._fullLayout;if(a){var m=d._zoomlayer,g=d.dragmode,y=p(g),v=f(g);if(y||v){var x=C(e,o,"x"),b=C(e,s,"y");if(x&&b){var w=m.selectAll(".select-outline-"+a.id);if(w&&e._fullLayout._outlining&&w.length){for(var k=w[0][0].getAttribute("d"),T=_(k,e,a),S=[],A=0;A<T.length;A++){for(var M=T[A],E=[],P=0;P<M.length;P++)E.push([le(x,M[P][1]),le(b,M[P][2])]);E.xref=o,E.yref=s,E.subtract=se(E,S),S.push(E)}h=h.concat(S)}}}}var L=o&&s?[o+s]:d._subplots.cartesian;!function(e){var t=e.calcdata;if(t)for(var r=0;r<t.length;r++){var n=t[r][0].trace,i=e._fullLayout._splomScenes;if(i){var a=i[n.uid];a&&(a.selectBatch=[])}}}(e);for(var I={},z=0;z<L.length;z++){var O=L[z],R=O.indexOf("y"),D=O.slice(0,R),j=O.slice(R),F=o&&s?r:void 0;if(F=ae(h,D,j,F)){var B=n;if(!l){var N=C(e,D,"x"),U=C(e,j,"y");B=X(e,[N],[U],O);for(var V=0;V<B.length;V++){var q=B[V],H=q.cd[0],G=H.trace;if("scattergl"===q._module.name&&!H.t.xpx){var W=G.x,$=G.y,Z=G._length;H.t.xpx=[],H.t.ypx=[];for(var Y=0;Y<Z;Y++)H.t.xpx[Y]=N.c2p(W[Y]),H.t.ypx[Y]=U.c2p($[Y])}"splom"===q._module.name&&(I[G.uid]||(I[G.uid]=!0))}}var K=re(F,B);c=c.concat(K),u=u.concat(B)}}var Q={points:c};J(e,u,Q);var ee=d.clickmode.indexOf("event")>-1&&t;if(!a&&t){var te=oe(e,!0);if(te.length){var ne=te[0].xref,de=te[0].yref;if(ne&&de){var fe=ce(te);ue([C(e,ne,"x"),C(e,de,"y")])(Q,fe)}}e._fullLayout._noEmitSelectedAtStart?e._fullLayout._noEmitSelectedAtStart=!1:ee&&he(e,Q),d._reselect=!1}if(!a&&d._deselect){var me=d._deselect;(function(e,t,r){for(var n=0;n<r.length;n++){var i=r[n];if(i.xaxis&&i.xaxis._id===e&&i.yaxis&&i.yaxis._id===t)return!0}return!1})(o=me.xref,s=me.yref,u)||ie(e,o,s,n),ee&&(Q.points.length?he(e,Q):pe(e)),d._deselect=!1}return{eventData:Q,selectionTesters:r}}function ie(e,t,r,n){n=X(e,[C(e,t,"x")],[C(e,r,"y")],t+r);for(var i=0;i<n.length;i++){var a=n[i];a._module.selectPoints(a,!1)}J(e,n)}function ae(e,t,r,n){for(var i,a=0;a<e.length;a++){var o=e[a];t===o.xref&&r===o.yref&&(i?n=G(i=Q(i,o,!!o.subtract)):(i=[o],n=R(o)))}return n}function oe(e,t){for(var r=[],n=e._fullLayout,i=n.selections,a=i.length,o=0;o<a;o++)if(!t||o===n._activeSelectionIndex){var s=i[o];if(s){var l,c,u,h,p,d=s.xref,f=s.yref,y=C(e,d,"x"),v=C(e,f,"y");if("rect"===s.type){p=[];var x=le(y,s.x0),b=le(y,s.x1),_=le(v,s.y0),w=le(v,s.y1);p=[[x,_],[x,w],[b,w],[b,_]],l=Math.min(x,b),c=Math.max(x,b),u=Math.min(_,w),h=Math.max(_,w),p.xmin=l,p.xmax=c,p.ymin=u,p.ymax=h,p.xref=d,p.yref=f,p.subtract=!1,p.isRect=!0,r.push(p)}else if("path"===s.type)for(var k=s.path.split("Z"),T=[],S=0;S<k.length;S++){var A=k[S];if(A){A+="Z";var M=m.extractPathCoords(A,g.paramIsX,"raw"),E=m.extractPathCoords(A,g.paramIsY,"raw");l=1/0,c=-1/0,u=1/0,h=-1/0,p=[];for(var P=0;P<M.length;P++){var L=le(y,M[P]),I=le(v,E[P]);p.push([L,I]),l=Math.min(L,l),c=Math.max(L,c),u=Math.min(I,u),h=Math.max(I,h)}p.xmin=l,p.xmax=c,p.ymin=u,p.ymax=h,p.xref=d,p.yref=f,p.subtract=se(p,T),T.push(p),r.push(p)}}}}return r}function se(e,t){for(var r=!1,i=0;i<t.length;i++)for(var a=t[i],o=0;o<e.length;o++)if(n(e[o],a)){r=!r;break}return r}function le(e,t){return"date"===e.type&&(t=t.replace("_"," ")),"log"===e.type?e.c2p(t):e.r2p(t,null,e.calendar)}function ce(e){for(var t=e.length,r=[],n=0;n<t;n++){var i=e[n];r=(r=r.concat(i)).concat([i[0]])}return(a=r).isRect=5===a.length&&a[0][0]===a[4][0]&&a[0][1]===a[4][1]&&a[0][0]===a[1][0]&&a[2][0]===a[3][0]&&a[0][1]===a[3][1]&&a[1][1]===a[2][1]||a[0][1]===a[1][1]&&a[2][1]===a[3][1]&&a[0][0]===a[3][0]&&a[1][0]===a[2][0],a.isRect&&(a.xmin=Math.min(a[0][0],a[2][0]),a.xmax=Math.max(a[0][0],a[2][0]),a.ymin=Math.min(a[0][1],a[2][1]),a.ymax=Math.max(a[0][1],a[2][1])),a;var a}function ue(e){return function(t,r){for(var n,i,a=0;a<e.length;a++){var o=e[a],s=o._id,l=s.charAt(0);if(r.isRect){n||(n={});var c=r[l+"min"],u=r[l+"max"];void 0!==c&&void 0!==u&&(n[s]=[j(o,c),j(o,u)].sort(A))}else i||(i={}),i[s]=r.map(F(o))}n&&(t.range=n),i&&(t.lassoPoints=i)}}function he(e,t){t&&(t.selections=(e.layout||{}).selections||[]),e.emit("plotly_selected",t)}function pe(e){e.emit("plotly_deselect",null)}t.exports={reselect:ne,prepSelect:function(e,t,r,n,l){var c=!N(n),m=u(l),g=h(l),v=d(l),x=p(l),_=f(l),w="drawcircle"===l,k="drawline"===l||w,T=n.gd,A=T._fullLayout,M=_&&"immediate"===A.newselection.mode&&c,C=A._zoomlayer,P=n.element.getBoundingClientRect(),L=n.plotinfo,D=B(L),j=t-P.left,F=r-P.top;A._calcInverseTransform(T);var V=S.apply3DTransform(A._invTransform)(j,F);j=V[0],F=V[1];var q,H,Z,Y,K,ee,ae,oe=A._invScaleX,se=A._invScaleY,le=j,de=F,fe="M"+j+","+F,me=n.xaxes[0],ge=n.yaxes[0],ye=me._length,ve=ge._length,xe=e.altKey&&!(p(l)&&v);W(e,T,n),m&&(q=O([[j,F]],I.BENDPX));var be=C.selectAll("path.select-outline-"+L.id).data([1]),_e=x?A.newshape:A.newselection;x&&(n.hasText=_e.label.text||_e.label.texttemplate);var we=x&&!v?_e.fillcolor:"rgba(0,0,0,0)",ke=_e.line.color||(c?o.contrast(T._fullLayout.plot_bgcolor):"#7f7f7f");be.enter().append("path").attr("class","select-outline select-outline-"+L.id).style({opacity:x?_e.opacity/2:1,"stroke-dasharray":a(_e.line.dash,_e.line.width),"stroke-width":_e.line.width+"px","shape-rendering":"crispEdges"}).call(o.stroke,ke).call(o.fill,we).attr("fill-rule","evenodd").classed("cursor-move",!!x).attr("transform",D).attr("d",fe+"Z");var Te=C.append("path").attr("class","zoombox-corners").style({fill:o.background,stroke:o.defaultLine,"stroke-width":1}).attr("transform",D).attr("d","M0,0Z");if(x&&n.hasText){var Se=C.select(".label-temp");Se.empty()&&(Se=C.append("g").classed("label-temp",!0).classed("select-outline",!0).style({opacity:.8}))}var Ae=A._uid+I.SELECTID,Me=[],Ee=X(T,n.xaxes,n.yaxes,n.subplot);M&&!e.shiftKey&&(n._clearSubplotSelections=function(){if(c){var e=me._id,t=ge._id;ie(T,e,t,Ee);for(var r=(T.layout||{}).selections||[],n=[],a=!1,o=0;o<r.length;o++){var s=A.selections[o];s&&s.xref===e&&s.yref===t?a=!0:n.push(r[o])}a&&(T._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",T,{selections:n}))}});var Ce=function(e){var t=e.plotinfo;return t.fillRangeItems||ue(e.xaxes.concat(e.yaxes))}(n);n.moveFn=function(e,t){n._clearSubplotSelections&&(n._clearSubplotSelections(),n._clearSubplotSelections=void 0),le=Math.max(0,Math.min(ye,oe*e+j)),de=Math.max(0,Math.min(ve,se*t+F));var r=Math.abs(le-j),i=Math.abs(de-F);if(g){var a,o,s;if(_){var l=A.selectdirection;switch(a="any"===l?i<Math.min(.6*r,z)?"h":r<Math.min(.6*i,z)?"v":"d":l){case"h":o=w?ve/2:0,s=ve;break;case"v":o=w?ye/2:0,s=ye}}if(x)switch(A.newshape.drawdirection){case"vertical":a="h",o=w?ve/2:0,s=ve;break;case"horizontal":a="v",o=w?ye/2:0,s=ye;break;case"ortho":r<i?(a="h",o=F,s=de):(a="v",o=j,s=le);break;default:a="d"}"h"===a?((Y=k?b(w,[le,o],[le,s]):[[j,o],[j,s],[le,s],[le,o]]).xmin=k?le:Math.min(j,le),Y.xmax=k?le:Math.max(j,le),Y.ymin=Math.min(o,s),Y.ymax=Math.max(o,s),Te.attr("d","M"+Y.xmin+","+(F-z)+"h-4v"+2*z+"h4ZM"+(Y.xmax-1)+","+(F-z)+"h4v"+2*z+"h-4Z")):"v"===a?((Y=k?b(w,[o,de],[s,de]):[[o,F],[o,de],[s,de],[s,F]]).xmin=Math.min(o,s),Y.xmax=Math.max(o,s),Y.ymin=k?de:Math.min(F,de),Y.ymax=k?de:Math.max(F,de),Te.attr("d","M"+(j-z)+","+Y.ymin+"v-4h"+2*z+"v4ZM"+(j-z)+","+(Y.ymax-1)+"v4h"+2*z+"v-4Z")):"d"===a&&((Y=k?b(w,[j,F],[le,de]):[[j,F],[j,de],[le,de],[le,F]]).xmin=Math.min(j,le),Y.xmax=Math.max(j,le),Y.ymin=Math.min(F,de),Y.ymax=Math.max(F,de),Te.attr("d","M0,0Z"))}else m&&(q.addPt([le,de]),Y=q.filtered);if(n.selectionDefs&&n.selectionDefs.length?(Z=Q(n.mergedPolygons,Y,xe),Y.subtract=xe,H=G(n.selectionDefs.concat([Y]))):(Z=[Y],H=R(Y)),y(te(Z,v),be,n),_){var c,u=ne(T,!1),h=u.eventData?u.eventData.points.slice():[];u=ne(T,!1,H,Ee,n),H=u.selectionTesters,ae=u.eventData,c=q?q.filtered:ce(Z),E.throttle(Ae,I.SELECTDELAY,(function(){for(var e=(Me=re(H,Ee)).slice(),t=0;t<h.length;t++){for(var r=h[t],n=!1,i=0;i<e.length;i++)if(e[i].curveNumber===r.curveNumber&&e[i].pointNumber===r.pointNumber){n=!0;break}n||e.push(r)}e.length&&(ae||(ae={}),ae.points=e),Ce(ae,c),function(e,t){e.emit("plotly_selecting",t)}(T,ae)}))}},n.clickFn=function(e,t){if(Te.remove(),T._fullLayout._activeShapeIndex>=0)T._fullLayout._deactivateShape(T);else if(!x){var r=A.clickmode;E.done(Ae).then((function(){if(E.clear(Ae),2===e){for(be.remove(),K=0;K<Ee.length;K++)(ee=Ee[K])._module.selectPoints(ee,!1);if(J(T,Ee),$(n),pe(T),Ee.length){var a=Ee[0].xaxis,o=Ee[0].yaxis;if(a&&o){for(var l=[],c=T._fullLayout.selections,u=0;u<c.length;u++){var h=c[u];h&&(h.xref===a._id&&h.yref===o._id||l.push(h))}l.length<c.length&&(T._fullLayout._noEmitSelectedAtStart=!0,i.call("_guiRelayout",T,{selections:l}))}}}else r.indexOf("select")>-1&&U(t,T,n.xaxes,n.yaxes,n.subplot,n,be),"event"===r&&he(T,void 0);s.click(T,t,L.id)})).catch(S.error)}},n.doneFn=function(){Te.remove(),E.done(Ae).then((function(){E.clear(Ae),!M&&Y&&n.selectionDefs&&(Y.subtract=xe,n.selectionDefs.push(Y),n.mergedPolygons.length=0,[].push.apply(n.mergedPolygons,Z)),(M||x)&&$(n,M),n.doneFnCompleted&&n.doneFnCompleted(Me),_&&he(T,ae)})).catch(S.error)}},clearOutline:v,clearSelectionsCache:$,selectOnClick:U}}}),yn=p({"src/components/annotations/arrow_paths.js"(e,t){t.exports=[{path:"",backoff:0},{path:"M-2.4,-3V3L0.6,0Z",backoff:.6},{path:"M-3.7,-2.5V2.5L1.3,0Z",backoff:1.3},{path:"M-4.45,-3L-1.65,-0.2V0.2L-4.45,3L1.55,0Z",backoff:1.55},{path:"M-2.2,-2.2L-0.2,-0.2V0.2L-2.2,2.2L-1.4,3L1.6,0L-1.4,-3Z",backoff:1.6},{path:"M-4.4,-2.1L-0.6,-0.2V0.2L-4.4,2.1L-4,3L2,0L-4,-3Z",backoff:2},{path:"M2,0A2,2 0 1,1 0,-2A2,2 0 0,1 2,0Z",backoff:0,noRotate:!0},{path:"M2,2V-2H-2V2Z",backoff:0,noRotate:!0}]}}),vn=p({"src/constants/axis_placeable_objects.js"(e,t){t.exports={axisRefDescription:function(e,t,r){return["If set to a",e,"axis id (e.g. *"+e+"* or","*"+e+"2*), the `"+e+"` position refers to a",e,"coordinate. If set to *paper*, the `"+e+"`","position refers to the distance from the",t,"of the plotting","area in normalized coordinates where *0* (*1*) corresponds to the",t,"("+r+"). If set to a",e,"axis ID followed by","*domain* (separated by a space), the position behaves like for","*paper*, but refers to the distance in fractions of the domain","length from the",t,"of the domain of that axis: e.g.,","*"+e+"2 domain* refers to the domain of the second",e," axis and a",e,"position of 0.5 refers to the","point between the",t,"and the",r,"of the domain of the","second",e,"axis."].join(" ")}}}}),xn=p({"src/components/annotations/attributes.js"(e,t){var r=yn(),n=D(),i=yt(),a=gt().templatedArray;vn(),t.exports=a("annotation",{visible:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},text:{valType:"string",editType:"calc+arraydraw"},textangle:{valType:"angle",dflt:0,editType:"calc+arraydraw"},font:n({editType:"calc+arraydraw",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},height:{valType:"number",min:1,dflt:null,editType:"calc+arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},align:{valType:"enumerated",values:["left","center","right"],dflt:"center",editType:"arraydraw"},valign:{valType:"enumerated",values:["top","middle","bottom"],dflt:"middle",editType:"arraydraw"},bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},bordercolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},borderpad:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calc+arraydraw"},showarrow:{valType:"boolean",dflt:!0,editType:"calc+arraydraw"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},startarrowhead:{valType:"integer",min:0,max:r.length,dflt:1,editType:"arraydraw"},arrowside:{valType:"flaglist",flags:["end","start"],extras:["none"],dflt:"end",editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calc+arraydraw"},arrowwidth:{valType:"number",min:.1,editType:"calc+arraydraw"},standoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calc+arraydraw"},ax:{valType:"any",editType:"calc+arraydraw"},ay:{valType:"any",editType:"calc+arraydraw"},axref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.x.toString()],editType:"calc"},ayref:{valType:"enumerated",dflt:"pixel",values:["pixel",i.idRegex.y.toString()],editType:"calc"},xref:{valType:"enumerated",values:["paper",i.idRegex.x.toString()],editType:"calc"},x:{valType:"any",editType:"calc+arraydraw"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calc+arraydraw"},xshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},yref:{valType:"enumerated",values:["paper",i.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calc+arraydraw"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calc+arraydraw"},yshift:{valType:"number",dflt:0,editType:"calc+arraydraw"},clicktoshow:{valType:"enumerated",values:[!1,"onoff","onout"],dflt:!1,editType:"arraydraw"},xclick:{valType:"any",editType:"arraydraw"},yclick:{valType:"any",editType:"arraydraw"},hovertext:{valType:"string",editType:"arraydraw"},hoverlabel:{bgcolor:{valType:"color",editType:"arraydraw"},bordercolor:{valType:"color",editType:"arraydraw"},font:n({editType:"arraydraw"}),editType:"arraydraw"},captureevents:{valType:"boolean",editType:"arraydraw"},editType:"calc"})}}),bn=p({"src/traces/scatter/constants.js"(e,t){t.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20,eventDataKeys:[]}}}),_n=p({"src/traces/scatter/fillcolor_attribute.js"(e,t){t.exports=function(e){return{valType:"color",editType:"style",anim:!0}}}}),wn=p({"src/traces/scatter/attributes.js"(e,t){var r=Et().axisHoverFormat,n=Oe().texttemplateAttrs,i=Oe().hovertemplateAttrs,a=Lt(),o=D(),s=Ie().dash,l=Ie().pattern,c=Jt(),u=bn(),h=R().extendFlat,p=_n();t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},x0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dx:{valType:"number",dflt:1,editType:"calc",anim:!0},y:{valType:"data_array",editType:"calc+clearAxisTypes",anim:!0},y0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes",anim:!0},dy:{valType:"number",dflt:1,editType:"calc",anim:!0},xperiod:{valType:"any",dflt:0,editType:"calc"},yperiod:{valType:"any",dflt:0,editType:"calc"},xperiod0:{valType:"any",editType:"calc"},yperiod0:{valType:"any",editType:"calc"},xperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},yperiodalignment:{valType:"enumerated",values:["start","middle","end"],dflt:"middle",editType:"calc"},xhoverformat:r("x"),yhoverformat:r("y"),offsetgroup:{valType:"string",dflt:"",editType:"calc"},alignmentgroup:{valType:"string",dflt:"",editType:"calc"},stackgroup:{valType:"string",dflt:"",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc"},groupnorm:{valType:"enumerated",values:["","fraction","percent"],dflt:"",editType:"calc"},stackgaps:{valType:"enumerated",values:["infer zero","interpolate"],dflt:"infer zero",editType:"calc"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},texttemplate:n({},{}),hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"],editType:"calc"},hoveron:{valType:"flaglist",flags:["points","fills"],editType:"style"},hovertemplate:i({},{keys:u.eventDataKeys}),line:{color:{valType:"color",editType:"style",anim:!0},width:{valType:"number",min:0,dflt:2,editType:"style",anim:!0},shape:{valType:"enumerated",values:["linear","spline","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},smoothing:{valType:"number",min:0,max:1.3,dflt:1,editType:"plot"},dash:h({},s,{editType:"style"}),backoff:{valType:"number",min:0,dflt:"auto",arrayOk:!0,editType:"plot"},simplify:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},cliponaxis:{valType:"boolean",dflt:!0,editType:"plot"},fill:{valType:"enumerated",values:["none","tozeroy","tozerox","tonexty","tonextx","toself","tonext"],editType:"calc"},fillcolor:p(!0),fillgradient:h({type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],dflt:"none",editType:"calc"},start:{valType:"number",editType:"calc"},stop:{valType:"number",editType:"calc"},colorscale:{valType:"colorscale",editType:"style"},editType:"calc"}),fillpattern:l,marker:h({symbol:{valType:"enumerated",values:c.symbolList,dflt:"circle",arrayOk:!0,editType:"style"},opacity:{valType:"number",min:0,max:1,arrayOk:!0,editType:"style",anim:!0},angle:{valType:"angle",dflt:0,arrayOk:!0,editType:"plot",anim:!1},angleref:{valType:"enumerated",values:["previous","up"],dflt:"up",editType:"plot",anim:!1},standoff:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"plot",anim:!0},size:{valType:"number",min:0,dflt:6,arrayOk:!0,editType:"calc",anim:!0},maxdisplayed:{valType:"number",min:0,dflt:0,editType:"plot"},sizeref:{valType:"number",dflt:1,editType:"calc"},sizemin:{valType:"number",min:0,dflt:0,editType:"calc"},sizemode:{valType:"enumerated",values:["diameter","area"],dflt:"diameter",editType:"calc"},line:h({width:{valType:"number",min:0,arrayOk:!0,editType:"style",anim:!0},editType:"calc"},a("marker.line",{anim:!0})),gradient:{type:{valType:"enumerated",values:["radial","horizontal","vertical","none"],arrayOk:!0,dflt:"none",editType:"calc"},color:{valType:"color",arrayOk:!0,editType:"calc"},editType:"calc"},editType:"calc"},a("marker",{anim:!0})),selected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},unselected:{marker:{opacity:{valType:"number",min:0,max:1,editType:"style"},color:{valType:"color",editType:"style"},size:{valType:"number",min:0,editType:"style"},editType:"style"},textfont:{color:{valType:"color",editType:"style"},editType:"style"},editType:"style"},textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"middle center",arrayOk:!0,editType:"calc"},textfont:o({editType:"calc",colorEditType:"style",arrayOk:!0}),zorder:{valType:"integer",dflt:0,editType:"plot"}}}}),kn=p({"src/components/selections/attributes.js"(e,t){var r=xn(),n=wn().line,i=Ie().dash,a=R().extendFlat,o=Le().overrideAll,s=gt().templatedArray;vn(),t.exports=o(s("selection",{type:{valType:"enumerated",values:["rect","path"]},xref:a({},r.xref,{}),yref:a({},r.yref,{}),x0:{valType:"any"},x1:{valType:"any"},y0:{valType:"any"},y1:{valType:"any"},path:{valType:"string",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:.7,editType:"arraydraw"},line:{color:n.color,width:a({},n.width,{min:1,dflt:1}),dash:a({},i,{dflt:"dot"})}}),"arraydraw","from-root")}}),Tn=p({"src/components/selections/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=kn(),o=qr();function s(e,t,i){function s(n,i){return r.coerce(e,t,a,n,i)}var l=s("path"),c="path"!==s("type",l?"path":"rect");c&&delete t.path,s("opacity"),s("line.color"),s("line.width"),s("line.dash");for(var u=["x","y"],h=0;h<2;h++){var p,d,f,m=u[h],g={_fullLayout:i},y=n.coerceRef(e,t,g,m);if((p=n.getFromId(g,y))._selectionIndices.push(t._index),f=o.rangeToShapePosition(p),d=o.shapePositionToRange(p),c){var v=m+"0",x=m+"1",b=e[v],_=e[x];e[v]=d(e[v],!0),e[x]=d(e[x],!0),n.coercePosition(t,g,s,y,v),n.coercePosition(t,g,s,y,x);var w=t[v],k=t[x];void 0!==w&&void 0!==k&&(t[v]=f(w),t[x]=f(k),e[v]=b,e[x]=_)}}c&&r.noneOrAll(e,t,["x0","x1","y0","y1"])}t.exports=function(e,t){i(e,t,{name:"selections",handleItemDefaults:s});for(var r=t.selections,n=0;n<r.length;n++){var a=r[n];a&&void 0===a.path&&(void 0!==a.x0&&void 0!==a.x1&&void 0!==a.y0&&void 0!==a.y1||(t.selections[n]=null))}}}}),Sn=p({"src/components/selections/draw_newselection/defaults.js"(e,t){t.exports=function(e,t,r){r("newselection.mode"),r("newselection.line.width")&&(r("newselection.line.color"),r("newselection.line.dash")),r("activeselection.fillcolor"),r("activeselection.opacity")}}}),An=p({"src/plots/cartesian/include_components.js"(e,t){var r=Ve(),n=st(),i=vt();t.exports=function(e){return function(t,a){var o=t[e];if(Array.isArray(o))for(var s=r.subplotsRegistry.cartesian,l=s.idRegex,c=a._subplots,u=c.xaxis,h=c.yaxis,p=c.cartesian,d=a._has("cartesian"),f=0;f<o.length;f++){var m=o[f];if(n.isPlainObject(m)){var g=i.cleanId(m.xref,"x",!1),y=i.cleanId(m.yref,"y",!1),v=l.x.test(g),x=l.y.test(y);if(v||x){d||n.pushUnique(a._basePlotModules,s);var b=!1;v&&-1===u.indexOf(g)&&(u.push(g),b=!0),x&&-1===h.indexOf(y)&&(h.push(y),b=!0),b&&v&&x&&p.push(g+y)}}}}}}}),Mn=p({"src/components/selections/index.js"(e,t){var r=nn(),n=gn();t.exports={moduleType:"component",name:"selections",layoutAttributes:kn(),supplyLayoutDefaults:Tn(),supplyDrawNewSelectionDefaults:Sn(),includeBasePlot:An()("selections"),draw:r.draw,drawOne:r.drawOne,reselect:n.reselect,prepSelect:n.prepSelect,clearOutline:n.clearOutline,clearSelectionsCache:n.clearSelectionsCache,selectOnClick:n.selectOnClick}}}),En=p({"src/plots/cartesian/dragbox.js"(e,t){var r=v(),n=st(),i=n.numberFormat,a=O(),o=sr(),s=Ve(),l=n.strTranslate,c=At(),u=q(),h=Jt(),p=zr(),d=nr(),f=pr(),m=hr(),g=Or(),y=g.selectingOrDrawing,x=g.freeMode,b=St().FROM_TL,_=Rr(),w=rn().redrawReglTraces,k=kt(),T=vt().getFromId,S=Mn().prepSelect,A=Mn().clearOutline,M=Mn().selectOnClick,E=en(),C=yt(),P=C.MINDRAG,L=C.MINZOOM,I=!0;function z(e,t,r,i){var a=n.ensureSingle(e.draglayer,t,r,(function(t){t.classed("drag",!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",e.id)}));return a.call(f,i),a.node()}function R(e,t,n,i,a,o,s){var l=z(e,"rect",t,n);return r.select(l).call(h.setRect,i,a,o,s),l}function D(e,t){for(var r=0;r<e.length;r++)if(!e[r].fixedrange)return t;return""}function j(e,t,r,n,i){for(var a=0;a<e.length;a++){var o=e[a];if(!o.fixedrange)if(o.rangebreaks){var s="y"===o._id.charAt(0),l=s?1-t:t,c=s?1-r:r;n[o._name+".range[0]"]=o.l2r(o.p2l(l*o._length)),n[o._name+".range[1]"]=o.l2r(o.p2l(c*o._length))}else{var u=o._rl[0],h=o._rl[1]-u;n[o._name+".range[0]"]=o.l2r(u+h*t),n[o._name+".range[1]"]=o.l2r(u+h*r)}}if(i&&i.length){var p=(t+(1-r))/2;j(i,p,1-p,n,[])}}function F(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(!n.fixedrange){if(n.rangebreaks){var i=n._length,a=(n.p2l(0+t)-n.p2l(0)+(n.p2l(i+t)-n.p2l(i)))/2;n.range=[n.l2r(n._rl[0]-a),n.l2r(n._rl[1]-a)]}else n.range=[n.l2r(n._rl[0]-t/n._m),n.l2r(n._rl[1]-t/n._m)];n.limitRange&&n.limitRange()}}}function B(e){return 1-(e>=0?Math.min(e,.9):1/(1/Math.max(e,-.3)+3.222))}function N(e,t,r,n,i){return e.append("path").attr("class","zoombox").style({fill:t>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform",l(r,n)).attr("d",i+"Z")}function U(e,t,r){return e.append("path").attr("class","zoombox-corners").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("transform",l(t,r)).attr("d","M0,0Z")}function V(e,t,r,n,i,a){e.attr("d",n+"M"+r.l+","+r.t+"v"+r.h+"h"+r.w+"v-"+r.h+"h-"+r.w+"Z"),H(e,t,i,a)}function H(e,t,r,n){r||(e.transition().style("fill",n>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),t.transition().style("opacity",1).duration(200))}function G(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function W(e){I&&e.data&&e._context.showTips&&(n.notifier(n._(e,"Double-click to zoom back out"),"long"),I=!1)}function $(e){var t=Math.floor(Math.min(e.b-e.t,e.r-e.l,L)/2);return"M"+(e.l-3.5)+","+(e.t-.5+t)+"h3v"+-t+"h"+t+"v-3h-"+(t+3)+"ZM"+(e.r+3.5)+","+(e.t-.5+t)+"h-3v"+-t+"h"+-t+"v-3h"+(t+3)+"ZM"+(e.r+3.5)+","+(e.b+.5-t)+"h-3v"+t+"h"+-t+"v3h"+(t+3)+"ZM"+(e.l-3.5)+","+(e.b+.5-t)+"h3v"+t+"h"+t+"v3h-"+(t+3)+"Z"}function Z(e,t,r,i,a){for(var o,s,l,c,u=!1,h={},p={},d=(a||{}).xaHash,f=(a||{}).yaHash,m=0;m<t.length;m++){var g=t[m];for(o in r)if(g[o]){for(l in g)a&&(d[l]||f[l])||("x"===l.charAt(0)?r:i)[l]||(h[l]=o);for(s in i)a&&(d[s]||f[s])||!g[s]||(u=!0)}for(s in i)if(g[s])for(c in g)a&&(d[c]||f[c])||("x"===c.charAt(0)?r:i)[c]||(p[c]=s)}u&&(n.extendFlat(h,p),p={});var y={},v=[];for(l in h){var x=T(e,l);v.push(x),y[x._id]=x}var b={},_=[];for(c in p){var w=T(e,c);_.push(w),b[w._id]=w}return{xaHash:y,yaHash:b,xaxes:v,yaxes:_,xLinks:h,yLinks:p,isSubplotConstrained:u}}function X(e,t){if(o){var r=void 0!==e.onwheel?"wheel":"mousewheel";e._onwheel&&e.removeEventListener(r,e._onwheel),e._onwheel=t,e.addEventListener(r,t,{passive:!1})}else void 0!==e.onwheel?e.onwheel=t:void 0!==e.onmousewheel?e.onmousewheel=t:e.isAddedWheelEvent||(e.isAddedWheelEvent=!0,e.addEventListener("wheel",t,{passive:!1}))}function Y(e){var t=[];for(var r in e)t.push(e[r]);return t}t.exports={makeDragBox:function(e,t,o,l,u,f,g,v){var I,z,O,q,H,K,J,Q,ee,te,re,ne,ie,ae,oe,se,le,ce,ue,he,pe,de,fe,me=e._fullLayout._zoomlayer,ge=g+v==="nsew",ye=1===(g+v).length;function ve(){if(I=t.xaxis,z=t.yaxis,ee=I._length,te=z._length,J=I._offset,Q=z._offset,(O={})[I._id]=I,(q={})[z._id]=z,g&&v)for(var r=t.overlays,n=0;n<r.length;n++){var i=r[n].xaxis;O[i._id]=i;var a=r[n].yaxis;q[a._id]=a}H=Y(O),K=Y(q),ie=D(H,v),ae=D(K,g),oe=!ae&&!ie,ne=Z(e,e._fullLayout._axisMatchGroups,O,q);var o=(re=Z(e,e._fullLayout._axisConstraintGroups,O,q,ne)).isSubplotConstrained||ne.isSubplotConstrained;se=v||o,le=g||o;var s=e._fullLayout;ce=s._has("scattergl"),ue=s._has("splom"),he=s._has("svg")}o+=t.yaxis._shift,ve();var xe=function(e,t,r){return e?"nsew"===e?r?"":"pan"===t?"move":"crosshair":e.toLowerCase()+"-resize":"pointer"}(ae+ie,e._fullLayout.dragmode,ge),be=R(t,g+v+"drag",xe,o,l,u,f);if(oe&&!ge)return be.onmousedown=null,be.style.pointerEvents="none",be;var _e,we,ke,Te,Se,Ae,Me,Ee,Ce,Pe,Le={element:be,gd:e,plotinfo:t};function Ie(){Le.plotinfo.selection=!1,A(e)}function ze(n,a){var o=Le.gd;if(o._fullLayout._activeShapeIndex>=0)o._fullLayout._deactivateShape(o);else{var l=o._fullLayout.clickmode;if(G(o),2!==n||ye||function(){if(!e._transitioningWithDuration){var t=e._context.doubleClick,r=[];ie&&(r=r.concat(H)),ae&&(r=r.concat(K)),ne.xaxes&&(r=r.concat(ne.xaxes)),ne.yaxes&&(r=r.concat(ne.yaxes));var n,i,a={};if("reset+autosize"===t)for(t="autosize",i=0;i<r.length;i++){var o=(n=r[i])._rangeInitial0,l=n._rangeInitial1,c=void 0!==o||void 0!==l;if(c&&(void 0!==o&&o!==n.range[0]||void 0!==l&&l!==n.range[1])||!c&&!0!==n.autorange){t="reset";break}}if("autosize"===t)for(i=0;i<r.length;i++)(n=r[i]).fixedrange||(a[n._name+".autorange"]=!0);else if("reset"===t)for((ie||re.isSubplotConstrained)&&(r=r.concat(re.xaxes)),ae&&!re.isSubplotConstrained&&(r=r.concat(re.yaxes)),re.isSubplotConstrained&&(ie?ae||(r=r.concat(K)):r=r.concat(H)),i=0;i<r.length;i++)if(!(n=r[i]).fixedrange){var u=n._name,h=n._autorangeInitial;void 0===n._rangeInitial0&&void 0===n._rangeInitial1?a[u+".autorange"]=!0:void 0===n._rangeInitial0?(a[u+".autorange"]=h,a[u+".range"]=[null,n._rangeInitial1]):void 0===n._rangeInitial1?(a[u+".range"]=[n._rangeInitial0,null],a[u+".autorange"]=h):a[u+".range"]=[n._rangeInitial0,n._rangeInitial1]}e.emit("plotly_doubleclick",null),s.call("_guiRelayout",e,a)}}(),ge)l.indexOf("select")>-1&&M(a,o,H,K,t.id,Le),l.indexOf("event")>-1&&p.click(o,a,t.id);else if(1===n&&ye){var u=g?z:I,h="s"===g||"w"===v?0:1,d=u._name+".range["+h+"]",f=function(e,t){var r,n=e.range[t],a=Math.abs(n-e.range[1-t]);return"date"===e.type?n:"log"===e.type?(r=Math.ceil(Math.max(0,-Math.log(a)/Math.LN10))+3,i("."+r+"g")(Math.pow(10,n))):(r=Math.floor(Math.log(Math.abs(n))/Math.LN10)-Math.floor(Math.log(a)/Math.LN10)+4,i("."+String(r)+"g")(n))}(u,h),m="left",y="middle";if(u.fixedrange)return;g?(y="n"===g?"top":"bottom","right"===u.side&&(m="right")):"e"===v&&(m="right"),o._context.showAxisRangeEntryBoxes&&r.select(be).call(c.makeEditable,{gd:o,immediate:!0,background:o._fullLayout.paper_bgcolor,text:String(f),fill:u.tickfont?u.tickfont.color:"#444",horizontalAlign:m,verticalAlign:y}).on("edit",(function(e){var t=u.d2r(e);void 0!==t&&s.call("_guiRelayout",o,d,t)}))}}}function Oe(t,r){if(e._transitioningWithDuration)return!1;var n=Math.max(0,Math.min(ee,de*t+_e)),i=Math.max(0,Math.min(te,fe*r+we)),a=Math.abs(n-_e),o=Math.abs(i-we);function s(){Me="",ke.r=ke.l,ke.t=ke.b,Ce.attr("d","M0,0Z")}if(ke.l=Math.min(_e,n),ke.r=Math.max(_e,n),ke.t=Math.min(we,i),ke.b=Math.max(we,i),re.isSubplotConstrained)a>L||o>L?(Me="xy",a/ee>o/te?(o=a*te/ee,we>i?ke.t=we-o:ke.b=we+o):(a=o*ee/te,_e>n?ke.l=_e-a:ke.r=_e+a),Ce.attr("d",$(ke))):s();else if(ne.isSubplotConstrained)if(a>L||o>L){Me="xy";var l=Math.min(ke.l/ee,(te-ke.b)/te),c=Math.max(ke.r/ee,(te-ke.t)/te);ke.l=l*ee,ke.r=c*ee,ke.b=(1-l)*te,ke.t=(1-c)*te,Ce.attr("d",$(ke))}else s();else!ae||o<Math.min(Math.max(.6*a,P),L)?a<P||!ie?s():(ke.t=0,ke.b=te,Me="x",Ce.attr("d",function(e,t){return"M"+(e.l-.5)+","+(t-L-.5)+"h-3v"+(2*L+1)+"h3ZM"+(e.r+.5)+","+(t-L-.5)+"h3v"+(2*L+1)+"h-3Z"}(ke,we))):!ie||a<Math.min(.6*o,L)?(ke.l=0,ke.r=ee,Me="y",Ce.attr("d",function(e,t){return"M"+(t-L-.5)+","+(e.t-.5)+"v-3h"+(2*L+1)+"v3ZM"+(t-L-.5)+","+(e.b+.5)+"v3h"+(2*L+1)+"v-3Z"}(ke,_e))):(Me="xy",Ce.attr("d",$(ke)));ke.w=ke.r-ke.l,ke.h=ke.b-ke.t,Me&&(Pe=!0),e._dragged=Pe,V(Ee,Ce,ke,Se,Ae,Te),Re(),e.emit("plotly_relayouting",pe),Ae=!0}function Re(){pe={},"xy"!==Me&&"x"!==Me||(j(H,ke.l/ee,ke.r/ee,pe,re.xaxes),Ve("x",pe)),"xy"!==Me&&"y"!==Me||(j(K,(te-ke.b)/te,(te-ke.t)/te,pe,re.yaxes),Ve("y",pe))}function De(){Re(),G(e),He(),W(e)}Le.prepFn=function(t,r,i){var o=Le.dragmode,s=e._fullLayout.dragmode;s!==o&&(Le.dragmode=s),ve(),de=e._fullLayout._invScaleX,fe=e._fullLayout._invScaleY,oe||(ge?t.shiftKey?"pan"===s?s="zoom":y(s)||(s="pan"):t.ctrlKey&&(s="pan"):s="pan"),x(s)?Le.minDrag=1:Le.minDrag=void 0,y(s)?(Le.xaxes=H,Le.yaxes=K,S(t,r,i,Le,s)):(Le.clickFn=ze,y(o)&&Ie(),oe||("zoom"===s?(Le.moveFn=Oe,Le.doneFn=De,Le.minDrag=1,function(t,r,i){var o=be.getBoundingClientRect();_e=r-o.left,we=i-o.top,e._fullLayout._calcInverseTransform(e);var s=n.apply3DTransform(e._fullLayout._invTransform)(_e,we);_e=s[0],we=s[1],ke={l:_e,r:_e,w:0,t:we,b:we,h:0},Te=e._hmpixcount?e._hmlumcount/e._hmpixcount:a(e._fullLayout.plot_bgcolor).getLuminance(),Ae=!1,Me="xy",Pe=!1,Ee=N(me,Te,J,Q,Se="M0,0H"+ee+"V"+te+"H0V0"),Ce=U(me,J,Q)}(0,r,i)):"pan"===s&&(Le.moveFn=Ue,Le.doneFn=He))),e._fullLayout._redrag=function(){var t=e._dragdata;if(t&&t.element===be){var r=e._fullLayout.dragmode;y(r)||(ve(),Ge([0,0,ee,te]),Le.moveFn(t.dx,t.dy))}}},m.init(Le);var je=[0,0,ee,te],Fe=null,Be=C.REDRAWDELAY,Ne=t.mainplot?e._fullLayout._plots[t.mainplot]:t;function Ue(t,r){if(t*=de,r*=fe,!e._transitioningWithDuration){if(e._fullLayout._replotting=!0,"ew"===ie||"ns"===ae){var n=ie?-t:0,i=ae?-r:0;if(ne.isSubplotConstrained){if(ie&&ae){var a=(t/ee-r/te)/2;n=-(t=a*ee),i=-(r=-a*te)}ae?n=-i*ee/te:i=-n*te/ee}return ie&&(F(H,t),Ve("x")),ae&&(F(K,r),Ve("y")),Ge([n,i,ee,te]),qe(),void e.emit("plotly_relayouting",pe)}var o,s,l="w"===ie===("n"===ae)?1:-1;if(ie&&ae&&(re.isSubplotConstrained||ne.isSubplotConstrained)){var c=(t/ee+l*r/te)/2;t=c*ee,r=l*c*te}if("w"===ie?t=d(H,0,t):"e"===ie?t=d(H,1,-t):ie||(t=0),"n"===ae?r=d(K,1,r):"s"===ae?r=d(K,0,-r):ae||(r=0),o="w"===ie?t:0,s="n"===ae?r:0,re.isSubplotConstrained&&!ne.isSubplotConstrained||ne.isSubplotConstrained&&ie&&ae&&l>0){var u;if(ne.isSubplotConstrained||!ie&&1===ae.length){for(u=0;u<H.length;u++)H[u].range=H[u]._r.slice(),E(H[u],1-r/te);o=(t=r*ee/te)/2}if(ne.isSubplotConstrained||!ae&&1===ie.length){for(u=0;u<K.length;u++)K[u].range=K[u]._r.slice(),E(K[u],1-t/ee);s=(r=t*te/ee)/2}}ne.isSubplotConstrained&&ae||Ve("x"),ne.isSubplotConstrained&&ie||Ve("y");var h=ee-t,p=te-r;!ne.isSubplotConstrained||ie&&ae||(ie?(s=o?0:t*te/ee,p=h*te/ee):(o=s?0:r*ee/te,h=p*ee/te)),Ge([o,s,h,p]),qe(),e.emit("plotly_relayouting",pe)}function d(e,t,r){for(var n,i,a=1-t,o=0;o<e.length;o++){var s=e[o];if(!s.fixedrange){n=s,i=s._rl[a]+(s._rl[t]-s._rl[a])/B(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[t]=l)}}return n._length*(n._rl[t]-i)/(n._rl[t]-n._rl[a])}}function Ve(e,t){for(var r=ne.isSubplotConstrained?{x:K,y:H}[e]:ne[e+"axes"],n=ne.isSubplotConstrained?{x:H,y:K}[e]:[],i=0;i<r.length;i++){var a=r[i],o=a._id,s=ne.xLinks[o]||ne.yLinks[o],l=n[0]||O[s]||q[s];l&&(t?(t[a._name+".range[0]"]=t[l._name+".range[0]"],t[a._name+".range[1]"]=t[l._name+".range[1]"]):a.range=l.range.slice())}}function qe(){var r,n=[];function i(e){for(r=0;r<e.length;r++)e[r].fixedrange||n.push(e[r]._id)}function a(e,t){for(r=0;r<e.length;r++){var i=e[r],a=i[t];i.fixedrange||"sync"!==a.tickmode||n.push(a._id)}}for(se&&(i(H),i(re.xaxes),i(ne.xaxes),a(t.overlays,"xaxis")),le&&(i(K),i(re.yaxes),i(ne.yaxes),a(t.overlays,"yaxis")),pe={},r=0;r<n.length;r++){var o=n[r],s=T(e,o);d.drawOne(e,s,{skipTitle:!0}),pe[s._name+".range[0]"]=s.range[0],pe[s._name+".range[1]"]=s.range[1]}d.redrawComponents(e,n)}function He(){Ge([0,0,ee,te]),n.syncOrAsync([k.previousPromises,function(){e._fullLayout._replotting=!1,s.call("_guiRelayout",e,pe)}],e)}function Ge(t){var r,i,a,o,l=e._fullLayout,c=l._plots,u=l._subplots.cartesian;if(ue&&s.subplotsRegistry.splom.drag(e),ce)for(r=0;r<u.length;r++)if(a=(i=c[u[r]]).xaxis,o=i.yaxis,i._scene){a.limitRange&&a.limitRange(),o.limitRange&&o.limitRange();var p=n.simpleMap(a.range,a.r2l),d=n.simpleMap(o.range,o.r2l);i._scene.update({range:[p[0],d[0],p[1],d[1]]})}if((ue||ce)&&(_(e),w(e)),he){var f=t[2]/I._length,m=t[3]/z._length;for(r=0;r<u.length;r++){a=(i=c[u[r]]).xaxis,o=i.yaxis;var y,x,b,k,T=(se||ne.isSubplotConstrained)&&!a.fixedrange&&O[a._id],S=(le||ne.isSubplotConstrained)&&!o.fixedrange&&q[o._id];if(T?(y=f,b=v||ne.isSubplotConstrained?t[0]:Ze(a,y)):ne.xaHash[a._id]?(y=f,b=t[0]*a._length/I._length):ne.yaHash[a._id]?(y=m,b="ns"===ae?-t[1]*a._length/z._length:Ze(a,y,{n:"top",s:"bottom"}[ae])):b=$e(a,y=We(a,f,m)),y>1&&(void 0!==a.maxallowed&&se===(a.range[0]<a.range[1]?"e":"w")||void 0!==a.minallowed&&se===(a.range[0]<a.range[1]?"w":"e"))&&(y=1,b=0),S?(x=m,k=g||ne.isSubplotConstrained?t[1]:Ze(o,x)):ne.yaHash[o._id]?(x=m,k=t[1]*o._length/z._length):ne.xaHash[o._id]?(x=f,k="ew"===ie?-t[0]*o._length/I._length:Ze(o,x,{e:"right",w:"left"}[ie])):k=$e(o,x=We(o,f,m)),x>1&&(void 0!==o.maxallowed&&le===(o.range[0]<o.range[1]?"n":"s")||void 0!==o.minallowed&&le===(o.range[0]<o.range[1]?"s":"n"))&&(x=1,k=0),y||x){y||(y=1),x||(x=1);var A=a._offset-b/y,M=o._offset-k/x;i.clipRect.call(h.setTranslate,b,k).call(h.setScale,y,x),i.plot.call(h.setTranslate,A,M).call(h.setScale,1/y,1/x),y===i.xScaleFactor&&x===i.yScaleFactor||(h.setPointGroupScale(i.zoomScalePts,y,x),h.setTextPointsScale(i.zoomScaleTxt,y,x)),h.hideOutsideRangePoints(i.clipOnAxisFalseTraces,i),i.xScaleFactor=y,i.yScaleFactor=x}}}}function We(e,t,r){return e.fixedrange?0:se&&re.xaHash[e._id]?t:le&&(re.isSubplotConstrained?re.xaHash:re.yaHash)[e._id]?r:0}function $e(e,t){return t?(e.range=e._r.slice(),E(e,t),Ze(e,t)):0}function Ze(e,t,r){return e._length*(1-t)*b[r||e.constraintoward||"middle"]}return g.length*v.length!==1&&X(be,(function(t){if(e._context._scrollZoom.cartesian||e._fullLayout._enablescrollzoom){if(Ie(),e._transitioningWithDuration)return t.preventDefault(),void t.stopPropagation();ve(),clearTimeout(Fe);var r=-t.deltaY;if(isFinite(r)||(r=t.wheelDelta/10),isFinite(r)){var i,a=Math.exp(-Math.min(Math.max(r,-20),20)/200),o=Ne.draglayer.select(".nsewdrag").node().getBoundingClientRect(),s=(t.clientX-o.left)/o.width,l=(o.bottom-t.clientY)/o.height;if(se){for(v||(s=.5),i=0;i<H.length;i++)c(H[i],s,a);Ve("x"),je[2]*=a,je[0]+=je[2]*s*(1/a-1)}if(le){for(g||(l=.5),i=0;i<K.length;i++)c(K[i],l,a);Ve("y"),je[3]*=a,je[1]+=je[3]*(1-l)*(1/a-1)}Ge(je),qe(),e.emit("plotly_relayouting",pe),Fe=setTimeout((function(){e._fullLayout&&(je=[0,0,ee,te],He())}),Be),t.preventDefault()}else n.log("Did not find wheel motion attributes: ",t)}function c(e,t,r){if(!e.fixedrange){var i=n.simpleMap(e.range,e.r2l),a=i[0]+(i[1]-i[0])*t;e.range=i.map((function(t){return e.l2r(a+(t-a)*r)}))}}})),be},makeDragger:z,makeRectDragger:R,makeZoombox:N,makeCorners:U,updateZoombox:V,xyCorners:$,transitionZoombox:H,removeZoombox:G,showDoubleClickNotifier:W,attachWheelEventHandler:X}}}),Cn=p({"src/plots/cartesian/graph_interact.js"(e){var t=v(),r=zr(),n=hr(),i=pr(),a=En().makeDragBox,o=yt().DRAGGERSIZE;e.initInteractions=function(i){var s=i._fullLayout;if(i._context.staticPlot)t.select(i).selectAll(".drag").remove();else if(s._has("cartesian")||s._has("splom")){Object.keys(s._plots||{}).sort((function(e,t){if((s._plots[e].mainplot&&!0)===(s._plots[t].mainplot&&!0)){var r=e.split("y"),n=t.split("y");return r[0]===n[0]?Number(r[1]||1)-Number(n[1]||1):Number(r[0]||1)-Number(n[0]||1)}return s._plots[e].mainplot?1:-1})).forEach((function(e){var t=s._plots[e],l=t.xaxis,c=t.yaxis;if(!t.mainplot){var u=a(i,t,l._offset,c._offset,l._length,c._length,"ns","ew");u.onmousemove=function(t){i._fullLayout._rehover=function(){i._fullLayout._hoversubplot===e&&i._fullLayout._plots[e]&&r.hover(i,t,e)},r.hover(i,t,e),i._fullLayout._lasthover=u,i._fullLayout._hoversubplot=e},u.onmouseout=function(e){i._dragging||(i._fullLayout._hoversubplot=null,n.unhover(i,e))},i._context.showAxisDragHandles&&(a(i,t,l._offset-o,c._offset-o,o,o,"n","w"),a(i,t,l._offset+l._length,c._offset-o,o,o,"n","e"),a(i,t,l._offset-o,c._offset+c._length,o,o,"s","w"),a(i,t,l._offset+l._length,c._offset+c._length,o,o,"s","e"))}if(i._context.showAxisDragHandles){if(e===l._mainSubplot){var h=l._mainLinePosition;"top"===l.side&&(h-=o),a(i,t,l._offset+.1*l._length,h,.8*l._length,o,"","ew"),a(i,t,l._offset,h,.1*l._length,o,"","w"),a(i,t,l._offset+.9*l._length,h,.1*l._length,o,"","e")}if(e===c._mainSubplot){var p=c._mainLinePosition;"right"!==c.side&&(p-=o),a(i,t,p,c._offset+.1*c._length,o,.8*c._length,"ns",""),a(i,t,p,c._offset+.9*c._length,o,.1*c._length,"s",""),a(i,t,p,c._offset,o,.1*c._length,"n","")}}}));var l=s._hoverlayer.node();l.onmousemove=function(e){e.target=i._fullLayout._lasthover,r.hover(i,e,s._hoversubplot)},l.onclick=function(e){e.target=i._fullLayout._lasthover,r.click(i,e)},l.onmousedown=function(e){i._fullLayout._lasthover.onmousedown(e)},e.updateFx(i)}},e.updateFx=function(e){var t=e._fullLayout,r="pan"===t.dragmode?"move":"crosshair";i(t._draggers,r)}}}),Pn=p({"src/plot_api/container_array_match.js"(e,t){var r=Ve();t.exports=function(e){for(var t,n,i=r.layoutArrayContainers,a=r.layoutArrayRegexes,o=e.split("[")[0],s=0;s<a.length;s++)if((n=e.match(a[s]))&&0===n.index){t=n[0];break}if(t||(t=i[i.indexOf(o)]),!t)return!1;var l=e.substr(t.length);return l?!!(n=l.match(/^\[(0|[1-9][0-9]*)\](\.(.+))?$/))&&{array:t,index:Number(n[1]),property:n[3]||""}:{array:t,index:"",property:""}}}}),Ln=p({"src/plot_api/manage_arrays.js"(e){var t=A(),r=Y(),n=X(),i=Ge().sorterAsc,a=Ve();e.containerArrayMatch=Pn();var o=e.isAddVal=function(e){return"add"===e||t(e)},s=e.isRemoveVal=function(e){return null===e||"remove"===e};e.applyContainerArrayChanges=function(e,t,l,c,u){var h=t.astr,p=a.getComponentMethod(h,"supplyLayoutDefaults"),d=a.getComponentMethod(h,"draw"),f=a.getComponentMethod(h,"drawOne"),m=c.replot||c.recalc||p===r||d===r,g=e.layout,y=e._fullLayout;if(l[""]){Object.keys(l).length>1&&n.warn("Full array edits are incompatible with other edits",h);var v=l[""][""];if(s(v))t.set(null);else{if(!Array.isArray(v))return n.warn("Unrecognized full array edit value",h,v),!0;t.set(v)}return!m&&(p(g,y),d(e),!0)}var x,b,_,w,k,T,S,A,M=Object.keys(l).map(Number).sort(i),E=t.get(),C=E||[],P=u(y,h).get(),L=[],I=-1,z=C.length;for(x=0;x<M.length;x++)if(w=l[_=M[x]],k=Object.keys(w),T=w[""],S=o(T),_<0||_>C.length-(S?0:1))n.warn("index out of range",h,_);else if(void 0!==T)k.length>1&&n.warn("Insertion & removal are incompatible with edits to the same index.",h,_),s(T)?L.push(_):S?("add"===T&&(T={}),C.splice(_,0,T),P&&P.splice(_,0,{})):n.warn("Unrecognized full object edit value",h,_,T),-1===I&&(I=_);else for(b=0;b<k.length;b++)A=h+"["+_+"].",u(C[_],k[b],A).set(w[k[b]]);for(x=L.length-1;x>=0;x--)C.splice(L[x],1),P&&P.splice(L[x],1);if(C.length?E||t.set(C):t.set(null),m)return!1;if(p(g,y),f!==r){var O;if(-1===I)O=M;else{for(z=Math.max(C.length,z),O=[],x=0;x<M.length&&!((_=M[x])>=I);x++)O.push(_);for(x=I;x<z;x++)O.push(x)}for(x=0;x<O.length;x++)f(e,O[x])}else d(e);return!0}}}),In=p({"src/plot_api/helpers.js"(e){var t=k(),r=(be(),Ve()),n=st(),i=kt(),a=vt(),o=q(),s=a.cleanId,l=a.getFromTrace,c=r.traceIs;function u(e,t){var r=e[t],n=t.charAt(0);r&&"paper"!==r&&(e[t]=s(r,n,!0))}function h(e){if(!n.isPlainObject(e))return!1;var t=e.name;return delete e.name,delete e.showlegend,("string"===typeof t||"number"===typeof t)&&String(t)}function p(e,t,r,n){if(r&&!n)return e;if(n&&!r)return t;if(!e.trim())return t;if(!t.trim())return e;var i,a=Math.min(e.length,t.length);for(i=0;i<a&&e.charAt(i)===t.charAt(i);i++);return e.substr(0,i).trim()}function d(e){var t="middle",r="center";return"string"===typeof e&&(-1!==e.indexOf("top")?t="top":-1!==e.indexOf("bottom")&&(t="bottom"),-1!==e.indexOf("left")?r="left":-1!==e.indexOf("right")&&(r="right")),t+" "+r}function f(e,t){return t in e&&"object"===typeof e[t]&&0===Object.keys(e[t]).length}e.clearPromiseQueue=function(e){Array.isArray(e._promises)&&e._promises.length>0&&n.log("Clearing previous rejected promises from queue."),e._promises=[]},e.cleanLayout=function(t){var r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var a=(i.subplotsRegistry.cartesian||{}).attrRegex,l=((i.subplotsRegistry.polar||{}).attrRegex,(i.subplotsRegistry.ternary||{}).attrRegex,(i.subplotsRegistry.gl3d||{}).attrRegex,Object.keys(t));for(r=0;r<l.length;r++){var c=l[r];if(a&&a.test(c)){var h=t[c];h.anchor&&"free"!==h.anchor&&(h.anchor=s(h.anchor)),h.overlaying&&(h.overlaying=s(h.overlaying)),h.type||(h.isdate?h.type="date":h.islog?h.type="log":!1===h.isdate&&!1===h.islog&&(h.type="linear")),"withzero"!==h.autorange&&"tozero"!==h.autorange||(h.autorange=!0,h.rangemode="tozero"),h.insiderange&&delete h.range,delete h.islog,delete h.isdate,delete h.categories,f(h,"domain")&&delete h.domain}}var p=Array.isArray(t.annotations)?t.annotations.length:0;for(r=0;r<p;r++){var d=t.annotations[r];n.isPlainObject(d)&&(u(d,"xref"),u(d,"yref"))}var m=Array.isArray(t.shapes)?t.shapes.length:0;for(r=0;r<m;r++){var g=t.shapes[r];n.isPlainObject(g)&&(u(g,"xref"),u(g,"yref"))}var y=Array.isArray(t.images)?t.images.length:0;for(r=0;r<y;r++){var v=t.images[r];n.isPlainObject(v)&&(u(v,"xref"),u(v,"yref"))}var x=t.legend;return x&&(x.x>3?(x.x=1.02,x.xanchor="left"):x.x<-2&&(x.x=-.02,x.xanchor="right"),x.y>3?(x.y=1.02,x.yanchor="bottom"):x.y<-2&&(x.y=-.02,x.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),o.clean(t),t.template&&t.template.layout&&e.cleanLayout(t.template.layout),t},e.cleanData=function(t){for(var a=0;a<t.length;a++){var l,u=t[a];if("histogramy"===u.type&&"xbins"in u&&!("ybins"in u)&&(u.ybins=u.xbins,delete u.xbins),"histogramy"===u.type&&e.swapXYData(u),"histogramx"!==u.type&&"histogramy"!==u.type||(u.type="histogram"),"scl"in u&&!("colorscale"in u)&&(u.colorscale=u.scl,delete u.scl),"reversescl"in u&&!("reversescale"in u)&&(u.reversescale=u.reversescl,delete u.reversescl),u.xaxis&&(u.xaxis=s(u.xaxis,"x")),u.yaxis&&(u.yaxis=s(u.yaxis,"y")),c(u,"gl3d")&&u.scene&&(u.scene=i.subplotsRegistry.gl3d.cleanId(u.scene)),!c(u,"pie-like")&&!c(u,"bar-like"))if(Array.isArray(u.textposition))for(l=0;l<u.textposition.length;l++)u.textposition[l]=d(u.textposition[l]);else u.textposition&&(u.textposition=d(u.textposition));var m=r.getModule(u);if(m&&m.colorbar){var g=m.colorbar.container,y=g?u[g]:u;y&&y.colorscale&&("YIGnBu"===y.colorscale&&(y.colorscale="YlGnBu"),"YIOrRd"===y.colorscale&&(y.colorscale="YlOrRd"))}if("surface"===u.type&&n.isPlainObject(u.contours)){var v=["x","y","z"];for(l=0;l<v.length;l++){var x=u.contours[v[l]];n.isPlainObject(x)&&(x.highlightColor&&(x.highlightcolor=x.highlightColor,delete x.highlightColor),x.highlightWidth&&(x.highlightwidth=x.highlightWidth,delete x.highlightWidth))}}if("candlestick"===u.type||"ohlc"===u.type){var b=!1!==(u.increasing||{}).showlegend,_=!1!==(u.decreasing||{}).showlegend,w=h(u.increasing),k=h(u.decreasing);if(!1!==w&&!1!==k){var T=p(w,k,b,_);T&&(u.name=T)}else!w&&!k||u.name||(u.name=w||k)}f(u,"line")&&delete u.line,"marker"in u&&(f(u.marker,"line")&&delete u.marker.line,f(u,"marker")&&delete u.marker),o.clean(u),u.autobinx&&(delete u.autobinx,delete u.xbins),u.autobiny&&(delete u.autobiny,delete u.ybins)}},e.swapXYData=function(e){var t;if(n.swapAttrs(e,["?","?0","d?","?bins","nbins?","autobin?","?src","error_?"]),Array.isArray(e.z)&&Array.isArray(e.z[0])&&(e.transpose?delete e.transpose:e.transpose=!0),e.error_x&&e.error_y){var r=e.error_y,i="copy_ystyle"in r?r.copy_ystyle:!(r.color||r.thickness||r.width);n.swapAttrs(e,["error_?.copy_ystyle"]),i&&n.swapAttrs(e,["error_?.color","error_?.thickness","error_?.width"])}if("string"===typeof e.hoverinfo){var a=e.hoverinfo.split("+");for(t=0;t<a.length;t++)"x"===a[t]?a[t]="y":"y"===a[t]&&(a[t]="x");e.hoverinfo=a.join("+")}},e.coerceTraceIndices=function(e,r){if(t(r))return[r];if(!Array.isArray(r)||!r.length)return e.data.map((function(e,t){return t}));if(Array.isArray(r)){for(var i=[],a=0;a<r.length;a++)n.isIndex(r[a],e.data.length)?i.push(r[a]):n.warn("trace index (",r[a],") is not a number or is out of bounds");return i}return r},e.manageArrayContainers=function(e,r,i){var a=e.obj,o=e.parts,s=o.length,l=o[s-1],c=t(l);if(c&&null===r){var u=o.slice(0,s-1).join(".");n.nestedProperty(a,u).get().splice(l,1)}else c&&void 0===e.get()?(void 0===e.get()&&(i[e.astr]=null),e.set(r)):e.set(r)};var m=/(\.[^\[\]\.]+|\[[^\[\]\.]+\])$/;function g(e){var t=e.search(m);if(t>0)return e.substr(0,t)}e.hasParent=function(e,t){for(var r=g(t);r;){if(r in e)return!0;r=g(r)}return!1};var y=["x","y","z"];e.clearAxisTypes=function(e,t,r){for(var i=0;i<t.length;i++)for(var a=e._fullData[i],o=0;o<3;o++){var s=l(e,a,y[o]);if(s&&"log"!==s.type){var c=s._name,u=s._id.substr(1);if("scene"===u.substr(0,5)){if(void 0!==r[u])continue;c=u+"."+c}var h=c+".type";void 0===r[c]&&void 0===r[h]&&n.nestedProperty(e.layout,h).set(null)}}}}}),zn=p({"src/plot_api/plot_api.js"(e){var t=v(),r=k(),n=ut(),i=st(),a=i.nestedProperty,o=pt(),s=dt(),l=Ve(),c=mt(),u=kt(),h=nr(),p=ar(),d=Ct(),f=Jt(),m=q(),g=Cn().initInteractions,y=Tt(),x=Mn().clearOutline,b=$().dfltConfig,_=Ln(),w=In(),T=rn(),S=Le(),A=yt().AX_NAME_PATTERN,M=0;function E(e){var t=e._fullLayout;t._redrawFromAutoMarginCount?t._redrawFromAutoMarginCount--:e.emit("plotly_afterplot")}function C(e,t){try{e._fullLayout._paper.style("background",t)}catch(r){i.error(r)}}function P(e,t){C(e,m.combine(t,"white"))}function L(e,r){if(!e._context){e._context=i.extendDeep({},b);var a=t.select("base");e._context._baseUrl=a.size()&&a.attr("href")?window.location.href.split("#")[0]:""}var o,s,l,c=e._context;if(r){for(s=Object.keys(r),o=0;o<s.length;o++)"editable"!==(l=s[o])&&"edits"!==l&&l in c&&("setBackground"===l&&"opaque"===r[l]?c[l]=P:c[l]=r[l]);var u=r.editable;if(void 0!==u)for(c.editable=u,s=Object.keys(c.edits),o=0;o<s.length;o++)c.edits[s[o]]=u;if(r.edits)for(s=Object.keys(r.edits),o=0;o<s.length;o++)(l=s[o])in c.edits&&(c.edits[l]=r.edits[l]);c._exportedPlot=r._exportedPlot}c.staticPlot&&(c.editable=!1,c.edits={},c.autosizable=!1,c.scrollZoom=!1,c.doubleClick=!1,c.showTips=!1,c.showLink=!1,c.displayModeBar=!1),"hover"!==c.displayModeBar||n||(c.displayModeBar=!0),"transparent"!==c.setBackground&&"function"===typeof c.setBackground||(c.setBackground=C),c._hasZeroHeight=c._hasZeroHeight||0===e.clientHeight,c._hasZeroWidth=c._hasZeroWidth||0===e.clientWidth;var h=c.scrollZoom,p=c._scrollZoom={};if(!0===h)p.cartesian=1,p.gl3d=1,p.geo=1,p.mapbox=1,p.map=1;else if("string"===typeof h){var d=h.split("+");for(o=0;o<d.length;o++)p[d[o]]=1}else!1!==h&&(p.gl3d=1,p.geo=1,p.mapbox=1,p.map=1)}function I(e,t){var r,n,i=t+1,a=[];for(r=0;r<e.length;r++)(n=e[r])<0?a.push(i+n):a.push(n);return a}function z(e,t,r){var n,i;for(n=0;n<t.length;n++){if((i=t[n])!==parseInt(i,10))throw new Error("all values in "+r+" must be integers");if(i>=e.data.length||i<-e.data.length)throw new Error(r+" must be valid indices for gd.data.");if(t.indexOf(i,n+1)>-1||i>=0&&t.indexOf(-e.data.length+i)>-1||i<0&&t.indexOf(e.data.length+i)>-1)throw new Error("each index in "+r+" must be unique.")}}function O(e,t,r){if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("currentIndices is a required argument.");if(Array.isArray(t)||(t=[t]),z(e,t,"currentIndices"),"undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&z(e,r,"newIndices"),"undefined"!==typeof r&&t.length!==r.length)throw new Error("current and new indices must be of equal length.")}function R(e,t,n,o,s){!function(e,t,r,n){var a=i.isPlainObject(n);if(!Array.isArray(e.data))throw new Error("gd.data must be an array");if(!i.isPlainObject(t))throw new Error("update must be a key:value object");if("undefined"===typeof r)throw new Error("indices must be an integer or array of integers");for(var o in z(e,r,"indices"),t){if(!Array.isArray(t[o])||t[o].length!==r.length)throw new Error("attribute "+o+" must be an array of length equal to indices array length");if(a&&(!(o in n)||!Array.isArray(n[o])||n[o].length!==t[o].length))throw new Error("when maxPoints is set as a key:value object it must contain a 1:1 corrispondence with the keys and number of traces in the update object")}}(e,t,n,o);for(var l=function(e,t,n,o){var s,l,c,u,h,p=i.isPlainObject(o),d=[];for(var f in Array.isArray(n)||(n=[n]),n=I(n,e.data.length-1),t)for(var m=0;m<n.length;m++){if(s=e.data[n[m]],l=(c=a(s,f)).get(),u=t[f][m],!i.isArrayOrTypedArray(u))throw new Error("attribute: "+f+" index: "+m+" must be an array");if(!i.isArrayOrTypedArray(l))throw new Error("cannot extend missing or non-array attribute: "+f);if(l.constructor!==u.constructor)throw new Error("cannot extend array with an array of a different type: "+f);h=p?o[f][m]:o,r(h)||(h=-1),d.push({prop:c,target:l,insert:u,maxp:Math.floor(h)})}return d}(e,t,n,o),c={},u={},h=0;h<l.length;h++){var p=l[h].prop,d=l[h].maxp,f=s(l[h].target,l[h].insert,d);p.set(f[0]),Array.isArray(c[p.astr])||(c[p.astr]=[]),c[p.astr].push(f[1]),Array.isArray(u[p.astr])||(u[p.astr]=[]),u[p.astr].push(l[h].target.length)}return{update:c,maxPoints:u}}function D(e,t){var r=new e.constructor(e.length+t.length);return r.set(e),r.set(t,e.length),r}function j(t,r,n,a){t=i.getGraphDiv(t),w.clearPromiseQueue(t);var o={};if("string"===typeof r)o[r]=n;else{if(!i.isPlainObject(r))return i.warn("Restyle fail.",r,n,a),Promise.reject();o=i.extendFlat({},r),void 0===a&&(a=n)}Object.keys(o).length&&(t.changed=!0);var l=w.coerceTraceIndices(t,a),c=U(t,o,l),h=c.flags;h.calc&&(t.calcdata=void 0),h.clearAxisTypes&&w.clearAxisTypes(t,l,{});var p=[];h.fullReplot?p.push(e._doPlot):(p.push(u.previousPromises),u.supplyDefaults(t),h.markerSize&&(u.doCalcdata(t),G(p)),h.style&&p.push(T.doTraceStyle),h.colorbars&&p.push(T.doColorBars),p.push(E)),p.push(u.rehover,u.redrag,u.reselect),s.add(t,j,[t,c.undoit,c.traces],j,[t,c.redoit,c.traces]);var d=i.syncOrAsync(p,t);return d&&d.then||(d=Promise.resolve()),d.then((function(){return t.emit("plotly_restyle",c.eventData),t}))}function F(e){return void 0===e?null:e}function B(e,t){return t?function(t,r,n){var i=a(t,r),o=i.set;return i.set=function(t){N((n||"")+r,i.get(),t,e),o(t)},i}:a}function N(e,t,r,n){if(Array.isArray(t)||Array.isArray(r))for(var a=Array.isArray(t)?t:[],o=Array.isArray(r)?r:[],s=Math.max(a.length,o.length),l=0;l<s;l++)N(e+"["+l+"]",a[l],o[l],n);else if(i.isPlainObject(t)||i.isPlainObject(r)){var c=i.isPlainObject(t)?t:{},u=i.isPlainObject(r)?r:{},h=i.extendFlat({},c,u);for(var p in h)N(e+"."+p,c[p],u[p],n)}else void 0===n[e]&&(n[e]=F(t))}function U(e,t,r){var n,o,s=e._fullLayout,p=e._fullData,d=e.data,f=s._guiEditing,m=B(s._preGUI,f),g=i.extendDeepAll({},t),y=S.traceFlags(),v={},x={};function b(){return r.map((function(){}))}function _(e){var t=h.id2name(e);-1===o.indexOf(t)&&o.push(t)}function k(e){return"LAYOUT"+e+".autorange"}function T(e){return"LAYOUT"+e+".range"}function A(e){for(var t=e;t<p.length;t++)if(p[t]._input===d[e])return p[t]}function M(n,i,a){if(Array.isArray(n))n.forEach((function(e){M(e,i,a)}));else if(!(n in t)&&!w.hasParent(t,n)){var o;if("LAYOUT"===n.substr(0,6))o=m(e.layout,n.replace("LAYOUT",""));else{var l=r[a];o=B(s._tracePreGUI[A(l)._fullInput.uid],f)(d[l],n)}n in x||(x[n]=b()),void 0===x[n][a]&&(x[n][a]=F(o.get())),void 0!==i&&o.set(i)}}function E(e){return function(t){return p[t][e]}}function C(e){return function(t,n){return!1===t?p[r[n]][e]:null}}for(var P in t){if(w.hasParent(t,P))throw new Error("cannot set "+P+" and a parent attribute simultaneously");var L,I,z,O,R,D,j=t[P];if("autobinx"!==P&&"autobiny"!==P||(P=P.charAt(P.length-1)+"bins",j=Array.isArray(j)?j.map(C(P)):!1===j?r.map(E(P)):null),v[P]=j,"LAYOUT"!==P.substr(0,6)){for(x[P]=b(),n=0;n<r.length;n++)if(L=d[r[n]],I=A(r[n]),O=(z=B(s._tracePreGUI[I._fullInput.uid],f)(L,P)).get(),void 0!==(R=Array.isArray(j)?j[n%j.length]:j)){var N=z.parts[z.parts.length-1],U=P.substr(0,P.length-N.length-1),V=U?U+".":"",q=U?a(I,U).get():I;if((D=c.getTraceValObject(I,z.parts))&&D.impliedEdits&&null!==R)for(var H in D.impliedEdits)M(i.relativeAttr(P,H),D.impliedEdits[H],n);else if("thicknessmode"!==N&&"lenmode"!==N||O===R||"fraction"!==R&&"pixels"!==R||!q){if("type"===P&&("pie"===R!==("pie"===O)||"funnelarea"===R!==("funnelarea"===O))){var G="x",W="y";"bar"!==R&&"bar"!==O||"h"!==L.orientation||(G="y",W="x"),i.swapAttrs(L,["?","?src"],"labels",G),i.swapAttrs(L,["d?","?0"],"label",G),i.swapAttrs(L,["?","?src"],"values",W),"pie"===O||"funnelarea"===O?(a(L,"marker.color").set(a(L,"marker.colors").get()),s._pielayer.selectAll("g.trace").remove()):l.traceIs(L,"cartesian")&&a(L,"marker.colors").set(a(L,"marker.color").get())}}else{var $=s._size,Z=q.orient,X="top"===Z||"bottom"===Z;if("thicknessmode"===N){var Y=X?$.h:$.w;M(V+"thickness",q.thickness*("fraction"===R?1/Y:Y),n)}else{var K=X?$.w:$.h;M(V+"len",q.len*("fraction"===R?1/K:K),n)}}if(x[P][n]=F(O),-1!==["swapxy","swapxyaxes","orientation","orientationaxes"].indexOf(P)){if("orientation"===P){z.set(R);var J=L.x&&!L.y?"h":"v";if((z.get()||J)===I.orientation)continue}else"orientationaxes"===P&&(L.orientation={v:"h",h:"v"}[I.orientation]);w.swapXYData(L),y.calc=y.clearAxisTypes=!0}else-1!==u.dataArrayContainers.indexOf(z.parts[0])?(w.manageArrayContainers(z,R,x),y.calc=!0):(D?D.arrayOk&&!l.traceIs(I,"regl")&&(i.isArrayOrTypedArray(R)||i.isArrayOrTypedArray(O))?y.calc=!0:S.update(y,D):y.calc=!0,z.set(R))}if(-1!==["swapxyaxes","orientationaxes"].indexOf(P)&&h.swap(e,r),"orientationaxes"===P){var Q=a(e.layout,"hovermode"),ee=Q.get();"x"===ee?Q.set("y"):"y"===ee?Q.set("x"):"x unified"===ee?Q.set("y unified"):"y unified"===ee&&Q.set("x unified")}if(-1!==["orientation","type"].indexOf(P)){for(o=[],n=0;n<r.length;n++){var te=d[r[n]];l.traceIs(te,"cartesian")&&(_(te.xaxis||"x"),_(te.yaxis||"y"))}M(o.map(k),!0,0),M(o.map(T),[0,1],0)}}else z=m(e.layout,P.replace("LAYOUT","")),x[P]=[F(z.get())],z.set(Array.isArray(j)?j[0]:j),y.calc=!0}return(y.calc||y.plot)&&(y.fullReplot=!0),{flags:y,undoit:x,redoit:v,traces:r,eventData:i.extendDeepNoArrays([],[g,r])}}function V(e,t,r){e=i.getGraphDiv(e),w.clearPromiseQueue(e);var n={};if("string"===typeof t)n[t]=r;else{if(!i.isPlainObject(t))return i.warn("Relayout fail.",t,r),Promise.reject();n=i.extendFlat({},t)}Object.keys(n).length&&(e.changed=!0);var a=Y(e,n),o=a.flags;o.calc&&(e.calcdata=void 0);var l=[u.previousPromises];o.layoutReplot?l.push(T.layoutReplot):Object.keys(n).length&&(H(e,o,a)||u.supplyDefaults(e),o.legend&&l.push(T.doLegend),o.layoutstyle&&l.push(T.layoutStyles),o.axrange&&G(l,a.rangesAltered),o.ticks&&l.push(T.doTicksRelayout),o.modebar&&l.push(T.doModeBar),o.camera&&l.push(T.doCamera),o.colorbars&&l.push(T.doColorBars),l.push(E)),l.push(u.rehover,u.redrag,u.reselect),s.add(e,V,[e,a.undoit],V,[e,a.redoit]);var c=i.syncOrAsync(l,e);return c&&c.then||(c=Promise.resolve(e)),c.then((function(){return e.emit("plotly_relayout",a.eventData),e}))}function H(e,t,r){var n,a,o=e._fullLayout;if(!t.axrange)return!1;for(var s in t)if("axrange"!==s&&t[s])return!1;var l=function(e,t){return i.coerce(n,a,d,e,t)},c={};for(var u in r.rangesAltered){var f=h.id2name(u);if(n=e.layout[f],a=o[f],p(n,a,l,c),a._matchGroup)for(var m in a._matchGroup)if(m!==u){var g=o[h.id2name(m)];g.autorange=a.autorange,g.range=a.range.slice(),g._input.range=a.range.slice()}}return!0}function G(e,t){var r=t?function(e){var r=[];for(var n in t){var i=h.getFromId(e,n);if(r.push(n),-1!==(i.ticklabelposition||"").indexOf("inside")&&i._anchorAxis&&r.push(i._anchorAxis._id),i._matchGroup)for(var a in i._matchGroup)t[a]||r.push(a)}return h.draw(e,r,{skipTitle:!0})}:function(e){return h.draw(e,"redraw")};e.push(x,T.doAutoRangeAndConstraints,r,T.drawData,T.finalDraw)}var W=/^[xyz]axis[0-9]*\.range(\[[0|1]\])?$/,Z=/^[xyz]axis[0-9]*\.autorange$/,X=/^[xyz]axis[0-9]*\.domain(\[[0|1]\])?$/;function Y(e,t){var r,n,o,s=e.layout,u=e._fullLayout,p=u._guiEditing,d=B(u._preGUI,p),f=Object.keys(t),m=h.list(e),g=i.extendDeepAll({},t),y={};for(f=Object.keys(t),n=0;n<f.length;n++)if(0===f[n].indexOf("allaxes")){for(o=0;o<m.length;o++){var v=m[o]._id.substr(1),x=-1!==v.indexOf("scene")?v+".":"",b=f[n].replace("allaxes",x+m[o]._name);t[b]||(t[b]=t[f[n]])}delete t[f[n]]}var k=S.layoutFlags(),T={},M={};function E(e,r){if(Array.isArray(e))e.forEach((function(e){E(e,r)}));else if(!(e in t)&&!w.hasParent(t,e)){var n=d(s,e);e in M||(M[e]=F(n.get())),void 0!==r&&n.set(r)}}var C,P={};function L(e){var t=h.name2id(e.split(".")[0]);return P[t]=1,t}for(var I in t){if(w.hasParent(t,I))throw new Error("cannot set "+I+" and a parent attribute simultaneously");for(var z=d(s,I),O=t[I],R=z.parts.length-1;R>0&&"string"!==typeof z.parts[R];)R--;var D=z.parts[R],j=z.parts[R-1]+"."+D,N=z.parts.slice(0,R).join("."),U=a(e.layout,N).get(),V=a(u,N).get(),q=z.get();if(void 0!==O){T[I]=O,M[I]="reverse"===D?O:F(q);var H=c.getLayoutValObject(u,z.parts);if(H&&H.impliedEdits&&null!==O)for(var G in H.impliedEdits)E(i.relativeAttr(I,G),H.impliedEdits[G]);if(-1!==["width","height"].indexOf(I))if(O){E("autosize",null);var $="height"===I?"width":"height";E($,u[$])}else u[I]=e._initialAutoSize[I];else if("autosize"===I)E("width",O?null:u.width),E("height",O?null:u.height);else if(j.match(W))L(j),a(u,N+"._inputRange").set(null);else if(j.match(Z)){L(j),a(u,N+"._inputRange").set(null);var Y=a(u,N).get();Y._inputDomain&&(Y._input.domain=Y._inputDomain.slice())}else j.match(X)&&a(u,N+"._inputDomain").set(null);if("type"===D){C=U;var J="linear"===V.type&&"log"===O,Q="log"===V.type&&"linear"===O;if(J||Q){if(C&&C.range)if(V.autorange)J&&(C.range=C.range[1]>C.range[0]?[1,2]:[2,1]);else{var ee=C.range[0],te=C.range[1];J?(ee<=0&&te<=0&&E(N+".autorange",!0),ee<=0?ee=te/1e6:te<=0&&(te=ee/1e6),E(N+".range[0]",Math.log(ee)/Math.LN10),E(N+".range[1]",Math.log(te)/Math.LN10)):(E(N+".range[0]",Math.pow(10,ee)),E(N+".range[1]",Math.pow(10,te)))}else E(N+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[z.parts[0]]&&"radialaxis"===z.parts[1]&&delete u[z.parts[0]]._subplot.viewInitial["radialaxis.range"],l.getComponentMethod("annotations","convertCoords")(e,V,O,E),l.getComponentMethod("images","convertCoords")(e,V,O,E)}else E(N+".autorange",!0),E(N+".range",null);a(u,N+"._inputRange").set(null)}else if(D.match(A)){var re=a(u,I).get(),ne=(O||{}).type;ne&&"-"!==ne||(ne="linear"),l.getComponentMethod("annotations","convertCoords")(e,re,ne,E),l.getComponentMethod("images","convertCoords")(e,re,ne,E)}var ie=_.containerArrayMatch(I);if(ie){r=ie.array,n=ie.index;var ae=ie.property,oe=H||{editType:"calc"};""!==n&&""===ae&&(_.isAddVal(O)?M[I]=null:_.isRemoveVal(O)?M[I]=(a(s,r).get()||[])[n]:i.warn("unrecognized full object value",t)),S.update(k,oe),y[r]||(y[r]={});var se=y[r][n];se||(se=y[r][n]={}),se[ae]=O,delete t[I]}else"reverse"===D?(U.range?U.range.reverse():(E(N+".autorange",!0),U.range=[1,0]),V.autorange?k.calc=!0:k.plot=!0):("dragmode"===I&&(!1===O&&!1!==q||!1!==O&&!1===q)||u._has("scatter-like")&&u._has("regl")&&"dragmode"===I&&("lasso"===O||"select"===O)&&"lasso"!==q&&"select"!==q?k.plot=!0:H?S.update(k,H):k.calc=!0,z.set(O))}}for(r in y)_.applyContainerArrayChanges(e,d(s,r),y[r],k,d)||(k.plot=!0);for(var le in P){var ce=(C=h.getFromId(e,le))&&C._constraintGroup;if(ce)for(var ue in k.calc=!0,ce)P[ue]||(h.getFromId(e,ue)._constraintShrinkable=!0)}(K(e)||t.height||t.width)&&(k.plot=!0);var he=u.shapes;for(n=0;n<he.length;n++)if(he[n].showlegend){k.calc=!0;break}return(k.plot||k.calc)&&(k.layoutReplot=!0),{flags:k,rangesAltered:P,undoit:M,redoit:T,eventData:g}}function K(e){var t=e._fullLayout,r=t.width,n=t.height;return e.layout.autosize&&u.plotAutoSize(e,e.layout,t),t.width!==r||t.height!==n}function J(t,r,n,a){t=i.getGraphDiv(t),w.clearPromiseQueue(t),i.isPlainObject(r)||(r={}),i.isPlainObject(n)||(n={}),Object.keys(r).length&&(t.changed=!0),Object.keys(n).length&&(t.changed=!0);var o=w.coerceTraceIndices(t,a),l=U(t,i.extendFlat({},r),o),c=l.flags,h=Y(t,i.extendFlat({},n)),p=h.flags;(c.calc||p.calc)&&(t.calcdata=void 0),c.clearAxisTypes&&w.clearAxisTypes(t,o,n);var d=[];p.layoutReplot?d.push(T.layoutReplot):c.fullReplot?d.push(e._doPlot):(d.push(u.previousPromises),H(t,p,h)||u.supplyDefaults(t),c.style&&d.push(T.doTraceStyle),(c.colorbars||p.colorbars)&&d.push(T.doColorBars),p.legend&&d.push(T.doLegend),p.layoutstyle&&d.push(T.layoutStyles),p.axrange&&G(d,h.rangesAltered),p.ticks&&d.push(T.doTicksRelayout),p.modebar&&d.push(T.doModeBar),p.camera&&d.push(T.doCamera),d.push(E)),d.push(u.rehover,u.redrag,u.reselect),s.add(t,J,[t,l.undoit,h.undoit,l.traces],J,[t,l.redoit,h.redoit,l.traces]);var f=i.syncOrAsync(d,t);return f&&f.then||(f=Promise.resolve(t)),f.then((function(){return t.emit("plotly_update",{data:l.eventData,layout:h.eventData}),t}))}function Q(e){return function(t){t._fullLayout._guiEditing=!0;var r=e.apply(null,arguments);return t._fullLayout._guiEditing=!1,r}}var ee=[{pattern:/^hiddenlabels/,attr:"legend.uirevision"},{pattern:/^((x|y)axis\d*)\.((auto)?range|title\.text)/},{pattern:/axis\d*\.showspikes$/,attr:"modebar.uirevision"},{pattern:/(hover|drag)mode$/,attr:"modebar.uirevision"},{pattern:/^(scene\d*)\.camera/},{pattern:/^(geo\d*)\.(projection|center|fitbounds)/},{pattern:/^(ternary\d*\.[abc]axis)\.(min|title\.text)$/},{pattern:/^(polar\d*\.radialaxis)\.((auto)?range|angle|title\.text)/},{pattern:/^(polar\d*\.angularaxis)\.rotation/},{pattern:/^(mapbox\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^(map\d*)\.(center|zoom|bearing|pitch)/},{pattern:/^legend\.(x|y)$/,attr:"editrevision"},{pattern:/^(shapes|annotations)/,attr:"editrevision"},{pattern:/^title\.text$/,attr:"editrevision"}],te=[{pattern:/^selectedpoints$/,attr:"selectionrevision"},{pattern:/(^|value\.)visible$/,attr:"legend.uirevision"},{pattern:/^dimensions\[\d+\]\.constraintrange/},{pattern:/^node\.(x|y|groups)/},{pattern:/^level$/},{pattern:/(^|value\.)name$/},{pattern:/colorbar\.title\.text$/},{pattern:/colorbar\.(x|y)$/,attr:"editrevision"}];function re(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=e.match(n.pattern);if(i){var a=i[1]||"";return{head:a,tail:e.substr(a.length+1),attr:n.attr}}}}function ne(e,t){var r=a(t,e).get();if(void 0!==r)return r;var n=e.split(".");for(n.pop();n.length>1;)if(n.pop(),void 0!==(r=a(t,n.join(".")+".uirevision").get()))return r;return t.uirevision}function ie(e,t){for(var r=0;r<t.length;r++)if(t[r]._fullInput.uid===e)return r;return-1}function ae(e,t,r){for(var n=0;n<t.length;n++)if(t[n].uid===e)return n;return!t[r]||t[r].uid?-1:r}function oe(e,t){var r=i.isPlainObject(e),n=Array.isArray(e);return r||n?(r&&i.isPlainObject(t)||n&&Array.isArray(t))&&JSON.stringify(e)===JSON.stringify(t):e===t}function se(e,t,r,n){var a,o,s,l=n.getValObject,c=n.flags,u=n.immutable,h=n.inArray,p=n.arrayIndex;function d(){var e=a.editType;h&&-1!==e.indexOf("arraydraw")?i.pushUnique(c.arrays[h],p):(S.update(c,a),"none"!==e&&c.nChanges++,n.transition&&a.anim&&c.nChangesAnim++,(W.test(s)||Z.test(s))&&(c.rangesAltered[r[0]]=1),"datarevision"===o&&(c.newDataRevision=1))}function f(e){return"data_array"===e.valType||e.arrayOk}for(o in e){if(c.calc&&!n.transition)return;var m=e[o],g=t[o],y=r.concat(o);if(s=y.join("."),"_"!==o.charAt(0)&&"function"!==typeof m&&m!==g){if(("tick0"===o||"dtick"===o)&&"geo"!==r[0]){var v=t.tickmode;if("auto"===v||"array"===v||!v)continue}if(("range"!==o||!t.autorange)&&("zmin"!==o&&"zmax"!==o||"contourcarpet"!==t.type)&&(a=l(y))&&(!a._compareAsJSON||JSON.stringify(m)!==JSON.stringify(g))){var x,b=a.valType,_=f(a),w=Array.isArray(m),k=Array.isArray(g);if(w&&k){var T="_input_"+o,A=e[T],M=t[T];if(Array.isArray(A)&&A===M)continue}if(void 0===g)_&&w?c.calc=!0:d();else if(a._isLinkedToArray){var E=[],C=!1;h||(c.arrays[o]=E);var P=Math.min(m.length,g.length),L=Math.max(m.length,g.length);if(P!==L){if("arraydraw"!==a.editType){d();continue}C=!0}for(x=0;x<P;x++)se(m[x],g[x],y.concat(x),i.extendFlat({inArray:o,arrayIndex:x},n));if(C)for(x=P;x<L;x++)E.push(x)}else!b&&i.isPlainObject(m)?se(m,g,y,n):_?w&&k?(u&&(c.calc=!0),(u||n.newDataRevision)&&d()):w!==k?c.calc=!0:d():w&&k&&m.length===g.length&&String(m)===String(g)||d()}}}for(o in t)if(!(o in e)&&"_"!==o.charAt(0)&&"function"!==typeof t[o]){if(f(a=l(r.concat(o)))&&Array.isArray(t[o]))return void(c.calc=!0);d()}}function le(e,t){var r;for(r in e)if("_"!==r.charAt(0)){var n=e[r],a=t[r];if(n!==a)if(i.isPlainObject(n)&&i.isPlainObject(a)){if(le(n,a))return!0}else{if(!Array.isArray(n)||!Array.isArray(a))return!0;if(n.length!==a.length)return!0;for(var o=0;o<n.length;o++)if(n[o]!==a[o]){if(!i.isPlainObject(n[o])||!i.isPlainObject(a[o]))return!0;if(le(n[o],a[o]))return!0}}}}function ce(e){var t=e._fullLayout,r=e.getBoundingClientRect();if(!i.equalDomRects(r,t._lastBBox)){var n=t._invTransform=i.inverseTransformMatrix(i.getFullTransformMatrix(e));t._invScaleX=Math.sqrt(n[0][0]*n[0][0]+n[0][1]*n[0][1]+n[0][2]*n[0][2]),t._invScaleY=Math.sqrt(n[1][0]*n[1][0]+n[1][1]*n[1][1]+n[1][2]*n[1][2]),t._lastBBox=r}}e.animate=function(e,t,r){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before animating it. For more details, see https://plotly.com/javascript/animations/");var n=e._transitionData;n._frameQueue||(n._frameQueue=[]);var a=(r=u.supplyAnimationDefaults(r)).transition,o=r.frame;function s(e){return Array.isArray(a)?e>=a.length?a[0]:a[e]:a}function l(e){return Array.isArray(o)?e>=o.length?o[0]:o[e]:o}function c(e,t){var r=0;return function(){if(e&&++r===t)return e()}}return void 0===n._frameWaitingCnt&&(n._frameWaitingCnt=0),new Promise((function(o,h){var p,d,f=0;function m(e){return Array.isArray(a)?f>=a.length?e.transitionOpts=a[f]:e.transitionOpts=a[0]:e.transitionOpts=a,f++,e}var g=[],y=void 0===t||null===t,v=Array.isArray(t);if(y||v||!i.isPlainObject(t)){if(y||-1!==["string","number"].indexOf(typeof t))for(p=0;p<n._frames.length;p++)(d=n._frames[p])&&(y||String(d.group)===String(t))&&g.push({type:"byname",name:String(d.name),data:m({name:d.name})});else if(v)for(p=0;p<t.length;p++){var x=t[p];-1!==["number","string"].indexOf(typeof x)?(x=String(x),g.push({type:"byname",name:x,data:m({name:x})})):i.isPlainObject(x)&&g.push({type:"object",data:m(i.extendFlat({},x))})}}else g.push({type:"object",data:m(i.extendFlat({},t))});for(p=0;p<g.length;p++)if("byname"===(d=g[p]).type&&!n._frameHash[d.data.name])return i.warn('animate failure: frame not found: "'+d.data.name+'"'),void h();-1!==["next","immediate"].indexOf(r.mode)&&function(){if(0!==n._frameQueue.length){for(;n._frameQueue.length;){var t=n._frameQueue.pop();t.onInterrupt&&t.onInterrupt()}e.emit("plotly_animationinterrupted",[])}}(),"reverse"===r.direction&&g.reverse();var b=e._fullLayout._currentFrame;if(b&&r.fromcurrent){var _=-1;for(p=0;p<g.length;p++)if("byname"===(d=g[p]).type&&d.name===b){_=p;break}if(_>0&&_<g.length-1){var k=[];for(p=0;p<g.length;p++)d=g[p],("byname"!==g[p].type||p>_)&&k.push(d);g=k}}g.length>0?function(t){if(0!==t.length){for(var i=0;i<t.length;i++){var a;a="byname"===t[i].type?u.computeFrame(e,t[i].name):t[i].data;var p=l(i),d=s(i);d.duration=Math.min(d.duration,p.duration);var f={frame:a,name:t[i].name,frameOpts:p,transitionOpts:d};i===t.length-1&&(f.onComplete=c(o,2),f.onInterrupt=h),n._frameQueue.push(f)}"immediate"===r.mode&&(n._lastFrameAt=-1/0),n._animationRaf||function(){e.emit("plotly_animating"),n._lastFrameAt=-1/0,n._timeToNext=0,n._runningTransitions=0,n._currentFrame=null;var t=function(){n._animationRaf=window.requestAnimationFrame(t),Date.now()-n._lastFrameAt>n._timeToNext&&function(){n._currentFrame&&n._currentFrame.onComplete&&n._currentFrame.onComplete();var t=n._currentFrame=n._frameQueue.shift();if(t){var r=t.name?t.name.toString():null;e._fullLayout._currentFrame=r,n._lastFrameAt=Date.now(),n._timeToNext=t.frameOpts.duration,u.transition(e,t.frame.data,t.frame.layout,w.coerceTraceIndices(e,t.frame.traces),t.frameOpts,t.transitionOpts).then((function(){t.onComplete&&t.onComplete()})),e.emit("plotly_animatingframe",{name:r,frame:t.frame,animation:{frame:t.frameOpts,transition:t.transitionOpts}})}else e.emit("plotly_animated"),window.cancelAnimationFrame(n._animationRaf),n._animationRaf=null}()};t()}()}}(g):(e.emit("plotly_animated"),o())}))},e.addFrames=function(e,t,r){if(e=i.getGraphDiv(e),null===t||void 0===t)return Promise.resolve();if(!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plotly.com/javascript/animations/");var n,a,o,l,c=e._transitionData._frames,h=e._transitionData._frameHash;if(!Array.isArray(t))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+t);var p=c.length+2*t.length,d=[],f={};for(n=t.length-1;n>=0;n--)if(i.isPlainObject(t[n])){var m=t[n].name,g=(h[m]||f[m]||{}).name,y=t[n].name,v=h[g]||f[g];g&&y&&"number"===typeof y&&v&&M<5&&(M++,i.warn('addFrames: overwriting frame "'+(h[g]||f[g]).name+'" with a frame whose name of type "number" also equates to "'+g+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),5===M&&i.warn("addFrames: This API call has yielded too many of these warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f[m]={name:m},d.push({frame:u.supplyFrameDefaults(t[n]),index:r&&void 0!==r[n]&&null!==r[n]?r[n]:p+n})}d.sort((function(e,t){return e.index>t.index?-1:e.index<t.index?1:0}));var x=[],b=[],_=c.length;for(n=d.length-1;n>=0;n--){if("number"===typeof(a=d[n].frame).name&&i.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;h[a.name="frame "+e._transitionData._counter++];);if(h[a.name]){for(o=0;o<c.length&&(c[o]||{}).name!==a.name;o++);x.push({type:"replace",index:o,value:a}),b.unshift({type:"replace",index:o,value:c[o]})}else l=Math.max(0,Math.min(d[n].index,_)),x.push({type:"insert",index:l,value:a}),b.unshift({type:"delete",index:l}),_++}var w=u.modifyFrames,k=u.modifyFrames,T=[e,b],S=[e,x];return s&&s.add(e,w,T,k,S),u.modifyFrames(e,x)},e.deleteFrames=function(e,t){if(e=i.getGraphDiv(e),!i.isPlotDiv(e))throw new Error("This element is not a Plotly plot: "+e);var r,n,a=e._transitionData._frames,o=[],l=[];if(!t)for(t=[],r=0;r<a.length;r++)t.push(r);for((t=t.slice()).sort(),r=t.length-1;r>=0;r--)n=t[r],o.push({type:"delete",index:n}),l.unshift({type:"insert",index:n,value:a[n]});var c=u.modifyFrames,h=u.modifyFrames,p=[e,l],d=[e,o];return s&&s.add(e,c,p,h,d),u.modifyFrames(e,o)},e.addTraces=function t(r,n,a){r=i.getGraphDiv(r);var o,l,c=[],u=e.deleteTraces,h=t,p=[r,c],d=[r,n];for(function(e,t,r){var n,i;if(!Array.isArray(e.data))throw new Error("gd.data must be an array.");if("undefined"===typeof t)throw new Error("traces must be defined.");for(Array.isArray(t)||(t=[t]),n=0;n<t.length;n++)if("object"!==typeof(i=t[n])||Array.isArray(i)||null===i)throw new Error("all values in traces array must be non-array objects");if("undefined"===typeof r||Array.isArray(r)||(r=[r]),"undefined"!==typeof r&&r.length!==t.length)throw new Error("if indices is specified, traces.length must equal indices.length")}(r,n,a),Array.isArray(n)||(n=[n]),n=n.map((function(e){return i.extendFlat({},e)})),w.cleanData(n),o=0;o<n.length;o++)r.data.push(n[o]);for(o=0;o<n.length;o++)c.push(-n.length+o);if("undefined"===typeof a)return l=e.redraw(r),s.add(r,u,p,h,d),l;Array.isArray(a)||(a=[a]);try{O(r,c,a)}catch(f){throw r.data.splice(r.data.length-n.length,n.length),f}return s.startSequence(r),s.add(r,u,p,h,d),l=e.moveTraces(r,c,a),s.stopSequence(r),l},e.deleteTraces=function t(r,n){r=i.getGraphDiv(r);var a,o,l=[],c=e.addTraces,u=t,h=[r,l,n],p=[r,n];if("undefined"===typeof n)throw new Error("indices must be an integer or array of integers.");for(Array.isArray(n)||(n=[n]),z(r,n,"indices"),(n=I(n,r.data.length-1)).sort(i.sorterDes),a=0;a<n.length;a+=1)o=r.data.splice(n[a],1)[0],l.push(o);var d=e.redraw(r);return s.add(r,c,h,u,p),d},e.extendTraces=function t(r,n,a,o){var l=R(r=i.getGraphDiv(r),n,a,o,(function(e,t,r){var n,a;if(i.isTypedArray(e))if(r<0){var o=new e.constructor(0),s=D(e,t);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(l)),a.set(e),a.set(t.subarray(0,l),e.length)}else{var c=r-t.length,u=e.length-c;n.set(e.subarray(u)),n.set(t,c),a.set(e.subarray(0,u))}else n=e.concat(t),a=r>=0&&r<n.length?n.splice(0,n.length-r):[];return[n,a]})),c=e.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,e.prependTraces,u,t,arguments),c},e.moveTraces=function t(r,n,a){var o,l=[],c=[],u=t,h=t,p=[r=i.getGraphDiv(r),a,n],d=[r,n,a];if(O(r,n,a),n=Array.isArray(n)?n:[n],"undefined"===typeof a)for(a=[],o=0;o<n.length;o++)a.push(-n.length+o);for(a=Array.isArray(a)?a:[a],n=I(n,r.data.length-1),a=I(a,r.data.length-1),o=0;o<r.data.length;o++)-1===n.indexOf(o)&&l.push(r.data[o]);for(o=0;o<n.length;o++)c.push({newIndex:a[o],trace:r.data[n[o]]});for(c.sort((function(e,t){return e.newIndex-t.newIndex})),o=0;o<c.length;o+=1)l.splice(c[o].newIndex,0,c[o].trace);r.data=l;var f=e.redraw(r);return s.add(r,u,p,h,d),f},e.prependTraces=function t(r,n,a,o){var l=R(r=i.getGraphDiv(r),n,a,o,(function(e,t,r){var n,a;if(i.isTypedArray(e))if(r<=0){var o=new e.constructor(0),s=D(t,e);r<0?(n=s,a=o):(n=o,a=s)}else if(n=new e.constructor(r),a=new e.constructor(e.length+t.length-r),r===t.length)n.set(t),a.set(e);else if(r<t.length){var l=t.length-r;n.set(t.subarray(0,l)),a.set(t.subarray(l)),a.set(e,l)}else{var c=r-t.length;n.set(t),n.set(e.subarray(0,c),t.length),a.set(e.subarray(c))}else n=t.concat(e),a=r>=0&&r<n.length?n.splice(r,n.length):[];return[n,a]})),c=e.redraw(r),u=[r,l.update,a,l.maxPoints];return s.add(r,e.extendTraces,u,t,arguments),c},e.newPlot=function(t,r,n,a){return t=i.getGraphDiv(t),u.cleanPlot([],{},t._fullData||[],t._fullLayout||{}),u.purge(t),e._doPlot(t,r,n,a)},e._doPlot=function(r,n,a,s){var c;if(r=i.getGraphDiv(r),o.init(r),i.isPlainObject(n)){var p=n;n=p.data,a=p.layout,s=p.config,c=p.frames}if(!1===o.triggerHandler(r,"plotly_beforeplot",[n,a,s]))return Promise.reject();n||a||i.isPlotDiv(r)||i.warn("Calling _doPlot as if redrawing but this container doesn't yet have a plot.",r),L(r,s),a||(a={}),t.select(r).classed("js-plotly-plot",!0),f.makeTester(),Array.isArray(r._promises)||(r._promises=[]);var d=0===(r.data||[]).length&&Array.isArray(n);Array.isArray(n)&&(w.cleanData(n),d?r.data=n:r.data.push.apply(r.data,n),r.empty=!1),r.layout&&!d||(r.layout=w.cleanLayout(a)),u.supplyDefaults(r);var m=r._fullLayout,v=m._has("cartesian");m._replotting=!0,(d||m._shouldCreateBgLayer)&&(function(e){var r=t.select(e),n=e._fullLayout;if(n._calcInverseTransform=ce,n._calcInverseTransform(e),n._container=r.selectAll(".plot-container").data([0]),n._container.enter().insert("div",":first-child").classed("plot-container",!0).classed("plotly",!0).style({width:"100%",height:"100%"}),n._paperdiv=n._container.selectAll(".svg-container").data([0]),n._paperdiv.enter().append("div").classed("user-select-none",!0).classed("svg-container",!0).style("position","relative"),n._glcontainer=n._paperdiv.selectAll(".gl-container").data([{}]),n._glcontainer.enter().append("div").classed("gl-container",!0),n._paperdiv.selectAll(".main-svg").remove(),n._paperdiv.select(".modebar-container").remove(),n._paper=n._paperdiv.insert("svg",":first-child").classed("main-svg",!0),n._toppaper=n._paperdiv.append("svg").classed("main-svg",!0),n._modebardiv=n._paperdiv.append("div"),delete n._modeBar,n._hoverpaper=n._paperdiv.append("svg").classed("main-svg",!0),!n._uid){var a={};t.selectAll("defs").each((function(){this.id&&(a[this.id.split("-")[1]]=1)})),n._uid=i.randstr(a)}n._paperdiv.selectAll(".main-svg").attr(y.svgAttrs),n._defs=n._paper.append("defs").attr("id","defs-"+n._uid),n._clips=n._defs.append("g").classed("clips",!0),n._topdefs=n._toppaper.append("defs").attr("id","topdefs-"+n._uid),n._topclips=n._topdefs.append("g").classed("clips",!0),n._bgLayer=n._paper.append("g").classed("bglayer",!0),n._draggers=n._paper.append("g").classed("draglayer",!0);var o=n._paper.append("g").classed("layer-below",!0);n._imageLowerLayer=o.append("g").classed("imagelayer",!0),n._shapeLowerLayer=o.append("g").classed("shapelayer",!0),n._cartesianlayer=n._paper.append("g").classed("cartesianlayer",!0),n._polarlayer=n._paper.append("g").classed("polarlayer",!0),n._smithlayer=n._paper.append("g").classed("smithlayer",!0),n._ternarylayer=n._paper.append("g").classed("ternarylayer",!0),n._geolayer=n._paper.append("g").classed("geolayer",!0),n._funnelarealayer=n._paper.append("g").classed("funnelarealayer",!0),n._pielayer=n._paper.append("g").classed("pielayer",!0),n._iciclelayer=n._paper.append("g").classed("iciclelayer",!0),n._treemaplayer=n._paper.append("g").classed("treemaplayer",!0),n._sunburstlayer=n._paper.append("g").classed("sunburstlayer",!0),n._indicatorlayer=n._toppaper.append("g").classed("indicatorlayer",!0),n._glimages=n._paper.append("g").classed("glimages",!0);var s=n._toppaper.append("g").classed("layer-above",!0);n._imageUpperLayer=s.append("g").classed("imagelayer",!0),n._shapeUpperLayer=s.append("g").classed("shapelayer",!0),n._selectionLayer=n._toppaper.append("g").classed("selectionlayer",!0),n._infolayer=n._toppaper.append("g").classed("infolayer",!0),n._menulayer=n._toppaper.append("g").classed("menulayer",!0),n._zoomlayer=n._toppaper.append("g").classed("zoomlayer",!0),n._hoverlayer=n._hoverpaper.append("g").classed("hoverlayer",!0),n._modebardiv.classed("modebar-container",!0).style("position","absolute").style("top","0px").style("right","0px"),e.emit("plotly_framework")}(r),m._shouldCreateBgLayer&&delete m._shouldCreateBgLayer),f.initGradients(r),f.initPatterns(r),d&&h.saveShowSpikeInitial(r);var x=!r.calcdata||r.calcdata.length!==(r._fullData||[]).length;x&&u.doCalcdata(r);for(var b=0;b<r.calcdata.length;b++)r.calcdata[b][0].trace=r._fullData[b];r._context.responsive?r._responsiveChartHandler||(r._responsiveChartHandler=function(){i.isHidden(r)||u.resize(r)},window.addEventListener("resize",r._responsiveChartHandler)):i.clearResponsive(r);var _=i.extendFlat({},m._size),k=0;function S(){if(u.clearAutoMarginIds(r),T.drawMarginPushers(r),h.allowAutoMargin(r),r._fullLayout.title.text&&r._fullLayout.title.automargin&&u.allowAutoMargin(r,"title.automargin"),m._has("pie"))for(var e=r._fullData,t=0;t<e.length;t++){var n=e[t];"pie"===n.type&&n.automargin&&u.allowAutoMargin(r,"pie."+n.uid+".automargin")}return u.doAutoMargin(r),u.previousPromises(r)}function A(){r._transitioning||(T.doAutoRangeAndConstraints(r),d&&h.saveRangeInitial(r),l.getComponentMethod("rangeslider","calcAutorange")(r))}var M=[u.previousPromises,function(){if(c)return e.addFrames(r,c)},function e(){for(var t=m._basePlotModules,n=0;n<t.length;n++)t[n].drawFramework&&t[n].drawFramework(r);!m._glcanvas&&m._has("gl")&&(m._glcanvas=m._glcontainer.selectAll(".gl-canvas").data([{key:"contextLayer",context:!0,pick:!1},{key:"focusLayer",context:!1,pick:!1},{key:"pickLayer",context:!1,pick:!0}],(function(e){return e.key})),m._glcanvas.enter().append("canvas").attr("class",(function(e){return"gl-canvas gl-canvas-"+e.key.replace("Layer","")})).style({position:"absolute",top:0,left:0,overflow:"visible","pointer-events":"none"}));var a=r._context.plotGlPixelRatio;if(m._glcanvas){m._glcanvas.attr("width",m.width*a).attr("height",m.height*a).style("width",m.width+"px").style("height",m.height+"px");var o=m._glcanvas.data()[0].regl;if(o&&(Math.floor(m.width*a)!==o._gl.drawingBufferWidth||Math.floor(m.height*a)!==o._gl.drawingBufferHeight)){var s="WebGL context buffer and canvas dimensions do not match due to browser/WebGL bug.";if(!k)return i.log(s+" Clearing graph and plotting again."),u.cleanPlot([],{},r._fullData,m),u.supplyDefaults(r),m=r._fullLayout,u.doCalcdata(r),k++,e();i.error(s)}}return"h"===m.modebar.orientation?m._modebardiv.style("height",null).style("width","100%"):m._modebardiv.style("width",null).style("height",m.height+"px"),u.previousPromises(r)},S,function(){if(u.didMarginChange(_,m._size))return i.syncOrAsync([S,T.layoutStyles],r)}];v&&M.push((function(){if(x)return i.syncOrAsync([l.getComponentMethod("shapes","calcAutorange"),l.getComponentMethod("annotations","calcAutorange"),A],r);A()})),M.push(T.layoutStyles),v&&M.push((function(){return h.draw(r,d?"":"redraw")}),(function(e){var t=e._fullLayout._insideTickLabelsUpdaterange;if(t)return e._fullLayout._insideTickLabelsUpdaterange=void 0,V(e,t).then((function(){h.saveRangeInitial(e,!0)}))})),M.push(T.drawData,T.finalDraw,g,u.addLinks,u.rehover,u.redrag,u.reselect,u.doAutoMargin,u.previousPromises);var C=i.syncOrAsync(M,r);return C&&C.then||(C=Promise.resolve()),C.then((function(){return E(r),r}))},e.purge=function(e){var t=(e=i.getGraphDiv(e))._fullLayout||{},r=e._fullData||[];return u.cleanPlot([],{},r,t),u.purge(e),o.purge(e),t._container&&t._container.remove(),delete e._context,e},e.react=function(t,r,n,o){var s,h;t=i.getGraphDiv(t),w.clearPromiseQueue(t);var p=t._fullData,d=t._fullLayout;if(i.isPlotDiv(t)&&p&&d){if(i.isPlainObject(r)){var f=r;r=f.data,n=f.layout,o=f.config,s=f.frames}var m=!1;if(o){var g=i.extendDeep({},t._context);t._context=void 0,L(t,o),m=le(g,t._context)}t.data=r||[],w.cleanData(t.data),t.layout=n||{},w.cleanLayout(t.layout),function(e,t,r,n){var o,s,l,c,u,h,p,d,f,m,g=n._preGUI,y=[],v={},x={};for(o in g){if(u=re(o,ee)){if(f=u.head,m=u.tail,s=u.attr||f+".uirevision",(c=(l=a(n,s).get())&&ne(s,t))&&c===l){if(null===(h=g[o])&&(h=void 0),oe(d=(p=a(t,o)).get(),h)){void 0===d&&"autorange"===m&&y.push(f),p.set(F(a(n,o).get()));continue}if("autorange"===m||"range["===m.substr(0,6)){var b=g[f+".range[0]"],_=g[f+".range[1]"],w=g[f+".autorange"];if(w||null===w&&null===b&&null===_){if(!(f in v)){var k=a(t,f).get();v[f]=k&&(k.autorange||!1!==k.autorange&&(!k.range||2!==k.range.length))}if(v[f]){p.set(F(a(n,o).get()));continue}}}}}else i.warn("unrecognized GUI edit: "+o);delete g[o],u&&"range["===u.tail.substr(0,6)&&(x[u.head]=1)}for(var T=0;T<y.length;T++){var S=y[T];if(x[S]){var A=a(t,S).get();A&&delete A.autorange}}var M=n._tracePreGUI;for(var E in M){var C,P=M[E],L=null;for(o in P){if(!L){var I=ie(E,r);if(I<0){delete M[E];break}var z=ae(E,e,(C=r[I]._fullInput).index);if(z<0){delete M[E];break}L=e[z]}if(u=re(o,te)){if(u.attr?c=(l=a(n,u.attr).get())&&ne(u.attr,t):(l=C.uirevision,void 0===(c=L.uirevision)&&(c=t.uirevision)),c&&c===l&&(null===(h=P[o])&&(h=void 0),oe(d=(p=a(L,o)).get(),h))){p.set(F(a(C,o).get()));continue}}else i.warn("unrecognized GUI edit: "+o+" in trace uid "+E);delete P[o]}}}(t.data,t.layout,p,d),u.supplyDefaults(t,{skipUpdateCalc:!0});var y=t._fullData,v=t._fullLayout,x=void 0===v.datarevision,b=v.transition,_=function(e,t,r,n,i){var a=S.layoutFlags();function o(e){return c.getLayoutValObject(r,e)}for(var s in a.arrays={},a.rangesAltered={},a.nChanges=0,a.nChangesAnim=0,r)if((s.startsWith("xaxis")||s.startsWith("yaxis"))&&t[s]){var l=r[s].domain,u=t[s].domain,h=t[s]._inputDomain;t[s]._inputDomain&&(l[0]===h[0]&&l[1]===h[1]?r[s].domain=t[s].domain:l[0]===u[0]&&l[1]===u[1]||(r[s]._inputDomain=null))}var p={getValObject:o,flags:a,immutable:n,transition:i,gd:e};return se(t,r,[],p),(a.plot||a.calc)&&(a.layoutReplot=!0),i&&a.nChanges&&a.nChangesAnim&&(a.anim=a.nChanges===a.nChangesAnim?"all":"some"),a}(t,d,v,x,b),k=_.newDataRevision,A=function(e,t,r,n,i,a){var o=t.length===r.length;if(!i&&!o)return{fullReplot:!0,calc:!0};var s,l,u=S.traceFlags();function h(e){var t=c.getTraceValObject(l,e);return!l._module.animatable&&t.anim&&(t.anim=!1),t}u.arrays={},u.nChanges=0,u.nChangesAnim=0;var p={getValObject:h,flags:u,immutable:n,transition:i,newDataRevision:a,gd:e},d={};for(s=0;s<t.length;s++)if(r[s]){if(d[(l=r[s]._fullInput).uid])continue;d[l.uid]=1,se(t[s]._fullInput,l,[],p)}return(u.calc||u.plot)&&(u.fullReplot=!0),i&&u.nChanges&&u.nChangesAnim&&(u.anim=u.nChanges===u.nChangesAnim&&o?"all":"some"),u}(t,p,y,x,b,k);if(K(t)&&(_.layoutReplot=!0),A.calc||_.calc){t.calcdata=void 0;for(var M=Object.getOwnPropertyNames(v),C=0;C<M.length;C++){var P=M[C],I=P.substring(0,5);if("xaxis"===I||"yaxis"===I){var z=v[P]._emptyCategories;z&&z()}}}else u.supplyDefaultsUpdateCalc(t.calcdata,y);var O=[];if(s&&(t._transitionData={},u.createTransitionData(t),O.push((function(){return e.addFrames(t,s)}))),v.transition&&!m&&(A.anim||_.anim))_.ticks&&O.push(T.doTicksRelayout),u.doCalcdata(t),T.doAutoRangeAndConstraints(t),O.push((function(){return u.transitionFromReact(t,A,_,d)}));else if(A.fullReplot||_.layoutReplot||m)t._fullLayout._skipDefaults=!0,O.push(e._doPlot);else{for(var R in _.arrays){var D=_.arrays[R];if(D.length){var j=l.getComponentMethod(R,"drawOne");if(j!==i.noop)for(var B=0;B<D.length;B++)j(t,D[B]);else{var N=l.getComponentMethod(R,"draw");if(N===i.noop)throw new Error("cannot draw components: "+R);N(t)}}}O.push(u.previousPromises),A.style&&O.push(T.doTraceStyle),(A.colorbars||_.colorbars)&&O.push(T.doColorBars),_.legend&&O.push(T.doLegend),_.layoutstyle&&O.push(T.layoutStyles),_.axrange&&G(O),_.ticks&&O.push(T.doTicksRelayout),_.modebar&&O.push(T.doModeBar),_.camera&&O.push(T.doCamera),O.push(E)}O.push(u.rehover,u.redrag,u.reselect),(h=i.syncOrAsync(O,t))&&h.then||(h=Promise.resolve(t))}else h=e.newPlot(t,r,n,o);return h.then((function(){return t.emit("plotly_react",{data:r,layout:n}),t}))},e.redraw=function(t){if(t=i.getGraphDiv(t),!i.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t);return w.cleanData(t.data),w.cleanLayout(t.layout),t.calcdata=void 0,e._doPlot(t).then((function(){return t.emit("plotly_redraw"),t}))},e.relayout=V,e.restyle=j,e.setPlotConfig=function(e){return i.extendFlat(b,e)},e.update=J,e._guiRelayout=Q(V),e._guiRestyle=Q(j),e._guiUpdate=Q(J),e._storeDirectGUIEdit=function(e,t,r){for(var n in r)N(n,a(e,n).get(),r[n],t)}}}),On=p({"src/snapshot/helpers.js"(e){var t=Ve();e.getDelay=function(e){return e._has&&(e._has("gl3d")||e._has("mapbox")||e._has("map"))?500:0},e.getRedrawFunc=function(e){return function(){t.getComponentMethod("colorbar","draw")(e)}},e.encodeSVG=function(e){return"data:image/svg+xml,"+encodeURIComponent(e)},e.encodeJSON=function(e){return"data:application/json,"+encodeURIComponent(e)};var r=window.URL||window.webkitURL;e.createObjectURL=function(e){return r.createObjectURL(e)},e.revokeObjectURL=function(e){return r.revokeObjectURL(e)},e.createBlob=function(e,t){if("svg"===t)return new window.Blob([e],{type:"image/svg+xml;charset=utf-8"});if("full-json"===t)return new window.Blob([e],{type:"application/json;charset=utf-8"});var r=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(window.atob(e));return new window.Blob([r],{type:"image/"+t})},e.octetStream=function(e){document.location.href="data:application/octet-stream"+e},e.IMAGE_URL_PREFIX=/^data:image\/\w+;base64,/}}),Rn=p({"src/snapshot/tosvg.js"(e,t){var r=v(),n=(st(),Jt()),i=q(),a=(Tt(),/"/g),o="TOBESTRIPPED",s=new RegExp('("'+o+")|("+o+'")',"g");t.exports=function(e,t,l){var c,u=e._fullLayout,h=u._paper,p=u._toppaper,d=u.width,f=u.height;h.insert("rect",":first-child").call(n.setRect,0,0,d,f).call(i.fill,u.paper_bgcolor);var m=u._basePlotModules||[];for(c=0;c<m.length;c++){var g=m[c];g.toSVG&&g.toSVG(e)}if(p){var y=p.node().childNodes,v=Array.prototype.slice.call(y);for(c=0;c<v.length;c++){var x=v[c];x.childNodes.length&&h.node().appendChild(x)}}u._draggers&&u._draggers.remove(),h.node().style.background="",h.selectAll("text").attr({"data-unformatted":null,"data-math":null}).each((function(){var e=r.select(this);if("hidden"!==this.style.visibility&&"none"!==this.style.display){e.style({visibility:null,display:null});var t=this.style.fontFamily;t&&-1!==t.indexOf('"')&&e.style("font-family",t.replace(a,o));var n=this.style.fontWeight;!n||"normal"!==n&&"400"!==n||e.style("font-weight",void 0);var i=this.style.fontStyle;i&&"normal"===i&&e.style("font-style",void 0);var s=this.style.fontVariant;s&&"normal"===s&&e.style("font-variant",void 0)}else e.remove()})),h.selectAll(".gradient_filled,.pattern_filled").each((function(){var e=r.select(this),t=this.style.fill;t&&-1!==t.indexOf("url(")&&e.style("fill",t.replace(a,o));var n=this.style.stroke;n&&-1!==n.indexOf("url(")&&e.style("stroke",n.replace(a,o))})),"pdf"!==t&&"eps"!==t||h.selectAll("#MathJax_SVG_glyphs path").attr("stroke-width",0),"svg"===t&&l&&(h.attr("width",l*d),h.attr("height",l*f),h.attr("viewBox","0 0 "+d+" "+f));var b=(new window.XMLSerializer).serializeToString(h.node());return b=(b=(b=function(e){var t=r.select("body").append("div").style({display:"none"}).html(""),n=e.replace(/(&[^;]*;)/gi,(function(e){return"&lt;"===e?"&#60;":"&rt;"===e?"&#62;":-1!==e.indexOf("<")||-1!==e.indexOf(">")?"":t.html(e).text()}));return t.remove(),n}(b)).replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&amp;")).replace(s,"'")}}}),Dn=p({"src/snapshot/svgtoimg.js"(e,t){var r=st(),n=ht().EventEmitter,i=On();t.exports=function(e){var t=e.emitter||new n,a=new Promise((function(n,a){var o,s,l=window.Image,c=e.svg,u=e.format||"png",h=e.canvas,p=e.scale||1,d=e.width||300,f=e.height||150,m=p*d,g=p*f,y=h.getContext("2d",{willReadFrequently:!0}),v=new l;"svg"===u||r.isSafari()?s=i.encodeSVG(c):(o=i.createBlob(c,"svg"),s=i.createObjectURL(o)),h.width=m,h.height=g,v.onload=function(){var r;switch(o=null,i.revokeObjectURL(s),"svg"!==u&&y.drawImage(v,0,0,m,g),u){case"jpeg":r=h.toDataURL("image/jpeg");break;case"png":r=h.toDataURL("image/png");break;case"webp":r=h.toDataURL("image/webp");break;case"svg":r=s;break;default:var l="Image format is not jpeg, png, svg or webp.";if(a(new Error(l)),!e.promise)return t.emit("error",l)}n(r),e.promise||t.emit("success",r)},v.onerror=function(r){if(o=null,i.revokeObjectURL(s),a(r),!e.promise)return t.emit("error",r)},v.src=s}));return e.promise?a:t}}}),jn=p({"src/plot_api/to_image.js"(e,t){var r=k(),n=zn(),i=kt(),a=st(),o=On(),s=Rn(),l=Dn(),c=g().version,u={format:{valType:"enumerated",values:["png","jpeg","webp","svg","full-json"],dflt:"png"},width:{valType:"number",min:1},height:{valType:"number",min:1},scale:{valType:"number",min:0,dflt:1},setBackground:{valType:"any",dflt:!1},imageDataOnly:{valType:"boolean",dflt:!1}};t.exports=function(e,t){var h,p,d,f;function m(e){return!(e in t)||a.validate(t[e],u[e])}if(t=t||{},a.isPlainObject(e)?(h=e.data||[],p=e.layout||{},d=e.config||{},f={}):(e=a.getGraphDiv(e),h=a.extendDeep([],e.data),p=a.extendDeep({},e.layout),d=e._context,f=e._fullLayout||{}),!m("width")&&null!==t.width||!m("height")&&null!==t.height)throw new Error("Height and width should be pixel values.");if(!m("format"))throw new Error("Export format is not "+a.join2(u.format.values,", "," or ")+".");var g={};function y(e,r){return a.coerce(t,g,u,e,r)}var v=y("format"),x=y("width"),b=y("height"),_=y("scale"),w=y("setBackground"),k=y("imageDataOnly"),T=document.createElement("div");T.style.position="absolute",T.style.left="-5000px",document.body.appendChild(T);var S=a.extendFlat({},p);x?S.width=x:null===t.width&&r(f.width)&&(S.width=f.width),b?S.height=b:null===t.height&&r(f.height)&&(S.height=f.height);var A=a.extendFlat({},d,{_exportedPlot:!0,staticPlot:!0,setBackground:w}),M=o.getRedrawFunc(T);function E(){return new Promise((function(e){setTimeout(e,o.getDelay(T._fullLayout))}))}function C(){return new Promise((function(e,t){var r=s(T,v,_),u=T._fullLayout.width,h=T._fullLayout.height;function p(){n.purge(T),document.body.removeChild(T)}if("full-json"===v){var d=i.graphJson(T,!1,"keepdata","object",!0,!0);return d.version=c,d=JSON.stringify(d),p(),e(k?d:o.encodeJSON(d))}if(p(),"svg"===v)return e(k?r:o.encodeSVG(r));var f=document.createElement("canvas");f.id=a.randstr(),l({format:v,width:u,height:h,scale:_,canvas:f,svg:r,promise:!0}).then(e).catch(t)}))}return new Promise((function(e,t){n.newPlot(T,h,S,A).then(M).then(E).then(C).then((function(t){e(function(e){return k?e.replace(o.IMAGE_URL_PREFIX,""):e}(t))})).catch((function(e){t(e)}))}))}}}),Fn=p({"src/plot_api/validate.js"(e,t){var r=st(),n=kt(),i=mt(),a=$().dfltConfig,o=r.isPlainObject,s=Array.isArray,l=r.isArrayOrTypedArray;function c(e,t,n,i,a,u){u=u||[];for(var h=Object.keys(e),m=0;m<h.length;m++){var g=h[m],y=u.slice();y.push(g);var v=e[g],x=t[g],b=f(n,g),_=(b||{}).valType,w="info_array"===_,k="colorscale"===_,T=(b||{}).items;if(d(n,g))if(o(v)&&o(x)&&"any"!==_)c(v,x,b,i,a,y);else if(w&&s(v)){v.length>x.length&&i.push(p("unused",a,y.concat(x.length)));var S,A,M,E,C,P=x.length,L=Array.isArray(T);if(L&&(P=Math.min(P,T.length)),2===b.dimensions)for(A=0;A<P;A++)if(s(v[A])){v[A].length>x[A].length&&i.push(p("unused",a,y.concat(A,x[A].length)));var I=x[A].length;for(S=0;S<(L?Math.min(I,T[A].length):I);S++)M=L?T[A][S]:T,E=v[A][S],C=x[A][S],r.validate(E,M)?C!==E&&C!==+E&&i.push(p("dynamic",a,y.concat(A,S),E,C)):i.push(p("value",a,y.concat(A,S),E))}else i.push(p("array",a,y.concat(A),v[A]));else for(A=0;A<P;A++)M=L?T[A]:T,E=v[A],C=x[A],r.validate(E,M)?C!==E&&C!==+E&&i.push(p("dynamic",a,y.concat(A),E,C)):i.push(p("value",a,y.concat(A),E))}else if(b.items&&!w&&s(v)){var z,O,R=T[Object.keys(T)[0]],D=[];for(z=0;z<x.length;z++){var j=x[z]._index||z;if((O=y.slice()).push(j),o(v[j])&&o(x[z])){D.push(j);var F=v[j],B=x[z];o(F)&&!1!==F.visible&&!1===B.visible?i.push(p("invisible",a,O)):c(F,B,R,i,a,O)}}for(z=0;z<v.length;z++)(O=y.slice()).push(z),o(v[z])?-1===D.indexOf(z)&&i.push(p("unused",a,O)):i.push(p("object",a,O,v[z]))}else!o(v)&&o(x)?i.push(p("object",a,y,v)):l(v)||!l(x)||w||k?g in t?r.validate(v,b)?"enumerated"===b.valType&&(b.coerceNumber&&v!==+x||v!==x)&&i.push(p("dynamic",a,y,v,x)):i.push(p("value",a,y,v)):i.push(p("unused",a,y,v)):i.push(p("array",a,y,v));else i.push(p("schema",a,y))}return i}t.exports=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={});var l,u,h=i.get(),d=[],f={_context:r.extendFlat({},a)};s(e)?(f.data=r.extendDeep([],e),l=e):(f.data=[],l=[],d.push(p("array","data"))),o(t)?(f.layout=r.extendDeep({},t),u=t):(f.layout={},u={},arguments.length>1&&d.push(p("object","layout"))),n.supplyDefaults(f);for(var m=f._fullData,g=l.length,y=0;y<g;y++){var v=l[y],x=["data",y];if(o(v)){var b=m[y],_=b.type,w=h.traces[_].attributes;w.type={valType:"enumerated",values:[_]},!1===b.visible&&!1!==v.visible&&d.push(p("invisible",x)),c(v,b,w,d,x)}else d.push(p("object",x))}var k=f._fullLayout,T=function(e,t){for(var n=e.layout.layoutAttributes,i=0;i<t.length;i++){var a=t[i],o=e.traces[a.type],s=o.layoutAttributes;s&&(a.subplot?r.extendFlat(n[o.attributes.subplot.dflt],s):r.extendFlat(n,s))}return n}(h,m);return c(u,k,T,d,"layout"),0===d.length?void 0:d};var u={object:function(e,t){return("layout"===e&&""===t?"The layout argument":"data"===e[0]&&""===t?"Trace "+e[1]+" in the data argument":h(e)+"key "+t)+" must be linked to an object container"},array:function(e,t){return("data"===e?"The data argument":h(e)+"key "+t)+" must be linked to an array container"},schema:function(e,t){return h(e)+"key "+t+" is not part of the schema"},unused:function(e,t,r){var n=o(r)?"container":"key";return h(e)+n+" "+t+" did not get coerced"},dynamic:function(e,t,r,n){return[h(e)+"key",t,"(set to '"+r+"')","got reset to","'"+n+"'","during defaults."].join(" ")},invisible:function(e,t){return(t?h(e)+"item "+t:"Trace "+e[1])+" got defaulted to be not visible"},value:function(e,t,r){return[h(e)+"key "+t,"is set to an invalid value ("+r+")"].join(" ")}};function h(e){return s(e)?"In data trace "+e[1]+", ":"In "+e+", "}function p(e,t,n,i,a){var o,l;n=n||"",s(t)?(o=t[0],l=t[1]):(o=t,l=null);var c=function(e){if(!s(e))return String(e);for(var t="",r=0;r<e.length;r++){var n=e[r];"number"===typeof n?t=t.substr(0,t.length-1)+"["+n+"]":t+=n,r<e.length-1&&(t+=".")}return t}(n),h=u[e](t,c,i,a);return r.log(h),{code:e,container:o,trace:l,path:n,astr:c,msg:h}}function d(e,t){var r=g(t),n=r.keyMinusId,i=r.id;return!!(n in e&&e[n]._isSubplotObj&&i)||t in e}function f(e,t){return t in e?e[t]:e[g(t).keyMinusId]}var m=r.counterRegex("([a-z]+)");function g(e){var t=e.match(m);return{keyMinusId:t&&t[1],id:t&&t[2]}}}}),Bn=p({"src/snapshot/filesaver.js"(e,t){var r=st(),n=On();t.exports=function(e,t,i){var a=document.createElement("a"),o="download"in a;return new Promise((function(s,l){var c,u;if(o)return c=n.createBlob(e,i),u=n.createObjectURL(c),a.href=u,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),n.revokeObjectURL(u),c=null,s(t);if(r.isSafari()){var h="svg"===i?",":";base64,";return n.octetStream(h+encodeURIComponent(e)),s(t)}l(new Error("download error"))}))}}}),Nn=p({"src/snapshot/download.js"(e,t){var r=st(),n=jn(),i=Bn();On(),t.exports=function(e,t){var a;return r.isPlainObject(e)||(a=r.getGraphDiv(e)),(t=t||{}).format=t.format||"png",t.width=t.width||null,t.height=t.height||null,t.imageDataOnly=!0,new Promise((function(r,o){a&&a._snapshotInProgress&&o(new Error("Snapshotting already in progress.")),a&&(a._snapshotInProgress=!0);var s=n(e,t),l=t.filename||e.fn||"newplot";l+="."+t.format.replace("-","."),s.then((function(e){return a&&(a._snapshotInProgress=!1),i(e,l,t.format)})).then((function(e){r(e)})).catch((function(e){a&&(a._snapshotInProgress=!1),o(e)}))}))}}}),Un=p({"src/plot_api/template_api.js"(e){var t=st(),r=t.isPlainObject,n=mt(),i=kt(),a=N(),o=gt(),s=$().dfltConfig;function l(e,n){e=t.extendDeep({},e);var i,a,s=Object.keys(e).sort();function u(t,n,i){if(r(n)&&r(t))l(t,n);else if(Array.isArray(n)&&Array.isArray(t)){var s=o.arrayTemplater({_template:e},i);for(a=0;a<n.length;a++){var c=n[a],u=s.newItem(c)._template;u&&l(u,c)}var h=s.defaultItems();for(a=0;a<h.length;a++)n.push(h[a]._template);for(a=0;a<n.length;a++)delete n[a].templateitemname}}for(i=0;i<s.length;i++){var h=s[i],p=e[h];if(h in n?u(p,n[h],h):n[h]=p,c(h)===h)for(var d in n){var f=c(d);d===f||f!==h||d in e||u(p,n[d],h)}}}function c(e){return e.replace(/[0-9]+$/,"")}function u(e,n,i,a,s){var l=s&&i(s);for(var h in e){var p=e[h],f=d(e,h,a),m=d(e,h,s),g=i(m);if(!g){var y=c(h);y!==h&&(g=i(m=d(e,y,s)))}if((!l||l!==g)&&!(!g||g._noTemplating||"data_array"===g.valType||g.arrayOk&&Array.isArray(p)))if(!g.valType&&r(p))u(p,n,i,f,m);else if(g._isLinkedToArray&&Array.isArray(p))for(var v=!1,x=0,b={},_=0;_<p.length;_++){var w=p[_];if(r(w)){var k=w.name;if(k)b[k]||(u(w,n,i,d(p,x,f),d(p,x,m)),x++,b[k]=1);else if(!v){var T=d(e,o.arrayDefaultKey(h),a),S=d(p,x,f);u(w,n,i,S,d(p,x,m));var A=t.nestedProperty(n,S);t.nestedProperty(n,T).set(A.get()),A.set(null),v=!0}}}else t.nestedProperty(n,f).set(p)}}function h(e,r){return n.getLayoutValObject(e,t.nestedProperty({},r).parts)}function p(e,r){return n.getTraceValObject(e,t.nestedProperty({},r).parts)}function d(e,t,r){return r?Array.isArray(e)?r+"["+t+"]":r+"."+t:t}function f(e){for(var t=0;t<e.length;t++)if(r(e[t]))return!0}function m(e){var t;switch(e.code){case"data":t="The template has no key data.";break;case"layout":t="The template has no key layout.";break;case"missing":t=e.path?"There are no templates for item "+e.path+" with name "+e.templateitemname:"There are no templates for trace "+e.index+", of type "+e.traceType+".";break;case"unused":t=e.path?"The template item at "+e.path+" was not used in constructing the plot.":e.dataCount?"Some of the templates of type "+e.traceType+" were not used. The template has "+e.templateCount+" traces, the data only has "+e.dataCount+" of this type.":"The template has "+e.templateCount+" traces of type "+e.traceType+" but there are none in the data.";break;case"reused":t="Some of the templates of type "+e.traceType+" were used more than once. The template has "+e.templateCount+" traces, the data has "+e.dataCount+" of this type."}return e.msg=t,e}e.makeTemplate=function(e){e=t.isPlainObject(e)?e:t.getGraphDiv(e),e=t.extendDeep({_context:s},{data:e.data,layout:e.layout}),i.supplyDefaults(e);var n=e.data||[],o=e.layout||{};o._basePlotModules=e._fullLayout._basePlotModules,o._modules=e._fullLayout._modules;var c={data:{},layout:{}};n.forEach((function(e){var r={};u(e,r,p.bind(null,e));var n=t.coerce(e,{},a,"type"),i=c.data[n];i||(i=c.data[n]=[]),i.push(r)})),u(o,c.layout,h.bind(null,o)),delete c.layout.template;var d=o.template;if(r(d)){var f,m,g,y,v,x,b=d.layout;r(b)&&l(b,c.layout);var _=d.data;if(r(_)){for(m in c.data)if(g=_[m],Array.isArray(g)){for(x=(v=c.data[m]).length,y=g.length,f=0;f<x;f++)l(g[f%y],v[f]);for(f=x;f<y;f++)v.push(t.extendDeep({},g[f]))}for(m in _)m in c.data||(c.data[m]=t.extendDeep([],_[m]))}}return c},e.validateTemplate=function(e,n){var a=t.extendDeep({},{_context:s,data:e.data,layout:e.layout}),o=a.layout||{};r(n)||(n=o.template||{});var l=n.layout,u=n.data,h=[];a.layout=o,a.layout.template=n,i.supplyDefaults(a);var p=a._fullLayout,g=a._fullData,y={};if(r(l)?(function e(t,n){for(var i in t)if("_"!==i.charAt(0)&&r(t[i])){var a,o=c(i),s=[];for(a=0;a<n.length;a++)s.push(d(t,i,n[a])),o!==i&&s.push(d(t,o,n[a]));for(a=0;a<s.length;a++)y[s[a]]=1;e(t[i],s)}}(p,["layout"]),function e(t,n){for(var i in t)if(-1===i.indexOf("defaults")&&r(t[i])){var a=d(t,i,n);y[a]?e(t[i],a):h.push({code:"unused",path:a})}}(l,"layout")):h.push({code:"layout"}),r(u)){for(var v,x={},b=0;b<g.length;b++){var _=g[b];x[v=_.type]=(x[v]||0)+1,_._fullInput._template||h.push({code:"missing",index:_.index,traceType:v})}for(v in u){var w=u[v].length,k=x[v]||0;w>k?h.push({code:"unused",traceType:v,templateCount:w,dataCount:k}):k>w&&h.push({code:"reused",traceType:v,templateCount:w,dataCount:k})}}else h.push({code:"data"});if(function e(t,n){for(var i in t)if("_"!==i.charAt(0)){var a=t[i],o=d(t,i,n);r(a)?(Array.isArray(t)&&!1===a._template&&a.templateitemname&&h.push({code:"missing",path:o,templateitemname:a.templateitemname}),e(a,o)):Array.isArray(a)&&f(a)&&e(a,o)}}({data:g,layout:p},""),h.length)return h.map(m)}}}),Vn=p({"src/plot_api/index.js"(e){var t=zn();e._doPlot=t._doPlot,e.newPlot=t.newPlot,e.restyle=t.restyle,e.relayout=t.relayout,e.redraw=t.redraw,e.update=t.update,e._guiRestyle=t._guiRestyle,e._guiRelayout=t._guiRelayout,e._guiUpdate=t._guiUpdate,e._storeDirectGUIEdit=t._storeDirectGUIEdit,e.react=t.react,e.extendTraces=t.extendTraces,e.prependTraces=t.prependTraces,e.addTraces=t.addTraces,e.deleteTraces=t.deleteTraces,e.moveTraces=t.moveTraces,e.purge=t.purge,e.addFrames=t.addFrames,e.deleteFrames=t.deleteFrames,e.animate=t.animate,e.setPlotConfig=t.setPlotConfig;var r=Ce().getGraphDiv,n=Wr().eraseActiveShape;e.deleteActiveShape=function(e){return n(r(e))},e.toImage=jn(),e.validate=Fn(),e.downloadImage=Nn();var i=Un();e.makeTemplate=i.makeTemplate,e.validateTemplate=i.validateTemplate}}),qn=p({"src/traces/scatter/xy_defaults.js"(e,t){var r=st(),n=Ve();t.exports=function(e,t,i,a){var o,s=a("x"),l=a("y");if(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],i),s){var c=r.minRowLength(s);l?o=Math.min(c,r.minRowLength(l)):(o=c,a("y0"),a("dy"))}else{if(!l)return 0;o=r.minRowLength(l),a("x0"),a("dx")}return t._length=o,o}}}),Hn=p({"src/traces/scatter/period_defaults.js"(e,t){var r=st().dateTick0,n=T().ONEWEEK;function i(e,t){return r(t,e%n===0?1:0)}t.exports=function(e,t,r,n,a){if(a||(a={x:!0,y:!0}),a.x){var o=n("xperiod");o&&(n("xperiod0",i(o,t.xcalendar)),n("xperiodalignment"))}if(a.y){var s=n("yperiod");s&&(n("yperiod0",i(s,t.ycalendar)),n("yperiodalignment"))}}}}),Gn=p({"src/traces/scatter/stack_defaults.js"(e,t){var r=["orientation","groupnorm","stackgaps"];t.exports=function(e,t,n,i){var a=n._scatterStackOpts,o=i("stackgroup");if(o){var s=t.xaxis+t.yaxis,l=a[s];l||(l=a[s]={});var c=l[o],u=!1;c?c.traces.push(t):(c=l[o]={traceIndices:[],traces:[t]},u=!0);for(var h={orientation:t.x&&!t.y?"h":"v"},p=0;p<r.length;p++){var d=r[p],f=d+"Found";if(!c[f]){var m=void 0!==e[d],g="orientation"===d;if((m||u)&&(c[d]=i(d,h[d]),g&&(c.fillDflt="h"===c[d]?"tonextx":"tonexty"),m&&(c[f]=!0,!u&&(delete c.traces[0][d],g))))for(var y=0;y<c.traces.length-1;y++){var v=c.traces[y];v._input.fill!==v.fill&&(v.fill=c.fillDflt)}}}return c}}}}),Wn=p({"src/traces/scatter/marker_defaults.js"(e,t){var r=q(),n=Mt().hasColorscale,i=Vt(),a=$t();t.exports=function(e,t,o,s,l,c){var u=a.isBubble(e),h=(e.line||{}).color;c=c||{},h&&(o=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),c.noAngle||(l("marker.angle"),c.noAngleRef||l("marker.angleref"),c.noStandOff||l("marker.standoff")),l("marker.color",o),n(e,"marker")&&i(e,t,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&t.marker.color!==h?h:u?r.background:r.defaultLine),n(e,"marker.line")&&i(e,t,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient&&"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}}),$n=p({"src/traces/scatter/line_defaults.js"(e,t){var r=st().isArrayOrTypedArray,n=Mt().hasColorscale,i=Vt();t.exports=function(e,t,a,o,s,l){l||(l={});var c=(e.marker||{}).color;c&&c._inputArray&&(c=c._inputArray),s("line.color",a),n(e,"line")?i(e,t,o,s,{prefix:"line.",cLetter:"c"}):s("line.color",!r(c)&&c||a),s("line.width"),l.noDash||s("line.dash"),l.backoff&&s("line.backoff")}}}),Zn=p({"src/traces/scatter/line_shape_defaults.js"(e,t){t.exports=function(e,t,r){"spline"===r("line.shape")&&r("line.smoothing")}}}),Xn=p({"src/traces/scatter/text_defaults.js"(e,t){var r=st();t.exports=function(e,t,n,i,a){a=a||{},i("textposition"),r.coerceFont(i,"textfont",a.font||n.font,a),a.noSelect||(i("selected.textfont.color"),i("unselected.textfont.color"))}}}),Yn=p({"src/traces/scatter/fillcolor_defaults.js"(e,t){var r=q(),n=st().isArrayOrTypedArray;t.exports=function(e,t,i,a,o){o||(o={});var s,l=!1;if(t.marker){var c=t.marker.color,u=(t.marker.line||{}).color;c&&!n(c)?l=c:u&&!n(u)&&(l=u)}if(o.moduleHasFillgradient&&"none"!==a("fillgradient.type")){a("fillgradient.start"),a("fillgradient.stop");var h=a("fillgradient.colorscale");h&&(s=function(e){for(var t=r.interpolate(e[0][1],e[1][1],.5),n=2;n<e.length;n++){var i=r.interpolate(e[n-1][1],e[n][1],.5);t=r.interpolate(t,i,e[n-1][0]/e[n][0])}return t}(h))}a("fillcolor",r.addOpacity((t.line||{}).color||l||s||i,.5))}}}),Kn=p({"src/traces/scatter/defaults.js"(e,t){var r=st(),n=Ve(),i=wn(),a=bn(),o=$t(),s=qn(),l=Hn(),c=Gn(),u=Wn(),h=$n(),p=Zn(),d=Xn(),f=Yn(),m=st().coercePattern;t.exports=function(e,t,g,y){function v(n,a){return r.coerce(e,t,i,n,a)}var x=s(e,t,y,v);if(x||(t.visible=!1),t.visible){l(e,t,y,v),v("xhoverformat"),v("yhoverformat"),v("zorder");var b=c(e,t,y,v);"group"===y.scattermode&&void 0===t.orientation&&v("orientation","v");var _=!b&&x<a.PTS_LINESONLY?"lines+markers":"lines";v("text"),v("hovertext"),v("mode",_),o.hasMarkers(t)&&u(e,t,g,y,v,{gradient:!0}),o.hasLines(t)&&(h(e,t,g,y,v,{backoff:!0}),p(e,t,v),v("connectgaps"),v("line.simplify")),o.hasText(t)&&(v("texttemplate"),d(e,t,y,v));var w=[];(o.hasMarkers(t)||o.hasText(t))&&(v("cliponaxis"),v("marker.maxdisplayed"),w.push("points")),v("fill",b?b.fillDflt:"none"),"none"!==t.fill&&(f(e,t,g,v,{moduleHasFillgradient:!0}),o.hasLines(t)||p(e,t,v),m(v,"fillpattern",t.fillcolor,!1));var k=(t.line||{}).color,T=(t.marker||{}).color;"tonext"!==t.fill&&"toself"!==t.fill||w.push("fills"),v("hoveron",w.join("+")||"points"),"fills"!==t.hoveron&&v("hovertemplate");var S=n.getComponentMethod("errorbars","supplyDefaults");S(e,t,k||T||g,{axis:"y"}),S(e,t,k||T||g,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(t,v)}}}}),Jn=p({"src/traces/scatter/grouping_defaults.js"(e,t){var r=tn().getAxisGroup;t.exports=function(e,t,n,i,a){var o=t.orientation,s=t[{v:"x",h:"y"}[o]+"axis"],l=r(n,s)+o,c=n._alignmentOpts||{},u=i("alignmentgroup"),h=c[l];h||(h=c[l]={});var p=h[u];p?p.traces.push(t):p=h[u]={traces:[t],alignmentIndex:Object.keys(h).length,offsetGroups:{}};var d=i("offsetgroup")||"",f=p.offsetGroups,m=f[d];t._offsetIndex=0,("group"!==a||d)&&(m||(m=f[d]={offsetIndex:Object.keys(f).length}),t._offsetIndex=m.offsetIndex)}}}),Qn=p({"src/traces/scatter/cross_trace_defaults.js"(e,t){var r=st(),n=Jn(),i=wn();t.exports=function(e,t){var a,o,s,l=t.scattermode;function c(e){return r.coerce(o._input,o,i,e)}if("group"===t.scattermode)for(s=0;s<e.length;s++)"scatter"===(o=e[s]).type&&(a=o._input,n(a,o,t,c,l));for(s=0;s<e.length;s++){var u=e[s];if("scatter"===u.type){var h=u.fill;if("none"!==h&&"toself"!==h&&(u.opacity=void 0,"tonexty"===h||"tonextx"===h))for(var p=s-1;p>=0;p--){var d=e[p];if("scatter"===d.type&&d.xaxis===u.xaxis&&d.yaxis===u.yaxis){d.opacity=void 0;break}}}}}}}),ei=p({"src/traces/scatter/layout_defaults.js"(e,t){var r=st(),n=bt();t.exports=function(e,t){var i,a,o="group"===t.barmode;"group"===t.scattermode&&(i="scattergap",a=o?t.bargap:.2,r.coerce(e,t,n,i,a))}}}),ti=p({"src/plots/cartesian/align_period.js"(e,t){var r=k(),n=st(),i=n.dateTime2ms,a=n.incrementMonth,o=T().ONEAVGMONTH;t.exports=function(e,t,n,s){if("date"!==t.type)return{vals:s};var l=e[n+"periodalignment"];if(!l)return{vals:s};var c,u=e[n+"period"];if(r(u)){if((u=+u)<=0)return{vals:s}}else if("string"===typeof u&&"M"===u.charAt(0)){var h=+u.substring(1);if(!(h>0&&Math.round(h)===h))return{vals:s};c=h}for(var p=t.calendar,d="start"===l,f="end"===l,m=e[n+"period0"],g=i(m,p)||0,y=[],v=[],x=[],b=s.length,_=0;_<b;_++){var w,k,T,S=s[_];if(c){for(w=Math.round((S-g)/(c*o)),T=a(g,c*w,p);T>S;)T=a(T,-c,p);for(;T<=S;)T=a(T,c,p);k=a(T,-c,p)}else{for(T=g+(w=Math.round((S-g)/u))*u;T>S;)T-=u;for(;T<=S;)T+=u;k=T-u}y[_]=d?k:f?T:(k+T)/2,v[_]=k,x[_]=T}return{vals:y,starts:v,ends:x}}}}),ri=p({"src/traces/scatter/colorscale_calc.js"(e,t){var r=Mt().hasColorscale,n=Gt(),i=$t();t.exports=function(e,t){i.hasLines(t)&&r(t,"line")&&n(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),i.hasMarkers(t)&&(r(t,"marker")&&n(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&n(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}))}}}),ni=p({"src/traces/scatter/arrays_to_calcdata.js"(e,t){var r=st();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.texttemplate,e,"txt"),r.mergeArray(t.hovertext,e,"htx"),r.mergeArray(t.customdata,e,"data"),r.mergeArray(t.textposition,e,"tp"),t.textfont&&(r.mergeArrayCastPositive(t.textfont.size,e,"ts"),r.mergeArray(t.textfont.color,e,"tc"),r.mergeArray(t.textfont.family,e,"tf"),r.mergeArray(t.textfont.weight,e,"tw"),r.mergeArray(t.textfont.style,e,"ty"),r.mergeArray(t.textfont.variant,e,"tv"),r.mergeArray(t.textfont.textcase,e,"tC"),r.mergeArray(t.textfont.lineposition,e,"tE"),r.mergeArray(t.textfont.shadow,e,"tS"));var i=t.marker;if(i){r.mergeArrayCastPositive(i.size,e,"ms"),r.mergeArrayCastPositive(i.opacity,e,"mo"),r.mergeArray(i.symbol,e,"mx"),r.mergeArray(i.angle,e,"ma"),r.mergeArray(i.standoff,e,"mf"),r.mergeArray(i.color,e,"mc");var a=i.line;i.line&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"));var o=i.gradient;o&&"none"!==o.type&&(r.mergeArray(o.type,e,"mgt"),r.mergeArray(o.color,e,"mgc"))}}}}),ii=p({"src/traces/scatter/calc_selection.js"(e,t){var r=st();t.exports=function(e,t){r.isArrayOrTypedArray(t.selectedpoints)&&r.tagSelected(e,t)}}}),ai=p({"src/traces/scatter/calc.js"(e,t){var r=k(),n=st(),i=nr(),a=ti(),o=T().BADNUM,s=$t(),l=ri(),c=ni(),u=ii();function h(e,t,r,n,a,o,l){var c=t._length,u=e._fullLayout,h=r._id,p=n._id,d=u._firstScatter[f(t)]===t.uid,g=(m(t,u,r,n)||{}).orientation,y=t.fill;r._minDtick=0,n._minDtick=0;var v={padded:!0},x={padded:!0};l&&(v.ppad=x.ppad=l);var b=c<2||a[0]!==a[c-1]||o[0]!==o[c-1];b&&("tozerox"===y||"tonextx"===y&&(d||"h"===g))?v.tozero=!0:(t.error_y||{}).visible||"tonexty"!==y&&"tozeroy"!==y&&(s.hasMarkers(t)||s.hasText(t))||(v.padded=!1,v.ppad=0),b&&("tozeroy"===y||"tonexty"===y&&(d||"v"===g))?x.tozero=!0:"tonextx"!==y&&"tozerox"!==y||(x.padded=!1),h&&(t._extremes[h]=i.findExtremes(r,a,v)),p&&(t._extremes[p]=i.findExtremes(n,o,x))}function p(e,t){if(s.hasMarkers(e)){var r,a=e.marker,o=1.6*(e.marker.sizeref||1);if(r="area"===e.marker.sizemode?function(e){return Math.max(Math.sqrt((e||0)/o),3)}:function(e){return Math.max((e||0)/o,3)},n.isArrayOrTypedArray(a.size)){var l={type:"linear"};i.setConvert(l);for(var c=l.makeCalcdata(e.marker,"size"),u=new Array(t),h=0;h<t;h++)u[h]=r(c[h]);return u}return r(a.size)}}function d(e,t){var r=f(t),n=e._firstScatter;n[r]||(n[r]=t.uid)}function f(e){var t=e.stackgroup;return e.xaxis+e.yaxis+e.type+(t?"-"+t:"")}function m(e,t,r,n){var i=e.stackgroup;if(i){var a=t._scatterStackOpts[r._id+n._id][i],o="v"===a.orientation?n:r;return"linear"===o.type||"log"===o.type?a:void 0}}t.exports={calc:function(e,t){var s,f,g,y,v,x,b=e._fullLayout,_=t._xA=i.getFromId(e,t.xaxis||"x","x"),w=t._yA=i.getFromId(e,t.yaxis||"y","y"),k=_.makeCalcdata(t,"x"),T=w.makeCalcdata(t,"y"),S=a(t,_,"x",k),A=a(t,w,"y",T),M=S.vals,E=A.vals,C=t._length,P=new Array(C),L=t.ids,I=m(t,b,_,w),z=!1;d(b,t);var O,R="x",D="y";I?(n.pushUnique(I.traceIndices,t.index),(s="v"===I.orientation)?(D="s",O="x"):(R="s",O="y"),v="interpolate"===I.stackgaps):h(e,t,_,w,M,E,p(t,C));var j=!!t.xperiodalignment,F=!!t.yperiodalignment;for(f=0;f<C;f++){var B=P[f]={},N=r(M[f]),U=r(E[f]);N&&U?(B[R]=M[f],B[D]=E[f],j&&(B.orig_x=k[f],B.xEnd=S.ends[f],B.xStart=S.starts[f]),F&&(B.orig_y=T[f],B.yEnd=A.ends[f],B.yStart=A.starts[f])):I&&(s?N:U)?(B[O]=s?M[f]:E[f],B.gap=!0,v?(B.s=o,z=!0):B.s=0):B[R]=B[D]=o,L&&(B.id=String(L[f]))}if(c(P,t),l(e,t),u(P,t),I){for(f=0;f<P.length;)P[f][O]===o?P.splice(f,1):f++;if(n.sort(P,(function(e,t){return e[O]-t[O]||e.i-t.i})),z){for(f=0;f<P.length-1&&P[f].gap;)f++;for((x=P[f].s)||(x=P[f].s=0),g=0;g<f;g++)P[g].s=x;for(y=P.length-1;y>f&&P[y].gap;)y--;for(x=P[y].s,g=P.length-1;g>y;g--)P[g].s=x;for(;f<y;)if(P[++f].gap){for(g=f+1;P[g].gap;)g++;for(var V=P[f-1][O],q=P[f-1].s,H=(P[g].s-q)/(P[g][O]-V);f<g;)P[f].s=q+(P[f][O]-V)*H,f++}}}return P},calcMarkerSize:p,calcAxisExpansion:h,setFirstScatter:d,getStackOpts:m}}}),oi=p({"src/traces/bar/sieve.js"(e,t){t.exports=n;var r=st().distinctVals;function n(e,t){this.traces=e,this.sepNegVal=t.sepNegVal,this.overlapNoMerge=t.overlapNoMerge;for(var n=1/0,i=t.posAxis._id.charAt(0),a=[],o=0;o<e.length;o++){for(var s=e[o],l=0;l<s.length;l++){var c=s[l],u=c.p;void 0===u&&(u=c[i]),void 0!==u&&a.push(u)}s[0]&&s[0].width1&&(n=Math.min(s[0].width1,n))}this.positions=a;var h=r(a);this.distinctPositions=h.vals,1===h.vals.length&&n!==1/0?this.minDiff=n:this.minDiff=Math.min(h.minDiff,n);var p=(t.posAxis||{}).type;"category"!==p&&"multicategory"!==p||(this.minDiff=1),this.binWidth=this.minDiff,this.bins={}}n.prototype.put=function(e,t,r){var n=this.getLabel(e,t,r),i=this.bins[n]||0;return this.bins[n]=i+r,i},n.prototype.get=function(e,t,r){var n=this.getLabel(e,t,r);return this.bins[n]||0},n.prototype.getLabel=function(e,t,r){return(r<0&&this.sepNegVal?"v":"^")+(this.overlapNoMerge?e:Math.round(e/this.binWidth))+"g"+t}}}),si=p({"src/traces/bar/cross_trace_calc.js"(e,t){var r=k(),n=st().isArrayOrTypedArray,i=T().BADNUM,a=Ve(),o=nr(),s=tn().getAxisGroup,l=oi();function c(e,t,a,s,c){if(s.length){var p,y,v,x;switch(function(e,t){var i,a;for(i=0;i<t.length;i++){var o,s=t[i],l=s[0].trace,c="funnel"===l.type?l._base:l.base,u="h"===l.orientation?l.xcalendar:l.ycalendar,h="category"===e.type||"multicategory"===e.type?function(){return null}:e.d2c;if(n(c)){for(a=0;a<Math.min(c.length,s.length);a++)o=h(c[a],0,u),r(o)?(s[a].b=+o,s[a].hasB=1):s[a].b=0;for(;a<s.length;a++)s[a].b=0}else{o=h(c,0,u);var p=r(o);for(o=p?o:0,a=0;a<s.length;a++)s[a].b=o,p&&(s[a].hasB=1)}}}(a,s),c.mode){case"overlay":u(e,t,a,s,c);break;case"group":for(p=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.offset?y.push(x):p.push(x);y.length&&function(e,t,r,n,a){var o=new l(n,{posAxis:t,sepNegVal:!1,overlapNoMerge:!a.norm});h(e,t,o,a),function(e,t){for(var r=e.traces,n=0;n<r.length;n++){var a=r[n],o=a[0].trace,s=a[0].t.offsetindex;if(void 0===o.base)for(var c=new l([a],{posAxis:t,sepNegVal:!0,overlapNoMerge:!0}),u=0;u<a.length;u++){var h=a[u];if(h.p!==i){var p=c.put(h.p,s,h.b+h.s);p&&(h.b=p)}}}}(o,t),a.norm?(f(o),m(r,o,a)):d(r,o)}(e,t,a,y,c),p.length&&u(e,t,a,p,c);break;case"stack":case"relative":for(p=[],y=[],v=0;v<s.length;v++)void 0===(x=s[v])[0].trace.base?y.push(x):p.push(x);!function(e){if(!(e.length<2)){var t,n,i,a,o,s;for(t=0;t<e.length&&void 0===(a=(n=e[t][0].trace).marker?n.marker.cornerradius:void 0);t++);if(void 0!==a)for(o=r(a)?+a:+a.slice(0,-1),s=r(a)?"px":"%",t=0;t<e.length;t++)(i=e[t][0].t).cornerradiusvalue=o,i.cornerradiusform=s}}(y),y.length&&function(e,t,r,n,a){var s=new l(n,{posAxis:t,sepNegVal:"relative"===a.mode,overlapNoMerge:!(a.norm||"stack"===a.mode||"relative"===a.mode)});h(e,t,s,a),function(e,t,r){var n,a,s,l,c,u,h,p=g(e),d=t.traces;for(l=0;l<d.length;l++)if("funnel"===(a=(n=d[l])[0].trace).type)for(h=n[0].t.offsetindex,c=0;c<n.length;c++)(u=n[c]).s!==i&&t.put(u.p,h,-.5*u.s);for(l=0;l<d.length;l++){s="funnel"===(a=(n=d[l])[0].trace).type,h="barpolar"===a.type?0:n[0].t.offsetindex;var f=[];for(c=0;c<n.length;c++)if((u=n[c]).s!==i){var m;m=s?u.s:u.s+u.b;var y=t.put(u.p,h,m),v=y+m;u.b=y,u[p]=v,r.norm||(f.push(v),u.hasB&&f.push(y))}r.norm||(a._extremes[e._id]=o.findExtremes(e,f,{tozero:!0,padded:!0}))}}(r,s,a);for(var c=0;c<n.length;c++)for(var u=n[c],p=u[0].t.offsetindex,d=0;d<u.length;d++){var f=u[d];f.s!==i&&f.b+f.s===s.get(f.p,p,f.s)&&(f._outmost=!0)}a.norm&&m(r,s,a)}(e,t,a,y,c),p.length&&u(e,t,a,p,c)}!function(e){var t,n,i,a,o,s,l;for(t=0;t<e.length;t++)i=(n=e[t])[0].trace,void 0===(a=n[0].t).cornerradiusvalue&&void 0!==(o=i.marker?i.marker.cornerradius:void 0)&&(s=r(o)?+o:+o.slice(0,-1),l=r(o)?"px":"%",a.cornerradiusvalue=s,a.cornerradiusform=l)}(s),function(e,t){var i,a,o,s=g(t),l={},c=1/0,u=-1/0;for(i=0;i<e.length;i++)for(o=e[i],a=0;a<o.length;a++){var h=o[a].p;r(h)&&(c=Math.min(c,h),u=Math.max(u,h))}var p=1e4/(u-c),d=l.round=function(e){return String(Math.round(p*(e-c)))},f={},m={},y=e.some((function(e){var t=e[0].trace;return"marker"in t&&t.marker.cornerradius}));for(i=0;i<e.length;i++){(o=e[i])[0].t.extents=l;var v=o[0].t.poffset,x=n(v);for(a=0;a<o.length;a++){var b=o[a],_=b[s]-b.w/2;if(r(_)){var w=b[s]+b.w/2,k=d(b.p);l[k]?l[k]=[Math.min(_,l[k][0]),Math.max(w,l[k][1])]:l[k]=[_,w]}if(b.p0=b.p+(x?v[a]:v),b.p1=b.p0+b.w,b.s0=b.b,b.s1=b.s0+b.s,y){var T=Math.min(b.s0,b.s1)||0,S=Math.max(b.s0,b.s1)||0,A=b[s];f[A]=A in f?Math.min(f[A],T):T,m[A]=A in m?Math.max(m[A],S):S}}}y&&function(e,t,r,n){for(var i=g(n),a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s],c=l[i];l._sMin=t[c],l._sMax=r[c]}}(e,f,m,t)}(s,t)}}function u(e,t,r,n,i){for(var a=0;a<n.length;a++){var o=n[a],s=new l([o],{posAxis:t,sepNegVal:!1,overlapNoMerge:!i.norm});h(e,t,s,i),i.norm?(f(s),m(r,s,i)):d(r,s)}}function h(e,t,i,a){var o,l,c,u,h=e._fullLayout,d=i.positions,f=i.distinctPositions,m=i.minDiff,y=i.traces,v=y.length,x=d.length!==f.length,b=m*(1-a.gap);if("angularaxis"===t._id)c=-(l=(o=b)*(1-(a.groupgap||0)))/2;else{var _=s(h,t._id)+y[0][0].trace.orientation;u=h._alignmentOpts[_]||{}}for(var w=0;w<v;w++){var k=y[w],T=k[0].trace;if("angularaxis"!==t._id){var S=u[T.alignmentgroup]||{},A=Object.keys(S.offsetGroups||{}).length;l=(o=A?b/A:x?b/v:b)*(1-(a.groupgap||0)),c=A?((2*T._offsetIndex+1-A)*o-l)/2:x?((2*w+1-v)*o-l)/2:-l/2}var M=k[0].t;M.barwidth=l,M.offsetindex=T._offsetIndex||0,M.poffset=c,M.bargroupwidth=b,M.bardelta=m}i.binWidth=y[0][0].t.barwidth/100,function(e){var t,i,a=e.traces;for(t=0;t<a.length;t++){var o,s=a[t],l=s[0],c=l.trace,u=l.t,h=c._offset||c.offset,p=u.poffset;if(n(h)){for(o=Array.prototype.slice.call(h,0,s.length),i=0;i<o.length;i++)r(o[i])||(o[i]=p);for(i=o.length;i<s.length;i++)o.push(p);u.poffset=o}else void 0!==h&&(u.poffset=h);var d=c._width||c.width,f=u.barwidth;if(n(d)){var m=Array.prototype.slice.call(d,0,s.length);for(i=0;i<m.length;i++)r(m[i])||(m[i]=f);for(i=m.length;i<s.length;i++)m.push(f);if(u.barwidth=m,void 0===h){for(o=[],i=0;i<s.length;i++)o.push(p+(f-m[i])/2);u.poffset=o}}else void 0!==d&&(u.barwidth=d,void 0===h&&(u.poffset=p+(f-d)/2))}}(i),function(e,t){for(var r=t.traces,i=g(e),a=0;a<r.length;a++)for(var o=r[a],s=o[0].t,l=s.poffset,c=n(l),u=s.barwidth,h=n(u),p=0;p<o.length;p++){var d=o[p],f=d.w=h?u[p]:u;void 0===d.p&&(d.p=d[i],d["orig_"+i]=d[i]);var m=(c?l[p]:l)+f/2;d[i]=d.p+m}}(t,i),"angularaxis"===t._id?p(t,i):p(t,i,x)}function p(e,t,r){var i=t.traces,a=t.minDiff/2;o.minDtick(e,t.minDiff,t.distinctPositions[0],r);for(var s=0;s<i.length;s++){var l,c,u,h,p=i[s],d=p[0],f=d.trace,m=[];for(h=0;h<p.length;h++)c=(l=p[h]).p-a,u=l.p+a,m.push(c,u);if(f.width||f.offset){var g=d.t,y=g.poffset,v=g.barwidth,x=n(y),b=n(v);for(h=0;h<p.length;h++){l=p[h];var _=x?y[h]:y,w=b?v[h]:v;u=(c=l.p+_)+w,m.push(c,u)}}f._extremes[e._id]=o.findExtremes(e,m,{padded:!1})}}function d(e,t){for(var r=t.traces,n=g(e),i=0;i<r.length;i++){for(var a=r[i],s=a[0].trace,l="scatter"===s.type,c="v"===s.orientation,u=[],h=!1,p=0;p<a.length;p++){var d=a[p],f=l?0:d.b,m=l?c?d.y:d.x:f+d.s;d[n]=m,u.push(m),d.hasB&&u.push(f),d.hasB&&d.b||(h=!0)}s._extremes[e._id]=o.findExtremes(e,u,{tozero:h,padded:!0})}}function f(e){for(var t=e.traces,r=0;r<t.length;r++)for(var n=t[r],a=n[0].t.offsetindex,o=0;o<n.length;o++){var s=n[o];s.s!==i&&e.put(s.p,a,s.b+s.s)}}function m(e,t,n){var a=t.traces,s=g(e),l="fraction"===n.norm?1:100,c=l/1e9,u=e.l2c(e.c2l(0)),h="stack"===n.mode?l:u;function p(t){return r(e.c2l(t))&&(t<u-c||t>h+c||!r(u))}for(var d=0;d<a.length;d++){for(var f=a[d],m=f[0].t.offsetindex,y=f[0].trace,v=[],x=!1,b=!1,_=0;_<f.length;_++){var w=f[_];if(w.s!==i){var k=Math.abs(l/t.get(w.p,m,w.s));w.b*=k,w.s*=k;var T=w.b,S=T+w.s;w[s]=S,v.push(S),b=b||p(S),w.hasB&&(v.push(T),b=b||p(T)),w.hasB&&w.b||(x=!0)}}y._extremes[e._id]=o.findExtremes(e,v,{tozero:x,padded:b})}}function g(e){return e._id.charAt(0)}t.exports={crossTraceCalc:function(e,t){for(var r=t.xaxis,n=t.yaxis,i=e._fullLayout,o=e._fullData,s=e.calcdata,l=[],u=[],h=0;h<o.length;h++){var p=o[h];if(!0===p.visible&&a.traceIs(p,"bar")&&p.xaxis===r._id&&p.yaxis===n._id&&("h"===p.orientation?l.push(s[h]):u.push(s[h]),p._computePh))for(var d=e.calcdata[h],f=0;f<d.length;f++)"function"===typeof d[f].ph0&&(d[f].ph0=d[f].ph0()),"function"===typeof d[f].ph1&&(d[f].ph1=d[f].ph1())}var m={xCat:"category"===r.type||"multicategory"===r.type,yCat:"category"===n.type||"multicategory"===n.type,mode:i.barmode,norm:i.barnorm,gap:i.bargap,groupgap:i.bargroupgap};c(e,r,n,u,m),c(e,n,r,l,m)},setGroupPositions:c}}}),li=p({"src/traces/scatter/cross_trace_calc.js"(e,t){var r=ai(),n=si().setGroupPositions;function i(e,t,r,n,i,a,o){i[n]=!0;var s={i:null,gap:!0,s:0};if(s[o]=r,e.splice(t,0,s),t&&r===e[t-1][o]){var l=e[t-1];s.s=l.s,s.i=l.i,s.gap=l.gap}else a&&(s.s=function(e,t,r,n){var i=e[t-1],a=e[t+1];return a?i?i.s+(a.s-i.s)*(r-i[n])/(a[n]-i[n]):a.s:i.s}(e,t,r,o));t||(e[0].t=e[1].t,e[0].trace=e[1].trace,delete e[1].t,delete e[1].trace)}t.exports=function(e,t){"group"===e._fullLayout.scattermode&&function(e,t){for(var r=t.xaxis,i=t.yaxis,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=[],c=[],u=0;u<o.length;u++){var h=o[u];!0===h.visible&&"scatter"===h.type&&h.xaxis===r._id&&h.yaxis===i._id&&("h"===h.orientation?l.push(s[u]):"v"===h.orientation&&c.push(s[u]))}var p={mode:a.scattermode,gap:a.scattergap};n(e,r,i,c,p),n(e,i,r,l,p)}(e,t);var a=t.xaxis,o=t.yaxis,s=a._id+o._id,l=e._fullLayout._scatterStackOpts[s];if(l){var c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T=e.calcdata;for(var S in l){var A=(v=l[S]).traceIndices;if(A.length){for(x="interpolate"===v.stackgaps,b=v.groupnorm,"v"===v.orientation?(_="x",w="y"):(_="y",w="x"),k=new Array(A.length),c=0;c<k.length;c++)k[c]=!1;f=T[A[0]];var M=new Array(f.length);for(c=0;c<f.length;c++)M[c]=f[c][_];for(c=1;c<A.length;c++){for(d=T[A[c]],u=h=0;u<d.length;u++){for(m=d[u][_];m>M[h]&&h<M.length;h++)i(d,u,M[h],c,k,x,_),u++;if(m!==M[h]){for(p=0;p<c;p++)i(T[A[p]],h,m,p,k,x,_);M.splice(h,0,m)}h++}for(;h<M.length;h++)i(d,u,M[h],c,k,x,_),u++}var E=M.length;for(u=0;u<f.length;u++){for(g=f[u][w]=f[u].s,c=1;c<A.length;c++)(d=T[A[c]])[0].trace._rawLength=d[0].trace._length,d[0].trace._length=E,g+=d[u].s,d[u][w]=g;if(b)for(y=("fraction"===b?g:g/100)||1,c=0;c<A.length;c++){var C=T[A[c]][u];C[w]/=y,C.sNorm=C.s/y}}for(c=0;c<A.length;c++){var P=(d=T[A[c]])[0].trace,L=r.calcMarkerSize(P,P._rawLength),I=Array.isArray(L);if(L&&k[c]||I){var z=L;for(L=new Array(E),u=0;u<E;u++)L[u]=d[u].gap?0:I?z[d[u].i]:z}var O=new Array(E),R=new Array(E);for(u=0;u<E;u++)O[u]=d[u].x,R[u]=d[u].y;r.calcAxisExpansion(e,P,a,o,O,R,L),d[0].t.orientation=v.orientation}}}}}}}),ci=p({"src/traces/scatter/line_points.js"(e,t){var r=Jt(),n=T(),i=n.BADNUM,a=n.LOG_CLIP,o=a+.5,s=a-.5,l=st(),c=l.segmentsIntersect,u=l.constrain,h=bn();t.exports=function(e,t){var n,a,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E=t.trace||{},C=t.xaxis,P=t.yaxis,L="log"===C.type,I="log"===P.type,z=C._length,O=P._length,R=t.backoff,D=E.marker,j=t.connectGaps,F=t.baseTolerance,B=t.shape,N="linear"===B,U=E.fill&&"none"!==E.fill,V=[],q=h.minTolerance,H=e.length,G=new Array(H),W=0;function $(r){var n=e[r];if(!n)return!1;var a=t.linearized?C.l2p(n.x):C.c2p(n.x),l=t.linearized?P.l2p(n.y):P.c2p(n.y);if(a===i){if(L&&(a=C.c2p(n.x,!0)),a===i)return!1;I&&l===i&&(a*=Math.abs(C._m*O*(C._m>0?o:s)/(P._m*z*(P._m>0?o:s)))),a*=1e3}if(l===i){if(I&&(l=P.c2p(n.y,!0)),l===i)return!1;l*=1e3}return[a,l]}function Z(e,t,r,n){var i=r-e,a=n-t,o=.5-e,s=.5-t,l=i*i+a*a,c=i*o+a*s;if(c>0&&c<l){var u=o*a-s*i;if(u*u<l)return!0}}function X(e,t){var r=e[0]/z,n=e[1]/O,i=Math.max(0,-r,r-1,-n,n-1);return i&&void 0!==A&&Z(r,n,A,M)&&(i=0),i&&t&&Z(r,n,t[0]/z,t[1]/O)&&(i=0),(1+h.toleranceGrowth*i)*F}function Y(e,t){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)}var K,J,Q,ee,te,re,ne,ie=h.maxScreensAway,ae=-z*ie,oe=z*(1+ie),se=-O*ie,le=O*(1+ie),ce=[[ae,se,oe,se],[oe,se,oe,le],[oe,le,ae,le],[ae,le,ae,se]];function ue(e){if(e[0]<ae||e[0]>oe||e[1]<se||e[1]>le)return[u(e[0],ae,oe),u(e[1],se,le)]}function he(e,t){return e[0]===t[0]&&(e[0]===ae||e[0]===oe)||e[1]===t[1]&&(e[1]===se||e[1]===le)||void 0}function pe(e,t,r){return function(n,i){var a=ue(n),o=ue(i),s=[];if(a&&o&&he(a,o))return s;a&&s.push(a),o&&s.push(o);var c=2*l.constrain((n[e]+i[e])/2,t,r)-((a||n)[e]+(o||i)[e]);return c&&((a&&o?c>0===a[e]>o[e]?a:o:a||o)[e]+=c),s}}function de(e){var t=e[0],r=e[1],n=t===G[W-1][0],i=r===G[W-1][1];if(!n||!i)if(W>1){var a=t===G[W-2][0],o=r===G[W-2][1];n&&(t===ae||t===oe)&&a?o?W--:G[W-1]=e:i&&(r===se||r===le)&&o?a?W--:G[W-1]=e:G[W++]=e}else G[W++]=e}function fe(e){G[W-1][0]!==e[0]&&G[W-1][1]!==e[1]&&de([Q,ee]),de(e),te=null,Q=ee=0}"linear"===B||"spline"===B?ne=function(e,t){for(var r=[],n=0,i=0;i<4;i++){var a=ce[i],o=c(e[0],e[1],t[0],t[1],a[0],a[1],a[2],a[3]);o&&(!n||Math.abs(o.x-r[0][0])>1||Math.abs(o.y-r[0][1])>1)&&(o=[o.x,o.y],n&&Y(o,e)<Y(r[0],e)?r.unshift(o):r.push(o),n++)}return r}:"hv"===B||"vh"===B?ne=function(e,t){var r=[],n=ue(e),i=ue(t);return n&&i&&he(n,i)||(n&&r.push(n),i&&r.push(i)),r}:"hvh"===B?ne=pe(0,ae,oe):"vhv"===B&&(ne=pe(1,se,le));var me=l.isArrayOrTypedArray(D);function ge(t){if(t&&R&&(t.i=n,t.d=e,t.trace=E,t.marker=me?D[t.i]:D,t.backoff=R),A=t[0]/z,M=t[1]/O,K=t[0]<ae?ae:t[0]>oe?oe:0,J=t[1]<se?se:t[1]>le?le:0,K||J){if(W)if(te){var r=ne(te,t);r.length>1&&(fe(r[0]),G[W++]=r[1])}else re=ne(G[W-1],t)[0],G[W++]=re;else G[W++]=[K||t[0],J||t[1]];var i=G[W-1];K&&J&&(i[0]!==K||i[1]!==J)?(te&&(Q!==K&&ee!==J?de(Q&&ee?function(e,t){var r=t[0]-e[0],n=(t[1]-e[1])/r;return(e[1]*t[0]-t[1]*e[0])/r>0?[n>0?ae:oe,le]:[n>0?oe:ae,se]}(te,t):[Q||K,ee||J]):Q&&ee&&de([Q,ee])),de([K,J])):Q-K&&ee-J&&de([K||Q,J||ee]),te=t,Q=K,ee=J}else te&&fe(ne(te,t)[0]),G[W++]=t}for(n=0;n<H;n++)if(a=$(n)){for(W=0,te=null,ge(a),n++;n<H;n++){if(!(d=$(n))){if(j)continue;break}if(N&&t.simplify){var ye=$(n+1);if(x=Y(d,a),U&&(0===W||W===H-1)||!(x<X(d,ye)*q)){for(y=[(d[0]-a[0])/x,(d[1]-a[1])/x],f=a,b=x,_=k=T=0,g=!1,p=d,n++;n<e.length;n++){if(m=ye,ye=$(n+1),!m){if(j)continue;break}if(S=(v=[m[0]-a[0],m[1]-a[1]])[0]*y[1]-v[1]*y[0],k=Math.min(k,S),(T=Math.max(T,S))-k>X(m,ye))break;p=m,(w=v[0]*y[0]+v[1]*y[1])>b?(b=w,d=m,g=!1):w<_&&(_=w,f=m,g=!0)}if(g?(ge(d),p!==f&&ge(f)):(f!==a&&ge(f),p!==d&&ge(d)),ge(p),n>=e.length||!m)break;ge(m),a=m}}else ge(d)}te&&de([Q||te[0],ee||te[1]]),V.push(G.slice(0,W))}var ve=B.slice(B.length-1);if(R&&"h"!==ve&&"v"!==ve){for(var xe=!1,be=-1,_e=[],we=0;we<V.length;we++)for(var ke=0;ke<V[we].length-1;ke++){var Te=V[we][ke],Se=V[we][ke+1],Ae=r.applyBackoff(Se,Te);Ae[0]===Se[0]&&Ae[1]===Se[1]||(xe=!0),_e[be+1]||(_e[++be]=[Te,[Ae[0],Ae[1]]])}return xe?_e:V}return V}}}),ui=p({"src/traces/scatter/link_traces.js"(e,t){var r={tonextx:1,tonexty:1,tonext:1};t.exports=function(e,t,n){var i,a,o,s,l,c={},u=!1,h=-1,p=0,d=-1;for(a=0;a<n.length;a++)(o=(i=n[a][0].trace).stackgroup||"")?o in c?l=c[o]:(l=c[o]=p,p++):i.fill in r&&d>=0?l=d:(l=d=p,p++),l<h&&(u=!0),i._groupIndex=h=l;var f=n.slice();u&&f.sort((function(e,t){var r=e[0].trace,n=t[0].trace;return r._groupIndex-n._groupIndex||r.index-n.index}));var m={};for(a=0;a<f.length;a++)o=(i=f[a][0].trace).stackgroup||"",!0===i.visible?(i._nexttrace=null,i.fill in r&&(s=m[o],i._prevtrace=s||null,s&&(s._nexttrace=i)),i._ownfill=i.fill&&("tozero"===i.fill.substr(0,6)||"toself"===i.fill||"to"===i.fill.substr(0,2)&&!i._prevtrace),m[o]=i):i._prevtrace=i._nexttrace=i._ownfill=null;return f}}}),hi=p({"src/traces/scatter/plot.js"(e,t){var r=v(),n=Ve(),i=st(),a=i.ensureSingle,o=i.identity,s=Jt(),l=$t(),c=ci(),u=ui(),h=fn().tester;function p(e,t,u,p,d,f,m){var g,y=e._context.staticPlot;!function(e,t,n,a,o){var s=n.xaxis,c=n.yaxis,u=r.extent(i.simpleMap(s.range,s.r2c)),h=r.extent(i.simpleMap(c.range,c.r2c)),p=a[0].trace;if(l.hasMarkers(p)){var d=p.marker.maxdisplayed;if(0!==d){var f=a.filter((function(e){return e.x>=u[0]&&e.x<=u[1]&&e.y>=h[0]&&e.y<=h[1]})),m=Math.ceil(f.length/d),g=0;o.forEach((function(e,r){var n=e[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r<t&&g++}));var y=Math.round(g*m/3+Math.floor(g/3)*m/7.1);a.forEach((function(e){delete e.vis})),f.forEach((function(e,t){0===Math.round((t+y)%m)&&(e.vis=!0)}))}}}(0,t,u,p,d);var v=!!m&&m.duration>0;function x(e){return v?e.transition():e}var b=u.xaxis,_=u.yaxis,w=p[0].trace,k=w.line,T=r.select(f),S=a(T,"g","errorbars"),A=a(T,"g","lines"),M=a(T,"g","points"),E=a(T,"g","text");if(n.getComponentMethod("errorbars","plot")(e,S,u,m),!0===w.visible){var C,P;x(T).style("opacity",w.opacity);var L,I,z=w.fill.charAt(w.fill.length-1);"x"!==z&&"y"!==z&&(z=""),"y"===z?(L=1,I=_.c2p(0,!0)):"x"===z&&(L=0,I=b.c2p(0,!0)),p[0][u.isRangePlot?"nodeRangePlot3":"node3"]=T;var O,R,D="",j=[],F=w._prevtrace,B=null,N=null;F&&(D=F._prevRevpath||"",P=F._nextFill,j=F._ownPolygons,B=F._fillsegments,N=F._fillElement);var U,V,q,H,G,W,$="",Z="",X=[];w._polygons=[];var Y=[],K=[],J=i.noop;if(C=w._ownFill,l.hasLines(w)||"none"!==w.fill){P&&P.datum(p),-1!==["hv","vh","hvh","vhv"].indexOf(k.shape)?(U=s.steps(k.shape),V=s.steps(k.shape.split("").reverse().join(""))):U=V="spline"===k.shape?function(e){var t=e[e.length-1];return e.length>1&&e[0][0]===t[0]&&e[0][1]===t[1]?s.smoothclosed(e.slice(1),k.smoothing):s.smoothopen(e,k.smoothing)}:function(e){return"M"+e.join("L")},q=function(e){return V(e.reverse())},K=c(p,{xaxis:b,yaxis:_,trace:w,connectGaps:w.connectgaps,baseTolerance:Math.max(k.width||1,3)/4,shape:k.shape,backoff:k.backoff,simplify:k.simplify,fill:w.fill}),Y=new Array(K.length);var Q=0;for(g=0;g<K.length;g++){var ee,te=K[g];ee&&z?ee.push.apply(ee,te):(ee=te.slice(),Y[Q]=ee,Q++)}w._fillElement=null,w._fillExclusionElement=N,w._fillsegments=Y.slice(0,Q),Y=w._fillsegments,K.length&&(H=K[0][0].slice(),W=(G=K[K.length-1])[G.length-1].slice()),J=function(e){return function(t){if(O=U(t),R=q(t),$?z?($+="L"+O.substr(1),Z=R+"L"+Z.substr(1)):($+="Z"+O,Z=R+"Z"+Z):($=O,Z=R),l.hasLines(w)){var n=r.select(this);if(n.datum(p),e)x(n.style("opacity",0).attr("d",O).call(s.lineGroupStyle)).style("opacity",1);else{var i=x(n);i.attr("d",O),s.singleLineStyle(p,i)}}}}}var re=A.selectAll(".js-line").data(K);x(re.exit()).style("opacity",0).remove(),re.each(J(!1)),re.enter().append("path").classed("js-line",!0).style("vector-effect",y?"none":"non-scaling-stroke").call(s.lineGroupStyle).each(J(!0)),s.setClipUrl(re,u.layerClipId,e);var ne=function(){var e=new Array(Y.length);for(g=0;g<Y.length;g++)e[g]=h(Y[g]);return e},ie=function(e){var t,r;if(e&&0!==e.length){for(t=new Array(e.length-1+Y.length),r=0;r<e.length-1;r++)t[r]=h(e[r]);var n=e[e.length-1].slice();for(n.reverse(),r=0;r<Y.length;r++)t[e.length-1+r]=h(Y[r].concat(n))}else for(t=new Array(Y.length),r=0;r<Y.length;r++){var i=Y[r][0].slice(),a=Y[r][Y[r].length-1].slice();i[L]=a[L]=I;var o=[a,i].concat(Y[r]);t[r]=h(o)}return t};K.length?(C?(C.datum(p),H&&W&&(z?(H[L]=W[L]=I,x(C).attr("d","M"+W+"L"+H+"L"+$.substr(1)).call(s.singleFillStyle,e),X=ie(null)):(x(C).attr("d",$+"Z").call(s.singleFillStyle,e),X=ne())),w._polygons=X,w._fillElement=C):P&&("tonext"===w.fill.substr(0,6)&&$&&D?("tonext"===w.fill?(x(P).attr("d",$+"Z"+D+"Z").call(s.singleFillStyle,e),X=ne(),w._polygons=X.concat(j)):(x(P).attr("d",$+"L"+D.substr(1)+"Z").call(s.singleFillStyle,e),X=ie(B),w._polygons=X),w._fillElement=P):oe(P)),w._prevRevpath=Z):(C?oe(C):P&&oe(P),w._prevRevpath=null),w._ownPolygons=X,M.datum(p),E.datum(p),function(t,n,i){var a,c=i[0].trace,h=l.hasMarkers(c),p=l.hasText(c),d=function(e){if(e.ids)return ue}(c),f=he,m=he;if(h||p){var g=o,y=c.stackgroup,w=y&&"infer zero"===e._fullLayout._scatterStackOpts[b._id+_._id][y].stackgaps;c.marker.maxdisplayed||c._needsCull?g=w?le:se:y&&!w&&(g=ce),h&&(f=g),p&&(m=g)}var k,T=(a=t.selectAll("path.point").data(f,d)).enter().append("path").classed("point",!0);v&&T.call(s.pointStyle,c,e).call(s.translatePoints,b,_).style("opacity",0).transition().style("opacity",1),a.order(),h&&(k=s.makePointStyleFns(c)),a.each((function(t){var n=r.select(this),i=x(n);s.translatePoint(t,i,b,_)?(s.singlePointStyle(t,i,c,k,e),u.layerClipId&&s.hideOutsideRangePoint(t,i,b,_,c.xcalendar,c.ycalendar),c.customdata&&n.classed("plotly-customdata",null!==t.data&&void 0!==t.data)):i.remove()})),v?a.exit().transition().style("opacity",0).remove():a.exit().remove(),(a=n.selectAll("g").data(m,d)).enter().append("g").classed("textpoint",!0).append("text"),a.order(),a.each((function(e){var t=r.select(this),n=x(t.select("text"));s.translatePoint(e,n,b,_)?u.layerClipId&&s.hideOutsideRangePoint(e,t,b,_,c.xcalendar,c.ycalendar):t.remove()})),a.selectAll("text").call(s.textPointStyle,c,e).each((function(e){var t=b.c2p(e.x),n=_.c2p(e.y);r.select(this).selectAll("tspan.line").each((function(){x(r.select(this)).attr({x:t,y:n})}))})),a.exit().remove()}(M,E,p);var ae=!1===w.cliponaxis?null:u.layerClipId;s.setClipUrl(M,ae,e),s.setClipUrl(E,ae,e)}function oe(e){x(e).attr("d","M0,0Z")}function se(e){return e.filter((function(e){return!e.gap&&e.vis}))}function le(e){return e.filter((function(e){return e.vis}))}function ce(e){return e.filter((function(e){return!e.gap}))}function ue(e){return e.id}function he(){return!1}}t.exports=function(e,t,n,i,l,c){var h,d,f=!l,m=!!l&&l.duration>0,g=u(e,t,n);(h=i.selectAll("g.trace").data(g,(function(e){return e[0].trace.uid}))).enter().append("g").attr("class",(function(e){return"trace scatter trace"+e[0].trace.uid})).style("stroke-miterlimit",2),h.order(),function(e,t,n){t.each((function(t){var i=a(r.select(this),"g","fills");s.setClipUrl(i,n.layerClipId,e);var l=t[0].trace,c=[];l._ownfill&&c.push("_ownFill"),l._nexttrace&&c.push("_nextFill");var u=i.selectAll("g").data(c,o);u.enter().append("g"),u.exit().each((function(e){l[e]=null})).remove(),u.order().each((function(e){l[e]=a(r.select(this),"path","js-fill")}))}))}(e,h,t),m?(c&&(d=c()),r.transition().duration(l.duration).ease(l.easing).each("end",(function(){d&&d()})).each("interrupt",(function(){d&&d()})).each((function(){i.selectAll("g.trace").each((function(r,n){p(e,n,t,r,g,this,l)}))}))):h.each((function(r,n){p(e,n,t,r,g,this,l)})),f&&h.exit().remove(),i.selectAll("path:not([d])").remove()}}}),pi=p({"src/traces/scatter/marker_colorbar.js"(e,t){t.exports={container:"marker",min:"cmin",max:"cmax"}}}),di=p({"src/traces/scatter/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a={_fullLayout:n},o=r.getFromTrace(a,t,"x"),s=r.getFromTrace(a,t,"y"),l=e.orig_x;void 0===l&&(l=e.x);var c=e.orig_y;return void 0===c&&(c=e.y),i.xLabel=r.tickText(o,o.c2l(l),!0).text,i.yLabel=r.tickText(s,s.c2l(c),!0).text,i}}}),fi=p({"src/traces/scatter/style.js"(e,t){var r=v(),n=Jt(),i=Ve();function a(e,t,r){n.pointStyle(e.selectAll("path.point"),t,r)}function o(e,t,r){n.textPointStyle(e.selectAll("text"),t,r)}t.exports={style:function(e){var t=r.select(e).selectAll("g.trace.scatter");t.style("opacity",(function(e){return e[0].trace.opacity})),t.selectAll("g.points").each((function(t){a(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.text").each((function(t){o(r.select(this),t.trace||t[0].trace,e)})),t.selectAll("g.trace path.js-line").call(n.lineGroupStyle),t.selectAll("g.trace path.js-fill").call(n.fillGroupStyle,e,!1),i.getComponentMethod("errorbars","style")(t)},stylePoints:a,styleText:o,styleOnSelect:function(e,t,r){var i=t[0].trace;i.selectedpoints?(n.selectedPointStyle(r.selectAll("path.point"),i),n.selectedTextStyle(r.selectAll("text"),i)):(a(r,i,e),o(r,i,e))}}}}),mi=p({"src/traces/scatter/get_trace_color.js"(e,t){var r=q(),n=$t();t.exports=function(e,t){var i,a;if("lines"===e.mode)return(i=e.line.color)&&r.opacity(i)?i:e.fillcolor;if("none"===e.mode)return e.fill?e.fillcolor:"";var o=t.mcc||(e.marker||{}).color,s=t.mlcc||((e.marker||{}).line||{}).color;return(a=o&&r.opacity(o)?o:s&&r.opacity(s)&&(t.mlw||((e.marker||{}).line||{}).width)?s:"")?r.opacity(a)<.3?r.addOpacity(a,.3):a:(i=(e.line||{}).color)&&r.opacity(i)&&n.hasLines(e)&&e.line.width?i:e.fillcolor}}}),gi=p({"src/traces/scatter/hover.js"(e,t){var r=st(),n=zr(),i=Ve(),a=mi(),o=q(),s=r.fillText;t.exports=function(e,t,l,c){var u=e.cd,h=u[0].trace,p=e.xa,d=e.ya,f=p.c2p(t),m=d.c2p(l),g=[f,m],y=h.hoveron||"",v=-1!==h.mode.indexOf("markers")?3:.5,x=!!h.xperiodalignment,b=!!h.yperiodalignment;if(-1!==y.indexOf("points")){var _=function(e){var t=Math.max(v,e.mrc||0),r=p.c2p(e.x)-f,n=d.c2p(e.y)-m;return Math.max(Math.sqrt(r*r+n*n)-t,1-v/t)},w=n.getDistanceFunction(c,(function(e){if(x){var t=p.c2p(e.xStart),r=p.c2p(e.xEnd);return f>=Math.min(t,r)&&f<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(p.c2p(e.x)-f);return a<n?i*a/n:a-n+i}),(function(e){if(b){var t=d.c2p(e.yStart),r=d.c2p(e.yEnd);return m>=Math.min(t,r)&&m<=Math.max(t,r)?0:1/0}var n=Math.max(3,e.mrc||0),i=1-1/n,a=Math.abs(d.c2p(e.y)-m);return a<n?i*a/n:a-n+i}),_);if(n.getClosest(u,w,e),!1!==e.index){var k=u[e.index],T=p.c2p(k.x,!0),S=d.c2p(k.y,!0),A=k.mrc||1;e.index=k.i;var M=u[0].t.orientation,E=M&&(k.sNorm||k.s),C="h"===M?E:void 0!==k.orig_x?k.orig_x:k.x,P="v"===M?E:void 0!==k.orig_y?k.orig_y:k.y;return r.extendFlat(e,{color:a(h,k),x0:T-A,x1:T+A,xLabelVal:C,y0:S-A,y1:S+A,yLabelVal:P,spikeDistance:_(k),hovertemplate:h.hovertemplate}),s(k,h,e),i.getComponentMethod("errorbars","hoverInfo")(k,h,e),[e]}}function L(e){if(!e)return!1;var t=e.node();try{var r=new DOMPoint(g[0],g[1]);return t.isPointInFill(r)}catch(i){var n=t.ownerSVGElement.createSVGPoint();return n.x=g[0],n.y=g[1],t.isPointInFill(n)}}if(-1!==y.indexOf("fills")&&h._fillElement&&L(h._fillElement)&&!L(h._fillExclusionElement)){var I=function(e){var t,r,n,i,a,o,s,l,c,u=[],h=1/0,f=-1/0,m=1/0,y=-1/0;for(t=0;t<e.length;t++){var v=e[t];v.contains(g)&&(u.push(v),m=Math.min(m,v.ymin),y=Math.max(y,v.ymax))}if(0===u.length)return null;for(r=((m=Math.max(m,0))+(y=Math.min(y,d._length)))/2,t=0;t<u.length;t++)for(i=u[t].pts,n=1;n<i.length;n++)(l=i[n-1][1])>r!==(c=i[n][1])>=r&&(o=i[n-1][0],s=i[n][0],c-l&&(a=o+(s-o)*(r-l)/(c-l),h=Math.min(h,a),f=Math.max(f,a)));return{x0:h=Math.max(h,0),x1:f=Math.min(f,p._length),y0:r,y1:r}}(h._polygons);null===I&&(I={x0:g[0],x1:g[0],y0:g[1],y1:g[1]});var z=o.defaultLine;return o.opacity(h.fillcolor)?z=h.fillcolor:o.opacity((h.line||{}).color)&&(z=h.line.color),r.extendFlat(e,{distance:e.maxHoverDistance,x0:I.x0,x1:I.x1,y0:I.y0,y1:I.y1,color:z,hovertemplate:!1}),delete e.index,h.text&&!r.isArrayOrTypedArray(h.text)?e.text=String(h.text):e.text=h.name,[e]}}}}),yi=p({"src/traces/scatter/select.js"(e,t){var r=$t();t.exports=function(e,t){var n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[],h=s[0].trace;if(!r.hasMarkers(h)&&!r.hasText(h))return[];if(!1===t)for(n=0;n<s.length;n++)s[n].selected=0;else for(n=0;n<s.length;n++)i=s[n],a=l.c2p(i.x),o=c.c2p(i.y),null!==i.i&&t.contains([a,o],!1,n,e)?(u.push({pointNumber:i.i,x:l.c2d(i.x),y:c.c2d(i.y)}),i.selected=1):i.selected=0;return u}}}),vi=p({"src/plots/cartesian/attributes.js"(e,t){t.exports={xaxis:{valType:"subplotid",dflt:"x",editType:"calc+clearAxisTypes"},yaxis:{valType:"subplotid",dflt:"y",editType:"calc+clearAxisTypes"}}}}),xi=p({"src/plots/cartesian/type_defaults.js"(e,t){var r=Ve().traceIs,n=tr();function i(e){return{v:"x",h:"y"}[e.orientation||"v"]}function a(e,t){var n=i(e),a=r(e,"box-violin"),o=r(e._fullInput||{},"candlestick");return a&&!o&&t===n&&void 0===e[n]&&void 0===e[n+"0"]}t.exports=function(e,t,o,s){o("autotypenumbers",s.autotypenumbersDflt),"-"===o("type",(s.splomStash||{}).type)&&(function(e,t){if("-"===e.type){var o,s=e._id,l=s.charAt(0);-1!==s.indexOf("scene")&&(s=l);var c=function(e,t,r){for(var n=0;n<e.length;n++){var i=e[n];if("splom"===i.type&&i._length>0&&(i["_"+r+"axes"]||{})[t])return i;if((i[r+"axis"]||r)===t){if(a(i,r))return i;if((i[r]||[]).length||i[r+"0"])return i}}}(t,s,l);if(c)if("histogram"!==c.type||l!=={v:"y",h:"x"}[c.orientation||"v"]){var u=l+"calendar",h=c[u],p={noMultiCategory:!r(c,"cartesian")||r(c,"noMultiCategory")};if("box"===c.type&&c._hasPreCompStats&&l==={h:"x",v:"y"}[c.orientation||"v"]&&(p.noMultiCategory=!0),p.autotypenumbers=e.autotypenumbers,a(c,l)){var d=i(c),f=[];for(o=0;o<t.length;o++){var m=t[o];r(m,"box-violin")&&(m[l+"axis"]||l)===s&&(void 0!==m[d]?f.push(m[d][0]):void 0!==m.name?f.push(m.name):f.push("text"),m[u]!==h&&(h=void 0))}e.type=n(f,h,p)}else if("splom"===c.type){var g=c.dimensions[c._axesDim[s]];g.visible&&(e.type=n(g.values,h,p))}else e.type=n(c[l]||[c[l+"0"]],h,p)}else e.type="linear"}}(t,s.data),"-"===t.type?t.type="linear":e.type=t.type)}}}),bi=p({"src/plots/cartesian/category_order_defaults.js"(e,t){var r=M().isTypedArraySpec;t.exports=function(e,t,n,i){if("category"===t.type){var a,o=e.categoryarray,s=Array.isArray(o)&&o.length>0||r(o);s&&(a="array");var l,c=n("categoryorder",a);"array"===c&&(l=n("categoryarray")),s||"array"!==c||(c=t.categoryorder="trace"),"trace"===c?t._initialCategories=[]:"array"===c?t._initialCategories=l.slice():(l=function(e,t){var r,n,i,a=t.dataAttr||e._id.charAt(0),o={};if(t.axData)r=t.axData;else for(r=[],n=0;n<t.data.length;n++){var s=t.data[n];s[a+"axis"]===e._id&&r.push(s)}for(n=0;n<r.length;n++){var l=r[n][a];for(i=0;i<l.length;i++){var c=l[i];null!==c&&void 0!==c&&(o[c]=1)}}return Object.keys(o)}(t,i).sort(),"category ascending"===c?t._initialCategories=l:"category descending"===c&&(t._initialCategories=l.reverse()))}}}}),_i=p({"src/plots/cartesian/line_grid_defaults.js"(e,t){var r=O().mix,n=V(),i=st();t.exports=function(e,t,a,o){var s=(o=o||{}).dfltColor;function l(r,n){return i.coerce2(e,t,o.attributes,r,n)}var c=l("linecolor",s),u=l("linewidth");a("showline",o.showLine||!!c||!!u)||(delete t.linecolor,delete t.linewidth);var h=l("gridcolor",r(s,o.bgColor,o.blend||n.lightFraction).toRgbString()),p=l("gridwidth"),d=l("griddash");if(a("showgrid",o.showGrid||!!h||!!p||!!d)||(delete t.gridcolor,delete t.gridwidth,delete t.griddash),o.hasMinor){var f=l("minor.gridcolor",r(t.gridcolor,o.bgColor,67).toRgbString()),m=l("minor.gridwidth",t.gridwidth||1),g=l("minor.griddash",t.griddash||"solid");a("minor.showgrid",!!f||!!m||!!g)||(delete t.minor.gridcolor,delete t.minor.gridwidth,delete t.minor.griddash)}if(!o.noZeroLine){var y=l("zerolinecolor",s),v=l("zerolinewidth");a("zeroline",o.showGrid||!!y||!!v)||(delete t.zerolinecolor,delete t.zerolinewidth)}}}}),wi=p({"src/plots/cartesian/axis_defaults.js"(e,t){var r=k(),n=Ve(),i=st(),a=gt(),o=Ft(),s=Ct(),l=Rt(),c=Dt(),u=Bt(),h=Nt(),p=bi(),d=_i(),f=ar(),m=er(),g=yt().WEEKDAY_PATTERN,y=yt().HOUR_PATTERN;function v(e,t,n){function a(r,n){return i.coerce(e,t,s.rangebreaks,r,n)}if(a("enabled")){var o=a("bounds");if(o&&o.length>=2){var l,c,u="";if(2===o.length)for(l=0;l<2;l++)if(c=b(o[l])){u=g;break}var h=a("pattern",u);if(h===g)for(l=0;l<2;l++)(c=b(o[l]))&&(t.bounds[l]=o[l]=c-1);if(h)for(l=0;l<2;l++)switch(c=o[l],h){case g:if(!r(c))return void(t.enabled=!1);if((c=+c)!==Math.floor(c)||c<0||c>=7)return void(t.enabled=!1);t.bounds[l]=o[l]=c;break;case y:if(!r(c))return void(t.enabled=!1);if((c=+c)<0||c>24)return void(t.enabled=!1);t.bounds[l]=o[l]=c}if(!1===n.autorange){var p=n.range;if(p[0]<p[1]){if(o[0]<p[0]&&o[1]>p[1])return void(t.enabled=!1)}else if(o[0]>p[0]&&o[1]<p[1])return void(t.enabled=!1)}}else{var d=a("values");if(!d||!d.length)return void(t.enabled=!1);a("dvalue")}}}t.exports=function(e,t,r,y,x){var b,_=y.letter,w=y.font||{},k=y.splomStash||{},T=r("visible",!y.visibleDflt),S=t._template||{},A=t.type||S.type||"-";"date"===A&&(n.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",y.calendar),y.noTicklabelmode||(b=r("ticklabelmode"))),y.noTicklabelindex||"date"!==A&&"linear"!==A||r("ticklabelindex");var M="";y.noTicklabelposition&&"multicategory"!==A||(M=i.coerce(e,t,{ticklabelposition:{valType:"enumerated",dflt:"outside",values:"period"===b?["outside","inside"]:"x"===_?["outside","inside","outside left","inside left","outside right","inside right"]:["outside","inside","outside top","inside top","outside bottom","inside bottom"]}},"ticklabelposition")),y.noTicklabeloverflow||r("ticklabeloverflow",-1!==M.indexOf("inside")?"hide past domain":"category"===A||"multicategory"===A?"allow":"hide past div"),m(t,x),f(e,t,r,y),p(e,t,r,y),"category"===A||y.noHover||r("hoverformat");var E=r("color"),C=E!==s.color.dflt?E:w.color,P=k.label||x._dfltTitle[_];if(h(e,t,r,A,y),!T)return t;r("title.text",P),i.coerceFont(r,"title.font",w,{overrideDflt:{size:i.bigFont(w.size),color:C}}),l(e,t,r,A);var L=y.hasMinor;if(L&&(a.newContainer(t,"minor"),l(e,t,r,A,{isMinor:!0})),u(e,t,r,A,y),c(e,t,r,y),L){var I=y.isMinor;y.isMinor=!0,c(e,t,r,y),y.isMinor=I}d(e,t,r,{dfltColor:E,bgColor:y.bgColor,showGrid:y.showGrid,hasMinor:L,attributes:s}),!L||t.minor.ticks||t.minor.showgrid||delete t.minor,(t.showline||t.ticks)&&r("mirror");var z,O="multicategory"===A;if(y.noTickson||"category"!==A&&!O||!t.ticks&&!t.showgrid||(O&&(z="boundaries"),"boundaries"===r("tickson",z)&&delete t.ticklabelposition),O&&r("showdividers")&&(r("dividercolor"),r("dividerwidth")),"date"===A)if(o(e,t,{name:"rangebreaks",inclusionAttr:"enabled",handleItemDefaults:v}),t.rangebreaks.length){for(var R=0;R<t.rangebreaks.length;R++)if(t.rangebreaks[R].pattern===g){t._hasDayOfWeekBreaks=!0;break}if(m(t,x),x._has("scattergl")||x._has("splom"))for(var D=0;D<y.data.length;D++){var j=y.data[D];"scattergl"!==j.type&&"splom"!==j.type||(j.visible=!1,i.warn(j.type+" traces do not work on axes with rangebreaks. Setting trace "+j.index+" to `visible: false`."))}}else delete t.rangebreaks;return t};var x={sun:1,mon:2,tue:3,wed:4,thu:5,fri:6,sat:7};function b(e){if("string"===typeof e)return x[e.substr(0,3).toLowerCase()]}}}),ki=p({"src/plots/cartesian/position_defaults.js"(e,t){var r=k(),n=st();t.exports=function(e,t,i,a){var o,s,l,c,u,h,p=a.counterAxes||[],d=a.overlayableAxes||[],f=a.letter,m=a.grid,g=a.overlayingDomain;m&&(s=m._domains[f][m._axisMap[t._id]],o=m._anchors[t._id],s&&(l=m[f+"side"].split(" ")[0],c=m.domain[f]["right"===l||"top"===l?1:0])),s=s||[0,1],o=o||(r(e.position)?"free":p[0]||"free"),l=l||("x"===f?"bottom":"left"),c=c||0,u=0,h=!1;var y=n.coerce(e,t,{anchor:{valType:"enumerated",values:["free"].concat(p),dflt:o}},"anchor"),v=n.coerce(e,t,{side:{valType:"enumerated",values:"x"===f?["bottom","top"]:["left","right"],dflt:l}},"side");"free"===y&&("y"===f&&(i("autoshift")&&(c="left"===v?g[0]:g[1],h=!t.automargin||t.automargin,u="left"===v?-3:3),i("shift",u)),i("position",c)),i("automargin",h);var x=!1;if(d.length&&(x=n.coerce(e,t,{overlaying:{valType:"enumerated",values:[!1].concat(d),dflt:!1}},"overlaying")),!x){var b=i("domain",s);b[0]>b[1]-1/4096&&(t.domain=s),n.noneOrAll(e.domain,t.domain,s),"sync"===t.tickmode&&(t.tickmode="auto")}return i("layer"),t}}}),Ti=p({"src/plots/cartesian/layout_defaults.js"(e,t){var r=st(),n=q(),i=Xt().isUnifiedHover,a=Cr(),o=gt(),s=Be(),l=Ct(),c=xi(),u=wi(),h=tn(),p=ki(),d=vt(),f=d.id2name,m=d.name2id,g=yt().AX_ID_PATTERN,y=Ve(),v=y.traceIs,x=y.getComponentMethod;function b(e,t,r){Array.isArray(e[t])?e[t].push(r):e[t]=[r]}t.exports=function(e,t,y){var _,w,k=t.autotypenumbers,T={},S={},A={},M={},E={},C={},P={},L={},I={},z={};for(_=0;_<y.length;_++){var O=y[_];if(v(O,"cartesian")){var R,D;if(O.xaxis)R=f(O.xaxis),b(T,R,O);else if(O.xaxes)for(w=0;w<O.xaxes.length;w++)b(T,f(O.xaxes[w]),O);if(O.yaxis)D=f(O.yaxis),b(T,D,O);else if(O.yaxes)for(w=0;w<O.yaxes.length;w++)b(T,f(O.yaxes[w]),O);"funnel"===O.type?"h"===O.orientation?(R&&(S[R]=!0),D&&(P[D]=!0)):D&&(A[D]=!0):"image"===O.type?(D&&(L[D]=!0),R&&(L[R]=!0)):(D&&(E[D]=!0,C[D]=!0),v(O,"carpet")&&("carpet"!==O.type||O._cheater)||R&&(M[R]=!0)),"carpet"===O.type&&O._cheater&&R&&(S[R]=!0),v(O,"2dMap")&&(I[R]=!0,I[D]=!0),v(O,"oriented")&&(z["h"===O.orientation?D:R]=!0)}}var j=t._subplots,F=j.xaxis,B=j.yaxis,N=r.simpleMap(F,f),U=r.simpleMap(B,f),V=N.concat(U),q=n.background;F.length&&B.length&&(q=r.coerce(e,t,s,"plot_bgcolor"));var H,G,W,$,Z,X=n.combine(q,t.paper_bgcolor);function Y(){var e=T[H]||[];Z._traceIndices=e.map((function(e){return e.index})),Z._annIndices=[],Z._shapeIndices=[],Z._selectionIndices=[],Z._imgIndices=[],Z._subplotsWith=[],Z._counterAxes=[],Z._name=Z._attr=H,Z._id=G}function K(e,t){return r.coerce($,Z,l,e,t)}function J(e,t){return r.coerce2($,Z,l,e,t)}function Q(e){return"x"===e?B:F}function ee(t,r){for(var n="x"===t?N:U,i=[],a=0;a<n.length;a++){var o=n[a];o===r||(e[o]||{}).overlaying||i.push(m(o))}return i}var te={x:Q("x"),y:Q("y")},re=te.x.concat(te.y),ne={},ie=[];function ae(){var e=$.matches;g.test(e)&&-1===re.indexOf(e)&&(ne[e]=$.type,ie=Object.keys(ne))}var oe=a(e,t),se=i(oe);for(_=0;_<V.length;_++){H=V[_],G=m(H),W=H.charAt(0),r.isPlainObject(e[H])||(e[H]={}),$=e[H],Z=o.newContainer(t,H,W+"axis"),Y();var le="x"===W&&!M[H]&&S[H]||"y"===W&&!E[H]&&A[H],ce="y"===W&&(!C[H]&&P[H]||L[H]),ue={hasMinor:!0,letter:W,font:t.font,outerTicks:I[H],showGrid:!z[H],data:T[H]||[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:le,reverseDflt:ce,autotypenumbersDflt:k,splomStash:((t._splomAxes||{})[W]||{})[G],noAutotickangles:"y"===W};K("uirevision",t.uirevision),c($,Z,K,ue),u($,Z,K,ue,t);var he=se&&W===oe.charAt(0),pe=J("spikecolor",se?Z.color:void 0),de=J("spikethickness",se?1.5:void 0),fe=J("spikedash",se?"dot":void 0),me=J("spikemode",se?"across":void 0),ge=J("spikesnap");K("showspikes",!!he||!!pe||!!de||!!fe||!!me||!!ge)||(delete Z.spikecolor,delete Z.spikethickness,delete Z.spikedash,delete Z.spikemode,delete Z.spikesnap);var ye=f($.overlaying),ve=[0,1];if(void 0!==t[ye]){var xe=f(t[ye].anchor);void 0!==t[xe]&&(ve=t[xe].domain)}p($,Z,K,{letter:W,counterAxes:te[W],overlayableAxes:ee(W,H),grid:t.grid,overlayingDomain:ve}),K("title.standoff"),ae(),Z._input=$}for(_=0;_<ie.length;){G=ie[_++],W=(H=f(G)).charAt(0),r.isPlainObject(e[H])||(e[H]={}),$=e[H],Z=o.newContainer(t,H,W+"axis"),Y();var be={letter:W,font:t.font,outerTicks:I[H],showGrid:!z[H],data:[],bgColor:X,calendar:t.calendar,automargin:!0,visibleDflt:!1,reverseDflt:!1,autotypenumbersDflt:k,splomStash:((t._splomAxes||{})[W]||{})[G]};K("uirevision",t.uirevision),Z.type=ne[G]||"linear",u($,Z,K,be,t),p($,Z,K,{letter:W,counterAxes:te[W],overlayableAxes:ee(W,H),grid:t.grid}),K("fixedrange"),ae(),Z._input=$}var _e=x("rangeslider","handleDefaults"),we=x("rangeselector","handleDefaults");for(_=0;_<N.length;_++)H=N[_],$=e[H],Z=t[H],_e(e,t,H),"date"===Z.type&&we($,Z,t,U,Z.calendar),K("fixedrange");for(_=0;_<U.length;_++){H=U[_],$=e[H],Z=t[H];var ke=t[f(Z.anchor)];K("fixedrange",x("rangeslider","isVisible")(ke))}h.handleDefaults(e,t,{axIds:re.concat(ie).sort(d.idSort),axHasImage:L})}}}),Si=p({"src/plots/cartesian/transition_axes.js"(e,t){var r=v(),n=Ve(),i=st(),a=Jt(),o=nr();t.exports=function(e,t,s,l){var c=e._fullLayout;if(0!==t.length){var u,h,p,d;l&&(u=l());var f=r.ease(s.easing);return e._transitionData._interruptCallbacks.push((function(){return window.cancelAnimationFrame(d),d=null,function(){for(var r={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr0&&(r[o._name+".range"]=a.xr0.slice()),a.yr0&&(r[s._name+".range"]=a.yr0.slice())}return n.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}()})),h=Date.now(),d=window.requestAnimationFrame((function r(){p=Date.now();for(var i=Math.min(1,(p-h)/s.duration),a=f(i),o=0;o<t.length;o++)g(t[o],a);p-h>s.duration?(function(){for(var r={},i=0;i<t.length;i++){var a=t[i],o=a.plotinfo.xaxis,s=a.plotinfo.yaxis;a.xr1&&(r[o._name+".range"]=a.xr1.slice()),a.yr1&&(r[s._name+".range"]=a.yr1.slice())}u&&u(),n.call("relayout",e,r).then((function(){for(var e=0;e<t.length;e++)m(t[e].plotinfo)}))}(),d=window.cancelAnimationFrame(r)):d=window.requestAnimationFrame(r)})),Promise.resolve()}function m(e){var t=e.xaxis,r=e.yaxis;c._defs.select("#"+e.clipId+"> rect").call(a.setTranslate,0,0).call(a.setScale,1,1),e.plot.call(a.setTranslate,t._offset,r._offset).call(a.setScale,1,1);var n=e.plot.selectAll(".scatterlayer .trace");n.selectAll(".point").call(a.setPointGroupScale,1,1),n.selectAll(".textpoint").call(a.setTextPointsScale,1,1),n.call(a.hideOutsideRangePoints,e)}function g(t,r){var n=t.plotinfo,s=n.xaxis,l=n.yaxis,c=s._length,u=l._length,h=!!t.xr1,p=!!t.yr1,d=[];if(h){var f=i.simpleMap(t.xr0,s.r2l),m=i.simpleMap(t.xr1,s.r2l),g=f[1]-f[0],y=m[1]-m[0];d[0]=(f[0]*(1-r)+r*m[0]-f[0])/(f[1]-f[0])*c,d[2]=c*(1-r+r*y/g),s.range[0]=s.l2r(f[0]*(1-r)+r*m[0]),s.range[1]=s.l2r(f[1]*(1-r)+r*m[1])}else d[0]=0,d[2]=c;if(p){var v=i.simpleMap(t.yr0,l.r2l),x=i.simpleMap(t.yr1,l.r2l),b=v[1]-v[0],_=x[1]-x[0];d[1]=(v[1]*(1-r)+r*x[1]-v[1])/(v[0]-v[1])*u,d[3]=u*(1-r+r*_/b),l.range[0]=s.l2r(v[0]*(1-r)+r*x[0]),l.range[1]=l.l2r(v[1]*(1-r)+r*x[1])}else d[1]=0,d[3]=u;o.drawOne(e,s,{skipTitle:!0}),o.drawOne(e,l,{skipTitle:!0}),o.redrawComponents(e,[s._id,l._id]);var w=h?c/d[2]:1,k=p?u/d[3]:1,T=h?d[0]:0,S=p?d[1]:0,A=h?d[0]/d[2]*c:0,M=p?d[1]/d[3]*u:0,E=s._offset-A,C=l._offset-M;n.clipRect.call(a.setTranslate,T,S).call(a.setScale,1/w,1/k),n.plot.call(a.setTranslate,E,C).call(a.setScale,w,k),a.setPointGroupScale(n.zoomScalePts,1/w,1/k),a.setTextPointsScale(n.zoomScaleTxt,1/w,1/k)}o.redrawComponents(e)}}}),Ai=p({"src/plots/cartesian/index.js"(e){var t=v(),r=Ve(),n=st(),i=kt(),a=Jt(),o=_t().getModuleCalcData,s=vt(),l=yt(),c=Tt(),u=n.ensureSingle;function h(e,t,r){return n.ensureSingle(e,t,r,(function(e){e.datum(r)}))}var p=l.zindexSeparator;function d(e,n,i,s,c){for(var u,h,p,d=l.traceLayerClasses,f=e._fullLayout,m=f._zindices,g=f._modules,y=[],v=[],x=0;x<m.length;x++)for(var b=m[x],_=0;_<g.length;_++){var w=(u=g[_]).name,k=r.modules[w].categories;if(k.svg){var T=u.layerName||w+"layer",S=T+(x?Number(x)+1:""),A=u.plot;p=(h=o(i,A,b))[0],i=h[1],p.length&&y.push({i:d.indexOf(T),zindex:x,className:S,plotMethod:A,cdModule:p}),k.zoomScale&&v.push("."+S)}}y.sort((function(e,t){return(e.zindex||0)-(t.zindex||0)||e.i-t.i}));var M=n.plot.selectAll("g.mlayer").data(y,(function(e){return e.className}));if(M.enter().append("g").attr("class",(function(e){return e.className})).classed("mlayer",!0).classed("rangeplot",n.isRangePlot),M.exit().remove(),M.order(),M.each((function(r){var i=t.select(this),o=r.className;r.plotMethod(e,n,r.cdModule,i,s,c),-1===l.clipOnAxisFalseQuery.indexOf("."+o)&&a.setClipUrl(i,n.layerClipId,e)})),f._has("scattergl")&&(u=r.getModule("scattergl"),p=o(i,u)[0],u.plot(e,n,p)),!e._context.staticPlot&&(n._hasClipOnAxisFalse&&(n.clipOnAxisFalseTraces=n.plot.selectAll(l.clipOnAxisFalseQuery.join(",")).selectAll(".trace")),v.length)){var E=n.plot.selectAll(v.join(",")).selectAll(".trace");n.zoomScalePts=E.selectAll("path.point"),n.zoomScaleTxt=E.selectAll(".textpoint")}}function f(e,t){var r=e._fullLayout,n=t.plotgroup,i=t.id,a=-1!==i.indexOf(p),o=l.layerValue2layerClass[t.xaxis.layer],c=l.layerValue2layerClass[t.yaxis.layer],d=r._hasOnlyLargeSploms,f=r._zindices.length>1,m=t.mainplotinfo;if(!t.mainplot||f)if(d)t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.xaxislayer=u(n,"g","xaxislayer-above"),t.yaxislayer=u(n,"g","yaxislayer-above");else{if(!a){var g=u(n,"g","layer-subplot");t.shapelayer=u(g,"g","shapelayer"),t.imagelayer=u(g,"g","imagelayer"),m&&f?(t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer):(t.minorGridlayer=u(n,"g","minor-gridlayer"),t.gridlayer=u(n,"g","gridlayer"),t.zerolinelayer=u(n,"g","zerolinelayer"));var y=u(n,"g","layer-between");t.shapelayerBetween=u(y,"g","shapelayer"),t.imagelayerBetween=u(y,"g","imagelayer"),u(n,"path","xlines-below"),u(n,"path","ylines-below"),t.overlinesBelow=u(n,"g","overlines-below"),u(n,"g","xaxislayer-below"),u(n,"g","yaxislayer-below"),t.overaxesBelow=u(n,"g","overaxes-below")}t.overplot=u(n,"g","overplot"),t.plot=u(t.overplot,"g",i),a||(t.xlines=u(n,"path","xlines-above"),t.ylines=u(n,"path","ylines-above"),t.overlinesAbove=u(n,"g","overlines-above"),u(n,"g","xaxislayer-above"),u(n,"g","yaxislayer-above"),t.overaxesAbove=u(n,"g","overaxes-above"),t.xlines=n.select(".xlines-"+o),t.ylines=n.select(".ylines-"+c),t.xaxislayer=n.select(".xaxislayer-"+o),t.yaxislayer=n.select(".yaxislayer-"+c))}else{var v=m.plotgroup,x=i+"-x",b=i+"-y";t.minorGridlayer=m.minorGridlayer,t.gridlayer=m.gridlayer,t.zerolinelayer=m.zerolinelayer,u(m.overlinesBelow,"path",x),u(m.overlinesBelow,"path",b),u(m.overaxesBelow,"g",x),u(m.overaxesBelow,"g",b),t.plot=u(m.overplot,"g",i),u(m.overlinesAbove,"path",x),u(m.overlinesAbove,"path",b),u(m.overaxesAbove,"g",x),u(m.overaxesAbove,"g",b),t.xlines=v.select(".overlines-"+o).select("."+x),t.ylines=v.select(".overlines-"+c).select("."+b),t.xaxislayer=v.select(".overaxes-"+o).select("."+x),t.yaxislayer=v.select(".overaxes-"+c).select("."+b)}a||(d||(h(t.minorGridlayer,"g",t.xaxis._id),h(t.minorGridlayer,"g",t.yaxis._id),t.minorGridlayer.selectAll("g").map((function(e){return e[0]})).sort(s.idSort),h(t.gridlayer,"g",t.xaxis._id),h(t.gridlayer,"g",t.yaxis._id),t.gridlayer.selectAll("g").map((function(e){return e[0]})).sort(s.idSort)),t.xlines.style("fill","none").classed("crisp",!0),t.ylines.style("fill","none").classed("crisp",!0))}function m(e,r){if(e){var n={};for(var i in e.each((function(e){var i=e[0];t.select(this).remove(),g(i,r),n[i]=!0})),r._plots)for(var a=r._plots[i].overlays||[],o=0;o<a.length;o++){var s=a[o];n[s.id]&&s.plot.selectAll(".trace").remove()}}}function g(e,t){t._draggers.selectAll("g."+e).remove(),t._defs.select("#clip"+t._uid+e+"plot").remove()}e.name="cartesian",e.attr=["xaxis","yaxis"],e.idRoot=["x","y"],e.idRegex=l.idRegex,e.attrRegex=l.attrRegex,e.attributes=vi(),e.layoutAttributes=Ct(),e.supplyLayoutDefaults=Ti(),e.transitionAxes=Si(),e.finalizeSubplots=function(e,t){var r,i,a,o=t._subplots,c=o.xaxis,u=o.yaxis,h=o.cartesian,p=h,d={},f={};for(r=0;r<p.length;r++){var m=p[r].split("y");d[m[0]]=1,f["y"+m[1]]=1}for(r=0;r<c.length;r++)d[i=c[r]]||(a=(e[s.id2name(i)]||{}).anchor,l.idRegex.y.test(a)||(a="y"),h.push(i+a),p.push(i+a),f[a]||(f[a]=1,n.pushUnique(u,a)));for(r=0;r<u.length;r++)f[a=u[r]]||(i=(e[s.id2name(a)]||{}).anchor,l.idRegex.x.test(i)||(i="x"),h.push(i+a),p.push(i+a),d[i]||(d[i]=1,n.pushUnique(c,i)));if(!p.length){for(var g in i="",a="",e)l.attrRegex.test(g)&&("x"===g.charAt(0)?(!i||+g.substr(5)<+i.substr(5))&&(i=g):(!a||+g.substr(5)<+a.substr(5))&&(a=g));i=i?s.name2id(i):"x",a=a?s.name2id(a):"y",c.push(i),u.push(a),h.push(i+a)}},e.plot=function(e,t,r,i){var a,o=e._fullLayout,s=o._subplots.cartesian,l=e.calcdata;if(!Array.isArray(t))for(t=[],a=0;a<l.length;a++)t.push(a);for(var c=o._zindices,u=0;u<c.length;u++){var h=c[u];for(a=0;a<s.length;a++){var f=s[a],m=o._plots[f];if(u>0){var g=m.id;if(-1!==g.indexOf(p))continue;g+=p+(u+1),m=n.extendFlat({},m,{id:g,plot:o._cartesianlayer.selectAll(".subplot").select("."+g)})}for(var y,v=[],x=0;x<l.length;x++){var b=l[x],_=b[0].trace;h===(_.zorder||0)&&_.xaxis+_.yaxis===f&&((-1!==t.indexOf(_.index)||_.carpet)&&(y&&y[0].trace.xaxis+y[0].trace.yaxis===f&&-1!==["tonextx","tonexty","tonext"].indexOf(_.fill)&&-1===v.indexOf(y)&&v.push(y),v.push(b)),y=b)}d(e,m,v,r,i)}}},e.clean=function(e,t,r,n){var i,a,o,l=n._plots||{},c=t._plots||{},u=n._subplots||{};if(n._hasOnlyLargeSploms&&!t._hasOnlyLargeSploms)for(o in l)(i=l[o]).plotgroup&&i.plotgroup.remove();var h=n._has&&n._has("gl"),d=t._has&&t._has("gl");if(h&&!d)for(o in l)(i=l[o])._scene&&i._scene.destroy();if(u.xaxis&&u.yaxis){var f=s.listIds({_fullLayout:n});for(a=0;a<f.length;a++){var y=f[a];t[s.id2name(y)]||n._infolayer.selectAll(".g-"+y+"title").remove()}}var v=n._has&&n._has("cartesian"),x=t._has&&t._has("cartesian");if(v&&!x)m(n._cartesianlayer.selectAll(".subplot"),n),n._defs.selectAll(".axesclip").remove(),delete n._axisConstraintGroups,delete n._axisMatchGroups;else if(u.cartesian)for(a=0;a<u.cartesian.length;a++){var b=u.cartesian[a];if(-1===b.indexOf(p)&&!c[b]){var _="."+b+",."+b+"-x,."+b+"-y";n._cartesianlayer.selectAll(_).remove(),g(b,n)}}},e.drawFramework=function(e){var r,i=e._fullLayout,a=e.calcdata,o={};for(r=0;r<a.length;r++){var s=a[r][0],l=s.trace.zorder||0;o[l]||(o[l]=[]),o[l].push(s)}var c=Object.keys(o).map(Number).sort(n.sorterAsc);c.length||(c=[0]),i._zindices=c;var h=function(e){var t,r,n,i,a,o,s=e._fullLayout,l=s._zindices.length,c=s._subplots.cartesian,u=c.length,h=[],d=[];for(t=0;t<u;t++){n=c[t],a=(i=s._plots[n]).xaxis,o=i.yaxis;var f=a._mainAxis,m=o._mainAxis,g=f._id+m._id,y=s._plots[g];i.overlays=[],g!==n&&y?(i.mainplot=g,i.mainplotinfo=y,d.push(n)):(i.mainplot=void 0,i.mainplotinfo=void 0,h.push(n))}for(t=0;t<d.length;t++)n=d[t],(i=s._plots[n]).mainplotinfo.overlays.push(i);var v=h.concat(d),x=[];for(t=0;t<u;t++){n=v[t],a=(i=s._plots[n]).xaxis,o=i.yaxis;for(var b=[],_=1;_<=l;_++){var w="";for(_>1&&(w+=p+_),b.push(n+w),r=0;r<i.overlays.length;r++)b.push(i.overlays[r].id+w)}b=b.concat([a.layer,o.layer,a.overlaying||"",o.overlaying||""]),x.push(b)}return x}(e),d=h.length,g=[];for(r=0;r<d;r++)g[r]=h[r].slice();for(var y=1;y<c.length;y++){var v=[];for(r=0;r<d;r++)v[r]=h[r].slice(),v[r][0]+=p+(y+1);g=g.concat(v)}var x=i._cartesianlayer.selectAll(".subplot").data(g,String);x.enter().append("g").attr("class",(function(e){return"subplot "+e[0]})),x.order(),x.exit().call(m,i),x.each((function(r){var a=r[0],o=a.indexOf(p),s=-1!==o,l=s?a.slice(0,o):a,c=i._plots[a];c||(c=n.extendFlat({},i._plots[l]))&&(c.id=a,i._plots[a]=c,i._subplots.cartesian.push(a)),c&&(c.plotgroup=t.select(this),f(e,c),s||(c.draglayer=u(i._draggers,"g",a)))}))},e.rangePlot=function(e,t,r){f(e,t),d(e,t,r),i.style(e)},e.toSVG=function(e){var r=e._fullLayout._glimages,n=t.select(e).selectAll(".svg-container");n.filter((function(e,t){return t===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,t=e.toDataURL("image/png");r.append("svg:image").attr({xmlns:c.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})}))},e.updateFx=Cn().updateFx}}),Mi=p({"src/traces/scatter/index.js"(e,t){var r=$t();t.exports={hasLines:r.hasLines,hasMarkers:r.hasMarkers,hasText:r.hasText,isBubble:r.isBubble,attributes:wn(),layoutAttributes:bt(),supplyDefaults:Kn(),crossTraceDefaults:Qn(),supplyLayoutDefaults:ei(),calc:ai().calc,crossTraceCalc:li(),arraysToCalcdata:ni(),plot:hi(),colorbar:pi(),formatLabels:di(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:gi(),selectPoints:yi(),animatable:!0,moduleType:"trace",name:"scatter",basePlotModule:Ai(),categories:["cartesian","svg","symbols","errorBarsOK","showLegend","scatter-like","zoomScale"],meta:{}}}}),Ei=p({"src/components/annotations/draw_arrow_head.js"(e,t){var r=v(),n=q(),i=yn(),a=st(),o=a.strScale,s=a.strRotate,l=a.strTranslate;t.exports=function(e,t,a){var c,u,h,p,d=e.node(),f=i[a.arrowhead||0],m=i[a.startarrowhead||0],g=(a.arrowwidth||1)*(a.arrowsize||1),y=(a.arrowwidth||1)*(a.startarrowsize||1),v=t.indexOf("start")>=0,x=t.indexOf("end")>=0,b=f.backoff*g+a.standoff,_=m.backoff*y+a.startstandoff;if("line"===d.nodeName){c={x:+e.attr("x1"),y:+e.attr("y1")},u={x:+e.attr("x2"),y:+e.attr("y2")};var w=c.x-u.x,k=c.y-u.y;if(p=(h=Math.atan2(k,w))+Math.PI,b&&_&&b+_>Math.sqrt(w*w+k*k))return void O();if(b){if(b*b>w*w+k*k)return void O();var T=b*Math.cos(h),S=b*Math.sin(h);u.x+=T,u.y+=S,e.attr({x2:u.x,y2:u.y})}if(_){if(_*_>w*w+k*k)return void O();var A=_*Math.cos(h),M=_*Math.sin(h);c.x-=A,c.y-=M,e.attr({x1:c.x,y1:c.y})}}else if("path"===d.nodeName){var E=d.getTotalLength(),C="";if(E<b+_)return void O();var P=d.getPointAtLength(0),L=d.getPointAtLength(.1);h=Math.atan2(P.y-L.y,P.x-L.x),c=d.getPointAtLength(Math.min(_,E)),C="0px,"+_+"px,";var I=d.getPointAtLength(E),z=d.getPointAtLength(E-.1);p=Math.atan2(I.y-z.y,I.x-z.x),u=d.getPointAtLength(Math.max(0,E-b)),C+=E-(C?_+b:b)+"px,"+E+"px",e.style("stroke-dasharray",C)}function O(){e.style("stroke-dasharray","0px,100px")}function R(t,i,c,u){t.path&&(t.noRotate&&(c=0),r.select(d.parentNode).append("path").attr({class:e.attr("class"),d:t.path,transform:l(i.x,i.y)+s(180*c/Math.PI)+o(u)}).style({fill:n.rgb(a.arrowcolor),"stroke-width":0}))}v&&R(m,c,h,y),x&&R(f,u,p,g)}}}),Ci=p({"src/components/annotations/draw.js"(e,t){var r=v(),n=Ve(),i=kt(),a=st(),o=a.strTranslate,s=nr(),l=q(),c=Jt(),u=zr(),h=At(),p=pr(),d=hr(),f=gt().arrayEditor,m=Ei();function g(e,t){var r=e._fullLayout.annotations[t]||{},n=s.getFromId(e,r.xref),i=s.getFromId(e,r.yref);n&&n.setScale(),i&&i.setScale(),x(e,r,t,!1,n,i)}function y(e,t,r,n,i){var a=i[r],o=i[r+"ref"],l=-1!==r.indexOf("y"),c="domain"===s.getRefType(o),u=l?n.h:n.w;return e?c?a+(l?-t:t)/e._length:e.p2r(e.r2p(a)+t):a+(l?-t:t)/u}function x(e,t,i,g,v,x){var b,_,w=e._fullLayout,k=e._fullLayout._size,T=e._context.edits;g?(b="annotation-"+g,_=g+".annotations"):(b="annotation",_="annotations");var S=f(e.layout,_,t),A=S.modifyBase,M=S.modifyItem,E=S.getUpdateObj;w._infolayer.selectAll("."+b+'[data-index="'+i+'"]').remove();var C="clip"+w._uid+"_ann"+i;if(t._input&&!1!==t.visible){var P={x:{},y:{}},L=+t.textangle||0,I=w._infolayer.append("g").classed(b,!0).attr("data-index",String(i)).style("opacity",t.opacity),z=I.append("g").classed("annotation-text-g",!0),O=T[t.showarrow?"annotationTail":"annotationPosition"],R=t.captureevents||T.annotationText||O,D=z.append("g").style("pointer-events",R?"all":null).call(p,"pointer").on("click",(function(){e._dragging=!1,e.emit("plotly_clickannotation",W(r.event))}));t.hovertext&&D.on("mouseover",(function(){var r=t.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=e.getBoundingClientRect();u.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:t.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color,fontWeight:n.weight,fontStyle:n.style,fontVariant:n.variant,fontShadow:n.fontShadow,fontLineposition:n.fontLineposition,fontTextcase:n.fontTextcase},{container:w._hoverlayer.node(),outerContainer:w._paper.node(),gd:e})})).on("mouseout",(function(){u.loneUnhover(w._hoverlayer.node())}));var j=t.borderwidth,F=t.borderpad,B=j+F,N=D.append("rect").attr("class","bg").style("stroke-width",j+"px").call(l.stroke,t.bordercolor).call(l.fill,t.bgcolor),U=t.width||t.height,V=w._topclips.selectAll("#"+C).data(U?[0]:[]);V.enter().append("clipPath").classed("annclip",!0).attr("id",C).append("rect"),V.exit().remove();var q=t.font,H=w._meta?a.templateString(t.text,w._meta):t.text,G=D.append("text").classed("annotation-text",!0).text(H);T.annotationText?G.call(h.makeEditable,{delegate:D,gd:e}).call($).on("edit",(function(r){t.text=r,this.call($),M("text",r),v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0),n.call("_guiRelayout",e,E())})):G.call($)}else r.selectAll("#"+C).remove();function W(e){var r={index:i,annotation:t._input,fullAnnotation:t,event:e};return g&&(r.subplotId=g),r}function $(r){return r.call(c.font,q).attr({"text-anchor":{left:"start",right:"end"}[t.align]||"middle"}),h.convertToTspans(r,e,Z),r}function Z(){var r=G.selectAll("a");1===r.size()&&r.text()===G.text()&&D.insert("a",":first-child").attr({"xlink:xlink:href":r.attr("xlink:href"),"xlink:xlink:show":r.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(N.node());var i=D.select(".annotation-text-math-group"),u=!i.empty(),f=c.bBox((u?i:G).node()),b=f.width,_=f.height,S=t.width||b,R=t.height||_,F=Math.round(S+2*B),q=Math.round(R+2*B);function H(e,t){return"auto"===t&&(t=e<1/3?"left":e>2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[t]}for(var $=!1,Z=["x","y"],X=0;X<Z.length;X++){var Y,K,J,Q,ee,te=Z[X],re=t[te+"ref"]||te,ne=t["a"+te+"ref"],ie={x:v,y:x}[te],ae=(L+("x"===te?0:-90))*Math.PI/180,oe=F*Math.cos(ae),se=q*Math.sin(ae),le=Math.abs(oe)+Math.abs(se),ce=t[te+"anchor"],ue=t[te+"shift"]*("x"===te?1:-1),he=P[te],pe=s.getRefType(re);if(ie&&"domain"!==pe){var de=ie.r2fraction(t[te]);(de<0||de>1)&&(ne===re?((de=ie.r2fraction(t["a"+te]))<0||de>1)&&($=!0):$=!0),Y=ie._offset+ie.r2p(t[te]),Q=.5}else{var fe="domain"===pe;"x"===te?(J=t[te],Y=fe?ie._offset+ie._length*J:Y=k.l+k.w*J):(J=1-t[te],Y=fe?ie._offset+ie._length*J:Y=k.t+k.h*J),Q=t.showarrow?.5:J}if(t.showarrow){he.head=Y;var me=t["a"+te];if(ee=oe*H(.5,t.xanchor)-se*H(.5,t.yanchor),ne===re){var ge=s.getRefType(ne);"domain"===ge?("y"===te&&(me=1-me),he.tail=ie._offset+ie._length*me):"paper"===ge?"y"===te?(me=1-me,he.tail=k.t+k.h*me):he.tail=k.l+k.w*me:he.tail=ie._offset+ie.r2p(me),K=ee}else he.tail=Y+me,K=ee+me;he.text=he.tail+ee;var ye=w["x"===te?"width":"height"];if("paper"===re&&(he.head=a.constrain(he.head,1,ye-1)),"pixel"===ne){var ve=-Math.max(he.tail-3,he.text),xe=Math.min(he.tail+3,he.text)-ye;ve>0?(he.tail+=ve,he.text+=ve):xe>0&&(he.tail-=xe,he.text-=xe)}he.tail+=ue,he.head+=ue}else K=ee=le*H(Q,ce),he.text=Y+ee;he.text+=ue,ee+=ue,K+=ue,t["_"+te+"padplus"]=le/2+K,t["_"+te+"padminus"]=le/2-K,t["_"+te+"size"]=le,t["_"+te+"shift"]=ee}if($)D.remove();else{var be=0,_e=0;if("left"!==t.align&&(be=(S-b)*("center"===t.align?.5:1)),"top"!==t.valign&&(_e=(R-_)*("middle"===t.valign?.5:1)),u)i.select("svg").attr({x:B+be-1,y:B+_e}).call(c.setClipUrl,U?C:null,e);else{var we=B+_e-f.top,ke=B+be-f.left;G.call(h.positionText,ke,we).call(c.setClipUrl,U?C:null,e)}V.select("rect").call(c.setRect,B,B,S,R),N.call(c.setRect,j/2,j/2,F-j,q-j),D.call(c.setTranslate,Math.round(P.x.text-F/2),Math.round(P.y.text-q/2)),z.attr({transform:"rotate("+L+","+P.x.text+","+P.y.text+")"});var Te,Se=function(r,i){I.selectAll(".annotation-arrow-g").remove();var s=P.x.head,u=P.y.head,h=P.x.tail+r,p=P.y.tail+i,f=P.x.text+r,b=P.y.text+i,_=a.rotationXYMatrix(L,f,b),w=a.apply2DTransform(_),S=a.apply2DTransform2(_),C=+N.attr("width"),O=+N.attr("height"),R=f-.5*C,j=R+C,F=b-.5*O,B=F+O,U=[[R,F,R,B],[R,B,j,B],[j,B,j,F],[j,F,R,F]].map(S);if(!U.reduce((function(e,t){return e^!!a.segmentsIntersect(s,u,s+1e6,u+1e6,t[0],t[1],t[2],t[3])}),!1)){U.forEach((function(e){var t=a.segmentsIntersect(h,p,s,u,e[0],e[1],e[2],e[3]);t&&(h=t.x,p=t.y)}));var V=t.arrowwidth,q=t.arrowcolor,H=t.arrowside,G=I.append("g").style({opacity:l.opacity(q)}).classed("annotation-arrow-g",!0),W=G.append("path").attr("d","M"+h+","+p+"L"+s+","+u).style("stroke-width",V+"px").call(l.stroke,l.rgb(q));if(m(W,H,t),T.annotationPosition&&W.node().parentNode&&!g){var $=s,Z=u;if(t.standoff){var X=Math.sqrt(Math.pow(s-h,2)+Math.pow(u-p,2));$+=t.standoff*(h-s)/X,Z+=t.standoff*(p-u)/X}var Y,K,J=G.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).classed("cursor-move",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(h-$)+","+(p-Z),transform:o($,Z)}).style("stroke-width",V+6+"px").call(l.stroke,"rgba(0,0,0,0)").call(l.fill,"rgba(0,0,0,0)");d.init({element:J.node(),gd:e,prepFn:function(){var e=c.getTranslate(D);Y=e.x,K=e.y,v&&v.autorange&&A(v._name+".autorange",!0),x&&x.autorange&&A(x._name+".autorange",!0)},moveFn:function(e,r){var n=w(Y,K),i=n[0]+e,a=n[1]+r;D.call(c.setTranslate,i,a),M("x",y(v,e,"x",k,t)),M("y",y(x,r,"y",k,t)),t.axref===t.xref&&M("ax",y(v,e,"ax",k,t)),t.ayref===t.yref&&M("ay",y(x,r,"ay",k,t)),G.attr("transform",o(e,r)),z.attr({transform:"rotate("+L+","+i+","+a+")"})},doneFn:function(){n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}};t.showarrow&&Se(0,0),O&&d.init({element:D.node(),gd:e,prepFn:function(){Te=z.attr("transform")},moveFn:function(e,r){var n="pointer";if(t.showarrow)t.axref===t.xref?M("ax",y(v,e,"ax",k,t)):M("ax",t.ax+e),t.ayref===t.yref?M("ay",y(x,r,"ay",k.w,t)):M("ay",t.ay+r),Se(e,r);else{if(g)return;var i,a;if(v)i=y(v,e,"x",k,t);else{var s=t._xsize/k.w,l=t.x+(t._xshift-t.xshift)/k.w-s/2;i=d.align(l+e/k.w,s,0,1,t.xanchor)}if(x)a=y(x,r,"y",k,t);else{var c=t._ysize/k.h,u=t.y-(t._yshift+t.yshift)/k.h-c/2;a=d.align(u-r/k.h,c,0,1,t.yanchor)}M("x",i),M("y",a),v&&x||(n=d.getCursor(v?.5:i,x?.5:a,t.xanchor,t.yanchor))}z.attr({transform:o(e,r)+Te}),p(D,n)},clickFn:function(r,n){t.captureevents&&e.emit("plotly_clickannotation",W(n))},doneFn:function(){p(D),n.call("_guiRelayout",e,E());var t=document.querySelector(".js-notes-box-panel");t&&t.redraw(t.selectedObj)}})}}}t.exports={draw:function(e){var t=e._fullLayout;t._infolayer.selectAll(".annotation").remove();for(var r=0;r<t.annotations.length;r++)t.annotations[r].visible&&g(e,r);return i.previousPromises(e)},drawOne:g,drawRaw:x}}}),Pi=p({"src/components/annotations/click.js"(e,t){var r=st(),n=Ve(),i=gt().arrayEditor;function a(e,t){var r,n,i,a,s,l,c,u=e._fullLayout.annotations,h=[],p=[],d=[],f=(t||[]).length;for(r=0;r<u.length;r++)if(a=(i=u[r]).clicktoshow){for(n=0;n<f;n++)if(l=(s=t[n]).xaxis,c=s.yaxis,l._id===i.xref&&c._id===i.yref&&l.d2r(s.x)===o(i._xclick,l)&&c.d2r(s.y)===o(i._yclick,c)){(i.visible?"onout"===a?p:d:h).push(r);break}n===f&&i.visible&&"onout"===a&&p.push(r)}return{on:h,off:p,explicitOff:d}}function o(e,t){return"log"===t.type?t.l2r(e):t.d2r(e)}t.exports={hasClickToShow:function(e,t){var r=a(e,t);return r.on.length>0||r.explicitOff.length>0},onClick:function(e,t){var o,s,l=a(e,t),c=l.on,u=l.off.concat(l.explicitOff),h={},p=e._fullLayout.annotations;if(c.length||u.length){for(o=0;o<c.length;o++)(s=i(e.layout,"annotations",p[c[o]])).modifyItem("visible",!0),r.extendFlat(h,s.getUpdateObj());for(o=0;o<u.length;o++)(s=i(e.layout,"annotations",p[u[o]])).modifyItem("visible",!1),r.extendFlat(h,s.getUpdateObj());return n.call("update",e,{},h)}}}}}),Li=p({"src/components/annotations/common_defaults.js"(e,t){var r=st(),n=q();t.exports=function(e,t,i,a){a("opacity");var o=a("bgcolor"),s=a("bordercolor"),l=n.opacity(s);a("borderpad");var c=a("borderwidth"),u=a("showarrow");if(a("text",u?" ":i._dfltTitle.annotation),a("textangle"),r.coerceFont(a,"font",i.font),a("width"),a("align"),a("height")&&a("valign"),u){var h,p,d=a("arrowside");-1!==d.indexOf("end")&&(h=a("arrowhead"),p=a("arrowsize")),-1!==d.indexOf("start")&&(a("startarrowhead",h),a("startarrowsize",p)),a("arrowcolor",l?t.bordercolor:n.defaultLine),a("arrowwidth",2*(l&&c||1)),a("standoff"),a("startstandoff")}var f=a("hovertext"),m=i.hoverlabel||{};if(f){var g=a("hoverlabel.bgcolor",m.bgcolor||(n.opacity(o)?n.rgb(o):n.defaultLine)),y=a("hoverlabel.bordercolor",m.bordercolor||n.contrast(g)),v=r.extendFlat({},m.font);v.color||(v.color=y),r.coerceFont(a,"hoverlabel.font",v)}a("captureevents",!!f)}}}),Ii=p({"src/components/annotations/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=Li(),o=xn();function s(e,t,i){function s(n,i){return r.coerce(e,t,o,n,i)}var l=s("visible"),c=s("clicktoshow");if(l||c){a(e,t,i,s);for(var u=t.showarrow,h=["x","y"],p=[-10,-30],d={_fullLayout:i},f=0;f<2;f++){var m=h[f],g=n.coerceRef(e,t,d,m,"","paper");if("paper"!==g&&n.getFromId(d,g)._annIndices.push(t._index),n.coercePosition(t,d,s,g,m,.5),u){var y="a"+m,v=n.coerceRef(e,t,d,y,"pixel",["pixel","paper"]);"pixel"!==v&&v!==g&&(v=t[y]="pixel");var x="pixel"===v?p[f]:.4;n.coercePosition(t,d,s,v,y,x)}s(m+"anchor"),s(m+"shift")}if(r.noneOrAll(e,t,["x","y"]),u&&r.noneOrAll(e,t,["ax","ay"]),c){var b=s("xclick"),_=s("yclick");t._xclick=void 0===b?t.x:n.cleanPosition(b,d,t.xref),t._yclick=void 0===_?t.y:n.cleanPosition(_,d,t.yref)}}}t.exports=function(e,t){i(e,t,{name:"annotations",handleItemDefaults:s})}}}),zi=p({"src/components/annotations/calc_autorange.js"(e,t){var r=st(),n=nr(),i=Ci().draw;function a(e){var t=e._fullLayout;r.filterVisible(t.annotations).forEach((function(t){var r=n.getFromId(e,t.xref),i=n.getFromId(e,t.yref),a=n.getRefType(t.xref),s=n.getRefType(t.yref);t._extremes={},"range"===a&&o(t,r),"range"===s&&o(t,i)}))}function o(e,t){var r,i=t._id,a=i.charAt(0),o=e[a],s=e["a"+a],l=e[a+"ref"],c=e["a"+a+"ref"],u=e["_"+a+"padplus"],h=e["_"+a+"padminus"],p={x:1,y:-1}[a]*e[a+"shift"],d=3*e.arrowsize*e.arrowwidth||0,f=d+p,m=d-p,g=3*e.startarrowsize*e.arrowwidth||0,y=g+p,v=g-p;if(c===l){var x=n.findExtremes(t,[t.r2c(o)],{ppadplus:f,ppadminus:m}),b=n.findExtremes(t,[t.r2c(s)],{ppadplus:Math.max(u,y),ppadminus:Math.max(h,v)});r={min:[x.min[0],b.min[0]],max:[x.max[0],b.max[0]]}}else y=s?y+s:y,v=s?v-s:v,r=n.findExtremes(t,[t.r2c(o)],{ppadplus:Math.max(u,f,y),ppadminus:Math.max(h,m,v)});e._extremes[i]=r}t.exports=function(e){var t=e._fullLayout;if(r.filterVisible(t.annotations).length&&e._fullData.length)return r.syncOrAsync([i,a],e)}}}),Oi=p({"src/components/annotations/convert_coords.js"(e,t){var r=k(),n=L();t.exports=function(e,t,i,a){t=t||{};var o="log"===i&&"linear"===t.type,s="linear"===i&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.annotations,h=t._id.charAt(0),p=0;p<u.length;p++)l=u[p],c="annotations["+p+"].",l[h+"ref"]===t._id&&d(h),l["a"+h+"ref"]===t._id&&d("a"+h);function d(e){var i=l[e],s=null;s=o?n(i,t.range):Math.pow(10,i),r(s)||(s=null),a(c+e,s)}}}}),Ri=p({"src/components/annotations/index.js"(e,t){var r=Ci(),n=Pi();t.exports={moduleType:"component",name:"annotations",layoutAttributes:xn(),supplyLayoutDefaults:Ii(),includeBasePlot:An()("annotations"),calcAutorange:zi(),draw:r.draw,drawOne:r.drawOne,drawRaw:r.drawRaw,hasClickToShow:n.hasClickToShow,onClick:n.onClick,convertCoords:Oi()}}}),Di=p({"src/components/annotations3d/attributes.js"(e,t){var r=xn(),n=Le().overrideAll,i=gt().templatedArray;t.exports=n(i("annotation",{visible:r.visible,x:{valType:"any"},y:{valType:"any"},z:{valType:"any"},ax:{valType:"number"},ay:{valType:"number"},xanchor:r.xanchor,xshift:r.xshift,yanchor:r.yanchor,yshift:r.yshift,text:r.text,textangle:r.textangle,font:r.font,width:r.width,height:r.height,opacity:r.opacity,align:r.align,valign:r.valign,bgcolor:r.bgcolor,bordercolor:r.bordercolor,borderpad:r.borderpad,borderwidth:r.borderwidth,showarrow:r.showarrow,arrowcolor:r.arrowcolor,arrowhead:r.arrowhead,startarrowhead:r.startarrowhead,arrowside:r.arrowside,arrowsize:r.arrowsize,startarrowsize:r.startarrowsize,arrowwidth:r.arrowwidth,standoff:r.standoff,startstandoff:r.startstandoff,hovertext:r.hovertext,hoverlabel:r.hoverlabel,captureevents:r.captureevents}),"calc","from-root")}}),ji=p({"src/components/annotations3d/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=Li(),o=Di();function s(e,t,i,s){function l(n,i){return r.coerce(e,t,o,n,i)}function c(e){var r=e+"axis",a={_fullLayout:{}};return a._fullLayout[r]=i[r],n.coercePosition(t,a,l,e,e,.5)}l("visible")&&(a(e,t,s.fullLayout,l),c("x"),c("y"),c("z"),r.noneOrAll(e,t,["x","y","z"]),t.xref="x",t.yref="y",t.zref="z",l("xanchor"),l("yanchor"),l("xshift"),l("yshift"),t.showarrow&&(t.axref="pixel",t.ayref="pixel",l("ax",-10),l("ay",-30),r.noneOrAll(e,t,["ax","ay"])))}t.exports=function(e,t,r){i(e,t,{name:"annotations",handleItemDefaults:s,fullLayout:r.fullLayout})}}}),Fi=p({"src/components/annotations3d/convert.js"(e,t){var r=st(),n=nr();function i(e,t){var i=t.fullSceneLayout.domain,a=t.fullLayout._size,o={pdata:null,type:"linear",autorange:!1,range:[-1/0,1/0]};e._xa={},r.extendFlat(e._xa,o),n.setConvert(e._xa),e._xa._offset=a.l+i.x[0]*a.w,e._xa.l2p=function(){return.5*(1+e._pdata[0]/e._pdata[3])*a.w*(i.x[1]-i.x[0])},e._ya={},r.extendFlat(e._ya,o),n.setConvert(e._ya),e._ya._offset=a.t+(1-i.y[1])*a.h,e._ya.l2p=function(){return.5*(1-e._pdata[1]/e._pdata[3])*a.h*(i.y[1]-i.y[0])}}t.exports=function(e){for(var t=e.fullSceneLayout.annotations,r=0;r<t.length;r++)i(t[r],e);e.fullLayout._infolayer.selectAll(".annotation-"+e.id).remove()}}}),Bi=p({"src/plots/gl3d/project.js"(e,t){function r(e,t){var r,n,i=[0,0,0,0];for(r=0;r<4;++r)for(n=0;n<4;++n)i[n]+=e[4*r+n]*t[r];return i}t.exports=function(e,t){return r(e.projection,r(e.view,r(e.model,[t[0],t[1],t[2],1])))}}}),Ni=p({"src/components/annotations3d/draw.js"(e,t){var r=Ci().drawRaw,n=Bi(),i=["x","y","z"];t.exports=function(e){for(var t=e.fullSceneLayout,a=e.dataScale,o=t.annotations,s=0;s<o.length;s++){for(var l=o[s],c=!1,u=0;u<3;u++){var h=i[u],p=l[h],d=t[h+"axis"].r2fraction(p);if(d<0||d>1){c=!0;break}}c?e.fullLayout._infolayer.select(".annotation-"+e.id+'[data-index="'+s+'"]').remove():(l._pdata=n(e.glplot.cameraParams,[t.xaxis.r2l(l.x)*a[0],t.yaxis.r2l(l.y)*a[1],t.zaxis.r2l(l.z)*a[2]]),r(e.graphDiv,l,s,e.id,l._xa,l._ya))}}}}),Ui=p({"src/components/annotations3d/index.js"(e,t){var r=Ve(),n=st();t.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:Di()}}},layoutAttributes:Di(),handleDefaults:ji(),includeBasePlot:function(e,t){var i=r.subplotsRegistry.gl3d;if(i)for(var a=i.attrRegex,o=Object.keys(e),s=0;s<o.length;s++){var l=o[s];a.test(l)&&(e[l].annotations||[]).length&&(n.pushUnique(t._basePlotModules,i),n.pushUnique(t._subplots.gl3d,l))}},convert:Fi(),draw:Ni()}}}),Vi=p({"src/components/shapes/attributes.js"(e,t){var r=xn(),n=D(),i=wn().line,a=Ie().dash,o=R().extendFlat,s=gt().templatedArray,l=(vn(),N()),c=Oe().shapeTexttemplateAttrs,u=Re();t.exports=s("shape",{visible:o({},l.visible,{editType:"calc+arraydraw"}),showlegend:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},legend:o({},l.legend,{editType:"calc+arraydraw"}),legendgroup:o({},l.legendgroup,{editType:"calc+arraydraw"}),legendgrouptitle:{text:o({},l.legendgrouptitle.text,{editType:"calc+arraydraw"}),font:n({editType:"calc+arraydraw"}),editType:"calc+arraydraw"},legendrank:o({},l.legendrank,{editType:"calc+arraydraw"}),legendwidth:o({},l.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:o({},r.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:o({},r.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:o({},i.color,{editType:"arraydraw"}),width:o({},i.width,{editType:"calc+arraydraw"}),dash:o({},a,{editType:"arraydraw"}),editType:"calc+arraydraw"},fillcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"arraydraw"},fillrule:{valType:"enumerated",values:["evenodd","nonzero"],dflt:"evenodd",editType:"arraydraw"},editable:{valType:"boolean",dflt:!1,editType:"calc+arraydraw"},label:{text:{valType:"string",dflt:"",editType:"arraydraw"},texttemplate:c({},{keys:Object.keys(u)}),font:n({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"})}}),qi=p({"src/components/shapes/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=Vi(),o=qr();function s(e,t,i){function s(n,i){return r.coerce(e,t,a,n,i)}if(t._isShape=!0,s("visible")){s("showlegend")&&(s("legend"),s("legendwidth"),s("legendgroup"),s("legendgrouptitle.text"),r.coerceFont(s,"legendgrouptitle.font"),s("legendrank"));var l=s("path"),c=s("type",l?"path":"rect"),u="path"!==c;u&&delete t.path,s("editable"),s("layer"),s("opacity"),s("fillcolor"),s("fillrule"),s("line.width")&&(s("line.color"),s("line.dash"));for(var h=s("xsizemode"),p=s("ysizemode"),d=["x","y"],f=0;f<2;f++){var m,g,y,v=d[f],x=v+"anchor",b="x"===v?h:p,_={_fullLayout:i},w=n.coerceRef(e,t,_,v,void 0,"paper");if("range"===n.getRefType(w)?((m=n.getFromId(_,w))._shapeIndices.push(t._index),y=o.rangeToShapePosition(m),g=o.shapePositionToRange(m),"category"!==m.type&&"multicategory"!==m.type||(s(v+"0shift"),s(v+"1shift"))):g=y=r.identity,u){var k=v+"0",T=v+"1",S=e[k],A=e[T];e[k]=g(e[k],!0),e[T]=g(e[T],!0),"pixel"===b?(s(k,0),s(T,10)):(n.coercePosition(t,_,s,w,k,.25),n.coercePosition(t,_,s,w,T,.75)),t[k]=y(t[k]),t[T]=y(t[T]),e[k]=S,e[T]=A}if("pixel"===b){var M=e[x];e[x]=g(e[x],!0),n.coercePosition(t,_,s,w,x,.25),t[x]=y(t[x]),e[x]=M}}u&&r.noneOrAll(e,t,["x0","x1","y0","y1"]);var E,C,P="line"===c;if(u&&(E=s("label.texttemplate")),E||(C=s("label.text")),C||E){s("label.textangle");var L=s("label.textposition",P?"middle":"middle center");s("label.xanchor"),s("label.yanchor",function(e,t){return e?"bottom":-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle"}(P,L)),s("label.padding"),r.coerceFont(s,"label.font",i.font)}}}t.exports=function(e,t){i(e,t,{name:"shapes",handleItemDefaults:s})}}}),Hi=p({"src/components/shapes/draw_newshape/defaults.js"(e,t){var r=q(),n=st();t.exports=function(e,t,i){if(i("newshape.visible"),i("newshape.name"),i("newshape.showlegend"),i("newshape.legend"),i("newshape.legendwidth"),i("newshape.legendgroup"),i("newshape.legendgrouptitle.text"),n.coerceFont(i,"newshape.legendgrouptitle.font"),i("newshape.legendrank"),i("newshape.drawdirection"),i("newshape.layer"),i("newshape.fillcolor"),i("newshape.fillrule"),i("newshape.opacity"),i("newshape.line.width")){var a=(e||{}).plot_bgcolor||"#FFF";i("newshape.line.color",r.contrast(a)),i("newshape.line.dash")}var o="drawline"===e.dragmode,s=i("newshape.label.text"),l=i("newshape.label.texttemplate");if(s||l){i("newshape.label.textangle");var c=i("newshape.label.textposition",o?"middle":"middle center");i("newshape.label.xanchor"),i("newshape.label.yanchor",function(e,t){return e?"bottom":-1!==t.indexOf("top")?"top":-1!==t.indexOf("bottom")?"bottom":"middle"}(o,c)),i("newshape.label.padding"),n.coerceFont(i,"newshape.label.font",t.font)}i("activeshape.fillcolor"),i("activeshape.opacity")}}}),Gi=p({"src/components/shapes/calc_autorange.js"(e,t){var r=st(),n=nr(),i=Vr(),a=qr();function o(e){return l(e.line.width,e.xsizemode,e.x0,e.x1,e.path,!1)}function s(e){return l(e.line.width,e.ysizemode,e.y0,e.y1,e.path,!0)}function l(e,t,n,o,s,l){var c=e/2,u=l;if("pixel"===t){var h=s?a.extractPathCoords(s,l?i.paramIsY:i.paramIsX):[n,o],p=r.aggNums(Math.max,null,h),d=r.aggNums(Math.min,null,h),f=d<0?Math.abs(d)+c:c,m=p>0?p+c:c;return{ppad:c,ppadplus:u?f:m,ppadminus:u?m:f}}return{ppad:c}}function c(e,t,r){var n,o,s="x"===e._id.charAt(0)?"x":"y",l="category"===e.type||"multicategory"===e.type,c=0,u=0,h=l?e.r2c:e.d2c;if("scaled"===t[s+"sizemode"]?(n=t[s+"0"],o=t[s+"1"],l&&(c=t[s+"0shift"],u=t[s+"1shift"])):(n=t[s+"anchor"],o=t[s+"anchor"]),void 0!==n)return[h(n)+c,h(o)+u];if(t.path){var p,d,f,m,g=1/0,y=-1/0,v=t.path.match(i.segmentRE);for("date"===e.type&&(h=a.decodeDate(h)),p=0;p<v.length;p++)void 0!==(d=r[v[p].charAt(0)].drawn)&&(!(f=v[p].substr(1).match(i.paramRE))||f.length<d||((m=h(f[d]))<g&&(g=m),m>y&&(y=m)));return y>=g?[g,y]:void 0}}t.exports=function(e){var t=e._fullLayout,a=r.filterVisible(t.shapes);if(a.length&&e._fullData.length)for(var l=0;l<a.length;l++){var u,h,p=a[l];p._extremes={};var d=n.getRefType(p.xref),f=n.getRefType(p.yref);"paper"!==p.xref&&"domain"!==d&&(h=c(u=n.getFromId(e,p.xref),p,i.paramIsX))&&(p._extremes[u._id]=n.findExtremes(u,h,o(p))),"paper"!==p.yref&&"domain"!==f&&(h=c(u=n.getFromId(e,p.yref),p,i.paramIsY))&&(p._extremes[u._id]=n.findExtremes(u,h,s(p)))}}}}),Wi=p({"src/components/shapes/index.js"(e,t){var r=Wr();t.exports={moduleType:"component",name:"shapes",layoutAttributes:Vi(),supplyLayoutDefaults:qi(),supplyDrawNewShapeDefaults:Hi(),includeBasePlot:An()("shapes"),calcAutorange:Gi(),draw:r.draw,drawOne:r.drawOne}}}),$i=p({"src/components/images/attributes.js"(e,t){var r=yt(),n=gt().templatedArray;vn(),t.exports=n("image",{visible:{valType:"boolean",dflt:!0,editType:"arraydraw"},source:{valType:"string",editType:"arraydraw"},layer:{valType:"enumerated",values:["below","above"],dflt:"above",editType:"arraydraw"},sizex:{valType:"number",dflt:0,editType:"arraydraw"},sizey:{valType:"number",dflt:0,editType:"arraydraw"},sizing:{valType:"enumerated",values:["fill","contain","stretch"],dflt:"contain",editType:"arraydraw"},opacity:{valType:"number",min:0,max:1,dflt:1,editType:"arraydraw"},x:{valType:"any",dflt:0,editType:"arraydraw"},y:{valType:"any",dflt:0,editType:"arraydraw"},xanchor:{valType:"enumerated",values:["left","center","right"],dflt:"left",editType:"arraydraw"},yanchor:{valType:"enumerated",values:["top","middle","bottom"],dflt:"top",editType:"arraydraw"},xref:{valType:"enumerated",values:["paper",r.idRegex.x.toString()],dflt:"paper",editType:"arraydraw"},yref:{valType:"enumerated",values:["paper",r.idRegex.y.toString()],dflt:"paper",editType:"arraydraw"},editType:"arraydraw"})}}),Zi=p({"src/components/images/defaults.js"(e,t){var r=st(),n=nr(),i=Ft(),a=$i();function o(e,t,i){function o(n,i){return r.coerce(e,t,a,n,i)}var s=o("source");if(!o("visible",!!s))return t;o("layer"),o("xanchor"),o("yanchor"),o("sizex"),o("sizey"),o("sizing"),o("opacity");for(var l={_fullLayout:i},c=["x","y"],u=0;u<2;u++){var h=c[u],p=n.coerceRef(e,t,l,h,"paper",void 0);"paper"!==p&&n.getFromId(l,p)._imgIndices.push(t._index),n.coercePosition(t,l,o,p,h,0)}return t}t.exports=function(e,t){i(e,t,{name:"images",handleItemDefaults:o})}}}),Xi=p({"src/components/images/draw.js"(e,t){var r=v(),n=Jt(),i=nr(),a=vt(),o=Tt();t.exports=function(e){var t,s,l=e._fullLayout,c=[],u={},h=[];for(s=0;s<l.images.length;s++){var p=l.images[s];if(p.visible)if("below"===p.layer&&"paper"!==p.xref&&"paper"!==p.yref){t=a.ref2id(p.xref)+a.ref2id(p.yref);var d=l._plots[t];if(!d){h.push(p);continue}d.mainplot&&(t=d.mainplot.id),u[t]||(u[t]=[]),u[t].push(p)}else"above"===p.layer?c.push(p):h.push(p)}var f={left:{sizing:"xMin",offset:0},center:{sizing:"xMid",offset:-.5},right:{sizing:"xMax",offset:-1}},m={top:{sizing:"YMin",offset:0},middle:{sizing:"YMid",offset:-.5},bottom:{sizing:"YMax",offset:-1}};function g(t){var n=r.select(this);if(this._imgSrc!==t.source)if(n.attr("xmlns",o.svg),!e._context.staticPlot||t.source&&"data:"===t.source.slice(0,5))n.attr("xlink:href",t.source),this._imgSrc=t.source;else{var i=new Promise(function(e){var r=new Image;function i(){n.remove(),e()}this.img=r,r.setAttribute("crossOrigin","anonymous"),r.onerror=i,r.onload=function(){var t=document.createElement("canvas");t.width=this.width,t.height=this.height,t.getContext("2d",{willReadFrequently:!0}).drawImage(this,0,0);var r=t.toDataURL("image/png");n.attr("xlink:href",r),e()},n.on("error",i),r.src=t.source,this._imgSrc=t.source}.bind(this));e._promises.push(i)}}function y(t){var a,o,s=r.select(this),c=i.getFromId(e,t.xref),u=i.getFromId(e,t.yref),h="domain"===i.getRefType(t.xref),p="domain"===i.getRefType(t.yref),d=l._size;a=void 0!==c?"string"===typeof t.xref&&h?c._length*t.sizex:Math.abs(c.l2p(t.sizex)-c.l2p(0)):t.sizex*d.w,o=void 0!==u?"string"===typeof t.yref&&p?u._length*t.sizey:Math.abs(u.l2p(t.sizey)-u.l2p(0)):t.sizey*d.h;var g,y,v=a*f[t.xanchor].offset,x=o*m[t.yanchor].offset,b=f[t.xanchor].sizing+m[t.yanchor].sizing;switch(g=void 0!==c?"string"===typeof t.xref&&h?c._length*t.x+c._offset:c.r2p(t.x)+c._offset:t.x*d.w+d.l,g+=v,y=void 0!==u?"string"===typeof t.yref&&p?u._length*(1-t.y)+u._offset:u.r2p(t.y)+u._offset:d.h-t.y*d.h+d.t,y+=x,t.sizing){case"fill":b+=" slice";break;case"stretch":b="none"}s.attr({x:g,y:y,width:a,height:o,preserveAspectRatio:b,opacity:t.opacity});var _=(c&&"domain"!==i.getRefType(t.xref)?c._id:"")+(u&&"domain"!==i.getRefType(t.yref)?u._id:"");n.setClipUrl(s,_?"clip"+l._uid+_:null,e)}function v(e){return[e.xref,e.x,e.sizex,e.yref,e.y,e.sizey].join("_")}function x(e,t){return e._index-t._index}var b=l._imageLowerLayer.selectAll("image").data(h,v),_=l._imageUpperLayer.selectAll("image").data(c,v);b.enter().append("image"),_.enter().append("image"),b.exit().remove(),_.exit().remove(),b.each((function(e){g.bind(this)(e),y.bind(this)(e)})),_.each((function(e){g.bind(this)(e),y.bind(this)(e)})),b.sort(x),_.sort(x);var w=Object.keys(l._plots);for(s=0;s<w.length;s++){t=w[s];var k=l._plots[t];if(k.imagelayer){var T=k.imagelayer.selectAll("image").data(u[t]||[],v);T.enter().append("image"),T.exit().remove(),T.each((function(e){g.bind(this)(e),y.bind(this)(e)})),T.sort(x)}}}}}),Yi=p({"src/components/images/convert_coords.js"(e,t){var r=k(),n=L();t.exports=function(e,t,i,a){t=t||{};var o="log"===i&&"linear"===t.type,s="linear"===i&&"log"===t.type;if(o||s)for(var l,c,u=e._fullLayout.images,h=t._id.charAt(0),p=0;p<u.length;p++)if(c="images["+p+"].",(l=u[p])[h+"ref"]===t._id){var d=l[h],f=l["size"+h],m=null,g=null;if(o){m=n(d,t.range);var y=f/Math.pow(10,m)/2;g=2*Math.log(y+Math.sqrt(1+y*y))/Math.LN10}else g=(m=Math.pow(10,d))*(Math.pow(10,f/2)-Math.pow(10,-f/2));r(m)?r(g)||(g=null):(m=null,g=null),a(c+h,m),a(c+"size"+h,g)}}}}),Ki=p({"src/components/images/index.js"(e,t){t.exports={moduleType:"component",name:"images",layoutAttributes:$i(),supplyLayoutDefaults:Zi(),includeBasePlot:An()("images"),draw:Xi(),convertCoords:Yi()}}}),Ji=p({"src/components/updatemenus/constants.js"(e,t){t.exports={name:"updatemenus",containerClassName:"updatemenu-container",headerGroupClassName:"updatemenu-header-group",headerClassName:"updatemenu-header",headerArrowClassName:"updatemenu-header-arrow",dropdownButtonGroupClassName:"updatemenu-dropdown-button-group",dropdownButtonClassName:"updatemenu-dropdown-button",buttonClassName:"updatemenu-button",itemRectClassName:"updatemenu-item-rect",itemTextClassName:"updatemenu-item-text",menuIndexAttrName:"updatemenu-active-index",autoMarginIdRoot:"updatemenu-",blankHeaderOpts:{label:" "},minWidth:30,minHeight:30,textPadX:24,arrowPadX:16,rx:2,ry:2,textOffsetX:12,textOffsetY:3,arrowOffsetX:4,gapButtonHeader:5,gapButton:2,activeColor:"#F4FAFF",hoverColor:"#F4FAFF",arrowSymbol:{left:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}}}),Qi=p({"src/components/updatemenus/attributes.js"(e,t){var r=D(),n=V(),i=R().extendFlat,a=Le().overrideAll,o=Fe(),s=gt().templatedArray,l=s("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}});t.exports=a(s("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:l,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:i(o({editType:"arraydraw"}),{}),font:r({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:n.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}}),"arraydraw","from-root")}}),ea=p({"src/components/updatemenus/defaults.js"(e,t){var r=st(),n=Ft(),i=Qi(),a=Ji().name,o=i.buttons;function s(e,t,a){function o(n,a){return r.coerce(e,t,i,n,a)}o("visible",n(e,t,{name:"buttons",handleItemDefaults:l}).length>0)&&(o("active"),o("direction"),o("type"),o("showactive"),o("x"),o("y"),r.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("bgcolor",a.paper_bgcolor),o("bordercolor"),o("borderwidth"))}function l(e,t){function n(n,i){return r.coerce(e,t,o,n,i)}n("visible","skip"===e.method||Array.isArray(e.args))&&(n("method"),n("args"),n("args2"),n("label"),n("execute"))}t.exports=function(e,t){n(e,t,{name:a,handleItemDefaults:s})}}}),ta=p({"src/components/updatemenus/scrollbox.js"(e,t){t.exports=o;var r=v(),n=q(),i=Jt(),a=st();function o(e,t,r){this.gd=e,this.container=t,this.id=r,this.position=null,this.translateX=null,this.translateY=null,this.hbar=null,this.vbar=null,this.bg=this.container.selectAll("rect.scrollbox-bg").data([0]),this.bg.exit().on(".drag",null).on("wheel",null).remove(),this.bg.enter().append("rect").classed("scrollbox-bg",!0).style("pointer-events","all").attr({opacity:0,x:0,y:0,width:0,height:0})}o.barWidth=2,o.barLength=20,o.barRadius=2,o.barPad=1,o.barColor="#808BA4",o.prototype.enable=function(e,t,a){var s=this.gd._fullLayout,l=s.width,c=s.height;this.position=e;var u,h,p,d,f=this.position.l,m=this.position.w,g=this.position.t,y=this.position.h,v=this.position.direction,x="down"===v,b="left"===v,_="up"===v,w=m,k=y;x||b||"right"===v||_||(this.position.direction="down",x=!0),x||_?(h=(u=f)+w,x?(p=g,k=(d=Math.min(p+k,c))-p):k=(d=g+k)-(p=Math.max(d-k,0))):(d=(p=g)+k,b?w=(h=f+w)-(u=Math.max(h-w,0)):(u=f,w=(h=Math.min(u+w,l))-u)),this._box={l:u,t:p,w:w,h:k};var T=m>w,S=o.barLength+2*o.barPad,A=o.barWidth+2*o.barPad,M=f,E=g+y;E+A>c&&(E=c-A);var C=this.container.selectAll("rect.scrollbar-horizontal").data(T?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(n.fill,o.barColor),T?(this.hbar=C.attr({rx:o.barRadius,ry:o.barRadius,x:M,y:E,width:S,height:A}),this._hbarXMin=M+S/2,this._hbarTranslateMax=w-S):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var P=y>k,L=o.barWidth+2*o.barPad,I=o.barLength+2*o.barPad,z=f+m,O=g;z+L>l&&(z=l-L);var R=this.container.selectAll("rect.scrollbar-vertical").data(P?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(n.fill,o.barColor),P?(this.vbar=R.attr({rx:o.barRadius,ry:o.barRadius,x:z,y:O,width:L,height:I}),this._vbarYMin=O+I/2,this._vbarTranslateMax=k-I):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var D=this.id,j=u-.5,F=P?h+L+.5:h+.5,B=p-.5,N=T?d+A+.5:d+.5,U=s._topdefs.selectAll("#"+D).data(T||P?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",D).append("rect"),T||P?(this._clipRect=U.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(F)-Math.floor(j),height:Math.ceil(N)-Math.floor(B)}),this.container.call(i.setClipUrl,D,this.gd),this.bg.attr({x:f,y:g,width:m,height:y})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),T||P){var V=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault()})).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=r.behavior.drag().on("dragstart",(function(){r.event.sourceEvent.preventDefault(),r.event.sourceEvent.stopPropagation()})).on("drag",this._onBarDrag.bind(this));T&&this.hbar.on(".drag",null).call(q),P&&this.vbar.on(".drag",null).call(q)}this.setTranslate(t,a)},o.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(i.setClipUrl,null),delete this._clipRect),this.hbar&&(this.hbar.on(".drag",null),this.hbar.remove(),delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax),this.vbar&&(this.vbar.on(".drag",null),this.vbar.remove(),delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax)},o.prototype._onBoxDrag=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e-=r.event.dx),this.vbar&&(t-=r.event.dy),this.setTranslate(e,t)},o.prototype._onBoxWheel=function(){var e=this.translateX,t=this.translateY;this.hbar&&(e+=r.event.deltaY),this.vbar&&(t+=r.event.deltaY),this.setTranslate(e,t)},o.prototype._onBarDrag=function(){var e=this.translateX,t=this.translateY;if(this.hbar){var n=e+this._hbarXMin,i=n+this._hbarTranslateMax;e=(a.constrain(r.event.x,n,i)-n)/(i-n)*(this.position.w-this._box.w)}if(this.vbar){var o=t+this._vbarYMin,s=o+this._vbarTranslateMax;t=(a.constrain(r.event.y,o,s)-o)/(s-o)*(this.position.h-this._box.h)}this.setTranslate(e,t)},o.prototype.setTranslate=function(e,t){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(e=a.constrain(e||0,0,r),t=a.constrain(t||0,0,n),this.translateX=e,this.translateY=t,this.container.call(i.setTranslate,this._box.l-this.position.l-e,this._box.t-this.position.t-t),this._clipRect&&this._clipRect.attr({x:Math.floor(this.position.l+e-.5),y:Math.floor(this.position.t+t-.5)}),this.hbar){var o=e/r;this.hbar.call(i.setTranslate,e+o*this._hbarTranslateMax,t)}if(this.vbar){var s=t/n;this.vbar.call(i.setTranslate,e,t+s*this._vbarTranslateMax)}}}}),ra=p({"src/components/updatemenus/draw.js"(e,t){var r=v(),n=kt(),i=q(),a=Jt(),o=st(),s=At(),l=gt().arrayEditor,c=St().LINE_SPACING,u=Ji(),h=ta();function p(e){return e._index}function d(e,t){return+e.attr(u.menuIndexAttrName)===t._index}function f(e,t,r,n,i,a,o,s){t.active=o,l(e.layout,u.name,t).applyUpdate("active",o),"buttons"===t.type?g(e,n,null,null,t):"dropdown"===t.type&&(i.attr(u.menuIndexAttrName,"-1"),m(e,n,i,a,t),s||g(e,n,i,a,t))}function m(e,t,r,n,i){var s=o.ensureSingle(t,"g",u.headerClassName,(function(e){e.style("pointer-events","all")})),l=i._dims,c=i.active,h=i.buttons[c]||u.blankHeaderOpts,p={y:i.pad.t,yPad:0,x:i.pad.l,xPad:0,index:0},f={width:l.headerWidth,height:l.headerHeight};s.call(y,i,h,e).call(A,i,p,f),o.ensureSingle(t,"text",u.headerArrowClassName,(function(e){e.attr("text-anchor","end").call(a.font,i.font).text(u.arrowSymbol[i.direction])})).attr({x:l.headerWidth-u.arrowOffsetX+i.pad.l,y:l.headerHeight/2+u.textOffsetY+i.pad.t}),s.on("click",(function(){r.call(M,String(d(r,i)?-1:i._index)),g(e,t,r,n,i)})),s.on("mouseover",(function(){s.call(w)})),s.on("mouseout",(function(){s.call(k,i)})),a.setTranslate(t,l.lx,l.ly)}function g(e,t,i,a,s){i||(i=t).attr("pointer-events","all");var l=function(e){return-1===+e.attr(u.menuIndexAttrName)}(i)&&"buttons"!==s.type?[]:s.buttons,c="dropdown"===s.type?u.dropdownButtonClassName:u.buttonClassName,h=i.selectAll("g."+c).data(o.filterVisible(l)),p=h.enter().append("g").classed(c,!0),d=h.exit();"dropdown"===s.type?(p.attr("opacity","0").transition().attr("opacity","1"),d.transition().attr("opacity","0").remove()):d.remove();var m=0,g=0,v=s._dims,x=-1!==["up","down"].indexOf(s.direction);"dropdown"===s.type&&(x?g=v.headerHeight+u.gapButtonHeader:m=v.headerWidth+u.gapButtonHeader),"dropdown"===s.type&&"up"===s.direction&&(g=-u.gapButtonHeader+u.gapButton-v.openHeight),"dropdown"===s.type&&"left"===s.direction&&(m=-u.gapButtonHeader+u.gapButton-v.openWidth);var b={x:v.lx+m+s.pad.l,y:v.ly+g+s.pad.t,yPad:u.gapButton,xPad:u.gapButton,index:0},T={l:b.x+s.borderwidth,t:b.y+s.borderwidth};h.each((function(o,l){var c=r.select(this);c.call(y,s,o,e).call(A,s,b),c.on("click",(function(){r.event.defaultPrevented||(o.execute&&(o.args2&&s.active===l?(f(e,s,0,t,i,a,-1),n.executeAPICommand(e,o.method,o.args2)):(f(e,s,0,t,i,a,l),n.executeAPICommand(e,o.method,o.args))),e.emit("plotly_buttonclicked",{menu:s,button:o,active:s.active}))})),c.on("mouseover",(function(){c.call(w)})),c.on("mouseout",(function(){c.call(k,s),h.call(_,s)}))})),h.call(_,s),x?(T.w=Math.max(v.openWidth,v.headerWidth),T.h=b.y-T.t):(T.w=b.x-T.l,T.h=Math.max(v.openHeight,v.headerHeight)),T.direction=s.direction,a&&(h.size()?function(e,t,r,n,i,a){var o,s,l,c=i.direction,h="up"===c||"down"===c,p=i._dims,d=i.active;if(h)for(s=0,l=0;l<d;l++)s+=p.heights[l]+u.gapButton;else for(o=0,l=0;l<d;l++)o+=p.widths[l]+u.gapButton;n.enable(a,o,s),n.hbar&&n.hbar.attr("opacity","0").transition().attr("opacity","1"),n.vbar&&n.vbar.attr("opacity","0").transition().attr("opacity","1")}(0,0,0,a,s,T):function(e){var t=!!e.hbar,r=!!e.vbar;t&&e.hbar.transition().attr("opacity","0").each("end",(function(){t=!1,r||e.disable()})),r&&e.vbar.transition().attr("opacity","0").each("end",(function(){r=!1,t||e.disable()}))}(a))}function y(e,t,r,n){e.call(x,t).call(b,t,r,n)}function x(e,t){o.ensureSingle(e,"rect",u.itemRectClassName,(function(e){e.attr({rx:u.rx,ry:u.ry,"shape-rendering":"crispEdges"})})).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px")}function b(e,t,r,n){var i=o.ensureSingle(e,"text",u.itemTextClassName,(function(e){e.attr({"text-anchor":"start","data-notex":1})})),l=r.label,c=n._fullLayout._meta;c&&(l=o.templateString(l,c)),i.call(a.font,t.font).text(l).call(s.convertToTspans,n)}function _(e,t){var n=t.active;e.each((function(e,a){var o=r.select(this);a===n&&t.showactive&&o.select("rect."+u.itemRectClassName).call(i.fill,u.activeColor)}))}function w(e){e.select("rect."+u.itemRectClassName).call(i.fill,u.hoverColor)}function k(e,t){e.select("rect."+u.itemRectClassName).call(i.fill,t.bgcolor)}function T(e,t){var i=t._dims={width1:0,height1:0,heights:[],widths:[],totalWidth:0,totalHeight:0,openWidth:0,openHeight:0,lx:0,ly:0},l=a.tester.selectAll("g."+u.dropdownButtonClassName).data(o.filterVisible(t.buttons));l.enter().append("g").classed(u.dropdownButtonClassName,!0);var h=-1!==["up","down"].indexOf(t.direction);l.each((function(n,o){var l=r.select(this);l.call(y,t,n,e);var p=l.select("."+u.itemTextClassName),d=p.node()&&a.bBox(p.node()).width,f=Math.max(d+u.textPadX,u.minWidth),m=t.font.size*c,g=s.lineCount(p),v=Math.max(m*g,u.minHeight)+u.textOffsetY;v=Math.ceil(v),f=Math.ceil(f),i.widths[o]=f,i.heights[o]=v,i.height1=Math.max(i.height1,v),i.width1=Math.max(i.width1,f),h?(i.totalWidth=Math.max(i.totalWidth,f),i.openWidth=i.totalWidth,i.totalHeight+=v+u.gapButton,i.openHeight+=v+u.gapButton):(i.totalWidth+=f+u.gapButton,i.openWidth+=f+u.gapButton,i.totalHeight=Math.max(i.totalHeight,v),i.openHeight=i.totalHeight)})),h?i.totalHeight-=u.gapButton:i.totalWidth-=u.gapButton,i.headerWidth=i.width1+u.arrowPadX,i.headerHeight=i.height1,"dropdown"===t.type&&(h?(i.width1+=u.arrowPadX,i.totalHeight=i.height1):i.totalWidth=i.width1,i.totalWidth+=u.arrowPadX),l.remove();var p=i.totalWidth+t.pad.l+t.pad.r,d=i.totalHeight+t.pad.t+t.pad.b,f=e._fullLayout._size;i.lx=f.l+f.w*t.x,i.ly=f.t+f.h*(1-t.y);var m="left";o.isRightAnchor(t)&&(i.lx-=p,m="right"),o.isCenterAnchor(t)&&(i.lx-=p/2,m="center");var g="top";o.isBottomAnchor(t)&&(i.ly-=d,g="bottom"),o.isMiddleAnchor(t)&&(i.ly-=d/2,g="middle"),i.totalWidth=Math.ceil(i.totalWidth),i.totalHeight=Math.ceil(i.totalHeight),i.lx=Math.round(i.lx),i.ly=Math.round(i.ly),n.autoMargin(e,S(t),{x:t.x,y:t.y,l:p*({right:1,center:.5}[m]||0),r:p*({left:1,center:.5}[m]||0),b:d*({top:1,middle:.5}[g]||0),t:d*({bottom:1,middle:.5}[g]||0)})}function S(e){return u.autoMarginIdRoot+e._index}function A(e,t,r,n){n=n||{};var i=e.select("."+u.itemRectClassName),o=e.select("."+u.itemTextClassName),l=t.borderwidth,h=r.index,p=t._dims;a.setTranslate(e,l+r.x,l+r.y);var d=-1!==["up","down"].indexOf(t.direction),f=n.height||(d?p.heights[h]:p.height1);i.attr({x:0,y:0,width:n.width||(d?p.width1:p.widths[h]),height:f});var m=t.font.size*c,g=(s.lineCount(o)-1)*m/2;s.positionText(o,u.textOffsetX,f/2-g+u.textOffsetY),d?r.y+=p.heights[h]+r.yPad:r.x+=p.widths[h]+r.xPad,r.index++}function M(e,t){e.attr(u.menuIndexAttrName,t||"-1").selectAll("g."+u.dropdownButtonClassName).remove()}t.exports=function(e){var t=e._fullLayout,i=o.filterVisible(t[u.name]);function a(t){n.autoMargin(e,S(t))}var s=t._menulayer.selectAll("g."+u.containerClassName).data(i.length>0?[0]:[]);if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor","pointer"),s.exit().each((function(){r.select(this).selectAll("g."+u.headerGroupClassName).each(a)})).remove(),0!==i.length){var l=s.selectAll("g."+u.headerGroupClassName).data(i,p);l.enter().append("g").classed(u.headerGroupClassName,!0);for(var c=o.ensureSingle(s,"g",u.dropdownButtonGroupClassName,(function(e){e.style("pointer-events","all")})),y=0;y<i.length;y++){var v=i[y];T(e,v)}var x="updatemenus"+t._uid,b=new h(e,c,x);l.enter().size()&&(c.node().parentNode.appendChild(c.node()),c.call(M)),l.exit().each((function(e){c.call(M),a(e)})).remove(),l.each((function(t){var i=r.select(this),a="dropdown"===t.type?c:null;n.manageCommandObserver(e,t,t.buttons,(function(r){f(e,t,t.buttons[r.index],i,a,b,r.index,!0)})),"dropdown"===t.type?(m(e,i,c,b,t),d(c,t)&&g(e,i,c,b,t)):g(e,i,null,null,t)}))}}}}),na=p({"src/components/updatemenus/index.js"(e,t){var r=Ji();t.exports={moduleType:"component",name:r.name,layoutAttributes:Qi(),supplyLayoutDefaults:ea(),draw:ra()}}}),ia=p({"src/components/sliders/constants.js"(e,t){t.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}}}),aa=p({"src/components/sliders/attributes.js"(e,t){var r=D(),n=Fe(),i=R().extendDeepAll,a=Le().overrideAll,o=Pe(),s=gt().templatedArray,l=ia(),c=s("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}});t.exports=a(s("slider",{visible:{valType:"boolean",dflt:!0},active:{valType:"number",min:0,dflt:0},steps:c,lenmode:{valType:"enumerated",values:["fraction","pixels"],dflt:"fraction"},len:{valType:"number",min:0,dflt:1},x:{valType:"number",min:-2,max:3,dflt:0},pad:i(n({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:o.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:r({})},font:r({}),activebgcolor:{valType:"color",dflt:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}}),"arraydraw","from-root")}}),oa=p({"src/components/sliders/defaults.js"(e,t){var r=st(),n=Ft(),i=aa(),a=ia().name,o=i.steps;function s(e,t,a){function o(n,a){return r.coerce(e,t,i,n,a)}for(var s=n(e,t,{name:"steps",handleItemDefaults:l}),c=0,u=0;u<s.length;u++)s[u].visible&&c++;if(c<2?t.visible=!1:o("visible")){t._stepCount=c;var h=t._visibleSteps=r.filterVisible(s);(s[o("active")]||{}).visible||(t.active=h[0]._index),o("x"),o("y"),r.noneOrAll(e,t,["x","y"]),o("xanchor"),o("yanchor"),o("len"),o("lenmode"),o("pad.t"),o("pad.r"),o("pad.b"),o("pad.l"),r.coerceFont(o,"font",a.font),o("currentvalue.visible")&&(o("currentvalue.xanchor"),o("currentvalue.prefix"),o("currentvalue.suffix"),o("currentvalue.offset"),r.coerceFont(o,"currentvalue.font",t.font)),o("transition.duration"),o("transition.easing"),o("bgcolor"),o("activebgcolor"),o("bordercolor"),o("borderwidth"),o("ticklen"),o("tickwidth"),o("tickcolor"),o("minorticklen")}}function l(e,t){function n(n,i){return r.coerce(e,t,o,n,i)}if("skip"===e.method||Array.isArray(e.args)?n("visible"):t.visible=!1){n("method"),n("args");var i=n("label","step-"+t._index);n("value",i),n("execute")}}t.exports=function(e,t){n(e,t,{name:a,handleItemDefaults:s})}}}),sa=p({"src/components/sliders/draw.js"(e,t){var r=v(),n=kt(),i=q(),a=Jt(),o=st(),s=o.strTranslate,l=At(),c=gt().arrayEditor,u=ia(),h=St(),p=h.LINE_SPACING,d=h.FROM_TL,f=h.FROM_BR;function m(e){return u.autoMarginIdRoot+e._index}function g(e){return e._index}function y(e,t){var i=a.tester.selectAll("g."+u.labelGroupClass).data(t._visibleSteps);i.enter().append("g").classed(u.labelGroupClass,!0);var s=0,c=0;i.each((function(e){var n=_(r.select(this),{step:e},t).node();if(n){var i=a.bBox(n);c=Math.max(c,i.height),s=Math.max(s,i.width)}})),i.remove();var h=t._dims={};h.inputAreaWidth=Math.max(u.railWidth,u.gripHeight);var p=e._fullLayout._size;h.lx=p.l+p.w*t.x,h.ly=p.t+p.h*(1-t.y),"fraction"===t.lenmode?h.outerLength=Math.round(p.w*t.len):h.outerLength=t.len,h.inputAreaStart=0,h.inputAreaLength=Math.round(h.outerLength-t.pad.l-t.pad.r);var g=(h.inputAreaLength-2*u.stepInset)/(t._stepCount-1),y=s+u.labelPadding;if(h.labelStride=Math.max(1,Math.ceil(y/g)),h.labelHeight=c,h.currentValueMaxWidth=0,h.currentValueHeight=0,h.currentValueTotalHeight=0,h.currentValueMaxLines=1,t.currentvalue.visible){var v=a.tester.append("g");i.each((function(e){var r=x(v,t,e.label),n=r.node()&&a.bBox(r.node())||{width:0,height:0},i=l.lineCount(r);h.currentValueMaxWidth=Math.max(h.currentValueMaxWidth,Math.ceil(n.width)),h.currentValueHeight=Math.max(h.currentValueHeight,Math.ceil(n.height)),h.currentValueMaxLines=Math.max(h.currentValueMaxLines,i)})),h.currentValueTotalHeight=h.currentValueHeight+t.currentvalue.offset,v.remove()}h.height=h.currentValueTotalHeight+u.tickOffset+t.ticklen+u.labelOffset+h.labelHeight+t.pad.t+t.pad.b;var b="left";o.isRightAnchor(t)&&(h.lx-=h.outerLength,b="right"),o.isCenterAnchor(t)&&(h.lx-=h.outerLength/2,b="center");var w="top";o.isBottomAnchor(t)&&(h.ly-=h.height,w="bottom"),o.isMiddleAnchor(t)&&(h.ly-=h.height/2,w="middle"),h.outerLength=Math.ceil(h.outerLength),h.height=Math.ceil(h.height),h.lx=Math.round(h.lx),h.ly=Math.round(h.ly);var k={y:t.y,b:h.height*f[w],t:h.height*d[w]};"fraction"===t.lenmode?(k.l=0,k.xl=t.x-t.len*d[b],k.r=0,k.xr=t.x+t.len*f[b]):(k.x=t.x,k.l=h.outerLength*d[b],k.r=h.outerLength*f[b]),n.autoMargin(e,m(t),k)}function x(e,t,r){if(t.currentvalue.visible){var n,i,s=t._dims;switch(t.currentvalue.xanchor){case"right":n=s.inputAreaLength-u.currentValueInset-s.currentValueMaxWidth,i="left";break;case"center":n=.5*s.inputAreaLength,i="middle";break;default:n=u.currentValueInset,i="left"}var c=o.ensureSingle(e,"text",u.labelClass,(function(e){e.attr({"text-anchor":i,"data-notex":1})})),h=t.currentvalue.prefix?t.currentvalue.prefix:"";if("string"===typeof r)h+=r;else{var d=t.steps[t.active].label,f=t._gd._fullLayout._meta;f&&(d=o.templateString(d,f)),h+=d}t.currentvalue.suffix&&(h+=t.currentvalue.suffix),c.call(a.font,t.currentvalue.font).text(h).call(l.convertToTspans,t._gd);var m=l.lineCount(c),g=(s.currentValueMaxLines+1-m)*t.currentvalue.font.size*p;return l.positionText(c,n,g),c}}function b(e,t,r){o.ensureSingle(e,"rect",u.gripRectClass,(function(n){n.call(S,t,e,r).style("pointer-events","all")})).attr({width:u.gripWidth,height:u.gripHeight,rx:u.gripRadius,ry:u.gripRadius}).call(i.stroke,r.bordercolor).call(i.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function _(e,t,r){var n=o.ensureSingle(e,"text",u.labelClass,(function(e){e.attr({"text-anchor":"middle","data-notex":1})})),i=t.step.label,s=r._gd._fullLayout._meta;return s&&(i=o.templateString(i,s)),n.call(a.font,r.font).text(i).call(l.convertToTspans,r._gd),n}function w(e,t){var n=o.ensureSingle(e,"g",u.labelsClass),i=t._dims,s=n.selectAll("g."+u.labelGroupClass).data(i.labelSteps);s.enter().append("g").classed(u.labelGroupClass,!0),s.exit().remove(),s.each((function(e){var n=r.select(this);n.call(_,e,t),a.setTranslate(n,E(t,e.fraction),u.tickOffset+t.ticklen+t.font.size*p+u.labelOffset+i.currentValueTotalHeight)}))}function k(e,t,r,n,i){var a=Math.round(n*(r._stepCount-1)),o=r._visibleSteps[a]._index;o!==r.active&&T(e,t,r,o,!0,i)}function T(e,t,r,i,a,o){var s=r.active;r.active=i,c(e.layout,u.name,r).applyUpdate("active",i);var l=r.steps[r.active];t.call(M,r,o),t.call(x,r),e.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(t._nextMethod?(t._nextMethod.step=l,t._nextMethod.doCallback=a,t._nextMethod.doTransition=o):(t._nextMethod={step:l,doCallback:a,doTransition:o},t._nextMethodRaf=window.requestAnimationFrame((function(){var r=t._nextMethod.step;r.method&&(r.execute&&n.executeAPICommand(e,r.method,r.args),t._nextMethod=null,t._nextMethodRaf=null)}))))}function S(e,t,n){if(!t._context.staticPlot){var a=n.node(),o=r.select(t);e.on("mousedown",l),e.on("touchstart",l)}function s(){return n.data()[0]}function l(){var e=s();t.emit("plotly_sliderstart",{slider:e});var l=n.select("."+u.gripRectClass);r.event.stopPropagation(),r.event.preventDefault(),l.call(i.fill,e.activebgcolor);var c=C(e,r.mouse(a)[0]);function h(){var e=s(),i=C(e,r.mouse(a)[0]);k(t,n,e,i,!1)}function p(){var e=s();e._dragging=!1,l.call(i.fill,e.bgcolor),o.on("mouseup",null),o.on("mousemove",null),o.on("touchend",null),o.on("touchmove",null),t.emit("plotly_sliderend",{slider:e,step:e.steps[e.active]})}k(t,n,e,c,!0),e._dragging=!0,o.on("mousemove",h),o.on("touchmove",h),o.on("mouseup",p),o.on("touchend",p)}}function A(e,t){var n=e.selectAll("rect."+u.tickRectClass).data(t._visibleSteps),o=t._dims;n.enter().append("rect").classed(u.tickRectClass,!0),n.exit().remove(),n.attr({width:t.tickwidth+"px","shape-rendering":"crispEdges"}),n.each((function(e,n){var s=n%o.labelStride===0,l=r.select(this);l.attr({height:s?t.ticklen:t.minorticklen}).call(i.fill,t.tickcolor),a.setTranslate(l,E(t,n/(t._stepCount-1))-.5*t.tickwidth,(s?u.tickOffset:u.minorTickOffset)+o.currentValueTotalHeight)}))}function M(e,t,r){for(var n=e.select("rect."+u.gripRectClass),i=0,a=0;a<t._stepCount;a++)if(t._visibleSteps[a]._index===t.active){i=a;break}var o=E(t,i/(t._stepCount-1));if(!t._invokingCommand){var l=n;r&&t.transition.duration>0&&(l=l.transition().duration(t.transition.duration).ease(t.transition.easing)),l.attr("transform",s(o-.5*u.gripWidth,t._dims.currentValueTotalHeight))}}function E(e,t){var r=e._dims;return r.inputAreaStart+u.stepInset+(r.inputAreaLength-2*u.stepInset)*Math.min(1,Math.max(0,t))}function C(e,t){var r=e._dims;return Math.min(1,Math.max(0,(t-u.stepInset-r.inputAreaStart)/(r.inputAreaLength-2*u.stepInset-2*r.inputAreaStart)))}function P(e,t,r){var n=r._dims,s=o.ensureSingle(e,"rect",u.railTouchRectClass,(function(n){n.call(S,t,e,r).style("pointer-events","all")}));s.attr({width:n.inputAreaLength,height:Math.max(n.inputAreaWidth,u.tickOffset+r.ticklen+n.labelHeight)}).call(i.fill,r.bgcolor).attr("opacity",0),a.setTranslate(s,0,n.currentValueTotalHeight)}function L(e,t){var r=t._dims,n=r.inputAreaLength-2*u.railInset,s=o.ensureSingle(e,"rect",u.railRectClass);s.attr({width:n,height:u.railWidth,rx:u.railRadius,ry:u.railRadius,"shape-rendering":"crispEdges"}).call(i.stroke,t.bordercolor).call(i.fill,t.bgcolor).style("stroke-width",t.borderwidth+"px"),a.setTranslate(s,u.railInset,.5*(r.inputAreaWidth-u.railWidth)+r.currentValueTotalHeight)}t.exports=function(e){var t=e._context.staticPlot,i=e._fullLayout,o=function(e,t){for(var r=e[u.name],n=[],i=0;i<r.length;i++){var a=r[i];a.visible&&(a._gd=t,n.push(a))}return n}(i,e),s=i._infolayer.selectAll("g."+u.containerClassName).data(o.length>0?[0]:[]);function l(t){t._commandObserver&&(t._commandObserver.remove(),delete t._commandObserver),n.autoMargin(e,m(t))}if(s.enter().append("g").classed(u.containerClassName,!0).style("cursor",t?null:"ew-resize"),s.exit().each((function(){r.select(this).selectAll("g."+u.groupClassName).each(l)})).remove(),0!==o.length){var c=s.selectAll("g."+u.groupClassName).data(o,g);c.enter().append("g").classed(u.groupClassName,!0),c.exit().each(l).remove();for(var h=0;h<o.length;h++){var p=o[h];y(e,p)}c.each((function(t){var i=r.select(this);!function(e){var t=e._dims;t.labelSteps=[];for(var r=e._stepCount,n=0;n<r;n+=t.labelStride)t.labelSteps.push({fraction:n/(r-1),step:e._visibleSteps[n]})}(t),n.manageCommandObserver(e,t,t._visibleSteps,(function(t){var r=i.data()[0];r.active!==t.index&&(r._dragging||T(e,i,r,t.index,!1,!0))})),function(e,t,r){(r.steps[r.active]||{}).visible||(r.active=r._visibleSteps[0]._index),t.call(x,r).call(L,r).call(w,r).call(A,r).call(P,e,r).call(b,e,r);var n=r._dims;a.setTranslate(t,n.lx+r.pad.l,n.ly+r.pad.t),t.call(M,r,!1),t.call(x,r)}(e,r.select(this),t)}))}}}}),la=p({"src/components/sliders/index.js"(e,t){var r=ia();t.exports={moduleType:"component",name:r.name,layoutAttributes:aa(),supplyLayoutDefaults:oa(),draw:sa()}}}),ca=p({"src/components/rangeslider/attributes.js"(e,t){var r=V();t.exports={bgcolor:{valType:"color",dflt:r.background,editType:"plot"},bordercolor:{valType:"color",dflt:r.defaultLine,editType:"plot"},borderwidth:{valType:"integer",dflt:0,min:0,editType:"plot"},autorange:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"range[0]":void 0,"range[1]":void 0}},range:{valType:"info_array",items:[{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"calc",impliedEdits:{"^autorange":!1}}],editType:"calc",impliedEdits:{autorange:!1}},thickness:{valType:"number",dflt:.15,min:0,max:1,editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"}}}),ua=p({"src/components/rangeslider/oppaxis_attributes.js"(e,t){t.exports={_isSubplotObj:!0,rangemode:{valType:"enumerated",values:["auto","fixed","match"],dflt:"match",editType:"calc"},range:{valType:"info_array",items:[{valType:"any",editType:"plot"},{valType:"any",editType:"plot"}],editType:"plot"},editType:"calc"}}}),ha=p({"src/components/rangeslider/constants.js"(e,t){t.exports={name:"rangeslider",containerClassName:"rangeslider-container",bgClassName:"rangeslider-bg",rangePlotClassName:"rangeslider-rangeplot",maskMinClassName:"rangeslider-mask-min",maskMaxClassName:"rangeslider-mask-max",slideBoxClassName:"rangeslider-slidebox",grabberMinClassName:"rangeslider-grabber-min",grabAreaMinClassName:"rangeslider-grabarea-min",handleMinClassName:"rangeslider-handle-min",grabberMaxClassName:"rangeslider-grabber-max",grabAreaMaxClassName:"rangeslider-grabarea-max",handleMaxClassName:"rangeslider-handle-max",maskMinOppAxisClassName:"rangeslider-mask-min-opp-axis",maskMaxOppAxisClassName:"rangeslider-mask-max-opp-axis",maskColor:"rgba(0,0,0,0.4)",maskOppAxisColor:"rgba(0,0,0,0.2)",slideBoxFill:"transparent",slideBoxCursor:"ew-resize",grabAreaFill:"transparent",grabAreaCursor:"col-resize",grabAreaWidth:10,handleWidth:4,handleRadius:1,handleStrokeWidth:1,extraPad:15}}}),pa=p({"src/components/rangeslider/helpers.js"(e){var t=vt(),r=At(),n=ha(),i=St().LINE_SPACING,a=n.name;function o(e){var t=e&&e[a];return t&&t.visible}e.isVisible=o,e.makeData=function(e){for(var r=t.list({_fullLayout:e},"x",!0),n=e.margin,i=[],s=0;s<r.length;s++){var l=r[s];if(o(l)){i.push(l);var c=l[a];c._id=a+l._id,c._height=(e.height-n.b-n.t)*c.thickness,c._offsetShift=Math.floor(c.borderwidth/2)}}e._rangeSliderData=i},e.autoMarginOpts=function(e,t){var o=e._fullLayout,s=t[a],l=t._id.charAt(0),c=0,u=0;return"bottom"===t.side&&(c=t._depth,t.title.text!==o._dfltTitle[l]&&(u=1.5*t.title.font.size+10+s._offsetShift,u+=(t.title.text.match(r.BR_TAG_ALL)||[]).length*t.title.font.size*i)),{x:0,y:t._counterDomainMin,l:0,r:0,t:0,b:s._height+c+Math.max(o.margin.b,u),pad:n.extraPad+2*s._offsetShift}}}}),da=p({"src/components/rangeslider/defaults.js"(e,t){var r=st(),n=gt(),i=vt(),a=ca(),o=ua();t.exports=function(e,t,s){var l=e[s],c=t[s];if(l.rangeslider||t._requestRangeslider[c._id]){r.isPlainObject(l.rangeslider)||(l.rangeslider={});var u,h,p=l.rangeslider,d=n.newContainer(c,"rangeslider");if(_("visible")){_("bgcolor",t.plot_bgcolor),_("bordercolor"),_("borderwidth"),_("thickness"),_("autorange",!c.isValidRange(p.range)),_("range");var f=t._subplots;if(f)for(var m=f.cartesian.filter((function(e){return e.substr(0,e.indexOf("y"))===i.name2id(s)})).map((function(e){return e.substr(e.indexOf("y"),e.length)})),g=r.simpleMap(m,i.id2name),y=0;y<g.length;y++){var v=g[y];u=p[v]||{},h=n.newContainer(d,v,"yaxis");var x,b=t[v];u.range&&b.isValidRange(u.range)&&(x="fixed"),"match"!==w("rangemode",x)&&w("range",b.range.slice())}d._input=p}}function _(e,t){return r.coerce(p,d,a,e,t)}function w(e,t){return r.coerce(u,h,o,e,t)}}}}),fa=p({"src/components/rangeslider/calc_autorange.js"(e,t){var r=vt().list,n=rr().getAutoRange,i=ha();t.exports=function(e){for(var t=r(e,"x",!0),a=0;a<t.length;a++){var o=t[a],s=o[i.name];s&&s.visible&&s.autorange&&(s._input.autorange=!0,s._input.range=s.range=n(e,o))}}}}),ma=p({"src/components/rangeslider/draw.js"(e,t){var r=v(),n=Ve(),i=kt(),a=st(),o=a.strTranslate,s=Jt(),l=q(),c=Qt(),u=Ai(),h=vt(),p=hr(),d=pr(),f=ha();function m(e){return"number"===typeof e.clientX?e.clientX:e.touches&&e.touches.length>0?e.touches[0].clientX:0}function g(e,t,r,n){var i=a.ensureSingle(e,"rect",f.bgClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})),c=n.borderwidth%2===0?n.borderwidth:n.borderwidth-1,u=-n._offsetShift,h=s.crispRound(t,n.borderwidth);i.attr({width:n._width+c,height:n._height+c,transform:o(u,u),"stroke-width":h}).call(l.stroke,n.bordercolor).call(l.fill,n.bgcolor)}function y(e,t,r,n){var i=t._fullLayout;a.ensureSingleById(i._topdefs,"clipPath",n._clipId,(function(e){e.append("rect").attr({x:0,y:0})})).select("rect").attr({width:n._width,height:n._height})}function x(e,t,n,o){var l,c=t.calcdata,p=e.selectAll("g."+f.rangePlotClassName).data(n._subplotsWith,a.identity);p.enter().append("g").attr("class",(function(e){return f.rangePlotClassName+" "+e})).call(s.setClipUrl,o._clipId,t),p.order(),p.exit().remove(),p.each((function(e,a){var s=r.select(this),p=0===a,d=h.getFromId(t,e,"y"),f=d._name,m=o[f],g={data:[],layout:{xaxis:{type:n.type,domain:[0,1],range:o.range.slice(),calendar:n.calendar},width:o._width,height:o._height,margin:{t:0,b:0,l:0,r:0}},_context:t._context};n.rangebreaks&&(g.layout.xaxis.rangebreaks=n.rangebreaks),g.layout[f]={type:d.type,domain:[0,1],range:"match"!==m.rangemode?m.range.slice():d.range.slice(),calendar:d.calendar},d.rangebreaks&&(g.layout[f].rangebreaks=d.rangebreaks),i.supplyDefaults(g);var y=g._fullLayout.xaxis,v=g._fullLayout[f];y.clearCalc(),y.setScale(),v.clearCalc(),v.setScale();var x={id:e,plotgroup:s,xaxis:y,yaxis:v,isRangePlot:!0};p?l=x:(x.mainplot="xy",x.mainplotinfo=l),u.rangePlot(t,x,function(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n],a=i[0].trace;a.xaxis+a.yaxis===t&&r.push(i)}return r}(c,e))}))}function b(e,t,r,n,i){a.ensureSingle(e,"rect",f.maskMinClassName,(function(e){e.attr({x:0,y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,f.maskColor),a.ensureSingle(e,"rect",f.maskMaxClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("height",n._height).call(l.fill,f.maskColor),"match"!==i.rangemode&&(a.ensureSingle(e,"rect",f.maskMinOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).call(l.fill,f.maskOppAxisColor),a.ensureSingle(e,"rect",f.maskMaxOppAxisClassName,(function(e){e.attr({y:0,"shape-rendering":"crispEdges"})})).attr("width",n._width).style("border-top",f.maskOppBorder).call(l.fill,f.maskOppAxisColor))}function _(e,t,r,n){t._context.staticPlot||a.ensureSingle(e,"rect",f.slideBoxClassName,(function(e){e.attr({y:0,cursor:f.slideBoxCursor,"shape-rendering":"crispEdges"})})).attr({height:n._height,fill:f.slideBoxFill})}function w(e,t,r,n){var i=a.ensureSingle(e,"g",f.grabberMinClassName),o=a.ensureSingle(e,"g",f.grabberMaxClassName),s={x:0,width:f.handleWidth,rx:f.handleRadius,fill:l.background,stroke:l.defaultLine,"stroke-width":f.handleStrokeWidth,"shape-rendering":"crispEdges"},c={y:Math.round(n._height/4),height:Math.round(n._height/2)};a.ensureSingle(i,"rect",f.handleMinClassName,(function(e){e.attr(s)})).attr(c),a.ensureSingle(o,"rect",f.handleMaxClassName,(function(e){e.attr(s)})).attr(c);var u={width:f.grabAreaWidth,x:0,y:0,fill:f.grabAreaFill,cursor:t._context.staticPlot?void 0:f.grabAreaCursor};a.ensureSingle(i,"rect",f.grabAreaMinClassName,(function(e){e.attr(u)})).attr("height",n._height),a.ensureSingle(o,"rect",f.grabAreaMaxClassName,(function(e){e.attr(u)})).attr("height",n._height)}t.exports=function(e){for(var t=e._fullLayout,i=t._rangeSliderData,s=0;s<i.length;s++){var l=i[s][f.name];l._clipId=l._id+"-"+t._uid}var u=t._infolayer.selectAll("g."+f.containerClassName).data(i,(function(e){return e._name}));u.exit().each((function(e){var r=e[f.name];t._topdefs.select("#"+r._clipId).remove()})).remove(),0!==i.length&&(u.enter().append("g").classed(f.containerClassName,!0).attr("pointer-events","all"),u.each((function(i){var s=r.select(this),l=i[f.name],u=t[h.id2name(i.anchor)],v=l[h.id2name(i.anchor)];if(l.range){var k,T=a.simpleMap(l.range,i.r2l),S=a.simpleMap(i.range,i.r2l);k=S[0]<S[1]?[Math.min(T[0],S[0]),Math.max(T[1],S[1])]:[Math.max(T[0],S[0]),Math.min(T[1],S[1])],l.range=l._input.range=a.simpleMap(k,i.l2r)}i.cleanRange("rangeslider.range");var A=t._size,M=i.domain;l._width=A.w*(M[1]-M[0]);var E=Math.round(A.l+A.w*M[0]),C=Math.round(A.t+A.h*(1-i._counterDomainMin)+("bottom"===i.side?i._depth:0)+l._offsetShift+f.extraPad);s.attr("transform",o(E,C)),l._rl=a.simpleMap(l.range,i.r2l);var P=l._rl[0],L=l._rl[1],I=L-P;if(l.p2d=function(e){return e/l._width*I+P},l.d2p=function(e){return(e-P)/I*l._width},i.rangebreaks){var z=i.locateBreaks(P,L);if(z.length){var O,R,D=0;for(O=0;O<z.length;O++)D+=(R=z[O]).max-R.min;var j=l._width/(L-P-D),F=[-j*P];for(O=0;O<z.length;O++)R=z[O],F.push(F[F.length-1]-j*(R.max-R.min));for(l.d2p=function(e){for(var t=F[0],r=0;r<z.length;r++){var n=z[r];if(e>=n.max)t=F[r+1];else if(e<n.min)break}return t+j*e},O=0;O<z.length;O++)(R=z[O]).pmin=l.d2p(R.min),R.pmax=l.d2p(R.max);l.p2d=function(e){for(var t=F[0],r=0;r<z.length;r++){var n=z[r];if(e>=n.pmax)t=F[r+1];else if(e<n.pmin)break}return(e-t)/j}}}if("match"!==v.rangemode){var B=u.r2l(v.range[0]),N=u.r2l(v.range[1])-B;l.d2pOppAxis=function(e){return(e-B)/N*l._height}}s.call(g,e,i,l).call(y,e,i,l).call(x,e,i,l).call(b,e,i,l,v).call(_,e,i,l).call(w,e,i,l),function(e,t,i,o){if(!t._context.staticPlot){var s=e.select("rect."+f.slideBoxClassName).node(),l=e.select("rect."+f.grabAreaMinClassName).node(),c=e.select("rect."+f.grabAreaMaxClassName).node();e.on("mousedown",u),e.on("touchstart",u)}function u(){var u=r.event,h=u.target,f=m(u),g=f-e.node().getBoundingClientRect().left,y=o.d2p(i._rl[0]),v=o.d2p(i._rl[1]),x=p.coverSlip();function b(e){var u,p,b,_=+m(e)-f;switch(h){case s:if(b="ew-resize",y+_>i._length||v+_<0)return;u=y+_,p=v+_;break;case l:if(b="col-resize",y+_>i._length)return;u=y+_,p=v;break;case c:if(b="col-resize",v+_<0)return;u=y,p=v+_;break;default:b="ew-resize",u=g,p=g+_}if(p<u){var w=p;p=u,u=w}o._pixelMin=u,o._pixelMax=p,d(r.select(x),b),function(e,t,r,i){function o(e){return r.l2r(a.constrain(e,i._rl[0],i._rl[1]))}var s=o(i.p2d(i._pixelMin)),l=o(i.p2d(i._pixelMax));window.requestAnimationFrame((function(){n.call("_guiRelayout",t,r._name+".range",[s,l])}))}(0,t,i,o)}function _(){x.removeEventListener("mousemove",b),x.removeEventListener("mouseup",_),this.removeEventListener("touchmove",b),this.removeEventListener("touchend",_),a.removeElement(x)}this.addEventListener("touchmove",b),this.addEventListener("touchend",_),x.addEventListener("mousemove",b),x.addEventListener("mouseup",_)}}(s,e,i,l),function(e,t,r,n,i,s){var l=f.handleWidth/2;function c(e){return a.constrain(e,0,n._width)}function u(e){return a.constrain(e,0,n._height)}function h(e){return a.constrain(e,-l,n._width+l)}var p=c(n.d2p(r._rl[0])),d=c(n.d2p(r._rl[1]));if(e.select("rect."+f.slideBoxClassName).attr("x",p).attr("width",d-p),e.select("rect."+f.maskMinClassName).attr("width",p),e.select("rect."+f.maskMaxClassName).attr("x",d).attr("width",n._width-d),"match"!==s.rangemode){var m=n._height-u(n.d2pOppAxis(i._rl[1])),g=n._height-u(n.d2pOppAxis(i._rl[0]));e.select("rect."+f.maskMinOppAxisClassName).attr("x",p).attr("height",m).attr("width",d-p),e.select("rect."+f.maskMaxOppAxisClassName).attr("x",p).attr("y",g).attr("height",n._height-g).attr("width",d-p),e.select("rect."+f.slideBoxClassName).attr("y",m).attr("height",g-m)}var y=.5,v=Math.round(h(p-l))-y,x=Math.round(h(d-l))+y;e.select("g."+f.grabberMinClassName).attr("transform",o(v,y)),e.select("g."+f.grabberMaxClassName).attr("transform",o(x,y))}(s,0,i,l,u,v),"bottom"===i.side&&c.draw(e,i._id+"title",{propContainer:i,propName:i._name+".title",placeholder:t._dfltTitle.x,attributes:{x:i._offset+i._length/2,y:C+l._height+l._offsetShift+10+1.5*i.title.font.size,"text-anchor":"middle"}})})))}}}),ga=p({"src/components/rangeslider/index.js"(e,t){var r=st(),n=ca(),i=ua(),a=pa();t.exports={moduleType:"component",name:"rangeslider",schema:{subplots:{xaxis:{rangeslider:r.extendFlat({},n,{yaxis:i})}}},layoutAttributes:ca(),handleDefaults:da(),calcAutorange:fa(),draw:ma(),isVisible:a.isVisible,makeData:a.makeData,autoMarginOpts:a.autoMarginOpts}}}),ya=p({"src/components/rangeselector/attributes.js"(e,t){var r=D(),n=V(),i=(0,gt().templatedArray)("button",{visible:{valType:"boolean",dflt:!0,editType:"plot"},step:{valType:"enumerated",values:["month","year","day","hour","minute","second","all"],dflt:"month",editType:"plot"},stepmode:{valType:"enumerated",values:["backward","todate"],dflt:"backward",editType:"plot"},count:{valType:"number",min:0,dflt:1,editType:"plot"},label:{valType:"string",editType:"plot"},editType:"plot"});t.exports={visible:{valType:"boolean",editType:"plot"},buttons:i,x:{valType:"number",min:-2,max:3,editType:"plot"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"plot"},y:{valType:"number",min:-2,max:3,editType:"plot"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"bottom",editType:"plot"},font:r({editType:"plot"}),bgcolor:{valType:"color",dflt:n.lightLine,editType:"plot"},activecolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:n.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"plot"}}}),va=p({"src/components/rangeselector/constants.js"(e,t){t.exports={yPad:.02,minButtonWidth:30,rx:3,ry:3,lightAmount:25,darkAmount:10}}}),xa=p({"src/components/rangeselector/defaults.js"(e,t){var r=st(),n=q(),i=gt(),a=Ft(),o=ya(),s=va();function l(e,t,n,i){var a=i.calendar;function s(n,i){return r.coerce(e,t,o.buttons,n,i)}if(s("visible")){var l=s("step");"all"!==l&&(!a||"gregorian"===a||"month"!==l&&"year"!==l?s("stepmode"):t.stepmode="backward",s("count")),s("label")}}t.exports=function(e,t,c,u,h){var p=e.rangeselector||{},d=i.newContainer(t,"rangeselector");function f(e,t){return r.coerce(p,d,o,e,t)}if(f("visible",a(p,d,{name:"buttons",handleItemDefaults:l,calendar:h}).length>0)){var m=function(e,t,r){for(var n=r.filter((function(r){return t[r].anchor===e._id})),i=0,a=0;a<n.length;a++){var o=t[n[a]].domain;o&&(i=Math.max(o[1],i))}return[e.domain[0],i+s.yPad]}(t,c,u);f("x",m[0]),f("y",m[1]),r.noneOrAll(e,t,["x","y"]),f("xanchor"),f("yanchor"),r.coerceFont(f,"font",c.font);var g=f("bgcolor");f("activecolor",n.contrast(g,s.lightAmount,s.darkAmount)),f("bordercolor"),f("borderwidth")}}}}),ba=p({"src/components/rangeselector/get_update_object.js"(e,t){var r=x(),n=st().titleCase;t.exports=function(e,t){var i=e._name,a={};if("all"===t.step)a[i+".autorange"]=!0;else{var o=function(e,t){var i,a=e.range,o=new Date(e.r2l(a[1])),s=t.step,l=r["utc"+n(s)],c=t.count;switch(t.stepmode){case"backward":i=e.l2r(+l.offset(o,-c));break;case"todate":var u=l.offset(o,-c);i=e.l2r(+l.ceil(u))}var h=a[1];return[i,h]}(e,t);a[i+".range[0]"]=o[0],a[i+".range[1]"]=o[1]}return a}}}),_a=p({"src/components/rangeselector/draw.js"(e,t){var r=v(),n=Ve(),i=kt(),a=q(),o=Jt(),s=st(),l=s.strTranslate,c=At(),u=vt(),h=St(),p=h.LINE_SPACING,d=h.FROM_TL,f=h.FROM_BR,m=va(),g=ba();function y(e){return e._id}function x(e,t,r){var n=s.ensureSingle(e,"rect","selector-rect",(function(e){e.attr("shape-rendering","crispEdges")}));n.attr({rx:m.rx,ry:m.ry}),n.call(a.stroke,t.bordercolor).call(a.fill,function(e,t){return t._isActive||t._isHovered?e.activecolor:e.bgcolor}(t,r)).style("stroke-width",t.borderwidth+"px")}function b(e,t,r,n){var i,a;s.ensureSingle(e,"text","selector-text",(function(e){e.attr("text-anchor","middle")})).call(o.font,t.font).text((i=r,a=n._fullLayout._meta,i.label?a?s.templateString(i.label,a):i.label:"all"===i.step?"all":i.count+i.step.charAt(0))).call((function(e){c.convertToTspans(e,n)}))}t.exports=function(e){var t=e._fullLayout._infolayer.selectAll(".rangeselector").data(function(e){for(var t=u.list(e,"x",!0),r=[],n=0;n<t.length;n++){var i=t[n];i.rangeselector&&i.rangeselector.visible&&r.push(i)}return r}(e),y);t.enter().append("g").classed("rangeselector",!0),t.exit().remove(),t.style({cursor:"pointer","pointer-events":"all"}),t.each((function(t){var a=r.select(this),u=t,h=u.rangeselector,y=a.selectAll("g.button").data(s.filterVisible(h.buttons));y.enter().append("g").classed("button",!0),y.exit().remove(),y.each((function(t){var i=r.select(this),a=g(u,t);t._isActive=function(e,t,r){if("all"===t.step)return!0===e.autorange;var n=Object.keys(r);return e.range[0]===r[n[0]]&&e.range[1]===r[n[1]]}(u,t,a),i.call(x,h,t),i.call(b,h,t,e),i.on("click",(function(){e._dragged||n.call("_guiRelayout",e,a)})),i.on("mouseover",(function(){t._isHovered=!0,i.call(x,h,t)})),i.on("mouseout",(function(){t._isHovered=!1,i.call(x,h,t)}))})),function(e,t,n,a,u){var h=0,g=0,y=n.borderwidth;t.each((function(){var e=r.select(this).select(".selector-text"),t=n.font.size*p,i=Math.max(t*c.lineCount(e),16)+3;g=Math.max(g,i)})),t.each((function(){var e=r.select(this),t=e.select(".selector-rect"),i=e.select(".selector-text"),a=i.node()&&o.bBox(i.node()).width,s=n.font.size*p,u=c.lineCount(i),d=Math.max(a+10,m.minButtonWidth);e.attr("transform",l(y+h,y)),t.attr({x:0,y:0,width:d,height:g}),c.positionText(i,d/2,g/2-(u-1)*s/2+3),h+=d+5}));var v=e._fullLayout._size,x=v.l+v.w*n.x,b=v.t+v.h*(1-n.y),_="left";s.isRightAnchor(n)&&(x-=h,_="right"),s.isCenterAnchor(n)&&(x-=h/2,_="center");var w="top";s.isBottomAnchor(n)&&(b-=g,w="bottom"),s.isMiddleAnchor(n)&&(b-=g/2,w="middle"),h=Math.ceil(h),g=Math.ceil(g),x=Math.round(x),b=Math.round(b),i.autoMargin(e,a+"-range-selector",{x:n.x,y:n.y,l:h*d[_],r:h*f[_],b:g*f[w],t:g*d[w]}),u.attr("transform",l(x,b))}(e,y,h,u._name,a)}))}}}),wa=p({"src/components/rangeselector/index.js"(e,t){t.exports={moduleType:"component",name:"rangeselector",schema:{subplots:{xaxis:{rangeselector:ya()}}},layoutAttributes:ya(),handleDefaults:xa(),draw:_a()}}}),ka=p({"src/plots/domain.js"(e){var t=R().extendFlat;e.attributes=function(e,r){r=r||{};var n={valType:"info_array",editType:(e=e||{}).editType,items:[{valType:"number",min:0,max:1,editType:e.editType},{valType:"number",min:0,max:1,editType:e.editType}],dflt:[0,1]},i=(e.name&&e.name,e.trace,r.description&&r.description,{x:t({},n,{}),y:t({},n,{}),editType:e.editType});return e.noGridCell||(i.row={valType:"integer",min:0,dflt:0,editType:e.editType},i.column={valType:"integer",min:0,dflt:0,editType:e.editType}),i},e.defaults=function(e,t,r,n){var i=n&&n.x||[0,1],a=n&&n.y||[0,1],o=t.grid;if(o){var s=r("domain.column");void 0!==s&&(s<o.columns?i=o._domains.x[s]:delete e.domain.column);var l=r("domain.row");void 0!==l&&(l<o.rows?a=o._domains.y[l]:delete e.domain.row)}var c=r("domain.x",i),u=r("domain.y",a);c[0]<c[1]||(e.domain.x=i.slice()),u[0]<u[1]||(e.domain.y=a.slice())}}}),Ta=p({"src/components/grid/index.js"(e,t){var r=st(),n=G().counter,i=ka().attributes,a=yt().idRegex,o=gt(),s={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:[n("xy").toString(),""],editType:"plot"},editType:"plot"},xaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.x.toString(),""],editType:"plot"},editType:"plot"},yaxes:{valType:"info_array",freeLength:!0,items:{valType:"enumerated",values:[a.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:i({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 l(e,t,r){var n=t[r+"axes"],i=Object.keys((e._splomAxes||{})[r]||{});return Array.isArray(n)?n:i.length?i:void 0}function c(e,t,r,n,i,a){var o=t(e+"gap",r),s=t("domain."+e);t(e+"side",n);for(var l=new Array(i),c=s[0],u=(s[1]-c)/(i-o),h=u*(1-o),p=0;p<i;p++){var d=c+u*p;l[a?i-1-p:p]=[d,d+h]}return l}function u(e,t,r,n,i){var a,o=new Array(r);function s(e,r){-1!==t.indexOf(r)&&void 0===n[r]?(o[e]=r,n[r]=e):o[e]=""}if(Array.isArray(e))for(a=0;a<r;a++)s(a,e[a]);else for(s(0,i),a=1;a<r;a++)s(a,i+(a+1));return o}t.exports={moduleType:"component",name:"grid",schema:{layout:{grid:s}},layoutAttributes:s,sizeDefaults:function(e,t){var n=e.grid||{},i=l(t,n,"x"),a=l(t,n,"y");if(e.grid||i||a){var u,h,p=Array.isArray(n.subplots)&&Array.isArray(n.subplots[0]),d=Array.isArray(i),f=Array.isArray(a),m=d&&i!==n.xaxes&&f&&a!==n.yaxes;p?(u=n.subplots.length,h=n.subplots[0].length):(f&&(u=a.length),d&&(h=i.length));var g=o.newContainer(t,"grid"),y=T("rows",u),v=T("columns",h);if(y*v>1){p||d||f||"independent"===T("pattern")&&(p=!0),g._hasSubplotGrid=p;var x,b,_="top to bottom"===T("roworder"),w=p?.2:.1,k=p?.3:.1;m&&t._splomGridDflt&&(x=t._splomGridDflt.xside,b=t._splomGridDflt.yside),g._domains={x:c("x",T,w,x,v),y:c("y",T,k,b,y,_)}}else delete t.grid}function T(e,t){return r.coerce(n,g,s,e,t)}},contentDefaults:function(e,t){var r=t.grid;if(r&&r._domains){var n,i,a,o,s,c,h,p=e.grid||{},d=t._subplots,f=r._hasSubplotGrid,m=r.rows,g=r.columns,y="independent"===r.pattern,v=r._axisMap={};if(f){var x=p.subplots||[];c=r.subplots=new Array(m);var b=1;for(n=0;n<m;n++){var _=c[n]=new Array(g),w=x[n]||[];for(i=0;i<g;i++)if(y?(s=1===b?"xy":"x"+b+"y"+b,b++):s=w[i],_[i]="",-1!==d.cartesian.indexOf(s)){if(h=s.indexOf("y"),a=s.slice(0,h),o=s.slice(h),void 0!==v[a]&&v[a]!==i||void 0!==v[o]&&v[o]!==n)continue;_[i]=s,v[a]=i,v[o]=n}}}else{var k=l(t,p,"x"),T=l(t,p,"y");r.xaxes=u(k,d.xaxis,g,v,"x"),r.yaxes=u(T,d.yaxis,m,v,"y")}var S=r._anchors={},A="top to bottom"===r.roworder;for(var M in v){var E,C,P,L=M.charAt(0),I=r[L+"side"];if(I.length<8)S[M]="free";else if("x"===L){if("t"===I.charAt(0)===A?(E=0,C=1,P=m):(E=m-1,C=-1,P=-1),f){var z=v[M];for(n=E;n!==P;n+=C)if((s=c[n][z])&&(h=s.indexOf("y"),s.slice(0,h)===M)){S[M]=s.slice(h);break}}else for(n=E;n!==P;n+=C)if(o=r.yaxes[n],-1!==d.cartesian.indexOf(M+o)){S[M]=o;break}}else if("l"===I.charAt(0)?(E=0,C=1,P=g):(E=g-1,C=-1,P=-1),f){var O=v[M];for(n=E;n!==P;n+=C)if((s=c[O][n])&&(h=s.indexOf("y"),s.slice(h)===M)){S[M]=s.slice(0,h);break}}else for(n=E;n!==P;n+=C)if(a=r.xaxes[n],-1!==d.cartesian.indexOf(a+M)){S[M]=a;break}}}}}}}),Sa=p({"src/components/errorbars/attributes.js"(e,t){t.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc"}}}),Aa=p({"src/components/errorbars/defaults.js"(e,t){var r=k(),n=Ve(),i=st(),a=gt(),o=Sa();t.exports=function(e,t,s,l){var c="error_"+l.axis,u=a.newContainer(t,c),h=e[c]||{};function p(e,t){return i.coerce(h,u,o,e,t)}if(!1!==p("visible",void 0!==h.array||void 0!==h.value||"sqrt"===h.type)){var d=p("type","array"in h?"data":"percent"),f=!0;"sqrt"!==d&&(f=p("symmetric",!(("data"===d?"arrayminus":"valueminus")in h))),"data"===d?(p("array"),p("traceref"),f||(p("arrayminus"),p("tracerefminus"))):"percent"!==d&&"constant"!==d||(p("value"),f||p("valueminus"));var m="copy_"+l.inherit+"style";l.inherit&&(t["error_"+l.inherit]||{}).visible&&p(m,!(h.color||r(h.thickness)||r(h.width))),l.inherit&&u[m]||(p("color",s),p("thickness"),p("width",n.traceIs(t,"gl3d")?0:4))}}}}),Ma=p({"src/components/errorbars/compute_error.js"(e,t){function r(e,t){return"percent"===e?function(e){return Math.abs(e*t/100)}:"constant"===e?function(){return Math.abs(t)}:"sqrt"===e?function(e){return Math.sqrt(Math.abs(e))}:void 0}t.exports=function(e){var t=e.type,n=e.symmetric;if("data"===t){var i=e.array||[];if(n)return function(e,t){var r=+i[t];return[r,r]};var a=e.arrayminus||[];return function(e,t){var r=+i[t],n=+a[t];return isNaN(r)&&isNaN(n)?[NaN,NaN]:[n||0,r||0]}}var o=r(t,e.value),s=r(t,e.valueminus);return n||void 0===e.valueminus?function(e){var t=o(e);return[t,t]}:function(e){return[s(e),o(e)]}}}}),Ea=p({"src/components/errorbars/calc.js"(e,t){var r=k(),n=Ve(),i=nr(),a=st(),o=Ma();function s(e,t,n,s){var l=t["error_"+s]||{},c=[];if(l.visible&&-1!==["linear","log"].indexOf(n.type)){for(var u=o(l),h=0;h<e.length;h++){var p=e[h],d=p.i;if(void 0===d)d=h;else if(null===d)continue;var f=p[s];if(r(n.c2l(f))){var m=u(f,d);if(r(m[0])&&r(m[1])){var g=p[s+"s"]=f-m[0],y=p[s+"h"]=f+m[1];c.push(g,y)}}}var v=n._id,x=t._extremes[v],b=i.findExtremes(n,c,a.extendFlat({tozero:x.opts.tozero},{padded:!0}));x.min=x.min.concat(b.min),x.max=x.max.concat(b.max)}}t.exports=function(e){for(var t=e.calcdata,r=0;r<t.length;r++){var a=t[r],o=a[0].trace;if(!0===o.visible&&n.traceIs(o,"errorBarsOK")){var l=i.getFromId(e,o.xaxis),c=i.getFromId(e,o.yaxis);s(a,o,l,"x"),s(a,o,c,"y")}}}}}),Ca=p({"src/components/errorbars/plot.js"(e,t){var r=v(),n=k(),i=Jt(),a=$t();t.exports=function(e,t,o,s){var l=o.xaxis,c=o.yaxis,u=s&&s.duration>0,h=e._context.staticPlot;t.each((function(t){var p,d=t[0].trace,f=d.error_x||{},m=d.error_y||{};d.ids&&(p=function(e){return e.id});var g=a.hasMarkers(d)&&d.marker.maxdisplayed>0;m.visible||f.visible||(t=[]);var y=r.select(this).selectAll("g.errorbar").data(t,p);if(y.exit().remove(),t.length){f.visible||y.selectAll("path.xerror").remove(),m.visible||y.selectAll("path.yerror").remove(),y.style("opacity",1);var v=y.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(s.duration).style("opacity",1),i.setClipUrl(y,o.layerClipId,e),y.each((function(e){var t=r.select(this),i=function(e,t,r){var i={x:t.c2p(e.x),y:r.c2p(e.y)};return void 0!==e.yh&&(i.yh=r.c2p(e.yh),i.ys=r.c2p(e.ys),n(i.ys)||(i.noYS=!0,i.ys=r.c2p(e.ys,!0))),void 0!==e.xh&&(i.xh=t.c2p(e.xh),i.xs=t.c2p(e.xs),n(i.xs)||(i.noXS=!0,i.xs=t.c2p(e.xs,!0))),i}(e,l,c);if(!g||e.vis){var a,o=t.select("path.yerror");if(m.visible&&n(i.x)&&n(i.yh)&&n(i.ys)){var p=m.width;a="M"+(i.x-p)+","+i.yh+"h"+2*p+"m-"+p+",0V"+i.ys,i.noYS||(a+="m-"+p+",0h"+2*p),o.size()?u&&(o=o.transition().duration(s.duration).ease(s.easing)):o=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("yerror",!0),o.attr("d",a)}else o.remove();var d=t.select("path.xerror");if(f.visible&&n(i.y)&&n(i.xh)&&n(i.xs)){var y=(f.copy_ystyle?m:f).width;a="M"+i.xh+","+(i.y-y)+"v"+2*y+"m0,-"+y+"H"+i.xs,i.noXS||(a+="m0,-"+y+"v"+2*y),d.size()?u&&(d=d.transition().duration(s.duration).ease(s.easing)):d=t.append("path").style("vector-effect",h?"none":"non-scaling-stroke").classed("xerror",!0),d.attr("d",a)}else d.remove()}}))}}))}}}),Pa=p({"src/components/errorbars/style.js"(e,t){var r=v(),n=q();t.exports=function(e){e.each((function(e){var t=e[0].trace,i=t.error_y||{},a=t.error_x||{},o=r.select(this);o.selectAll("path.yerror").style("stroke-width",i.thickness+"px").call(n.stroke,i.color),a.copy_ystyle&&(a=i),o.selectAll("path.xerror").style("stroke-width",a.thickness+"px").call(n.stroke,a.color)}))}}}),La=p({"src/components/errorbars/index.js"(e,t){var r=st(),n=Le().overrideAll,i=Sa(),a={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i)};delete a.error_x.copy_zstyle,delete a.error_y.copy_zstyle,delete a.error_y.copy_ystyle;var o={error_x:r.extendFlat({},i),error_y:r.extendFlat({},i),error_z:r.extendFlat({},i)};delete o.error_x.copy_ystyle,delete o.error_y.copy_ystyle,delete o.error_z.copy_ystyle,delete o.error_z.copy_zstyle,t.exports={moduleType:"component",name:"errorbars",schema:{traces:{scatter:a,bar:a,histogram:a,scatter3d:n(o,"calc","nested"),scattergl:n(a,"calc","nested")}},supplyDefaults:Aa(),calc:Ea(),makeComputeError:Ma(),plot:Ca(),style:Pa(),hoverInfo:function(e,t,r){(t.error_y||{}).visible&&(r.yerr=e.yh-e.y,t.error_y.symmetric||(r.yerrneg=e.y-e.ys)),(t.error_x||{}).visible&&(r.xerr=e.xh-e.x,t.error_x.symmetric||(r.xerrneg=e.x-e.xs))}}}}),Ia=p({"src/components/colorbar/constants.js"(e,t){t.exports={cn:{colorbar:"colorbar",cbbg:"cbbg",cbfill:"cbfill",cbfills:"cbfills",cbline:"cbline",cblines:"cblines",cbaxis:"cbaxis",cbtitleunshift:"cbtitleunshift",cbtitle:"cbtitle",cboutline:"cboutline",crisp:"crisp",jsPlaceholder:"js-placeholder"}}}}),za=p({"src/components/colorbar/draw.js"(e,t){var r=v(),n=O(),i=kt(),a=Ve(),o=nr(),s=hr(),l=st(),c=l.strTranslate,u=R().extendFlat,h=pr(),p=Jt(),d=q(),f=Qt(),m=At(),g=Mt().flipScale,y=wi(),x=ki(),b=Ct(),_=St(),w=_.LINE_SPACING,k=_.FROM_TL,T=_.FROM_BR,S=Ia().cn;t.exports={draw:function(e){var t=e._fullLayout._infolayer.selectAll("g."+S.colorbar).data(function(e){var t,r,n,i,a=e._fullLayout,o=e.calcdata,s=[];function l(e){return u(e,{_fillcolor:null,_line:{color:null,width:null,dash:null},_levels:{start:null,end:null,size:null},_filllevels:null,_fillgradient:null,_zrange:null})}function c(){"function"===typeof i.calc?i.calc(e,n,t):(t._fillgradient=r.reversescale?g(r.colorscale):r.colorscale,t._zrange=[r[i.min],r[i.max]])}for(var h=0;h<o.length;h++){var p=o[h];if((n=p[0].trace)._module){var d=n._module.colorbar;if(!0===n.visible&&d)for(var f=Array.isArray(d),m=f?d:[d],y=0;y<m.length;y++){var v=(i=m[y]).container;(r=v?n[v]:n)&&r.showscale&&((t=l(r.colorbar))._id="cb"+n.uid+(f&&v?"-"+v:""),t._traceIndex=n.index,t._propPrefix=(v?v+".":"")+"colorbar.",t._meta=n._meta,c(),s.push(t))}}}for(var x in a._colorAxes)if((r=a[x]).showscale){var b=a._colorAxes[x];(t=l(r.colorbar))._id="cb"+x,t._propPrefix=x+".colorbar.",t._meta=a._meta,i={min:"cmin",max:"cmax"},"heatmap"!==b[0]&&(n=b[1],i.calc=n._module.colorbar.calc),c(),s.push(t)}return s}(e),(function(e){return e._id}));t.enter().append("g").attr("class",(function(e){return e._id})).classed(S.colorbar,!0),t.each((function(t){var g=r.select(this);l.ensureSingle(g,"rect",S.cbbg),l.ensureSingle(g,"g",S.cbfills),l.ensureSingle(g,"g",S.cblines),l.ensureSingle(g,"g",S.cbaxis,(function(e){e.classed(S.crisp,!0)})),l.ensureSingle(g,"g",S.cbtitleunshift,(function(e){e.append("g").classed(S.cbtitle,!0)})),l.ensureSingle(g,"rect",S.cboutline);var v=function(e,t,a){var s="v"===t.orientation,h=t.len,g=t.lenmode,v=t.thickness,_=t.thicknessmode,A=t.outlinewidth,M=t.borderwidth,E=t.bgcolor,C=t.xanchor,P=t.yanchor,L=t.xpad,I=t.ypad,z=t.x,O=s?t.y:1-t.y,R="paper"===t.yref,D="paper"===t.xref,j=a._fullLayout,F=j._size,B=t._fillcolor,N=t._line,U=t.title,V=U.side,q=t._zrange||r.extent(("function"===typeof B?B:N.color).domain()),H="function"===typeof N.color?N.color:function(){return N.color},G="function"===typeof B?B:function(){return B},W=t._levels,$=function(e,t,r){var n,i,a=t._levels,o=[],s=[],l=a.end+a.size/100,c=a.size,u=1.001*r[0]-.001*r[1],h=1.001*r[1]-.001*r[0];for(i=0;i<1e5&&(n=a.start+i*c,!(c>0?n>=l:n<=l));i++)n>u&&n<h&&o.push(n);if(t._fillgradient)s=[0];else if("function"===typeof t._fillcolor){var p=t._filllevels;if(p)for(l=p.end+p.size/100,c=p.size,i=0;i<1e5&&(n=p.start+i*c,!(c>0?n>=l:n<=l));i++)n>r[0]&&n<r[1]&&s.push(n);else(s=o.map((function(e){return e-a.size/2}))).push(s[s.length-1]+a.size)}else t._fillcolor&&"string"===typeof t._fillcolor&&(s=[0]);return a.size<0&&(o.reverse(),s.reverse()),{line:o,fill:s}}(0,t,q),Z=$.fill,X=$.line,Y=Math.round(v*("fraction"===_?s?F.w:F.h:1)),K=Y/(s?F.w:F.h),J=Math.round(h*("fraction"===g?s?F.h:F.w:1)),Q=J/(s?F.h:F.w),ee=D?F.w:a._fullLayout.width,te=R?F.h:a._fullLayout.height,re=Math.round(s?z*ee+L:O*te+I),ne={center:.5,right:1}[C]||0,ie={top:1,middle:.5}[P]||0,ae=s?z-ne*K:O-ie*K,oe=s?O-ie*Q:z-ne*Q,se=Math.round(s?te*(1-oe):ee*oe);t._lenFrac=Q,t._thickFrac=K,t._uFrac=ae,t._vFrac=oe;var le=t._axis=function(e,t,r){var n=e._fullLayout,i="v"===t.orientation,a={type:"linear",range:r,tickmode:t.tickmode,nticks:t.nticks,tick0:t.tick0,dtick:t.dtick,tickvals:t.tickvals,ticktext:t.ticktext,ticks:t.ticks,ticklen:t.ticklen,tickwidth:t.tickwidth,tickcolor:t.tickcolor,showticklabels:t.showticklabels,labelalias:t.labelalias,ticklabelposition:t.ticklabelposition,ticklabeloverflow:t.ticklabeloverflow,ticklabelstep:t.ticklabelstep,tickfont:t.tickfont,tickangle:t.tickangle,tickformat:t.tickformat,exponentformat:t.exponentformat,minexponent:t.minexponent,separatethousands:t.separatethousands,showexponent:t.showexponent,showtickprefix:t.showtickprefix,tickprefix:t.tickprefix,showticksuffix:t.showticksuffix,ticksuffix:t.ticksuffix,title:t.title,showline:!0,anchor:"free",side:i?"right":"bottom",position:1},o=i?"y":"x",s={type:"linear",_id:o+t._id},c={letter:o,font:n.font,noAutotickangles:"y"===o,noHover:!0,noTickson:!0,noTicklabelmode:!0,noInsideRange:!0,calendar:n.calendar};function u(e,t){return l.coerce(a,s,b,e,t)}return y(a,s,u,c,n),x(a,s,u,c),s}(a,t,q);le.position=K+(s?z+L/F.w:O+I/F.h);var ce=-1!==["top","bottom"].indexOf(V);if(s&&ce&&(le.title.side=V,le.titlex=z+L/F.w,le.titley=oe+("top"===U.side?Q-I/F.h:I/F.h)),s||ce||(le.title.side=V,le.titley=O+I/F.h,le.titlex=oe+L/F.w),N.color&&"auto"===t.tickmode){le.tickmode="linear",le.tick0=W.start;var ue=W.size,he=l.constrain(J/50,4,15)+1,pe=(q[1]-q[0])/((t.nticks||he)*ue);if(pe>1){var de=Math.pow(10,Math.floor(Math.log(pe)/Math.LN10));ue*=de*l.roundUp(pe/de,[2,5,10]),(Math.abs(W.start)/W.size+1e-6)%1<2e-6&&(le.tick0=0)}le.dtick=ue}le.domain=s?[oe+I/F.h,oe+Q-I/F.h]:[oe+L/F.w,oe+Q-L/F.w],le.setScale(),e.attr("transform",c(Math.round(F.l),Math.round(F.t)));var fe,me=e.select("."+S.cbtitleunshift).attr("transform",c(-Math.round(F.l),-Math.round(F.t))),ge=le.ticklabelposition,ye=le.title.font.size,ve=e.select("."+S.cbaxis),xe=0,be=0;function _e(r,n){var i={propContainer:le,propName:t._propPrefix+"title",traceIndex:t._traceIndex,_meta:t._meta,placeholder:j._dfltTitle.colorbar,containerGroup:e.select("."+S.cbtitle)},o="h"===r.charAt(0)?r.substr(1):"h"+r;e.selectAll("."+o+",."+o+"-math-group").remove(),f.draw(a,r,u(i,n||{}))}function we(){var e,t;(s&&ce||!s&&!ce)&&("top"===V&&(e=L+F.l+ee*z,t=I+F.t+te*(1-oe-Q)+3+.75*ye),"bottom"===V&&(e=L+F.l+ee*z,t=I+F.t+te*(1-oe)-3-.25*ye),"right"===V&&(t=I+F.t+te*O+3+.75*ye,e=L+F.l+ee*oe),_e(le._id+"title",{attributes:{x:e,y:t,"text-anchor":s?"start":"middle"}}))}function ke(){if(s&&!ce||!s&&ce){var e,n,i=le.position||0,o=le._offset+le._length/2;if("right"===V)n=o,e=F.l+ee*i+10+ye*(le.showticklabels?1:.5);else if(e=o,"bottom"===V&&(n=F.t+te*i+10+(-1===ge.indexOf("inside")?le.tickfont.size:0)+("intside"!==le.ticks&&t.ticklen||0)),"top"===V){var l=U.text.split("<br>").length;n=F.t+te*i+10-Y-w*ye*l}_e((s?"h":"v")+le._id+"title",{avoid:{selection:r.select(a).selectAll("g."+le._id+"tick"),side:V,offsetTop:s?0:F.t,offsetLeft:s?F.l:0,maxShift:s?j.width:j.height},attributes:{x:e,y:n,"text-anchor":"middle"},transform:{rotate:s?-90:0,offset:0}})}}function Te(){if(!s&&!ce||s&&ce){var i,u=e.select("."+S.cbtitle),h=u.select("text"),d=[-A/2,A/2],f=u.select(".h"+le._id+"title-math-group").node(),g=15.6;if(h.node()&&(g=parseInt(h.node().style.fontSize,10)*w),f?(i=p.bBox(f),be=i.width,(xe=i.height)>g&&(d[1]-=(xe-g)/2)):h.node()&&!h.classed(S.jsPlaceholder)&&(i=p.bBox(h.node()),be=i.width,xe=i.height),s){if(xe){if(xe+=5,"top"===V)le.domain[1]-=xe/F.h,d[1]*=-1;else{le.domain[0]+=xe/F.h;var y=m.lineCount(h);d[1]+=(1-y)*g}u.attr("transform",c(d[0],d[1])),le.setScale()}}else be&&("right"===V&&(le.domain[0]+=(be+ye/2)/F.w),u.attr("transform",c(d[0],d[1])),le.setScale())}e.selectAll("."+S.cbfills+",."+S.cblines).attr("transform",s?c(0,Math.round(F.h*(1-le.domain[1]))):c(Math.round(F.w*le.domain[0]),0)),ve.attr("transform",s?c(0,Math.round(-F.t)):c(Math.round(-F.l),0));var v=e.select("."+S.cbfills).selectAll("rect."+S.cbfill).attr("style","").data(Z);v.enter().append("rect").classed(S.cbfill,!0).attr("style",""),v.exit().remove();var x=q.map(le.c2p).map(Math.round).sort((function(e,t){return e-t}));v.each((function(e,i){var o=[0===i?q[0]:(Z[i]+Z[i-1])/2,i===Z.length-1?q[1]:(Z[i]+Z[i+1])/2].map(le.c2p).map(Math.round);s&&(o[1]=l.constrain(o[1]+(o[1]>o[0])?1:-1,x[0],x[1]));var c=r.select(this).attr(s?"x":"y",re).attr(s?"y":"x",r.min(o)).attr(s?"width":"height",Math.max(Y,2)).attr(s?"height":"width",Math.max(r.max(o)-r.min(o),2));if(t._fillgradient)p.gradient(c,a,t._id,s?"vertical":"horizontalreversed",t._fillgradient,"fill");else{var u=G(e).replace("e-","");c.attr("fill",n(u).toHexString())}}));var b=e.select("."+S.cblines).selectAll("path."+S.cbline).data(N.color&&N.width?X:[]);b.enter().append("path").classed(S.cbline,!0),b.exit().remove(),b.each((function(e){var t=re,n=Math.round(le.c2p(e))+N.width/2%1;r.select(this).attr("d","M"+(s?t+","+n:n+","+t)+(s?"h":"v")+Y).call(p.lineGroupStyle,N.width,H(e),N.dash)})),ve.selectAll("g."+le._id+"tick,path").remove();var _=re+Y+(A||0)/2-("outside"===t.ticks?1:0),k=o.calcTicks(le),T=o.getTickSigns(le)[2];return o.drawTicks(a,le,{vals:"inside"===le.ticks?o.clipEnds(le,k):k,layer:ve,path:o.makeTickPath(le,_,T),transFn:o.makeTransTickFn(le)}),o.drawLabels(a,le,{vals:k,layer:ve,transFn:o.makeTransTickLabelFn(le),labelFns:o.makeLabelFns(le,_)})}function Se(){var r,o=Y+A/2;-1===ge.indexOf("inside")&&(r=p.bBox(ve.node()),o+=s?r.width:r.height),fe=me.select("text");var l=0,u=s&&"top"===V,f=!s&&"right"===V,m=0;if(fe.node()&&!fe.classed(S.jsPlaceholder)){var y,x=me.select(".h"+le._id+"title-math-group").node();x&&(s&&ce||!s&&!ce)?(l=(r=p.bBox(x)).width,y=r.height):(l=(r=p.bBox(me.node())).right-F.l-(s?re:se),y=r.bottom-F.t-(s?se:re),s||"top"!==V||(o+=r.height,m=r.height)),f&&(fe.attr("transform",c(l/2+ye/2,0)),l*=2),o=Math.max(o,s?l:y)}var b=2*(s?L:I)+o+M+A/2,w=0;!s&&U.text&&"bottom"===P&&O<=0&&(b+=w=b/2,m+=w),j._hColorbarMoveTitle=w,j._hColorbarMoveCBTitle=m;var B=M+A,N=(s?re:se)-B/2-(s?L:0),q=(s?se:re)-(s?J:I+m-w);e.select("."+S.cbbg).attr("x",N).attr("y",q).attr(s?"width":"height",Math.max(b-w,2)).attr(s?"height":"width",Math.max(J+B,2)).call(d.fill,E).call(d.stroke,t.bordercolor).style("stroke-width",M);var H=f?Math.max(l-10,0):0;e.selectAll("."+S.cboutline).attr("x",(s?re:se+L)+H).attr("y",(s?se+I-J:re)+(u?xe:0)).attr(s?"width":"height",Math.max(Y,2)).attr(s?"height":"width",Math.max(J-(s?2*I+xe:2*L+H),2)).call(d.stroke,t.outlinecolor).style({fill:"none","stroke-width":A});var G=s?ne*b:0,W=s?0:(1-ie)*b-m;if(G=D?F.l-G:-G,W=R?F.t-W:-W,e.attr("transform",c(G,W)),!s&&(M||n(E).getAlpha()&&!n.equals(j.paper_bgcolor,E))){var $=ve.selectAll("text"),Z=$[0].length,X=e.select("."+S.cbbg).node(),K=p.bBox(X),Q=p.getTranslate(e),ee=2;$.each((function(e,t){var r=0,n=Z-1;if(t===r||t===n){var i,a=p.bBox(this),o=p.getTranslate(this);if(t===n){var s=a.right+o.x;(i=K.right+Q.x+se-M-ee+z-s)>0&&(i=0)}else if(t===r){var l=a.left+o.x;(i=K.left+Q.x+se+M+ee-l)<0&&(i=0)}i&&(Z<3?this.setAttribute("transform","translate("+i+",0) "+this.getAttribute("transform")):this.setAttribute("visibility","hidden"))}}))}var te={},ae=k[C],oe=T[C],ue=k[P],he=T[P],pe=b-Y;s?("pixels"===g?(te.y=O,te.t=J*ue,te.b=J*he):(te.t=te.b=0,te.yt=O+h*ue,te.yb=O-h*he),"pixels"===_?(te.x=z,te.l=b*ae,te.r=b*oe):(te.l=pe*ae,te.r=pe*oe,te.xl=z-v*ae,te.xr=z+v*oe)):("pixels"===g?(te.x=z,te.l=J*ae,te.r=J*oe):(te.l=te.r=0,te.xl=z+h*ae,te.xr=z-h*oe),"pixels"===_?(te.y=1-O,te.t=b*ue,te.b=b*he):(te.t=pe*ue,te.b=pe*he,te.yt=O-v*ue,te.yb=O+v*he));var de=t.y<.5?"b":"t",be=t.x<.5?"l":"r";a._fullLayout._reservedMargin[t._id]={};var _e={r:j.width-N-G,l:N+te.r,b:j.height-q-W,t:q+te.b};D&&R?i.autoMargin(a,t._id,te):D?a._fullLayout._reservedMargin[t._id][de]=_e[de]:R||s?a._fullLayout._reservedMargin[t._id][be]=_e[be]:a._fullLayout._reservedMargin[t._id][de]=_e[de]}return l.syncOrAsync([i.previousPromises,we,Te,ke,i.previousPromises,Se],a)}(g,t,e);v&&v.then&&(e._promises||[]).push(v),e._context.edits.colorbarPosition&&function(e,t,r){var n,i,o,l="v"===t.orientation,u=r._fullLayout,p=u._size;s.init({element:e.node(),gd:r,prepFn:function(){n=e.attr("transform"),h(e)},moveFn:function(r,a){e.attr("transform",n+c(r,a)),i=s.align((l?t._uFrac:t._vFrac)+r/p.w,l?t._thickFrac:t._lenFrac,0,1,t.xanchor),o=s.align((l?t._vFrac:1-t._uFrac)-a/p.h,l?t._lenFrac:t._thickFrac,0,1,t.yanchor);var u=s.getCursor(i,o,t.xanchor,t.yanchor);h(e,u)},doneFn:function(){if(h(e),void 0!==i&&void 0!==o){var n={};n[t._propPrefix+"x"]=i,n[t._propPrefix+"y"]=o,void 0!==t._traceIndex?a.call("_guiRestyle",r,n,t._traceIndex):a.call("_guiRelayout",r,n)}}})}(g,t,e)})),t.exit().each((function(t){i.autoMargin(e,t._id)})).remove(),t.order()}}}}),Oa=p({"src/components/colorbar/index.js"(e,t){t.exports={moduleType:"component",name:"colorbar",attributes:Pt(),supplyDefaults:Ut(),draw:za().draw,hasColorbar:zt()}}}),Ra=p({"src/components/legend/index.js"(e,t){t.exports={moduleType:"component",name:"legend",layoutAttributes:fr(),supplyLayoutDefaults:gr(),draw:Tr(),style:kr()}}}),Da=p({"src/locale-en.js"(e,t){t.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],periods:["AM","PM"],dateTime:"%a %b %e %X %Y",date:"%d/%m/%Y",time:"%H:%M:%S",decimal:".",thousands:",",grouping:[3],currency:["$",""],year:"%Y",month:"%b %Y",dayMonth:"%b %-d",dayMonthYear:"%b %-d, %Y"}}}}),ja=p({"src/locale-en-us.js"(e,t){t.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}}}),Fa=p({"src/snapshot/cloneplot.js"(e,t){var r=Ve(),n=st(),i=n.extendFlat,a=n.extendDeep;function o(e){var t;switch(e){case"themes__thumb":t={autosize:!0,width:150,height:150,title:{text:""},showlegend:!1,margin:{l:5,r:5,t:5,b:5,pad:0},annotations:[]};break;case"thumbnail":t={title:{text:""},hidesources:!0,showlegend:!1,borderwidth:0,bordercolor:"",margin:{l:1,r:1,t:1,b:1,pad:0},annotations:[]};break;default:t={}}return t}t.exports=function(e,t){var n,s,l=e.data,c=e.layout,u=a([],l),h=a({},c,o(t.tileClass)),p=e._context||{};if(t.width&&(h.width=t.width),t.height&&(h.height=t.height),"thumbnail"===t.tileClass||"themes__thumb"===t.tileClass){h.annotations=[];var d=Object.keys(h);for(n=0;n<d.length;n++)s=d[n],["xaxis","yaxis","zaxis"].indexOf(s.slice(0,5))>-1&&(h[d[n]].title={text:""});for(n=0;n<u.length;n++){var f=u[n];f.showscale=!1,f.marker&&(f.marker.showscale=!1),r.traceIs(f,"pie-like")&&(f.textposition="none")}}if(Array.isArray(t.annotations))for(n=0;n<t.annotations.length;n++)h.annotations.push(t.annotations[n]);var m=Object.keys(h).filter((function(e){return e.match(/^scene\d*$/)}));if(m.length){var g={};for("thumbnail"===t.tileClass&&(g={title:{text:""},showaxeslabels:!1,showticklabels:!1,linetickenable:!1}),n=0;n<m.length;n++){var y=h[m[n]];y.xaxis||(y.xaxis={}),y.yaxis||(y.yaxis={}),y.zaxis||(y.zaxis={}),i(y.xaxis,g),i(y.yaxis,g),i(y.zaxis,g),y._scene=null}}var v=document.createElement("div");t.tileClass&&(v.className=t.tileClass);var x={gd:v,td:v,layout:h,data:u,config:{staticPlot:void 0===t.staticPlot||t.staticPlot,plotGlPixelRatio:void 0===t.plotGlPixelRatio?2:t.plotGlPixelRatio,displaylogo:t.displaylogo||!1,showLink:t.showLink||!1,showTips:t.showTips||!1,mapboxAccessToken:p.mapboxAccessToken}};return"transparent"!==t.setBackground&&(x.config.setBackground=t.setBackground||"opaque"),x.gd.defaultLayout=o(t.tileClass),x}}}),Ba=p({"src/snapshot/toimage.js"(e,t){var r=ht().EventEmitter,n=Ve(),i=st(),a=On(),o=Fa(),s=Rn(),l=Dn();t.exports=function(e,t){var c=new r,u=o(e,{format:"png"}),h=u.gd;h.style.position="absolute",h.style.left="-5000px",document.body.appendChild(h);var p=a.getRedrawFunc(h);return n.call("_doPlot",h,u.data,u.layout,u.config).then(p).then((function(){var e=a.getDelay(h._fullLayout);setTimeout((function(){var e=s(h),r=document.createElement("canvas");r.id=i.randstr(),(c=l({format:t.format,width:h._fullLayout.width,height:h._fullLayout.height,canvas:r,emitter:c,svg:e})).clean=function(){h&&document.body.removeChild(h)}}),e)})).catch((function(e){c.emit("error",e)})),c}}}),Na=p({"src/snapshot/index.js"(e,t){var r=On(),n={getDelay:r.getDelay,getRedrawFunc:r.getRedrawFunc,clone:Fa(),toSVG:Rn(),svgToImg:Dn(),toImage:Ba(),downloadImage:Nn()};t.exports=n}}),Ua=p({"src/core.js"(e){e.version=g().version,y(),lt();var t,r,n=Ve(),i=e.register=n.register,a=Vn(),o=Object.keys(a);for(r=0;r<o.length;r++)"_"!==(t=o[r]).charAt(0)&&(e[t]=a[t]),i({moduleType:"apiMethod",name:t,fn:a[t]});i(Mi()),i([Ri(),Ui(),Mn(),Wi(),Ki(),na(),la(),ga(),wa(),Ta(),La(),Wt(),Oa(),Ra(),zr(),Qr()]),i([Da(),ja()]),window.PlotlyLocales&&Array.isArray(window.PlotlyLocales)&&(i(window.PlotlyLocales),delete window.PlotlyLocales),e.Icons=Dr();var s=zr(),l=kt();e.Plots={resize:l.resize,graphJson:l.graphJson,sendDataToCloud:l.sendDataToCloud},e.Fx={hover:s.hover,unhover:s.unhover,loneHover:s.loneHover,loneUnhover:s.loneUnhover},e.Snapshot=Na(),e.PlotSchema=mt()}}),Va=p({"lib/core.js"(e,t){t.exports=Ua()}}),qa=p({"src/traces/bar/constants.js"(e,t){t.exports={TEXTPAD:3,eventDataKeys:["value","label"]}}}),Ha=p({"src/traces/bar/attributes.js"(e,t){var r=wn(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=Oe().texttemplateAttrs,o=Lt(),s=D(),l=qa(),c=Ie().pattern,u=R().extendFlat,h=s({editType:"calc",arrayOk:!0,colorEditType:"style"}),p=u({},r.marker.line.width,{dflt:0}),d=u({width:p,editType:"calc"},o("marker.line")),f=u({line:d,editType:"calc"},o("marker"),{opacity:{valType:"number",arrayOk:!0,dflt:1,min:0,max:1,editType:"style"},pattern:c,cornerradius:{valType:"any",editType:"calc"}});t.exports={x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),text:r.text,texttemplate:a({editType:"plot"},{keys:l.eventDataKeys}),hovertext:r.hovertext,hovertemplate:i({},{keys:l.eventDataKeys}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},insidetextanchor:{valType:"enumerated",values:["end","middle","start"],dflt:"end",editType:"plot"},textangle:{valType:"angle",dflt:"auto",editType:"plot"},textfont:u({},h,{}),insidetextfont:u({},h,{}),outsidetextfont:u({},h,{}),constraintext:{valType:"enumerated",values:["inside","outside","both","none"],dflt:"both",editType:"calc"},cliponaxis:u({},r.cliponaxis,{}),orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},base:{valType:"any",dflt:null,arrayOk:!0,editType:"calc"},offset:{valType:"number",dflt:null,arrayOk:!0,editType:"calc"},width:{valType:"number",dflt:null,min:0,arrayOk:!0,editType:"calc"},marker:f,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:{marker:{opacity:r.selected.marker.opacity,color:r.selected.marker.color,editType:"style"},textfont:r.selected.textfont,editType:"style"},unselected:{marker:{opacity:r.unselected.marker.opacity,color:r.unselected.marker.color,editType:"style"},textfont:r.unselected.textfont,editType:"style"},zorder:r.zorder}}}),Ga=p({"src/traces/bar/layout_attributes.js"(e,t){t.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"}}}}),Wa=p({"src/traces/bar/style_defaults.js"(e,t){var r=q(),n=Mt().hasColorscale,i=Vt(),a=st().coercePattern;t.exports=function(e,t,o,s,l){var c=o("marker.color",s),u=n(e,"marker");u&&i(e,t,l,o,{prefix:"marker.",cLetter:"c"}),o("marker.line.color",r.defaultLine),n(e,"marker.line")&&i(e,t,l,o,{prefix:"marker.line.",cLetter:"c"}),o("marker.line.width"),o("marker.opacity"),a(o,"marker.pattern",c,u),o("selected.marker.color"),o("unselected.marker.color")}}}),$a=p({"src/traces/bar/defaults.js"(e,t){var r=k(),n=st(),i=q(),a=Ve(),o=qn(),s=Hn(),l=Wa(),c=Jn(),u=Ha(),h=n.coerceFont;function p(e){if(r(e)){if((e=+e)>=0)return e}else if("string"===typeof e&&"%"===(e=e.trim()).slice(-1)&&r(e.slice(0,-1))&&(e=+e.slice(0,-1))>=0)return e+"%"}function d(e,t,r,i,a,o){var s=!(!1===(o=o||{}).moduleHasSelected),l=!(!1===o.moduleHasUnselected),c=!(!1===o.moduleHasConstrain),u=!(!1===o.moduleHasCliponaxis),p=!(!1===o.moduleHasTextangle),d=!(!1===o.moduleHasInsideanchor),f=!!o.hasPathbar,m=Array.isArray(a)||"auto"===a,g=m||"inside"===a,y=m||"outside"===a;if(g||y){var v=h(i,"textfont",r.font),x=n.extendFlat({},v),b=!(e.textfont&&e.textfont.color);if(b&&delete x.color,h(i,"insidetextfont",x),f){var _=n.extendFlat({},v);b&&delete _.color,h(i,"pathbar.textfont",_)}y&&h(i,"outsidetextfont",v),s&&i("selected.textfont.color"),l&&i("unselected.textfont.color"),c&&i("constraintext"),u&&i("cliponaxis"),p&&i("textangle"),i("texttemplate")}g&&d&&i("insidetextanchor")}t.exports={supplyDefaults:function(e,t,r,c){function h(r,i){return n.coerce(e,t,u,r,i)}if(o(e,t,c,h)){s(e,t,c,h),h("xhoverformat"),h("yhoverformat"),h("zorder"),h("orientation",t.x&&!t.y?"h":"v"),h("base"),h("offset"),h("width"),h("text"),h("hovertext"),h("hovertemplate");var p=h("textposition");d(e,0,c,h,p,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),l(e,t,h,r,c);var f=(t.marker.line||{}).color,m=a.getComponentMethod("errorbars","supplyDefaults");m(e,t,f||i.defaultLine,{axis:"y"}),m(e,t,f||i.defaultLine,{axis:"x",inherit:"y"}),n.coerceSelectionMarkerOpacity(t,h)}else t.visible=!1},crossTraceDefaults:function(e,t){var r,i;function a(e,t){return n.coerce(i._input,i,u,e,t)}for(var o=0;o<e.length;o++)if("bar"===(i=e[o]).type){r=i._input;var s=a("marker.cornerradius",t.barcornerradius);i.marker&&(i.marker.cornerradius=p(s)),c(r,i,t,a,t.barmode)}},handleText:d,validateCornerradius:p}}}),Za=p({"src/traces/bar/layout_defaults.js"(e,t){var r=Ve(),n=nr(),i=st(),a=Ga(),o=$a().validateCornerradius;t.exports=function(e,t,s){function l(r,n){return i.coerce(e,t,a,r,n)}for(var c=!1,u=!1,h=!1,p={},d=l("barmode"),f="group"===d,m=0;m<s.length;m++){var g=s[m];if(r.traceIs(g,"bar")&&g.visible){c=!0;var y=g.xaxis+g.yaxis;f?(p[y]&&(h=!0),p[y]=!0):(y+=g._input.offsetgroup,p.length>0&&!p[y]&&(h=!0),p[y]=!0),g.visible&&"histogram"===g.type&&"category"!==n.getFromId({_fullLayout:t},g["v"===g.orientation?"xaxis":"yaxis"]).type&&(u=!0)}}if(c){"overlay"!==d&&l("barnorm"),l("bargap",u&&!h?0:.2),l("bargroupgap");var v=l("barcornerradius");t.barcornerradius=o(v)}else delete t.barmode}}}),Xa=p({"src/traces/bar/arrays_to_calcdata.js"(e,t){var r=st();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.hovertext,e,"htx");var i=t.marker;if(i){r.mergeArray(i.opacity,e,"mo",!0),r.mergeArray(i.color,e,"mc");var a=i.line;a&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"))}}}}),Ya=p({"src/traces/bar/calc.js"(e,t){var r=nr(),n=ti(),i=Mt().hasColorscale,a=Gt(),o=Xa(),s=ii();t.exports=function(e,t){var l,c,u,h,p,d,f=r.getFromId(e,t.xaxis||"x"),m=r.getFromId(e,t.yaxis||"y"),g={msUTC:!(!t.base&&0!==t.base)};"h"===t.orientation?(l=f.makeCalcdata(t,"x",g),u=m.makeCalcdata(t,"y"),h=n(t,m,"y",u),p=!!t.yperiodalignment,d="y"):(l=m.makeCalcdata(t,"y",g),u=f.makeCalcdata(t,"x"),h=n(t,f,"x",u),p=!!t.xperiodalignment,d="x"),c=h.vals;for(var y=Math.min(c.length,l.length),v=new Array(y),x=0;x<y;x++)v[x]={p:c[x],s:l[x]},p&&(v[x].orig_p=u[x],v[x][d+"End"]=h.ends[x],v[x][d+"Start"]=h.starts[x]),t.ids&&(v[x].id=String(t.ids[x]));return i(t,"marker")&&a(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),i(t,"marker.line")&&a(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),o(v,t),s(v,t),v}}}),Ka=p({"src/traces/bar/uniform_text.js"(e,t){var r=v(),n=st();function i(e){return"_"+e+"Text_minsize"}t.exports={recordMinTextSize:function(e,t,r){if(r.uniformtext.mode){var n=i(e),a=r.uniformtext.minsize,o=t.scale*t.fontSize;t.hide=o<a,r[n]=r[n]||1/0,t.hide||(r[n]=Math.min(r[n],Math.max(o,a)))}},clearMinTextSize:function(e,t){t[i(e)]=void 0},resizeText:function(e,t,i){var a=e._fullLayout,o=a["_"+i+"Text_minsize"];if(o){var s,l="hide"===a.uniformtext.mode;switch(i){case"funnelarea":case"pie":case"sunburst":s="g.slice";break;case"treemap":case"icicle":s="g.slice, g.pathbar";break;default:s="g.points > g.point"}t.selectAll(s).each((function(e){var t=e.transform;if(t){t.scale=l&&t.hide?0:o/t.fontSize;var i=r.select(this).select("text");n.setTransormAndDisplay(i,t)}}))}}}}}),Ja=p({"src/traces/bar/helpers.js"(e){var t=k(),r=O(),n=st().isArrayOrTypedArray;e.coerceString=function(e,t,r){if("string"===typeof t){if(t||!e.noBlank)return t}else if(("number"===typeof t||!0===t)&&!e.strict)return String(t);return void 0!==r?r:e.dflt},e.coerceNumber=function(e,r,n){if(t(r)){r=+r;var i=e.min,a=e.max;if(!(void 0!==i&&r<i||void 0!==a&&r>a))return r}return void 0!==n?n:e.dflt},e.coerceColor=function(e,t,n){return r(t).isValid()?t:void 0!==n?n:e.dflt},e.coerceEnumerated=function(e,t,r){return e.coerceNumber&&(t=+t),-1!==e.values.indexOf(t)?t:void 0!==r?r:e.dflt},e.getValue=function(e,t){var r;return n(e)?t<e.length&&(r=e[t]):r=e,r},e.getLineWidth=function(e,t){return 0<t.mlw?t.mlw:n(e.marker.line.width)?0:e.marker.line.width}}}),Qa=p({"src/traces/bar/style.js"(e,t){var r=v(),n=q(),i=Jt(),a=st(),o=Ve(),s=Ka().resizeText,l=Ha(),c=l.textfont,u=l.insidetextfont,h=l.outsidetextfont,p=Ja();function d(e,t,r){i.pointStyle(e.selectAll("path"),t,r),f(e,t,r)}function f(e,t,n){e.selectAll("text").each((function(e){var o=r.select(this),s=a.ensureUniformFontSize(n,m(o,e,t,n));i.font(o,s)}))}function m(e,t,r,n){var i=n._fullLayout.font,a=r.textfont;if(e.classed("bartext-inside")){var o=_(t,r);a=y(r,t.i,i,o)}else e.classed("bartext-outside")&&(a=x(r,t.i,i));return a}function g(e,t,r){return b(c,e.textfont,t,r)}function y(e,t,r,i){var a=g(e,t,r);return(void 0===e._input.textfont||void 0===e._input.textfont.color||Array.isArray(e.textfont.color)&&void 0===e.textfont.color[t])&&(a={color:n.contrast(i),family:a.family,size:a.size,weight:a.weight,style:a.style,variant:a.variant,textcase:a.textcase,lineposition:a.lineposition,shadow:a.shadow}),b(u,e.insidetextfont,t,a)}function x(e,t,r){var n=g(e,t,r);return b(h,e.outsidetextfont,t,n)}function b(e,t,r,n){t=t||{};var i=p.getValue(t.family,r),a=p.getValue(t.size,r),o=p.getValue(t.color,r),s=p.getValue(t.weight,r),l=p.getValue(t.style,r),c=p.getValue(t.variant,r),u=p.getValue(t.textcase,r),h=p.getValue(t.lineposition,r),d=p.getValue(t.shadow,r);return{family:p.coerceString(e.family,i,n.family),size:p.coerceNumber(e.size,a,n.size),color:p.coerceColor(e.color,o,n.color),weight:p.coerceString(e.weight,s,n.weight),style:p.coerceString(e.style,l,n.style),variant:p.coerceString(e.variant,c,n.variant),textcase:p.coerceString(e.variant,u,n.textcase),lineposition:p.coerceString(e.variant,h,n.lineposition),shadow:p.coerceString(e.variant,d,n.shadow)}}function _(e,t){return"waterfall"===t.type?t[e.dir].marker.color:e.mcc||e.mc||t.marker.color}t.exports={style:function(e){var t=r.select(e).selectAll('g[class^="barlayer"]').selectAll("g.trace");s(e,t,"bar");var n=t.size(),i=e._fullLayout;t.style("opacity",(function(e){return e[0].trace.opacity})).each((function(e){("stack"===i.barmode&&n>1||0===i.bargap&&0===i.bargroupgap&&!e[0].trace.marker.line.width)&&r.select(this).attr("shape-rendering","crispEdges")})),t.selectAll("g.points").each((function(t){d(r.select(this),t[0].trace,e)})),o.getComponentMethod("errorbars","style")(t)},styleTextPoints:f,styleOnSelect:function(e,t,n){var s=t[0].trace;s.selectedpoints?function(e,t,n){i.selectedPointStyle(e.selectAll("path"),t),function(e,t,n){e.each((function(e){var o,s=r.select(this);if(e.selected){o=a.ensureUniformFontSize(n,m(s,e,t,n));var l=t.selected.textfont&&t.selected.textfont.color;l&&(o.color=l),i.font(s,o)}else i.selectedTextStyle(s,t)}))}(e.selectAll("text"),t,n)}(n,s,e):(d(n,s,e),o.getComponentMethod("errorbars","style")(n))},getInsideTextFont:y,getOutsideTextFont:x,getBarColor:_,resizeText:s}}}),eo=p({"src/traces/bar/plot.js"(e,t){var r=v(),n=k(),i=st(),a=At(),o=q(),s=Jt(),l=Ve(),c=nr().tickText,u=Ka(),h=u.recordMinTextSize,p=u.clearMinTextSize,d=Qa(),f=Ja(),m=qa(),g=Ha(),y=g.text,x=g.textposition,b=Xt().appendArrayPointValue,_=m.TEXTPAD;function w(e){return e.id}function T(e){return(e>0)-(e<0)}function S(e,t){return e<t?1:-1}function A(e,t,r,n){var i;return!t.uniformtext.mode&&M(r)?(n&&(i=n()),e.transition().duration(r.duration).ease(r.easing).each("end",(function(){i&&i()})).each("interrupt",(function(){i&&i()}))):e}function M(e){return e&&e.duration>0}function E(e,t,r,n,i){return!(e<0||t<0)&&(r<=e&&n<=t||r<=t&&n<=e||(i?e>=r*(t/n):t>=n*(e/r)))}function C(e){return"auto"===e?0:e}function P(e,t){var r=Math.PI/180*t,n=Math.abs(Math.sin(r)),i=Math.abs(Math.cos(r));return{x:e.width*i+e.height*n,y:e.width*n+e.height*i}}function L(e,t,r,n,i,a){var o=!!a.isHorizontal,s=!!a.constrained,l=a.angle||0,c=a.anchor,u="end"===c,h="start"===c,p=((a.leftToRight||0)+1)/2,d=1-p,f=a.hasB,m=a.r,g=a.overhead,y=i.width,v=i.height,x=Math.abs(t-e),b=Math.abs(n-r),w=x>2*_&&b>2*_?_:0;x-=2*w,b-=2*w;var k=C(l);"auto"!==l||y<=x&&v<=b||!(y>x||v>b)||(y>b||v>x)&&y<v===x<b||(k+=90);var T,A,M=P(i,k);if(m&&m-g>_){var E=function(e,t,r,n,i,a,o,s,l){var c,u,h,p,d,f=Math.max(0,Math.abs(t-e)-2*_),m=Math.max(0,Math.abs(n-r)-2*_),g=a-_,y=o?g-Math.sqrt(g*g-(g-o)*(g-o)):g,v=l?2*g:s?g-o:2*y,x=l?2*g:s?2*y:g-o;return i.y/i.x>=m/(f-v)?p=m/i.y:i.y/i.x<=(m-x)/f?p=f/i.x:!l&&s?(c=i.x*i.x+i.y*i.y/4,h=(f-g)*(f-g)+(m/2-g)*(m/2-g)-g*g,p=(-(u=-2*i.x*(f-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):l?(c=(i.x*i.x+i.y*i.y)/4,h=(f/2-g)*(f/2-g)+(m/2-g)*(m/2-g)-g*g,p=(-(u=-i.x*(f/2-g)-i.y*(m/2-g))+Math.sqrt(u*u-4*c*h))/(2*c)):(c=i.x*i.x/4+i.y*i.y,h=(f/2-g)*(f/2-g)+(m-g)*(m-g)-g*g,p=(-(u=-i.x*(f/2-g)-2*i.y*(m-g))+Math.sqrt(u*u-4*c*h))/(2*c)),p=Math.min(1,p),d=s?Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(m-i.y*p)/2)*(g-(m-i.y*p)/2)))-o):Math.max(0,g-Math.sqrt(Math.max(0,g*g-(g-(f-i.x*p)/2)*(g-(f-i.x*p)/2)))-o),{scale:p,pad:d}}(e,t,r,n,M,m,g,o,f);T=E.scale,A=E.pad}else T=1,s&&(T=Math.min(1,x/M.x,b/M.y)),A=0;var L=i.left*d+i.right*p,I=(i.top+i.bottom)/2,z=(e+_)*d+(t-_)*p,O=(r+n)/2,R=0,D=0;if(h||u){var j=(o?M.x:M.y)/2;m&&(u||f)&&(w+=A);var F=o?S(e,t):S(r,n);o?h?(z=e+F*w,R=-F*j):(z=t-F*w,R=F*j):h?(O=r+F*w,D=-F*j):(O=n-F*w,D=F*j)}return{textX:L,textY:I,targetX:z,targetY:O,anchorX:R,anchorY:D,scale:T,rotate:k}}t.exports={plot:function(e,t,u,m,g,v){var k=t.xaxis,I=t.yaxis,z=e._fullLayout,O=e._context.staticPlot;g||(g={mode:z.barmode,norm:z.barmode,gap:z.bargap,groupgap:z.bargroupgap},p("bar",z));var R=i.makeTraceGroups(m,u,"trace bars").each((function(l){var u=r.select(this),p=l[0].trace,m=l[0].t,R="waterfall"===p.type,D="funnel"===p.type,j="histogram"===p.type,F="bar"===p.type,B=F||D,N=0;R&&p.connector.visible&&"between"===p.connector.mode&&(N=p.connector.line.width/2);var U="h"===p.orientation,V=M(g),q=i.ensureSingle(u,"g","points"),H=function(e){if(e.ids)return w}(p),G=q.selectAll("g.point").data(i.identity,H);G.enter().append("g").classed("point",!0),G.exit().remove(),G.each((function(u,w){var M,R,D=r.select(this),q=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),n?[i,a]:[a,i]}(u,k,I,U),H=q[0][0],G=q[0][1],W=q[1][0],$=q[1][1],Z=0===(U?G-H:$-W);if(Z&&B&&f.getLineWidth(p,u)&&(Z=!1),Z||(Z=!n(H)||!n(G)||!n(W)||!n($)),u.isBlank=Z,Z&&(U?G=H:$=W),N&&!Z&&(U?(H-=S(H,G)*N,G+=S(H,G)*N):(W-=S(W,$)*N,$+=S(W,$)*N)),"waterfall"===p.type){if(!Z){var X=p[u.dir].marker;M=X.line.width,R=X.color}}else M=f.getLineWidth(p,u),R=u.mc||p.marker.color;function Y(e){var t=r.round(M/2%1,2);return 0===g.gap&&0===g.groupgap?r.round(Math.round(e)-t,2):e}var K=o.opacity(R)<1||M>.01?Y:function(e,t,r){return r&&e===t?e:Math.abs(e-t)>=2?Y(e):e>t?Math.ceil(e):Math.floor(e)};e._context.staticPlot||(H=K(H,G,U),G=K(G,H,U),W=K(W,$,!U),$=K($,W,!U));var J,Q=U?k.c2p:I.c2p;J=u.s0>0?u._sMax:u.s0<0?u._sMin:u.s1>0?u._sMax:u._sMin;var ee,te,re=F||j?function(e,t){if(!e)return 0;var r,n=U?Math.abs($-W):Math.abs(G-H),i=U?Math.abs(G-H):Math.abs($-W),a=K(Math.abs(Q(J,!0)-Q(0,!0))),o=u.hasB?Math.min(n/2,i/2):Math.min(n/2,a);return r="%"===t?n*(Math.min(50,e)/100):e,K(Math.max(Math.min(r,o),0))}(m.cornerradiusvalue,m.cornerradiusform):0,ne="M"+H+","+W+"V"+$+"H"+G+"V"+W+"Z",ie=0;if(re&&u.s){var ae=0===T(u.s0)||T(u.s)===T(u.s0)?u.s1:u.s0;if((ie=K(u.hasB?0:Math.abs(Q(J,!0)-Q(ae,!0))))<re){var oe=S(H,G),se=S(W,$),le=oe===-se?1:0;if(U)if(u.hasB)ee="M"+(H+re*oe)+","+W+"A "+re+","+re+" 0 0 "+le+" "+H+","+(W+re*se)+"V"+($-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+$+"H"+(G-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+G+","+($-re*se)+"V"+(W+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(G-re*oe)+","+W+"Z";else{var ce=(te=Math.abs(G-H)+ie)<re?re-Math.sqrt(te*(2*re-te)):0,ue=ie>0?Math.sqrt(ie*(2*re-ie)):0,he=oe>0?Math.max:Math.min;ee="M"+H+","+W+"V"+($-ce*se)+"H"+he(G-(re-ie)*oe,H)+"A "+re+","+re+" 0 0 "+le+" "+G+","+($-re*se-ue)+"V"+(W+re*se+ue)+"A "+re+","+re+" 0 0 "+le+" "+he(G-(re-ie)*oe,H)+","+(W+ce*se)+"Z"}else if(u.hasB)ee="M"+(H+re*oe)+","+W+"A "+re+","+re+" 0 0 "+le+" "+H+","+(W+re*se)+"V"+($-re*se)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe)+","+$+"H"+(G-re*oe)+"A "+re+","+re+" 0 0 "+le+" "+G+","+($-re*se)+"V"+(W+re*se)+"A "+re+","+re+" 0 0 "+le+" "+(G-re*oe)+","+W+"Z";else{var pe=(te=Math.abs($-W)+ie)<re?re-Math.sqrt(te*(2*re-te)):0,de=ie>0?Math.sqrt(ie*(2*re-ie)):0,fe=se>0?Math.max:Math.min;ee="M"+(H+pe*oe)+","+W+"V"+fe($-(re-ie)*se,W)+"A "+re+","+re+" 0 0 "+le+" "+(H+re*oe-de)+","+$+"H"+(G-re*oe+de)+"A "+re+","+re+" 0 0 "+le+" "+(G-pe*oe)+","+fe($-(re-ie)*se,W)+"V"+W+"Z"}}else ee=ne}else ee=ne;var me=A(i.ensureSingle(D,"path"),z,g,v);if(me.style("vector-effect",O?"none":"non-scaling-stroke").attr("d",isNaN((G-H)*($-W))||Z&&e._context.staticPlot?"M0,0Z":ee).call(s.setClipUrl,t.layerClipId,e),!z.uniformtext.mode&&V){var ge=s.makePointStyleFns(p);s.singlePointStyle(u,me,p,ge,e)}!function(e,t,r,n,o,l,u,p,m,g,v,w,k){var T,M=t.xaxis,I=t.yaxis,z=e._fullLayout;function O(t,r,n){return i.ensureSingle(t,"text").text(r).attr({class:"bartext bartext-"+T,"text-anchor":"middle","data-notex":1}).call(s.font,n).call(a.convertToTspans,e)}var R=n[0].trace,D="h"===R.orientation,j=function(e,t,r,n,a){var o,s=t[0].trace,l=s.texttemplate;return o=l?function(e,t,r,n,a){var o=t[0].trace,s=i.castOption(o,r,"texttemplate");if(!s)return"";var l,u,h,p,d="histogram"===o.type,f="waterfall"===o.type,m="funnel"===o.type,g="h"===o.orientation;function y(e){return c(u,u.c2l(e),!0).text}function v(e){return c(p,p.c2l(e),!0).text}g?(l="y",u=a,h="x",p=n):(l="x",u=n,h="y",p=a);var x=t[r],_={};_.label=x.p,_.labelLabel=_[l+"Label"]=y(x.p);var w=i.castOption(o,x.i,"text");(0===w||w)&&(_.text=w),_.value=x.s,_.valueLabel=_[h+"Label"]=v(x.s);var k={};b(k,o,x.i),(d||void 0===k.x)&&(k.x=g?_.value:_.label),(d||void 0===k.y)&&(k.y=g?_.label:_.value),(d||void 0===k.xLabel)&&(k.xLabel=g?_.valueLabel:_.labelLabel),(d||void 0===k.yLabel)&&(k.yLabel=g?_.labelLabel:_.valueLabel),f&&(_.delta=+x.rawS||x.s,_.deltaLabel=v(_.delta),_.final=x.v,_.finalLabel=v(_.final),_.initial=_.final-_.delta,_.initialLabel=v(_.initial)),m&&(_.value=x.s,_.valueLabel=v(_.value),_.percentInitial=x.begR,_.percentInitialLabel=i.formatPercent(x.begR),_.percentPrevious=x.difR,_.percentPreviousLabel=i.formatPercent(x.difR),_.percentTotal=x.sumR,_.percenTotalLabel=i.formatPercent(x.sumR));var T=i.castOption(o,x.i,"customdata");return T&&(_.customdata=T),i.texttemplateString(s,_,e._d3locale,k,_,o._meta||{})}(e,t,r,n,a):s.textinfo?function(e,t,r,n){var a=e[0].trace,o="h"===a.orientation,s="waterfall"===a.type,l="funnel"===a.type;function u(e){return c(o?n:r,e,!0).text}function h(e){return c(o?r:n,+e,!0).text}var p,d=a.textinfo,f=e[t],m=d.split("+"),g=[],y=function(e){return-1!==m.indexOf(e)};if(y("label")&&g.push(u(e[t].p)),y("text")&&(0===(p=i.castOption(a,f.i,"text"))||p)&&g.push(p),s){var v=+f.rawS||f.s,x=f.v,b=x-v;y("initial")&&g.push(h(b)),y("delta")&&g.push(h(v)),y("final")&&g.push(h(x))}if(l){y("value")&&g.push(h(f.s));var _=0;y("percent initial")&&_++,y("percent previous")&&_++,y("percent total")&&_++;var w=_>1;y("percent initial")&&(p=i.formatPercent(f.begR),w&&(p+=" of initial"),g.push(p)),y("percent previous")&&(p=i.formatPercent(f.difR),w&&(p+=" of previous"),g.push(p)),y("percent total")&&(p=i.formatPercent(f.sumR),w&&(p+=" of total"),g.push(p))}return g.join("<br>")}(t,r,n,a):f.getValue(s.text,r),f.coerceString(y,o)}(z,n,o,M,I);T=function(e,t){var r=f.getValue(e.textposition,t);return f.coerceEnumerated(x,r)}(R,o);var F="stack"===w.mode||"relative"===w.mode,B=n[o],N=!F||B._outmost,U=B.hasB,V=g&&g-v>_;if(j&&"none"!==T&&(!B.isBlank&&l!==u&&p!==m||"auto"!==T&&"inside"!==T)){var q=z.font,H=d.getBarColor(n[o],R),G=d.getInsideTextFont(R,o,q,H),W=d.getOutsideTextFont(R,o,q),$=R.insidetextanchor||"end",Z=r.datum();D?"log"===M.type&&Z.s0<=0&&(l=M.range[0]<M.range[1]?0:M._length):"log"===I.type&&Z.s0<=0&&(p=I.range[0]<I.range[1]?I._length:0);var X,Y,K,J,Q,ee=Math.abs(u-l),te=Math.abs(m-p),re=ee-2*_,ne=te-2*_;if("outside"===T&&(N||B.hasB||(T="inside")),"auto"===T)if(N){T="inside",X=O(r,j,Q=i.ensureUniformFontSize(e,G)),K=(Y=s.bBox(X.node())).width,J=Y.height;var ie,ae=K>0&&J>0;ie=V?U?E(re-2*g,ne,K,J,D)||E(re,ne-2*g,K,J,D):D?E(re-(g-v),ne,K,J,D)||E(re,ne-2*(g-v),K,J,D):E(re,ne-(g-v),K,J,D)||E(re-2*(g-v),ne,K,J,D):E(re,ne,K,J,D),ae&&ie?T="inside":(T="outside",X.remove(),X=null)}else T="inside";if(!X){var oe=(X=O(r,j,Q=i.ensureUniformFontSize(e,"outside"===T?W:G))).attr("transform");if(X.attr("transform",""),K=(Y=s.bBox(X.node())).width,J=Y.height,X.attr("transform",oe),K<=0||J<=0)return void X.remove()}var se,le=R.textangle;se="outside"===T?function(e,t,r,n,i,a){var o,s=!!a.isHorizontal,l=!!a.constrained,c=a.angle||0,u=i.width,h=i.height,p=Math.abs(t-e),d=Math.abs(n-r);o=s?d>2*_?_:0:p>2*_?_:0;var f=1;l&&(f=s?Math.min(1,d/h):Math.min(1,p/u));var m=C(c),g=P(i,m),y=(s?g.x:g.y)/2,v=(i.left+i.right)/2,x=(i.top+i.bottom)/2,b=(e+t)/2,w=(r+n)/2,k=0,T=0,A=s?S(t,e):S(r,n);return s?(b=t-A*o,k=A*y):(w=n+A*o,T=-A*y),{textX:v,textY:x,targetX:b,targetY:w,anchorX:k,anchorY:T,scale:f,rotate:m}}(l,u,p,m,Y,{isHorizontal:D,constrained:"both"===R.constraintext||"outside"===R.constraintext,angle:le}):L(l,u,p,m,Y,{isHorizontal:D,constrained:"both"===R.constraintext||"inside"===R.constraintext,angle:le,anchor:$,hasB:U,r:g,overhead:v}),se.fontSize=Q.size,h("histogram"===R.type?"bar":R.type,se,z),B.transform=se;var ce=A(X,z,w,k);i.setTransormAndDisplay(ce,se)}else r.select("text").remove()}(e,t,D,l,w,H,G,W,$,re,ie,g,v),t.layerClipId&&s.hideOutsideRangePoint(u,D.select("text"),k,I,p.xcalendar,p.ycalendar)}));var W=!1===p.cliponaxis;s.setClipUrl(u,W?null:t.layerClipId,e)}));l.getComponentMethod("errorbars","plot")(e,R,t,g)},toMoveInsideBar:L}}}),to=p({"src/traces/bar/hover.js"(e,t){var r=zr(),n=Ve(),i=q(),a=st().fillText,o=Ja().getLineWidth,s=nr().hoverLabelText,l=T().BADNUM;function c(e,t,n,i,o){var c,u,h,p,d,f,m,g=e.cd,y=g[0].trace,v=g[0].t,x="closest"===i,b="waterfall"===y.type,_=e.maxHoverDistance,w=e.maxSpikeDistance;"h"===y.orientation?(c=n,u=t,h="y",p="x",d=O,f=I):(c=t,u=n,h="x",p="y",f=O,d=I);var k=y[h+"period"],T=x||k;function S(e){return M(e,-1)}function A(e){return M(e,1)}function M(e,t){var r=e.w;return e[h]+t*r/2}function E(e){return e[h+"End"]-e[h+"Start"]}var C=x?S:k?function(e){return e.p-E(e)/2}:function(e){return Math.min(S(e),e.p-v.bardelta/2)},P=x?A:k?function(e){return e.p+E(e)/2}:function(e){return Math.max(A(e),e.p+v.bardelta/2)};function L(e,t,n){return o.finiteRange&&(n=0),r.inbox(e-c,t-c,n+Math.min(1,Math.abs(t-e)/m)-1)}function I(e){return L(C(e),P(e),_)}function z(e){var t=e[p];if(b){var r=Math.abs(e.rawS)||0;u>0?t+=r:u<0&&(t-=r)}return t}function O(e){var t=u,n=e.b,i=z(e);return r.inbox(n-t,i-t,_+(i-t)/(i-n)-1)}var R=e[h+"a"],D=e[p+"a"];m=Math.abs(R.r2c(R.range[1])-R.r2c(R.range[0]));var j=r.getDistanceFunction(i,d,f,(function(e){return(d(e)+f(e))/2}));if(r.getClosest(g,j,e),!1!==e.index&&g[e.index].p!==l){T||(C=function(e){return Math.min(S(e),e.p-v.bargroupwidth/2)},P=function(e){return Math.max(A(e),e.p+v.bargroupwidth/2)});var F=g[e.index],B=y.base?F.b+F.s:F.s;e[p+"0"]=e[p+"1"]=D.c2p(F[p],!0),e[p+"LabelVal"]=B;var N=v.extents[v.extents.round(F.p)];e[h+"0"]=R.c2p(x?C(F):N[0],!0),e[h+"1"]=R.c2p(x?P(F):N[1],!0);var U,V=void 0!==F.orig_p;return e[h+"LabelVal"]=V?F.orig_p:F.p,e.labelLabel=s(R,e[h+"LabelVal"],y[h+"hoverformat"]),e.valueLabel=s(D,e[p+"LabelVal"],y[p+"hoverformat"]),e.baseLabel=s(D,F.b,y[p+"hoverformat"]),e.spikeDistance=(function(e){var t=u,n=e.b,i=z(e);return r.inbox(n-t,i-t,w+(i-t)/(i-n)-1)}(F)+L(S(U=F),A(U),w))/2,e[h+"Spike"]=R.c2p(F.p,!0),a(F,y,e),e.hovertemplate=y.hovertemplate,e}}function u(e,t){var r=t.mcc||e.marker.color,n=t.mlcc||e.marker.line.color,a=o(e,t);return i.opacity(r)?r:i.opacity(n)&&a?n:void 0}t.exports={hoverPoints:function(e,t,r,i,a){var o=c(e,t,r,i,a);if(o){var s=o.cd,l=s[0].trace,h=s[o.index];return o.color=u(l,h),n.getComponentMethod("errorbars","hoverInfo")(h,l,o),[o]}},hoverOnBars:c,getTraceColor:u}}}),ro=p({"src/traces/bar/event_data.js"(e,t){t.exports=function(e,t,r){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),"h"===r.orientation?(e.label=e.y,e.value=e.x):(e.label=e.x,e.value=e.y),e}}}),no=p({"src/traces/bar/select.js"(e,t){function r(e,t,r,n,i){var a=t.c2p(n?e.s0:e.p0,!0),o=t.c2p(n?e.s1:e.p1,!0),s=r.c2p(n?e.p0:e.s0,!0),l=r.c2p(n?e.p1:e.s1,!0);return i?[(a+o)/2,(s+l)/2]:n?[o,(s+l)/2]:[(a+o)/2,l]}t.exports=function(e,t){var n,i=e.cd,a=e.xaxis,o=e.yaxis,s=i[0].trace,l="funnel"===s.type,c="h"===s.orientation,u=[];if(!1===t)for(n=0;n<i.length;n++)i[n].selected=0;else for(n=0;n<i.length;n++){var h=i[n],p="ct"in h?h.ct:r(h,a,o,c,l);t.contains(p,!1,n,e)?(u.push({pointNumber:n,x:a.c2d(h.x),y:o.c2d(h.y)}),h.selected=1):h.selected=0}return u}}}),io=p({"src/traces/bar/index.js"(e,t){t.exports={attributes:Ha(),layoutAttributes:Ga(),supplyDefaults:$a().supplyDefaults,crossTraceDefaults:$a().crossTraceDefaults,supplyLayoutDefaults:Za(),calc:Ya(),crossTraceCalc:si().crossTraceCalc,colorbar:pi(),arraysToCalcdata:Xa(),plot:eo().plot,style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:to().hoverPoints,eventData:ro(),selectPoints:no(),moduleType:"trace",name:"bar",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","oriented","errorBarsOK","showLegend","zoomScale"],animatable:!0,meta:{}}}}),ao=p({"lib/bar.js"(e,t){t.exports=io()}}),oo=p({"src/traces/box/attributes.js"(e,t){var r=_n(),n=wn(),i=Ha(),a=V(),o=Et().axisHoverFormat,s=Oe().hovertemplateAttrs,l=R().extendFlat,c=n.marker,u=c.line;t.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},dx:{valType:"number",editType:"calc"},dy:{valType:"number",editType:"calc"},xperiod:n.xperiod,yperiod:n.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:n.xperiodalignment,yperiodalignment:n.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),name:{valType:"string",editType:"calc+clearAxisTypes"},q1:{valType:"data_array",editType:"calc+clearAxisTypes"},median:{valType:"data_array",editType:"calc+clearAxisTypes"},q3:{valType:"data_array",editType:"calc+clearAxisTypes"},lowerfence:{valType:"data_array",editType:"calc"},upperfence:{valType:"data_array",editType:"calc"},notched:{valType:"boolean",editType:"calc"},notchwidth:{valType:"number",min:0,max:.5,dflt:.25,editType:"calc"},notchspan:{valType:"data_array",editType:"calc"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],editType:"calc"},jitter:{valType:"number",min:0,max:1,editType:"calc"},pointpos:{valType:"number",min:-2,max:2,editType:"calc"},sdmultiple:{valType:"number",min:0,editType:"calc",dflt:1},sizemode:{valType:"enumerated",values:["quartiles","sd"],editType:"calc",dflt:"quartiles"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],editType:"calc"},mean:{valType:"data_array",editType:"calc"},sd:{valType:"data_array",editType:"calc"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},quartilemethod:{valType:"enumerated",values:["linear","exclusive","inclusive"],dflt:"linear",editType:"calc"},width:{valType:"number",min:0,dflt:0,editType:"calc"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:l({},c.symbol,{arrayOk:!1,editType:"plot"}),opacity:l({},c.opacity,{arrayOk:!1,dflt:1,editType:"style"}),angle:l({},c.angle,{arrayOk:!1,editType:"calc"}),size:l({},c.size,{arrayOk:!1,editType:"calc"}),color:l({},c.color,{arrayOk:!1,editType:"style"}),line:{color:l({},u.color,{arrayOk:!1,dflt:a.defaultLine,editType:"style"}),width:l({},u.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:r(),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calc"},showwhiskers:{valType:"boolean",editType:"calc"},offsetgroup:i.offsetgroup,alignmentgroup:i.alignmentgroup,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),hovertemplate:s({}),hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"},zorder:n.zorder}}}),so=p({"src/traces/box/layout_attributes.js"(e,t){t.exports={boxmode:{valType:"enumerated",values:["group","overlay"],dflt:"overlay",editType:"calc"},boxgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"},boxgroupgap:{valType:"number",min:0,max:1,dflt:.3,editType:"calc"}}}}),lo=p({"src/traces/box/defaults.js"(e,t){var r=st(),n=Ve(),i=q(),a=Hn(),o=Jn(),s=tr(),l=oo();function c(e,t,i,a){function o(e){var t=0;return e&&e.length&&(t+=1,r.isArrayOrTypedArray(e[0])&&e[0].length&&(t+=1)),t}function c(t){return r.validate(e[t],l[t])}var u,h=i("y"),p=i("x");if("box"===t.type){var d=i("q1"),f=i("median"),m=i("q3");t._hasPreCompStats=d&&d.length&&f&&f.length&&m&&m.length,u=Math.min(r.minRowLength(d),r.minRowLength(f),r.minRowLength(m))}var g,y,v=o(h),x=o(p),b=v&&r.minRowLength(h),_=x&&r.minRowLength(p),w=a.calendar,k={autotypenumbers:a.autotypenumbers};if(t._hasPreCompStats)switch(String(x)+String(v)){case"00":var T=c("x0")||c("dx");g=!c("y0")&&!c("dy")||T?"v":"h",y=u;break;case"10":g="v",y=Math.min(u,_);break;case"20":g="h",y=Math.min(u,p.length);break;case"01":g="h",y=Math.min(u,b);break;case"02":g="v",y=Math.min(u,h.length);break;case"12":g="v",y=Math.min(u,_,h.length);break;case"21":g="h",y=Math.min(u,p.length,b);break;case"11":y=0;break;case"22":var S,A=!1;for(S=0;S<p.length;S++)if("category"===s(p[S],w,k)){A=!0;break}if(A)g="v",y=Math.min(u,_,h.length);else{for(S=0;S<h.length;S++)if("category"===s(h[S],w,k)){A=!0;break}A?(g="h",y=Math.min(u,p.length,b)):(g="v",y=Math.min(u,_,h.length))}}else v>0?(g="v",y=x>0?Math.min(_,b):Math.min(b)):x>0?(g="h",y=Math.min(_)):y=0;if(y){t._length=y;var M=i("orientation",g);t._hasPreCompStats?"v"===M&&0===x?(i("x0",0),i("dx",1)):"h"===M&&0===v&&(i("y0",0),i("dy",1)):"v"===M&&0===x?i("x0"):"h"===M&&0===v&&i("y0"),n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a)}else t.visible=!1}function u(e,t,n,i){var a=i.prefix,o=r.coerce2(e,t,l,"marker.outliercolor"),s=n("marker.line.outliercolor"),c="outliers";t._hasPreCompStats?c="all":(o||s)&&(c="suspectedoutliers");var u=n(a+"points",c);u?(n("jitter","all"===u?.3:0),n("pointpos","all"===u?-1.5:0),n("marker.symbol"),n("marker.opacity"),n("marker.size"),n("marker.angle"),n("marker.color",t.line.color),n("marker.line.color"),n("marker.line.width"),"suspectedoutliers"===u&&(n("marker.line.outliercolor",t.marker.color),n("marker.line.outlierwidth")),n("selected.marker.color"),n("unselected.marker.color"),n("selected.marker.size"),n("unselected.marker.size"),n("text"),n("hovertext")):delete t.marker;var h=n("hoveron");"all"!==h&&-1===h.indexOf("points")||n("hovertemplate"),r.coerceSelectionMarkerOpacity(t,n)}t.exports={supplyDefaults:function(e,t,n,o){function s(n,i){return r.coerce(e,t,l,n,i)}if(c(e,t,s,o),!1!==t.visible){a(e,t,o,s),s("xhoverformat"),s("yhoverformat");var h=t._hasPreCompStats;h&&(s("lowerfence"),s("upperfence")),s("line.color",(e.marker||{}).color||n),s("line.width"),s("fillcolor",i.addOpacity(t.line.color,.5));var p=!1;if(h){var d=s("mean"),f=s("sd");d&&d.length&&(p=!0,f&&f.length&&(p="sd"))}s("whiskerwidth");var m,g=s("sizemode");"quartiles"===g&&(m=s("boxmean",p)),s("showwhiskers","quartiles"===g),"sd"!==g&&"sd"!==m||s("sdmultiple"),s("width"),s("quartilemethod");var y=!1;if(h){var v=s("notchspan");v&&v.length&&(y=!0)}else r.validate(e.notchwidth,l.notchwidth)&&(y=!0);s("notched",y)&&s("notchwidth"),u(e,t,s,{prefix:"box"}),s("zorder")}},crossTraceDefaults:function(e,t){var n,i;function a(e){return r.coerce(i._input,i,l,e)}for(var s=0;s<e.length;s++){var c=(i=e[s]).type;if("box"===c||"violin"===c){n=i._input;var u=t[c+"mode"];"group"===u&&o(n,i,t,a,u)}}},handleSampleDefaults:c,handlePointsDefaults:u}}}),co=p({"src/traces/box/layout_defaults.js"(e,t){var r=Ve(),n=st(),i=so();function a(e,t,n,i,a){for(var o=a+"Layout",s=!1,l=0;l<n.length;l++){var c=n[l];if(r.traceIs(c,o)){s=!0;break}}s&&(i(a+"mode"),i(a+"gap"),i(a+"groupgap"))}t.exports={supplyLayoutDefaults:function(e,t,r){a(0,0,r,(function(r,a){return n.coerce(e,t,i,r,a)}),"box")},_supply:a}}}),uo=p({"src/traces/box/calc.js"(e,t){var r=k(),n=nr(),i=ti(),a=st(),o=T().BADNUM,s=a._;t.exports=function(e,t){var l,y,v,x,b,_,w,k=e._fullLayout,T=n.getFromId(e,t.xaxis||"x"),S=n.getFromId(e,t.yaxis||"y"),A=[],M="violin"===t.type?"_numViolins":"_numBoxes";"h"===t.orientation?(v=T,x="x",b=S,_="y",w=!!t.yperiodalignment):(v=S,x="y",b=T,_="x",w=!!t.xperiodalignment);var E,C,P,L,I,z,O=function(e,t,n,o){var s,l=t in e,c=t+"0"in e,u="d"+t in e;if(l||c&&u){var h=n.makeCalcdata(e,t);return[i(e,n,t,h).vals,h]}s=c?e[t+"0"]:"name"in e&&("category"===n.type||r(e.name)&&-1!==["linear","log"].indexOf(n.type)||a.isDateTime(e.name)&&"date"===n.type)?e.name:o;for(var p="multicategory"===n.type?n.r2c_just_indices(s):n.d2c(s,0,e[t+"calendar"]),d=e._length,f=new Array(d),m=0;m<d;m++)f[m]=p;return[f]}(t,_,b,k[M]),R=O[0],D=O[1],j=a.distinctVals(R,b),F=j.vals,B=j.minDiff/2,N="all"===(t.boxpoints||t.points)?a.identity:function(e){return e.v<E.lf||e.v>E.uf};if(t._hasPreCompStats){var U=t[x],V=function(e){return v.d2c((t[e]||[])[l])},q=1/0,H=-1/0;for(l=0;l<t._length;l++){var G=R[l];if(r(G)){if((E={}).pos=E[_]=G,w&&D&&(E.orig_p=D[l]),E.q1=V("q1"),E.med=V("median"),E.q3=V("q3"),C=[],U&&a.isArrayOrTypedArray(U[l]))for(y=0;y<U[l].length;y++)(z=v.d2c(U[l][y]))!==o&&(c(I={v:z,i:[l,y]},t,[l,y]),C.push(I));if(E.pts=C.sort(u),L=(P=E[x]=C.map(h)).length,E.med!==o&&E.q1!==o&&E.q3!==o&&E.med>=E.q1&&E.q3>=E.med){var W=V("lowerfence");E.lf=W!==o&&W<=E.q1?W:p(E,P,L);var $=V("upperfence");E.uf=$!==o&&$>=E.q3?$:d(E,P,L);var Z=V("mean");E.mean=Z!==o?Z:L?a.mean(P,L):(E.q1+E.q3)/2;var X=V("sd");E.sd=Z!==o&&X>=0?X:L?a.stdev(P,L,E.mean):E.q3-E.q1,E.lo=f(E),E.uo=m(E);var Y=V("notchspan");Y=Y!==o&&Y>0?Y:g(E,L),E.ln=E.med-Y,E.un=E.med+Y;var K=E.lf,J=E.uf;t.boxpoints&&P.length&&(K=Math.min(K,P[0]),J=Math.max(J,P[L-1])),t.notched&&(K=Math.min(K,E.ln),J=Math.max(J,E.un)),E.min=K,E.max=J}else{var Q;a.warn(["Invalid input - make sure that q1 <= median <= q3","q1 = "+E.q1,"median = "+E.med,"q3 = "+E.q3].join("\n")),Q=E.med!==o?E.med:E.q1!==o?E.q3!==o?(E.q1+E.q3)/2:E.q1:E.q3!==o?E.q3:0,E.med=Q,E.q1=E.q3=Q,E.lf=E.uf=Q,E.mean=E.sd=Q,E.ln=E.un=Q,E.min=E.max=Q}q=Math.min(q,E.min),H=Math.max(H,E.max),E.pts2=C.filter(N),A.push(E)}}t._extremes[v._id]=n.findExtremes(v,[q,H],{padded:!0})}else{var ee=v.makeCalcdata(t,x),te=function(e,t){for(var r=e.length,n=new Array(r+1),i=0;i<r;i++)n[i]=e[i]-t;return n[r]=e[r-1]+t,n}(F,B),re=F.length,ne=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=[];return t}(re);for(l=0;l<t._length;l++)if(z=ee[l],r(z)){var ie=a.findBin(R[l],te);ie>=0&&ie<re&&(c(I={v:z,i:l},t,l),ne[ie].push(I))}var ae=1/0,oe=-1/0,se=t.quartilemethod,le="exclusive"===se,ce="inclusive"===se;for(l=0;l<re;l++)if(ne[l].length>0){var ue,he;(E={}).pos=E[_]=F[l],C=E.pts=ne[l].sort(u),L=(P=E[x]=C.map(h)).length,E.min=P[0],E.max=P[L-1],E.mean=a.mean(P,L),E.sd=a.stdev(P,L,E.mean)*t.sdmultiple,E.med=a.interp(P,.5),L%2&&(le||ce)?(le?(ue=P.slice(0,L/2),he=P.slice(L/2+1)):ce&&(ue=P.slice(0,L/2+1),he=P.slice(L/2)),E.q1=a.interp(ue,.5),E.q3=a.interp(he,.5)):(E.q1=a.interp(P,.25),E.q3=a.interp(P,.75)),E.lf=p(E,P,L),E.uf=d(E,P,L),E.lo=f(E),E.uo=m(E);var pe=g(E,L);E.ln=E.med-pe,E.un=E.med+pe,ae=Math.min(ae,E.ln),oe=Math.max(oe,E.un),E.pts2=C.filter(N),A.push(E)}t.notched&&a.isTypedArray(ee)&&(ee=Array.from(ee)),t._extremes[v._id]=n.findExtremes(v,t.notched?ee.concat([ae,oe]):ee,{padded:!0})}return function(e,t){if(a.isArrayOrTypedArray(t.selectedpoints))for(var r=0;r<e.length;r++){for(var n=e[r].pts||[],i={},o=0;o<n.length;o++)i[n[o].i]=o;a.tagSelected(n,t,i)}}(A,t),A.length>0?(A[0].t={num:k[M],dPos:B,posLetter:_,valLetter:x,labels:{med:s(e,"median:"),min:s(e,"min:"),q1:s(e,"q1:"),q3:s(e,"q3:"),max:s(e,"max:"),mean:"sd"===t.boxmean||"sd"===t.sizemode?s(e,"mean \xb1 \u03c3:").replace("\u03c3",1===t.sdmultiple?"\u03c3":t.sdmultiple+"\u03c3"):s(e,"mean:"),lf:s(e,"lower fence:"),uf:s(e,"upper fence:")}},k[M]++,A):[{t:{empty:!0}}]};var l={text:"tx",hovertext:"htx"};function c(e,t,r){for(var n in l)a.isArrayOrTypedArray(t[n])&&(Array.isArray(r)?a.isArrayOrTypedArray(t[n][r[0]])&&(e[l[n]]=t[n][r[0]][r[1]]):e[l[n]]=t[n][r])}function u(e,t){return e.v-t.v}function h(e){return e.v}function p(e,t,r){return 0===r?e.q1:Math.min(e.q1,t[Math.min(a.findBin(2.5*e.q1-1.5*e.q3,t,!0)+1,r-1)])}function d(e,t,r){return 0===r?e.q3:Math.max(e.q3,t[Math.max(a.findBin(2.5*e.q3-1.5*e.q1,t),0)])}function f(e){return 4*e.q1-3*e.q3}function m(e){return 4*e.q3-3*e.q1}function g(e,t){return 0===t?0:1.57*(e.q3-e.q1)/Math.sqrt(t)}}}),ho=p({"src/traces/box/cross_trace_calc.js"(e,t){var r=nr(),n=st(),i=tn().getAxisGroup,a=["v","h"];function o(e,t,a,o){var s,l,c,u=t.calcdata,h=t._fullLayout,p=o._id,d=p.charAt(0),f=[],m=0;for(s=0;s<a.length;s++)for(c=u[a[s]],l=0;l<c.length;l++)f.push(o.c2l(c[l].pos,!0)),m+=(c[l].pts2||[]).length;if(f.length){var g=n.distinctVals(f);"category"!==o.type&&"multicategory"!==o.type||(g.minDiff=1);var y=g.minDiff/2;r.minDtick(o,g.minDiff,g.vals[0],!0);var v=h["violin"===e?"_numViolins":"_numBoxes"],x="group"===h[e+"mode"]&&v>1,b=1-h[e+"gap"],_=1-h[e+"groupgap"];for(s=0;s<a.length;s++){var w,k,T,S,A,M,E=(c=u[a[s]])[0].trace,C=c[0].t,P=E.width,L=E.side;if(P)w=k=S=P/2,T=0;else if(w=y,x){var I=i(h,o._id)+E.orientation,z=(h._alignmentOpts[I]||{})[E.alignmentgroup]||{},O=Object.keys(z.offsetGroups||{}).length,R=O||v;k=w*b*_/R,T=2*w*(((O?E._offsetIndex:C.num)+.5)/R-.5)*b,S=w*b/R}else k=w*b*_,T=0,S=w;C.dPos=w,C.bPos=T,C.bdPos=k,C.wHover=S;var D,j,F,B,N,U,V=T+k,q=Boolean(P);if("positive"===L?(A=w*(P?1:.5),D=V,M=D=T):"negative"===L?(A=D=T,M=w*(P?1:.5),j=V):(A=M=w,D=j=V),(E.boxpoints||E.points)&&m>0){var H=E.pointpos,G=E.jitter,W=E.marker.size/2,$=0;H+G>=0&&(($=V*(H+G))>A?(q=!0,N=W,F=$):$>D&&(N=W,F=A)),$<=A&&(F=A);var Z=0;H-G<=0&&((Z=-V*(H-G))>M?(q=!0,U=W,B=Z):Z>j&&(U=W,B=M)),Z<=M&&(B=M)}else F=A,B=M;var X=new Array(c.length);for(l=0;l<c.length;l++)X[l]=c[l].pos;E._extremes[p]=r.findExtremes(o,X,{padded:q,vpadminus:B,vpadplus:F,vpadLinearized:!0,ppadminus:{x:U,y:N}[d],ppadplus:{x:N,y:U}[d]})}}}t.exports={crossTraceCalc:function(e,t){for(var r=e.calcdata,n=t.xaxis,i=t.yaxis,s=0;s<a.length;s++){for(var l=a[s],c="h"===l?i:n,u=[],h=0;h<r.length;h++){var p=r[h],d=p[0].t,f=p[0].trace;!0!==f.visible||"box"!==f.type&&"candlestick"!==f.type||d.empty||(f.orientation||"v")!==l||f.xaxis!==n._id||f.yaxis!==i._id||u.push(h)}o("box",e,u,c)}},setPositionOffset:o}}}),po=p({"src/traces/box/plot.js"(e,t){var r=v(),n=st(),i=Jt();function a(e,t,i,a,o){var s,l,c="h"===i.orientation,u=t.val,h=t.pos,p=!!h.rangebreaks,d=a.bPos,f=a.wdPos||0,m=a.bPosPxOffset||0,g=i.whiskerwidth||0,y=!1!==i.showwhiskers,v=i.notched||!1,x=v?1-2*i.notchwidth:1;Array.isArray(a.bdPos)?(s=a.bdPos[0],l=a.bdPos[1]):(s=a.bdPos,l=a.bdPos);var b=e.selectAll("path.box").data("violin"!==i.type||i.box.visible?n.identity:[]);b.enter().append("path").style("vector-effect",o?"none":"non-scaling-stroke").attr("class","box"),b.exit().remove(),b.each((function(e){if(e.empty)return r.select(this).attr("d","M0,0Z");var t=h.c2l(e.pos+d,!0),a=h.l2p(t-s)+m,o=h.l2p(t+l)+m,b=p?(a+o)/2:h.l2p(t)+m,_=i.whiskerwidth,w=p?a*_+(1-_)*b:h.l2p(t-f)+m,k=p?o*_+(1-_)*b:h.l2p(t+f)+m,T=h.l2p(t-s*x)+m,S=h.l2p(t+l*x)+m,A="sd"===i.sizemode,M=u.c2p(A?e.mean-e.sd:e.q1,!0),E=A?u.c2p(e.mean+e.sd,!0):u.c2p(e.q3,!0),C=n.constrain(A?u.c2p(e.mean,!0):u.c2p(e.med,!0),Math.min(M,E)+1,Math.max(M,E)-1),P=void 0===e.lf||!1===i.boxpoints||A,L=u.c2p(P?e.min:e.lf,!0),I=u.c2p(P?e.max:e.uf,!0),z=u.c2p(e.ln,!0),O=u.c2p(e.un,!0);c?r.select(this).attr("d","M"+C+","+T+"V"+S+"M"+M+","+a+"V"+o+(v?"H"+z+"L"+C+","+S+"L"+O+","+o:"")+"H"+E+"V"+a+(v?"H"+O+"L"+C+","+T+"L"+z+","+a:"")+"Z"+(y?"M"+M+","+b+"H"+L+"M"+E+","+b+"H"+I+(0===g?"":"M"+L+","+w+"V"+k+"M"+I+","+w+"V"+k):"")):r.select(this).attr("d","M"+T+","+C+"H"+S+"M"+a+","+M+"H"+o+(v?"V"+z+"L"+S+","+C+"L"+o+","+O:"")+"V"+E+"H"+a+(v?"V"+O+"L"+T+","+C+"L"+a+","+z:"")+"Z"+(y?"M"+b+","+M+"V"+L+"M"+b+","+E+"V"+I+(0===g?"":"M"+w+","+L+"H"+k+"M"+w+","+I+"H"+k):""))}))}function o(e,t,r,a){var o=t.x,s=t.y,l=a.bdPos,c=a.bPos,u=r.boxpoints||r.points;n.seedPseudoRandom();var h=e.selectAll("g.points").data(u?function(e){return e.forEach((function(e){e.t=a,e.trace=r})),e}:[]);h.enter().append("g").attr("class","points"),h.exit().remove();var p=h.selectAll("path").data((function(e){var t,i,a=e.pts2,o=Math.max((e.max-e.min)/10,e.q3-e.q1),s=1e-9*o,h=.01*o,p=[],d=0;if(r.jitter){if(0===o)for(d=1,p=new Array(a.length),t=0;t<a.length;t++)p[t]=1;else for(t=0;t<a.length;t++){var f=Math.max(0,t-5),m=a[f].v,g=Math.min(a.length-1,t+5),y=a[g].v;"all"!==u&&(a[t].v<e.lf?y=Math.min(y,e.lf):m=Math.max(m,e.uf));var v=Math.sqrt(h*(g-f)/(y-m+s))||0;v=n.constrain(Math.abs(v),0,1),p.push(v),d=Math.max(v,d)}i=2*r.jitter/(d||1)}for(t=0;t<a.length;t++){var x=a[t],b=x.v,_=r.jitter?i*p[t]*(n.pseudoRandom()-.5):0,w=e.pos+c+l*(r.pointpos+_);"h"===r.orientation?(x.y=w,x.x=b):(x.x=w,x.y=b),"suspectedoutliers"===u&&b<e.uo&&b>e.lo&&(x.so=!0)}return a}));p.enter().append("path").classed("point",!0),p.exit().remove(),p.call(i.translatePoints,o,s)}function s(e,t,i,a){var o,s,l=t.val,c=t.pos,u=!!c.rangebreaks,h=a.bPos,p=a.bPosPxOffset||0,d=i.boxmean||(i.meanline||{}).visible;Array.isArray(a.bdPos)?(o=a.bdPos[0],s=a.bdPos[1]):(o=a.bdPos,s=a.bdPos);var f=e.selectAll("path.mean").data("box"===i.type&&i.boxmean||"violin"===i.type&&i.box.visible&&i.meanline.visible?n.identity:[]);f.enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}),f.exit().remove(),f.each((function(e){var t=c.c2l(e.pos+h,!0),n=c.l2p(t-o)+p,a=c.l2p(t+s)+p,f=u?(n+a)/2:c.l2p(t)+p,m=l.c2p(e.mean,!0),g=l.c2p(e.mean-e.sd,!0),y=l.c2p(e.mean+e.sd,!0);"h"===i.orientation?r.select(this).attr("d","M"+m+","+n+"V"+a+("sd"===d?"m0,0L"+g+","+f+"L"+m+","+n+"L"+y+","+f+"Z":"")):r.select(this).attr("d","M"+n+","+m+"H"+a+("sd"===d?"m0,0L"+f+","+g+"L"+n+","+m+"L"+f+","+y+"Z":""))}))}t.exports={plot:function(e,t,i,l){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis;n.makeTraceGroups(l,i,"trace boxes").each((function(e){var t,n,i=r.select(this),l=e[0],p=l.t,d=l.trace;p.wdPos=p.bdPos*d.whiskerwidth,!0!==d.visible||p.empty?i.remove():("h"===d.orientation?(t=h,n=u):(t=u,n=h),a(i,{pos:t,val:n},d,p,c),o(i,{x:u,y:h},d,p),s(i,{pos:t,val:n},d,p))}))},plotBoxAndWhiskers:a,plotPoints:o,plotBoxMean:s}}}),fo=p({"src/traces/box/style.js"(e,t){var r=v(),n=q(),i=Jt();t.exports={style:function(e,t,a){var o=a||r.select(e).selectAll("g.trace.boxes");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(t){var a=r.select(this),o=t[0].trace,s=o.line.width;function l(e,t,r,i){e.style("stroke-width",t+"px").call(n.stroke,r).call(n.fill,i)}var c=a.selectAll("path.box");if("candlestick"===o.type)c.each((function(e){if(!e.empty){var t=r.select(this),n=o[e.dir];l(t,n.line.width,n.line.color,n.fillcolor),t.style("opacity",o.selectedpoints&&!e.selected?.3:1)}}));else{l(c,s,o.line.color,o.fillcolor),a.selectAll("path.mean").style({"stroke-width":s,"stroke-dasharray":2*s+"px,"+s+"px"}).call(n.stroke,o.line.color);var u=a.selectAll("path.point");i.pointStyle(u,o,e)}}))},styleOnSelect:function(e,t,r){var n=t[0].trace,a=r.selectAll("path.point");n.selectedpoints?i.selectedPointStyle(a,n):i.pointStyle(a,n,e)}}}}),mo=p({"src/traces/box/hover.js"(e,t){var r=nr(),n=st(),i=zr(),a=q(),o=n.fillText;function s(e,t,o,s){var l,c,u,h,p,d,f,m,g,y,v,x,b,_,w=e.cd,k=e.xa,T=e.ya,S=w[0].trace,A=w[0].t,M="violin"===S.type,E=A.bdPos,C=A.wHover,P=function(e){return u.c2l(e.pos)+A.bPos-u.c2l(d)};M&&"both"!==S.side?("positive"===S.side&&(g=function(e){var t=P(e);return i.inbox(t,t+C,y)},x=E,b=0),"negative"===S.side&&(g=function(e){var t=P(e);return i.inbox(t-C,t,y)},x=0,b=E)):(g=function(e){var t=P(e);return i.inbox(t-C,t+C,y)},x=b=E),_=M?function(e){return i.inbox(e.span[0]-p,e.span[1]-p,y)}:function(e){return i.inbox(e.min-p,e.max-p,y)},"h"===S.orientation?(p=t,d=o,f=_,m=g,l="y",u=T,c="x",h=k):(p=o,d=t,f=g,m=_,l="x",u=k,c="y",h=T);var L=Math.min(1,E/Math.abs(u.r2c(u.range[1])-u.r2c(u.range[0])));function I(e){return(f(e)+m(e))/2}y=e.maxHoverDistance-L,v=e.maxSpikeDistance-L;var z=i.getDistanceFunction(s,f,m,I);if(i.getClosest(w,z,e),!1===e.index)return[];var O=w[e.index],R=S.line.color,D=(S.marker||{}).color;a.opacity(R)&&S.line.width?e.color=R:a.opacity(D)&&S.boxpoints?e.color=D:e.color=S.fillcolor,e[l+"0"]=u.c2p(O.pos+A.bPos-b,!0),e[l+"1"]=u.c2p(O.pos+A.bPos+x,!0),e[l+"LabelVal"]=void 0!==O.orig_p?O.orig_p:O.pos;var j=l+"Spike";e.spikeDistance=I(O)*v/y,e[j]=u.c2p(O.pos,!0);var F=S.boxmean||"sd"===S.sizemode||(S.meanline||{}).visible,B=S.boxpoints||S.points,N=B&&F?["max","uf","q3","med","mean","q1","lf","min"]:B&&!F?["max","uf","q3","med","q1","lf","min"]:!B&&F?["max","q3","med","mean","q1","min"]:["max","q3","med","q1","min"],U=h.range[1]<h.range[0];S.orientation===(U?"v":"h")&&N.reverse();for(var V=e.spikeDistance,q=e[j],H=[],G=0;G<N.length;G++){var W=N[G];if(W in O){var $=O[W],Z=h.c2p($,!0),X=n.extendFlat({},e);X.attr=W,X[c+"0"]=X[c+"1"]=Z,X[c+"LabelVal"]=$,X[c+"Label"]=(A.labels?A.labels[W]+" ":"")+r.hoverLabelText(h,$,S[c+"hoverformat"]),X.hoverOnBox=!0,"mean"!==W||!("sd"in O)||"sd"!==S.boxmean&&"sd"!==S.sizemode||(X[c+"err"]=O.sd),X.hovertemplate=!1,H.push(X)}}e.name="",e.spikeDistance=void 0,e[j]=void 0;for(var Y=0;Y<H.length;Y++)"med"!==H[Y].attr?(H[Y].name="",H[Y].spikeDistance=void 0,H[Y][j]=void 0):(H[Y].spikeDistance=V,H[Y][j]=q);return H}function l(e,t,r){for(var a,s,l,c=e.cd,u=e.xa,h=e.ya,p=c[0].trace,d=u.c2p(t),f=h.c2p(r),m=i.quadrature((function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(u.c2p(e.x)-d)-t,1-3/t)}),(function(e){var t=Math.max(3,e.mrc||0);return Math.max(Math.abs(h.c2p(e.y)-f)-t,1-3/t)})),g=!1,y=0;y<c.length;y++){s=c[y];for(var v=0;v<(s.pts||[]).length;v++){var x=m(l=s.pts[v]);x<=e.distance&&(e.distance=x,g=[y,v])}}if(!g)return!1;l=(s=c[g[0]]).pts[g[1]];var b=u.c2p(l.x,!0),_=h.c2p(l.y,!0),w=l.mrc||1;a=n.extendFlat({},e,{index:l.i,color:(p.marker||{}).color,name:p.name,x0:b-w,x1:b+w,y0:_-w,y1:_+w,spikeDistance:e.distance,hovertemplate:p.hovertemplate});var k,T=s.orig_p,S=void 0!==T?T:s.pos;return"h"===p.orientation?(k=h,a.xLabelVal=l.x,a.yLabelVal=S):(k=u,a.xLabelVal=S,a.yLabelVal=l.y),a[k._id.charAt(0)+"Spike"]=k.c2p(s.pos,!0),o(l,p,a),a}t.exports={hoverPoints:function(e,t,r,n){var i,a=e.cd[0].trace.hoveron,o=[];return-1!==a.indexOf("boxes")&&(o=o.concat(s(e,t,r,n))),-1!==a.indexOf("points")&&(i=l(e,t,r)),"closest"===n?i?[i]:o:i?(o.push(i),o):o},hoverOnBoxes:s,hoverOnPoints:l}}}),go=p({"src/traces/box/event_data.js"(e,t){t.exports=function(e,t){return t.hoverOnBox&&(e.hoverOnBox=t.hoverOnBox),"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),yo=p({"src/traces/box/select.js"(e,t){t.exports=function(e,t){var r,n,i=e.cd,a=e.xaxis,o=e.yaxis,s=[];if(!1===t)for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++)i[r].pts[n].selected=0;else for(r=0;r<i.length;r++)for(n=0;n<(i[r].pts||[]).length;n++){var l=i[r].pts[n],c=a.c2p(l.x),u=o.c2p(l.y);t.contains([c,u],null,l.i,e)?(s.push({pointNumber:l.i,x:a.c2d(l.x),y:o.c2d(l.y)}),l.selected=1):l.selected=0}return s}}}),vo=p({"src/traces/box/index.js"(e,t){t.exports={attributes:oo(),layoutAttributes:so(),supplyDefaults:lo().supplyDefaults,crossTraceDefaults:lo().crossTraceDefaults,supplyLayoutDefaults:co().supplyLayoutDefaults,calc:uo(),crossTraceCalc:ho().crossTraceCalc,plot:po().plot,style:fo().style,styleOnSelect:fo().styleOnSelect,hoverPoints:mo().hoverPoints,eventData:go(),selectPoints:yo(),moduleType:"trace",name:"box",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","boxLayout","zoomScale"],meta:{}}}}),xo=p({"lib/box.js"(e,t){t.exports=vo()}}),bo=p({"src/traces/heatmap/attributes.js"(e,t){var r=wn(),n=N(),i=D(),a=Et().axisHoverFormat,o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=Lt(),c=R().extendFlat;t.exports=c({z:{valType:"data_array",editType:"calc"},x:c({},r.x,{impliedEdits:{xtype:"array"}}),x0:c({},r.x0,{impliedEdits:{xtype:"scaled"}}),dx:c({},r.dx,{impliedEdits:{xtype:"scaled"}}),y:c({},r.y,{impliedEdits:{ytype:"array"}}),y0:c({},r.y0,{impliedEdits:{ytype:"scaled"}}),dy:c({},r.dy,{impliedEdits:{ytype:"scaled"}}),xperiod:c({},r.xperiod,{impliedEdits:{xtype:"scaled"}}),yperiod:c({},r.yperiod,{impliedEdits:{ytype:"scaled"}}),xperiod0:c({},r.xperiod0,{impliedEdits:{xtype:"scaled"}}),yperiod0:c({},r.yperiod0,{impliedEdits:{ytype:"scaled"}}),xperiodalignment:c({},r.xperiodalignment,{impliedEdits:{xtype:"scaled"}}),yperiodalignment:c({},r.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:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:o(),texttemplate:s({arrayOk:!1,editType:"plot"},{keys:["x","y","z","text"]}),textfont:i({editType:"plot",autoSize:!0,autoColor:!0,colorEditType:"style"}),showlegend:c({},n.showlegend,{dflt:!1}),zorder:r.zorder},l("",{cLetter:"z",autoColorDflt:!1}))}}),_o=p({"src/traces/heatmap/xyz_defaults.js"(e,t){var r=k(),n=st(),i=Ve();function a(e,t){var r=t(e);return"scaled"===(r?t(e+"type","array"):"scaled")&&(t(e+"0"),t("d"+e)),r}t.exports=function(e,t,o,s,l,c){var u,h,p=o("z");if(l=l||"x",c=c||"y",void 0===p||!p.length)return 0;if(n.isArray1D(p)){u=o(l),h=o(c);var d=n.minRowLength(u),f=n.minRowLength(h);if(0===d||0===f)return 0;t._length=Math.min(d,f,p.length)}else{if(u=a(l,o),h=a(c,o),!function(e){for(var t,i=!0,a=!1,o=!1,s=0;s<e.length;s++){if(t=e[s],!n.isArrayOrTypedArray(t)){i=!1;break}t.length>0&&(a=!0);for(var l=0;l<t.length;l++)if(r(t[l])){o=!0;break}}return i&&a&&o}(p))return 0;o("transpose"),t._length=null}return i.getComponentMethod("calendars","handleTraceDefaults")(e,t,[l,c],s),!0}}}),wo=p({"src/traces/heatmap/label_defaults.js"(e,t){var r=st();t.exports=function(e,t){e("texttemplate");var n=r.extendFlat({},t.font,{color:"auto",size:"auto"});r.coerceFont(e,"textfont",n)}}}),ko=p({"src/traces/heatmap/style_defaults.js"(e,t){t.exports=function(e,t,r){!1===r("zsmooth")&&(r("xgap"),r("ygap")),r("zhoverformat")}}}),To=p({"src/traces/heatmap/defaults.js"(e,t){var r=st(),n=_o(),i=wo(),a=Hn(),o=ko(),s=Vt(),l=bo();t.exports=function(e,t,c,u){function h(n,i){return r.coerce(e,t,l,n,i)}n(e,t,h,u)?(a(e,t,u,h),h("xhoverformat"),h("yhoverformat"),h("text"),h("hovertext"),h("hovertemplate"),i(h,u),o(e,t,h,u),h("hoverongaps"),h("connectgaps",r.isArray1D(t.z)&&!1!==t.zsmooth),s(e,t,u,h,{prefix:"",cLetter:"z"}),h("zorder")):t.visible=!1}}}),So=p({"src/traces/histogram/bin_functions.js"(e,t){var r=k();t.exports={count:function(e,t,r){return r[e]++,1},sum:function(e,t,n,i){var a=i[t];return r(a)?(a=Number(a),n[e]+=a,a):0},avg:function(e,t,n,i,a){var o=i[t];return r(o)&&(o=Number(o),n[e]+=o,a[e]++),0},min:function(e,t,n,i){var a=i[t];if(r(a)){if(a=Number(a),!r(n[e]))return n[e]=a,a;if(n[e]>a){var o=a-n[e];return n[e]=a,o}}return 0},max:function(e,t,n,i){var a=i[t];if(r(a)){if(a=Number(a),!r(n[e]))return n[e]=a,a;if(n[e]<a){var o=a-n[e];return n[e]=a,o}}return 0}}}}),Ao=p({"src/traces/histogram/norm_functions.js"(e,t){t.exports={percent:function(e,t){for(var r=e.length,n=100/t,i=0;i<r;i++)e[i]*=n},probability:function(e,t){for(var r=e.length,n=0;n<r;n++)e[n]/=t},density:function(e,t,r,n){var i=e.length;n=n||1;for(var a=0;a<i;a++)e[a]*=r[a]*n},"probability density":function(e,t,r,n){var i=e.length;n&&(t/=n);for(var a=0;a<i;a++)e[a]*=r[a]/t}}}}),Mo=p({"src/traces/histogram/average.js"(e,t){t.exports=function(e,t){for(var r=e.length,n=0,i=0;i<r;i++)t[i]?(e[i]/=t[i],n+=e[i]):e[i]=null;return n}}}),Eo=p({"src/traces/histogram/bin_label_vals.js"(e,t){var r=T(),n=r.ONEAVGYEAR,i=r.ONEAVGMONTH,a=r.ONEDAY,o=r.ONEHOUR,s=r.ONEMIN,l=r.ONESEC,c=nr().tickIncrement;function u(e,t,r,n){if(e*t<=0)return 1/0;for(var i=Math.abs(t-e),a="date"===r.type,o=h(i,a),s=0;s<10;s++){var l=h(80*o,a);if(o===l)break;if(!p(l,e,t,a,r,n))break;o=l}return o}function h(e,t){return t&&e>l?e>a?e>1.1*n?n:e>1.1*i?i:a:e>o?o:e>s?s:l:Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function p(e,t,r,i,o,s){if(i&&e>a){var l=d(t,o,s),c=d(r,o,s),u=e===n?0:1;return l[u]!==c[u]}return Math.floor(r/e)-Math.floor(t/e)>.1}function d(e,t,r){var i=t.c2d(e,n,r).split("-");return""===i[0]&&(i.unshift(),i[0]="-"+i[0]),i}t.exports=function(e,t,r,i,o){var s,l,h=-1.1*t,p=-.1*t,d=e-p,f=r[0],m=r[1],g=Math.min(u(f+p,f+d,i,o),u(m+p,m+d,i,o)),y=Math.min(u(f+h,f+p,i,o),u(m+h,m+p,i,o));if(g>y&&y<Math.abs(m-f)/4e3?(s=g,l=!1):(s=Math.min(g,y),l=!0),"date"===i.type&&s>a){var v=s===n?1:6,x=s===n?"M12":"M1";return function(t,r){var a=i.c2d(t,n,o),s=a.indexOf("-",v);s>0&&(a=a.substr(0,s));var u=i.d2c(a,0,o);if(u<t){var h=c(u,x,!1,o);(u+h)/2<t+e&&(u=h)}return r&&l?c(u,x,!0,o):u}}return function(t,r){var n=s*Math.round(t/s);return n+s/10<t&&n+.9*s<t+e&&(n+=s),r&&l&&(n-=s),n}}}}),Co=p({"src/traces/histogram/calc.js"(e,t){var r=k(),n=st(),i=Ve(),a=nr(),o=Xa(),s=So(),l=Ao(),c=Mo(),u=Eo();function h(e,t,o,s,l){var c,u,p,d,f,m,g,y=s+"bins",v=e._fullLayout,x=t["_"+s+"bingroup"],b=v._histogramBinOpts[x],_="overlay"===v.barmode,w=function(e){return o.r2c(e,0,d)},k=function(e){return o.c2r(e,0,d)},T="date"===o.type?function(e){return e||0===e?n.cleanDate(e,null,d):null}:function(e){return r(e)?Number(e):null};function S(e,t,r){t[e+"Found"]?(t[e]=T(t[e]),null===t[e]&&(t[e]=r[e])):(m[e]=t[e]=r[e],n.nestedProperty(u[0],y+"."+e).set(r[e]))}if(t["_"+s+"autoBinFinished"])delete t["_"+s+"autoBinFinished"];else{u=b.traces;var A=[],M=!0,E=!1,C=!1;for(c=0;c<u.length;c++)if((p=u[c]).visible){var P=b.dirs[c];f=p["_"+P+"pos0"]=o.makeCalcdata(p,P),A=n.concat(A,f),delete p["_"+s+"autoBinFinished"],!0===t.visible&&(M?M=!1:(delete p._autoBin,p["_"+s+"autoBinFinished"]=1),i.traceIs(p,"2dMap")&&(E=!0),"histogram2dcontour"===p.type&&(C=!0))}d=u[0][s+"calendar"];var L=a.autoBin(A,o,b.nbins,E,d,b.sizeFound&&b.size),I=u[0]._autoBin={};if(m=I[b.dirs[0]]={},C&&(b.size||(L.start=k(a.tickIncrement(w(L.start),L.size,!0,d))),void 0===b.end&&(L.end=k(a.tickIncrement(w(L.end),L.size,!1,d)))),_&&!i.traceIs(t,"2dMap")&&0===L._dataSpan&&"category"!==o.type&&"multicategory"!==o.type&&""===t.bingroup&&"undefined"===typeof t.xbins){if(l)return[L,f,!0];L=function(e,t,r,i,a){var o,s,l,c=e._fullLayout,u=function(e,t){for(var r=t.xaxis,n=t.yaxis,i=t.orientation,a=[],o=e._fullData,s=0;s<o.length;s++){var l=o[s];"histogram"===l.type&&!0===l.visible&&l.orientation===i&&l.xaxis===r&&l.yaxis===n&&a.push(l)}return a}(e,t),p=!1,d=1/0,f=[t];for(o=0;o<u.length;o++)if((s=u[o])===t)p=!0;else if(p){var m=h(e,s,r,i,!0),g=m[0],y=m[2];s["_"+i+"autoBinFinished"]=1,s["_"+i+"pos0"]=m[1],y?f.push(s):d=Math.min(d,g.size)}else l=c._histogramBinOpts[s["_"+i+"bingroup"]],d=Math.min(d,l.size||s[a].size);var v=new Array(f.length);for(o=0;o<f.length;o++)for(var x=f[o]["_"+i+"pos0"],b=0;b<x.length;b++)if(void 0!==x[b]){v[o]=x[b];break}for(isFinite(d)||(d=n.distinctVals(v).minDiff),o=0;o<f.length;o++){var _=(s=f[o])[i+"calendar"],w={start:r.c2r(v[o]-d/2,0,_),end:r.c2r(v[o]+d/2,0,_),size:d};s._input[a]=s[a]=w,(l=c._histogramBinOpts[s["_"+i+"bingroup"]])&&n.extendFlat(l,w)}return t[a]}(e,t,o,s,y)}(g=p.cumulative||{}).enabled&&"include"!==g.currentbin&&("decreasing"===g.direction?L.start=k(a.tickIncrement(w(L.start),L.size,!0,d)):L.end=k(a.tickIncrement(w(L.end),L.size,!1,d))),b.size=L.size,b.sizeFound||(m.size=L.size,n.nestedProperty(u[0],y+".size").set(L.size)),S("start",b,L),S("end",b,L)}f=t["_"+s+"pos0"],delete t["_"+s+"pos0"];var z=t._input[y]||{},O=n.extendFlat({},b),R=b.start,D=o.r2l(z.start),j=void 0!==D;if((b.startFound||j)&&D!==o.r2l(R)){var F=j?D:n.aggNums(Math.min,null,f),B={type:"category"===o.type||"multicategory"===o.type?"linear":o.type,r2l:o.r2l,dtick:b.size,tick0:R,calendar:d,range:[F,a.tickIncrement(F,b.size,!1,d)].map(o.l2r)},N=a.tickFirst(B);N>o.r2l(F)&&(N=a.tickIncrement(N,b.size,!0,d)),O.start=o.l2r(N),j||n.nestedProperty(t,y+".start").set(O.start)}var U=b.end,V=o.r2l(z.end),q=void 0!==V;if((b.endFound||q)&&V!==o.r2l(U)){var H=q?V:n.aggNums(Math.max,null,f);O.end=o.l2r(H),q||n.nestedProperty(t,y+".start").set(O.end)}var G="autobin"+s;return!1===t._input[G]&&(t._input[y]=n.extendFlat({},t[y]||{}),delete t._input[G],delete t[G]),[O,f]}t.exports={calc:function(e,t){var i,p,d,f,m=[],g=[],y="h"===t.orientation,v=a.getFromId(e,y?t.yaxis:t.xaxis),x=y?"y":"x",b={x:"y",y:"x"}[x],_=t[x+"calendar"],w=t.cumulative,k=h(e,t,v,x),T=k[0],S=k[1],A="string"===typeof T.size,M=[],E=A?M:T,C=[],P=[],L=[],I=0,z=t.histnorm,O=t.histfunc,R=-1!==z.indexOf("density");w.enabled&&R&&(z=z.replace(/ ?density$/,""),R=!1);var D,j="max"===O||"min"===O?null:0,F=s.count,B=l[z],N=!1,U=function(e){return v.r2c(e,0,_)};for(n.isArrayOrTypedArray(t[b])&&"count"!==O&&(D=t[b],N="avg"===O,F=s[O]),i=U(T.start),d=U(T.end)+(i-a.tickIncrement(i,T.size,!1,_))/1e6;i<d&&m.length<1e6&&(p=a.tickIncrement(i,T.size,!1,_),m.push((i+p)/2),g.push(j),L.push([]),M.push(i),R&&C.push(1/(p-i)),N&&P.push(0),!(p<=i));)i=p;M.push(i),A||"date"!==v.type||(E={start:U(E.start),end:U(E.end),size:E.size}),e._fullLayout._roundFnOpts||(e._fullLayout._roundFnOpts={});var V=t["_"+x+"bingroup"],q={leftGap:1/0,rightGap:1/0};V&&(e._fullLayout._roundFnOpts[V]||(e._fullLayout._roundFnOpts[V]=q),q=e._fullLayout._roundFnOpts[V]);var H,G=g.length,W=!0,$=q.leftGap,Z=q.rightGap,X={};for(i=0;i<S.length;i++){var Y=S[i];(f=n.findBin(Y,E))>=0&&f<G&&(I+=F(f,i,g,D,P),W&&L[f].length&&Y!==S[L[f][0]]&&(W=!1),L[f].push(i),X[i]=f,$=Math.min($,Y-M[f]),Z=Math.min(Z,M[f+1]-Y))}q.leftGap=$,q.rightGap=Z,W||(H=function(t,r){return function(){var n=e._fullLayout._roundFnOpts[V];return u(n.leftGap,n.rightGap,M,v,_)(t,r)}}),N&&(I=c(g,P)),B&&B(g,I,C),w.enabled&&function(e,t,r){var n,i,a;function o(t){a=e[t],e[t]/=2}function s(t){i=e[t],e[t]=a+i/2,a+=i}if("half"===r)if("increasing"===t)for(o(0),n=1;n<e.length;n++)s(n);else for(o(e.length-1),n=e.length-2;n>=0;n--)s(n);else if("increasing"===t){for(n=1;n<e.length;n++)e[n]+=e[n-1];"exclude"===r&&(e.unshift(0),e.pop())}else{for(n=e.length-2;n>=0;n--)e[n]+=e[n+1];"exclude"===r&&(e.push(0),e.shift())}}(g,w.direction,w.currentbin);var K=Math.min(m.length,g.length),J=[],Q=0,ee=K-1;for(i=0;i<K;i++)if(g[i]){Q=i;break}for(i=K-1;i>=Q;i--)if(g[i]){ee=i;break}for(i=Q;i<=ee;i++)if(r(m[i])&&r(g[i])){var te={p:m[i],s:g[i],b:0};w.enabled||(te.pts=L[i],W?te.ph0=te.ph1=L[i].length?S[L[i][0]]:m[i]:(t._computePh=!0,te.ph0=H(M[i]),te.ph1=H(M[i+1],!0))),J.push(te)}return 1===J.length&&(J[0].width1=a.tickIncrement(J[0].p,T.size,!1,_)-J[0].p),o(J,t),n.isArrayOrTypedArray(t.selectedpoints)&&n.tagSelected(J,t,X),J},calcAllAutoBins:h}}}),Po=p({"src/traces/histogram2d/calc.js"(e,t){var r=st(),n=nr(),i=So(),a=Ao(),o=Mo(),s=Eo(),l=Co().calcAllAutoBins;function c(e,t,r,n){var i,a=new Array(e);if(n)for(i=0;i<e;i++)a[i]=1/(t[i+1]-t[i]);else{var o=1/r;for(i=0;i<e;i++)a[i]=o}return a}function u(e,t){return{start:e(t.start),end:e(t.end),size:t.size}}function h(e,t,r,n,i,a){var o,l=e.length-1,c=new Array(l),u=s(r,n,e,i,a);for(o=0;o<l;o++){var h=(t||[])[o];c[o]=void 0===h?[u(e[o]),u(e[o+1],!0)]:[h,h]}return c}t.exports=function(e,t){var s,p,d,f,m=n.getFromId(e,t.xaxis),g=n.getFromId(e,t.yaxis),y=t.xcalendar,v=t.ycalendar,x=function(e){return m.r2c(e,0,y)},b=function(e){return g.r2c(e,0,v)},_=l(e,t,m,"x"),w=_[0],k=_[1],T=l(e,t,g,"y"),S=T[0],A=T[1],M=t._length;k.length>M&&k.splice(M,k.length-M),A.length>M&&A.splice(M,A.length-M);var E=[],C=[],P=[],L="string"===typeof w.size,I="string"===typeof S.size,z=[],O=[],R=L?z:w,D=I?O:S,j=0,F=[],B=[],N=t.histnorm,U=t.histfunc,V=-1!==N.indexOf("density"),q="max"===U||"min"===U?null:0,H=i.count,G=a[N],W=!1,$=[],Z=[],X="z"in t?t.z:"marker"in t&&Array.isArray(t.marker.color)?t.marker.color:"";X&&"count"!==U&&(W="avg"===U,H=i[U]);var Y=w.size,K=x(w.start),J=x(w.end)+(K-n.tickIncrement(K,Y,!1,y))/1e6;for(s=K;s<J;s=n.tickIncrement(s,Y,!1,y))C.push(q),z.push(s),W&&P.push(0);z.push(s);var Q,ee=C.length,te=(s-K)/ee,re=(Q=K+te/2,m.c2r(Q,0,y)),ne=S.size,ie=b(S.start),ae=b(S.end)+(ie-n.tickIncrement(ie,ne,!1,v))/1e6;for(s=ie;s<ae;s=n.tickIncrement(s,ne,!1,v)){E.push(C.slice()),O.push(s);var oe=new Array(ee);for(p=0;p<ee;p++)oe[p]=[];B.push(oe),W&&F.push(P.slice())}O.push(s);var se=E.length,le=(s-ie)/se,ce=function(e){return g.c2r(e,0,v)}(ie+le/2);V&&($=c(C.length,R,te,L),Z=c(E.length,D,le,I)),L||"date"!==m.type||(R=u(x,R)),I||"date"!==g.type||(D=u(b,D));var ue=!0,he=!0,pe=new Array(ee),de=new Array(se),fe=1/0,me=1/0,ge=1/0,ye=1/0;for(s=0;s<M;s++){var ve=k[s],xe=A[s];d=r.findBin(ve,R),f=r.findBin(xe,D),d>=0&&d<ee&&f>=0&&f<se&&(j+=H(d,s,E[f],X,F[f]),B[f][d].push(s),ue&&(void 0===pe[d]?pe[d]=ve:pe[d]!==ve&&(ue=!1)),he&&(void 0===de[f]?de[f]=xe:de[f]!==xe&&(he=!1)),fe=Math.min(fe,ve-z[d]),me=Math.min(me,z[d+1]-ve),ge=Math.min(ge,xe-O[f]),ye=Math.min(ye,O[f+1]-xe))}if(W)for(f=0;f<se;f++)j+=o(E[f],F[f]);if(G)for(f=0;f<se;f++)G(E[f],j,$,Z[f]);return{x:k,xRanges:h(z,ue&&pe,fe,me,m,y),x0:re,dx:te,y:A,yRanges:h(O,he&&de,ge,ye,g,v),y0:ce,dy:le,z:E,pts:B}}}}),Lo=p({"src/traces/heatmap/convert_column_xyz.js"(e,t){var r=st(),n=T().BADNUM,i=ti();t.exports=function(e,t,a,o,s,l){var c=e._length,u=t.makeCalcdata(e,o),h=a.makeCalcdata(e,s);u=i(e,t,o,u).vals,h=i(e,a,s,h).vals;var p,d,f,m,g=e.text,y=void 0!==g&&r.isArray1D(g),v=e.hovertext,x=void 0!==v&&r.isArray1D(v),b=r.distinctVals(u),_=b.vals,w=r.distinctVals(h),k=w.vals,T=[],S=k.length,A=_.length;for(p=0;p<l.length;p++)T[p]=r.init2dArray(S,A);y&&(f=r.init2dArray(S,A)),x&&(m=r.init2dArray(S,A));var M=r.init2dArray(S,A);for(p=0;p<c;p++)if(u[p]!==n&&h[p]!==n){var E=r.findBin(u[p]+b.minDiff/2,_),C=r.findBin(h[p]+w.minDiff/2,k);for(d=0;d<l.length;d++){var P=e[l[d]];T[d][C][E]=P[p],M[C][E]=p}y&&(f[C][E]=g[p]),x&&(m[C][E]=v[p])}for(e["_"+o]=_,e["_"+s]=k,d=0;d<l.length;d++)e["_"+l[d]]=T[d];y&&(e._text=f),x&&(e._hovertext=m),t&&"category"===t.type&&(e["_"+o+"CategoryMap"]=_.map((function(e){return t._categories[e]}))),a&&"category"===a.type&&(e["_"+s+"CategoryMap"]=k.map((function(e){return a._categories[e]}))),e._after2before=M}}}),Io=p({"src/traces/heatmap/clean_2d_array.js"(e,t){var r=k(),n=st(),i=T().BADNUM;t.exports=function(e,t,a,o){var s,l,c,u,h,p;function d(e){if(r(e))return+e}if(t&&t.transpose){for(s=0,h=0;h<e.length;h++)s=Math.max(s,e[h].length);if(0===s)return!1;c=function(e){return e.length},u=function(e,t,r){return(e[r]||[])[t]}}else s=e.length,c=function(e,t){return e[t].length},u=function(e,t,r){return(e[t]||[])[r]};function f(e){if(t&&"carpet"!==t.type&&"contourcarpet"!==t.type&&e&&"category"===e.type&&t["_"+e._id.charAt(0)].length){var r=e._id.charAt(0),a={},o=t["_"+r+"CategoryMap"]||t[r];for(h=0;h<o.length;h++)a[o[h]]=h;return function(t){var r=a[e._categories[t]];return r+1?r:i}}return n.identity}var m=f(a),g=f(o);o&&"category"===o.type&&(s=o._categories.length);var y,v,x,b=new Array(s);for(h=0;h<s;h++)for(l=a&&"category"===a.type?a._categories.length:c(e,h),b[h]=new Array(l),p=0;p<l;p++)b[h][p]=d((y=e,v=g(h),x=m(p),v===i||x===i?i:u(y,v,x)));return b}}}),zo=p({"src/traces/heatmap/interp2d.js"(e,t){var r=st(),n=[[-1,0],[1,0],[0,-1],[0,1]];function i(e){return.5-.25*Math.min(1,.5*e)}function a(e,t,r){var i,a,o,s,l,c,u,h,p,d,f,m,g,y=0;for(s=0;s<t.length;s++){for(a=(i=t[s])[0],o=i[1],f=e[a][o],d=0,p=0,l=0;l<4;l++)(u=e[a+(c=n[l])[0]])&&void 0!==(h=u[o+c[1]])&&(0===d?m=g=h:(m=Math.min(m,h),g=Math.max(g,h)),p++,d+=h);if(0===p)throw"iterateInterp2d order is wrong: no defined neighbors";e[a][o]=d/p,void 0===f?p<4&&(y=1):(e[a][o]=(1+r)*e[a][o]-r*f,g>m&&(y=Math.max(y,Math.abs(e[a][o]-f)/(g-m))))}return y}t.exports=function(e,t){var n,o=1;for(a(e,t),n=0;n<t.length&&!(t[n][2]<4);n++);for(t=t.slice(n),n=0;n<100&&o>.01;n++)o=a(e,t,i(o));return o>.01&&r.log("interp2d didn't converge quickly",o),e}}}),Oo=p({"src/traces/heatmap/find_empties.js"(e,t){var r=st().maxRowLength;t.exports=function(e){var t,n,i,a,o,s,l,c,u=[],h={},p=[],d=e[0],f=[],m=[0,0,0],g=r(e);for(n=0;n<e.length;n++)for(t=f,f=d,d=e[n+1]||[],i=0;i<g;i++)void 0===f[i]&&((s=(void 0!==f[i-1]?1:0)+(void 0!==f[i+1]?1:0)+(void 0!==t[i]?1:0)+(void 0!==d[i]?1:0))?(0===n&&s++,0===i&&s++,n===e.length-1&&s++,i===f.length-1&&s++,s<4&&(h[[n,i]]=[n,i,s]),u.push([n,i,s])):p.push([n,i]));for(;p.length;){for(l={},c=!1,o=p.length-1;o>=0;o--)(s=((h[[(n=(a=p[o])[0])-1,i=a[1]]]||m)[2]+(h[[n+1,i]]||m)[2]+(h[[n,i-1]]||m)[2]+(h[[n,i+1]]||m)[2])/20)&&(l[a]=[n,i,s],p.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort((function(e,t){return t[2]-e[2]}))}}}),Ro=p({"src/traces/heatmap/make_bound_array.js"(e,t){var r=Ve(),n=st().isArrayOrTypedArray;t.exports=function(e,t,i,a,o,s){var l,c,u,h=[],p=r.traceIs(e,"contour"),d=r.traceIs(e,"histogram");if(n(t)&&t.length>1&&!d&&"category"!==s.type){var f=t.length;if(!(f<=o))return p?t.slice(0,o):t.slice(0,o+1);if(p)h=Array.from(t).slice(0,o);else if(1===o)h="log"===s.type?[.5*t[0],2*t[0]]:[t[0]-.5,t[0]+.5];else if("log"===s.type){for(h=[Math.pow(t[0],1.5)/Math.pow(t[1],.5)],u=1;u<f;u++)h.push(Math.sqrt(t[u-1]*t[u]));h.push(Math.pow(t[f-1],1.5)/Math.pow(t[f-2],.5))}else{for(h=[1.5*t[0]-.5*t[1]],u=1;u<f;u++)h.push(.5*(t[u-1]+t[u]));h.push(1.5*t[f-1]-.5*t[f-2])}if(f<o){var m,g=h[h.length-1];if("log"===s.type)for(m=g/h[h.length-2],u=f;u<o;u++)g*=m,h.push(g);else for(m=g-h[h.length-2],u=f;u<o;u++)g+=m,h.push(g)}}else{var y=e[s._id.charAt(0)+"calendar"];for(l=d?s.r2c(i,0,y):n(t)&&1===t.length?t[0]:void 0===i?0:("log"===s.type?s.d2c:s.r2c)(i,0,y),c=a||1,u=p?0:-.5;u<o;u++)h.push(l+c*u)}return h}}}),Do=p({"src/traces/heatmap/calc.js"(e,t){var r=Ve(),n=st(),i=nr(),a=ti(),o=Po(),s=Gt(),l=Lo(),c=Io(),u=zo(),h=Oo(),p=Ro(),d=T().BADNUM;function f(e){for(var t=[],r=e.length,n=0;n<r;n++){var i=e[n];i!==d&&t.push(i)}return t}t.exports=function(e,t){var m,g,y,v,x,b,_,w,k,T,S,A=i.getFromId(e,t.xaxis||"x"),M=i.getFromId(e,t.yaxis||"y"),E=r.traceIs(t,"contour"),C=r.traceIs(t,"histogram"),P=E?"best":t.zsmooth;if(A._minDtick=0,M._minDtick=0,C)v=(S=o(e,t)).orig_x,m=S.x,g=S.x0,y=S.dx,w=S.orig_y,x=S.y,b=S.y0,_=S.dy,k=S.z;else{var L=t.z;n.isArray1D(L)?(l(t,A,M,"x","y",["z"]),m=t._x,x=t._y,L=t._z):(v=t.x?A.makeCalcdata(t,"x"):[],w=t.y?M.makeCalcdata(t,"y"):[],m=a(t,A,"x",v).vals,x=a(t,M,"y",w).vals,t._x=m,t._y=x),g=t.x0,y=t.dx,b=t.y0,_=t.dy,k=c(L,t,A,M)}function I(e){P=t._input.zsmooth=t.zsmooth=!1,n.warn('cannot use zsmooth: "fast": '+e)}function z(e){if(e.length>1){var t=(e[e.length-1]-e[0])/(e.length-1),r=Math.abs(t/100);for(T=0;T<e.length-1;T++)if(Math.abs(e[T+1]-e[T]-t)>r)return!1}return!0}(A.rangebreaks||M.rangebreaks)&&(k=function(e,t,r){for(var n=[],i=-1,a=0;a<r.length;a++)if(t[a]!==d){n[++i]=[];for(var o=0;o<r[a].length;o++)e[o]!==d&&n[i].push(r[a][o])}return n}(m,x,k),C||(m=f(m),x=f(x),t._x=m,t._y=x)),C||!E&&!t.connectgaps||(t._emptypoints=h(k),u(k,t._emptypoints)),t._islinear=!1,"log"===A.type||"log"===M.type?"fast"===P&&I("log axis found"):z(m)?z(x)?t._islinear=!0:"fast"===P&&I("y scale is not linear"):"fast"===P&&I("x scale is not linear");var O=n.maxRowLength(k),R="scaled"===t.xtype?"":m,D=p(t,R,g,y,O,A),j="scaled"===t.ytype?"":x,F=p(t,j,b,_,k.length,M);t._extremes[A._id]=i.findExtremes(A,D),t._extremes[M._id]=i.findExtremes(M,F);var B={x:D,y:F,z:k,text:t._text||t.text,hovertext:t._hovertext||t.hovertext};if(t.xperiodalignment&&v&&(B.orig_x=v),t.yperiodalignment&&w&&(B.orig_y=w),R&&R.length===D.length-1&&(B.xCenter=R),j&&j.length===F.length-1&&(B.yCenter=j),C&&(B.xRanges=S.xRanges,B.yRanges=S.yRanges,B.pts=S.pts),E||s(e,t,{vals:k,cLetter:"z"}),E&&t.contours&&"heatmap"===t.contours.coloring){var N={type:"contour"===t.type?"heatmap":"histogram2d",xcalendar:t.xcalendar,ycalendar:t.ycalendar};B.xfill=p(N,R,g,y,O,A),B.yfill=p(N,j,b,_,k.length,M)}return[B]}}}),jo=p({"src/constants/pixelated_image.js"(e){e.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"]],e.STYLE=e.CSS_DECLARATIONS.map((function(e){return e.join(": ")+"; "})).join("")}}),Fo=p({"src/lib/supports_pixelated_image.js"(e,t){var r=jo(),n=Jt(),i=st(),a=null;t.exports=function(){if(null!==a)return a;a=!1;var e=i.isSafari()||i.isIOS();if(window.navigator.userAgent&&!e){var t=Array.from(r.CSS_DECLARATIONS).reverse(),o=window.CSS&&window.CSS.supports||window.supportsCSS;if("function"===typeof o)a=t.some((function(e){return o.apply(null,e)}));else{var s=n.tester.append("image").attr("style",r.STYLE),l=window.getComputedStyle(s.node()).imageRendering;a=t.some((function(e){var t=e[1];return l===t||l===t.toLowerCase()})),s.remove()}}return a}}}),Bo=p({"src/traces/heatmap/plot.js"(e,t){var r=v(),n=O(),i=Ve(),a=Jt(),o=nr(),s=st(),l=At(),c=di(),u=q(),h=Wt().extractOpts,p=Wt().makeColorScaleFuncFromTrace,d=Tt(),f=St().LINE_SPACING,m=Fo(),g=jo().STYLE,y="heatmap-label";function x(e){return e.selectAll("g."+y)}function b(e){x(e).remove()}function _(e,t){var r=t.length-2,n=s.constrain(s.findBin(e,t),0,r),i=t[n],a=t[n+1],o=s.constrain(n+(e-i)/(a-i)-.5,0,r),l=Math.round(o),c=Math.abs(o-l);return o&&o!==r&&c?{bin0:l,frac:c,bin1:Math.round(l+c/(o-l))}:{bin0:l,bin1:l,frac:0}}function w(e,t){var r=t.length-1,n=s.constrain(s.findBin(e,t),0,r),i=t[n],a=(e-i)/(t[n+1]-i)||0;return a<=0?{bin0:n,bin1:n,frac:0}:a<.5?{bin0:n,bin1:n+1,frac:a}:{bin0:n+1,bin1:n,frac:1-a}}function k(e,t,r){e[t]=r[0],e[t+1]=r[1],e[t+2]=r[2],e[t+3]=Math.round(255*r[3])}t.exports=function(e,t,v,T){var S=t.xaxis,A=t.yaxis;s.makeTraceGroups(T,v,"hm").each((function(t){var v,T,M,E,C,P,L,I,z=r.select(this),O=t[0],R=O.trace,D=R.xgap||0,j=R.ygap||0,F=O.z,B=O.x,N=O.y,U=O.xCenter,V=O.yCenter,q=i.traceIs(R,"contour"),H=q?"best":R.zsmooth,G=F.length,W=s.maxRowLength(F),$=!1,Z=!1;for(P=0;void 0===v&&P<B.length-1;)v=S.c2p(B[P]),P++;for(P=B.length-1;void 0===T&&P>0;)T=S.c2p(B[P]),P--;for(T<v&&(M=T,T=v,v=M,$=!0),P=0;void 0===E&&P<N.length-1;)E=A.c2p(N[P]),P++;for(P=N.length-1;void 0===C&&P>0;)C=A.c2p(N[P]),P--;C<E&&(M=E,E=C,C=M,Z=!0),q&&(U=B,V=N,B=O.xfill,N=O.yfill);var X="default";if(H?X="best"===H?"smooth":"fast":R._islinear&&0===D&&0===j&&m()&&(X="fast"),"fast"!==X){var Y="best"===H?0:.5;v=Math.max(-Y*S._length,v),T=Math.min((1+Y)*S._length,T),E=Math.max(-Y*A._length,E),C=Math.min((1+Y)*A._length,C)}var K,J,Q=Math.round(T-v),ee=Math.round(C-E);if(v>=S._length||T<=0||E>=A._length||C<=0)return z.selectAll("image").data([]).exit().remove(),void b(z);"fast"===X?(K=W,J=G):(K=Q,J=ee);var te=document.createElement("canvas");te.width=K,te.height=J;var re,ne,ie=te.getContext("2d",{willReadFrequently:!0}),ae=p(R,{noNumericCheck:!0,returnArray:!0});"fast"===X?(re=$?function(e){return W-1-e}:s.identity,ne=Z?function(e){return G-1-e}:s.identity):(re=function(e){return s.constrain(Math.round(S.c2p(B[e])-v),0,Q)},ne=function(e){return s.constrain(Math.round(A.c2p(N[e])-E),0,ee)});var oe,se,le,ce,ue=ne(0),he=[ue,ue],pe=$?0:1,de=Z?0:1,fe=0,me=0,ge=0,ye=0;function ve(e,t){if(void 0!==e){var r=ae(e);return r[0]=Math.round(r[0]),r[1]=Math.round(r[1]),r[2]=Math.round(r[2]),fe+=t,me+=r[0]*t,ge+=r[1]*t,ye+=r[2]*t,r}return[0,0,0,0]}function xe(e,t,r,n){var i=e[r.bin0];if(void 0===i)return ve(void 0,1);var a,o=e[r.bin1],s=t[r.bin0],l=t[r.bin1],c=o-i||0,u=s-i||0;return a=void 0===o?void 0===l?0:void 0===s?2*(l-i):2*(2*l-s-i)/3:void 0===l?void 0===s?0:2*(2*i-o-s)/3:void 0===s?2*(2*l-o-i)/3:l+i-o-s,ve(i+r.frac*c+n.frac*(u+r.frac*a))}if("default"!==X){var be,_e=0;try{be=new Uint8Array(K*J*4)}catch(gt){be=new Array(K*J*4)}if("smooth"===X){var we,ke,Te,Se=U||B,Ae=V||N,Me=new Array(Se.length),Ee=new Array(Ae.length),Ce=new Array(Q),Pe=U?w:_,Le=V?w:_;for(P=0;P<Se.length;P++)Me[P]=Math.round(S.c2p(Se[P])-v);for(P=0;P<Ae.length;P++)Ee[P]=Math.round(A.c2p(Ae[P])-E);for(P=0;P<Q;P++)Ce[P]=Pe(P,Me);for(L=0;L<ee;L++)for(ke=F[(we=Le(L,Ee)).bin0],Te=F[we.bin1],P=0;P<Q;P++,_e+=4)k(be,_e,ce=xe(ke,Te,Ce[P],we))}else for(L=0;L<G;L++)for(le=F[L],he=ne(L),P=0;P<W;P++)ce=ve(le[P],1),k(be,_e=4*(he*W+re(P)),ce);var Ie=ie.createImageData(K,J);try{Ie.data.set(be)}catch(gt){var ze=Ie.data,Oe=ze.length;for(L=0;L<Oe;L++)ze[L]=be[L]}ie.putImageData(Ie,0,0)}else{var Re=Math.floor(D/2),De=Math.floor(j/2);for(L=0;L<G;L++)if(le=F[L],he.reverse(),he[de]=ne(L+1),he[0]!==he[1]&&void 0!==he[0]&&void 0!==he[1])for(oe=[se=re(0),se],P=0;P<W;P++)oe.reverse(),oe[pe]=re(P+1),oe[0]!==oe[1]&&void 0!==oe[0]&&void 0!==oe[1]&&(ce=ve(le[P],(oe[1]-oe[0])*(he[1]-he[0])),ie.fillStyle="rgba("+ce.join(",")+")",ie.fillRect(oe[0]+Re,he[0]+De,oe[1]-oe[0]-D,he[1]-he[0]-j))}me=Math.round(me/fe),ge=Math.round(ge/fe),ye=Math.round(ye/fe);var je=n("rgb("+me+","+ge+","+ye+")");e._hmpixcount=(e._hmpixcount||0)+fe,e._hmlumcount=(e._hmlumcount||0)+fe*je.getLuminance();var Fe=z.selectAll("image").data(t);Fe.enter().append("svg:image").attr({xmlns:d.svg,preserveAspectRatio:"none"}),Fe.attr({height:ee,width:Q,x:v,y:E,"xlink:href":te.toDataURL("image/png")}),"fast"!==X||H||Fe.attr("style",g),b(z);var Be=R.texttemplate;if(Be){var Ne=h(R),Ue={type:"linear",range:[Ne.min,Ne.max],_separators:S._separators,_numFormat:S._numFormat},Ve="histogram2dcontour"===R.type,qe="contour"===R.type,He=qe?G-1:G,Ge=qe?1:0,We=qe?W-1:W,$e=[];for(P=qe?1:0;P<He;P++){var Ze;if(qe)Ze=O.y[P];else if(Ve){if(0===P||P===G-1)continue;Ze=O.y[P]}else if(O.yCenter)Ze=O.yCenter[P];else{if(P+1===G&&void 0===O.y[P+1])continue;Ze=(O.y[P]+O.y[P+1])/2}var Xe=Math.round(A.c2p(Ze));if(!(0>Xe||Xe>A._length))for(L=Ge;L<We;L++){var Ye;if(qe)Ye=O.x[L];else if(Ve){if(0===L||L===W-1)continue;Ye=O.x[L]}else if(O.xCenter)Ye=O.xCenter[L];else{if(L+1===W&&void 0===O.x[L+1])continue;Ye=(O.x[L]+O.x[L+1])/2}var Ke=Math.round(S.c2p(Ye));if(!(0>Ke||Ke>S._length)){var Je=c({x:Ye,y:Ze},R,e._fullLayout);Je.x=Ye,Je.y=Ze;var Qe=O.z[P][L];void 0===Qe?(Je.z="",Je.zLabel=""):(Je.z=Qe,Je.zLabel=o.tickText(Ue,Qe,"hover").text);var et=O.text&&O.text[P]&&O.text[P][L];void 0!==et&&!1!==et||(et=""),Je.text=et;var tt=s.texttemplateString(Be,Je,e._fullLayout._d3locale,Je,R._meta||{});if(tt){var rt=tt.split("<br>"),nt=rt.length,it=0;for(I=0;I<nt;I++)it=Math.max(it,rt[I].length);$e.push({l:nt,c:it,t:tt,x:Ke,y:Xe,z:Qe})}}}}var at=R.textfont,ot=at.size,st=e._fullLayout.font.size;if(!ot||"auto"===ot){var lt=1/0,ct=1/0,ut=0,ht=0;for(I=0;I<$e.length;I++){var pt=$e[I];if(ut=Math.max(ut,pt.l),ht=Math.max(ht,pt.c),I<$e.length-1){var dt=$e[I+1],ft=Math.abs(dt.x-pt.x),mt=Math.abs(dt.y-pt.y);ft&&(lt=Math.min(lt,ft)),mt&&(ct=Math.min(ct,mt))}}isFinite(lt)&&isFinite(ct)?(lt-=D,ct-=j,lt/=ht,ct/=ut,lt/=f/2,ct/=f,ot=Math.min(Math.floor(lt),Math.floor(ct),st)):ot=st}if(ot<=0||!isFinite(ot))return;x(z).data($e).enter().append("g").classed(y,1).append("text").attr("text-anchor","middle").each((function(t){var n=r.select(this),i=at.color;i&&"auto"!==i||(i=u.contrast(void 0===t.z?e._fullLayout.plot_bgcolor:"rgba("+ae(t.z).join()+")")),n.attr("data-notex",1).call(l.positionText,function(e){return e.x}(t),function(e){return e.y-ot*(e.l*f/2-1)}(t)).call(a.font,{family:at.family,size:ot,color:i,weight:at.weight,style:at.style,variant:at.variant,textcase:at.textcase,lineposition:at.lineposition,shadow:at.shadow}).text(t.t).call(l.convertToTspans,e)}))}}))}}}),No=p({"src/traces/heatmap/colorbar.js"(e,t){t.exports={min:"zmin",max:"zmax"}}}),Uo=p({"src/traces/heatmap/style.js"(e,t){var r=v();t.exports=function(e){r.select(e).selectAll(".hm image").style("opacity",(function(e){return e.trace.opacity}))}}}),Vo=p({"src/traces/heatmap/hover.js"(e,t){var r=zr(),n=st(),i=n.isArrayOrTypedArray,a=nr(),o=Wt().extractOpts;t.exports=function(e,t,s,l,c){c||(c={});var u,h,p,d,f=c.isContour,m=e.cd[0],g=m.trace,y=e.xa,v=e.ya,x=m.x,b=m.y,_=m.z,w=m.xCenter,k=m.yCenter,T=m.zmask,S=g.zhoverformat,A=x,M=b;if(!1!==e.index){try{p=Math.round(e.index[1]),d=Math.round(e.index[0])}catch(N){return void n.error("Error hovering on heatmap, pointNumber must be [row,col], found:",e.index)}if(p<0||p>=_[0].length||d<0||d>_.length)return}else{if(r.inbox(t-x[0],t-x[x.length-1],0)>0||r.inbox(s-b[0],s-b[b.length-1],0)>0)return;if(f){var E;for(A=[2*x[0]-x[1]],E=1;E<x.length;E++)A.push((x[E]+x[E-1])/2);for(A.push([2*x[x.length-1]-x[x.length-2]]),M=[2*b[0]-b[1]],E=1;E<b.length;E++)M.push((b[E]+b[E-1])/2);M.push([2*b[b.length-1]-b[b.length-2]])}p=Math.max(0,Math.min(A.length-2,n.findBin(t,A))),d=Math.max(0,Math.min(M.length-2,n.findBin(s,M)))}var C,P,L=y.c2p(x[p]),I=y.c2p(x[p+1]),z=v.c2p(b[d]),O=v.c2p(b[d+1]);f?(C=m.orig_x||x,P=m.orig_y||b,I=L,u=C[p],O=z,h=P[d]):(C=m.orig_x||w||x,P=m.orig_y||k||b,u=w?C[p]:(C[p]+C[p+1])/2,h=k?P[d]:(P[d]+P[d+1])/2,y&&"category"===y.type&&(u=x[p]),v&&"category"===v.type&&(h=b[d]),g.zsmooth&&(L=I=y.c2p(u),z=O=v.c2p(h)));var R=_[d][p];if(T&&!T[d][p]&&(R=void 0),void 0!==R||g.hoverongaps){var D;i(m.hovertext)&&i(m.hovertext[d])?D=m.hovertext[d][p]:i(m.text)&&i(m.text[d])&&(D=m.text[d][p]);var j=o(g),F={type:"linear",range:[j.min,j.max],hoverformat:S,_separators:y._separators,_numFormat:y._numFormat},B=a.tickText(F,R,"hover").text;return[n.extendFlat(e,{index:g._after2before?g._after2before[d][p]:[d,p],distance:e.maxHoverDistance,spikeDistance:e.maxSpikeDistance,x0:L,x1:I,y0:z,y1:O,xLabelVal:u,yLabelVal:h,zLabelVal:R,zLabel:B,text:D})]}}}}),qo=p({"src/traces/heatmap/index.js"(e,t){t.exports={attributes:bo(),supplyDefaults:To(),calc:Do(),plot:Bo(),colorbar:No(),style:Uo(),hoverPoints:Vo(),moduleType:"trace",name:"heatmap",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","showLegend"],meta:{}}}}),Ho=p({"lib/heatmap.js"(e,t){t.exports=qo()}}),Go=p({"src/traces/histogram/bin_attributes.js"(e,t){t.exports=function(e,t){return{start:{valType:"any",editType:"calc"},end:{valType:"any",editType:"calc"},size:{valType:"any",editType:"calc"},editType:"calc"}}}}),Wo=p({"src/traces/histogram/constants.js"(e,t){t.exports={eventDataKeys:["binNumber"]}}}),$o=p({"src/traces/histogram/attributes.js"(e,t){var r=Ha(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=Oe().texttemplateAttrs,o=D(),s=Go(),l=Wo(),c=R().extendFlat;t.exports={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},xhoverformat:n("x"),yhoverformat:n("y"),text:c({},r.text,{}),hovertext:c({},r.hovertext,{}),orientation:r.orientation,histfunc:{valType:"enumerated",values:["count","sum","avg","min","max"],dflt:"count",editType:"calc"},histnorm:{valType:"enumerated",values:["","percent","probability","density","probability density"],dflt:"",editType:"calc"},cumulative:{enabled:{valType:"boolean",dflt:!1,editType:"calc"},direction:{valType:"enumerated",values:["increasing","decreasing"],dflt:"increasing",editType:"calc"},currentbin:{valType:"enumerated",values:["include","exclude","half"],dflt:"include",editType:"calc"},editType:"calc"},nbinsx:{valType:"integer",min:0,dflt:0,editType:"calc"},xbins:s("x",!0),nbinsy:{valType:"integer",min:0,dflt:0,editType:"calc"},ybins:s("y",!0),autobinx:{valType:"boolean",dflt:null,editType:"calc"},autobiny:{valType:"boolean",dflt:null,editType:"calc"},bingroup:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({},{keys:l.eventDataKeys}),texttemplate:a({arrayOk:!1,editType:"plot"},{keys:["label","value"]}),textposition:c({},r.textposition,{arrayOk:!1}),textfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),outsidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextfont:o({arrayOk:!1,editType:"plot",colorEditType:"style"}),insidetextanchor:r.insidetextanchor,textangle:r.textangle,cliponaxis:r.cliponaxis,constraintext:r.constraintext,marker:r.marker,offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,zorder:r.zorder}}}),Zo=p({"src/traces/histogram/defaults.js"(e,t){var r=Ve(),n=st(),i=q(),a=$a().handleText,o=Wa(),s=$o();t.exports=function(e,t,l,c){function u(r,i){return n.coerce(e,t,s,r,i)}var h=u("x"),p=u("y");u("cumulative.enabled")&&(u("cumulative.direction"),u("cumulative.currentbin")),u("text");var d=u("textposition");a(e,t,c,u,d,{moduleHasSelected:!0,moduleHasUnselected:!0,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),u("hovertext"),u("hovertemplate"),u("xhoverformat"),u("yhoverformat");var f=u("orientation",p&&!h?"h":"v"),m="v"===f?"x":"y",g="v"===f?"y":"x",y=h&&p?Math.min(n.minRowLength(h)&&n.minRowLength(p)):n.minRowLength(t[m]||[]);if(y){t._length=y,r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],c),t[g]&&u("histfunc"),u("histnorm"),u("autobin"+m),o(e,t,u,l,c),n.coerceSelectionMarkerOpacity(t,u);var v=(t.marker.line||{}).color,x=r.getComponentMethod("errorbars","supplyDefaults");x(e,t,v||i.defaultLine,{axis:"y"}),x(e,t,v||i.defaultLine,{axis:"x",inherit:"y"}),u("zorder")}else t.visible=!1}}}),Xo=p({"src/traces/histogram/cross_trace_defaults.js"(e,t){var r=st(),n=vt(),i=Ve().traceIs,a=Jn(),o=$a().validateCornerradius,s=r.nestedProperty,l=tn().getAxisGroup,c=[{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"}],u=["x","y"];t.exports=function(e,t){var h,p,d,f,m,g,y,v=t._histogramBinOpts={},x=[],b={},_=[];function w(e,t){return r.coerce(h._input,h,h._module.attributes,e,t)}function k(e){return"v"===e.orientation?"x":"y"}function T(e,i,a){var o=e.uid+"__"+a;i||(i=o);var s=function(e,r){return n.getFromTrace({_fullLayout:t},e,r).type}(e,a),l=e[a+"calendar"]||"",c=v[i],u=!0;c&&(s===c.axType&&l===c.calendar?(u=!1,c.traces.push(e),c.dirs.push(a)):(i=o,s!==c.axType&&r.warn(["Attempted to group the bins of trace",e.index,"set on a","type:"+s,"axis","with bins on","type:"+c.axType,"axis."].join(" ")),l!==c.calendar&&r.warn(["Attempted to group the bins of trace",e.index,"set with a",l,"calendar","with bins",c.calendar?"on a "+c.calendar+" calendar":"w/o a set calendar"].join(" ")))),u&&(v[i]={traces:[e],dirs:[a],axType:s,calendar:e[a+"calendar"]||""}),e["_"+a+"bingroup"]=i}for(m=0;m<e.length;m++)if(h=e[m],i(h,"histogram")){if(x.push(h),delete h._xautoBinFinished,delete h._yautoBinFinished,"histogram"===h.type){var S=w("marker.cornerradius",t.barcornerradius);h.marker&&(h.marker.cornerradius=o(S))}i(h,"2dMap")||a(h._input,h,t,w,t.barmode)}var A=t._alignmentOpts||{};for(m=0;m<x.length;m++){if(h=x[m],d="",!i(h,"2dMap")){if(f=k(h),"group"===t.barmode&&h.alignmentgroup){var M=h[f+"axis"],E=l(t,M)+h.orientation;(A[E]||{})[h.alignmentgroup]&&(d=E)}d||"overlay"===t.barmode||(d=l(t,h.xaxis)+l(t,h.yaxis)+k(h))}d?(b[d]||(b[d]=[]),b[d].push(h)):_.push(h)}for(d in b)if(1!==(p=b[d]).length){var C=!1;for(p.length&&(h=p[0],C=w("bingroup")),d=C||d,m=0;m<p.length;m++){var P=(h=p[m])._input.bingroup;P&&P!==d&&r.warn(["Trace",h.index,"must match","within bingroup",d+".","Ignoring its bingroup:",P,"setting."].join(" ")),h.bingroup=d,T(h,d,k(h))}}else _.push(p[0]);for(m=0;m<_.length;m++){h=_[m];var L=w("bingroup");if(i(h,"2dMap"))for(y=0;y<2;y++){var I=w((f=u[y])+"bingroup",L?L+"__"+f:null);T(h,I,f)}else T(h,L,k(h))}for(d in v){var z=v[d];for(p=z.traces,g=0;g<c.length;g++){var O,R,D=c[g],j=D.name;if("nbins"!==j||!z.sizeFound){for(m=0;m<p.length;m++){if(h=p[m],f=z.dirs[m],O=D.aStr[f],void 0!==s(h._input,O).get()){z[j]=w(O),z[j+"Found"]=!0;break}(R=(h._autoBin||{})[f]||{})[j]&&s(h,O).set(R[j])}if("start"===j||"end"===j)for(;m<p.length;m++)(h=p[m])["_"+f+"bingroup"]&&w(O,(R=(h._autoBin||{})[f]||{})[j]);"nbins"!==j||z.sizeFound||z.nbinsFound||(h=p[0],z[j]=w(O))}}}}}}),Yo=p({"src/traces/histogram/hover.js"(e,t){var r=to().hoverPoints,n=nr().hoverLabelText;t.exports=function(e,t,i,a,o){var s=r(e,t,i,a,o);if(s){var l=(e=s[0]).cd[e.index],c=e.cd[0].trace;if(!c.cumulative.enabled){var u="h"===c.orientation?"y":"x";e[u+"Label"]=n(e[u+"a"],[l.ph0,l.ph1],c[u+"hoverformat"])}return s}}}}),Ko=p({"src/traces/histogram/event_data.js"(e,t){t.exports=function(e,t,r,n,i){if(e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"zLabelVal"in t&&(e.z=t.zLabelVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),!(r.cumulative||{}).enabled){var a,o=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;if(e.pointNumbers=o,e.binNumber=e.pointNumber,delete e.pointNumber,delete e.pointIndex,r._indexToPoints){a=[];for(var s=0;s<o.length;s++)a=a.concat(r._indexToPoints[o[s]])}else a=o;e.pointIndices=a}return e}}}),Jo=p({"src/traces/histogram/index.js"(e,t){t.exports={attributes:$o(),layoutAttributes:Ga(),supplyDefaults:Zo(),crossTraceDefaults:Xo(),supplyLayoutDefaults:Za(),calc:Co().calc,crossTraceCalc:si().crossTraceCalc,plot:eo().plot,layerName:"barlayer",style:Qa().style,styleOnSelect:Qa().styleOnSelect,colorbar:pi(),hoverPoints:Yo(),selectPoints:no(),eventData:Ko(),moduleType:"trace",name:"histogram",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","bar","histogram","oriented","errorBarsOK","showLegend"],meta:{}}}}),Qo=p({"lib/histogram.js"(e,t){t.exports=Jo()}}),es=p({"src/traces/histogram2d/attributes.js"(e,t){var r=$o(),n=Go(),i=bo(),a=N(),o=Et().axisHoverFormat,s=Oe().hovertemplateAttrs,l=Oe().texttemplateAttrs,c=Lt(),u=R().extendFlat;t.exports=u({x:r.x,y:r.y,z:{valType:"data_array",editType:"calc"},marker:{color:{valType:"data_array",editType:"calc"},editType:"calc"},histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:n("x"),nbinsy:r.nbinsy,ybins:n("y"),autobinx:r.autobinx,autobiny:r.autobiny,bingroup:u({},r.bingroup,{}),xbingroup:u({},r.bingroup,{}),ybingroup:u({},r.bingroup,{}),xgap:i.xgap,ygap:i.ygap,zsmooth:i.zsmooth,xhoverformat:o("x"),yhoverformat:o("y"),zhoverformat:o("z",1),hovertemplate:s({},{keys:"z"}),texttemplate:l({arrayOk:!1,editType:"plot"},{keys:"z"}),textfont:i.textfont,showlegend:u({},a.showlegend,{dflt:!1})},c("",{cLetter:"z",autoColorDflt:!1}))}}),ts=p({"src/traces/histogram2d/sample_defaults.js"(e,t){var r=Ve(),n=st();t.exports=function(e,t,i,a){var o=i("x"),s=i("y"),l=n.minRowLength(o),c=n.minRowLength(s);l&&c?(t._length=Math.min(l,c),r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y"],a),(i("z")||i("marker.color"))&&i("histfunc"),i("histnorm"),i("autobinx"),i("autobiny")):t.visible=!1}}}),rs=p({"src/traces/histogram2d/defaults.js"(e,t){var r=st(),n=ts(),i=ko(),a=Vt(),o=wo(),s=es();t.exports=function(e,t,l,c){function u(n,i){return r.coerce(e,t,s,n,i)}n(e,t,u,c),!1!==t.visible&&(i(e,t,u,c),a(e,t,c,u,{prefix:"",cLetter:"z"}),u("hovertemplate"),o(u,c),u("xhoverformat"),u("yhoverformat"))}}}),ns=p({"src/traces/histogram2d/hover.js"(e,t){var r=Vo(),n=nr().hoverLabelText;t.exports=function(e,t,i,a,o){var s=r(e,t,i,a,o);if(s){var l=(e=s[0]).index,c=l[0],u=l[1],h=e.cd[0],p=h.trace,d=h.xRanges[u],f=h.yRanges[c];return e.xLabel=n(e.xa,[d[0],d[1]],p.xhoverformat),e.yLabel=n(e.ya,[f[0],f[1]],p.yhoverformat),s}}}}),is=p({"src/traces/histogram2d/index.js"(e,t){t.exports={attributes:es(),supplyDefaults:rs(),crossTraceDefaults:Xo(),calc:Do(),plot:Bo(),layerName:"heatmaplayer",colorbar:No(),style:Uo(),hoverPoints:ns(),eventData:Ko(),moduleType:"trace",name:"histogram2d",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","histogram","showLegend"],meta:{}}}}),as=p({"lib/histogram2d.js"(e,t){t.exports=is()}}),os=p({"src/constants/filter_ops.js"(e,t){t.exports={COMPARISON_OPS:["=","!=","<",">=",">","<="],COMPARISON_OPS2:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"],CONSTRAINT_REDUCTION:{"=":"=","<":"<","<=":"<",">":">",">=":">","[]":"[]","()":"[]","[)":"[]","(]":"[]","][":"][",")(":"][","](":"][",")[":"]["}}}}),ss=p({"src/traces/contour/attributes.js"(e,t){var r=bo(),n=wn(),i=Et(),a=i.axisHoverFormat,o=i.descriptionOnlyNumbers,s=Lt(),l=Ie().dash,c=D(),u=R().extendFlat,h=os(),p=h.COMPARISON_OPS2,d=h.INTERVAL_OPS,f=n.line;t.exports=u({z:r.z,x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:n.xperiod0,yperiod0:n.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,text:r.text,hovertext:r.hovertext,transpose:r.transpose,xtype:r.xtype,ytype:r.ytype,xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:u({},r.texttemplate,{}),textfont:u({},r.textfont,{}),hoverongaps:r.hoverongaps,connectgaps:u({},r.connectgaps,{}),fillcolor:{valType:"color",editType:"calc"},autocontour:{valType:"boolean",dflt:!0,editType:"calc",impliedEdits:{"contours.start":void 0,"contours.end":void 0,"contours.size":void 0}},ncontours:{valType:"integer",dflt:15,min:1,editType:"calc"},contours:{type:{valType:"enumerated",values:["levels","constraint"],dflt:"levels",editType:"calc"},start:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},end:{valType:"number",dflt:null,editType:"plot",impliedEdits:{"^autocontour":!1}},size:{valType:"number",dflt:null,min:0,editType:"plot",impliedEdits:{"^autocontour":!1}},coloring:{valType:"enumerated",values:["fill","heatmap","lines","none"],dflt:"fill",editType:"calc"},showlines:{valType:"boolean",dflt:!0,editType:"plot"},showlabels:{valType:"boolean",dflt:!1,editType:"plot"},labelfont:c({editType:"plot",colorEditType:"style"}),labelformat:{valType:"string",dflt:"",editType:"plot",description:o("contour label")},operation:{valType:"enumerated",values:[].concat(p).concat(d),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},editType:"calc",impliedEdits:{autocontour:!1}},line:{color:u({},f.color,{editType:"style+colorbars"}),width:{valType:"number",min:0,editType:"style+colorbars"},dash:l,smoothing:u({},f.smoothing,{}),editType:"plot"},zorder:n.zorder},s("",{cLetter:"z",autoColorDflt:!1,editTypeOverride:"calc"}))}}),ls=p({"src/traces/histogram2dcontour/attributes.js"(e,t){var r=es(),n=ss(),i=Lt(),a=Et().axisHoverFormat,o=R().extendFlat;t.exports=o({x:r.x,y:r.y,z:r.z,marker:r.marker,histnorm:r.histnorm,histfunc:r.histfunc,nbinsx:r.nbinsx,xbins:r.xbins,nbinsy:r.nbinsy,ybins:r.ybins,autobinx:r.autobinx,autobiny:r.autobiny,bingroup:r.bingroup,xbingroup:r.xbingroup,ybingroup:r.ybingroup,autocontour:n.autocontour,ncontours:n.ncontours,contours:n.contours,line:{color:n.line.color,width:o({},n.line.width,{dflt:.5}),dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z",1),hovertemplate:r.hovertemplate,texttemplate:n.texttemplate,textfont:n.textfont},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),cs=p({"src/traces/contour/contours_defaults.js"(e,t){t.exports=function(e,t,r,n){var i=n("contours.start"),a=n("contours.end"),o=!1===i||!1===a,s=r("contours.size");!(o?t.autocontour=!0:r("autocontour",!1))&&s||r("ncontours")}}}),us=p({"src/traces/contour/label_defaults.js"(e,t){var r=st();t.exports=function(e,t,n,i){if(i||(i={}),e("contours.showlabels")){var a=t.font;r.coerceFont(e,"contours.labelfont",a,{overrideDflt:{color:n}}),e("contours.labelformat")}!1!==i.hasHover&&e("zhoverformat")}}}),hs=p({"src/traces/contour/style_defaults.js"(e,t){var r=Vt(),n=us();t.exports=function(e,t,i,a,o){var s,l=i("contours.coloring"),c="";"fill"===l&&(s=i("contours.showlines")),!1!==s&&("lines"!==l&&(c=i("line.color","#000")),i("line.width",.5),i("line.dash")),"none"!==l&&(!0!==e.showlegend&&(t.showlegend=!1),t._dfltShowLegend=!1,r(e,t,a,i,{prefix:"",cLetter:"z"})),i("line.smoothing"),n(i,a,c,o)}}}),ps=p({"src/traces/histogram2dcontour/defaults.js"(e,t){var r=st(),n=ts(),i=cs(),a=hs(),o=wo(),s=ls();t.exports=function(e,t,l,c){function u(n,i){return r.coerce(e,t,s,n,i)}n(e,t,u,c),!1!==t.visible&&(i(e,t,u,(function(n){return r.coerce2(e,t,s,n)})),a(e,t,u,c),u("xhoverformat"),u("yhoverformat"),u("hovertemplate"),t.contours&&"heatmap"===t.contours.coloring&&o(u,c))}}}),ds=p({"src/traces/contour/set_contours.js"(e,t){var r=nr(),n=st();function i(e,t,n){var i={type:"linear",range:[e,t]};return r.autoTicks(i,(t-e)/(n||15)),i}t.exports=function(e,t){var a=e.contours;if(e.autocontour){var o=e.zmin,s=e.zmax;(e.zauto||void 0===o)&&(o=n.aggNums(Math.min,null,t)),(e.zauto||void 0===s)&&(s=n.aggNums(Math.max,null,t));var l=i(o,s,e.ncontours);a.size=l.dtick,a.start=r.tickFirst(l),l.range.reverse(),a.end=r.tickFirst(l),a.start===o&&(a.start+=a.size),a.end===s&&(a.end-=a.size),a.start>a.end&&(a.start=a.end=(a.start+a.end)/2),e._input.contours||(e._input.contours={}),n.extendFlat(e._input.contours,{start:a.start,end:a.end,size:a.size}),e._input.autocontour=!0}else if("constraint"!==a.type){var c,u=a.start,h=a.end,p=e._input.contours;u>h&&(a.start=p.start=h,h=a.end=p.end=u,u=a.start),a.size>0||(c=u===h?1:i(u,h,e.ncontours).dtick,p.size=a.size=c)}}}}),fs=p({"src/traces/contour/end_plus.js"(e,t){t.exports=function(e){return e.end+e.size/1e6}}}),ms=p({"src/traces/contour/calc.js"(e,t){var r=Wt(),n=Do(),i=ds(),a=fs();t.exports=function(e,t){var o=n(e,t),s=o[0].z;i(t,s);var l,c=t.contours,u=r.extractOpts(t);if("heatmap"===c.coloring&&u.auto&&!1===t.autocontour){var h=c.start,p=a(c),d=c.size||1,f=Math.floor((p-h)/d)+1;isFinite(d)||(d=1,f=1);var m=h-d/2;l=[m,m+f*d]}else l=s;return r.calc(e,t,{vals:l,cLetter:"z"}),o}}}),gs=p({"src/traces/contour/constants.js"(e,t){t.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}}}),ys=p({"src/traces/contour/make_crossings.js"(e,t){var r=gs();function n(e,t){var r=(t[0][0]>e?0:1)+(t[0][1]>e?0:2)+(t[1][1]>e?0:4)+(t[1][0]>e?0:8);return 5===r||10===r?e>(t[0][0]+t[0][1]+t[1][0]+t[1][1])/4?5===r?713:1114:5===r?104:208:15===r?0:r}t.exports=function(e){var t,i,a,o,s,l,c,u,h,p=e[0].z,d=p.length,f=p[0].length,m=2===d||2===f;for(i=0;i<d-1;i++)for(o=[],0===i&&(o=o.concat(r.BOTTOMSTART)),i===d-2&&(o=o.concat(r.TOPSTART)),t=0;t<f-1;t++)for(a=o.slice(),0===t&&(a=a.concat(r.LEFTSTART)),t===f-2&&(a=a.concat(r.RIGHTSTART)),s=t+","+i,l=[[p[i][t],p[i][t+1]],[p[i+1][t],p[i+1][t+1]]],h=0;h<e.length;h++)(c=n((u=e[h]).level,l))&&(u.crossings[s]=c,-1!==a.indexOf(c)&&(u.starts.push([t,i]),m&&-1!==a.indexOf(c,a.indexOf(c)+1)&&u.starts.push([t,i])))}}}),vs=p({"src/traces/contour/find_all_paths.js"(e,t){var r=st(),n=gs();function i(e,t,r,n){return Math.abs(e[0]-t[0])<r&&Math.abs(e[1]-t[1])<n}function a(e,t){var r=e[2]-t[2],n=e[3]-t[3];return Math.sqrt(r*r+n*n)}function o(e,t,o,l,c){var u,h=t.join(","),p=e.crossings[h],d=function(e,t,r){var i=0,a=0;return e>20&&t?208===e||1114===e?i=0===r[0]?1:-1:a=0===r[1]?1:-1:-1!==n.BOTTOMSTART.indexOf(e)?a=1:-1!==n.LEFTSTART.indexOf(e)?i=1:-1!==n.TOPSTART.indexOf(e)?a=-1:i=-1,[i,a]}(p,o,t),f=[s(e,t,[-d[0],-d[1]])],m=e.z.length,g=e.z[0].length,y=t.slice(),v=d.slice();for(u=0;u<1e4;u++){if(p>20?(p=n.CHOOSESADDLE[p][(d[0]||d[1])<0?0:1],e.crossings[h]=n.SADDLEREMAINDER[p]):delete e.crossings[h],!(d=n.NEWDELTA[p])){r.log("Found bad marching index:",p,t,e.level);break}f.push(s(e,t,d)),t[0]+=d[0],t[1]+=d[1],h=t.join(","),i(f[f.length-1],f[f.length-2],l,c)&&f.pop();var x=d[0]&&(t[0]<0||t[0]>g-2)||d[1]&&(t[1]<0||t[1]>m-2);if(t[0]===y[0]&&t[1]===y[1]&&d[0]===v[0]&&d[1]===v[1]||o&&x)break;p=e.crossings[h]}1e4===u&&r.log("Infinite loop in contour?");var b,_,w,k,T,S,A,M,E,C,P,L=i(f[0],f[f.length-1],l,c),I=0,z=.2*e.smoothing,O=[],R=0;for(u=1;u<f.length;u++)I+=A=a(f[u],f[u-1]),O.push(A);var D=I/O.length*z;function j(e){return f[e%f.length]}for(u=f.length-2;u>=R;u--)if((b=O[u])<D){for(w=0,_=u-1;_>=R&&b+O[_]<D;_--)b+=O[_];if(L&&u===f.length-2)for(w=0;w<_&&b+O[w]<D;w++)b+=O[w];T=u-_+w+1,S=Math.floor((u+_+w+2)/2),k=L||u!==f.length-2?L||-1!==_?T%2?j(S):[(j(S)[0]+j(S+1)[0])/2,(j(S)[1]+j(S+1)[1])/2]:f[0]:f[f.length-1],f.splice(_+1,u-_+1,k),u=_+1,w&&(R=w),L&&(u===f.length-2?f[w]=f[f.length-1]:0===u&&(f[f.length-1]=f[0]))}for(f.splice(0,R),u=0;u<f.length;u++)f[u].length=2;if(!(f.length<2))if(L)f.pop(),e.paths.push(f);else{o||r.log("Unclosed interior contour?",e.level,y.join(","),f.join("L"));var F=!1;for(M=0;M<e.edgepaths.length;M++)if(C=e.edgepaths[M],!F&&i(C[0],f[f.length-1],l,c)){f.pop(),F=!0;var B=!1;for(E=0;E<e.edgepaths.length;E++)if(i((P=e.edgepaths[E])[P.length-1],f[0],l,c)){B=!0,f.shift(),e.edgepaths.splice(M,1),E===M?e.paths.push(f.concat(P)):(E>M&&E--,e.edgepaths[E]=P.concat(f,C));break}B||(e.edgepaths[M]=f.concat(C))}for(M=0;M<e.edgepaths.length&&!F;M++)i((C=e.edgepaths[M])[C.length-1],f[0],l,c)&&(f.shift(),e.edgepaths[M]=C.concat(f),F=!0);F||e.edgepaths.push(f)}}function s(e,t,r){var n=t[0]+Math.max(r[0],0),i=t[1]+Math.max(r[1],0),a=e.z[i][n],o=e.xaxis,s=e.yaxis;if(r[1]){var l=(e.level-a)/(e.z[i][n+1]-a),c=(1!==l?(1-l)*o.c2l(e.x[n]):0)+(0!==l?l*o.c2l(e.x[n+1]):0);return[o.c2p(o.l2c(c),!0),s.c2p(e.y[i],!0),n+l,i]}var u=(e.level-a)/(e.z[i+1][n]-a),h=(1!==u?(1-u)*s.c2l(e.y[i]):0)+(0!==u?u*s.c2l(e.y[i+1]):0);return[o.c2p(e.x[n],!0),s.c2p(s.l2c(h),!0),n,i+u]}t.exports=function(e,t,n){var i,a,s,l;for(t=t||.01,n=n||.01,a=0;a<e.length;a++){for(s=e[a],l=0;l<s.starts.length;l++)o(s,s.starts[l],"edge",t,n);for(i=0;Object.keys(s.crossings).length&&i<1e4;)i++,o(s,Object.keys(s.crossings)[0].split(",").map(Number),void 0,t,n);1e4===i&&r.log("Infinite loop in contour?")}}}}),xs=p({"src/traces/contour/constraint_mapping.js"(e,t){var r=os(),n=k();function i(e,t){var i,a=Array.isArray(t);function o(e){return n(e)?+e:null}return-1!==r.COMPARISON_OPS2.indexOf(e)?i=o(a?t[0]:t):-1!==r.INTERVAL_OPS.indexOf(e)?i=a?[o(t[0]),o(t[1])]:[o(t),o(t)]:-1!==r.SET_OPS.indexOf(e)&&(i=a?t.map(o):[o(t)]),i}function a(e){return function(t){t=i(e,t);var r=Math.min(t[0],t[1]),n=Math.max(t[0],t[1]);return{start:r,end:n,size:n-r}}}function o(e){return function(t){return{start:t=i(e,t),end:1/0,size:1/0}}}t.exports={"[]":a("[]"),"][":a("]["),">":o(">"),"<":o("<"),"=":o("=")}}}),bs=p({"src/traces/contour/empty_pathinfo.js"(e,t){var r=st(),n=xs(),i=fs();t.exports=function(e,t,a){for(var o="constraint"===e.type?n[e._operation](e.value):e,s=o.size,l=[],c=i(o),u=a.trace._carpetTrace,h=u?{xaxis:u.aaxis,yaxis:u.baxis,x:a.a,y:a.b}:{xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y},p=o.start;p<c;p+=s)if(l.push(r.extendFlat({level:p,crossings:{},starts:[],edgepaths:[],paths:[],z:a.z,smoothing:a.trace.line.smoothing},h)),l.length>1e3){r.warn("Too many contours, clipping at 1000",e);break}return l}}}),_s=p({"src/traces/contour/convert_to_constraints.js"(e,t){var r=st();function n(e){return r.extendFlat({},e,{edgepaths:r.extendDeep([],e.edgepaths),paths:r.extendDeep([],e.paths),starts:r.extendDeep([],e.starts)})}t.exports=function(e,t){var i,a,o,s=function(e){return e.reverse()},l=function(e){return e};switch(t){case"=":case"<":return e;case">":for(1!==e.length&&r.warn("Contour data invalid for the specified inequality operation."),a=e[0],i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);return e;case"][":var c=s;s=l,l=c;case"[]":for(2!==e.length&&r.warn("Contour data invalid for the specified inequality range operation."),a=n(e[0]),o=n(e[1]),i=0;i<a.edgepaths.length;i++)a.edgepaths[i]=s(a.edgepaths[i]);for(i=0;i<a.paths.length;i++)a.paths[i]=s(a.paths[i]);for(i=0;i<a.starts.length;i++)a.starts[i]=s(a.starts[i]);for(;o.edgepaths.length;)a.edgepaths.push(l(o.edgepaths.shift()));for(;o.paths.length;)a.paths.push(l(o.paths.shift()));for(;o.starts.length;)a.starts.push(l(o.starts.shift()));return[a]}}}}),ws=p({"src/traces/contour/close_boundaries.js"(e,t){t.exports=function(e,t){var r,n=e[0],i=n.z;switch(t.type){case"levels":var a=Math.min(i[0][0],i[0][1]);for(r=0;r<e.length;r++){var o=e[r];o.prefixBoundary=!o.edgepaths.length&&(a>o.level||o.starts.length&&a===o.level)}break;case"constraint":if(n.prefixBoundary=!1,n.edgepaths.length)return;var s=n.x.length,l=n.y.length,c=-1/0,u=1/0;for(r=0;r<l;r++)u=Math.min(u,i[r][0]),u=Math.min(u,i[r][s-1]),c=Math.max(c,i[r][0]),c=Math.max(c,i[r][s-1]);for(r=1;r<s-1;r++)u=Math.min(u,i[0][r]),u=Math.min(u,i[l-1][r]),c=Math.max(c,i[0][r]),c=Math.max(c,i[l-1][r]);var h,p,d=t.value;switch(t._operation){case">":d>c&&(n.prefixBoundary=!0);break;case"<":(d<u||n.starts.length&&d===u)&&(n.prefixBoundary=!0);break;case"[]":h=Math.min(d[0],d[1]),((p=Math.max(d[0],d[1]))<u||h>c||n.starts.length&&p===u)&&(n.prefixBoundary=!0);break;case"][":h=Math.min(d[0],d[1]),p=Math.max(d[0],d[1]),h<u&&p>c&&(n.prefixBoundary=!0)}}}}}),ks=p({"src/traces/contour/plot.js"(e){var t=v(),r=st(),n=Jt(),i=Wt(),a=At(),o=nr(),s=er(),l=Bo(),c=ys(),u=vs(),h=bs(),p=_s(),d=ws(),f=gs(),m=f.LABELOPTIMIZER;function g(e,t){var i,a,o,s,l,c,u,h="",p=0,d=e.edgepaths.map((function(e,t){return t})),f=!0;function m(e){return Math.abs(e[1]-t[2][1])<.01}function g(e){return Math.abs(e[0]-t[0][0])<.01}function y(e){return Math.abs(e[0]-t[2][0])<.01}for(;d.length;){for(c=n.smoothopen(e.edgepaths[p],e.smoothing),h+=f?c:c.replace(/^M/,"L"),d.splice(d.indexOf(p),1),i=e.edgepaths[p][e.edgepaths[p].length-1],s=-1,o=0;o<4;o++){if(!i){r.log("Missing end?",p,e);break}for(u=i,Math.abs(u[1]-t[0][1])<.01&&!y(i)?a=t[1]:g(i)?a=t[0]:m(i)?a=t[3]:y(i)&&(a=t[2]),l=0;l<e.edgepaths.length;l++){var v=e.edgepaths[l][0];Math.abs(i[0]-a[0])<.01?Math.abs(i[0]-v[0])<.01&&(v[1]-i[1])*(a[1]-v[1])>=0&&(a=v,s=l):Math.abs(i[1]-a[1])<.01?Math.abs(i[1]-v[1])<.01&&(v[0]-i[0])*(a[0]-v[0])>=0&&(a=v,s=l):r.log("endpt to newendpt is not vert. or horz.",i,a,v)}if(i=a,s>=0)break;h+="L"+a}if(s===e.edgepaths.length){r.log("unclosed perimeter path");break}p=s,(f=-1===d.indexOf(p))&&(p=d[0],h+="Z")}for(p=0;p<e.paths.length;p++)h+=n.smoothclosed(e.paths[p],e.smoothing);return h}function y(e,t,n,i){var a=t.width/2,o=t.height/2,s=e.x,l=e.y,c=e.theta,u=Math.cos(c)*a,h=Math.sin(c)*a,p=(s>i.center?i.right-s:s-i.left)/(u+Math.abs(Math.sin(c)*o)),d=(l>i.middle?i.bottom-l:l-i.top)/(Math.abs(h)+Math.cos(c)*o);if(p<1||d<1)return 1/0;var f=m.EDGECOST*(1/(p-1)+1/(d-1));f+=m.ANGLECOST*c*c;for(var g=s-u,y=l-h,v=s+u,x=l+h,b=0;b<n.length;b++){var _=n[b],w=Math.cos(_.theta)*_.width/2,k=Math.sin(_.theta)*_.width/2,T=2*r.segmentDistance(g,y,v,x,_.x-w,_.y-k,_.x+w,_.y+k)/(t.height+_.height),S=_.level===t.level,A=S?m.SAMELEVELDISTANCE:1;if(T<=A)return 1/0;f+=m.NEIGHBORCOST*(S?m.SAMELEVELFACTOR:1)/(T-A)}return f}function x(e){var t,r,n=e.trace._emptypoints,i=[],a=e.z.length,o=e.z[0].length,s=[];for(t=0;t<o;t++)s.push(1);for(t=0;t<a;t++)i.push(s.slice());for(t=0;t<n.length;t++)i[(r=n[t])[0]][r[1]]=0;return e.zmask=i,i}e.plot=function(i,a,o,s){var m=a.xaxis,y=a.yaxis;r.makeTraceGroups(s,o,"contour").each((function(o){var s=t.select(this),v=o[0],b=v.trace,_=v.x,w=v.y,k=b.contours,T=h(k,a,v),S=r.ensureSingle(s,"g","heatmapcoloring"),A=[];"heatmap"===k.coloring&&(A=[o]),l(i,a,A,S),c(T),u(T);var M=m.c2p(_[0],!0),E=m.c2p(_[_.length-1],!0),C=y.c2p(w[0],!0),P=y.c2p(w[w.length-1],!0),L=[[M,P],[E,P],[E,C],[M,C]],I=T;"constraint"===k.type&&(I=p(T,k._operation)),function(e,t,n){var i=r.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"===n.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+t.join("L")+"Z").style("stroke","none")}(s,L,k),function(e,n,i,a){var o="fill"===a.coloring||"constraint"===a.type&&"="!==a._operation,s="M"+i.join("L")+"Z";o&&d(n,a);var l=r.ensureSingle(e,"g","contourfill").selectAll("path").data(o?n:[]);l.enter().append("path"),l.exit().remove(),l.each((function(e){var r=(e.prefixBoundary?s:"")+g(e,i);r?t.select(this).attr("d",r).style("stroke","none"):t.select(this).remove()}))}(s,I,L,k),function(i,a,o,s,l){var c=o._context.staticPlot,u=r.ensureSingle(i,"g","contourlines"),h=!1!==l.showlines,p=l.showlabels,d=h&&p,m=e.createLines(u,h||p,a,c),g=e.createLineClip(u,d,o,s.trace.uid),y=i.selectAll("g.contourlabels").data(p?[0]:[]);if(y.exit().remove(),y.enter().append("g").classed("contourlabels",!0),p){var v=[],x=[];r.clearLocationCache();var b=e.labelFormatter(o,s),_=n.tester.append("text").attr("data-notex",1).call(n.font,l.labelfont),w=a[0].xaxis,k=a[0].yaxis,T=w._length,S=k._length,A=w.range,M=k.range,E=r.aggNums(Math.min,null,s.x),C=r.aggNums(Math.max,null,s.x),P=r.aggNums(Math.min,null,s.y),L=r.aggNums(Math.max,null,s.y),I=Math.max(w.c2p(E,!0),0),z=Math.min(w.c2p(C,!0),T),O=Math.max(k.c2p(L,!0),0),R=Math.min(k.c2p(P,!0),S),D={};A[0]<A[1]?(D.left=I,D.right=z):(D.left=z,D.right=I),M[0]<M[1]?(D.top=O,D.bottom=R):(D.top=R,D.bottom=O),D.middle=(D.top+D.bottom)/2,D.center=(D.left+D.right)/2,v.push([[D.left,D.top],[D.right,D.top],[D.right,D.bottom],[D.left,D.bottom]]);var j=Math.sqrt(T*T+S*S),F=f.LABELDISTANCE*j/Math.max(1,a.length/f.LABELINCREASE);m.each((function(n){var i=e.calcTextOpts(n.level,b,_,o);t.select(this).selectAll("path").each((function(){var t=this,n=r.getVisibleSegment(t,D,i.height/2);if(n&&!(n.len<(i.width+i.height)*f.LABELMIN))for(var a=Math.min(Math.ceil(n.len/F),f.LABELMAX),o=0;o<a;o++){var s=e.findBestTextLocation(t,n,i,x,D);if(!s)break;e.addLabelData(s,i,x,v)}}))})),_.remove(),e.drawLabels(y,x,o,g,d?v:null)}p&&!h&&m.remove()}(s,T,i,v,k),function(e,t,i,a,o){var s=a.trace,l=i._fullLayout._clips,h="clip"+s.uid,p=l.selectAll("#"+h).data(s.connectgaps?[]:[0]);if(p.enter().append("clipPath").classed("contourclip",!0).attr("id",h),p.exit().remove(),!1===s.connectgaps){var f={level:.9,crossings:{},starts:[],edgepaths:[],paths:[],xaxis:t.xaxis,yaxis:t.yaxis,x:a.x,y:a.y,z:x(a),smoothing:0};c([f]),u([f]),d([f],{type:"levels"}),r.ensureSingle(p,"path","").attr("d",(f.prefixBoundary?"M"+o.join("L")+"Z":"")+g(f,o))}else h=null;n.setClipUrl(e,h,i)}(s,a,i,v,L)}))},e.createLines=function(e,t,r,i){var a=r[0].smoothing,o=e.selectAll("g.contourlevel").data(t?r:[]);if(o.exit().remove(),o.enter().append("g").classed("contourlevel",!0),t){var s=o.selectAll("path.openline").data((function(e){return e.pedgepaths||e.edgepaths}));s.exit().remove(),s.enter().append("path").classed("openline",!0),s.attr("d",(function(e){return n.smoothopen(e,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke");var l=o.selectAll("path.closedline").data((function(e){return e.ppaths||e.paths}));l.exit().remove(),l.enter().append("path").classed("closedline",!0),l.attr("d",(function(e){return n.smoothclosed(e,a)})).style("stroke-miterlimit",1).style("vector-effect",i?"none":"non-scaling-stroke")}return o},e.createLineClip=function(e,t,r,i){var a=t?"clipline"+i:null,o=r._fullLayout._clips.selectAll("#"+a).data(t?[0]:[]);return o.exit().remove(),o.enter().append("clipPath").classed("contourlineclip",!0).attr("id",a),n.setClipUrl(e,a,r),o},e.labelFormatter=function(e,t){var n=e._fullLayout,a=t.trace,l=a.contours,c={type:"linear",_id:"ycontour",showexponent:"all",exponentformat:"B"};if(l.labelformat)c.tickformat=l.labelformat,s(c,n);else{var u=i.extractOpts(a);if(u&&u.colorbar&&u.colorbar._axis)c=u.colorbar._axis;else{if("constraint"===l.type){var h=l.value;r.isArrayOrTypedArray(h)?c.range=[h[0],h[h.length-1]]:c.range=[h,h]}else c.range=[l.start,l.end],c.nticks=(l.end-l.start)/l.size;c.range[0]===c.range[1]&&(c.range[1]+=c.range[0]||1),c.nticks||(c.nticks=1e3),s(c,n),o.prepTicks(c),c._tmin=null,c._tmax=null}}return function(e){return o.tickText(c,e).text}},e.calcTextOpts=function(e,t,r,i){var o=t(e);r.text(o).call(a.convertToTspans,i);var s=r.node(),l=n.bBox(s,!0);return{text:o,width:l.width,height:l.height,fontSize:+s.style["font-size"].replace("px",""),level:e,dy:(l.top+l.bottom)/2}},e.findBestTextLocation=function(e,t,n,i,a){var o,s,l,c,u,h=n.width;t.isClosed?(s=t.len/m.INITIALSEARCHPOINTS,o=t.min+s/2,l=t.max):(s=(t.len-h)/(m.INITIALSEARCHPOINTS+1),o=t.min+s+h/2,l=t.max-(s+h)/2);for(var p=1/0,d=0;d<m.ITERATIONS;d++){for(var f=o;f<l;f+=s){var g=r.getTextLocation(e,t.total,f,h),v=y(g,n,i,a);v<p&&(p=v,u=g,c=f)}if(p>2*m.MAXCOST)break;d&&(s/=2),l=(o=c-s/2)+1.5*s}if(p<=m.MAXCOST)return u},e.addLabelData=function(e,t,r,n){var i=t.fontSize,a=t.width+i/3,o=Math.max(0,t.height-i/3),s=e.x,l=e.y,c=e.theta,u=Math.sin(c),h=Math.cos(c),p=function(e,t){return[s+e*h-t*u,l+e*u+t*h]},d=[p(-a/2,-o/2),p(-a/2,o/2),p(a/2,o/2),p(a/2,-o/2)];r.push({text:t.text,x:s,y:l,dy:t.dy,theta:c,level:t.level,width:a,height:o}),n.push(d)},e.drawLabels=function(e,n,i,o,s){var l=e.selectAll("text").data(n,(function(e){return e.text+","+e.x+","+e.y+","+e.theta}));if(l.exit().remove(),l.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each((function(e){var r=e.x+Math.sin(e.theta)*e.dy,n=e.y-Math.cos(e.theta)*e.dy;t.select(this).text(e.text).attr({x:r,y:n,transform:"rotate("+180*e.theta/Math.PI+" "+r+" "+n+")"}).call(a.convertToTspans,i)})),s){for(var c="",u=0;u<s.length;u++)c+="M"+s[u].join("L")+"Z";r.ensureSingle(o,"path","").attr("d",c)}}}}),Ts=p({"src/traces/contour/make_color_map.js"(e,t){var r=v(),n=Wt(),i=fs();t.exports=function(e){var t=e.contours,a=t.start,o=i(t),s=t.size||1,l=Math.floor((o-a)/s)+1,c="lines"===t.coloring?0:1,u=n.extractOpts(e);isFinite(s)||(s=1,l=1);var h,p,d=u.reversescale?n.flipScale(u.colorscale):u.colorscale,f=d.length,m=new Array(f),g=new Array(f),y=u.min,v=u.max;if("heatmap"===t.coloring){for(p=0;p<f;p++)h=d[p],m[p]=h[0]*(v-y)+y,g[p]=h[1];var x=r.extent([y,v,t.start,t.start+s*(l-1)]),b=x[y<v?0:1],_=x[y<v?1:0];b!==y&&(m.splice(0,0,b),g.splice(0,0,g[0])),_!==v&&(m.push(_),g.push(g[g.length-1]))}else{var w=e._input&&"number"===typeof e._input.zmin&&"number"===typeof e._input.zmax;for(w&&(a<=y||o>=v)&&(a<=y&&(a=y),o>=v&&(o=v),l=Math.floor((o-a)/s)+1,c=0),p=0;p<f;p++)h=d[p],m[p]=(h[0]*(l+c-1)-c/2)*s+a,g[p]=h[1];(w||e.autocontour)&&(m[0]>y&&(m.unshift(y),g.unshift(g[0])),m[m.length-1]<v&&(m.push(v),g.push(g[g.length-1])))}return n.makeColorScaleFunc({domain:m,range:g},{noNumericCheck:!0})}}}),Ss=p({"src/traces/contour/style.js"(e,t){var r=v(),n=Jt(),i=Uo(),a=Ts();t.exports=function(e){var t=r.select(e).selectAll("g.contour");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(e){var t=r.select(this),i=e[0].trace,o=i.contours,s=i.line,l=o.size||1,c=o.start,u="constraint"===o.type,h=!u&&"lines"===o.coloring,p=!u&&"fill"===o.coloring,d=h||p?a(i):null;t.selectAll("g.contourlevel").each((function(e){r.select(this).selectAll("path").call(n.lineGroupStyle,s.width,h?d(e.level):s.color,s.dash)}));var f=o.labelfont;if(t.selectAll("g.contourlabels text").each((function(e){n.font(r.select(this),{weight:f.weight,style:f.style,variant:f.variant,textcase:f.textcase,lineposition:f.lineposition,shadow:f.shadow,family:f.family,size:f.size,color:f.color||(h?d(e.level):s.color)})})),u)t.selectAll("g.contourfill path").style("fill",i.fillcolor);else if(p){var m;t.selectAll("g.contourfill path").style("fill",(function(e){return void 0===m&&(m=e.level),d(e.level+.5*l)})),void 0===m&&(m=c),t.selectAll("g.contourbg path").style("fill",d(m-.5*l))}})),i(e)}}}),As=p({"src/traces/contour/colorbar.js"(e,t){var r=Wt(),n=Ts(),i=fs();t.exports={min:"zmin",max:"zmax",calc:function(e,t,a){var o=t.contours,s=t.line,l=o.size||1,c=o.coloring,u=n(t,{isColorbar:!0});if("heatmap"===c){var h=r.extractOpts(t);a._fillgradient=h.reversescale?r.flipScale(h.colorscale):h.colorscale,a._zrange=[h.min,h.max]}else"fill"===c&&(a._fillcolor=u);a._line={color:"lines"===c?u:s.color,width:!1!==o.showlines?s.width:0,dash:s.dash},a._levels={start:o.start,end:i(o),size:l}}}}}),Ms=p({"src/traces/contour/hover.js"(e,t){var r=q(),n=Vo();t.exports=function(e,t,i,a,o){o||(o={}),o.isContour=!0;var s=n(e,t,i,a,o);return s&&s.forEach((function(e){var t=e.trace;"constraint"===t.contours.type&&(t.fillcolor&&r.opacity(t.fillcolor)?e.color=r.addOpacity(t.fillcolor,1):t.contours.showlines&&r.opacity(t.line.color)&&(e.color=r.addOpacity(t.line.color,1)))})),s}}}),Es=p({"src/traces/histogram2dcontour/index.js"(e,t){t.exports={attributes:ls(),supplyDefaults:ps(),crossTraceDefaults:Xo(),calc:ms(),plot:ks().plot,layerName:"contourlayer",style:Ss(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"histogram2dcontour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","histogram","showLegend"],meta:{}}}}),Cs=p({"lib/histogram2dcontour.js"(e,t){t.exports=Es()}}),Ps=p({"src/traces/contour/constraint_defaults.js"(e,t){var r=k(),n=us(),i=q(),a=i.addOpacity,o=i.opacity,s=os(),l=st().isArrayOrTypedArray,c=s.CONSTRAINT_REDUCTION,u=s.COMPARISON_OPS2;t.exports=function(e,t,i,s,h,p){var d,f,m,g=t.contours,y=i("contours.operation");g._operation=c[y],function(e,t){var n;-1===u.indexOf(t.operation)?(e("contours.value",[0,1]),l(t.value)?t.value.length>2?t.value=t.value.slice(2):0===t.length?t.value=[0,1]:t.length<2?(n=parseFloat(t.value[0]),t.value=[n,n+1]):t.value=[parseFloat(t.value[0]),parseFloat(t.value[1])]:r(t.value)&&(n=parseFloat(t.value),t.value=[n,n+1])):(e("contours.value",0),r(t.value)||(l(t.value)?t.value=parseFloat(t.value[0]):t.value=0))}(i,g),"="===y?d=g.showlines=!0:(d=i("contours.showlines"),m=i("fillcolor",a((e.line||{}).color||h,.5))),d&&(f=i("line.color",m&&o(m)?a(t.fillcolor,1):h),i("line.width",2),i("line.dash")),i("line.smoothing"),n(i,s,f,p)}}}),Ls=p({"src/traces/contour/defaults.js"(e,t){var r=st(),n=_o(),i=Hn(),a=Ps(),o=cs(),s=hs(),l=wo(),c=ss();t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,c,n,i)}if(n(e,t,p,h)){i(e,t,h,p),p("xhoverformat"),p("yhoverformat"),p("text"),p("hovertext"),p("hoverongaps"),p("hovertemplate");var d="constraint"===p("contours.type");p("connectgaps",r.isArray1D(t.z)),d?a(e,t,p,h,u):(o(e,t,p,(function(n){return r.coerce2(e,t,c,n)})),s(e,t,p,h)),t.contours&&"heatmap"===t.contours.coloring&&l(p,h),p("zorder")}else t.visible=!1}}}),Is=p({"src/traces/contour/index.js"(e,t){t.exports={attributes:ss(),supplyDefaults:Ls(),calc:ms(),plot:ks().plot,style:Ss(),colorbar:As(),hoverPoints:Ms(),moduleType:"trace",name:"contour",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","contour","showLegend"],meta:{}}}}),zs=p({"lib/contour.js"(e,t){t.exports=Is()}}),Os=p({"src/traces/scatterternary/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=wn(),o=N(),s=Lt(),l=Ie().dash,c=R().extendFlat,u=a.marker,h=a.line,p=u.line;t.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["a","b","c","text"]}),hovertext:c({},a.hovertext,{}),line:{color:h.color,width:h.width,dash:l,backoff:h.backoff,shape:c({},h.shape,{values:["linear","spline"]}),smoothing:h.smoothing,editType:"calc"},connectgaps:a.connectgaps,cliponaxis:a.cliponaxis,fill:c({},a.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:i(),marker:c({symbol:u.symbol,opacity:u.opacity,angle:u.angle,angleref:u.angleref,standoff:u.standoff,maxdisplayed:u.maxdisplayed,size:u.size,sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,line:c({width:p.width,editType:"calc"},s("marker.line")),gradient:u.gradient,editType:"calc"},s("marker")),textfont:a.textfont,textposition:a.textposition,selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:a.hoveron,hovertemplate:r()}}}),Rs=p({"src/traces/scatterternary/defaults.js"(e,t){var r=st(),n=bn(),i=$t(),a=Wn(),o=$n(),s=Zn(),l=Xn(),c=Yn(),u=Os();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}var f,m=d("a"),g=d("b"),y=d("c");if(m?(f=m.length,g?(f=Math.min(f,g.length),y&&(f=Math.min(f,y.length))):f=y?Math.min(f,y.length):0):g&&y&&(f=Math.min(g.length,y.length)),f){t._length=f,d("sum"),d("text"),d("hovertext"),"fills"!==t.hoveron&&d("hovertemplate"),d("mode",f<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(t)&&a(e,t,h,p,d,{gradient:!0}),i.hasLines(t)&&(o(e,t,h,p,d,{backoff:!0}),s(e,t,d),d("connectgaps")),i.hasText(t)&&(d("texttemplate"),l(e,t,p,d));var v=[];(i.hasMarkers(t)||i.hasText(t))&&(d("cliponaxis"),d("marker.maxdisplayed"),v.push("points")),d("fill"),"none"!==t.fill&&(c(e,t,h,d),i.hasLines(t)||s(e,t,d)),"tonext"!==t.fill&&"toself"!==t.fill||v.push("fills"),d("hoveron",v.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,d)}else t.visible=!1}}}),Ds=p({"src/traces/scatterternary/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot;return i.aLabel=r.tickText(a.aaxis,e.a,!0).text,i.bLabel=r.tickText(a.baxis,e.b,!0).text,i.cLabel=r.tickText(a.caxis,e.c,!0).text,i}}}),js=p({"src/traces/scatterternary/calc.js"(e,t){var r=k(),n=ri(),i=ni(),a=ii(),o=ai().calcMarkerSize,s=["a","b","c"],l={a:["b","c"],b:["a","c"],c:["a","b"]};t.exports=function(e,t){var c,u,h,p,d,f,m=e._fullLayout[t.subplot].sum,g=t.sum||m,y={a:t.a,b:t.b,c:t.c},v=t.ids;for(c=0;c<s.length;c++)if(!y[h=s[c]]){for(d=y[l[h][0]],f=y[l[h][1]],p=new Array(d.length),u=0;u<d.length;u++)p[u]=g-d[u]-f[u];y[h]=p}var x,b,_,w,k,T,S=t._length,A=new Array(S);for(c=0;c<S;c++)x=y.a[c],b=y.b[c],_=y.c[c],r(x)&&r(b)&&r(_)?(1!==(w=m/((x=+x)+(b=+b)+(_=+_)))&&(x*=w,b*=w,_*=w),T=x,k=_-b,A[c]={x:k,y:T,a:x,b:b,c:_},v&&(A[c].id=v[c])):A[c]={x:!1,y:!1};return o(t,S),n(e,t),i(A,t),a(A,t),A}}}),Fs=p({"src/traces/scatterternary/plot.js"(e,t){var r=hi();t.exports=function(e,t,n){var i=t.plotContainer;i.select(".scatterlayer").selectAll("*").remove();for(var a=t.xaxis,o=t.yaxis,s={xaxis:a,yaxis:o,plot:i,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},l=t.layers.frontplot.select("g.scatterlayer"),c=0;c<n.length;c++){var u=n[c];u.length&&(u[0].trace._xA=a,u[0].trace._yA=o)}r(e,s,n,l)}}}),Bs=p({"src/traces/scatterternary/hover.js"(e,t){var r=gi();t.exports=function(e,t,n,i){var a=r(e,t,n,i);if(a&&!1!==a[0].index){var o=a[0];if(void 0===o.index){var s=1-o.y0/e.ya._length,l=e.xa._length,c=l*s/2,u=l-c;return o.x0=Math.max(Math.min(o.x0,u),c),o.x1=Math.max(Math.min(o.x1,u),c),a}var h=o.cd[o.index],p=o.trace,d=o.subplot;o.a=h.a,o.b=h.b,o.c=h.c,o.xLabelVal=void 0,o.yLabelVal=void 0;var f={};f[p.subplot]={_subplot:d};var m=p._module.formatLabels(h,p,f);o.aLabel=m.aLabel,o.bLabel=m.bLabel,o.cLabel=m.cLabel;var g=h.hi||p.hoverinfo,y=[];if(!p.hovertemplate){var v=g.split("+");-1!==v.indexOf("all")&&(v=["a","b","c"]),-1!==v.indexOf("a")&&x(d.aaxis,o.aLabel),-1!==v.indexOf("b")&&x(d.baxis,o.bLabel),-1!==v.indexOf("c")&&x(d.caxis,o.cLabel)}return o.extraText=y.join("<br>"),o.hovertemplate=p.hovertemplate,a}function x(e,t){y.push(e._hovertitle+": "+t)}}}}),Ns=p({"src/traces/scatterternary/event_data.js"(e,t){t.exports=function(e,t,r,n,i){if(t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),n[i]){var a=n[i];e.a=a.a,e.b=a.b,e.c=a.c}else e.a=t.a,e.b=t.b,e.c=t.c;return e}}}),Us=p({"src/plots/ternary/ternary.js"(e,t){var r=v(),n=O(),i=Ve(),a=st(),o=a.strTranslate,s=a._,l=q(),c=Jt(),u=er(),h=R().extendFlat,p=kt(),d=nr(),f=hr(),m=zr(),g=Or(),y=g.freeMode,x=g.rectMode,b=Qt(),_=Mn().prepSelect,w=Mn().selectOnClick,k=Mn().clearOutline,T=Mn().clearSelectionsCache,S=yt();function A(e,t){this.id=e.id,this.graphDiv=e.graphDiv,this.init(t),this.makeFramework(t),this.updateFx(t),this.aTickLayout=null,this.bTickLayout=null,this.cTickLayout=null}t.exports=A;var M=A.prototype;M.init=function(e){this.container=e._ternarylayer,this.defs=e._defs,this.layoutId=e._uid,this.traceHash={},this.layers={}},M.plot=function(e,t){var r=this,n=t[r.id],i=t._size;r._hasClipOnAxisFalse=!1;for(var a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){r._hasClipOnAxisFalse=!0;break}r.updateLayers(n),r.adjustLayout(n,i),p.generalUpdatePerTraceModule(r.graphDiv,r,e,n),r.layers.plotbg.select("path").call(l.fill,n.bgcolor)},M.makeFramework=function(e){var t=this,r=t.graphDiv,n=e[t.id],i=t.clipId="clip"+t.layoutId+t.id,o=t.clipIdRelative="clip-relative"+t.layoutId+t.id;t.clipDef=a.ensureSingleById(e._clips,"clipPath",i,(function(e){e.append("path").attr("d","M0,0Z")})),t.clipDefRelative=a.ensureSingleById(e._clips,"clipPath",o,(function(e){e.append("path").attr("d","M0,0Z")})),t.plotContainer=a.ensureSingle(t.container,"g",t.id),t.updateLayers(n),c.setClipUrl(t.layers.backplot,i,r),c.setClipUrl(t.layers.grids,i,r)},M.updateFx=function(e){e._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===e.dragmode?"move":"crosshair")},M.updateLayers=function(e){var t=this.layers,n=["draglayer","plotbg","backplot","grids"];"below traces"===e.aaxis.layer&&n.push("aaxis","aline"),"below traces"===e.baxis.layer&&n.push("baxis","bline"),"below traces"===e.caxis.layer&&n.push("caxis","cline"),n.push("frontplot"),"above traces"===e.aaxis.layer&&n.push("aaxis","aline"),"above traces"===e.baxis.layer&&n.push("baxis","bline"),"above traces"===e.caxis.layer&&n.push("caxis","cline");var i=this.plotContainer.selectAll("g.toplevel").data(n,String),a=["agrid","bgrid","cgrid"];i.enter().append("g").attr("class",(function(e){return"toplevel "+e})).each((function(e){var n=r.select(this);t[e]=n,"frontplot"===e?n.append("g").classed("scatterlayer",!0):"backplot"===e?n.append("g").classed("maplayer",!0):"plotbg"===e?n.append("path").attr("d","M0,0Z"):"aline"===e||"bline"===e||"cline"===e?n.append("path"):"grids"===e&&a.forEach((function(e){t[e]=n.append("g").classed("grid "+e,!0)}))})),i.order()};var E=Math.sqrt(4/3);M.adjustLayout=function(e,t){var r,n,i,a,s,p,d=this,f=e.domain,m=(f.x[0]+f.x[1])/2,g=(f.y[0]+f.y[1])/2,y=f.x[1]-f.x[0],v=f.y[1]-f.y[0],x=y*t.w,b=v*t.h,_=e.sum,w=e.aaxis.min,k=e.baxis.min,T=e.caxis.min;x>E*b?i=(a=b)*E:a=(i=x)/E,s=y*i/x,p=v*a/b,r=t.l+t.w*m-i/2,n=t.t+t.h*(1-g)-a/2,d.x0=r,d.y0=n,d.w=i,d.h=a,d.sum=_,d.xaxis={type:"linear",range:[w+2*T-_,_-w-2*k],domain:[m-s/2,m+s/2],_id:"x"},u(d.xaxis,d.graphDiv._fullLayout),d.xaxis.setScale(),d.xaxis.isPtWithinRange=function(e){return e.a>=d.aaxis.range[0]&&e.a<=d.aaxis.range[1]&&e.b>=d.baxis.range[1]&&e.b<=d.baxis.range[0]&&e.c>=d.caxis.range[1]&&e.c<=d.caxis.range[0]},d.yaxis={type:"linear",range:[w,_-k-T],domain:[g-p/2,g+p/2],_id:"y"},u(d.yaxis,d.graphDiv._fullLayout),d.yaxis.setScale(),d.yaxis.isPtWithinRange=function(){return!0};var S=d.yaxis.domain[0],A=d.aaxis=h({},e.aaxis,{range:[w,_-k-T],side:"left",tickangle:(+e.aaxis.tickangle||0)-30,domain:[S,S+p*E],anchor:"free",position:0,_id:"y",_length:i});u(A,d.graphDiv._fullLayout),A.setScale();var M=d.baxis=h({},e.baxis,{range:[_-w-T,k],side:"bottom",domain:d.xaxis.domain,anchor:"free",position:0,_id:"x",_length:i});u(M,d.graphDiv._fullLayout),M.setScale();var C=d.caxis=h({},e.caxis,{range:[_-w-k,T],side:"right",tickangle:(+e.caxis.tickangle||0)+30,domain:[S,S+p*E],anchor:"free",position:0,_id:"y",_length:i});u(C,d.graphDiv._fullLayout),C.setScale();var P="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";d.clipDef.select("path").attr("d",P),d.layers.plotbg.select("path").attr("d",P);var L="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";d.clipDefRelative.select("path").attr("d",L);var I=o(r,n);d.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),d.clipDefRelative.select("path").attr("transform",null);var z=o(r-M._offset,n+a);d.layers.baxis.attr("transform",z),d.layers.bgrid.attr("transform",z);var O=o(r+i/2,n)+"rotate(30)"+o(0,-A._offset);d.layers.aaxis.attr("transform",O),d.layers.agrid.attr("transform",O);var R=o(r+i/2,n)+"rotate(-30)"+o(0,-C._offset);d.layers.caxis.attr("transform",R),d.layers.cgrid.attr("transform",R),d.drawAxes(!0),d.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(l.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),d.layers.bline.select("path").attr("d",M.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(l.stroke,M.linecolor||"#000").style("stroke-width",(M.linewidth||0)+"px"),d.layers.cline.select("path").attr("d",C.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(l.stroke,C.linecolor||"#000").style("stroke-width",(C.linewidth||0)+"px"),d.graphDiv._context.staticPlot||d.initInteractions(),c.setClipUrl(d.layers.frontplot,d._hasClipOnAxisFalse?null:d.clipId,d.graphDiv)},M.drawAxes=function(e){var t=this,r=t.graphDiv,n=t.id.substr(7)+"title",i=t.layers,a=t.aaxis,o=t.baxis,l=t.caxis;if(t.drawAx(a),t.drawAx(o),t.drawAx(l),e){var c=Math.max(a.showticklabels?a.tickfont.size/2:0,(l.showticklabels?.75*l.tickfont.size:0)+("outside"===l.ticks?.87*l.ticklen:0)),u=(o.showticklabels?o.tickfont.size:0)+("outside"===o.ticks?o.ticklen:0)+3;i["a-title"]=b.draw(r,"a"+n,{propContainer:a,propName:t.id+".aaxis.title",placeholder:s(r,"Click to enter Component A title"),attributes:{x:t.x0+t.w/2,y:t.y0-a.title.font.size/3-c,"text-anchor":"middle"}}),i["b-title"]=b.draw(r,"b"+n,{propContainer:o,propName:t.id+".baxis.title",placeholder:s(r,"Click to enter Component B title"),attributes:{x:t.x0-u,y:t.y0+t.h+.83*o.title.font.size+u,"text-anchor":"middle"}}),i["c-title"]=b.draw(r,"c"+n,{propContainer:l,propName:t.id+".caxis.title",placeholder:s(r,"Click to enter Component C title"),attributes:{x:t.x0+t.w+u,y:t.y0+t.h+.83*l.title.font.size+u,"text-anchor":"middle"}})}},M.drawAx=function(e){var t,r=this,n=r.graphDiv,i=e._name,o=i.charAt(0),s=e._id,l=r.layers[i],c=o+"tickLayout",u=(t=e).ticks+String(t.ticklen)+String(t.showticklabels);r[c]!==u&&(l.selectAll("."+s+"tick").remove(),r[c]=u),e.setScale();var h=d.calcTicks(e),p=d.clipEnds(e,h),f=d.makeTransTickFn(e),m=d.getTickSigns(e)[2],g=a.deg2rad(30),y=m*(e.linewidth||1)/2,v=m*e.ticklen,x=r.w,b=r.h,_="b"===o?"M0,"+y+"l"+Math.sin(g)*v+","+Math.cos(g)*v:"M"+y+",0l"+Math.cos(g)*v+","+-Math.sin(g)*v,w={a:"M0,0l"+b+",-"+x/2,b:"M0,0l-"+x/2+",-"+b,c:"M0,0l-"+b+","+x/2}[o];d.drawTicks(n,e,{vals:"inside"===e.ticks?p:h,layer:l,path:_,transFn:f,crisp:!1}),d.drawGrid(n,e,{vals:p,layer:r.layers[o+"grid"],path:w,transFn:f,crisp:!1}),d.drawLabels(n,e,{vals:h,layer:l,transFn:f,labelFns:d.makeLabelFns(e,0,30)})};var C=S.MINZOOM/2+.87,P="m-0.87,.5h"+C+"v3h-"+(C+5.2)+"l"+(C/2+2.6)+",-"+(.87*C+4.5)+"l2.6,1.5l-"+C/2+","+.87*C+"Z",L="m0.87,.5h-"+C+"v3h"+(C+5.2)+"l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-2.6,1.5l"+C/2+","+.87*C+"Z",I="m0,1l"+C/2+","+.87*C+"l2.6,-1.5l-"+(C/2+2.6)+",-"+(.87*C+4.5)+"l-"+(C/2+2.6)+","+(.87*C+4.5)+"l2.6,1.5l"+C/2+",-"+.87*C+"Z",z=!0;function D(e){r.select(e).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}M.clearOutline=function(){T(this.dragOptions),k(this.dragOptions.gd)},M.initInteractions=function(){var e,t,r,u,h,p,d,g,v,b,k,T,A=this,M=A.layers.plotbg.select("path").node(),C=A.graphDiv,O=C._fullLayout._zoomlayer;function R(e){var t={};return t[A.id+".aaxis.min"]=e.a,t[A.id+".baxis.min"]=e.b,t[A.id+".caxis.min"]=e.c,t}function j(e,t){var r=C._fullLayout.clickmode;D(C),2===e&&(C.emit("plotly_doubleclick",null),i.call("_guiRelayout",C,R({a:0,b:0,c:0}))),r.indexOf("select")>-1&&1===e&&w(t,C,[A.xaxis],[A.yaxis],A.id,A.dragOptions),r.indexOf("event")>-1&&m.click(C,t,A.id)}function F(e,t){return 1-t/A.h}function B(e,t){return 1-(e+(A.h-t)/Math.sqrt(3))/A.w}function N(e,t){return(e-(A.h-t)/Math.sqrt(3))/A.w}function U(n,i){var a=r+n*e,o=u+i*t,s=Math.max(0,Math.min(1,F(0,u),F(0,o))),l=Math.max(0,Math.min(1,B(r,u),B(a,o))),c=Math.max(0,Math.min(1,N(r,u),N(a,o))),f=(s/2+c)*A.w,m=(1-s/2-l)*A.w,y=(f+m)/2,x=m-f,_=(1-s)*A.h,w=_-x/E;x<S.MINZOOM?(d=h,k.attr("d",v),T.attr("d","M0,0Z")):(d={a:h.a+s*p,b:h.b+l*p,c:h.c+c*p},k.attr("d",v+"M"+f+","+_+"H"+m+"L"+y+","+w+"L"+f+","+_+"Z"),T.attr("d","M"+r+","+u+"m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2ZM"+f+","+_+P+"M"+m+","+_+L+"M"+y+","+w+I)),b||(k.transition().style("fill",g>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),T.transition().style("opacity",1).duration(200),b=!0),C.emit("plotly_relayouting",R(d))}function V(){D(C),d!==h&&(i.call("_guiRelayout",C,R(d)),z&&C.data&&C._context.showTips&&(a.notifier(s(C,"Double-click to zoom back out"),"long"),z=!1))}function q(e,t){var r=e/A.xaxis._m,n=t/A.yaxis._m,i=[(d={a:h.a-n,b:h.b+(r+n)/2,c:h.c-(r-n)/2}).a,d.b,d.c].sort(a.sorterAsc),s=i.indexOf(d.a),l=i.indexOf(d.b),u=i.indexOf(d.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),d={a:i[s],b:i[l],c:i[u]},t=(h.a-d.a)*A.yaxis._m,e=(h.c-d.c-h.b+d.b)*A.xaxis._m);var p=o(A.x0+e,A.y0+t);A.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",p);var f=o(-e,-t);A.clipDefRelative.select("path").attr("transform",f),A.aaxis.range=[d.a,A.sum-d.b-d.c],A.baxis.range=[A.sum-d.a-d.c,d.b],A.caxis.range=[A.sum-d.a-d.b,d.c],A.drawAxes(!1),A._hasClipOnAxisFalse&&A.plotContainer.select(".scatterlayer").selectAll(".trace").call(c.hideOutsideRangePoints,A),C.emit("plotly_relayouting",R(d))}function H(){i.call("_guiRelayout",C,R(d))}this.dragOptions={element:M,gd:C,plotinfo:{id:A.id,domain:C._fullLayout[A.id].domain,xaxis:A.xaxis,yaxis:A.yaxis},subplot:A.id,prepFn:function(i,s,c){A.dragOptions.xaxes=[A.xaxis],A.dragOptions.yaxes=[A.yaxis],e=C._fullLayout._invScaleX,t=C._fullLayout._invScaleY;var f=A.dragOptions.dragmode=C._fullLayout.dragmode;y(f)?A.dragOptions.minDrag=1:A.dragOptions.minDrag=void 0,"zoom"===f?(A.dragOptions.moveFn=U,A.dragOptions.clickFn=j,A.dragOptions.doneFn=V,function(e,t,i){var s=M.getBoundingClientRect();r=t-s.left,u=i-s.top,C._fullLayout._calcInverseTransform(C);var c=C._fullLayout._invTransform,f=a.apply3DTransform(c)(r,u);r=f[0],u=f[1],h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},d=h,p=A.aaxis.range[1]-h.a,g=n(A.graphDiv._fullLayout[A.id].bgcolor).getLuminance(),v="M0,"+A.h+"L"+A.w/2+", 0L"+A.w+","+A.h+"Z",b=!1,k=O.append("path").attr("class","zoombox").attr("transform",o(A.x0,A.y0)).style({fill:g>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",v),T=O.append("path").attr("class","zoombox-corners").attr("transform",o(A.x0,A.y0)).style({fill:l.background,stroke:l.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),A.clearOutline(C)}(0,s,c)):"pan"===f?(A.dragOptions.moveFn=q,A.dragOptions.clickFn=j,A.dragOptions.doneFn=H,h={a:A.aaxis.range[0],b:A.baxis.range[1],c:A.caxis.range[1]},d=h,A.clearOutline(C)):(x(f)||y(f))&&_(i,s,c,A.dragOptions,f)}},M.onmousemove=function(e){m.hover(C,e,A.id),C._fullLayout._lasthover=M,C._fullLayout._hoversubplot=A.id},M.onmouseout=function(e){C._dragging||f.unhover(C,e)},f.init(this.dragOptions)}}}),Vs=p({"src/plots/ternary/layout_attributes.js"(e,t){var r=V(),n=ka().attributes,i=Ct(),a=Le().overrideAll,o=R().extendFlat,s={title:{text:i.title.text,font:i.title.font},color:i.color,tickmode:i.minor.tickmode,nticks:o({},i.nticks,{dflt:6,min:1}),tick0:i.tick0,dtick:i.dtick,tickvals:i.tickvals,ticktext:i.ticktext,ticks:i.ticks,ticklen:i.ticklen,tickwidth:i.tickwidth,tickcolor:i.tickcolor,ticklabelstep:i.ticklabelstep,showticklabels:i.showticklabels,labelalias:i.labelalias,showtickprefix:i.showtickprefix,tickprefix:i.tickprefix,showticksuffix:i.showticksuffix,ticksuffix:i.ticksuffix,showexponent:i.showexponent,exponentformat:i.exponentformat,minexponent:i.minexponent,separatethousands:i.separatethousands,tickfont:i.tickfont,tickangle:i.tickangle,tickformat:i.tickformat,tickformatstops:i.tickformatstops,hoverformat:i.hoverformat,showline:o({},i.showline,{dflt:!0}),linecolor:i.linecolor,linewidth:i.linewidth,showgrid:o({},i.showgrid,{dflt:!0}),gridcolor:i.gridcolor,gridwidth:i.gridwidth,griddash:i.griddash,layer:i.layer,min:{valType:"number",dflt:0,min:0}},l=t.exports=a({domain:n({name:"ternary"}),bgcolor:{valType:"color",dflt:r.background},sum:{valType:"number",dflt:1,min:0},aaxis:s,baxis:s,caxis:s},"plot","from-root");l.uirevision={valType:"any",editType:"none"},l.aaxis.uirevision=l.baxis.uirevision=l.caxis.uirevision={valType:"any",editType:"none"}}}),qs=p({"src/plots/subplot_defaults.js"(e,t){var r=st(),n=gt(),i=ka().defaults;t.exports=function(e,t,a,o){var s,l,c=o.type,u=o.attributes,h=o.handleDefaults,p=o.partition||"x",d=t._subplots[c],f=d.length,m=f&&d[0].replace(/\d+$/,"");function g(e,t){return r.coerce(s,l,u,e,t)}for(var y=0;y<f;y++){var v=d[y];s=e[v]?e[v]:e[v]={},l=n.newContainer(t,v,m),o.noUirevision||g("uirevision",t.uirevision);var x={};x[p]=[y/f,(y+1)/f],i(l,t,g,x),o.id=v,h(s,l,g,o)}}}}),Hs=p({"src/plots/ternary/layout_defaults.js"(e,t){var r=q(),n=gt(),i=st(),a=qs(),o=Bt(),s=Nt(),l=Dt(),c=Rt(),u=_i(),h=Vs(),p=["aaxis","baxis","caxis"];function d(e,t,i,a){var o,s,l,c=i("bgcolor"),u=i("sum");a.bgColor=r.combine(c,a.paper_bgcolor);for(var h=0;h<p.length;h++)s=e[o=p[h]]||{},(l=n.newContainer(t,o))._name=o,f(s,l,a,t);var d=t.aaxis,m=t.baxis,g=t.caxis;d.min+m.min+g.min>=u&&(d.min=0,m.min=0,g.min=0,e.aaxis&&delete e.aaxis.min,e.baxis&&delete e.baxis.min,e.caxis&&delete e.caxis.min)}function f(e,t,r,n){var a=h[t._name];function p(r,n){return i.coerce(e,t,a,r,n)}p("uirevision",n.uirevision),t.type="linear";var d=p("color"),f=d!==a.color.dflt?d:r.font.color,m=t._name.charAt(0).toUpperCase(),g="Component "+m,y=p("title.text",g);t._hovertitle=y===g?y:m,i.coerceFont(p,"title.font",r.font,{overrideDflt:{size:i.bigFont(r.font.size),color:f}}),p("min"),c(e,t,p,"linear"),s(e,t,p,"linear"),o(e,t,p,"linear",{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(e,t,p,{outerTicks:!0}),p("showticklabels")&&(i.coerceFont(p,"tickfont",r.font,{overrideDflt:{color:f}}),p("tickangle"),p("tickformat")),u(e,t,p,{dfltColor:d,bgColor:r.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:a}),p("hoverformat"),p("layer")}t.exports=function(e,t,r){a(e,t,r,{type:"ternary",attributes:h,handleDefaults:d,font:t.font,paper_bgcolor:t.paper_bgcolor})}}}),Gs=p({"src/plots/ternary/index.js"(e){var t=Us(),r=_t().getSubplotCalcData,n=st().counterRegex,i="ternary";e.name=i;var a=e.attr="subplot";e.idRoot=i,e.idRegex=e.attrRegex=n(i),(e.attributes={})[a]={valType:"subplotid",dflt:"ternary",editType:"calc"},e.layoutAttributes=Vs(),e.supplyLayoutDefaults=Hs(),e.plot=function(e){for(var n=e._fullLayout,a=e.calcdata,o=n._subplots[i],s=0;s<o.length;s++){var l=o[s],c=r(a,i,l),u=n[l]._subplot;u||(u=new t({id:l,graphDiv:e,container:n._ternarylayer.node()},n),n[l]._subplot=u),u.plot(c,n,e._promises)}},e.clean=function(e,t,r,n){for(var a=n._subplots[i]||[],o=0;o<a.length;o++){var s=a[o],l=n[s]._subplot;!t[s]&&l&&(l.plotContainer.remove(),l.clipDef.remove(),l.clipDefRelative.remove(),l.layers["a-title"].remove(),l.layers["b-title"].remove(),l.layers["c-title"].remove())}},e.updateFx=function(e){var t=e._fullLayout;t._ternarylayer.selectAll("g.toplevel").style("cursor","pan"===t.dragmode?"move":"crosshair")}}}),Ws=p({"src/traces/scatterternary/index.js"(e,t){t.exports={attributes:Os(),supplyDefaults:Rs(),colorbar:pi(),formatLabels:Ds(),calc:js(),plot:Fs(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Bs(),selectPoints:yi(),eventData:Ns(),moduleType:"trace",name:"scatterternary",basePlotModule:Gs(),categories:["ternary","symbols","showLegend","scatter-like"],meta:{}}}}),$s=p({"lib/scatterternary.js"(e,t){t.exports=Ws()}}),Zs=p({"src/traces/violin/attributes.js"(e,t){var r=oo(),n=R().extendFlat,i=Et().axisHoverFormat;t.exports={y:r.y,x:r.x,x0:r.x0,y0:r.y0,xhoverformat:i("x"),yhoverformat:i("y"),name:n({},r.name,{}),orientation:n({},r.orientation,{}),bandwidth:{valType:"number",min:0,editType:"calc"},scalegroup:{valType:"string",dflt:"",editType:"calc"},scalemode:{valType:"enumerated",values:["width","count"],dflt:"width",editType:"calc"},spanmode:{valType:"enumerated",values:["soft","hard","manual"],dflt:"soft",editType:"calc"},span:{valType:"info_array",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}],editType:"calc"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:r.fillcolor,points:n({},r.boxpoints,{}),jitter:n({},r.jitter,{}),pointpos:n({},r.pointpos,{}),width:n({},r.width,{}),marker:r.marker,text:r.text,hovertext:r.hovertext,hovertemplate:r.hovertemplate,quartilemethod:r.quartilemethod,box:{visible:{valType:"boolean",dflt:!1,editType:"plot"},width:{valType:"number",min:0,max:1,dflt:.25,editType:"plot"},fillcolor:{valType:"color",editType:"style"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"style"},editType:"plot"},meanline:{visible:{valType:"boolean",dflt:!1,editType:"plot"},color:{valType:"color",editType:"style"},width:{valType:"number",min:0,editType:"style"},editType:"plot"},side:{valType:"enumerated",values:["both","positive","negative"],dflt:"both",editType:"calc"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,selected:r.selected,unselected:r.unselected,hoveron:{valType:"flaglist",flags:["violins","points","kde"],dflt:"violins+points+kde",extras:["all"],editType:"style"},zorder:r.zorder}}}),Xs=p({"src/traces/violin/layout_attributes.js"(e,t){var r=so(),n=st().extendFlat;t.exports={violinmode:n({},r.boxmode,{}),violingap:n({},r.boxgap,{}),violingroupgap:n({},r.boxgroupgap,{})}}}),Ys=p({"src/traces/violin/defaults.js"(e,t){var r=st(),n=q(),i=lo(),a=Zs();t.exports=function(e,t,o,s){function l(n,i){return r.coerce(e,t,a,n,i)}function c(n,i){return r.coerce2(e,t,a,n,i)}if(i.handleSampleDefaults(e,t,l,s),!1!==t.visible){l("bandwidth"),l("side"),l("width")||(l("scalegroup",t.name),l("scalemode"));var u,h=l("span");Array.isArray(h)&&(u="manual"),l("spanmode",u);var p=l("line.color",(e.marker||{}).color||o),d=l("line.width"),f=l("fillcolor",n.addOpacity(t.line.color,.5));i.handlePointsDefaults(e,t,l,{prefix:""});var m=c("box.width"),g=c("box.fillcolor",f),y=c("box.line.color",p),v=c("box.line.width",d);l("box.visible",Boolean(m||g||y||v))||(t.box={visible:!1});var x=c("meanline.color",p),b=c("meanline.width",d);l("meanline.visible",Boolean(x||b))||(t.meanline={visible:!1}),l("quartilemethod"),l("zorder")}}}}),Ks=p({"src/traces/violin/layout_defaults.js"(e,t){var r=st(),n=Xs(),i=co();t.exports=function(e,t,a){i._supply(e,t,a,(function(i,a){return r.coerce(e,t,n,i,a)}),"violin")}}}),Js=p({"src/traces/violin/helpers.js"(e){var t=st(),r=function(e){return 1/Math.sqrt(2*Math.PI)*Math.exp(-.5*e*e)};e.makeKDE=function(e,t,n){var i=n.length,a=r,o=e.bandwidth,s=1/(i*o);return function(e){for(var t=0,r=0;r<i;r++)t+=a((e-n[r])/o);return s*t}},e.getPositionOnKdePath=function(e,r,n){var i,a;"h"===r.orientation?(i="y",a="x"):(i="x",a="y");var o=t.findPointOnPath(e.path,n,a,{pathLength:e.pathLength}),s=e.posCenterPx,l=o[i];return[l,"both"===r.side?2*s-l:s]},e.getKdeValue=function(t,r,n){var i=t.pts.map(e.extractVal);return e.makeKDE(t,r,i)(n)/t.posDensityScale},e.extractVal=function(e){return e.v}}}),Qs=p({"src/traces/violin/calc.js"(e,t){var r=st(),n=nr(),i=uo(),a=Js(),o=T().BADNUM;function s(e,t,n){var i=t.max-t.min;if(!i)return e.bandwidth?e.bandwidth:0;if(e.bandwidth)return Math.max(e.bandwidth,i/1e4);var a=n.length,o=r.stdev(n,a-1,t.mean);return Math.max(function(e,t,r){return 1.059*Math.min(t,r/1.349)*Math.pow(e,-.2)}(a,o,t.q3-t.q1),i/100)}function l(e,t,r,i){var a,s=e.spanmode,l=e.span||[],c=[t.min,t.max],u=[t.min-2*i,t.max+2*i];function h(n){var i=l[n],a="multicategory"===r.type?r.r2c(i):r.d2c(i,0,e[t.valLetter+"calendar"]);return a===o?u[n]:a}var p={type:"linear",range:a="soft"===s?u:"hard"===s?c:[h(0),h(1)]};return n.setConvert(p),p.cleanRange(),a}t.exports=function(e,t){var o=i(e,t);if(o[0].t.empty)return o;for(var c=e._fullLayout,u=n.getFromId(e,t["h"===t.orientation?"xaxis":"yaxis"]),h=1/0,p=-1/0,d=0,f=0,m=0;m<o.length;m++){var g=o[m],y=g.pts.map(a.extractVal),v=g.bandwidth=s(t,g,y),x=g.span=l(t,g,u,v);if(g.min===g.max&&0===v)x=g.span=[g.min,g.max],g.density=[{v:1,t:x[0]}],g.bandwidth=v,d=Math.max(d,1);else{var b=x[1]-x[0],_=Math.ceil(b/(v/3)),w=b/_;if(!isFinite(w)||!isFinite(_))return r.error("Something went wrong with computing the violin span"),o[0].t.empty=!0,o;var k=a.makeKDE(g,t,y);g.density=new Array(_);for(var T=0,S=x[0];S<x[1]+w/2;T++,S+=w){var A=k(S);g.density[T]={v:A,t:S},d=Math.max(d,A)}}f=Math.max(f,y.length),h=Math.min(h,x[0]),p=Math.max(p,x[1])}var M=n.findExtremes(u,[h,p],{padded:!0});if(t._extremes[u._id]=M,t.width)o[0].t.maxKDE=d;else{var E=c._violinScaleGroupStats,C=t.scalegroup,P=E[C];P?(P.maxKDE=Math.max(P.maxKDE,d),P.maxCount=Math.max(P.maxCount,f)):E[C]={maxKDE:d,maxCount:f}}return o[0].t.labels.kde=r._(e,"kde:"),o}}}),el=p({"src/traces/violin/cross_trace_calc.js"(e,t){var r=ho().setPositionOffset,n=["v","h"];t.exports=function(e,t){for(var i=e.calcdata,a=t.xaxis,o=t.yaxis,s=0;s<n.length;s++){for(var l=n[s],c="h"===l?o:a,u=[],h=0;h<i.length;h++){var p=i[h],d=p[0].t,f=p[0].trace;!0!==f.visible||"violin"!==f.type||d.empty||f.orientation!==l||f.xaxis!==a._id||f.yaxis!==o._id||u.push(h)}r("violin",e,u,c)}}}}),tl=p({"src/traces/violin/plot.js"(e,t){var r=v(),n=st(),i=Jt(),a=po(),o=ci(),s=Js();t.exports=function(e,t,l,c){var u=e._context.staticPlot,h=e._fullLayout,p=t.xaxis,d=t.yaxis;function f(e,t){var r=o(e,{xaxis:p,yaxis:d,trace:t,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0,linearized:!0});return i.smoothopen(r[0],1)}n.makeTraceGroups(c,l,"trace violins").each((function(e){var i=r.select(this),o=e[0],l=o.t,c=o.trace;if(!0!==c.visible||l.empty)i.remove();else{var m=l.bPos,g=l.bdPos,y=t[l.valLetter+"axis"],v=t[l.posLetter+"axis"],x="both"===c.side,b=x||"positive"===c.side,_=x||"negative"===c.side,w=i.selectAll("path.violin").data(n.identity);w.enter().append("path").style("vector-effect",u?"none":"non-scaling-stroke").attr("class","violin"),w.exit().remove(),w.each((function(e){var t,n,i,a,o,s,u,p,d=r.select(this),w=e.density,k=w.length,T=v.c2l(e.pos+m,!0),S=v.l2p(T);if(c.width)t=l.maxKDE/g;else{var A=h._violinScaleGroupStats[c.scalegroup];t="count"===c.scalemode?A.maxKDE/g*(A.maxCount/e.pts.length):A.maxKDE/g}if(b){for(u=new Array(k),o=0;o<k;o++)(p=u[o]={})[l.posLetter]=T+w[o].v/t,p[l.valLetter]=y.c2l(w[o].t,!0);n=f(u,c)}if(_){for(u=new Array(k),s=0,o=k-1;s<k;s++,o--)(p=u[s]={})[l.posLetter]=T-w[o].v/t,p[l.valLetter]=y.c2l(w[o].t,!0);i=f(u,c)}if(x)a=n+"L"+i.substr(1)+"Z";else{var M=[S,y.c2p(w[0].t)],E=[S,y.c2p(w[k-1].t)];"h"===c.orientation&&(M.reverse(),E.reverse()),a=b?"M"+M+"L"+n.substr(1)+"L"+E:"M"+E+"L"+i.substr(1)+"L"+M}d.attr("d",a),e.posCenterPx=S,e.posDensityScale=t*g,e.path=d.node(),e.pathLength=e.path.getTotalLength()/(x?2:1)}));var k,T,S,A=c.box,M=A.width,E=(A.line||{}).width;x?(k=g*M,T=0):b?(k=[0,g*M/2],T=E*{x:1,y:-1}[l.posLetter]):(k=[g*M/2,0],T=E*{x:-1,y:1}[l.posLetter]),a.plotBoxAndWhiskers(i,{pos:v,val:y},c,{bPos:m,bdPos:k,bPosPxOffset:T}),a.plotBoxMean(i,{pos:v,val:y},c,{bPos:m,bdPos:k,bPosPxOffset:T}),!c.box.visible&&c.meanline.visible&&(S=n.identity);var C=i.selectAll("path.meanline").data(S||[]);C.enter().append("path").attr("class","meanline").style("fill","none").style("vector-effect",u?"none":"non-scaling-stroke"),C.exit().remove(),C.each((function(e){var t=y.c2p(e.mean,!0),n=s.getPositionOnKdePath(e,c,t);r.select(this).attr("d","h"===c.orientation?"M"+t+","+n[0]+"V"+n[1]:"M"+n[0]+","+t+"H"+n[1])})),a.plotPoints(i,{x:p,y:d},c,l)}}))}}}),rl=p({"src/traces/violin/style.js"(e,t){var r=v(),n=q(),i=fi().stylePoints;t.exports=function(e){var t=r.select(e).selectAll("g.trace.violins");t.style("opacity",(function(e){return e[0].trace.opacity})),t.each((function(t){var a=t[0].trace,o=r.select(this),s=a.box||{},l=s.line||{},c=a.meanline||{},u=c.width;o.selectAll("path.violin").style("stroke-width",a.line.width+"px").call(n.stroke,a.line.color).call(n.fill,a.fillcolor),o.selectAll("path.box").style("stroke-width",l.width+"px").call(n.stroke,l.color).call(n.fill,s.fillcolor);var h={"stroke-width":u+"px","stroke-dasharray":2*u+"px,"+u+"px"};o.selectAll("path.mean").style(h).call(n.stroke,c.color),o.selectAll("path.meanline").style(h).call(n.stroke,c.color),i(o,a,e)}))}}}),nl=p({"src/traces/violin/hover.js"(e,t){var r=q(),n=st(),i=nr(),a=mo(),o=Js();t.exports=function(e,t,s,l,c){c||(c={});var u,h,p=c.hoverLayer,d=e.cd,f=d[0].trace,m=f.hoveron,g=-1!==m.indexOf("violins"),y=-1!==m.indexOf("kde"),v=[];if(g||y){var x=a.hoverOnBoxes(e,t,s,l);if(y&&x.length>0){var b,_,w,k,T,S=e.xa,A=e.ya;"h"===f.orientation?(T=t,b="y",w=A,_="x",k=S):(T=s,b="x",w=S,_="y",k=A);var M=d[e.index];if(T>=M.span[0]&&T<=M.span[1]){var E=n.extendFlat({},e),C=k.c2p(T,!0),P=o.getKdeValue(M,f,T),L=o.getPositionOnKdePath(M,f,C),I=w._offset,z=w._length;E[b+"0"]=L[0],E[b+"1"]=L[1],E[_+"0"]=E[_+"1"]=C,E[_+"Label"]=_+": "+i.hoverLabelText(k,T,f[_+"hoverformat"])+", "+d[0].t.labels.kde+" "+P.toFixed(3);for(var O=0,R=0;R<x.length;R++)if("med"===x[R].attr){O=R;break}E.spikeDistance=x[O].spikeDistance;var D=b+"Spike";E[D]=x[O][D],x[O].spikeDistance=void 0,x[O][D]=void 0,E.hovertemplate=!1,v.push(E),(h={})[b+"1"]=n.constrain(I+L[0],I,I+z),h[b+"2"]=n.constrain(I+L[1],I,I+z),h[_+"1"]=h[_+"2"]=k._offset+C}}g&&(v=v.concat(x))}-1!==m.indexOf("points")&&(u=a.hoverOnPoints(e,t,s));var j=p.selectAll(".violinline-"+f.uid).data(h?[0]:[]);return j.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),j.exit().remove(),j.attr(h).call(r.stroke,e.color),"closest"===l?u?[u]:v:u?(v.push(u),v):v}}}),il=p({"src/traces/violin/index.js"(e,t){t.exports={attributes:Zs(),layoutAttributes:Xs(),supplyDefaults:Ys(),crossTraceDefaults:lo().crossTraceDefaults,supplyLayoutDefaults:Ks(),calc:Qs(),crossTraceCalc:el(),plot:tl(),style:rl(),styleOnSelect:fi().styleOnSelect,hoverPoints:nl(),selectPoints:yo(),moduleType:"trace",name:"violin",basePlotModule:Ai(),categories:["cartesian","svg","symbols","oriented","box-violin","showLegend","violinLayout","zoomScale"],meta:{}}}}),al=p({"lib/violin.js"(e,t){t.exports=il()}}),ol=p({"src/traces/funnel/constants.js"(e,t){t.exports={eventDataKeys:["percentInitial","percentPrevious","percentTotal"]}}}),sl=p({"src/traces/funnel/attributes.js"(e,t){var r=Ha(),n=wn().line,i=N(),a=Et().axisHoverFormat,o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=ol(),c=R().extendFlat,u=q();t.exports={x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","percent initial","percent previous","percent total"]}),textinfo:{valType:"flaglist",flags:["label","text","percent initial","percent previous","percent total","value"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),text:r.text,textposition:r.textposition,insidetextanchor:c({},r.insidetextanchor,{dflt:"middle"}),textangle:c({},r.textangle,{dflt:0}),textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:c({},r.orientation,{}),offset:c({},r.offset,{arrayOk:!1}),width:c({},r.width,{arrayOk:!1}),marker:function(){var e=c({},r.marker);return delete e.pattern,delete e.cornerradius,e}(),connector:{fillcolor:{valType:"color",editType:"style"},line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{dflt:0,editType:"plot"}),dash:n.dash,editType:"style"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),ll=p({"src/traces/funnel/layout_attributes.js"(e,t){t.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"}}}}),cl=p({"src/traces/funnel/defaults.js"(e,t){var r=st(),n=Jn(),i=$a().handleText,a=qn(),o=Hn(),s=sl(),l=q();t.exports={supplyDefaults:function(e,t,n,c){function u(n,i){return r.coerce(e,t,s,n,i)}if(a(e,t,c,u)){o(e,t,c,u),u("xhoverformat"),u("yhoverformat"),u("orientation",t.y&&!t.x?"v":"h"),u("offset"),u("width");var h=u("text");u("hovertext"),u("hovertemplate");var p=u("textposition");i(e,t,c,u,p,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"===t.textposition||t.texttemplate||u("textinfo",r.isArrayOrTypedArray(h)?"text+value":"value");var d=u("marker.color",n);u("marker.line.color",l.defaultLine),u("marker.line.width"),u("connector.visible")&&(u("connector.fillcolor",function(e){var t=r.isArrayOrTypedArray(e)?"#000":e;return l.addOpacity(t,.5*l.opacity(t))}(d)),u("connector.line.width")&&(u("connector.line.color"),u("connector.line.dash"))),u("zorder")}else t.visible=!1},crossTraceDefaults:function(e,t){var i,a;function o(e){return r.coerce(a._input,a,s,e)}for(var l=0;l<e.length;l++)"funnel"===(a=e[l]).type&&(i=a._input,n(i,a,t,o,t.funnelmode))}}}}),ul=p({"src/traces/funnel/layout_defaults.js"(e,t){var r=st(),n=ll();t.exports=function(e,t,i){var a=!1;function o(i,a){return r.coerce(e,t,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"funnel"===l.type){a=!0;break}}a&&(o("funnelmode"),o("funnelgap",.2),o("funnelgroupgap"))}}}),hl=p({"src/traces/funnel/arrays_to_calcdata.js"(e,t){var r=st();t.exports=function(e,t){for(var n=0;n<e.length;n++)e[n].i=n;r.mergeArray(t.text,e,"tx"),r.mergeArray(t.hovertext,e,"htx");var i=t.marker;if(i){r.mergeArray(i.opacity,e,"mo"),r.mergeArray(i.color,e,"mc");var a=i.line;a&&(r.mergeArray(a.color,e,"mlc"),r.mergeArrayCastPositive(a.width,e,"mlw"))}}}}),pl=p({"src/traces/funnel/calc.js"(e,t){var r=nr(),n=ti(),i=hl(),a=ii(),o=T().BADNUM;function s(e){return e===o?0:e}t.exports=function(e,t){var l,c,u,h,p,d,f,m,g=r.getFromId(e,t.xaxis||"x"),y=r.getFromId(e,t.yaxis||"y");"h"===t.orientation?(l=g.makeCalcdata(t,"x"),u=y.makeCalcdata(t,"y"),h=n(t,y,"y",u),p=!!t.yperiodalignment,d="y"):(l=y.makeCalcdata(t,"y"),u=g.makeCalcdata(t,"x"),h=n(t,g,"x",u),p=!!t.xperiodalignment,d="x"),c=h.vals;var v,x=Math.min(c.length,l.length),b=new Array(x);for(t._base=[],f=0;f<x;f++){l[f]<0&&(l[f]=o);var _=!1;l[f]!==o&&f+1<x&&l[f+1]!==o&&(_=!0),m=b[f]={p:c[f],s:l[f],cNext:_},t._base[f]=-.5*m.s,p&&(b[f].orig_p=u[f],b[f][d+"End"]=h.ends[f],b[f][d+"Start"]=h.starts[f]),t.ids&&(m.id=String(t.ids[f])),0===f&&(b[0].vTotal=0),b[0].vTotal+=s(m.s),m.begR=s(m.s)/s(b[0].s)}for(f=0;f<x;f++)(m=b[f]).s!==o&&(m.sumR=m.s/b[0].vTotal,m.difR=void 0!==v?m.s/v:1,v=m.s);return i(b,t),a(b,t),b}}}),dl=p({"src/traces/funnel/cross_trace_calc.js"(e,t){var r=si().setGroupPositions;t.exports=function(e,t){var n,i,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],h=[],p=[];for(i=0;i<o.length;i++){var d=o[i],f="h"===d.orientation;!0===d.visible&&d.xaxis===l._id&&d.yaxis===c._id&&"funnel"===d.type&&(n=s[i],f?p.push(n):h.push(n),u.push(n))}var m={mode:a.funnelmode,norm:a.funnelnorm,gap:a.funnelgap,groupgap:a.funnelgroupgap};for(r(e,l,c,h,m),r(e,c,l,p,m),i=0;i<u.length;i++){n=u[i];for(var g=0;g<n.length;g++)g+1<n.length&&(n[g].nextP0=n[g+1].p0,n[g].nextS0=n[g+1].s0,n[g].nextP1=n[g+1].p1,n[g].nextS1=n[g+1].s1)}}}}),fl=p({"src/traces/funnel/plot.js"(e,t){var r=v(),n=st(),i=Jt(),a=T().BADNUM,o=eo(),s=Ka().clearMinTextSize;function l(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),i[2]=o.c2p(e.nextS0,!0),a[2]=s.c2p(e.nextP0,!0),i[3]=o.c2p(e.nextS1,!0),a[3]=s.c2p(e.nextP1,!0),n?[i,a]:[a,i]}t.exports=function(e,t,c,u){var h=e._fullLayout;s("funnel",h),function(e,t,o,s){var c=t.xaxis,u=t.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),h=o[0].trace,p=n.ensureSingle(s,"g","regions");if(h.connector&&h.connector.visible){var d="h"===h.orientation,f=p.selectAll("g.region").data(n.identity);f.enter().append("g").classed("region",!0),f.exit().remove();var m=f.size();f.each((function(o,s){if(s===m-1||o.cNext){var h=l(o,c,u,d),p=h[0],f=h[1],g="";p[0]!==a&&f[0]!==a&&p[1]!==a&&f[1]!==a&&p[2]!==a&&f[2]!==a&&p[3]!==a&&f[3]!==a&&(g+=d?"M"+p[0]+","+f[1]+"L"+p[2]+","+f[2]+"H"+p[3]+"L"+p[1]+","+f[1]+"Z":"M"+p[1]+","+f[1]+"L"+p[2]+","+f[3]+"V"+f[2]+"L"+p[1]+","+f[0]+"Z"),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else p.remove()}))}(e,t,c,u),function(e,t,a,o){var s=t.xaxis,c=t.yaxis;n.makeTraceGroups(o,a,"trace bars").each((function(a){var o=r.select(this),u=a[0].trace,h=n.ensureSingle(o,"g","lines");if(u.connector&&u.connector.visible&&u.connector.line.width){var p="h"===u.orientation,d=h.selectAll("g.line").data(n.identity);d.enter().append("g").classed("line",!0),d.exit().remove();var f=d.size();d.each((function(a,o){if(o===f-1||a.cNext){var u=l(a,s,c,p),h=u[0],d=u[1],m="";void 0!==h[3]&&void 0!==d[3]&&(p?(m+="M"+h[0]+","+d[1]+"L"+h[2]+","+d[2],m+="M"+h[1]+","+d[1]+"L"+h[3]+","+d[2]):(m+="M"+h[1]+","+d[1]+"L"+h[2]+","+d[3],m+="M"+h[1]+","+d[0]+"L"+h[2]+","+d[2])),""===m&&(m="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",m).call(i.setClipUrl,t.layerClipId,e)}}))}else h.remove()}))}(e,t,c,u),o.plot(e,t,c,u,{mode:h.funnelmode,norm:h.funnelmode,gap:h.funnelgap,groupgap:h.funnelgroupgap})}}}),ml=p({"src/traces/funnel/style.js"(e,t){var r=v(),n=Jt(),i=q(),a=H().DESELECTDIM,o=Qa(),s=Ka().resizeText,l=o.styleTextPoints;t.exports={style:function(e,t,o){var c=o||r.select(e).selectAll('g[class^="funnellayer"]').selectAll("g.trace");s(e,c,"funnel"),c.style("opacity",(function(e){return e[0].trace.opacity})),c.each((function(t){var o=r.select(this),s=t[0].trace;o.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s.marker;r.select(this).call(i.fill,e.mc||t.color).call(i.stroke,e.mlc||t.line.color).call(n.dashLine,t.line.dash,e.mlw||t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".regions").each((function(){r.select(this).selectAll("path").style("stroke-width",0).call(i.fill,s.connector.fillcolor)})),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),yl=p({"src/traces/funnel/hover.js"(e,t){var r=q().opacity,n=to().hoverOnBars,i=st().formatPercent;t.exports=function(e,t,a,o,s){var l=n(e,t,a,o,s);if(l){var c=l.cd,u=c[0].trace,h="h"===u.orientation,p=c[l.index];l[(h?"x":"y")+"LabelVal"]=p.s,l.percentInitial=p.begR,l.percentInitialLabel=i(p.begR,1),l.percentPrevious=p.difR,l.percentPreviousLabel=i(p.difR,1),l.percentTotal=p.sumR,l.percentTotalLabel=i(p.sumR,1);var d=p.hi||u.hoverinfo,f=[];if(d&&"none"!==d&&"skip"!==d){var m="all"===d,g=d.split("+"),y=function(e){return m||-1!==g.indexOf(e)};y("percent initial")&&f.push(l.percentInitialLabel+" of initial"),y("percent previous")&&f.push(l.percentPreviousLabel+" of previous"),y("percent total")&&f.push(l.percentTotalLabel+" of total")}return l.extraText=f.join("<br>"),l.color=function(e,t){var n=e.marker,i=t.mc||n.color,a=t.mlc||n.line.color,o=t.mlw||n.line.width;return r(i)?i:r(a)&&o?a:void 0}(u,p),[l]}}}}),vl=p({"src/traces/funnel/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"percentInitial"in t&&(e.percentInitial=t.percentInitial),"percentPrevious"in t&&(e.percentPrevious=t.percentPrevious),"percentTotal"in t&&(e.percentTotal=t.percentTotal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),xl=p({"src/traces/funnel/index.js"(e,t){t.exports={attributes:sl(),layoutAttributes:ll(),supplyDefaults:cl().supplyDefaults,crossTraceDefaults:cl().crossTraceDefaults,supplyLayoutDefaults:ul(),calc:pl(),crossTraceCalc:dl(),plot:fl(),style:ml().style,hoverPoints:yl(),eventData:vl(),selectPoints:no(),moduleType:"trace",name:"funnel",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),bl=p({"lib/funnel.js"(e,t){t.exports=xl()}}),_l=p({"src/traces/waterfall/constants.js"(e,t){t.exports={eventDataKeys:["initial","delta","final"]}}}),wl=p({"src/traces/waterfall/attributes.js"(e,t){var r=Ha(),n=wn().line,i=N(),a=Et().axisHoverFormat,o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=_l(),c=R().extendFlat,u=q();function h(e){return{marker:{color:c({},r.marker.color,{arrayOk:!1,editType:"style"}),line:{color:c({},r.marker.line.color,{arrayOk:!1,editType:"style"}),width:c({},r.marker.line.width,{arrayOk:!1,editType:"style"}),editType:"style"},editType:"style"},editType:"style"}}t.exports={measure:{valType:"data_array",dflt:[],editType:"calc"},base:{valType:"number",dflt:null,arrayOk:!1,editType:"calc"},x:r.x,x0:r.x0,dx:r.dx,y:r.y,y0:r.y0,dy:r.dy,xperiod:r.xperiod,yperiod:r.yperiod,xperiod0:r.xperiod0,yperiod0:r.yperiod0,xperiodalignment:r.xperiodalignment,yperiodalignment:r.yperiodalignment,xhoverformat:a("x"),yhoverformat:a("y"),hovertext:r.hovertext,hovertemplate:o({},{keys:l.eventDataKeys}),hoverinfo:c({},i.hoverinfo,{flags:["name","x","y","text","initial","delta","final"]}),textinfo:{valType:"flaglist",flags:["label","text","initial","delta","final"],extras:["none"],editType:"plot",arrayOk:!1},texttemplate:s({editType:"plot"},{keys:l.eventDataKeys.concat(["label"])}),text:r.text,textposition:r.textposition,insidetextanchor:r.insidetextanchor,textangle:r.textangle,textfont:r.textfont,insidetextfont:r.insidetextfont,outsidetextfont:r.outsidetextfont,constraintext:r.constraintext,cliponaxis:r.cliponaxis,orientation:r.orientation,offset:r.offset,width:r.width,increasing:h(),decreasing:h(),totals:h(),connector:{line:{color:c({},n.color,{dflt:u.defaultLine}),width:c({},n.width,{editType:"plot"}),dash:n.dash,editType:"plot"},mode:{valType:"enumerated",values:["spanning","between"],dflt:"between",editType:"plot"},visible:{valType:"boolean",dflt:!0,editType:"plot"},editType:"plot"},offsetgroup:r.offsetgroup,alignmentgroup:r.alignmentgroup,zorder:r.zorder}}}),kl=p({"src/traces/waterfall/layout_attributes.js"(e,t){t.exports={waterfallmode:{valType:"enumerated",values:["group","overlay"],dflt:"group",editType:"calc"},waterfallgap:{valType:"number",min:0,max:1,editType:"calc"},waterfallgroupgap:{valType:"number",min:0,max:1,dflt:0,editType:"calc"}}}}),Tl=p({"src/constants/delta.js"(e,t){t.exports={INCREASING:{COLOR:"#3D9970",SYMBOL:"\u25b2"},DECREASING:{COLOR:"#FF4136",SYMBOL:"\u25bc"}}}}),Sl=p({"src/traces/waterfall/defaults.js"(e,t){var r=st(),n=Jn(),i=$a().handleText,a=qn(),o=Hn(),s=wl(),l=q(),c=Tl(),u=c.INCREASING.COLOR,h=c.DECREASING.COLOR;function p(e,t,r){e(t+".marker.color",r),e(t+".marker.line.color",l.defaultLine),e(t+".marker.line.width")}t.exports={supplyDefaults:function(e,t,n,l){function c(n,i){return r.coerce(e,t,s,n,i)}if(a(e,t,l,c)){o(e,t,l,c),c("xhoverformat"),c("yhoverformat"),c("measure"),c("orientation",t.x&&!t.y?"h":"v"),c("base"),c("offset"),c("width"),c("text"),c("hovertext"),c("hovertemplate");var d=c("textposition");i(e,t,l,c,d,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!0,moduleHasCliponaxis:!0,moduleHasTextangle:!0,moduleHasInsideanchor:!0}),"none"!==t.textposition&&(c("texttemplate"),t.texttemplate||c("textinfo")),p(c,"increasing",u),p(c,"decreasing",h),p(c,"totals","#4499FF"),c("connector.visible")&&(c("connector.mode"),c("connector.line.width")&&(c("connector.line.color"),c("connector.line.dash"))),c("zorder")}else t.visible=!1},crossTraceDefaults:function(e,t){var i,a;function o(e){return r.coerce(a._input,a,s,e)}if("group"===t.waterfallmode)for(var l=0;l<e.length;l++)i=(a=e[l])._input,n(i,a,t,o,t.waterfallmode)}}}}),Al=p({"src/traces/waterfall/layout_defaults.js"(e,t){var r=st(),n=kl();t.exports=function(e,t,i){var a=!1;function o(i,a){return r.coerce(e,t,n,i,a)}for(var s=0;s<i.length;s++){var l=i[s];if(l.visible&&"waterfall"===l.type){a=!0;break}}a&&(o("waterfallmode"),o("waterfallgap",.2),o("waterfallgroupgap"))}}}),Ml=p({"src/traces/waterfall/calc.js"(e,t){var r=nr(),n=ti(),i=st().mergeArray,a=ii(),o=T().BADNUM;function s(e){return"a"===e||"absolute"===e}function l(e){return"t"===e||"total"===e}t.exports=function(e,t){var c,u,h,p,d,f,m=r.getFromId(e,t.xaxis||"x"),g=r.getFromId(e,t.yaxis||"y");"h"===t.orientation?(c=m.makeCalcdata(t,"x"),h=g.makeCalcdata(t,"y"),p=n(t,g,"y",h),d=!!t.yperiodalignment,f="y"):(c=g.makeCalcdata(t,"y"),h=m.makeCalcdata(t,"x"),p=n(t,m,"x",h),d=!!t.xperiodalignment,f="x"),u=p.vals;for(var y,v=Math.min(u.length,c.length),x=new Array(v),b=0,_=!1,w=0;w<v;w++){var k=c[w]||0,T=!1;(c[w]!==o||l(t.measure[w])||s(t.measure[w]))&&w+1<v&&(c[w+1]!==o||l(t.measure[w+1])||s(t.measure[w+1]))&&(T=!0);var S=x[w]={i:w,p:u[w],s:k,rawS:k,cNext:T};s(t.measure[w])?(b=S.s,S.isSum=!0,S.dir="totals",S.s=b):l(t.measure[w])?(S.isSum=!0,S.dir="totals",S.s=b):(S.isSum=!1,S.dir=S.rawS<0?"decreasing":"increasing",y=S.s,S.s=b+y,b+=y),"totals"===S.dir&&(_=!0),d&&(x[w].orig_p=h[w],x[w][f+"End"]=p.ends[w],x[w][f+"Start"]=p.starts[w]),t.ids&&(S.id=String(t.ids[w])),S.v=(t.base||0)+b}return x.length&&(x[0].hasTotals=_),i(t.text,x,"tx"),i(t.hovertext,x,"htx"),a(x,t),x}}}),El=p({"src/traces/waterfall/cross_trace_calc.js"(e,t){var r=si().setGroupPositions;t.exports=function(e,t){var n,i,a=e._fullLayout,o=e._fullData,s=e.calcdata,l=t.xaxis,c=t.yaxis,u=[],h=[],p=[];for(i=0;i<o.length;i++){var d=o[i];!0===d.visible&&d.xaxis===l._id&&d.yaxis===c._id&&"waterfall"===d.type&&(n=s[i],"h"===d.orientation?p.push(n):h.push(n),u.push(n))}var f={mode:a.waterfallmode,norm:a.waterfallnorm,gap:a.waterfallgap,groupgap:a.waterfallgroupgap};for(r(e,l,c,h,f),r(e,c,l,p,f),i=0;i<u.length;i++){n=u[i];for(var m=0;m<n.length;m++){var g=n[m];!1===g.isSum&&(g.s0+=0===m?0:n[m-1].s),m+1<n.length&&(n[m].nextP0=n[m+1].p0,n[m].nextS0=n[m+1].s0)}}}}}),Cl=p({"src/traces/waterfall/plot.js"(e,t){var r=v(),n=st(),i=Jt(),a=T().BADNUM,o=eo(),s=Ka().clearMinTextSize;t.exports=function(e,t,l,c){var u=e._fullLayout;s("waterfall",u),o.plot(e,t,l,c,{mode:u.waterfallmode,norm:u.waterfallmode,gap:u.waterfallgap,groupgap:u.waterfallgroupgap}),function(e,t,o,s){var l=t.xaxis,c=t.yaxis;n.makeTraceGroups(s,o,"trace bars").each((function(o){var s=r.select(this),u=o[0].trace,h=n.ensureSingle(s,"g","lines");if(u.connector&&u.connector.visible){var p="h"===u.orientation,d=u.connector.mode,f=h.selectAll("g.line").data(n.identity);f.enter().append("g").classed("line",!0),f.exit().remove();var m=f.size();f.each((function(o,s){if(s===m-1||o.cNext){var u=function(e,t,r,n){var i=[],a=[],o=n?t:r,s=n?r:t;return i[0]=o.c2p(e.s0,!0),a[0]=s.c2p(e.p0,!0),i[1]=o.c2p(e.s1,!0),a[1]=s.c2p(e.p1,!0),i[2]=o.c2p(e.nextS0,!0),a[2]=s.c2p(e.nextP0,!0),n?[i,a]:[a,i]}(o,l,c,p),h=u[0],f=u[1],g="";h[0]!==a&&f[0]!==a&&h[1]!==a&&f[1]!==a&&("spanning"===d&&!o.isSum&&s>0&&(g+=p?"M"+h[0]+","+f[1]+"V"+f[0]:"M"+h[1]+","+f[0]+"H"+h[0]),"between"!==d&&(o.isSum||s<m-1)&&(g+=p?"M"+h[1]+","+f[0]+"V"+f[1]:"M"+h[0]+","+f[1]+"H"+h[1]),h[2]!==a&&f[2]!==a&&(g+=p?"M"+h[1]+","+f[1]+"V"+f[2]:"M"+h[1]+","+f[1]+"H"+h[2])),""===g&&(g="M0,0Z"),n.ensureSingle(r.select(this),"path").attr("d",g).call(i.setClipUrl,t.layerClipId,e)}}))}else h.remove()}))}(e,t,l,c)}}}),Pl=p({"src/traces/waterfall/style.js"(e,t){var r=v(),n=Jt(),i=q(),a=H().DESELECTDIM,o=Qa(),s=Ka().resizeText,l=o.styleTextPoints;t.exports={style:function(e,t,o){var c=o||r.select(e).selectAll('g[class^="waterfalllayer"]').selectAll("g.trace");s(e,c,"waterfall"),c.style("opacity",(function(e){return e[0].trace.opacity})),c.each((function(t){var o=r.select(this),s=t[0].trace;o.selectAll(".point > path").each((function(e){if(!e.isBlank){var t=s[e.dir].marker;r.select(this).call(i.fill,t.color).call(i.stroke,t.line.color).call(n.dashLine,t.line.dash,t.line.width).style("opacity",s.selectedpoints&&!e.selected?a:1)}})),l(o,s,e),o.selectAll(".lines").each((function(){var e=s.connector.line;n.lineGroupStyle(r.select(this).selectAll("path"),e.width,e.color,e.dash)}))}))}}}}),Ll=p({"src/traces/waterfall/hover.js"(e,t){var r=nr().hoverLabelText,n=q().opacity,i=to().hoverOnBars,a=Tl(),o=a.INCREASING.SYMBOL,s=a.DECREASING.SYMBOL;t.exports=function(e,t,a,l,c){var u=i(e,t,a,l,c);if(u){var h=u.cd,p=h[0].trace,d="h"===p.orientation,f=d?"x":"y",m=d?e.xa:e.ya,g=h[u.index],y=g.isSum?g.b+g.s:g.rawS;u.initial=g.b+g.s-y,u.delta=y,u.final=u.initial+u.delta;var v=T(Math.abs(u.delta));u.deltaLabel=y<0?"("+v+")":v,u.finalLabel=T(u.final),u.initialLabel=T(u.initial);var x=g.hi||p.hoverinfo,b=[];if(x&&"none"!==x&&"skip"!==x){var _="all"===x,w=x.split("+"),k=function(e){return _||-1!==w.indexOf(e)};g.isSum||(!k("final")||k(d?"x":"y")||b.push(u.finalLabel),k("delta")&&(y<0?b.push(u.deltaLabel+" "+s):b.push(u.deltaLabel+" "+o)),k("initial")&&b.push("Initial: "+u.initialLabel))}return b.length&&(u.extraText=b.join("<br>")),u.color=function(e,t){var r=e[t.dir].marker,i=r.color,a=r.line.color,o=r.line.width;return n(i)?i:n(a)&&o?a:void 0}(p,g),[u]}function T(e){return r(m,e,p[f+"hoverformat"])}}}}),Il=p({"src/traces/waterfall/event_data.js"(e,t){t.exports=function(e,t){return e.x="xVal"in t?t.xVal:t.x,e.y="yVal"in t?t.yVal:t.y,"initial"in t&&(e.initial=t.initial),"delta"in t&&(e.delta=t.delta),"final"in t&&(e.final=t.final),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e}}}),zl=p({"src/traces/waterfall/index.js"(e,t){t.exports={attributes:wl(),layoutAttributes:kl(),supplyDefaults:Sl().supplyDefaults,crossTraceDefaults:Sl().crossTraceDefaults,supplyLayoutDefaults:Al(),calc:Ml(),crossTraceCalc:El(),plot:Cl(),style:Pl().style,hoverPoints:Ll(),eventData:Il(),selectPoints:no(),moduleType:"trace",name:"waterfall",basePlotModule:Ai(),categories:["bar-like","cartesian","svg","oriented","showLegend","zoomScale"],meta:{}}}}),Ol=p({"lib/waterfall.js"(e,t){t.exports=zl()}}),Rl=p({"src/traces/image/constants.js"(e,t){t.exports={colormodel:{rgb:{min:[0,0,0],max:[255,255,255],fmt:function(e){return e.slice(0,3)},suffix:["","",""]},rgba:{min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},rgba256:{colormodel:"rgba",zminDflt:[0,0,0,0],zmaxDflt:[255,255,255,255],min:[0,0,0,0],max:[255,255,255,1],fmt:function(e){return e.slice(0,4)},suffix:["","","",""]},hsl:{min:[0,0,0],max:[360,100,100],fmt:function(e){var t=e.slice(0,3);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%"]},hsla:{min:[0,0,0,0],max:[360,100,100,1],fmt:function(e){var t=e.slice(0,4);return t[1]=t[1]+"%",t[2]=t[2]+"%",t},suffix:["\xb0","%","%",""]}}}}}),Dl=p({"src/traces/image/attributes.js"(e,t){var r,n,i=N(),a=wn().zorder,o=Oe().hovertemplateAttrs,s=R().extendFlat,l=Rl().colormodel,c=["rgb","rgba","rgba256","hsl","hsla"],u=[],h=[];for(n=0;n<c.length;n++)r=l[c[n]],u.push("For the `"+c[n]+"` colormodel, it is ["+(r.zminDflt||r.min).join(", ")+"]."),h.push("For the `"+c[n]+"` colormodel, it is ["+(r.zmaxDflt||r.max).join(", ")+"].");t.exports=s({source:{valType:"string",editType:"calc"},z:{valType:"data_array",editType:"calc"},colormodel:{valType:"enumerated",values:c,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:s({},i.hoverinfo,{flags:["x","y","z","color","name","text"],dflt:"x+y+z+text+name"}),hovertemplate:o({},{keys:["z","color","colormodel"]}),zorder:a})}}),jl=p({"src/traces/image/defaults.js"(e,t){var r=st(),n=Dl(),i=Rl(),a=On().IMAGE_URL_PREFIX;t.exports=function(e,t){function o(i,a){return r.coerce(e,t,n,i,a)}o("source"),t.source&&!t.source.match(a)&&delete t.source,t._hasSource=!!t.source;var s,l=o("z");t._hasZ=!(void 0===l||!l.length||!l[0]||!l[0].length),t._hasZ||t._hasSource?(o("x0"),o("y0"),o("dx"),o("dy"),t._hasZ?(o("colormodel","rgb"),o("zmin",(s=i.colormodel[t.colormodel]).zminDflt||s.min),o("zmax",s.zmaxDflt||s.max)):t._hasSource&&(t.colormodel="rgba256",s=i.colormodel[t.colormodel],t.zmin=s.zminDflt,t.zmax=s.zmaxDflt),o("zsmooth"),o("text"),o("hovertext"),o("hovertemplate"),t._length=null,o("zorder")):t.visible=!1}}}),Fl=p({"node_modules/inherits/inherits_browser.js"(e,t){"function"===typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}}),Bl=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/stream-browser.js"(e,t){t.exports=ht().EventEmitter}}),Nl=p({"node_modules/base64-js/index.js"(e){e.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},e.toByteArray=function(e){var t,r,a=o(e),s=a[0],l=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,h=l>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},e.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,l=0,c=n-i;l<c;l+=o)a.push(s(e,l,l+o>c?c:l+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};var t,r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(t=0;t<64;++t)r[t]=a[t],n[a.charCodeAt(t)]=t;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63}}),Ul=p({"node_modules/ieee754/index.js"(e){e.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},e.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m}}}),Vl=p({"node_modules/buffer/index.js"(e){var t=Nl(),r=Ul(),n="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},e.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return s(e,t,r)}function s(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|d(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);const i=function(e){if(o.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||Z(e.length)?a(0):u(e):"Buffer"===e.type&&Array.isArray(e.data)?u(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),a(e<0?0:0|p(e))}function u(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function p(e){if(e>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function d(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function f(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return E(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Z(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===n?0:a-n)){if(-1===n&&(n=a),a-n+1===l)return n*o}else-1!==n&&(a-=a-n),n=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){let r=!0;for(let n=0;n<l;n++)if(c(e,a+n)!==c(t,n)){r=!1;break}if(r)return a}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const a=t.length;let o;for(n>a/2&&(n=a/2),o=0;o<n;++o){const n=parseInt(t.substr(2*o,2),16);if(Z(n))return o;e[r+o]=n}return o}function x(e,t,r,n){return W(H(t,e.length-r),e,r,n)}function b(e,t,r,n){return W(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return W(G(t),e,r,n)}function w(e,t,r,n){return W(function(e,t){let r,n,i;const a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function k(e,r,n){return 0===r&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(r,n))}function T(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:r=e[i+1],128===(192&r)&&(l=(31&t)<<6|63&r,l>127&&(a=l));break;case 3:r=e[i+1],n=e[i+2],128===(192&r)&&128===(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128===(192&r)&&128===(192&n)&&128===(192&s)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=o}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}e.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||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(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"===typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},o.allocUnsafe=function(e){return c(e)},o.allocUnsafeSlow=function(e){return c(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=o.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if($(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=d,o.prototype._isBuffer=!0,o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):f.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let t="";const r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const l=Math.min(a,s),c=this.slice(n,i),u=e.slice(t,r);for(let o=0;o<l;++o)if(c[o]!==u[o]){a=c[o],s=u[o];break}return a<s?-1:s<a?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return x(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function M(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function E(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let a=t;a<r;++a)i+=X[e[a]];return i}function C(e,t,r){const n=e.slice(t,r);let i="";for(let a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function P(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function z(e,t,r,n,i){N(t,n,i,e,r,7);let a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function O(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,n,i,a){return t=+t,n>>>=0,a||O(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function D(e,t,n,i,a){return t=+t,n>>>=0,a||O(e,0,n,8),r.write(e,t,n,i,52,8),n+8}o.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),o.prototype.readBigUInt64BE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,a=0;for(;++a<t&&(i*=256);)n+=this[e+a]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,a=this[e+--n];for(;n>0&&(i*=256);)a+=this[e+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*t)),a},o.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),o.prototype.readBigInt64BE=Y((function(e){U(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),o.prototype.readFloatLE=function(e,t){return e>>>=0,t||P(e,4,this.length),r.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||P(e,4,this.length),r.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||P(e,8,this.length),r.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||P(e,8,this.length),r.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Y((function(e){return I(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeBigUInt64BE=Y((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,a=1,o=0;for(this[t+i]=255&e;--i>=0&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Y((function(e){return I(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeBigInt64BE=Y((function(e){return z(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),o.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(i=t;i<r;++i)this[i]=e;else{const a=o.isBuffer(e)?e:o.from(e,n),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=a[i%s]}return this};var j={};function F(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function B(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function N(e,t,r,n,i,a){if(e>r||e<t){const n="bigint"===typeof t?"n":"";let i;throw i=a>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){U(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,a)}function U(e,t){if("number"!==typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw U(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=B(String(r)):"bigint"===typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=B(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);var q=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const a=[];for(let o=0;o<n;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function G(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function W(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!==e}var X=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Y(e){return"undefined"===typeof BigInt?K:e}function K(){throw new Error("BigInt not supported")}}}),ql=p({"node_modules/has-symbols/shams.js"(e,t){t.exports=function(){if("function"!==typeof Symbol||"function"!==typeof Object.getOwnPropertySymbols)return!1;if("symbol"===typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"===typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"===typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"===typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"===typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}}}),Hl=p({"node_modules/has-tostringtag/shams.js"(e,t){var r=ql();t.exports=function(){return r()&&!!Symbol.toStringTag}}}),Gl=p({"node_modules/es-errors/index.js"(e,t){t.exports=Error}}),Wl=p({"node_modules/es-errors/eval.js"(e,t){t.exports=EvalError}}),$l=p({"node_modules/es-errors/range.js"(e,t){t.exports=RangeError}}),Zl=p({"node_modules/es-errors/ref.js"(e,t){t.exports=ReferenceError}}),Xl=p({"node_modules/es-errors/syntax.js"(e,t){t.exports=SyntaxError}}),Yl=p({"node_modules/es-errors/type.js"(e,t){t.exports=TypeError}}),Kl=p({"node_modules/es-errors/uri.js"(e,t){t.exports=URIError}}),Jl=p({"node_modules/has-symbols/index.js"(e,t){var r="undefined"!==typeof Symbol&&Symbol,n=ql();t.exports=function(){return"function"===typeof r&&"function"===typeof Symbol&&"symbol"===typeof r("foo")&&"symbol"===typeof Symbol("bar")&&n()}}}),Ql=p({"node_modules/has-proto/index.js"(e,t){var r={foo:{}},n=Object;t.exports=function(){return{__proto__:r}.foo===r.foo&&!({__proto__:null}instanceof n)}}}),ec=p({"node_modules/function-bind/implementation.js"(e,t){var r=Object.prototype.toString,n=Math.max,i=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};t.exports=function(e){var t=this;if("function"!==typeof t||"[object Function]"!==r.apply(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var a,o=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r}(arguments,1),s=n(0,t.length-o.length),l=[],c=0;c<s;c++)l[c]="$"+c;if(a=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(l,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var r=t.apply(this,i(o,arguments));return Object(r)===r?r:this}return t.apply(e,i(o,arguments))})),t.prototype){var u=function(){};u.prototype=t.prototype,a.prototype=new u,u.prototype=null}return a}}}),tc=p({"node_modules/function-bind/index.js"(e,t){var r=ec();t.exports=Function.prototype.bind||r}}),rc=p({"node_modules/hasown/index.js"(e,t){var r=Function.prototype.call,n=Object.prototype.hasOwnProperty,i=tc();t.exports=i.call(r,n)}}),nc=p({"node_modules/get-intrinsic/index.js"(e,t){var r,n=Gl(),i=Wl(),a=$l(),o=Zl(),s=Xl(),l=Yl(),c=Kl(),u=Function,h=function(e){try{return u('"use strict"; return ('+e+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(O){p=null}var d,f=function(){throw new l},m=p?function(){try{return f}catch(e){try{return p(arguments,"callee").get}catch(t){return f}}}():f,g=Jl()(),y=Ql()(),v=Object.getPrototypeOf||(y?function(e){return e.__proto__}:null),x={},b="undefined"!==typeof Uint8Array&&v?v(Uint8Array):r,_={__proto__:null,"%AggregateError%":"undefined"===typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"===typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":g&&v?v([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":x,"%AsyncGenerator%":x,"%AsyncGeneratorFunction%":x,"%AsyncIteratorPrototype%":x,"%Atomics%":"undefined"===typeof Atomics?r:Atomics,"%BigInt%":"undefined"===typeof BigInt?r:BigInt,"%BigInt64Array%":"undefined"===typeof BigInt64Array?r:BigInt64Array,"%BigUint64Array%":"undefined"===typeof BigUint64Array?r:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"===typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":n,"%eval%":eval,"%EvalError%":i,"%Float32Array%":"undefined"===typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"===typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"===typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":x,"%Int8Array%":"undefined"===typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"===typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"===typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&v?v(v([][Symbol.iterator]())):r,"%JSON%":"object"===typeof JSON?JSON:r,"%Map%":"undefined"===typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!==typeof Map&&g&&v?v((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"===typeof Promise?r:Promise,"%Proxy%":"undefined"===typeof Proxy?r:Proxy,"%RangeError%":a,"%ReferenceError%":o,"%Reflect%":"undefined"===typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"===typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!==typeof Set&&g&&v?v((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"===typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&v?v(""[Symbol.iterator]()):r,"%Symbol%":g?Symbol:r,"%SyntaxError%":s,"%ThrowTypeError%":m,"%TypedArray%":b,"%TypeError%":l,"%Uint8Array%":"undefined"===typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"===typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"===typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"===typeof Uint32Array?r:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"===typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"===typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"===typeof WeakSet?r:WeakSet};if(v)try{null.error}catch(O){d=v(v(O)),_["%Error.prototype%"]=d}var w=function e(t){var r;if("%AsyncFunction%"===t)r=h("async function () {}");else if("%GeneratorFunction%"===t)r=h("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=h("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&v&&(r=v(i.prototype))}return _[t]=r,r},k={__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"]},T=tc(),S=rc(),A=T.call(Function.call,Array.prototype.concat),M=T.call(Function.apply,Array.prototype.splice),E=T.call(Function.call,String.prototype.replace),C=T.call(Function.call,String.prototype.slice),P=T.call(Function.call,RegExp.prototype.exec),L=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,z=function(e,t){var r,n=e;if(S(k,n)&&(n="%"+(r=k[n])[0]+"%"),S(_,n)){var i=_[n];if(i===x&&(i=w(n)),"undefined"===typeof i&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new s("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!==typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!==typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,e))throw new s("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=C(e,0,1),r=C(e,-1);if("%"===t&&"%"!==r)throw new s("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new s("invalid intrinsic syntax, expected opening `%`");var n=[];return E(e,L,(function(e,t,r,i){n[n.length]=r?E(i,I,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=z("%"+n+"%",t),a=i.name,o=i.value,c=!1,u=i.alias;u&&(n=u[0],M(r,A([0,1],u)));for(var h=1,d=!0;h<r.length;h+=1){var f=r[h],m=C(f,0,1),g=C(f,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new s("property names with quotes must have matching quotes");if("constructor"!==f&&d||(c=!0),S(_,a="%"+(n+="."+f)+"%"))o=_[a];else if(null!=o){if(!(f in o)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(p&&h+1>=r.length){var y=p(o,f);o=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:o[f]}else d=S(o,f),o=o[f];d&&!c&&(_[a]=o)}}return o}}}),ic=p({"node_modules/es-define-property/index.js"(e,t){var r=nc()("%Object.defineProperty%",!0)||!1;if(r)try{r({},"a",{value:1})}catch(n){r=!1}t.exports=r}}),ac=p({"node_modules/gopd/index.js"(e,t){var r=nc()("%Object.getOwnPropertyDescriptor%",!0);if(r)try{r([],"length")}catch(n){r=null}t.exports=r}}),oc=p({"node_modules/define-data-property/index.js"(e,t){var r=ic(),n=Xl(),i=Yl(),a=ac();t.exports=function(e,t,o){if(!e||"object"!==typeof e&&"function"!==typeof e)throw new i("`obj` must be an object or a function`");if("string"!==typeof t&&"symbol"!==typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!==typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!==typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!==typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!==typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],h=!!a&&a(e,t);if(r)r(e,t,{configurable:null===c&&h?h.configurable:!c,enumerable:null===s&&h?h.enumerable:!s,value:o,writable:null===l&&h?h.writable:!l});else{if(!u&&(s||l||c))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=o}}}}),sc=p({"node_modules/has-property-descriptors/index.js"(e,t){var r=ic(),n=function(){return!!r};n.hasArrayLengthDefineBug=function(){if(!r)return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},t.exports=n}}),lc=p({"node_modules/set-function-length/index.js"(e,t){var r=nc(),n=oc(),i=sc()(),a=ac(),o=Yl(),s=r("%Math.floor%");t.exports=function(e,t){if("function"!==typeof e)throw new o("`fn` is not a function");if("number"!==typeof t||t<0||t>4294967295||s(t)!==t)throw new o("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in e&&a){var u=a(e,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!r)&&(i?n(e,"length",t,!0,!0):n(e,"length",t)),e}}}),cc=p({"node_modules/call-bind/index.js"(e,t){var r=tc(),n=nc(),i=lc(),a=Yl(),o=n("%Function.prototype.apply%"),s=n("%Function.prototype.call%"),l=n("%Reflect.apply%",!0)||r.call(s,o),c=ic(),u=n("%Math.max%");t.exports=function(e){if("function"!==typeof e)throw new a("a function is required");var t=l(r,s,arguments);return i(t,1+u(0,e.length-(arguments.length-1)),!0)};var h=function(){return l(r,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h}}),uc=p({"node_modules/call-bind/callBound.js"(e,t){var r=nc(),n=cc(),i=n(r("String.prototype.indexOf"));t.exports=function(e,t){var a=r(e,!!t);return"function"===typeof a&&i(e,".prototype.")>-1?n(a):a}}}),hc=p({"node_modules/is-arguments/index.js"(e,t){var r=Hl()(),n=uc()("Object.prototype.toString"),i=function(e){return!(r&&e&&"object"===typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},a=function(e){return!!i(e)||null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},o=function(){return i(arguments)}();i.isLegacyArguments=a,t.exports=o?i:a}}),pc=p({"node_modules/is-generator-function/index.js"(e,t){var r,n=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,o=Hl()(),s=Object.getPrototypeOf;t.exports=function(e){if("function"!==typeof e)return!1;if(a.test(i.call(e)))return!0;if(!o)return"[object GeneratorFunction]"===n.call(e);if(!s)return!1;if("undefined"===typeof r){var t=function(){if(!o)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&s(t)}return s(e)===r}}}),dc=p({"node_modules/is-callable/index.js"(e,t){var r,n,i=Function.prototype.toString,a="object"===typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"===typeof a&&"function"===typeof Object.defineProperty)try{r=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,r)}catch(f){f!==n&&(a=null)}else a=null;var o,s=/^\s*class\b/,l=function(e){try{var t=i.call(e);return s.test(t)}catch(r){return!1}},c=function(e){try{return!l(e)&&(i.call(e),!0)}catch(t){return!1}},u=Object.prototype.toString,h="function"===typeof Symbol&&!!Symbol.toStringTag,p=!(0 in[,]),d=function(){return!1};"object"===typeof document&&(o=document.all,u.call(o)===u.call(document.all)&&(d=function(e){if((p||!e)&&("undefined"===typeof e||"object"===typeof e))try{var t=u.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(r){}return!1})),t.exports=a?function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;try{a(e,null,r)}catch(t){if(t!==n)return!1}return!l(e)&&c(e)}:function(e){if(d(e))return!0;if(!e)return!1;if("function"!==typeof e&&"object"!==typeof e)return!1;if(h)return c(e);if(l(e))return!1;var t=u.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&c(e)}}}),fc=p({"node_modules/for-each/index.js"(e,t){var r=dc(),n=Object.prototype.toString,i=Object.prototype.hasOwnProperty;t.exports=function(e,t,a){if(!r(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=a),"[object Array]"===n.call(e)?function(e,t,r){for(var n=0,a=e.length;n<a;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o):"string"===typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,o):function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,o)}}}),mc=p({"node_modules/available-typed-arrays/index.js"(e,t){var r=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"===typeof globalThis?window:globalThis;t.exports=function(){for(var e=[],t=0;t<r.length;t++)"function"===typeof n[r[t]]&&(e[e.length]=r[t]);return e}}}),gc=p({"node_modules/which-typed-array/index.js"(e,t){var r=fc(),n=mc(),i=cc(),a=uc(),o=ac(),s=a("Object.prototype.toString"),l=Hl()(),c="undefined"===typeof globalThis?window:globalThis,u=n(),h=a("String.prototype.slice"),p=Object.getPrototypeOf,d=a("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},f={__proto__:null};r(u,l&&o&&p?function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=o(r,Symbol.toStringTag);if(!n){var a=p(r);n=o(a,Symbol.toStringTag)}f["$"+e]=i(n.get)}}:function(e){var t=new c[e],r=t.slice||t.set;r&&(f["$"+e]=i(r))}),t.exports=function(e){if(!e||"object"!==typeof e)return!1;if(!l){var t=h(s(e),8,-1);return d(u,t)>-1?t:"Object"===t&&function(e){var t=!1;return r(f,(function(r,n){if(!t)try{r(e),t=h(n,1)}catch(i){}})),t}(e)}return o?function(e){var t=!1;return r(f,(function(r,n){if(!t)try{"$"+r(e)===n&&(t=h(n,1))}catch(i){}})),t}(e):null}}}),yc=p({"node_modules/is-typed-array/index.js"(e,t){var r=fc(),n=mc(),i=uc(),a=i("Object.prototype.toString"),o=Hl()(),s=ac(),l="undefined"===typeof globalThis?window:globalThis,c=n(),u=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},h=i("String.prototype.slice"),p={},d=Object.getPrototypeOf;o&&s&&d&&r(c,(function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=d(t),n=s(r,Symbol.toStringTag);if(!n){var i=d(r);n=s(i,Symbol.toStringTag)}p[e]=n.get}})),t.exports=function(e){if(!e||"object"!==typeof e)return!1;if(!o||!(Symbol.toStringTag in e)){var t=h(a(e),8,-1);return u(c,t)>-1}return!!s&&function(e){var t=!1;return r(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(i){}})),t}(e)}}}),vc=p({"node_modules/util/support/types.js"(e){var t=hc(),r=pc(),n=gc(),i=yc();function a(e){return e.call.bind(e)}var o,s,l="undefined"!==typeof BigInt,c="undefined"!==typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),p=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);function f(e,t){if("object"!==typeof e)return!1;try{return t(e),!0}catch(r){return!1}}function m(e){return"[object Map]"===u(e)}function g(e){return"[object Set]"===u(e)}function y(e){return"[object WeakMap]"===u(e)}function v(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function b(e){return"undefined"!==typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function _(e){return"[object DataView]"===u(e)}function w(e){return"undefined"!==typeof DataView&&(_.working?_(e):e instanceof DataView)}l&&(o=a(BigInt.prototype.valueOf)),c&&(s=a(Symbol.prototype.valueOf)),e.isArgumentsObject=t,e.isGeneratorFunction=r,e.isTypedArray=i,e.isPromise=function(e){return"undefined"!==typeof Promise&&e instanceof Promise||null!==e&&"object"===typeof e&&"function"===typeof e.then&&"function"===typeof e.catch},e.isArrayBufferView=function(e){return"undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):i(e)||w(e)},e.isUint8Array=function(e){return"Uint8Array"===n(e)},e.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===n(e)},e.isUint16Array=function(e){return"Uint16Array"===n(e)},e.isUint32Array=function(e){return"Uint32Array"===n(e)},e.isInt8Array=function(e){return"Int8Array"===n(e)},e.isInt16Array=function(e){return"Int16Array"===n(e)},e.isInt32Array=function(e){return"Int32Array"===n(e)},e.isFloat32Array=function(e){return"Float32Array"===n(e)},e.isFloat64Array=function(e){return"Float64Array"===n(e)},e.isBigInt64Array=function(e){return"BigInt64Array"===n(e)},e.isBigUint64Array=function(e){return"BigUint64Array"===n(e)},m.working="undefined"!==typeof Map&&m(new Map),e.isMap=function(e){return"undefined"!==typeof Map&&(m.working?m(e):e instanceof Map)},g.working="undefined"!==typeof Set&&g(new Set),e.isSet=function(e){return"undefined"!==typeof Set&&(g.working?g(e):e instanceof Set)},y.working="undefined"!==typeof WeakMap&&y(new WeakMap),e.isWeakMap=function(e){return"undefined"!==typeof WeakMap&&(y.working?y(e):e instanceof WeakMap)},v.working="undefined"!==typeof WeakSet&&v(new WeakSet),e.isWeakSet=function(e){return v(e)},x.working="undefined"!==typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=b,_.working="undefined"!==typeof ArrayBuffer&&"undefined"!==typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=w;var k="undefined"!==typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function T(e){return"[object SharedArrayBuffer]"===u(e)}function S(e){return"undefined"!==typeof k&&("undefined"===typeof T.working&&(T.working=T(new k)),T.working?T(e):e instanceof k)}function A(e){return f(e,h)}function M(e){return f(e,p)}function E(e){return f(e,d)}function C(e){return l&&f(e,o)}function P(e){return c&&f(e,s)}e.isSharedArrayBuffer=S,e.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},e.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},e.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},e.isGeneratorObject=function(e){return"[object Generator]"===u(e)},e.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},e.isNumberObject=A,e.isStringObject=M,e.isBooleanObject=E,e.isBigIntObject=C,e.isSymbolObject=P,e.isBoxedPrimitive=function(e){return A(e)||M(e)||E(e)||C(e)||P(e)},e.isAnyArrayBuffer=function(e){return"undefined"!==typeof Uint8Array&&(b(e)||S(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))}}),xc=p({"node_modules/util/support/isBufferBrowser.js"(e,t){t.exports=function(e){return e&&"object"===typeof e&&"function"===typeof e.copy&&"function"===typeof e.fill&&"function"===typeof e.readUInt8}}}),bc=p({"(disabled):node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},r=/%[sdj%]/g;e.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}})),l=i[n];n<a;l=i[++n])f(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},e.deprecate=function(t,r){if("undefined"!==typeof process&&!0===process.noDeprecation)return t;if("undefined"===typeof process)return function(){return e.deprecate(t,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var n,i={},a=/^$/;function o(t,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"\x1b["+o.colors[r][0]+"m"+e+"\x1b["+o.colors[r][1]+"m":e}function l(e,t){return e}function c(t,r,n){if(t.customInspect&&r&&w(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return p(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),x=T?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)A(t,String(o))?a.push(h(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(h(e,t,r,n,i,!0))})),a}(t,r,n,s,o):o.map((function(e){return h(t,r,n,s,e,T)})),t.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=f(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"===typeof e}function f(e){return null===e}function m(e){return"number"===typeof e}function g(e){return"string"===typeof e}function y(e){return void 0===e}function v(e){return x(e)&&"[object RegExp]"===k(e)}function x(e){return"object"===typeof e&&null!==e}function b(e){return x(e)&&"[object Date]"===k(e)}function _(e){return x(e)&&("[object Error]"===k(e)||e instanceof Error)}function w(e){return"function"===typeof e}function k(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=process.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=vc(),e.isArray=p,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=m,e.isString=g,e.isSymbol=function(e){return"symbol"===typeof e},e.isUndefined=y,e.isRegExp=v,e.types.isRegExp=v,e.isObject=x,e.isDate=b,e.types.isDate=b,e.isError=_,e.types.isNativeError=_,e.isFunction=w,e.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},e.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",function(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}(),e.format.apply(e,arguments))},e.inherits=Fl(),e._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(M&&e[M]){var r;if("function"!==typeof(r=e[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(o){r(o)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),M&&Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,t(e))},e.promisify.custom=M,e.callbackify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!==typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};e.apply(this,t).then((function(e){process.nextTick(a.bind(null,null,e))}),(function(e){process.nextTick(E.bind(null,e,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,t(e)),r}}}),_c=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/buffer_list.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=Vl().Buffer,o=bc().inspect,s=o&&o.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,l,c;return t=e,l=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,a=e>i.length?i.length:e;if(a===i.length?n+=i:n+=i.slice(0,e),0===(e-=a)){a===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(a));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return o(this,function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){n(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}],l&&i(t.prototype,l),c&&i(t,c),e}()}}),wc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/destroy.js"(e,t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var a=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,e)):process.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?process.nextTick(n,a):(a._writableState.errorEmitted=!0,process.nextTick(r,a,e)):process.nextTick(r,a,e):t?(process.nextTick(n,a),t(e)):process.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}}),kc=p({"node_modules/stream-browserify/node_modules/readable-stream/errors-browser.js"(e,t){var r={};function n(e,t,n){n||(n=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"===typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,r[e]=i}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}n("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,a,o,s;if("string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var l=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(l," ").concat(n," ").concat(i(t,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r}}),Tc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/state.js"(e,t){var r=kc().codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,i){var a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,n);if(null!=a){if(!isFinite(a)||Math.floor(a)!==a||a<0)throw new r(i?n:"highWaterMark",a);return Math.floor(a)}return e.objectMode?16:16384}}}}),Sc=p({"node_modules/util-deprecate/browser.js"(e,t){function r(e){try{if(!window.localStorage)return!1}catch(r){return!1}var t=window.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}}),Ac=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_writable.js"(e,t){function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var n;t.exports=k,k.WritableState=w;var i,a={deprecate:Sc()},o=Bl(),s=Vl().Buffer,l=window.Uint8Array||function(){},c=wc(),u=Tc().getHighWaterMark,h=kc().codes,p=h.ERR_INVALID_ARG_TYPE,d=h.ERR_METHOD_NOT_IMPLEMENTED,f=h.ERR_MULTIPLE_CALLBACK,m=h.ERR_STREAM_CANNOT_PIPE,g=h.ERR_STREAM_DESTROYED,y=h.ERR_STREAM_NULL_VALUES,v=h.ERR_STREAM_WRITE_AFTER_END,x=h.ERR_UNKNOWN_ENCODING,b=c.errorOrDestroy;function _(){}function w(e,t,i){n=n||Mc(),e=e||{},"boolean"!==typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=u(this,e,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!==typeof i)throw new f;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(C,e,t),e._writableState.errorEmitted=!0,b(e,n)):(i(n),e._writableState.errorEmitted=!0,b(e,n),C(e,t))}(e,r,n,t,i);else{var a=M(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||A(e,r),n?process.nextTick(S,e,r,a,i):S(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function k(e){var t=this instanceof(n=n||Mc());if(!t&&!i.call(k,this))return new k(e);this._writableState=new w(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),o.call(this)}function T(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new g("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function S(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),C(e,t)}function A(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,a=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)a[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;a.allBuffers=l,T(e,t,!0,t.length,a,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(T(e,t,!1,t.objectMode?1:c.length,c,u,h),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function M(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final((function(r){t.pendingcb--,r&&b(e,r),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var r=M(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(E,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}Fl()(k,o),w.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(w.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(i=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!i.call(this,e)||this===k&&e&&e._writableState instanceof w}})):i=function(e){return e instanceof this},k.prototype.pipe=function(){b(this,new m)},k.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,o=!i.objectMode&&(n=e,s.isBuffer(n)||n instanceof l);return o&&!s.isBuffer(e)&&(e=function(e){return s.from(e)}(e)),"function"===typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!==typeof r&&(r=_),i.ending?function(e,t){var r=new v;b(e,r),process.nextTick(t,r)}(this,r):(o||function(e,t,r,n){var i;return null===r?i=new y:"string"===typeof r||t.objectMode||(i=new p("chunk",["string","Buffer"],r)),!i||(b(e,i),process.nextTick(n,i),!1)}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,a){if(!r){var o=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=s.from(t,r)),t}(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var l=t.objectMode?1:n.length;t.length+=l;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else T(e,t,!1,l,n,i,a);return c}(this,i,o,e,t,r)),a},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||A(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new d("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,C(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=c.destroy,k.prototype._undestroy=c.undestroy,k.prototype._destroy=function(e,t){t(e)}}}),Mc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_duplex.js"(e,t){var r=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=l;var n,i,a,o=zc(),s=Ac();for(Fl()(l,o),n=r(s.prototype),a=0;a<n.length;a++)i=n[a],l.prototype[i]||(l.prototype[i]=s.prototype[i]);function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}}),Ec=p({"node_modules/safe-buffer/index.js"(e,t){var r=Vl(),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a),a.prototype=Object.create(n.prototype),i(n,a),a.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},a.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"===typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},a.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n(e)},a.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}}),Cc=p({"node_modules/stream-browserify/node_modules/string_decoder/lib/string_decoder.js"(e){var t=Ec().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var n;switch(this.encoding=function(e){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!==typeof n&&(t.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=o,this.end=s,n=4;break;case"utf8":this.fillLast=a,n=4;break;case"base64":this.text=l,this.end=c,n=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function i(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!==(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function o(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var a=i(t[n]);return a>=0?(a>0&&(e.lastNeed=a-1),a):--n<r||-2===a?0:(a=i(t[n]))>=0?(a>0&&(e.lastNeed=a-2),a):--n<r||-2===a?0:(a=i(t[n]))>=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}}),Pc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/end-of-stream.js"(e,t){var r=kc().codes.ERR_STREAM_PREMATURE_CLOSE;function n(){}t.exports=function e(t,i,a){if("function"===typeof i)return e(t,null,i);i||(i={}),a=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(a||n);var o=i.readable||!1!==i.readable&&t.readable,s=i.writable||!1!==i.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){s=!1,c=!0,o||a.call(t)},h=t._readableState&&t._readableState.endEmitted,p=function(){o=!1,h=!0,s||a.call(t)},d=function(e){a.call(t,e)},f=function(){var e;return o&&!h?(t._readableState&&t._readableState.ended||(e=new r),a.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new r),a.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"===typeof e.abort}(t)?(t.on("complete",u),t.on("abort",f),t.req?m():t.on("request",m)):s&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",p),t.on("finish",u),!1!==i.error&&t.on("error",d),t.on("close",f),function(){t.removeListener("complete",u),t.removeListener("abort",f),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",p),t.removeListener("error",d),t.removeListener("close",f)}}}}),Lc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/async_iterator.js"(e,t){var r;function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=Pc(),a=Symbol("lastResolve"),o=Symbol("lastReject"),s=Symbol("error"),l=Symbol("ended"),c=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function d(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[c]=null,e[a]=null,e[o]=null,t(p(r,!1)))}}function f(e){process.nextTick(d,e)}var m=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((n(r={get stream(){return this[h]},next:function(){var e=this,t=this[s];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[s]?r(e[s]):t(p(void 0,!0))}))}));var r,n=this[c];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[l]?r(p(void 0,!0)):t[u](r,n)}),n)}}(n,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));r=new Promise(this[u])}return this[c]=r,r}},Symbol.asyncIterator,(function(){return this})),n(r,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(p(void 0,!0))}))}))})),r),m);t.exports=function(e){var t,r=Object.create(g,(n(t={},h,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,o,{value:null,writable:!0}),n(t,s,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,u,{value:function(e,t){var n=r[h].read();n?(r[c]=null,r[a]=null,r[o]=null,e(p(n,!1))):(r[a]=e,r[o]=t)},writable:!0}),t));return r[c]=null,i(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[o];return null!==t&&(r[c]=null,r[a]=null,r[o]=null,t(e)),void(r[s]=e)}var n=r[a];null!==n&&(r[c]=null,r[a]=null,r[o]=null,n(p(void 0,!0))),r[l]=!0})),e.on("readable",f.bind(null,r)),r}}}),Ic=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/from-browser.js"(e,t){t.exports=function(){throw new Error("Readable.from is not available in the browser")}}}),zc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_readable.js"(e,t){var r;t.exports=k,k.ReadableState=w,ht().EventEmitter;var n,i=function(e,t){return e.listeners(t).length},a=Bl(),o=Vl().Buffer,s=window.Uint8Array||function(){},l=bc();n=l&&l.debuglog?l.debuglog("stream"):function(){};var c,u,h,p=_c(),d=wc(),f=Tc().getHighWaterMark,m=kc().codes,g=m.ERR_INVALID_ARG_TYPE,y=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,x=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;Fl()(k,a);var b=d.errorOrDestroy,_=["error","close","destroy","pause","resume"];function w(e,t,n){r=r||Mc(),e=e||{},"boolean"!==typeof n&&(n=t instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=f(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=Cc().StringDecoder),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function k(e){if(r=r||Mc(),!(this instanceof k))return new k(e);var t=this instanceof r;this._readableState=new w(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function T(e,t,r,i,a){n("readableAddChunk",t);var l,c=e._readableState;if(null===t)c.reading=!1,function(e,t){if(n("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?E(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,C(e)))}}(e,c);else if(a||(l=function(e,t){var r,n;return n=t,o.isBuffer(n)||n instanceof s||"string"===typeof t||void 0===t||e.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],t)),r}(c,t)),l)b(e,l);else if(c.objectMode||t&&t.length>0)if("string"===typeof t||c.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),i)c.endEmitted?b(e,new x):S(e,c,t,!0);else if(c.ended)b(e,new y);else{if(c.destroyed)return!1;c.reading=!1,c.decoder&&!r?(t=c.decoder.write(t),c.objectMode||0!==t.length?S(e,c,t,!1):P(e,c)):S(e,c,t,!1)}else i||(c.reading=!1,P(e,c));return!c.ended&&(c.length<c.highWaterMark||0===c.length)}function S(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),P(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=d.destroy,k.prototype._undestroy=d.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"===typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=o.from(e,t),t=""),r=!0),T(this,e,t,!1,r)},k.prototype.unshift=function(e){return T(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){c||(c=Cc().StringDecoder);var t=new c(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";null!==r;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var A=1073741824;function M(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=A?e=A:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;n("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(n("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(C,e))}function C(e){var t=e._readableState;n("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,R(e)}function P(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(L,e,t))}function L(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(n("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){n("readable nexttick read 0"),e.read(0)}function O(e,t){n("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),R(e),t.flowing&&!t.reading&&e.read(0)}function R(e){var t=e._readableState;for(n("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function j(e){var t=e._readableState;n("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(F,t,e))}function F(e,t){if(n("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function B(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){n("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return n("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):E(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&j(this),null;var i,a=t.needReadable;return n("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&n("length less than watermark",a=!0),t.ended||t.reading?n("reading or ended",a=!1):a&&(n("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(r,t))),null===(i=e>0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&j(this)),null!==i&&this.emit("data",i),i},k.prototype._read=function(e){b(this,new v("_read()"))},k.prototype.pipe=function(e,t){var r=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,n("pipe count=%d opts=%j",a.pipesCount,t);var o=t&&!1===t.end||e===process.stdout||e===process.stderr?m:l;function s(t,i){n("onunpipe"),t===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,n("cleanup"),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("drain",c),e.removeListener("error",p),e.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",m),r.removeListener("data",h),u=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}function l(){n("onend"),e.end()}a.endEmitted?process.nextTick(o):r.once("end",o),e.on("unpipe",s);var c=function(e){return function(){var t=e._readableState;n("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,R(e))}}(r);e.on("drain",c);var u=!1;function h(t){n("ondata");var i=e.write(t);n("dest.write",i),!1===i&&((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==B(a.pipes,e))&&!u&&(n("false write response, pause",a.awaitDrain),a.awaitDrain++),r.pause())}function p(t){n("onerror",t),m(),e.removeListener("error",p),0===i(e,"error")&&b(e,t)}function d(){e.removeListener("finish",f),m()}function f(){n("onfinish"),e.removeListener("close",d),m()}function m(){n("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",d),e.once("finish",f),e.emit("pipe",r),a.flowing||(n("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=B(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,n("on readable",i.length,i.reading),i.length?E(this):i.reading||process.nextTick(z,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(I,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(I,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(n("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(O,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var a in e.on("end",(function(){if(n("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(a){n("wrapped data"),r.decoder&&(a=r.decoder.write(a)),(!r.objectMode||null!==a&&void 0!==a)&&(r.objectMode||a&&a.length)&&(t.push(a)||(i=!0,e.pause()))})),e)void 0===this[a]&&"function"===typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var o=0;o<_.length;o++)e.on(_[o],this.emit.bind(this,_[o]));return this._read=function(t){n("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"===typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===u&&(u=Lc()),u(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=D,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(k.from=function(e,t){return void 0===h&&(h=Ic()),h(k,e,t)})}}),Oc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_transform.js"(e,t){t.exports=c;var r=kc().codes,n=r.ERR_METHOD_NOT_IMPLEMENTED,i=r.ERR_MULTIPLE_CALLBACK,a=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=r.ERR_TRANSFORM_WITH_LENGTH_0,s=Mc();function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length<a.highWaterMark)&&this._read(a.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);s.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!==typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,r){h(e,t,r)}))}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new o;if(e._transformState.transforming)throw new a;return e.push(null)}Fl()(c,s),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,s.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new n("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){s.prototype._destroy.call(this,e,(function(e){t(e)}))}}}),Rc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/_stream_passthrough.js"(e,t){t.exports=n;var r=Oc();function n(e){if(!(this instanceof n))return new n(e);r.call(this,e)}Fl()(n,r),n.prototype._transform=function(e,t,r){r(null,e)}}}),Dc=p({"node_modules/stream-browserify/node_modules/readable-stream/lib/internal/streams/pipeline.js"(e,t){var r,n=kc().codes,i=n.ERR_MISSING_ARGS,a=n.ERR_STREAM_DESTROYED;function o(e){if(e)throw e}function s(e){e()}function l(e,t){return e.pipe(t)}t.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var c,u=function(e){return e.length?"function"!==typeof e[e.length-1]?o:e.pop():o}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new i("streams");var h=t.map((function(e,n){var i=n<t.length-1;return function(e,t,n,i){i=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(i);var o=!1;e.on("close",(function(){o=!0})),void 0===r&&(r=Pc()),r(e,{readable:t,writable:n},(function(e){if(e)return i(e);o=!0,i()}));var s=!1;return function(t){if(!o&&!s)return s=!0,function(e){return e.setHeader&&"function"===typeof e.abort}(e)?e.abort():"function"===typeof e.destroy?e.destroy():void i(t||new a("pipe"))}}(e,i,n>0,(function(e){c||(c=e),e&&h.forEach(s),i||(h.forEach(s),u(c))}))}));return t.reduce(l)}}}),jc=p({"node_modules/stream-browserify/index.js"(e,t){t.exports=n;var r=ht().EventEmitter;function n(){r.call(this)}Fl()(n,r),n.Readable=zc(),n.Writable=Ac(),n.Duplex=Mc(),n.Transform=Oc(),n.PassThrough=Rc(),n.finished=Pc(),n.pipeline=Dc(),n.Stream=n,n.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function a(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",a),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",l));var o=!1;function s(){o||(o=!0,e.end())}function l(){o||(o=!0,"function"===typeof e.destroy&&e.destroy())}function c(e){if(u(),0===r.listenerCount(this,"error"))throw e}function u(){n.removeListener("data",i),e.removeListener("drain",a),n.removeListener("end",s),n.removeListener("close",l),n.removeListener("error",c),e.removeListener("error",c),n.removeListener("end",u),n.removeListener("close",u),e.removeListener("close",u)}return n.on("error",c),e.on("error",c),n.on("end",u),n.on("close",u),e.on("close",u),e.emit("pipe",n),e}}}),Fc=p({"node_modules/util/util.js"(e){var t=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},r=/%[sdj%]/g;e.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}n=1;for(var i=arguments,a=i.length,s=String(e).replace(r,(function(e){if("%%"===e)return"%";if(n>=a)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}})),l=i[n];n<a;l=i[++n])f(l)||!x(l)?s+=" "+l:s+=" "+o(l);return s},e.deprecate=function(t,r){if("undefined"!==typeof process&&!0===process.noDeprecation)return t;if("undefined"===typeof process)return function(){return e.deprecate(t,r).apply(this,arguments)};var n=!1;return function(){if(!n){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),n=!0}return t.apply(this,arguments)}};var n,i={},a=/^$/;function o(t,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),c(n,t,n.depth)}function s(e,t){var r=o.styles[t];return r?"\x1b["+o.colors[r][0]+"m"+e+"\x1b["+o.colors[r][1]+"m":e}function l(e,t){return e}function c(t,r,n){if(t.customInspect&&r&&w(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var a=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):f(t)?e.stylize("null","null"):void 0}(t,r);if(a)return a;var o=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(r)),_(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(r);if(0===o.length){if(w(r)){var l=r.name?": "+r.name:"";return t.stylize("[Function"+l+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(_(r))return u(r)}var x,k="",T=!1,S=["{","}"];return p(r)&&(T=!0,S=["[","]"]),w(r)&&(k=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(k=" "+RegExp.prototype.toString.call(r)),b(r)&&(k=" "+Date.prototype.toUTCString.call(r)),_(r)&&(k=" "+u(r)),0!==o.length||T&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),x=T?function(e,t,r,n,i){for(var a=[],o=0,s=t.length;o<s;++o)A(t,String(o))?a.push(h(e,t,r,n,String(o),!0)):a.push("");return i.forEach((function(i){i.match(/^\d+$/)||a.push(h(e,t,r,n,i,!0))})),a}(t,r,n,s,o):o.map((function(e){return h(t,r,n,s,e,T)})),t.seen.pop(),function(e,t,r){var n=e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(x,k,S)):S[0]+k+S[1]}function u(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,a){var o,s,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(l.value)<0?(s=f(r)?c(e,l.value,null):c(e,l.value,r-1)).indexOf("\n")>-1&&(s=a?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"===typeof e}function f(e){return null===e}function m(e){return"number"===typeof e}function g(e){return"string"===typeof e}function y(e){return void 0===e}function v(e){return x(e)&&"[object RegExp]"===k(e)}function x(e){return"object"===typeof e&&null!==e}function b(e){return x(e)&&"[object Date]"===k(e)}function _(e){return x(e)&&("[object Error]"===k(e)||e instanceof Error)}function w(e){return"function"===typeof e}function k(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}n=(n="false").replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+n+"$","i"),e.debuglog=function(t){if(t=t.toUpperCase(),!i[t])if(a.test(t)){var r=process.pid;i[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else i[t]=function(){};return i[t]},e.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=vc(),e.isArray=p,e.isBoolean=d,e.isNull=f,e.isNullOrUndefined=function(e){return null==e},e.isNumber=m,e.isString=g,e.isSymbol=function(e){return"symbol"===typeof e},e.isUndefined=y,e.isRegExp=v,e.types.isRegExp=v,e.isObject=x,e.isDate=b,e.types.isDate=b,e.isError=_,e.types.isNativeError=_,e.isFunction=w,e.isPrimitive=function(e){return null===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||"symbol"===typeof e||"undefined"===typeof e},e.isBuffer=xc();var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",function(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),S[e.getMonth()],t].join(" ")}(),e.format.apply(e,arguments))},e.inherits=Fl(),e._extend=function(e,t){if(!t||!x(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var M="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function E(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}e.promisify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');if(M&&e[M]){var r;if("function"!==typeof(r=e[M]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],a=0;a<arguments.length;a++)i.push(arguments[a]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(o){r(o)}return n}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),M&&Object.defineProperty(r,M,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,t(e))},e.promisify.custom=M,e.callbackify=function(e){if("function"!==typeof e)throw new TypeError('The "original" argument must be of type Function');function r(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!==typeof n)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return n.apply(i,arguments)};e.apply(this,t).then((function(e){process.nextTick(a.bind(null,null,e))}),(function(e){process.nextTick(E.bind(null,e,a))}))}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),Object.defineProperties(r,t(e)),r}}}),Bc=p({"node_modules/assert/build/internal/errors.js"(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}function a(e,t){return(a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=s(e);if(t){var a=s(this).constructor;n=Reflect.construct(i,arguments,a)}else n=i.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var l,c,u={};function h(e,t,r){r||(r=Error);var i=function(r){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(u,r);var i,s,l,c=o(u);function u(r,n,i){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),a=c.call(this,function(e,r,n){return"string"===typeof t?t:t(e,r,n)}(r,n,i)),a.code=e,a}return i=u,s&&n(i.prototype,s),l&&n(i,l),Object.defineProperty(i,"prototype",{writable:!1}),i}(r);u[e]=i}function p(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}h("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),h("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,a,o,s;if(void 0===l&&(l=ru()),l("string"===typeof e,"'name' must be a string"),"string"===typeof t&&(a="not ",t.substr(!o||o<0?0:+o,a.length)===a)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(p(t,"type"));else{var c=function(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(p(t,"type"))}return s+=". Received type ".concat(r(n))}),TypeError),h("ERR_INVALID_ARG_VALUE",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===c&&(c=Fc());var n=c.inspect(t);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(r,". Received ").concat(n)}),TypeError,RangeError),h("ERR_INVALID_RETURN_VALUE",(function(e,t,n){var i;return i=n&&n.constructor&&n.constructor.name?"instance of ".concat(n.constructor.name):"type ".concat(r(n)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),h("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];void 0===l&&(l=ru()),l(t.length>0,"At least one arg needs to be specified");var n="The ",i=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),i){case 1:n+="".concat(t[0]," argument");break;case 2:n+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:n+=t.slice(0,i-1).join(", "),n+=", and ".concat(t[i-1]," arguments")}return"".concat(n," must be specified")}),TypeError),t.exports.codes=u}}),Nc=p({"node_modules/assert/build/internal/assert/assertion_error.js"(e,t){function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function n(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){var r,i,o;r=e,i=t,o=n[t],(i=a(i))in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!==d(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===d(t)?t:String(t)}function o(e,t){if(t&&("object"===d(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return s(e)}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"===typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return c(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(e,t,r){return(c=u()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i}).apply(null,arguments)}function u(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function h(e,t){return(h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var f=Fc().inspect,m=Bc().codes.ERR_INVALID_ARG_TYPE;function g(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",v="",x="",b="",_={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function T(e,t,r){var n="",i="",a=0,o="",s=!1,l=k(e),c=l.split("\n"),u=k(t).split("\n"),h=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===c.length&&1===u.length&&c[0]!==u[0]){var f=c[0].length+u[0].length;if(f<=10){if(("object"!==d(e)||null===e)&&("object"!==d(t)||null===t)&&(0!==e||0!==t))return"".concat(_[r],"\n\n")+"".concat(c[0]," !== ").concat(u[0],"\n")}else if("strictEqualObject"!==r&&f<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;c[0][h]===u[0][h];)h++;h>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var m=c[c.length-1],w=u[u.length-1];m===w&&(h++<2?o="\n ".concat(m).concat(o):n=m,c.pop(),u.pop(),0!==c.length&&0!==u.length);)m=c[c.length-1],w=u[u.length-1];var T=Math.max(c.length,u.length);if(0===T){var S=l.split("\n");if(S.length>30)for(S[26]="".concat(y,"...").concat(b);S.length>27;)S.pop();return"".concat(_.notIdentical,"\n\n").concat(S.join("\n"),"\n")}h>3&&(o="\n".concat(y,"...").concat(b).concat(o),s=!0),""!==n&&(o="\n ".concat(n).concat(o),n="");var A=0,M=_[r]+"\n".concat(v,"+ actual").concat(b," ").concat(x,"- expected").concat(b),E=" ".concat(y,"...").concat(b," Lines skipped");for(h=0;h<T;h++){var C=h-a;if(c.length<h+1)C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(u[h-2]),A++),i+="\n ".concat(u[h-1]),A++),a=h,n+="\n".concat(x,"-").concat(b," ").concat(u[h]),A++;else if(u.length<h+1)C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(c[h]),A++;else{var P=u[h],L=c[h],I=L!==P&&(!g(L,",")||L.slice(0,-1)!==P);I&&g(P,",")&&P.slice(0,-1)===L&&(I=!1,L+=","),I?(C>1&&h>2&&(C>4?(i+="\n".concat(y,"...").concat(b),s=!0):C>3&&(i+="\n ".concat(c[h-2]),A++),i+="\n ".concat(c[h-1]),A++),a=h,i+="\n".concat(v,"+").concat(b," ").concat(L),n+="\n".concat(x,"-").concat(b," ").concat(P),A+=2):(i+=n,n="",1!==C&&0!==h||(i+="\n ".concat(L),A++))}if(A>20&&h<T-2)return"".concat(M).concat(E,"\n").concat(i,"\n").concat(y,"...").concat(b).concat(n,"\n")+"".concat(y,"...").concat(b)}return"".concat(M).concat(s?E:"","\n").concat(i).concat(n).concat(o).concat(p)}var S=function(e,t){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(g,e);var r,a,l,c=function(e){var t=u();return function(){var r,n=p(e);if(t){var i=p(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return o(this,r)}}(g);function g(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),"object"!==d(e)||null===e)throw new m("options","Object",e);var r=e.message,n=e.operator,i=e.stackStartFn,a=e.actual,l=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=c.call(this,String(r));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(y="\x1b[34m",v="\x1b[32m",b="\x1b[39m",x="\x1b[31m"):(y="",v="",b="",x="")),"object"===d(a)&&null!==a&&"object"===d(l)&&null!==l&&"stack"in a&&a instanceof Error&&"stack"in l&&l instanceof Error&&(a=w(a),l=w(l)),"deepStrictEqual"===n||"strictEqual"===n)t=c.call(this,T(a,l,n));else if("notDeepStrictEqual"===n||"notStrictEqual"===n){var h=_[n],p=k(a).split("\n");if("notStrictEqual"===n&&"object"===d(a)&&null!==a&&(h=_.notStrictEqualObject),p.length>30)for(p[26]="".concat(y,"...").concat(b);p.length>27;)p.pop();t=1===p.length?c.call(this,"".concat(h," ").concat(p[0])):c.call(this,"".concat(h,"\n\n").concat(p.join("\n"),"\n"))}else{var f=k(a),S="",A=_[n];"notDeepEqual"===n||"notEqual"===n?(f="".concat(_[n],"\n\n").concat(f)).length>1024&&(f="".concat(f.slice(0,1021),"...")):(S="".concat(k(l)),f.length>512&&(f="".concat(f.slice(0,509),"...")),S.length>512&&(S="".concat(S.slice(0,509),"...")),"deepEqual"===n||"equal"===n?f="".concat(A,"\n\n").concat(f,"\n\nshould equal\n\n"):S=" ".concat(n," ").concat(S)),t=c.call(this,"".concat(f).concat(S))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(s(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=a,t.expected=l,t.operator=n,Error.captureStackTrace&&Error.captureStackTrace(s(t),i),t.stack,t.name="AssertionError",o(t)}return r=g,(a=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return f(this,n(n({},t),{},{customInspect:!1,depth:0}))}}])&&i(r.prototype,a),l&&i(r,l),Object.defineProperty(r,"prototype",{writable:!1}),g}(l(Error),f.custom);t.exports=S}}),Uc=p({"node_modules/object-keys/isArguments.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t=r.call(e),n="[object Arguments]"===t;return n||(n="[object Array]"!==t&&null!==e&&"object"===typeof e&&"number"===typeof e.length&&e.length>=0&&"[object Function]"===r.call(e.callee)),n}}}),Vc=p({"node_modules/object-keys/implementation.js"(e,t){var r,n,i,a,o,s,l,c,u,h,p,d;Object.keys||(n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Uc(),o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),l=o.call((function(){}),"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"===typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"===typeof window[e])try{u(window[e])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(e){if("undefined"===typeof window||!p)return u(e);try{return u(e)}catch(t){return!1}},r=function(e){var t=null!==e&&"object"===typeof e,r="[object Function]"===i.call(e),o=a(e),u=t&&"[object String]"===i.call(e),h=[];if(!t&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var p=l&&r;if(u&&e.length>0&&!n.call(e,0))for(var f=0;f<e.length;++f)h.push(String(f));if(o&&e.length>0)for(var m=0;m<e.length;++m)h.push(String(m));else for(var g in e)p&&"prototype"===g||!n.call(e,g)||h.push(String(g));if(s)for(var y=d(e),v=0;v<c.length;++v)y&&"constructor"===c[v]||!n.call(e,c[v])||h.push(c[v]);return h}),t.exports=r}}),qc=p({"node_modules/object-keys/index.js"(e,t){var r=Array.prototype.slice,n=Uc(),i=Object.keys,a=i?function(e){return i(e)}:Vc(),o=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return n(e)?o(r.call(e)):o(e)})}else Object.keys=a;return Object.keys||a},t.exports=a}}),Hc=p({"node_modules/object.assign/implementation.js"(e,t){var r=qc(),n=ql()(),i=uc(),a=Object,o=i("Array.prototype.push"),s=i("Object.prototype.propertyIsEnumerable"),l=n?Object.getOwnPropertySymbols:null;t.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var i=a(e);if(1===arguments.length)return i;for(var c=1;c<arguments.length;++c){var u=a(arguments[c]),h=r(u),p=n&&(Object.getOwnPropertySymbols||l);if(p)for(var d=p(u),f=0;f<d.length;++f){var m=d[f];s(u,m)&&o(h,m)}for(var g=0;g<h.length;++g){var y=h[g];if(s(u,y)){var v=u[y];i[y]=v}}}return i}}}),Gc=p({"node_modules/object.assign/polyfill.js"(e,t){var r=Hc();t.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),a="";for(var o in i)a+=o;return e!==a}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?r:Object.assign:r}}}),Wc=p({"node_modules/object-is/implementation.js"(e,t){var r=function(e){return e!==e};t.exports=function(e,t){return 0===e&&0===t?1/e===1/t:e===t||!(!r(e)||!r(t))}}}),$c=p({"node_modules/object-is/polyfill.js"(e,t){var r=Wc();t.exports=function(){return"function"===typeof Object.is?Object.is:r}}}),Zc=p({"node_modules/define-properties/index.js"(e,t){var r=qc(),n="function"===typeof Symbol&&"symbol"===typeof Symbol("foo"),i=Object.prototype.toString,a=Array.prototype.concat,o=Object.defineProperty,s=sc()(),l=o&&s,c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!==typeof(a=n)||"[object Function]"!==i.call(a)||!n())return;var a;l?o(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r},u=function(e,t){var i=arguments.length>2?arguments[2]:{},o=r(t);n&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)c(e,o[s],t[o[s]],i[o[s]])};u.supportsDescriptors=!!l,t.exports=u}}),Xc=p({"node_modules/object-is/shim.js"(e,t){var r=$c(),n=Zc();t.exports=function(){var e=r();return n(Object,{is:e},{is:function(){return Object.is!==e}}),e}}}),Yc=p({"node_modules/object-is/index.js"(e,t){var r=Zc(),n=cc(),i=Wc(),a=$c(),o=Xc(),s=n(a(),Object);r(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}}),Kc=p({"node_modules/is-nan/implementation.js"(e,t){t.exports=function(e){return e!==e}}}),Jc=p({"node_modules/is-nan/polyfill.js"(e,t){var r=Kc();t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:r}}}),Qc=p({"node_modules/is-nan/shim.js"(e,t){var r=Zc(),n=Jc();t.exports=function(){var e=n();return r(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}}}),eu=p({"node_modules/is-nan/index.js"(e,t){var r=cc(),n=Zc(),i=Kc(),a=Jc(),o=Qc(),s=r(a(),Number);n(s,{getPolyfill:a,implementation:i,shim:o}),t.exports=s}}),tu=p({"node_modules/assert/build/internal/util/comparisons.js"(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"===typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:Yc(),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:eu();function h(e){return e.call.bind(e)}var p=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),f=h(Object.prototype.toString),m=Fc().types,g=m.isAnyArrayBuffer,y=m.isArrayBufferView,v=m.isDate,x=m.isMap,b=m.isRegExp,_=m.isSet,w=m.isNativeError,k=m.isBoxedPrimitive,T=m.isNumberObject,S=m.isStringObject,A=m.isBooleanObject,M=m.isBigIntObject,E=m.isSymbolObject,C=m.isFloat32Array,P=m.isFloat64Array;function L(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function I(e){return Object.keys(e).filter(L).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function z(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function O(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"===typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var o,s,c,h,p=f(e);if(p!==f(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=I(e),m=I(t);return d.length===m.length&&D(e,t,r,n,1,d)}if("[object Object]"===p&&(!x(e)&&x(t)||!_(e)&&_(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(b(e)){if(!b(t)||(c=e,h=t,!(a?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(w(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(y(e)){if(r||!C(e)&&!P(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===z(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var L=I(e),O=I(t);return L.length===O.length&&D(e,t,r,n,0,L)}if(_(e))return!(!_(t)||e.size!==t.size)&&D(e,t,r,n,2);if(x(e))return!(!x(t)||e.size!==t.size)&&D(e,t,r,n,3);if(g(e)){if(s=t,(o=e).byteLength!==s.byteLength||0!==z(new Uint8Array(o),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return T(e)?T(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):S(e)?S(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):A(e)?A(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):M(e)?M(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):E(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return D(e,t,r,n,0)}function R(e,t){return t.filter((function(t){return d(e,t)}))}function D(e,t,n,a,l,u){if(5===arguments.length){u=Object.keys(e);var h=Object.keys(t);if(u.length!==h.length)return!1}for(var f=0;f<u.length;f++)if(!p(t,u[f]))return!1;if(n&&5===arguments.length){var m=c(e);if(0!==m.length){var g=0;for(f=0;f<m.length;f++){var y=m[f];if(d(e,y)){if(!d(t,y))return!1;u.push(y),g++}else if(d(t,y))return!1}var v=c(t);if(m.length!==v.length&&R(t,v).length!==g)return!1}else{var x=c(t);if(0!==x.length&&0!==R(t,x).length)return!1}}if(0===u.length&&(0===l||1===l&&0===e.length||0===e.size))return!0;if(void 0===a)a={val1:new Map,val2:new Map,position:0};else{var b=a.val1.get(e);if(void 0!==b){var _=a.val2.get(t);if(void 0!==_)return b===_}a.position++}a.val1.set(e,a.position),a.val2.set(t,a.position);var w=function(e,t,n,a,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var a=null,s=o(e),l=0;l<s.length;l++){var c=s[l];if("object"===i(c)&&null!==c)null===a&&(a=new Set),a.add(c);else if(!t.has(c)){if(r)return!1;if(!B(e,t,c))return!1;null===a&&(a=new Set),a.add(c)}}if(null!==a){for(var u=o(t),h=0;h<u.length;h++){var p=u[h];if("object"===i(p)&&null!==p){if(!j(a,p,r,n))return!1}else if(!r&&!e.has(p)&&!j(a,p,r,n))return!1}return 0===a.size}return!0}(e,t,n,l))return!1}else if(3===c){if(!function(e,t,n,a){for(var o=null,l=s(e),c=0;c<l.length;c++){var u=r(l[c],2),h=u[0],p=u[1];if("object"===i(h)&&null!==h)null===o&&(o=new Set),o.add(h);else{var d=t.get(h);if(void 0===d&&!t.has(h)||!O(p,d,n,a)){if(n)return!1;if(!N(e,t,h,p,a))return!1;null===o&&(o=new Set),o.add(h)}}}if(null!==o){for(var f=s(t),m=0;m<f.length;m++){var g=r(f[m],2),y=g[0],v=g[1];if("object"===i(y)&&null!==y){if(!U(o,e,y,v,n,a))return!1}else if(!n&&(!e.has(y)||!O(e.get(y),v,!1,a))&&!U(o,e,y,v,!1,a))return!1}return 0===o.size}return!0}(e,t,n,l))return!1}else if(1===c)for(;u<e.length;u++){if(!p(e,u)){if(p(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var d=h[u];if(!p(t,d)||!O(e[d],t[d],n,l))return!1}return h.length===Object.keys(t).length}if(!p(t,u)||!O(e[u],t[u],n,l))return!1}for(u=0;u<a.length;u++){var f=a[u];if(!O(e[f],t[f],n,l))return!1}return!0}(e,t,n,u,a,l);return a.val1.delete(e),a.val2.delete(t),w}function j(e,t,r,n){for(var i=o(e),a=0;a<i.length;a++){var s=i[a];if(O(t,s,r,n))return e.delete(s),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function B(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function N(e,t,r,n,i){var a=F(r);if(null!=a)return a;var o=t.get(a);return!(void 0===o&&!t.has(a)||!O(n,o,!1,i))&&!e.has(a)&&O(n,o,!1,i)}function U(e,t,r,n,i,a){for(var s=o(e),l=0;l<s.length;l++){var c=s[l];if(O(r,c,i,a)&&O(n,t.get(c),i,a))return e.delete(c),!0}return!1}t.exports={isDeepEqual:function(e,t){return O(e,t,!1)},isDeepStrictEqual:function(e,t){return O(e,t,!0)}}}}),ru=p({"node_modules/assert/build/assert.js"(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!==r(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===r(t)?t:String(t)}var o,s,l=Bc().codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,p=l.ERR_INVALID_RETURN_VALUE,d=l.ERR_MISSING_ARGS,f=Nc(),m=Fc().inspect,g=Fc().types,y=g.isPromise,v=g.isRegExp,x=Gc()(),b=$c()(),_=uc()("RegExp.prototype.test");function w(){var e=tu();o=e.isDeepEqual,s=e.isDeepStrictEqual}var k=!1,T=t.exports=E,S={};function A(e){if(e.message instanceof Error)throw e.message;throw new f(e)}function M(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw a.generatedMessage=i,a}}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];M.apply(void 0,[E,t.length].concat(t))}T.fail=function e(t,r,n,i,a){var o,s=arguments.length;if(0===s?o="Failed":1===s?(n=t,t=void 0):(!1===k&&(k=!0,(process.emitWarning?process.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===s&&(i="!=")),n instanceof Error)throw n;var l={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:a||e};void 0!==n&&(l.message=n);var c=new f(l);throw o&&(c.message=o,c.generatedMessage=!0),c},T.AssertionError=f,T.ok=E,T.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&A({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&A({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),o(t,r)||A({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),o(t,r)&&A({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),s(t,r)||A({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===o&&w(),s(t,r)&&A({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");b(t,r)||A({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");b(t,r)&&A({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var C=i((function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"===typeof n[e]&&v(t[e])&&_(t[e],n[e])?i[e]=n[e]:i[e]=t[e])}))}));function P(e,t,n,i){if("function"!==typeof t){if(v(t))return _(t,e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==r(e)||null===e){var a=new f({actual:e,expected:t,message:n,operator:"deepStrictEqual",stackStartFn:i});throw a.operator=i.name,a}var l=Object.keys(t);if(t instanceof Error)l.push("name","message");else if(0===l.length)throw new h("error",t,"may not be an empty object");return void 0===o&&w(),l.forEach((function(r){"string"===typeof e[r]&&v(t[r])&&_(t[r],e[r])||function(e,t,r,n,i,a){if(!(r in e)||!s(e[r],t[r])){if(!n){var o=new C(e,i),l=new C(t,i,e),c=new f({actual:o,expected:l,operator:"deepStrictEqual",stackStartFn:a});throw c.actual=e,c.expected=t,c.operator=a.name,c}A({actual:e,expected:t,message:n,operator:a.name,stackStartFn:a})}}(e,t,r,n,l,i)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function L(e){if("function"!==typeof e)throw new u("fn","Function",e);try{e()}catch(t){return t}return S}function I(e){return y(e)||null!==e&&"object"===r(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function z(e){return Promise.resolve().then((function(){var t;if("function"===typeof e){if(!I(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!I(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return S})).catch((function(e){return e}))}))}function O(e,t,n,i){if("string"===typeof n){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],n);if("object"===r(t)&&null!==t){if(t.message===n)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===n)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));i=n,n=void 0}else if(null!=n&&"object"!==r(n)&&"function"!==typeof n)throw new u("error",["Object","Error","Function","RegExp"],n);if(t===S){var a="";n&&n.name&&(a+=" (".concat(n.name,")")),a+=i?": ".concat(i):".";var o="rejects"===e.name?"rejection":"exception";A({actual:void 0,expected:n,operator:e.name,message:"Missing expected ".concat(o).concat(a),stackStartFn:e})}if(n&&!P(t,n,i,e))throw t}function R(e,t,r,n){if(t!==S){if("string"===typeof r&&(n=r,r=void 0),!r||P(t,r)){var i=n?": ".concat(n):".",a="doesNotReject"===e.name?"rejection":"exception";A({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(a).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function D(e,t,n,i,a){if(!v(t))throw new u("regexp","RegExp",t);var o="match"===a;if("string"!==typeof e||_(t,e)!==o){if(n instanceof Error)throw n;var s=!n;n=n||("string"!==typeof e?'The "string" argument must be of type string. Received type '+"".concat(r(e)," (").concat(m(e),")"):(o?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(m(t),". Input:\n\n").concat(m(e),"\n"));var l=new f({actual:e,expected:t,message:n,operator:a,stackStartFn:i});throw l.generatedMessage=s,l}}function j(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];M.apply(void 0,[j,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];O.apply(void 0,[e,L(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return z(t).then((function(t){return O.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];R.apply(void 0,[e,L(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return z(t).then((function(t){return R.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!==t&&void 0!==t){var n="ifError got unwanted exception: ";"object"===r(t)&&"string"===typeof t.message?0===t.message.length&&t.constructor?n+=t.constructor.name:n+=t.message:n+=m(t);var i=new f({actual:t,expected:null,operator:"ifError",message:n,stackStartFn:e}),a=t.stack;if("string"===typeof a){var o=a.split("\n");o.shift();for(var s=i.stack.split("\n"),l=0;l<o.length;l++){var c=s.indexOf(o[l]);if(-1!==c){s=s.slice(0,c);break}}i.stack="".concat(s.join("\n"),"\n").concat(o.join("\n"))}throw i}},T.match=function e(t,r,n){D(t,r,n,e,"match")},T.doesNotMatch=function e(t,r,n){D(t,r,n,e,"doesNotMatch")},T.strict=x(j,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict}}),nu=p({"node_modules/stream-parser/node_modules/ms/index.js"(e,t){var r=1e3,n=60*r,i=60*n,a=24*i,o=365.25*a;function s(e,t,r){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+r:Math.ceil(e/t)+" "+r+"s"}t.exports=function(e,t){t=t||{};var l,c=typeof e;if("string"===c&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return s*o;case"days":case"day":case"d":return s*a;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*n;case"seconds":case"second":case"secs":case"sec":case"s":return s*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(e);if("number"===c&&!1===isNaN(e))return t.long?s(l=e,a,"day")||s(l,i,"hour")||s(l,n,"minute")||s(l,r,"second")||l+" ms":function(e){return e>=a?Math.round(e/a)+"d":e>=i?Math.round(e/i)+"h":e>=n?Math.round(e/n)+"m":e>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}}),iu=p({"node_modules/stream-parser/node_modules/debug/src/debug.js"(e,t){var r;function n(t){function n(){if(n.enabled){var t=n,i=+new Date,a=i-(r||i);t.diff=a,t.prev=r,t.curr=i,r=i;for(var o=new Array(arguments.length),s=0;s<o.length;s++)o[s]=arguments[s];o[0]=e.coerce(o[0]),"string"!==typeof o[0]&&o.unshift("%O");var l=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,(function(r,n){if("%%"===r)return r;l++;var i=e.formatters[n];if("function"===typeof i){var a=o[l];r=i.call(t,a),o.splice(l,1),l--}return r})),e.formatArgs.call(t,o),(n.log||e.log||console.log.bind(console)).apply(t,o)}}return n.namespace=t,n.enabled=e.enabled(t),n.useColors=e.useColors(),n.color=function(t){var r,n=0;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}(t),"function"===typeof e.init&&e.init(n),n}(e=t.exports=n.debug=n.default=n).coerce=function(e){return e instanceof Error?e.stack||e.message:e},e.disable=function(){e.enable("")},e.enable=function(t){e.save(t),e.names=[],e.skips=[];for(var r=("string"===typeof t?t:"").split(/[\s,]+/),n=r.length,i=0;i<n;i++)r[i]&&("-"===(t=r[i].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){var r,n;for(r=0,n=e.skips.length;r<n;r++)if(e.skips[r].test(t))return!1;for(r=0,n=e.names.length;r<n;r++)if(e.names[r].test(t))return!0;return!1},e.humanize=nu(),e.names=[],e.skips=[],e.formatters={}}}),au=p({"node_modules/stream-parser/node_modules/debug/src/browser.js"(e,t){function r(){var t;try{t=e.storage.debug}catch(r){}return!t&&"undefined"!==typeof process&&"env"in process&&(t={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DEBUG),t}(e=t.exports=iu()).log=function(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},e.formatArgs=function(t){var r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),r){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(i++,"%c"===e&&(a=i))})),t.splice(a,0,n)}},e.save=function(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(r){}},e.load=r,e.useColors=function(){return!("undefined"===typeof window||!window.process||"renderer"!==window.process.type)||("undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}},e.enable(r())}}),ou=p({"node_modules/stream-parser/index.js"(e,t){var r=ru(),n=au()("stream-parser");function i(e){n("initializing parser stream"),e._parserBytesLeft=0,e._parserBuffers=[],e._parserBuffered=0,e._parserState=-1,e._parserCallback=null,"function"==typeof e.push&&(e._parserOutput=e.push.bind(e)),e._parserInit=!0}function a(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(isFinite(e)&&e>0,'can only buffer a finite number of bytes > 0, got "'+e+'"'),this._parserInit||i(this),n("buffering %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=0}function o(e,t){r(!this._parserCallback,'there is already a "callback" set!'),r(e>0,'can only skip > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("skipping %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=1}function s(e,t){r(!this._parserCallback,'There is already a "callback" set!'),r(e>0,'can only pass through > 0 bytes, got "'+e+'"'),this._parserInit||i(this),n("passing through %o bytes",e),this._parserBytesLeft=e,this._parserCallback=t,this._parserState=2}function l(e,t,r){this._parserInit||i(this),n("write(%o bytes)",e.length),"function"==typeof t&&(r=t),h(this,e,null,r)}function c(e,t,r){this._parserInit||i(this),n("transform(%o bytes)",e.length),"function"!=typeof t&&(t=this._parserOutput),h(this,e,t,r)}function u(e,t,r,i){if(e._parserBytesLeft-=t.length,n("%o bytes left for stream piece",e._parserBytesLeft),0===e._parserState?(e._parserBuffers.push(t),e._parserBuffered+=t.length):2===e._parserState&&r(t),0!==e._parserBytesLeft)return i;var a=e._parserCallback;if(a&&0===e._parserState&&e._parserBuffers.length>1&&(t=Buffer.concat(e._parserBuffers,e._parserBuffered)),0!==e._parserState&&(t=null),e._parserCallback=null,e._parserBuffered=0,e._parserState=-1,e._parserBuffers.splice(0),a){var o=[];t&&o.push(t),r&&o.push(r);var s=a.length>o.length;s&&o.push(p(i));var l=a.apply(e,o);if(!s||i===l)return i}}t.exports=function(e){var t=e&&"function"==typeof e._transform,r=e&&"function"==typeof e._write;if(!t&&!r)throw new Error("must pass a Writable or Transform stream in");n("extending Parser into stream"),e._bytes=a,e._skipBytes=o,t&&(e._passthrough=s),t?e._transform=c:e._write=l};var h=p((function e(t,r,n,i){return t._parserBytesLeft<=0?i(new Error("got data but not currently parsing anything")):r.length<=t._parserBytesLeft?function(){return u(t,r,n,i)}:function(){var a=r.slice(0,t._parserBytesLeft);return u(t,a,n,(function(o){return o?i(o):r.length>a.length?function(){return e(t,r.slice(a.length),n,i)}:void 0}))}}));function p(e){return function(){for(var t=e.apply(this,arguments);"function"==typeof t;)t=t();return t}}}}),su=p({"node_modules/probe-image-size/lib/common.js"(e){var t=jc().Transform,r=ou();function n(){t.call(this,{readableObjectMode:!0})}function i(e,t,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||"",this.name=this.constructor.name,this.message=e,t&&(this.code=t),r&&(this.statusCode=r)}n.prototype=Object.create(t.prototype),n.prototype.constructor=n,r(n.prototype),e.ParserStream=n,e.sliceEq=function(e,t,r){for(var n=t,i=0;i<r.length;)if(e[n++]!==r[i++])return!1;return!0},e.str2arr=function(e,t){var r=[],n=0;if(t&&"hex"===t)for(;n<e.length;)r.push(parseInt(e.slice(n,n+2),16)),n+=2;else for(;n<e.length;n++)r.push(255&e.charCodeAt(n));return r},e.readUInt16LE=function(e,t){return e[t]|e[t+1]<<8},e.readUInt16BE=function(e,t){return e[t+1]|e[t]<<8},e.readUInt32LE=function(e,t){return e[t]|e[t+1]<<8|e[t+2]<<16|16777216*e[t+3]},e.readUInt32BE=function(e,t){return e[t+3]|e[t+2]<<8|e[t+1]<<16|16777216*e[t]},i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,e.ProbeError=i}}),lu=p({"node_modules/probe-image-size/lib/miaf_utils.js"(e,t){var r=su().readUInt16BE,n=su().readUInt32BE;function i(e,t){if(e.length<4+t)return null;var r=n(e,t);return e.length<r+t||r<8?null:{boxtype:String.fromCharCode.apply(null,e.slice(t+4,t+8)),data:e.slice(t+8,t+r),end:t+r}}function a(e,t){for(var r=0;;){var a=i(e,r);if(!a)break;switch(a.boxtype){case"ispe":t.sizes.push({width:n(a.data,4),height:n(a.data,8)});break;case"irot":t.transforms.push({type:"irot",value:3&a.data[0]});break;case"imir":t.transforms.push({type:"imir",value:1&a.data[0]})}r=a.end}}function o(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+(e[t+i]||0);return n}function s(e,t){for(var n=e[4]>>4&15,i=15&e[4],a=e[5]>>4&15,s=r(e,6),l=8,c=0;c<s;c++){var u=r(e,l),h=r(e,l+=2),p=o(e,l+=2,a),d=r(e,l+=a);if(l+=2,0===h&&1===d){var f=o(e,l,n),m=o(e,l+n,i);t.item_loc[u]={length:m,offset:f+p}}l+=d*(n+i)}}function l(e,t){for(var n=r(e,4),a=6,o=0;o<n;o++){var s=i(e,a);if(!s)break;if("infe"===s.boxtype){for(var l=r(s.data,4),c="",u=8;u<s.data.length&&s.data[u];u++)c+=String.fromCharCode(s.data[u]);t.item_inf[c]=l}a=s.end}}function c(e,t){for(var r=0;;){var n=i(e,r);if(!n)break;"ipco"===n.boxtype&&a(n.data,t),r=n.end}}t.exports.unbox=i,t.exports.readSizeFromMeta=function(e){var t={sizes:[],transforms:[],item_inf:{},item_loc:{}};if(function(e,t){for(var r=4;;){var n=i(e,r);if(!n)break;"iprp"===n.boxtype&&c(n.data,t),"iloc"===n.boxtype&&s(n.data,t),"iinf"===n.boxtype&&l(n.data,t),r=n.end}}(e,t),t.sizes.length){var r=function(e){var t=e.reduce((function(e,t){return e.width>t.width||e.width===t.width&&e.height>t.height?e:t})),r=e.reduce((function(e,t){return e.height>t.height||e.height===t.height&&e.width>t.width?e:t}));return t.width>r.height||t.width===r.height&&t.height>r.width?t:r}(t.sizes),n=1;t.transforms.forEach((function(e){var t={1:6,2:5,3:8,4:7,5:4,6:3,7:2,8:1},r={1:4,2:3,3:2,4:1,5:6,6:5,7:8,8:7};if("imir"===e.type&&(n=0===e.value?r[n]:t[n=t[n=r[n]]]),"irot"===e.type)for(var i=0;i<e.value;i++)n=t[n]}));var a=null;return t.item_inf.Exif&&(a=t.item_loc[t.item_inf.Exif]),{width:r.width,height:r.height,orientation:t.transforms.length?n:null,variants:t.sizes,exif_location:a}}},t.exports.getMimeType=function(e){var t=String.fromCharCode.apply(null,e.slice(0,4)),r={};r[t]=!0;for(var n=8;n<e.length;n+=4)r[String.fromCharCode.apply(null,e.slice(n,n+4))]=!0;if(r.mif1||r.msf1||r.miaf)return"avif"===t||"avis"===t||"avio"===t?{type:"avif",mime:"image/avif"}:"heic"===t||"heix"===t?{type:"heic",mime:"image/heic"}:"hevc"===t||"hevx"===t?{type:"heic",mime:"image/heic-sequence"}:r.avif||r.avis?{type:"avif",mime:"image/avif"}:r.heic||r.heix||r.hevc||r.hevx||r.heis?r.msf1?{type:"heif",mime:"image/heif-sequence"}:{type:"heif",mime:"image/heif"}:{type:"avif",mime:"image/avif"}}}}),cu=p({"node_modules/probe-image-size/lib/exif_utils.js"(e,t){function r(e,t){var r=new Error(e);return r.code=t,r}function n(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}function i(e,t,n){this.input=e.subarray(t,n),this.start=t;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw r("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}i.prototype.each=function(e){this.aborted=!1;var t=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:t}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,e)}},i.prototype.read_uint16=function(e){var t=this.input;if(e+2>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?256*t[e]+t[e+1]:t[e]+256*t[e+1]},i.prototype.read_uint32=function(e){var t=this.input;if(e+4>t.length)throw r("unexpected EOF","EBADDATA");return this.big_endian?16777216*t[e]+65536*t[e+1]+256*t[e+2]+t[e+3]:t[e]+256*t[e+1]+65536*t[e+2]+16777216*t[e+3]},i.prototype.is_subifd_link=function(e,t){return 0===e&&34665===t||0===e&&34853===t||34665===e&&40965===t},i.prototype.exif_format_length=function(e){switch(e){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},i.prototype.exif_format_read=function(e,t){var r;switch(e){case 1:case 2:return r=this.input[t];case 6:return(r=this.input[t])|33554430*(128&r);case 3:return r=this.read_uint16(t);case 8:return(r=this.read_uint16(t))|131070*(32768&r);case 4:return r=this.read_uint32(t);case 9:return 0|(r=this.read_uint32(t));default:return null}},i.prototype.scan_ifd=function(e,t,i){var a=this.read_uint16(t);t+=2;for(var o=0;o<a;o++){var s=this.read_uint16(t),l=this.read_uint16(t+2),c=this.read_uint32(t+4),u=this.exif_format_length(l),h=c*u,p=h<=4?t+8:this.read_uint32(t+8),d=!1;if(p+h>this.input.length)throw r("unexpected EOF","EBADDATA");for(var f=[],m=p,g=0;g<c;g++,m+=u){var y=this.exif_format_read(l,m);if(null===y){f=null;break}f.push(y)}if(Array.isArray(f)&&2===l&&(f=n(String.fromCharCode.apply(null,f)))&&"\0"===f[f.length-1]&&(f=f.slice(0,-1)),this.is_subifd_link(e,s)&&Array.isArray(f)&&Number.isInteger(f[0])&&f[0]>0&&(this.ifds_to_read.push({id:s,offset:f[0]}),d=!0),!1===i({is_big_endian:this.big_endian,ifd:e,tag:s,format:l,count:c,entry_offset:t+this.start,data_length:h,data_offset:p+this.start,value:f,is_subifd_link:d}))return void(this.aborted=!0);t+=12}0===e&&this.ifds_to_read.push({id:1,offset:this.read_uint32(t)})},t.exports.ExifParser=i,t.exports.get_orientation=function(e){var t=0;try{return new i(e,0,e.length).each((function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t=e.value[0],!1})),t}catch(r){return-1}}}}),uu=p({"node_modules/probe-image-size/lib/parse_sync/avif.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=lu(),o=cu(),s=r("ftyp");t.exports=function(e){if(n(e,4,s)){var t=a.unbox(e,0);if(t){var r=a.getMimeType(t.data);if(r){for(var l,c=t.end;;){var u=a.unbox(e,c);if(!u)break;if(c=u.end,"mdat"===u.boxtype)return;if("meta"===u.boxtype){l=u.data;break}}if(l){var h=a.readSizeFromMeta(l);if(h){var p={width:h.width,height:h.height,type:r.type,mime:r.mime,wUnits:"px",hUnits:"px"};if(h.variants.length>1&&(p.variants=h.variants),h.orientation&&(p.orientation=h.orientation),h.exif_location&&h.exif_location.offset+h.exif_location.length<=e.length){var d=i(e,h.exif_location.offset),f=e.slice(h.exif_location.offset+d+4,h.exif_location.offset+h.exif_location.length),m=o.get_orientation(f);m>0&&(p.orientation=m)}return p}}}}}}}}),hu=p({"node_modules/probe-image-size/lib/parse_sync/bmp.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("BM");t.exports=function(e){if(!(e.length<26)&&n(e,0,a))return{width:i(e,18),height:i(e,22),type:"bmp",mime:"image/bmp",wUnits:"px",hUnits:"px"}}}}),pu=p({"node_modules/probe-image-size/lib/parse_sync/gif.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=r("GIF87a"),o=r("GIF89a");t.exports=function(e){if(!(e.length<10)&&(n(e,0,a)||n(e,0,o)))return{width:i(e,6),height:i(e,8),type:"gif",mime:"image/gif",wUnits:"px",hUnits:"px"}}}}),du=p({"node_modules/probe-image-size/lib/parse_sync/ico.js"(e,t){var r=su().readUInt16LE;t.exports=function(e){var t=r(e,0),n=r(e,2),i=r(e,4);if(0===t&&1===n&&i){for(var a=[],o={width:0,height:0},s=0;s<i;s++){var l=e[6+16*s]||256,c=e[6+16*s+1]||256,u={width:l,height:c};a.push(u),(l>o.width||c>o.height)&&(o=u)}return{width:o.width,height:o.height,variants:a,type:"ico",mime:"image/x-icon",wUnits:"px",hUnits:"px"}}}}}),fu=p({"node_modules/probe-image-size/lib/parse_sync/jpeg.js"(e,t){var r=su().readUInt16BE,n=su().str2arr,i=su().sliceEq,a=cu(),o=n("Exif\0\0");t.exports=function(e){if(!(e.length<2)&&255===e[0]&&216===e[1]&&255===e[2])for(var t=2;;){for(;;){if(e.length-t<2)return;if(255===e[t++])break}for(var n,s,l=e[t++];255===l;)l=e[t++];if(208<=l&&l<=217||1===l)n=0;else{if(!(192<=l&&l<=254))return;if(e.length-t<2)return;n=r(e,t)-2,t+=2}if(217===l||218===l)return;if(225===l&&n>=10&&i(e,t,o)&&(s=a.get_orientation(e.slice(t+6,t+n))),n>=5&&192<=l&&l<=207&&196!==l&&200!==l&&204!==l){if(e.length-t<n)return;var c={width:r(e,t+3),height:r(e,t+1),type:"jpg",mime:"image/jpeg",wUnits:"px",hUnits:"px"};return s>0&&(c.orientation=s),c}t+=n}}}}),mu=p({"node_modules/probe-image-size/lib/parse_sync/png.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("\x89PNG\r\n\x1a\n"),o=r("IHDR");t.exports=function(e){if(!(e.length<24)&&n(e,0,a)&&n(e,12,o))return{width:i(e,16),height:i(e,20),type:"png",mime:"image/png",wUnits:"px",hUnits:"px"}}}}),gu=p({"node_modules/probe-image-size/lib/parse_sync/psd.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt32BE,a=r("8BPS\0\x01");t.exports=function(e){if(!(e.length<22)&&n(e,0,a))return{width:i(e,18),height:i(e,14),type:"psd",mime:"image/vnd.adobe.photoshop",wUnits:"px",hUnits:"px"}}}}),yu=p({"node_modules/probe-image-size/lib/parse_sync/svg.js"(e,t){function r(e){return"number"===typeof e&&isFinite(e)&&e>0}var n=/<[-_.:a-zA-Z0-9][^>]*>/,i=/^<([-_.:a-zA-Z0-9]+:)?svg\s/,a=/[^-]\bwidth="([^%]+?)"|[^-]\bwidth='([^%]+?)'/,o=/\bheight="([^%]+?)"|\bheight='([^%]+?)'/,s=/\bview[bB]ox="(.+?)"|\bview[bB]ox='(.+?)'/,l=/in$|mm$|cm$|pt$|pc$|px$|em$|ex$/;function c(e){return l.test(e)?e.match(l)[0]:"px"}t.exports=function(e){if(function(e){var t,r=0,n=e.length;for(239===e[0]&&187===e[1]&&191===e[2]&&(r=3);r<n&&(32===(t=e[r])||9===t||13===t||10===t);)r++;return r!==n&&60===e[r]}(e)){for(var t="",l=0;l<e.length;l++)t+=String.fromCharCode(e[l]);var u=(t.match(n)||[""])[0];if(i.test(u)){var h=function(e){var t=e.match(a),r=e.match(o),n=e.match(s);return{width:t&&(t[1]||t[2]),height:r&&(r[1]||r[2]),viewbox:n&&(n[1]||n[2])}}(u),p=parseFloat(h.width),d=parseFloat(h.height);if(h.width&&h.height){if(!r(p)||!r(d))return;return{width:p,height:d,type:"svg",mime:"image/svg+xml",wUnits:c(h.width),hUnits:c(h.height)}}var f=(h.viewbox||"").split(" "),m={width:f[2],height:f[3]},g=parseFloat(m.width),y=parseFloat(m.height);if(r(g)&&r(y)&&c(m.width)===c(m.height)){var v=g/y;if(h.width){if(!r(p))return;return{width:p,height:p/v,type:"svg",mime:"image/svg+xml",wUnits:c(h.width),hUnits:c(h.width)}}if(h.height){if(!r(d))return;return{width:d*v,height:d,type:"svg",mime:"image/svg+xml",wUnits:c(h.height),hUnits:c(h.height)}}return{width:g,height:y,type:"svg",mime:"image/svg+xml",wUnits:c(m.width),hUnits:c(m.height)}}}}}}}),vu=p({"node_modules/probe-image-size/lib/parse_sync/tiff.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=su().readUInt16BE,o=su().readUInt32LE,s=su().readUInt32BE,l=r("II*\0"),c=r("MM\0*");function u(e,t,r){return r?a(e,t):i(e,t)}function h(e,t,r){return r?s(e,t):o(e,t)}function p(e,t,r){var n=u(e,t+2,r);return 1!==h(e,t+4,r)||3!==n&&4!==n?null:3===n?u(e,t+8,r):h(e,t+8,r)}t.exports=function(e){if(!(e.length<8)&&(n(e,0,l)||n(e,0,c))){var t=77===e[0],r=h(e,4,t)-8;if(!(r<0)){var i=r+8;if(!(e.length-i<2)){var a=12*u(e,i+0,t);if(!(a<=0)&&(i+=2,!(e.length-i<a))){var o,s,d,f;for(o=0;o<a;o+=12)256===(f=u(e,i+o,t))?s=p(e,i+o,t):257===f&&(d=p(e,i+o,t));return s&&d?{width:s,height:d,type:"tiff",mime:"image/tiff",wUnits:"px",hUnits:"px"}:void 0}}}}}}}),xu=p({"node_modules/probe-image-size/lib/parse_sync/webp.js"(e,t){var r=su().str2arr,n=su().sliceEq,i=su().readUInt16LE,a=su().readUInt32LE,o=cu(),s=r("RIFF"),l=r("WEBP");function c(e,t){if(157===e[t+3]&&1===e[t+4]&&42===e[t+5])return{width:16383&i(e,t+6),height:16383&i(e,t+8),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}function u(e,t){if(47===e[t]){var r=a(e,t+1);return{width:1+(16383&r),height:1+(r>>14&16383),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}}function h(e,t){return{width:1+(e[t+6]<<16|e[t+5]<<8|e[t+4]),height:1+(e[t+9]<<t|e[t+8]<<8|e[t+7]),type:"webp",mime:"image/webp",wUnits:"px",hUnits:"px"}}t.exports=function(e){if(!(e.length<16)&&(n(e,0,s)||n(e,8,l))){var t=12,r=null,i=0,p=a(e,4)+8;if(!(p>e.length)){for(;t+8<p;)if(0!==e[t]){var d=String.fromCharCode.apply(null,e.slice(t,t+4)),f=a(e,t+4);"VP8 "===d&&f>=10?r=r||c(e,t+8):"VP8L"===d&&f>=9?r=r||u(e,t+8):"VP8X"===d&&f>=10?r=r||h(e,t+8):"EXIF"===d&&(i=o.get_orientation(e.slice(t+8,t+8+f)),t=1/0),t+=8+f}else t++;if(r)return i>0&&(r.orientation=i),r}}}}}),bu=p({"node_modules/probe-image-size/lib/parsers_sync.js"(e,t){t.exports={avif:uu(),bmp:hu(),gif:pu(),ico:du(),jpeg:fu(),png:mu(),psd:gu(),svg:yu(),tiff:vu(),webp:xu()}}}),_u=p({"node_modules/probe-image-size/sync.js"(e,t){var r=bu();t.exports=function(e){return function(e){for(var t=Object.keys(r),n=0;n<t.length;n++){var i=r[t[n]](e);if(i)return i}return null}(e)},t.exports.parsers=r}}),wu=p({"src/traces/image/helpers.js"(e){var t=_u(),r=On().IMAGE_URL_PREFIX,n=Vl().Buffer;e.getImageSize=function(e){var i=e.replace(r,""),a=new n(i,"base64");return t(a)}}}),ku=p({"src/traces/image/calc.js"(e,t){var r=st(),n=Rl(),i=k(),a=nr(),o=st().maxRowLength,s=wu().getImageSize;function l(e,t,n,i){return function(a){return r.constrain((a-e)*t,n,i)}}function c(e,t){return function(n){return r.constrain(n,e,t)}}t.exports=function(e,t){var r,u;if(t._hasZ)r=t.z.length,u=o(t.z);else if(t._hasSource){var h=s(t.source);r=h.height,u=h.width}var p,d=a.getFromId(e,t.xaxis||"x"),f=a.getFromId(e,t.yaxis||"y"),m=d.d2c(t.x0)-t.dx/2,g=f.d2c(t.y0)-t.dy/2,y=[m,m+u*t.dx],v=[g,g+r*t.dy];if(d&&"log"===d.type)for(p=0;p<u;p++)y.push(m+p*t.dx);if(f&&"log"===f.type)for(p=0;p<r;p++)v.push(g+p*t.dy);return t._extremes[d._id]=a.findExtremes(d,y),t._extremes[f._id]=a.findExtremes(f,v),t._scaler=function(e){var t=n.colormodel[e.colormodel],r=t.colormodel||e.colormodel,a=r.length;e._sArray=[];for(var o=0;o<a;o++)t.min[o]!==e.zmin[o]||t.max[o]!==e.zmax[o]?e._sArray.push(l(e.zmin[o],(t.max[o]-t.min[o])/(e.zmax[o]-e.zmin[o]),t.min[o],t.max[o])):e._sArray.push(c(t.min[o],t.max[o]));return function(t){for(var r=t.slice(0,a),n=0;n<a;n++){var o=r[n];if(!i(o))return!1;r[n]=e._sArray[n](o)}return r}}(t),[{x0:m,y0:g,z:t.z,w:u,h:r}]}}}),Tu=p({"src/traces/image/plot.js"(e,t){var r=v(),n=st(),i=n.strTranslate,a=Tt(),o=Rl(),s=Fo(),l=jo().STYLE;t.exports=function(e,t,c,u){var h=t.xaxis,p=t.yaxis,d=!e._context._exportedPlot&&s();n.makeTraceGroups(u,c,"im").each((function(t){var s=r.select(this),c=t[0],u=c.trace,f=("fast"===u.zsmooth||!1===u.zsmooth&&d)&&!u._hasZ&&u._hasSource&&"linear"===h.type&&"linear"===p.type;u._realImage=f;var m,g,y,v,x,b,_=c.z,w=c.x0,k=c.y0,T=c.w,S=c.h,A=u.dx,M=u.dy;for(b=0;void 0===m&&b<T;)m=h.c2p(w+b*A),b++;for(b=T;void 0===g&&b>0;)g=h.c2p(w+b*A),b--;for(b=0;void 0===v&&b<S;)v=p.c2p(k+b*M),b++;for(b=S;void 0===x&&b>0;)x=p.c2p(k+b*M),b--;g<m&&(y=g,g=m,m=y),x<v&&(y=v,v=x,x=y),f||(m=Math.max(-.5*h._length,m),g=Math.min(1.5*h._length,g),v=Math.max(-.5*p._length,v),x=Math.min(1.5*p._length,x));var E=Math.round(g-m),C=Math.round(x-v);if(E<=0||C<=0)s.selectAll("image").data([]).exit().remove();else{var P=s.selectAll("image").data([t]);P.enter().append("svg:image").attr({xmlns:a.svg,preserveAspectRatio:"none"}),P.exit().remove();var L=!1===u.zsmooth?l:"";if(f){var I=n.simpleMap(h.range,h.r2l),z=n.simpleMap(p.range,p.r2l),O=I[1]<I[0],R=z[1]>z[0];if(O||R){var D=m+E/2,j=v+C/2;L+="transform:"+i(D+"px",j+"px")+"scale("+(O?-1:1)+","+(R?-1:1)+")"+i(-D+"px",-j+"px")+";"}}P.attr("style",L);var F=new Promise((function(e){if(u._hasZ)e();else if(u._hasSource)if(u._canvas&&u._canvas.el.width===T&&u._canvas.el.height===S&&u._canvas.source===u.source)e();else{var t=document.createElement("canvas");t.width=T,t.height=S;var r=t.getContext("2d",{willReadFrequently:!0});u._image=u._image||new Image;var n=u._image;n.onload=function(){r.drawImage(n,0,0),u._canvas={el:t,source:u.source},e()},n.setAttribute("src",u.source)}})).then((function(){var e;if(u._hasZ)e=B((function(e,t){var r=_[t][e];return n.isTypedArray(r)&&(r=Array.from(r)),r})).toDataURL("image/png");else if(u._hasSource)if(f)e=u.source;else{var t=u._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,T,S).data;e=B((function(e,r){var n=4*(r*T+e);return[t[n],t[n+1],t[n+2],t[n+3]]})).toDataURL("image/png")}P.attr({"xlink:href":e,height:C,width:E,x:m,y:v})}));e._promises.push(F)}function B(e){var t=document.createElement("canvas");t.width=E,t.height=C;var r,i=t.getContext("2d",{willReadFrequently:!0}),a=function(e){return n.constrain(Math.round(h.c2p(w+e*A)-m),0,E)},s=function(e){return n.constrain(Math.round(p.c2p(k+e*M)-v),0,C)},l=o.colormodel[u.colormodel],d=l.colormodel||u.colormodel,f=l.fmt;for(b=0;b<c.w;b++){var g=a(b),y=a(b+1);if(y!==g&&!isNaN(y)&&!isNaN(g))for(var x=0;x<c.h;x++){var _=s(x),T=s(x+1);T===_||isNaN(T)||isNaN(_)||!e(b,x)||(r=u._scaler(e(b,x)),i.fillStyle=r?d+"("+f(r).join(",")+")":"rgba(0,0,0,0)",i.fillRect(g,_,y-g,T-_))}}return t}}))}}}),Su=p({"src/traces/image/style.js"(e,t){var r=v();t.exports=function(e){r.select(e).selectAll(".im image").style("opacity",(function(e){return e[0].trace.opacity}))}}}),Au=p({"src/traces/image/hover.js"(e,t){var r=zr(),n=st(),i=n.isArrayOrTypedArray,a=Rl();t.exports=function(e,t,o){var s=e.cd[0],l=s.trace,c=e.xa,u=e.ya;if(!(r.inbox(t-s.x0,t-(s.x0+s.w*l.dx),0)>0||r.inbox(o-s.y0,o-(s.y0+s.h*l.dy),0)>0)){var h,p=Math.floor((t-s.x0)/l.dx),d=Math.floor(Math.abs(o-s.y0)/l.dy);if(l._hasZ?h=s.z[d][p]:l._hasSource&&(h=l._canvas.el.getContext("2d",{willReadFrequently:!0}).getImageData(p,d,1,1).data),h){var f,m=s.hi||l.hoverinfo;if(m){var g=m.split("+");-1!==g.indexOf("all")&&(g=["color"]),-1!==g.indexOf("color")&&(f=!0)}var y,v=a.colormodel[l.colormodel],x=v.colormodel||l.colormodel,b=x.length,_=l._scaler(h),w=v.suffix,k=[];(l.hovertemplate||f)&&(k.push("["+[_[0]+w[0],_[1]+w[1],_[2]+w[2]].join(", ")),4===b&&k.push(", "+_[3]+w[3]),k.push("]"),k=k.join(""),e.extraText=x.toUpperCase()+": "+k),i(l.hovertext)&&i(l.hovertext[d])?y=l.hovertext[d][p]:i(l.text)&&i(l.text[d])&&(y=l.text[d][p]);var T=u.c2p(s.y0+(d+.5)*l.dy),S=s.x0+(p+.5)*l.dx,A=s.y0+(d+.5)*l.dy,M="["+h.slice(0,l.colormodel.length).join(", ")+"]";return[n.extendFlat(e,{index:[d,p],x0:c.c2p(s.x0+p*l.dx),x1:c.c2p(s.x0+(p+1)*l.dx),y0:T,y1:T,color:_,xVal:S,xLabelVal:S,yVal:A,yLabelVal:A,zLabelVal:M,text:y,hovertemplateLabels:{zLabel:M,colorLabel:k,"color[0]Label":_[0]+w[0],"color[1]Label":_[1]+w[1],"color[2]Label":_[2]+w[2],"color[3]Label":_[3]+w[3]}})]}}}}}),Mu=p({"src/traces/image/event_data.js"(e,t){t.exports=function(e,t){return"xVal"in t&&(e.x=t.xVal),"yVal"in t&&(e.y=t.yVal),t.xa&&(e.xaxis=t.xa),t.ya&&(e.yaxis=t.ya),e.color=t.color,e.colormodel=t.trace.colormodel,e.z||(e.z=t.color),e}}}),Eu=p({"src/traces/image/index.js"(e,t){t.exports={attributes:Dl(),supplyDefaults:jl(),calc:ku(),plot:Tu(),style:Su(),hoverPoints:Au(),eventData:Mu(),moduleType:"trace",name:"image",basePlotModule:Ai(),categories:["cartesian","svg","2dMap","noSortingByValue"],animatable:!1,meta:{}}}}),Cu=p({"lib/image.js"(e,t){t.exports=Eu()}}),Pu=p({"src/traces/pie/attributes.js"(e,t){var r=N(),n=ka().attributes,i=D(),a=V(),o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=R().extendFlat,c=Ie().pattern,u=i({editType:"plot",arrayOk:!0,colorEditType:"plot"});t.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},pattern:c,editType:"calc"},text:{valType:"data_array",editType:"plot"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:l({},r.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:o({},{keys:["label","color","value","percent","text"]}),texttemplate:s({editType:"plot"},{keys:["label","color","value","percent","text"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"plot"},textfont:l({},u,{}),insidetextorientation:{valType:"enumerated",values:["horizontal","radial","tangential","auto"],dflt:"auto",editType:"plot"},insidetextfont:l({},u,{}),outsidetextfont:l({},u,{}),automargin:{valType:"boolean",dflt:!1,editType:"plot"},title:{text:{valType:"string",dflt:"",editType:"plot"},font:l({},u,{}),position:{valType:"enumerated",values:["top left","top center","top right","middle center","bottom left","bottom center","bottom right"],editType:"plot"},editType:"plot"},domain:n({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}}}),Lu=p({"src/traces/pie/defaults.js"(e,t){var r=k(),n=st(),i=Pu(),a=ka().defaults,o=$a().handleText,s=st().coercePattern;function l(e,t){var i=n.isArrayOrTypedArray(e),a=n.isArrayOrTypedArray(t),o=Math.min(i?e.length:1/0,a?t.length:1/0);if(isFinite(o)||(o=0),o&&a){for(var s,l=0;l<o;l++){var c=t[l];if(r(c)&&c>0){s=!0;break}}s||(o=0)}return{hasLabels:i,hasValues:a,len:o}}function c(e,t,r,n,i){n("marker.line.width")&&n("marker.line.color",i?void 0:r.paper_bgcolor);var a=n("marker.colors");s(n,"marker.pattern",a),e.marker&&!t.marker.pattern.fgcolor&&(t.marker.pattern.fgcolor=e.marker.colors),t.marker.pattern.bgcolor||(t.marker.pattern.bgcolor=r.paper_bgcolor)}t.exports={handleLabelsAndValues:l,handleMarkerDefaults:c,supplyDefaults:function(e,t,r,s){function u(r,a){return n.coerce(e,t,i,r,a)}var h=l(u("labels"),u("values")),p=h.len;if(t._hasLabels=h.hasLabels,t._hasValues=h.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),p){t._length=p,c(e,t,s,u,!0),u("scalegroup");var d,f=u("text"),m=u("texttemplate");if(m||(d=u("textinfo",n.isArrayOrTypedArray(f)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),m||d&&"none"!==d){var g=u("textposition");o(e,t,s,u,g,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),(Array.isArray(g)||"auto"===g||"outside"===g)&&u("automargin"),("inside"===g||"auto"===g||Array.isArray(g))&&u("insidetextorientation")}else"none"===d&&u("textposition","none");a(t,s,u);var y=u("hole");if(u("title.text")){var v=u("title.position",y?"middle center":"top center");y||"middle center"!==v||(t.title.position="top center"),n.coerceFont(u,"title.font",s.font)}u("sort"),u("direction"),u("rotation"),u("pull")}else t.visible=!1}}}}),Iu=p({"src/traces/pie/layout_attributes.js"(e,t){t.exports={hiddenlabels:{valType:"data_array",editType:"calc"},piecolorway:{valType:"colorlist",editType:"calc"},extendpiecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),zu=p({"src/traces/pie/layout_defaults.js"(e,t){var r=st(),n=Iu();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("piecolorway",t.colorway),i("extendpiecolors")}}}),Ou=p({"src/traces/pie/calc.js"(e,t){var r=k(),n=O(),i=q(),a={};function o(e){return function(t,r){return!!t&&!!(t=n(t)).isValid()&&(t=i.addOpacity(t,t.getAlpha()),e[r]||(e[r]=t),t)}}function s(e,t){var r,i=JSON.stringify(e),a=t[i];if(!a){for(a=e.slice(),r=0;r<e.length;r++)a.push(n(e[r]).lighten(20).toHexString());for(r=0;r<e.length;r++)a.push(n(e[r]).darken(20).toHexString());t[i]=a}return a}t.exports={calc:function(e,t){var n,i,a=[],s=e._fullLayout,l=s.hiddenlabels||[],c=t.labels,u=t.marker.colors||[],h=t.values,p=t._length,d=t._hasValues&&p;if(t.dlabel)for(c=new Array(p),n=0;n<p;n++)c[n]=String(t.label0+n*t.dlabel);var f={},m=o(s["_"+t.type+"colormap"]),g=0,y=!1;for(n=0;n<p;n++){var v,x,b;if(d){if(v=h[n],!r(v))continue;v=+v}else v=1;void 0!==(x=c[n])&&""!==x||(x=n);var _=f[x=String(x)];void 0===_?(f[x]=a.length,(b=-1!==l.indexOf(x))||(g+=v),a.push({v:v,label:x,color:m(u[n],x),i:n,pts:[n],hidden:b})):(y=!0,(i=a[_]).v+=v,i.pts.push(n),i.hidden||(g+=v),!1===i.color&&u[n]&&(i.color=m(u[n],x)))}return a=a.filter((function(e){return e.v>=0})),("funnelarea"===t.type?y:t.sort)&&a.sort((function(e,t){return t.v-e.v})),a[0]&&(a[0].vTotal=g),a},crossTraceCalc:function(e,t){var r=(t||{}).type;r||(r="pie");var n=e._fullLayout,i=e.calcdata,o=n[r+"colorway"],l=n["_"+r+"colormap"];n["extend"+r+"colors"]&&(o=s(o,a));for(var c=0,u=0;u<i.length;u++){var h=i[u];if(h[0].trace.type===r)for(var p=0;p<h.length;p++){var d=h[p];!1===d.color&&(l[d.label]?d.color=l[d.label]:(l[d.label]=d.color=o[c%o.length],c++))}}},makePullColorFn:o,generateExtendedColors:s}}}),Ru=p({"src/traces/pie/event_data.js"(e,t){var r=Xt().appendArrayMultiPointValues;t.exports=function(e,t){var n={curveNumber:t.index,pointNumbers:e.pts,data:t._input,fullData:t,label:e.label,color:e.color,value:e.v,percent:e.percent,text:e.text,bbox:e.bbox,v:e.v};return 1===e.pts.length&&(n.pointNumber=n.i=e.pts[0]),r(n,t,e.pts),"funnelarea"===t.type&&(delete n.v,delete n.i),n}}}),Du=p({"src/traces/pie/plot.js"(e,t){var r=v(),n=kt(),i=zr(),a=q(),o=Jt(),s=st(),l=s.strScale,c=s.strTranslate,u=At(),h=Ka(),p=h.recordMinTextSize,d=h.clearMinTextSize,f=qa().TEXTPAD,m=br(),g=Ru(),y=st().isValidTextValue;function x(e,t,n){var a=n[0],o=a.cx,l=a.cy,c=a.trace,u="funnelarea"===c.type;"_hasHoverLabel"in c||(c._hasHoverLabel=!1),"_hasHoverEvent"in c||(c._hasHoverEvent=!1),e.on("mouseover",(function(e){var n=t._fullLayout,h=t._fullData[c.index];if(!t._dragging&&!1!==n.hovermode){var p=h.hoverinfo;if(Array.isArray(p)&&(p=i.castHoverinfo({hoverinfo:[m.castOption(p,e.pts)],_module:c._module},n,0)),"all"===p&&(p="label+text+value+percent+name"),h.hovertemplate||"none"!==p&&"skip"!==p&&p){var d=e.rInscribed||0,f=o+e.pxmid[0]*(1-d),y=l+e.pxmid[1]*(1-d),v=n.separators,x=[];if(p&&-1!==p.indexOf("label")&&x.push(e.label),e.text=m.castOption(h.hovertext||h.text,e.pts),p&&-1!==p.indexOf("text")){var b=e.text;s.isValidTextValue(b)&&x.push(b)}e.value=e.v,e.valueLabel=m.formatPieValue(e.v,v),p&&-1!==p.indexOf("value")&&x.push(e.valueLabel),e.percent=e.v/a.vTotal,e.percentLabel=m.formatPiePercent(e.percent,v),p&&-1!==p.indexOf("percent")&&x.push(e.percentLabel);var _=h.hoverlabel,w=_.font,k=[];i.loneHover({trace:c,x0:f-d*a.r,x1:f+d*a.r,y:y,_x0:u?o+e.TL[0]:f-d*a.r,_x1:u?o+e.TR[0]:f+d*a.r,_y0:u?l+e.TL[1]:y-d*a.r,_y1:u?l+e.BL[1]:y+d*a.r,text:x.join("<br>"),name:h.hovertemplate||-1!==p.indexOf("name")?h.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:m.castOption(_.bgcolor,e.pts)||e.color,borderColor:m.castOption(_.bordercolor,e.pts),fontFamily:m.castOption(w.family,e.pts),fontSize:m.castOption(w.size,e.pts),fontColor:m.castOption(w.color,e.pts),nameLength:m.castOption(_.namelength,e.pts),textAlign:m.castOption(_.align,e.pts),hovertemplate:m.castOption(h.hovertemplate,e.pts),hovertemplateLabels:e,eventData:[g(e,h)]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t,inOut_bbox:k}),e.bbox=k[0],c._hasHoverLabel=!0}c._hasHoverEvent=!0,t.emit("plotly_hover",{points:[g(e,h)],event:r.event})}})),e.on("mouseout",(function(e){var n=t._fullLayout,a=t._fullData[c.index],o=r.select(this).datum();c._hasHoverEvent&&(e.originalEvent=r.event,t.emit("plotly_unhover",{points:[g(o,a)],event:r.event}),c._hasHoverEvent=!1),c._hasHoverLabel&&(i.loneUnhover(n._hoverlayer.node()),c._hasHoverLabel=!1)})),e.on("click",(function(e){var n=t._fullLayout,a=t._fullData[c.index];t._dragging||!1===n.hovermode||(t._hoverdata=[g(e,a)],i.click(t,r.event))}))}function b(e,t,r){var n=m.castOption(e.insidetextfont.color,t.pts);!n&&e._input.textfont&&(n=m.castOption(e._input.textfont.color,t.pts));var i=m.castOption(e.insidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,o=m.castOption(e.insidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,s=m.castOption(e.insidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,l=m.castOption(e.insidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,c=m.castOption(e.insidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,u=m.castOption(e.insidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,h=m.castOption(e.insidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,p=m.castOption(e.insidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n||a.contrast(t.color),family:i,size:o,weight:s,style:l,variant:c,textcase:u,lineposition:h,shadow:p}}function _(e,t){for(var r,n,i=0;i<e.length;i++)if((n=(r=e[i][0]).trace).title.text){var a=n.title.text;n._meta&&(a=s.templateString(a,n._meta));var l=o.tester.append("text").attr("data-notex",1).text(a).call(o.font,n.title.font).call(u.convertToTspans,t),c=o.bBox(l.node(),!0);r.titleBox={width:c.width,height:c.height},l.remove()}}function w(e,t,r){var n=r.r||t.rpx1,i=t.rInscribed;if(t.startangle===t.stopangle)return{rCenter:1-i,scale:0,rotate:0,textPosAngle:0};var a,o=t.ring,s=1===o&&Math.abs(t.startangle-t.stopangle)===2*Math.PI,l=t.halfangle,c=t.midangle,u=r.trace.insidetextorientation,h="horizontal"===u,p="tangential"===u,d="radial"===u,f="auto"===u,m=[];if(!f){var g,y=function(r,i){if(function(e,t){var r=e.startangle,n=e.stopangle;return r>t&&t>n||r<t&&t<n}(t,r)){var s=Math.abs(r-t.startangle),l=Math.abs(r-t.stopangle),c=s<l?s:l;(a="tan"===i?T(e,n,o,c,0):k(e,n,o,c,Math.PI/2)).textPosAngle=r,m.push(a)}};if(h||p){for(g=4;g>=-4;g-=2)y(Math.PI*g,"tan");for(g=4;g>=-4;g-=2)y(Math.PI*(g+1),"tan")}if(h||d){for(g=4;g>=-4;g-=2)y(Math.PI*(g+1.5),"rad");for(g=4;g>=-4;g-=2)y(Math.PI*(g+.5),"rad")}}if(s||f||h){var v=Math.sqrt(e.width*e.width+e.height*e.height);if((a={scale:i*n*2/v,rCenter:1-i,rotate:0}).textPosAngle=(t.startangle+t.stopangle)/2,a.scale>=1)return a;m.push(a)}(f||d)&&((a=k(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a)),(f||p)&&((a=T(e,n,o,l,c)).textPosAngle=(t.startangle+t.stopangle)/2,m.push(a));for(var x=0,b=0,_=0;_<m.length;_++){var w=m[_].scale;if(b<w&&(b=w,x=_),!f&&b>=1)break}return m[x]}function k(e,t,r,n,i){t=Math.max(0,t-2*f);var a=e.width/e.height,o=M(a,n,t,r);return{scale:2*o/e.height,rCenter:S(a,o/t),rotate:A(i)}}function T(e,t,r,n,i){t=Math.max(0,t-2*f);var a=e.height/e.width,o=M(a,n,t,r);return{scale:2*o/e.width,rCenter:S(a,o/t),rotate:A(i+Math.PI/2)}}function S(e,t){return Math.cos(t)-e*t}function A(e){return(180/Math.PI*e+720)%180-90}function M(e,t,r,n){var i=e+1/(2*Math.tan(t));return r*Math.min(1/(Math.sqrt(i*i+.5)+i),n/(Math.sqrt(e*e+n/2)+e))}function E(e,t){return e.v!==t.vTotal||t.trace.hole?Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2):1}function C(e,t){var r=t.pxmid[0],n=t.pxmid[1],i=e.width/2,a=e.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function P(e,t){var r,n,i,a=e.trace,o={x:e.cx,y:e.cy},s={tx:0,ty:0};s.ty+=a.title.font.size,i=I(a),-1!==a.title.position.indexOf("top")?(o.y-=(1+i)*e.r,s.ty-=e.titleBox.height):-1!==a.title.position.indexOf("bottom")&&(o.y+=(1+i)*e.r);var l,c,u=(l=e.r,c=e.trace.aspectratio,l/(void 0===c?1:c)),h=t.w*(a.domain.x[1]-a.domain.x[0])/2;return-1!==a.title.position.indexOf("left")?(h+=u,o.x-=(1+i)*u,s.tx+=e.titleBox.width/2):-1!==a.title.position.indexOf("center")?h*=2:-1!==a.title.position.indexOf("right")&&(h+=u,o.x+=(1+i)*u,s.tx-=e.titleBox.width/2),r=h/e.titleBox.width,n=L(e,t)/e.titleBox.height,{x:o.x,y:o.y,scale:Math.min(r,n),tx:s.tx,ty:s.ty}}function L(e,t){var r=e.trace,n=t.h*(r.domain.y[1]-r.domain.y[0]);return Math.min(e.titleBox.height,n/2)}function I(e){var t,r=e.pull;if(!r)return 0;if(s.isArrayOrTypedArray(r))for(r=0,t=0;t<e.pull.length;t++)e.pull[t]>r&&(r=e.pull[t]);return r}function z(e,t){for(var r=[],n=0;n<e.length;n++){var i=e[n][0],a=i.trace,o=a.domain,s=t.w*(o.x[1]-o.x[0]),l=t.h*(o.y[1]-o.y[0]);a.title.text&&"middle center"!==a.title.position&&(l-=L(i,t));var c=s/2,u=l/2;"funnelarea"!==a.type||a.scalegroup||(u/=a.aspectratio),i.r=Math.min(c,u)/(1+I(a)),i.cx=t.l+t.w*(a.domain.x[1]+a.domain.x[0])/2,i.cy=t.t+t.h*(1-a.domain.y[0])-l/2,a.title.text&&-1!==a.title.position.indexOf("bottom")&&(i.cy-=L(i,t)),a.scalegroup&&-1===r.indexOf(a.scalegroup)&&r.push(a.scalegroup)}!function(e,t){for(var r,n,i,a=0;a<t.length;a++){var o=1/0,s=t[a];for(n=0;n<e.length;n++)if((i=(r=e[n][0]).trace).scalegroup===s){var l;if("pie"===i.type)l=r.r*r.r;else if("funnelarea"===i.type){var c,u;i.aspectratio>1?u=(c=r.r)/i.aspectratio:c=(u=r.r)*i.aspectratio,l=(c*=(1+i.baseratio)/2)*u}o=Math.min(o,l/r.vTotal)}for(n=0;n<e.length;n++)if((i=(r=e[n][0]).trace).scalegroup===s){var h=o*r.vTotal;"funnelarea"===i.type&&(h/=(1+i.baseratio)/2,h/=i.aspectratio),r.r=Math.sqrt(h)}}}(e,r)}function O(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function R(e,t,r){var n,i=e._fullLayout,a=r.trace,o=a.texttemplate,l=a.textinfo;if(!o&&l&&"none"!==l){var c,u=l.split("+"),h=function(e){return-1!==u.indexOf(e)},p=h("label"),d=h("text"),f=h("value"),g=h("percent"),v=i.separators;if(c=p?[t.label]:[],d){var x=m.getFirstFilled(a.text,t.pts);y(x)&&c.push(x)}f&&c.push(m.formatPieValue(t.v,v)),g&&c.push(m.formatPiePercent(t.v/r.vTotal,v)),t.text=c.join("<br>")}if(o){var b=s.castOption(a,t.i,"texttemplate");if(b){var _={label:(n=t).label,value:n.v,valueLabel:m.formatPieValue(n.v,i.separators),percent:n.v/r.vTotal,percentLabel:m.formatPiePercent(n.v/r.vTotal,i.separators),color:n.color,text:n.text,customdata:s.castOption(a,n.i,"customdata")},w=m.getFirstFilled(a.text,t.pts);(y(w)||""===w)&&(_.text=w),t.text=s.texttemplateString(b,_,e._fullLayout._d3locale,_,a._meta||{})}else t.text=""}}function D(e,t){var r=e.rotate*Math.PI/180,n=Math.cos(r),i=Math.sin(r),a=(t.left+t.right)/2,o=(t.top+t.bottom)/2;e.textX=a*n-o*i,e.textY=a*i+o*n,e.noCenter=!0}t.exports={plot:function(e,t){var i=e._context.staticPlot,h=e._fullLayout,f=h._size;d("pie",h),_(t,e),z(t,f);var g=s.makeTraceGroups(h._pielayer,t,"trace").each((function(t){var d=r.select(this),g=t[0],y=g.trace;!function(e){var t,r,n,i=e[0],a=i.r,o=i.trace,s=m.getRotationAngle(o.rotation),l=2*Math.PI/i.vTotal,c="px0",u="px1";if("counterclockwise"===o.direction){for(t=0;t<e.length&&e[t].hidden;t++);if(t===e.length)return;s+=l*e[t].v,l*=-1,c="px1",u="px0"}for(n=O(a,s),t=0;t<e.length;t++)(r=e[t]).hidden||(r[c]=n,r.startangle=s,s+=l*r.v/2,r.pxmid=O(a,s),r.midangle=s,n=O(a,s+=l*r.v/2),r.stopangle=s,r[u]=n,r.largeArc=r.v>i.vTotal/2?1:0,r.halfangle=Math.PI*Math.min(r.v/i.vTotal,.5),r.ring=1-o.hole,r.rInscribed=E(r,i))}(t),d.attr("stroke-linejoin","round"),d.each((function(){var v=r.select(this).selectAll("g.slice").data(t);v.enter().append("g").classed("slice",!0),v.exit().remove();var _=[[[],[]],[[],[]]],k=!1;v.each((function(n,a){if(n.hidden)r.select(this).selectAll("path,g").remove();else{n.pointNumber=n.i,n.curveNumber=y.index,_[n.pxmid[1]<0?0:1][n.pxmid[0]<0?0:1].push(n);var l=g.cx,c=g.cy,d=r.select(this),f=d.selectAll("path.surface").data([n]);if(f.enter().append("path").classed("surface",!0).style({"pointer-events":i?"none":"all"}),d.call(x,e,t),y.pull){var v=+m.castOption(y.pull,n.pts)||0;v>0&&(l+=v*n.pxmid[0],c+=v*n.pxmid[1])}n.cxFinal=l,n.cyFinal=c;var T=y.hole;if(n.v===g.vTotal){var S="M"+(l+n.px0[0])+","+(c+n.px0[1])+L(n.px0,n.pxmid,!0,1)+L(n.pxmid,n.px0,!0,1)+"Z";T?f.attr("d","M"+(l+T*n.px0[0])+","+(c+T*n.px0[1])+L(n.px0,n.pxmid,!1,T)+L(n.pxmid,n.px0,!1,T)+"Z"+S):f.attr("d",S)}else{var A=L(n.px0,n.px1,!0,1);if(T){var M=1-T;f.attr("d","M"+(l+T*n.px1[0])+","+(c+T*n.px1[1])+L(n.px1,n.px0,!1,T)+"l"+M*n.px0[0]+","+M*n.px0[1]+A+"Z")}else f.attr("d","M"+l+","+c+"l"+n.px0[0]+","+n.px0[1]+A+"Z")}R(e,n,g);var E=m.castOption(y.textposition,n.pts),P=d.selectAll("g.slicetext").data(n.text&&"none"!==E?[0]:[]);P.enter().append("g").classed("slicetext",!0),P.exit().remove(),P.each((function(){var i=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),d=s.ensureUniformFontSize(e,"outside"===E?function(e,t,r){var n=m.castOption(e.outsidetextfont.color,t.pts)||m.castOption(e.textfont.color,t.pts)||r.color,i=m.castOption(e.outsidetextfont.family,t.pts)||m.castOption(e.textfont.family,t.pts)||r.family,a=m.castOption(e.outsidetextfont.size,t.pts)||m.castOption(e.textfont.size,t.pts)||r.size,o=m.castOption(e.outsidetextfont.weight,t.pts)||m.castOption(e.textfont.weight,t.pts)||r.weight,s=m.castOption(e.outsidetextfont.style,t.pts)||m.castOption(e.textfont.style,t.pts)||r.style,l=m.castOption(e.outsidetextfont.variant,t.pts)||m.castOption(e.textfont.variant,t.pts)||r.variant,c=m.castOption(e.outsidetextfont.textcase,t.pts)||m.castOption(e.textfont.textcase,t.pts)||r.textcase,u=m.castOption(e.outsidetextfont.lineposition,t.pts)||m.castOption(e.textfont.lineposition,t.pts)||r.lineposition,h=m.castOption(e.outsidetextfont.shadow,t.pts)||m.castOption(e.textfont.shadow,t.pts)||r.shadow;return{color:n,family:i,size:a,weight:o,style:s,variant:l,textcase:c,lineposition:u,shadow:h}}(y,n,h.font):b(y,n,h.font));i.text(n.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(o.font,d).call(u.convertToTspans,e);var f,v=o.bBox(i.node());if("outside"===E)f=C(v,n);else if(f=w(v,n,g),"auto"===E&&f.scale<1){var x=s.ensureUniformFontSize(e,y.outsidetextfont);i.call(o.font,x),f=C(v=o.bBox(i.node()),n)}var _=f.textPosAngle,T=void 0===_?n.pxmid:O(g.r,_);if(f.targetX=l+T[0]*f.rCenter+(f.x||0),f.targetY=c+T[1]*f.rCenter+(f.y||0),D(f,v),f.outside){var S=f.targetY;n.yLabelMin=S-v.height/2,n.yLabelMid=S,n.yLabelMax=S+v.height/2,n.labelExtraX=0,n.labelExtraY=0,k=!0}f.fontSize=d.size,p(y.type,f,h),t[a].transform=f,s.setTransormAndDisplay(i,f)}))}function L(e,t,r,i){var a=i*(t[0]-e[0]),o=i*(t[1]-e[1]);return"a"+i*g.r+","+i*g.r+" 0 "+n.largeArc+(r?" 1 ":" 0 ")+a+","+o}}));var T=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);if(T.enter().append("g").classed("titletext",!0),T.exit().remove(),T.each((function(){var t,n=s.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),i=y.title.text;y._meta&&(i=s.templateString(i,y._meta)),n.text(i).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(o.font,y.title.font).call(u.convertToTspans,e),t="middle center"===y.title.position?function(e){var t=Math.sqrt(e.titleBox.width*e.titleBox.width+e.titleBox.height*e.titleBox.height);return{x:e.cx,y:e.cy,scale:e.trace.hole*e.r*2/t,tx:0,ty:-e.titleBox.height/2+e.trace.title.font.size}}(g):P(g,f),n.attr("transform",c(t.x,t.y)+l(Math.min(1,t.scale))+c(t.tx,t.ty))})),k&&function(e,t){var r,n,i,a,o,l,c,u,h,p,d,f,g;function y(e,t){return e.pxmid[1]-t.pxmid[1]}function v(e,t){return t.pxmid[1]-e.pxmid[1]}function x(e,r){r||(r={});var i,u,h,d,f=r.labelExtraY+(n?r.yLabelMax:r.yLabelMin),g=n?e.yLabelMin:e.yLabelMax,y=n?e.yLabelMax:e.yLabelMin,v=e.cyFinal+o(e.px0[1],e.px1[1]),x=f-g;if(x*c>0&&(e.labelExtraY=x),s.isArrayOrTypedArray(t.pull))for(u=0;u<p.length;u++)(h=p[u])===e||(m.castOption(t.pull,e.pts)||0)>=(m.castOption(t.pull,h.pts)||0)||((e.pxmid[1]-h.pxmid[1])*c>0?(x=h.cyFinal+o(h.px0[1],h.px1[1])-g-e.labelExtraY)*c>0&&(e.labelExtraY+=x):(y+e.labelExtraY-v)*c>0&&(i=3*l*Math.abs(u-p.indexOf(e)),(d=h.cxFinal+a(h.px0[0],h.px1[0])+i-(e.cxFinal+e.pxmid[0])-e.labelExtraX)*l>0&&(e.labelExtraX+=d)))}for(n=0;n<2;n++)for(i=n?y:v,o=n?Math.max:Math.min,c=n?1:-1,r=0;r<2;r++){for(a=r?Math.max:Math.min,l=r?1:-1,(u=e[n][r]).sort(i),h=e[1-n][r],p=h.concat(u),f=[],d=0;d<u.length;d++)void 0!==u[d].yLabelMid&&f.push(u[d]);for(g=!1,d=0;n&&d<h.length;d++)if(void 0!==h[d].yLabelMid){g=h[d];break}for(d=0;d<f.length;d++){var b=d&&f[d-1];g&&!d&&(b=g),x(f[d],b)}}}(_,y),function(e,t){e.each((function(e){var n=r.select(this);if(e.labelExtraX||e.labelExtraY){var i=n.select("g.slicetext text");e.transform.targetX+=e.labelExtraX,e.transform.targetY+=e.labelExtraY,s.setTransormAndDisplay(i,e.transform);var o=e.cxFinal+e.pxmid[0],l="M"+o+","+(e.cyFinal+e.pxmid[1]),c=(e.yLabelMax-e.yLabelMin)*(e.pxmid[0]<0?-1:1)/4;if(e.labelExtraX){var u=e.labelExtraX*e.pxmid[1]/e.pxmid[0],h=e.yLabelMid+e.labelExtraY-(e.cyFinal+e.pxmid[1]);Math.abs(u)>Math.abs(h)?l+="l"+h*e.pxmid[0]/e.pxmid[1]+","+h+"H"+(o+e.labelExtraX+c):l+="l"+e.labelExtraX+","+u+"v"+(h-u)+"h"+c}else l+="V"+(e.yLabelMid+e.labelExtraY)+"h"+c;s.ensureSingle(n,"path","textline").call(a.stroke,t.outsidetextfont.color).attr({"stroke-width":Math.min(2,t.outsidetextfont.size/8),d:l,fill:"none"})}else n.select("path.textline").remove()}))}(v,y),k&&y.automargin){var S=o.bBox(d.node()),A=y.domain,M=f.w*(A.x[1]-A.x[0]),E=f.h*(A.y[1]-A.y[0]),L=(.5*M-g.r)/f.w,I=(.5*E-g.r)/f.h;n.autoMargin(e,"pie."+y.uid+".automargin",{xl:A.x[0]-L,xr:A.x[1]+L,yb:A.y[0]-I,yt:A.y[1]+I,l:Math.max(g.cx-g.r-S.left,0),r:Math.max(S.right-(g.cx+g.r),0),b:Math.max(S.bottom-(g.cy+g.r),0),t:Math.max(g.cy-g.r-S.top,0),pad:5})}}))}));setTimeout((function(){g.selectAll("tspan").each((function(){var e=r.select(this);e.attr("dy")&&e.attr("dy",e.attr("dy"))}))}),0)},formatSliceLabel:R,transformInsideText:w,determineInsideTextFont:b,positionTitleOutside:P,prerenderTitles:_,layoutAreas:z,attachFxHandlers:x,computeTransform:D}}}),ju=p({"src/traces/pie/style.js"(e,t){var r=v(),n=wr(),i=Ka().resizeText;t.exports=function(e){var t=e._fullLayout._pielayer.selectAll(".trace");i(e,t,"pie"),t.each((function(t){var i=t[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),Fu=p({"src/traces/pie/base_plot.js"(e){var t=kt();e.name="pie",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Bu=p({"src/traces/pie/index.js"(e,t){t.exports={attributes:Pu(),supplyDefaults:Lu().supplyDefaults,supplyLayoutDefaults:zu(),layoutAttributes:Iu(),calc:Ou().calc,crossTraceCalc:Ou().crossTraceCalc,plot:Du().plot,style:ju(),styleOne:wr(),moduleType:"trace",name:"pie",basePlotModule:Fu(),categories:["pie-like","pie","showLegend"],meta:{}}}}),Nu=p({"lib/pie.js"(e,t){t.exports=Bu()}}),Uu=p({"src/traces/sunburst/base_plot.js"(e){var t=kt();e.name="sunburst",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Vu=p({"src/traces/sunburst/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"linear",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"]}}}),qu=p({"src/traces/sunburst/attributes.js"(e,t){var r=N(),n=Oe().hovertemplateAttrs,i=Oe().texttemplateAttrs,a=Lt(),o=ka().attributes,s=Pu(),l=Vu(),c=R().extendFlat,u=Ie().pattern;t.exports={labels:{valType:"data_array",editType:"calc"},parents:{valType:"data_array",editType:"calc"},values:{valType:"data_array",editType:"calc"},branchvalues:{valType:"enumerated",values:["remainder","total"],dflt:"remainder",editType:"calc"},count:{valType:"flaglist",flags:["branches","leaves"],dflt:"leaves",editType:"calc"},level:{valType:"any",editType:"plot",anim:!0},maxdepth:{valType:"integer",editType:"plot",dflt:-1},marker:c({colors:{valType:"data_array",editType:"calc"},line:{color:c({},s.marker.line.color,{dflt:null}),width:c({},s.marker.line.width,{dflt:1}),editType:"calc"},pattern:u,editType:"calc"},a("marker",{colorAttr:"colors",anim:!1})),leaf:{opacity:{valType:"number",editType:"style",min:0,max:1},editType:"plot"},text:s.text,textinfo:{valType:"flaglist",flags:["label","text","value","current path","percent root","percent entry","percent parent"],extras:["none"],editType:"plot"},texttemplate:i({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:s.hovertext,hoverinfo:c({},r.hoverinfo,{flags:["label","text","value","name","current path","percent root","percent entry","percent parent"],dflt:"label+text+value+name"}),hovertemplate:n({},{keys:l.eventDataKeys}),textfont:s.textfont,insidetextorientation:s.insidetextorientation,insidetextfont:s.insidetextfont,outsidetextfont:c({},s.outsidetextfont,{}),rotation:{valType:"angle",dflt:0,editType:"plot"},sort:s.sort,root:{color:{valType:"color",editType:"calc",dflt:"rgba(0,0,0,0)"},editType:"calc"},domain:o({name:"sunburst",trace:!0,editType:"calc"})}}}),Hu=p({"src/traces/sunburst/layout_attributes.js"(e,t){t.exports={sunburstcolorway:{valType:"colorlist",editType:"calc"},extendsunburstcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Gu=p({"src/traces/sunburst/defaults.js"(e,t){var r=st(),n=qu(),i=ka().defaults,a=$a().handleText,o=Lu().handleMarkerDefaults,s=Wt(),l=s.hasColorscale,c=s.handleDefaults;t.exports=function(e,t,s,u){function h(i,a){return r.coerce(e,t,n,i,a)}var p=h("labels"),d=h("parents");if(p&&p.length&&d&&d.length){var f=h("values");f&&f.length?h("branchvalues"):h("count"),h("level"),h("maxdepth"),o(e,t,u,h);var m=t._hasColorscale=l(e,"marker","colors")||(e.marker||{}).coloraxis;m&&c(e,t,u,h,{prefix:"marker.",cLetter:"c"}),h("leaf.opacity",m?1:.7);var g=h("text");h("texttemplate"),t.texttemplate||h("textinfo",r.isArrayOrTypedArray(g)?"text+label":"label"),h("hovertext"),h("hovertemplate"),a(e,t,u,h,"auto",{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),h("insidetextorientation"),h("sort"),h("rotation"),h("root.color"),i(t,u,h),t._length=null}else t.visible=!1}}}),Wu=p({"src/traces/sunburst/layout_defaults.js"(e,t){var r=st(),n=Hu();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("sunburstcolorway",t.colorway),i("extendsunburstcolors")}}}),$u=p({"node_modules/d3-hierarchy/dist/d3-hierarchy.js"(e,t){var r,n;r=e,n=function(e){function t(e,t){return e.parent===t.parent?1:2}function r(e,t){return e+t.x}function n(e,t){return Math.max(e,t.y)}function i(e){var t=0,r=e.children,n=r&&r.length;if(n)for(;--n>=0;)t+=r[n].value;else t=1;e.value=t}function a(e,t){var r,n,i,a,s,u=new c(e),h=+e.value&&(u.value=e.value),p=[u];for(null==t&&(t=o);r=p.pop();)if(h&&(r.value=+r.data.value),(i=t(r.data))&&(s=i.length))for(r.children=new Array(s),a=s-1;a>=0;--a)p.push(n=r.children[a]=new c(i[a])),n.parent=r,n.depth=r.depth+1;return u.eachBefore(l)}function o(e){return e.children}function s(e){e.data=e.data.data}function l(e){var t=0;do{e.height=t}while((e=e.parent)&&e.height<++t)}function c(e){this.data=e,this.depth=this.height=0,this.parent=null}c.prototype=a.prototype={constructor:c,count:function(){return this.eachAfter(i)},each:function(e){var t,r,n,i,a=this,o=[a];do{for(t=o.reverse(),o=[];a=t.pop();)if(e(a),r=a.children)for(n=0,i=r.length;n<i;++n)o.push(r[n])}while(o.length);return this},eachAfter:function(e){for(var t,r,n,i=this,a=[i],o=[];i=a.pop();)if(o.push(i),t=i.children)for(r=0,n=t.length;r<n;++r)a.push(t[r]);for(;i=o.pop();)e(i);return this},eachBefore:function(e){for(var t,r,n=this,i=[n];n=i.pop();)if(e(n),t=n.children)for(r=t.length-1;r>=0;--r)i.push(t[r]);return this},sum:function(e){return this.eachAfter((function(t){for(var r=+e(t.data)||0,n=t.children,i=n&&n.length;--i>=0;)r+=n[i].value;t.value=r}))},sort:function(e){return this.eachBefore((function(t){t.children&&t.children.sort(e)}))},path:function(e){for(var t=this,r=function(e,t){if(e===t)return e;var r=e.ancestors(),n=t.ancestors(),i=null;for(e=r.pop(),t=n.pop();e===t;)i=e,e=r.pop(),t=n.pop();return i}(t,e),n=[t];t!==r;)t=t.parent,n.push(t);for(var i=n.length;e!==r;)n.splice(i,0,e),e=e.parent;return n},ancestors:function(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t},descendants:function(){var e=[];return this.each((function(t){e.push(t)})),e},leaves:function(){var e=[];return this.eachBefore((function(t){t.children||e.push(t)})),e},links:function(){var e=this,t=[];return e.each((function(r){r!==e&&t.push({source:r.parent,target:r})})),t},copy:function(){return a(this).eachBefore(s)}};var u=Array.prototype.slice;function h(e){for(var t,r,n=0,i=(e=function(e){for(var t,r,n=e.length;n;)r=Math.random()*n--|0,t=e[n],e[n]=e[r],e[r]=t;return e}(u.call(e))).length,a=[];n<i;)t=e[n],r&&f(r,t)?++n:(r=g(a=p(a,t)),n=0);return r}function p(e,t){var r,n;if(m(t,e))return[t];for(r=0;r<e.length;++r)if(d(t,e[r])&&m(y(e[r],t),e))return[e[r],t];for(r=0;r<e.length-1;++r)for(n=r+1;n<e.length;++n)if(d(y(e[r],e[n]),t)&&d(y(e[r],t),e[n])&&d(y(e[n],t),e[r])&&m(v(e[r],e[n],t),e))return[e[r],e[n],t];throw new Error}function d(e,t){var r=e.r-t.r,n=t.x-e.x,i=t.y-e.y;return r<0||r*r<n*n+i*i}function f(e,t){var r=e.r-t.r+1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function m(e,t){for(var r=0;r<t.length;++r)if(!f(e,t[r]))return!1;return!0}function g(e){switch(e.length){case 1:return{x:(t=e[0]).x,y:t.y,r:t.r};case 2:return y(e[0],e[1]);case 3:return v(e[0],e[1],e[2])}var t}function y(e,t){var r=e.x,n=e.y,i=e.r,a=t.x,o=t.y,s=t.r,l=a-r,c=o-n,u=s-i,h=Math.sqrt(l*l+c*c);return{x:(r+a+l/h*u)/2,y:(n+o+c/h*u)/2,r:(h+i+s)/2}}function v(e,t,r){var n=e.x,i=e.y,a=e.r,o=t.x,s=t.y,l=t.r,c=r.x,u=r.y,h=r.r,p=n-o,d=n-c,f=i-s,m=i-u,g=l-a,y=h-a,v=n*n+i*i-a*a,x=v-o*o-s*s+l*l,b=v-c*c-u*u+h*h,_=d*f-p*m,w=(f*b-m*x)/(2*_)-n,k=(m*g-f*y)/_,T=(d*x-p*b)/(2*_)-i,S=(p*y-d*g)/_,A=k*k+S*S-1,M=2*(a+w*k+T*S),E=w*w+T*T-a*a,C=-(A?(M+Math.sqrt(M*M-4*A*E))/(2*A):E/M);return{x:n+w+k*C,y:i+T+S*C,r:C}}function x(e,t,r){var n,i,a,o,s=e.x-t.x,l=e.y-t.y,c=s*s+l*l;c?(i=t.r+r.r,i*=i,o=e.r+r.r,i>(o*=o)?(n=(c+o-i)/(2*c),a=Math.sqrt(Math.max(0,o/c-n*n)),r.x=e.x-n*s-a*l,r.y=e.y-n*l+a*s):(n=(c+i-o)/(2*c),a=Math.sqrt(Math.max(0,i/c-n*n)),r.x=t.x+n*s-a*l,r.y=t.y+n*l+a*s)):(r.x=t.x+r.r,r.y=t.y)}function b(e,t){var r=e.r+t.r-1e-6,n=t.x-e.x,i=t.y-e.y;return r>0&&r*r>n*n+i*i}function _(e){var t=e._,r=e.next._,n=t.r+r.r,i=(t.x*r.r+r.x*t.r)/n,a=(t.y*r.r+r.y*t.r)/n;return i*i+a*a}function w(e){this._=e,this.next=null,this.previous=null}function k(e){if(!(i=e.length))return 0;var t,r,n,i,a,o,s,l,c,u,p;if((t=e[0]).x=0,t.y=0,!(i>1))return t.r;if(r=e[1],t.x=-r.r,r.x=t.r,r.y=0,!(i>2))return t.r+r.r;x(r,t,n=e[2]),t=new w(t),r=new w(r),n=new w(n),t.next=n.previous=r,r.next=t.previous=n,n.next=r.previous=t;e:for(s=3;s<i;++s){x(t._,r._,n=e[s]),n=new w(n),l=r.next,c=t.previous,u=r._.r,p=t._.r;do{if(u<=p){if(b(l._,n._)){r=l,t.next=r,r.previous=t,--s;continue e}u+=l._.r,l=l.next}else{if(b(c._,n._)){(t=c).next=r,r.previous=t,--s;continue e}p+=c._.r,c=c.previous}}while(l!==c.next);for(n.previous=t,n.next=r,t.next=r.previous=r=n,a=_(t);(n=n.next)!==r;)(o=_(n))<a&&(t=n,a=o);r=t.next}for(t=[r._],n=r;(n=n.next)!==r;)t.push(n._);for(n=h(t),s=0;s<i;++s)(t=e[s]).x-=n.x,t.y-=n.y;return n.r}function T(e){if("function"!==typeof e)throw new Error;return e}function S(){return 0}function A(e){return function(){return e}}function M(e){return Math.sqrt(e.value)}function E(e){return function(t){t.children||(t.r=Math.max(0,+e(t)||0))}}function C(e,t){return function(r){if(n=r.children){var n,i,a,o=n.length,s=e(r)*t||0;if(s)for(i=0;i<o;++i)n[i].r+=s;if(a=k(n),s)for(i=0;i<o;++i)n[i].r-=s;r.r=a+s}}}function P(e){return function(t){var r=t.parent;t.r*=e,r&&(t.x=r.x+e*t.x,t.y=r.y+e*t.y)}}function L(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function I(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,c=e.value&&(n-t)/e.value;++s<l;)(a=o[s]).y0=r,a.y1=i,a.x0=t,a.x1=t+=a.value*c}var z={depth:-1},O={};function R(e){return e.id}function D(e){return e.parentId}function j(e,t){return e.parent===t.parent?1:2}function F(e){var t=e.children;return t?t[0]:e.t}function B(e){var t=e.children;return t?t[t.length-1]:e.t}function N(e,t,r){var n=r/(t.i-e.i);t.c-=n,t.s+=r,e.c+=n,t.z+=r,t.m+=r}function U(e,t,r){return e.a.parent===t.parent?e.a:r}function V(e,t){this._=e,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=t}function q(e,t,r,n,i){for(var a,o=e.children,s=-1,l=o.length,c=e.value&&(i-r)/e.value;++s<l;)(a=o[s]).x0=t,a.x1=n,a.y0=r,a.y1=r+=a.value*c}V.prototype=Object.create(c.prototype);var H=(1+Math.sqrt(5))/2;function G(e,t,r,n,i,a){for(var o,s,l,c,u,h,p,d,f,m,g,y=[],v=t.children,x=0,b=0,_=v.length,w=t.value;x<_;){l=i-r,c=a-n;do{u=v[b++].value}while(!u&&b<_);for(h=p=u,g=u*u*(m=Math.max(c/l,l/c)/(w*e)),f=Math.max(p/g,g/h);b<_;++b){if(u+=s=v[b].value,s<h&&(h=s),s>p&&(p=s),g=u*u*m,(d=Math.max(p/g,g/h))>f){u-=s;break}f=d}y.push(o={value:u,dice:l<c,children:v.slice(x,b)}),o.dice?I(o,r,n,i,w?n+=c*u/w:a):q(o,r,n,w?r+=l*u/w:i,a),w-=u,x=b}return y}var W=function e(t){function r(e,r,n,i,a){G(t,e,r,n,i,a)}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(H),$=function e(t){function r(e,r,n,i,a){if((o=e._squarify)&&o.ratio===t)for(var o,s,l,c,u,h=-1,p=o.length,d=e.value;++h<p;){for(l=(s=o[h]).children,c=s.value=0,u=l.length;c<u;++c)s.value+=l[c].value;s.dice?I(s,r,n,i,n+=(a-n)*s.value/d):q(s,r,n,r+=(i-r)*s.value/d,a),d-=s.value}else e._squarify=o=G(t,e,r,n,i,a),o.ratio=t}return r.ratio=function(t){return e((t=+t)>1?t:1)},r}(H);e.cluster=function(){var e=t,i=1,a=1,o=!1;function s(t){var s,l=0;t.eachAfter((function(t){var i=t.children;i?(t.x=function(e){return e.reduce(r,0)/e.length}(i),t.y=function(e){return 1+e.reduce(n,0)}(i)):(t.x=s?l+=e(t,s):0,t.y=0,s=t)}));var c=function(e){for(var t;t=e.children;)e=t[0];return e}(t),u=function(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),h=c.x-e(c,u)/2,p=u.x+e(u,c)/2;return t.eachAfter(o?function(e){e.x=(e.x-t.x)*i,e.y=(t.y-e.y)*a}:function(e){e.x=(e.x-h)/(p-h)*i,e.y=(1-(t.y?e.y/t.y:1))*a})}return s.separation=function(t){return arguments.length?(e=t,s):e},s.size=function(e){return arguments.length?(o=!1,i=+e[0],a=+e[1],s):o?null:[i,a]},s.nodeSize=function(e){return arguments.length?(o=!0,i=+e[0],a=+e[1],s):o?[i,a]:null},s},e.hierarchy=a,e.pack=function(){var e=null,t=1,r=1,n=S;function i(i){return i.x=t/2,i.y=r/2,e?i.eachBefore(E(e)).eachAfter(C(n,.5)).eachBefore(P(1)):i.eachBefore(E(M)).eachAfter(C(S,1)).eachAfter(C(n,i.r/Math.min(t,r))).eachBefore(P(Math.min(t,r)/(2*i.r))),i}return i.radius=function(t){return arguments.length?(e=null==(r=t)?null:T(r),i):e;var r},i.size=function(e){return arguments.length?(t=+e[0],r=+e[1],i):[t,r]},i.padding=function(e){return arguments.length?(n="function"===typeof e?e:A(+e),i):n},i},e.packEnclose=h,e.packSiblings=function(e){return k(e),e},e.partition=function(){var e=1,t=1,r=0,n=!1;function i(i){var a=i.height+1;return i.x0=i.y0=r,i.x1=e,i.y1=t/a,i.eachBefore(function(e,t){return function(n){n.children&&I(n,n.x0,e*(n.depth+1)/t,n.x1,e*(n.depth+2)/t);var i=n.x0,a=n.y0,o=n.x1-r,s=n.y1-r;o<i&&(i=o=(i+o)/2),s<a&&(a=s=(a+s)/2),n.x0=i,n.y0=a,n.x1=o,n.y1=s}}(t,a)),n&&i.eachBefore(L),i}return i.round=function(e){return arguments.length?(n=!!e,i):n},i.size=function(r){return arguments.length?(e=+r[0],t=+r[1],i):[e,t]},i.padding=function(e){return arguments.length?(r=+e,i):r},i},e.stratify=function(){var e=R,t=D;function r(r){var n,i,a,o,s,u,h,p=r.length,d=new Array(p),f={};for(i=0;i<p;++i)n=r[i],s=d[i]=new c(n),null!=(u=e(n,i,r))&&(u+="")&&(f[h="$"+(s.id=u)]=h in f?O:s);for(i=0;i<p;++i)if(s=d[i],null!=(u=t(r[i],i,r))&&(u+="")){if(!(o=f["$"+u]))throw new Error("missing: "+u);if(o===O)throw new Error("ambiguous: "+u);o.children?o.children.push(s):o.children=[s],s.parent=o}else{if(a)throw new Error("multiple roots");a=s}if(!a)throw new Error("no root");if(a.parent=z,a.eachBefore((function(e){e.depth=e.parent.depth+1,--p})).eachBefore(l),a.parent=null,p>0)throw new Error("cycle");return a}return r.id=function(t){return arguments.length?(e=T(t),r):e},r.parentId=function(e){return arguments.length?(t=T(e),r):t},r},e.tree=function(){var e=j,t=1,r=1,n=null;function i(i){var l=function(e){for(var t,r,n,i,a,o=new V(e,0),s=[o];t=s.pop();)if(n=t._.children)for(t.children=new Array(a=n.length),i=a-1;i>=0;--i)s.push(r=t.children[i]=new V(n[i],i)),r.parent=t;return(o.parent=new V(null,0)).children=[o],o}(i);if(l.eachAfter(a),l.parent.m=-l.z,l.eachBefore(o),n)i.eachBefore(s);else{var c=i,u=i,h=i;i.eachBefore((function(e){e.x<c.x&&(c=e),e.x>u.x&&(u=e),e.depth>h.depth&&(h=e)}));var p=c===u?1:e(c,u)/2,d=p-c.x,f=t/(u.x+p+d),m=r/(h.depth||1);i.eachBefore((function(e){e.x=(e.x+d)*f,e.y=e.depth*m}))}return i}function a(t){var r=t.children,n=t.parent.children,i=t.i?n[t.i-1]:null;if(r){!function(e){for(var t,r=0,n=0,i=e.children,a=i.length;--a>=0;)(t=i[a]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(t);var a=(r[0].z+r[r.length-1].z)/2;i?(t.z=i.z+e(t._,i._),t.m=t.z-a):t.z=a}else i&&(t.z=i.z+e(t._,i._));t.parent.A=function(t,r,n){if(r){for(var i,a=t,o=t,s=r,l=a.parent.children[0],c=a.m,u=o.m,h=s.m,p=l.m;s=B(s),a=F(a),s&&a;)l=F(l),(o=B(o)).a=t,(i=s.z+h-a.z-c+e(s._,a._))>0&&(N(U(s,t,n),t,i),c+=i,u+=i),h+=s.m,c+=a.m,p+=l.m,u+=o.m;s&&!B(o)&&(o.t=s,o.m+=h-u),a&&!F(l)&&(l.t=a,l.m+=c-p,n=t)}return n}(t,i,t.parent.A||n[0])}function o(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function s(e){e.x*=t,e.y=e.depth*r}return i.separation=function(t){return arguments.length?(e=t,i):e},i.size=function(e){return arguments.length?(n=!1,t=+e[0],r=+e[1],i):n?null:[t,r]},i.nodeSize=function(e){return arguments.length?(n=!0,t=+e[0],r=+e[1],i):n?[t,r]:null},i},e.treemap=function(){var e=W,t=!1,r=1,n=1,i=[0],a=S,o=S,s=S,l=S,c=S;function u(e){return e.x0=e.y0=0,e.x1=r,e.y1=n,e.eachBefore(h),i=[0],t&&e.eachBefore(L),e}function h(t){var r=i[t.depth],n=t.x0+r,u=t.y0+r,h=t.x1-r,p=t.y1-r;h<n&&(n=h=(n+h)/2),p<u&&(u=p=(u+p)/2),t.x0=n,t.y0=u,t.x1=h,t.y1=p,t.children&&(r=i[t.depth+1]=a(t)/2,n+=c(t)-r,u+=o(t)-r,(h-=s(t)-r)<n&&(n=h=(n+h)/2),(p-=l(t)-r)<u&&(u=p=(u+p)/2),e(t,n,u,h,p))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(r=+e[0],n=+e[1],u):[r,n]},u.tile=function(t){return arguments.length?(e=T(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a="function"===typeof e?e:A(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o="function"===typeof e?e:A(+e),u):o},u.paddingRight=function(e){return arguments.length?(s="function"===typeof e?e:A(+e),u):s},u.paddingBottom=function(e){return arguments.length?(l="function"===typeof e?e:A(+e),u):l},u.paddingLeft=function(e){return arguments.length?(c="function"===typeof e?e:A(+e),u):c},u},e.treemapBinary=function(e,t,r,n,i){var a,o,s=e.children,l=s.length,c=new Array(l+1);for(c[0]=o=a=0;a<l;++a)c[a+1]=o+=s[a].value;!function e(t,r,n,i,a,o,l){if(t>=r-1){var u=s[t];return u.x0=i,u.y0=a,u.x1=o,void(u.y1=l)}for(var h=c[t],p=n/2+h,d=t+1,f=r-1;d<f;){var m=d+f>>>1;c[m]<p?d=m+1:f=m}p-c[d-1]<c[d]-p&&t+1<d&&--d;var g=c[d]-h,y=n-g;if(o-i>l-a){var v=(i*y+o*g)/n;e(t,d,g,i,a,v,l),e(d,r,y,v,a,o,l)}else{var x=(a*y+l*g)/n;e(t,d,g,i,a,o,x),e(d,r,y,i,x,o,l)}}(0,l,e.value,t,r,n,i)},e.treemapDice=I,e.treemapResquarify=$,e.treemapSlice=q,e.treemapSliceDice=function(e,t,r,n,i){(1&e.depth?q:I)(e,t,r,n,i)},e.treemapSquarify=W,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),Zu=p({"src/traces/sunburst/calc.js"(e){var t=$u(),r=k(),n=st(),i=Wt().makeColorScaleFuncFromTrace,a=Ou().makePullColorFn,o=Ou().generateExtendedColors,s=Wt().calc,l=T().ALMOST_EQUAL,c={},u={},h={};function p(e,t,r){var n=0,i=e.children;if(i){for(var a=i.length,o=0;o<a;o++)n+=p(i[o],t,r);r.branches&&n++}else r.leaves&&n++;return e.value=e.data.data.value=n,t._values||(t._values=[]),t._values[e.data.data.i]=n,n}e.calc=function(e,o){var c,u,h,d,f,m,g=e._fullLayout,y=o.ids,v=n.isArrayOrTypedArray(y),x=o.labels,b=o.parents,_=o.values,w=n.isArrayOrTypedArray(_),k=[],T={},S={},A=function(e){return e||"number"===typeof e},M=function(e){return!w||r(_[e])&&_[e]>=0};v?(c=Math.min(y.length,b.length),u=function(e){return A(y[e])&&M(e)},h=function(e){return String(y[e])}):(c=Math.min(x.length,b.length),u=function(e){return A(x[e])&&M(e)},h=function(e){return String(x[e])}),w&&(c=Math.min(c,_.length));for(var E=0;E<c;E++)if(u(E)){var C=h(E),P=A(b[E])?String(b[E]):"",L={i:E,id:C,pid:P,label:A(x[E])?String(x[E]):""};w&&(L.v=+_[E]),k.push(L),f=C,T[d=P]?T[d].push(f):T[d]=[f],S[f]=1}if(T[""]){if(T[""].length>1){for(var I=n.randstr(),z=0;z<k.length;z++)""===k[z].pid&&(k[z].pid=I);k.unshift({hasMultipleRoots:!0,id:I,pid:"",label:""})}}else{var O,R=[];for(O in T)S[O]||R.push(O);if(1!==R.length)return n.warn(["Multiple implied roots, cannot build",o.type,"hierarchy of",o.name+".","These roots include:",R.join(", ")].join(" "));O=R[0],k.unshift({hasImpliedRoot:!0,id:O,pid:"",label:O})}try{m=t.stratify().id((function(e){return e.id})).parentId((function(e){return e.pid}))(k)}catch(V){return n.warn(["Failed to build",o.type,"hierarchy of",o.name+".","Error:",V.message].join(" "))}var D=t.hierarchy(m),j=!1;if(w)switch(o.branchvalues){case"remainder":D.sum((function(e){return e.data.v}));break;case"total":D.each((function(e){var t=e.data.data,r=t.v;if(e.children){var i=e.children.reduce((function(e,t){return e+t.data.data.v}),0);if((t.hasImpliedRoot||t.hasMultipleRoots)&&(r=i),r<i*l)return j=!0,n.warn(["Total value for node",e.data.data.id,"of",o.name,"is smaller than the sum of its children.","\nparent value =",r,"\nchildren sum =",i].join(" "))}e.value=r}))}else p(D,o,{branches:-1!==o.count.indexOf("branches"),leaves:-1!==o.count.indexOf("leaves")});if(!j){var F,B;o.sort&&D.sort((function(e,t){return t.value-e.value}));var N=o.marker.colors||[],U=!!N.length;return o._hasColorscale?(U||(N=w?o.values:o._values),s(e,o,{vals:N,containerStr:"marker",cLetter:"c"}),B=i(o.marker)):F=a(g["_"+o.type+"colormap"]),D.each((function(e){var t=e.data.data;t.color=o._hasColorscale?B(N[t.i]):F(N[t.i],t.id)})),k[0].hierarchy=D,k}},e._runCrossTraceCalc=function(e,t){var r=t._fullLayout,n=t.calcdata,i=r[e+"colorway"],a=r["_"+e+"colormap"];r["extend"+e+"colors"]&&(i=o(i,"icicle"===e?h:"treemap"===e?u:c));var s,l=0;function p(e){var t=e.data.data,r=t.id;!1===t.color&&(a[r]?t.color=a[r]:e.parent?e.parent.parent?t.color=e.parent.data.data.color:(a[r]=t.color=i[l%i.length],l++):t.color=s)}for(var d=0;d<n.length;d++){var f=n[d][0];f.trace.type===e&&f.hierarchy&&(s=f.trace.root.color,f.hierarchy.each(p))}},e.crossTraceCalc=function(t){return e._runCrossTraceCalc("sunburst",t)}}});function Xu(e,t,r){e.prototype=t.prototype=r,r.constructor=e}function Yu(e,t){var r=Object.create(e.prototype);for(var n in t)r[n]=t[n];return r}var Ku,Ju,Qu,eh,th,rh,nh,ih,ah,oh,sh,lh,ch,uh=h({"node_modules/d3-color/src/define.js"(){}});function hh(){}function ph(){return this.rgb().formatHex()}function dh(){return this.rgb().formatHex8()}function fh(){return Ch(this).formatHsl()}function mh(){return this.rgb().formatRgb()}function gh(e){var t,r;return e=(e+"").trim().toLowerCase(),(t=rh.exec(e))?(r=t[1].length,t=parseInt(t[1],16),6===r?yh(t):3===r?new _h(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===r?vh(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===r?vh(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=nh.exec(e))?new _h(t[1],t[2],t[3],1):(t=ih.exec(e))?new _h(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ah.exec(e))?vh(t[1],t[2],t[3],t[4]):(t=oh.exec(e))?vh(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=sh.exec(e))?Eh(t[1],t[2]/100,t[3]/100,1):(t=lh.exec(e))?Eh(t[1],t[2]/100,t[3]/100,t[4]):ch.hasOwnProperty(e)?yh(ch[e]):"transparent"===e?new _h(NaN,NaN,NaN,0):null}function yh(e){return new _h(e>>16&255,e>>8&255,255&e,1)}function vh(e,t,r,n){return n<=0&&(e=t=r=NaN),new _h(e,t,r,n)}function xh(e){return e instanceof hh||(e=gh(e)),e?new _h((e=e.rgb()).r,e.g,e.b,e.opacity):new _h}function bh(e,t,r,n){return 1===arguments.length?xh(e):new _h(e,t,r,null==n?1:n)}function _h(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}function wh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}`}function kh(){return`#${Mh(this.r)}${Mh(this.g)}${Mh(this.b)}${Mh(255*(isNaN(this.opacity)?1:this.opacity))}`}function Th(){const e=Sh(this.opacity);return`${1===e?"rgb(":"rgba("}${Ah(this.r)}, ${Ah(this.g)}, ${Ah(this.b)}${1===e?")":`, ${e})`}`}function Sh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ah(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Mh(e){return((e=Ah(e))<16?"0":"")+e.toString(16)}function Eh(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Lh(e,t,r,n)}function Ch(e){if(e instanceof Lh)return new Lh(e.h,e.s,e.l,e.opacity);if(e instanceof hh||(e=gh(e)),!e)return new Lh;if(e instanceof Lh)return e;var t=(e=e.rgb()).r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(o=t===a?(r-n)/s+6*(r<n):r===a?(n-t)/s+2:(t-r)/s+4,s/=l<.5?a+i:2-a-i,o*=60):s=l>0&&l<1?0:o,new Lh(o,s,l,e.opacity)}function Ph(e,t,r,n){return 1===arguments.length?Ch(e):new Lh(e,t,r,null==n?1:n)}function Lh(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}function Ih(e){return(e=(e||0)%360)<0?e+360:e}function zh(e){return Math.max(0,Math.min(1,e||0))}function Oh(e,t,r){return 255*(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)}var Rh,Dh,jh,Fh,Bh,Nh,Uh,Vh,qh,Hh=h({"node_modules/d3-color/src/color.js"(){uh(),Ju=1/(Ku=.7),Qu="\\s*([+-]?\\d+)\\s*",eh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",th="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",rh=/^#([0-9a-f]{3,8})$/,nh=new RegExp(`^rgb\\(${Qu},${Qu},${Qu}\\)$`),ih=new RegExp(`^rgb\\(${th},${th},${th}\\)$`),ah=new RegExp(`^rgba\\(${Qu},${Qu},${Qu},${eh}\\)$`),oh=new RegExp(`^rgba\\(${th},${th},${th},${eh}\\)$`),sh=new RegExp(`^hsl\\(${eh},${th},${th}\\)$`),lh=new RegExp(`^hsla\\(${eh},${th},${th},${eh}\\)$`),ch={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Xu(hh,gh,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:ph,formatHex:ph,formatHex8:dh,formatHsl:fh,formatRgb:mh,toString:mh}),Xu(_h,bh,Yu(hh,{brighter(e){return e=null==e?Ju:Math.pow(Ju,e),new _h(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Ku:Math.pow(Ku,e),new _h(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _h(Ah(this.r),Ah(this.g),Ah(this.b),Sh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wh,formatHex:wh,formatHex8:kh,formatRgb:Th,toString:Th})),Xu(Lh,Ph,Yu(hh,{brighter(e){return e=null==e?Ju:Math.pow(Ju,e),new Lh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ku:Math.pow(Ku,e),new Lh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new _h(Oh(e>=240?e-240:e+120,i,n),Oh(e,i,n),Oh(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Lh(Ih(this.h),zh(this.s),zh(this.l),Sh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Sh(this.opacity);return`${1===e?"hsl(":"hsla("}${Ih(this.h)}, ${100*zh(this.s)}%, ${100*zh(this.l)}%${1===e?")":`, ${e})`}`}}))}}),Gh=h({"node_modules/d3-color/src/math.js"(){Rh=Math.PI/180,Dh=180/Math.PI}});function Wh(e){if(e instanceof Zh)return new Zh(e.l,e.a,e.b,e.opacity);if(e instanceof ep)return tp(e);e instanceof _h||(e=xh(e));var t,r,n=Jh(e.r),i=Jh(e.g),a=Jh(e.b),o=Xh((.2225045*n+.7168786*i+.0606169*a)/Fh);return n===i&&i===a?t=r=o:(t=Xh((.4360747*n+.3850649*i+.1430804*a)/jh),r=Xh((.0139322*n+.0971045*i+.7141733*a)/Bh)),new Zh(116*o-16,500*(t-o),200*(o-r),e.opacity)}function $h(e,t,r,n){return 1===arguments.length?Wh(e):new Zh(e,t,r,null==n?1:n)}function Zh(e,t,r,n){this.l=+e,this.a=+t,this.b=+r,this.opacity=+n}function Xh(e){return e>qh?Math.pow(e,1/3):e/Vh+Nh}function Yh(e){return e>Uh?e*e*e:Vh*(e-Nh)}function Kh(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Jh(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Qh(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof ep)return new ep(e.h,e.c,e.l,e.opacity);if(e instanceof Zh||(e=Wh(e)),0===e.a&&0===e.b)return new ep(NaN,0<e.l&&e.l<100?0:NaN,e.l,e.opacity);var t=Math.atan2(e.b,e.a)*Dh;return new ep(t<0?t+360:t,Math.sqrt(e.a*e.a+e.b*e.b),e.l,e.opacity)}(e):new ep(e,t,r,null==n?1:n)}function ep(e,t,r,n){this.h=+e,this.c=+t,this.l=+r,this.opacity=+n}function tp(e){if(isNaN(e.h))return new Zh(e.l,0,0,e.opacity);var t=e.h*Rh;return new Zh(e.l,Math.cos(t)*e.c,Math.sin(t)*e.c,e.opacity)}var rp,np,ip,ap,op,sp,lp,cp,up=h({"node_modules/d3-color/src/lab.js"(){uh(),Hh(),Gh(),jh=.96422,Fh=1,Bh=.82521,Nh=4/29,Vh=3*(Uh=6/29)*Uh,qh=Uh*Uh*Uh,Xu(Zh,$h,Yu(hh,{brighter(e){return new Zh(this.l+18*(null==e?1:e),this.a,this.b,this.opacity)},darker(e){return new Zh(this.l-18*(null==e?1:e),this.a,this.b,this.opacity)},rgb(){var e=(this.l+16)/116,t=isNaN(this.a)?e:e+this.a/500,r=isNaN(this.b)?e:e-this.b/200;return new _h(Kh(3.1338561*(t=jh*Yh(t))-1.6168667*(e=Fh*Yh(e))-.4906146*(r=Bh*Yh(r))),Kh(-.9787684*t+1.9161415*e+.033454*r),Kh(.0719453*t-.2289914*e+1.4052427*r),this.opacity)}})),Xu(ep,Qh,Yu(hh,{brighter(e){return new ep(this.h,this.c,this.l+18*(null==e?1:e),this.opacity)},darker(e){return new ep(this.h,this.c,this.l-18*(null==e?1:e),this.opacity)},rgb(){return tp(this).rgb()}}))}});function hp(e,t,r,n){return 1===arguments.length?function(e){if(e instanceof pp)return new pp(e.h,e.s,e.l,e.opacity);e instanceof _h||(e=xh(e));var t=e.r/255,r=e.g/255,n=e.b/255,i=(cp*n+sp*t-lp*r)/(cp+sp-lp),a=n-i,o=(op*(r-i)-ip*a)/ap,s=Math.sqrt(o*o+a*a)/(op*i*(1-i)),l=s?Math.atan2(o,a)*Dh-120:NaN;return new pp(l<0?l+360:l,s,i,e.opacity)}(e):new pp(e,t,r,null==n?1:n)}function pp(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}var dp=h({"node_modules/d3-color/src/cubehelix.js"(){uh(),Hh(),Gh(),sp=(op=1.97294)*(ap=-.90649),lp=op*(np=1.78277),cp=np*(ip=-.29227)-ap*(rp=-.14861),Xu(pp,hp,Yu(hh,{brighter(e){return e=null==e?Ju:Math.pow(Ju,e),new pp(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Ku:Math.pow(Ku,e),new pp(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Rh,t=+this.l,r=isNaN(this.s)?0:this.s*t*(1-t),n=Math.cos(e),i=Math.sin(e);return new _h(255*(t+r*(rp*n+np*i)),255*(t+r*(ip*n+ap*i)),255*(t+r*(op*n)),this.opacity)}}))}}),fp=h({"node_modules/d3-color/src/index.js"(){Hh(),up(),dp()}});function mp(e,t,r,n,i){var a=e*e,o=a*e;return((1-3*e+3*a-o)*t+(4-6*a+3*o)*r+(1+3*e+3*a-3*o)*n+o*i)/6}function gp(e){var t=e.length-1;return function(r){var n=r<=0?r=0:r>=1?(r=1,t-1):Math.floor(r*t),i=e[n],a=e[n+1],o=n>0?e[n-1]:2*i-a,s=n<t-1?e[n+2]:2*a-i;return mp((r-n/t)*t,o,i,a,s)}}var yp=h({"node_modules/d3-interpolate/src/basis.js"(){}});function vp(e){var t=e.length;return function(r){var n=Math.floor(((r%=1)<0?++r:r)*t),i=e[(n+t-1)%t],a=e[n%t],o=e[(n+1)%t],s=e[(n+2)%t];return mp((r-n/t)*t,i,a,o,s)}}var xp,bp=h({"node_modules/d3-interpolate/src/basisClosed.js"(){yp()}}),_p=h({"node_modules/d3-interpolate/src/constant.js"(){xp=e=>()=>e}});function wp(e,t){return function(r){return e+r*t}}function kp(e,t){var r=t-e;return r?wp(e,r>180||r<-180?r-360*Math.round(r/360):r):xp(isNaN(e)?t:e)}function Tp(e){return 1===(e=+e)?Sp:function(t,r){return r-t?function(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}(t,r,e):xp(isNaN(t)?r:t)}}function Sp(e,t){var r=t-e;return r?wp(e,r):xp(isNaN(e)?t:e)}var Ap,Mp,Ep,Cp=h({"node_modules/d3-interpolate/src/color.js"(){_p()}});function Pp(e){return function(t){var r,n,i=t.length,a=new Array(i),o=new Array(i),s=new Array(i);for(r=0;r<i;++r)n=bh(t[r]),a[r]=n.r||0,o[r]=n.g||0,s[r]=n.b||0;return a=e(a),o=e(o),s=e(s),n.opacity=1,function(e){return n.r=a(e),n.g=o(e),n.b=s(e),n+""}}}var Lp=h({"node_modules/d3-interpolate/src/rgb.js"(){fp(),yp(),bp(),Cp(),Ap=function e(t){var r=Tp(t);function n(e,t){var n=r((e=bh(e)).r,(t=bh(t)).r),i=r(e.g,t.g),a=r(e.b,t.b),o=Sp(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+""}}return n.gamma=e,n}(1),Mp=Pp(gp),Ep=Pp(vp)}});function Ip(e,t){t||(t=[]);var r,n=e?Math.min(t.length,e.length):0,i=t.slice();return function(a){for(r=0;r<n;++r)i[r]=e[r]*(1-a)+t[r]*a;return i}}function zp(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}var Op=h({"node_modules/d3-interpolate/src/numberArray.js"(){}});function Rp(e,t){return(zp(t)?Ip:Dp)(e,t)}function Dp(e,t){var r,n=t?t.length:0,i=e?Math.min(n,e.length):0,a=new Array(i),o=new Array(n);for(r=0;r<i;++r)a[r]=Zp(e[r],t[r]);for(;r<n;++r)o[r]=t[r];return function(e){for(r=0;r<i;++r)o[r]=a[r](e);return o}}var jp=h({"node_modules/d3-interpolate/src/array.js"(){Xp(),Op()}});function Fp(e,t){var r=new Date;return e=+e,t=+t,function(n){return r.setTime(e*(1-n)+t*n),r}}var Bp=h({"node_modules/d3-interpolate/src/date.js"(){}});function Np(e,t){return e=+e,t=+t,function(r){return e*(1-r)+t*r}}var Up=h({"node_modules/d3-interpolate/src/number.js"(){}});function Vp(e,t){var r,n={},i={};for(r in null!==e&&"object"===typeof e||(e={}),null!==t&&"object"===typeof t||(t={}),t)r in e?n[r]=Zp(e[r],t[r]):i[r]=t[r];return function(e){for(r in n)i[r]=n[r](e);return i}}var qp,Hp,Gp=h({"node_modules/d3-interpolate/src/object.js"(){Xp()}});function Wp(e,t){var r,n,i,a=qp.lastIndex=Hp.lastIndex=0,o=-1,s=[],l=[];for(e+="",t+="";(r=qp.exec(e))&&(n=Hp.exec(t));)(i=n.index)>a&&(i=t.slice(a,i),s[o]?s[o]+=i:s[++o]=i),(r=r[0])===(n=n[0])?s[o]?s[o]+=n:s[++o]=n:(s[++o]=null,l.push({i:o,x:Np(r,n)})),a=Hp.lastIndex;return a<t.length&&(i=t.slice(a),s[o]?s[o]+=i:s[++o]=i),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var r,n=0;n<t;++n)s[(r=l[n]).i]=r.x(e);return s.join("")})}var $p=h({"node_modules/d3-interpolate/src/string.js"(){Up(),qp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hp=new RegExp(qp.source,"g")}});function Zp(e,t){var r,n=typeof t;return null==t||"boolean"===n?xp(t):("number"===n?Np:"string"===n?(r=gh(t))?(t=r,Ap):Wp:t instanceof gh?Ap:t instanceof Date?Fp:zp(t)?Ip:Array.isArray(t)?Dp:"function"!==typeof t.valueOf&&"function"!==typeof t.toString||isNaN(t)?Vp:Np)(e,t)}var Xp=h({"node_modules/d3-interpolate/src/value.js"(){fp(),Lp(),jp(),Bp(),Up(),Gp(),$p(),_p(),Op()}});function Yp(e){var t=e.length;return function(r){return e[Math.max(0,Math.min(t-1,Math.floor(r*t)))]}}var Kp=h({"node_modules/d3-interpolate/src/discrete.js"(){}});function Jp(e,t){var r=kp(+e,+t);return function(e){var t=r(e);return t-360*Math.floor(t/360)}}var Qp=h({"node_modules/d3-interpolate/src/hue.js"(){Cp()}});function ed(e,t){return e=+e,t=+t,function(r){return Math.round(e*(1-r)+t*r)}}var td,rd,nd=h({"node_modules/d3-interpolate/src/round.js"(){}});function id(e,t,r,n,i,a){var o,s,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*r+t*n)&&(r-=e*l,n-=t*l),(s=Math.sqrt(r*r+n*n))&&(r/=s,n/=s,l/=s),e*n<t*r&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*td,skewX:Math.atan(l)*td,scaleX:o,scaleY:s}}var ad,od=h({"node_modules/d3-interpolate/src/transform/decompose.js"(){td=180/Math.PI,rd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1}}});function sd(e){const t=new("function"===typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?rd:id(t.a,t.b,t.c,t.d,t.e,t.f)}function ld(e){return null==e?rd:(ad||(ad=document.createElementNS("http://www.w3.org/2000/svg","g")),ad.setAttribute("transform",e),(e=ad.transform.baseVal.consolidate())?id((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):rd)}var cd,ud,hd=h({"node_modules/d3-interpolate/src/transform/parse.js"(){od()}});function pd(e,t,r,n){function i(e){return e.length?e.pop()+" ":""}return function(a,o){var s=[],l=[];return a=e(a),o=e(o),function(e,n,i,a,o,s){if(e!==i||n!==a){var l=o.push("translate(",null,t,null,r);s.push({i:l-4,x:Np(e,i)},{i:l-2,x:Np(n,a)})}else(i||a)&&o.push("translate("+i+t+a+r)}(a.translateX,a.translateY,o.translateX,o.translateY,s,l),function(e,t,r,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:Np(e,t)})):t&&r.push(i(r)+"rotate("+t+n)}(a.rotate,o.rotate,s,l),function(e,t,r,a){e!==t?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:Np(e,t)}):t&&r.push(i(r)+"skewX("+t+n)}(a.skewX,o.skewX,s,l),function(e,t,r,n,a,o){if(e!==r||t!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:Np(e,r)},{i:s-2,x:Np(t,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(e){for(var t,r=-1,n=l.length;++r<n;)s[(t=l[r]).i]=t.x(e);return s.join("")}}}var dd,fd=h({"node_modules/d3-interpolate/src/transform/index.js"(){Up(),hd(),cd=pd(sd,"px, ","px)","deg)"),ud=pd(ld,", ",")",")")}});function md(e){return((e=Math.exp(e))+1/e)/2}var gd,yd,vd=h({"node_modules/d3-interpolate/src/zoom.js"(){dd=function e(t,r,n){function i(e,i){var a,o,s=e[0],l=e[1],c=e[2],u=i[0],h=i[1],p=i[2],d=u-s,f=h-l,m=d*d+f*f;if(m<1e-12)o=Math.log(p/c)/t,a=function(e){return[s+e*d,l+e*f,c*Math.exp(t*e*o)]};else{var g=Math.sqrt(m),y=(p*p-c*c+n*m)/(2*c*r*g),v=(p*p-c*c-n*m)/(2*p*r*g),x=Math.log(Math.sqrt(y*y+1)-y),b=Math.log(Math.sqrt(v*v+1)-v);o=(b-x)/t,a=function(e){var n,i=e*o,a=md(x),u=c/(r*g)*(a*(n=t*i+x,((n=Math.exp(2*n))-1)/(n+1))-function(e){return((e=Math.exp(e))-1/e)/2}(x));return[s+u*d,l+u*f,c*a/md(t*i+x)]}}return a.duration=1e3*o*t/Math.SQRT2,a}return i.rho=function(t){var r=Math.max(.001,+t),n=r*r;return e(r,n,n*n)},i}(Math.SQRT2,2,4)}});function xd(e){return function(t,r){var n=e((t=Ph(t)).h,(r=Ph(r)).h),i=Sp(t.s,r.s),a=Sp(t.l,r.l),o=Sp(t.opacity,r.opacity);return function(e){return t.h=n(e),t.s=i(e),t.l=a(e),t.opacity=o(e),t+""}}}var bd=h({"node_modules/d3-interpolate/src/hsl.js"(){fp(),Cp(),gd=xd(kp),yd=xd(Sp)}});function _d(e,t){var r=Sp((e=$h(e)).l,(t=$h(t)).l),n=Sp(e.a,t.a),i=Sp(e.b,t.b),a=Sp(e.opacity,t.opacity);return function(t){return e.l=r(t),e.a=n(t),e.b=i(t),e.opacity=a(t),e+""}}var wd,kd,Td=h({"node_modules/d3-interpolate/src/lab.js"(){fp(),Cp()}});function Sd(e){return function(t,r){var n=e((t=Qh(t)).h,(r=Qh(r)).h),i=Sp(t.c,r.c),a=Sp(t.l,r.l),o=Sp(t.opacity,r.opacity);return function(e){return t.h=n(e),t.c=i(e),t.l=a(e),t.opacity=o(e),t+""}}}var Ad,Md,Ed=h({"node_modules/d3-interpolate/src/hcl.js"(){fp(),Cp(),wd=Sd(kp),kd=Sd(Sp)}});function Cd(e){return function t(r){function n(t,n){var i=e((t=hp(t)).h,(n=hp(n)).h),a=Sp(t.s,n.s),o=Sp(t.l,n.l),s=Sp(t.opacity,n.opacity);return function(e){return t.h=i(e),t.s=a(e),t.l=o(Math.pow(e,r)),t.opacity=s(e),t+""}}return r=+r,n.gamma=t,n}(1)}var Pd=h({"node_modules/d3-interpolate/src/cubehelix.js"(){fp(),Cp(),Ad=Cd(kp),Md=Cd(Sp)}});function Ld(e,t){void 0===t&&(t=e,e=Zp);for(var r=0,n=t.length-1,i=t[0],a=new Array(n<0?0:n);r<n;)a[r]=e(i,i=t[++r]);return function(e){var t=Math.max(0,Math.min(n-1,Math.floor(e*=n)));return a[t](e-t)}}var Id=h({"node_modules/d3-interpolate/src/piecewise.js"(){Xp()}});function zd(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e(n/(t-1));return r}var Od=h({"node_modules/d3-interpolate/src/quantize.js"(){}}),Rd={};d(Rd,{interpolate:()=>Zp,interpolateArray:()=>Rp,interpolateBasis:()=>gp,interpolateBasisClosed:()=>vp,interpolateCubehelix:()=>Ad,interpolateCubehelixLong:()=>Md,interpolateDate:()=>Fp,interpolateDiscrete:()=>Yp,interpolateHcl:()=>wd,interpolateHclLong:()=>kd,interpolateHsl:()=>gd,interpolateHslLong:()=>yd,interpolateHue:()=>Jp,interpolateLab:()=>_d,interpolateNumber:()=>Np,interpolateNumberArray:()=>Ip,interpolateObject:()=>Vp,interpolateRgb:()=>Ap,interpolateRgbBasis:()=>Mp,interpolateRgbBasisClosed:()=>Ep,interpolateRound:()=>ed,interpolateString:()=>Wp,interpolateTransformCss:()=>cd,interpolateTransformSvg:()=>ud,interpolateZoom:()=>dd,piecewise:()=>Ld,quantize:()=>zd});var Dd,jd,Fd,Bd=h({"node_modules/d3-interpolate/src/index.js"(){Xp(),jp(),yp(),bp(),Bp(),Kp(),Qp(),Up(),Op(),Gp(),nd(),$p(),fd(),vd(),Lp(),bd(),Td(),Ed(),Pd(),Id(),Od()}}),Nd=p({"src/traces/sunburst/fill_one.js"(e,t){var r=Jt(),n=q();t.exports=function(e,t,i,a,o){var s=t.data.data,l=s.i,c=o||s.color;if(l>=0){t.i=s.i;var u=i.marker;u.pattern&&u.colors&&u.pattern.shape||(u.color=c,t.color=c),r.pointStyle(e,i,a,t)}else n.fill(e,c)}}}),Ud=p({"src/traces/sunburst/style.js"(e,t){var r=v(),n=q(),i=st(),a=Ka().resizeText,o=Nd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._sunburstlayer.selectAll(".trace");a(e,t,"sunburst"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),Vd=p({"src/traces/sunburst/helpers.js"(e){var t=st(),r=q(),n=pr(),i=br();function a(e){return e.data.data.pid}e.findEntryWithLevel=function(t,r){var n;return r&&t.eachAfter((function(t){if(e.getPtId(t)===r)return n=t.copy()})),n||t},e.findEntryWithChild=function(t,r){var n;return t.eachAfter((function(t){for(var i=t.children||[],a=0;a<i.length;a++){var o=i[a];if(e.getPtId(o)===r)return n=t.copy()}})),n||t},e.isEntry=function(e){return!e.parent},e.isLeaf=function(e){return!e.children},e.getPtId=function(e){return e.data.data.id},e.getPtLabel=function(e){return e.data.data.label},e.getValue=function(e){return e.value},e.isHierarchyRoot=function(e){return""===a(e)},e.setSliceCursor=function(t,r,i){var a=i.isTransitioning;if(!a){var o=t.datum();a=i.hideOnRoot&&e.isHierarchyRoot(o)||i.hideOnLeaves&&e.isLeaf(o)}n(t,a?null:"pointer")},e.getInsideTextFontKey=function(e,r,n,i,a){var o=(a||{}).onPathbar?"pathbar.textfont":"insidetextfont",s=n.data.data.i;return t.castOption(r,s,o+"."+e)||t.castOption(r,s,"textfont."+e)||i.size},e.getOutsideTextFontKey=function(e,r,n,i){var a=n.data.data.i;return t.castOption(r,a,"outsidetextfont."+e)||t.castOption(r,a,"textfont."+e)||i.size},e.isOutsideText=function(t,r){return!t._hasColorscale&&e.isHierarchyRoot(r)},e.determineTextFont=function(n,i,a,o){return e.isOutsideText(n,i)?function(t,r,n){return{color:e.getOutsideTextFontKey("color",t,r,n),family:e.getOutsideTextFontKey("family",t,r,n),size:e.getOutsideTextFontKey("size",t,r,n),weight:e.getOutsideTextFontKey("weight",t,r,n),style:e.getOutsideTextFontKey("style",t,r,n),variant:e.getOutsideTextFontKey("variant",t,r,n),textcase:e.getOutsideTextFontKey("textcase",t,r,n),lineposition:e.getOutsideTextFontKey("lineposition",t,r,n),shadow:e.getOutsideTextFontKey("shadow",t,r,n)}}(n,i,a):function(n,i,a,o){var s=(o||{}).onPathbar,l=i.data.data,c=l.i,u=t.castOption(n,c,(s?"pathbar.textfont":"insidetextfont")+".color");return!u&&n._input.textfont&&(u=t.castOption(n._input,c,"textfont.color")),{color:u||r.contrast(l.color),family:e.getInsideTextFontKey("family",n,i,a,o),size:e.getInsideTextFontKey("size",n,i,a,o),weight:e.getInsideTextFontKey("weight",n,i,a,o),style:e.getInsideTextFontKey("style",n,i,a,o),variant:e.getInsideTextFontKey("variant",n,i,a,o),textcase:e.getInsideTextFontKey("textcase",n,i,a,o),lineposition:e.getInsideTextFontKey("lineposition",n,i,a,o),shadow:e.getInsideTextFontKey("shadow",n,i,a,o)}}(n,i,a,o)},e.hasTransition=function(e){return!!(e&&e.duration>0)},e.getMaxDepth=function(e){return e.maxdepth>=0?e.maxdepth:1/0},e.isHeader=function(t,r){return!(e.isLeaf(t)||t.depth===r._maxDepth-1)},e.getParent=function(t,r){return e.findEntryWithLevel(t,a(r))},e.listPath=function(t,r){var n=t.parent;if(!n)return[];var i=r?[n.data[r]]:[n];return e.listPath(n,r).concat(i)},e.getPath=function(t){return e.listPath(t,"label").join("/")+"/"},e.formatValue=i.formatPieValue,e.formatPercent=function(e,r){var n=t.formatPercent(e,0);return"0%"===n&&(n=i.formatPiePercent(e,r)),n}}}),qd=p({"src/traces/sunburst/fx.js"(e,t){var r=v(),n=Ve(),i=Xt().appendArrayPointValue,a=zr(),o=st(),s=pt(),l=Vd(),c=br().formatPieValue;function u(e,t,r){for(var n=e.data.data,a={curveNumber:t.index,pointNumber:n.i,data:t._input,fullData:t},o=0;o<r.length;o++){var s=r[o];s in e&&(a[s]=e[s])}return"parentString"in e&&!l.isHierarchyRoot(e)&&(a.parent=e.parentString),i(a,t,n.i),a}t.exports=function(e,t,i,h,p){var d=h[0],f=d.trace,m=d.hierarchy,g="sunburst"===f.type,y="treemap"===f.type||"icicle"===f.type;"_hasHoverLabel"in f||(f._hasHoverLabel=!1),"_hasHoverEvent"in f||(f._hasHoverEvent=!1),e.on("mouseover",(function(n){var s=i._fullLayout;if(!i._dragging&&!1!==s.hovermode){var h,v=i._fullData[f.index],x=n.data.data,b=x.i,_=l.isHierarchyRoot(n),w=l.getParent(m,n),k=l.getValue(n),T=function(e){return o.castOption(v,b,e)},S=T("hovertemplate"),A=a.castHoverinfo(v,s,b),M=s.separators;if(S||A&&"none"!==A&&"skip"!==A){var E,C;g&&(E=d.cx+n.pxmid[0]*(1-n.rInscribed),C=d.cy+n.pxmid[1]*(1-n.rInscribed)),y&&(E=n._hoverX,C=n._hoverY);var P,L={},I=[],z=[],O=function(e){return-1!==I.indexOf(e)};A&&(I="all"===A?v._module.attributes.hoverinfo.flags:A.split("+")),L.label=x.label,O("label")&&L.label&&z.push(L.label),x.hasOwnProperty("v")&&(L.value=x.v,L.valueLabel=c(L.value,M),O("value")&&z.push(L.valueLabel)),L.currentPath=n.currentPath=l.getPath(n.data),O("current path")&&!_&&z.push(L.currentPath);var R=[],D=function(){-1===R.indexOf(P)&&(z.push(P),R.push(P))};L.percentParent=n.percentParent=k/l.getValue(w),L.parent=n.parentString=l.getPtLabel(w),O("percent parent")&&(P=l.formatPercent(L.percentParent,M)+" of "+L.parent,D()),L.percentEntry=n.percentEntry=k/l.getValue(t),L.entry=n.entry=l.getPtLabel(t),!O("percent entry")||_||n.onPathbar||(P=l.formatPercent(L.percentEntry,M)+" of "+L.entry,D()),L.percentRoot=n.percentRoot=k/l.getValue(m),L.root=n.root=l.getPtLabel(m),O("percent root")&&!_&&(P=l.formatPercent(L.percentRoot,M)+" of "+L.root,D()),L.text=T("hovertext")||T("text"),O("text")&&(P=L.text,o.isValidTextValue(P)&&z.push(P)),h=[u(n,v,p.eventDataKeys)];var j={trace:v,y:C,_x0:n._x0,_x1:n._x1,_y0:n._y0,_y1:n._y1,text:z.join("<br>"),name:S||O("name")?v.name:void 0,color:T("hoverlabel.bgcolor")||x.color,borderColor:T("hoverlabel.bordercolor"),fontFamily:T("hoverlabel.font.family"),fontSize:T("hoverlabel.font.size"),fontColor:T("hoverlabel.font.color"),fontWeight:T("hoverlabel.font.weight"),fontStyle:T("hoverlabel.font.style"),fontVariant:T("hoverlabel.font.variant"),nameLength:T("hoverlabel.namelength"),textAlign:T("hoverlabel.align"),hovertemplate:S,hovertemplateLabels:L,eventData:h};g&&(j.x0=E-n.rInscribed*n.rpx1,j.x1=E+n.rInscribed*n.rpx1,j.idealAlign=n.pxmid[0]<0?"left":"right"),y&&(j.x=E,j.idealAlign=E<0?"left":"right");var F=[];a.loneHover(j,{container:s._hoverlayer.node(),outerContainer:s._paper.node(),gd:i,inOut_bbox:F}),h[0].bbox=F[0],f._hasHoverLabel=!0}if(y){var B=e.select("path.surface");p.styleOne(B,n,v,i,{hovered:!0})}f._hasHoverEvent=!0,i.emit("plotly_hover",{points:h||[u(n,v,p.eventDataKeys)],event:r.event})}})),e.on("mouseout",(function(t){var n=i._fullLayout,o=i._fullData[f.index],s=r.select(this).datum();if(f._hasHoverEvent&&(t.originalEvent=r.event,i.emit("plotly_unhover",{points:[u(s,o,p.eventDataKeys)],event:r.event}),f._hasHoverEvent=!1),f._hasHoverLabel&&(a.loneUnhover(n._hoverlayer.node()),f._hasHoverLabel=!1),y){var l=e.select("path.surface");p.styleOne(l,s,o,i,{hovered:!1})}})),e.on("click",(function(e){var t=i._fullLayout,o=i._fullData[f.index],c=g&&(l.isHierarchyRoot(e)||l.isLeaf(e)),h=l.getPtId(e),d=l.isEntry(e)?l.findEntryWithChild(m,h):l.findEntryWithLevel(m,h),y=l.getPtId(d),v={points:[u(e,o,p.eventDataKeys)],event:r.event};c||(v.nextLevel=y);var x=s.triggerHandler(i,"plotly_"+f.type+"click",v);if(!1!==x&&t.hovermode&&(i._hoverdata=[u(e,o,p.eventDataKeys)],a.click(i,r.event)),!c&&!1!==x&&!i._dragging&&!i._transitioning){n.call("_storeDirectGUIEdit",o,t._tracePreGUI[o.uid],{level:o.level});var b={data:[{level:y}],traces:[f.index]},_={frame:{redraw:!1,duration:p.transitionTime},transition:{duration:p.transitionTime,easing:p.transitionEasing},mode:"immediate",fromcurrent:!0};a.loneUnhover(t._hoverlayer.node()),n.call("animate",i,b,_)}}))}}}),Hd=p({"src/traces/sunburst/plot.js"(e){var t=v(),r=$u(),n=(Bd(),m(Rd)).interpolate,i=Jt(),a=st(),o=At(),s=Ka(),l=s.recordMinTextSize,c=s.clearMinTextSize,u=Du(),h=br().getRotationAngle,p=u.computeTransform,d=u.transformInsideText,f=Ud().styleOne,g=Qa().resizeText,y=qd(),x=Vu(),b=Vd();function _(s,c,u,m){var g=s._context.staticPlot,v=s._fullLayout,_=!v.uniformtext.mode&&b.hasTransition(m),k=t.select(u).selectAll("g.slice"),T=c[0],S=T.trace,A=T.hierarchy,M=b.findEntryWithLevel(A,S.level),E=b.getMaxDepth(S),C=v._size,P=S.domain,L=C.w*(P.x[1]-P.x[0]),I=C.h*(P.y[1]-P.y[0]),z=.5*Math.min(L,I),O=T.cx=C.l+C.w*(P.x[1]+P.x[0])/2,R=T.cy=C.t+C.h*(1-P.y[0])-I/2;if(!M)return k.remove();var D=null,j={};_&&k.each((function(e){j[b.getPtId(e)]={rpx0:e.rpx0,rpx1:e.rpx1,x0:e.x0,x1:e.x1,transform:e.transform},!D&&b.isEntry(e)&&(D=e)}));var F=function(e){return r.partition().size([2*Math.PI,e.height+1])(e)}(M).descendants(),B=M.height+1,N=0,U=E;T.hasMultipleRoots&&b.isHierarchyRoot(M)&&(F=F.slice(1),B-=1,N=1,U+=1),F=F.filter((function(e){return e.y1<=U}));var V=h(S.rotation);V&&F.forEach((function(e){e.x0+=V,e.x1+=V}));var q=Math.min(B,E),H=function(e){return(e-N)/q*z},G=function(e,t){return[e*Math.cos(t),-e*Math.sin(t)]},W=function(e){return a.pathAnnulus(e.rpx0,e.rpx1,e.x0,e.x1,O,R)},$=function(e){return O+w(e)[0]*(e.transform.rCenter||0)+(e.transform.x||0)},Z=function(e){return R+w(e)[1]*(e.transform.rCenter||0)+(e.transform.y||0)};(k=k.data(F,b.getPtId)).enter().append("g").classed("slice",!0),_?k.exit().transition().each((function(){var e=t.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var t=function(e){var t,r=b.getPtId(e),i=j[r],a=j[b.getPtId(M)];if(a){var o=(e.x1>a.x1?2*Math.PI:0)+V;t=e.rpx1<a.rpx1?{x0:e.x0,x1:e.x1,rpx0:0,rpx1:0}:{x0:o,x1:o,rpx0:e.rpx0,rpx1:e.rpx1}}else{var s,l=b.getPtId(e.parent);k.each((function(e){if(b.getPtId(e)===l)return s=e}));var c,u=s.children;u.forEach((function(e,t){if(b.getPtId(e)===r)return c=t}));var h=u.length,p=n(s.x0,s.x1);t={rpx0:z,rpx1:z,x0:p(c/h),x1:p((c+1)/h)}}return n(i,t)}(e);return function(e){return W(t(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():k.exit().remove(),k.order();var X=null;if(_&&D){var Y=b.getPtId(D);k.each((function(e){null===X&&b.getPtId(e)===Y&&(X=e.x1)}))}var K=k;function J(e){var t=e.parent,r=j[b.getPtId(t)],i={};if(r){var a=t.children,o=a.indexOf(e),s=a.length,l=n(r.x0,r.x1);i.x0=l(o/s),i.x1=l(o/s)}else i.x0=i.x1=0;return i}_&&(K=K.transition().each("end",(function(){var e=t.select(this);b.setSliceCursor(e,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:!1})}))),K.each((function(r){var u=t.select(this),h=a.ensureSingle(u,"path","surface",(function(e){e.style("pointer-events",g?"none":"all")}));r.rpx0=H(r.y0),r.rpx1=H(r.y1),r.xmid=(r.x0+r.x1)/2,r.pxmid=G(r.rpx1,r.xmid),r.midangle=-(r.xmid-Math.PI/2),r.startangle=-(r.x0-Math.PI/2),r.stopangle=-(r.x1-Math.PI/2),r.halfangle=.5*Math.min(a.angleDelta(r.x0,r.x1)||Math.PI,Math.PI),r.ring=1-r.rpx0/r.rpx1,r.rInscribed=function(e){return 0===e.rpx0&&a.isFullCircle([e.x0,e.x1])?1:Math.max(0,Math.min(1/(1+1/Math.sin(e.halfangle)),e.ring/2))}(r),_?h.transition().attrTween("d",(function(e){var t=function(e){var t,r=j[b.getPtId(e)],i={x0:e.x0,x1:e.x1,rpx0:e.rpx0,rpx1:e.rpx1};if(r)t=r;else if(D)if(e.parent)if(X){var o=(e.x1>X?2*Math.PI:0)+V;t={x0:o,x1:o}}else t={rpx0:z,rpx1:z},a.extendFlat(t,J(e));else t={rpx0:0,rpx1:0};else t={x0:V,x1:V};return n(t,i)}(e);return function(e){return W(t(e))}})):h.attr("d",W),u.call(y,M,s,c,{eventDataKeys:x.eventDataKeys,transitionTime:x.CLICK_TRANSITION_TIME,transitionEasing:x.CLICK_TRANSITION_EASING}).call(b.setSliceCursor,s,{hideOnRoot:!0,hideOnLeaves:!0,isTransitioning:s._transitioning}),h.call(f,r,S,s);var m=a.ensureSingle(u,"g","slicetext"),w=a.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),k=a.ensureUniformFontSize(s,b.determineTextFont(S,r,v.font));w.text(e.formatSliceLabel(r,M,S,c,v)).classed("slicetext",!0).attr("text-anchor","middle").call(i.font,k).call(o.convertToTspans,s);var A=i.bBox(w.node());r.transform=d(A,r,T),r.transform.targetX=$(r),r.transform.targetY=Z(r);var E=function(e,t){var r=e.transform;return p(r,t),r.fontSize=k.size,l(S.type,r,v),a.getTextTransform(r)};_?w.transition().attrTween("transform",(function(e){var t=function(e){var t,r=j[b.getPtId(e)],i=e.transform;if(r)t=r;else if(t={rpx1:e.rpx1,transform:{textPosAngle:i.textPosAngle,scale:0,rotate:i.rotate,rCenter:i.rCenter,x:i.x,y:i.y}},D)if(e.parent)if(X){var o=e.x1>X?2*Math.PI:0;t.x0=t.x1=o}else a.extendFlat(t,J(e));else t.x0=t.x1=V;else t.x0=t.x1=V;var s=n(t.transform.textPosAngle,e.transform.textPosAngle),c=n(t.rpx1,e.rpx1),u=n(t.x0,e.x0),h=n(t.x1,e.x1),p=n(t.transform.scale,i.scale),d=n(t.transform.rotate,i.rotate),f=0===i.rCenter?3:0===t.transform.rCenter?1/3:1,m=n(t.transform.rCenter,i.rCenter),g=function(e){return m(Math.pow(e,f))};return function(e){var t=c(e),r=u(e),n=h(e),a=g(e),o={pxmid:G(t,(r+n)/2),rpx1:t,transform:{textPosAngle:s(e),rCenter:a,x:i.x,y:i.y}};return l(S.type,i,v),{transform:{targetX:$(o),targetY:Z(o),scale:p(e),rotate:d(e),rCenter:a}}}}(e);return function(e){return E(t(e),A)}})):w.attr("transform",E(r,A))}))}function w(e){return t=e.rpx1,r=e.transform.textPosAngle,[t*Math.sin(r),-t*Math.cos(r)];var t,r}e.plot=function(e,r,n,i){var a,o,s=e._fullLayout,l=s._sunburstlayer,u=!n,h=!s.uniformtext.mode&&b.hasTransition(n);c("sunburst",s),(a=l.selectAll("g.trace.sunburst").data(r,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed("sunburst",!0).attr("stroke-linejoin","round"),a.order(),h?(i&&(o=i()),t.transition().duration(n.duration).ease(n.easing).each("end",(function(){o&&o()})).each("interrupt",(function(){o&&o()})).each((function(){l.selectAll("g.trace").each((function(t){_(e,t,this,n)}))}))):(a.each((function(t){_(e,t,this,n)})),s.uniformtext.mode&&g(e,s._sunburstlayer.selectAll(".trace"),"sunburst")),u&&a.exit().remove()},e.formatSliceLabel=function(e,t,r,n,i){var o=r.texttemplate,s=r.textinfo;if(!o&&(!s||"none"===s))return"";var l=i.separators,c=n[0],u=e.data.data,h=c.hierarchy,p=b.isHierarchyRoot(e),d=b.getParent(h,e),f=b.getValue(e);if(!o){var m,g=s.split("+"),y=function(e){return-1!==g.indexOf(e)},v=[];if(y("label")&&u.label&&v.push(u.label),u.hasOwnProperty("v")&&y("value")&&v.push(b.formatValue(u.v,l)),!p){y("current path")&&v.push(b.getPath(e.data));var x=0;y("percent parent")&&x++,y("percent entry")&&x++,y("percent root")&&x++;var _=x>1;if(x){var w,k=function(e){m=b.formatPercent(w,l),_&&(m+=" of "+e),v.push(m)};y("percent parent")&&!p&&(w=f/b.getValue(d),k("parent")),y("percent entry")&&(w=f/b.getValue(t),k("entry")),y("percent root")&&(w=f/b.getValue(h),k("root"))}}return y("text")&&(m=a.castOption(r,u.i,"text"),a.isValidTextValue(m)&&v.push(m)),v.join("<br>")}var T=a.castOption(r,u.i,"texttemplate");if(!T)return"";var S={};u.label&&(S.label=u.label),u.hasOwnProperty("v")&&(S.value=u.v,S.valueLabel=b.formatValue(u.v,l)),S.currentPath=b.getPath(e.data),p||(S.percentParent=f/b.getValue(d),S.percentParentLabel=b.formatPercent(S.percentParent,l),S.parent=b.getPtLabel(d)),S.percentEntry=f/b.getValue(t),S.percentEntryLabel=b.formatPercent(S.percentEntry,l),S.entry=b.getPtLabel(t),S.percentRoot=f/b.getValue(h),S.percentRootLabel=b.formatPercent(S.percentRoot,l),S.root=b.getPtLabel(h),u.hasOwnProperty("color")&&(S.color=u.color);var A=a.castOption(r,u.i,"text");return(a.isValidTextValue(A)||""===A)&&(S.text=A),S.customdata=a.castOption(r,u.i,"customdata"),a.texttemplateString(T,S,i._d3locale,S,r._meta||{})}}}),Gd=p({"src/traces/sunburst/index.js"(e,t){t.exports={moduleType:"trace",name:"sunburst",basePlotModule:Uu(),categories:[],animatable:!0,attributes:qu(),layoutAttributes:Hu(),supplyDefaults:Gu(),supplyLayoutDefaults:Wu(),calc:Zu().calc,crossTraceCalc:Zu().crossTraceCalc,plot:Hd().plot,style:Ud().style,colorbar:pi(),meta:{}}}}),Wd=p({"lib/sunburst.js"(e,t){t.exports=Gd()}}),$d=p({"src/traces/treemap/base_plot.js"(e){var t=kt();e.name="treemap",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Zd=p({"src/traces/treemap/constants.js"(e,t){t.exports={CLICK_TRANSITION_TIME:750,CLICK_TRANSITION_EASING:"poly",eventDataKeys:["currentPath","root","entry","percentRoot","percentEntry","percentParent"],gapWithPathbar:1}}}),Xd=p({"src/traces/treemap/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=Lt(),a=ka().attributes,o=Pu(),s=qu(),l=Zd(),c=R().extendFlat,u=Ie().pattern;t.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{packing:{valType:"enumerated",values:["squarify","binary","dice","slice","slice-dice","dice-slice"],dflt:"squarify",editType:"plot"},squarifyratio:{valType:"number",min:1,dflt:1,editType:"plot"},flip:{valType:"flaglist",flags:["x","y"],dflt:"",editType:"plot"},pad:{valType:"number",min:0,dflt:3,editType:"plot"},editType:"calc"},marker:c({pad:{t:{valType:"number",min:0,editType:"plot"},l:{valType:"number",min:0,editType:"plot"},r:{valType:"number",min:0,editType:"plot"},b:{valType:"number",min:0,editType:"plot"},editType:"calc"},colors:s.marker.colors,pattern:u,depthfade:{valType:"enumerated",values:[!0,!1,"reversed"],editType:"style"},line:s.marker.line,cornerradius:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),pathbar:{visible:{valType:"boolean",dflt:!0,editType:"plot"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},edgeshape:{valType:"enumerated",values:[">","<","|","/","\\"],dflt:">",editType:"plot"},thickness:{valType:"number",min:12,editType:"plot"},textfont:c({},o.textfont,{}),editType:"calc"},text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:l.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:l.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:c({},o.outsidetextfont,{}),textposition:{valType:"enumerated",values:["top left","top center","top right","middle left","middle center","middle right","bottom left","bottom center","bottom right"],dflt:"top left",editType:"plot"},sort:o.sort,root:s.root,domain:a({name:"treemap",trace:!0,editType:"calc"})}}}),Yd=p({"src/traces/treemap/layout_attributes.js"(e,t){t.exports={treemapcolorway:{valType:"colorlist",editType:"calc"},extendtreemapcolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Kd=p({"src/traces/treemap/defaults.js"(e,t){var r=st(),n=Xd(),i=q(),a=ka().defaults,o=$a().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Wt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,p){function d(i,a){return r.coerce(e,t,n,i,a)}var f=d("labels"),m=d("parents");if(f&&f.length&&m&&m.length){var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),"squarify"===d("tiling.packing")&&d("tiling.squarifyratio"),d("tiling.flip"),d("tiling.pad");var y=d("text");d("texttemplate"),t.texttemplate||d("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),d("hovertext"),d("hovertemplate");var v=d("pathbar.visible");o(e,t,p,d,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition");var x=-1!==t.textposition.indexOf("bottom");l(e,t,p,d),(t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis)?h(e,t,p,d,{prefix:"marker.",cLetter:"c"}):d("marker.depthfade",!(t.marker.colors||[]).length);var b=2*t.textfont.size;d("marker.pad.t",x?b/4:b),d("marker.pad.l",b/4),d("marker.pad.r",b/4),d("marker.pad.b",x?b:b/4),d("marker.cornerradius"),t._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(d("pathbar.thickness",t.pathbar.textfont.size+2*s),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),a(t,p,d),t._length=null}else t.visible=!1}}}),Jd=p({"src/traces/treemap/layout_defaults.js"(e,t){var r=st(),n=Yd();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("treemapcolorway",t.colorway),i("extendtreemapcolors")}}}),Qd=p({"src/traces/treemap/calc.js"(e){var t=Zu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("treemap",e)}}}),ef=p({"src/traces/treemap/flip_tree.js"(e,t){t.exports=function e(t,r,n){var i;n.swapXY&&(i=t.x0,t.x0=t.y0,t.y0=i,i=t.x1,t.x1=t.y1,t.y1=i),n.flipX&&(i=t.x0,t.x0=r[0]-t.x1,t.x1=r[0]-i),n.flipY&&(i=t.y0,t.y0=r[1]-t.y1,t.y1=r[1]-i);var a=t.children;if(a)for(var o=0;o<a.length;o++)e(a[o],r,n)}}}),tf=p({"src/traces/treemap/partition.js"(e,t){var r=$u(),n=ef();t.exports=function(e,t,i){var a,o=i.flipX,s=i.flipY,l="dice-slice"===i.packing,c=i.pad[s?"bottom":"top"],u=i.pad[o?"right":"left"],h=i.pad[o?"left":"right"],p=i.pad[s?"top":"bottom"];l&&(a=u,u=c,c=a,a=h,h=p,p=a);var d=r.treemap().tile(function(e,t){switch(e){case"squarify":return r.treemapSquarify.ratio(t);case"binary":return r.treemapBinary;case"dice":return r.treemapDice;case"slice":return r.treemapSlice;default:return r.treemapSliceDice}}(i.packing,i.squarifyratio)).paddingInner(i.pad.inner).paddingLeft(u).paddingRight(h).paddingTop(c).paddingBottom(p).size(l?[t[1],t[0]]:t)(e);return(l||o||s)&&n(d,t,{swapXY:l,flipX:o,flipY:s}),d}}}),rf=p({"src/traces/treemap/style.js"(e,t){var r=v(),n=q(),i=st(),a=Vd(),o=Ka().resizeText,s=Nd();function l(e,t,r,o,l){var c,u,h=(l||{}).hovered,p=t.data.data,d=p.i,f=p.color,m=a.isHierarchyRoot(t),g=1;if(h)c=r._hovered.marker.line.color,u=r._hovered.marker.line.width;else if(m&&f===r.root.color)g=100,c="rgba(0,0,0,0)",u=0;else if(c=i.castOption(r,d,"marker.line.color")||n.defaultLine,u=i.castOption(r,d,"marker.line.width")||0,!r._hasColorscale&&!t.onPathbar){var y=r.marker.depthfade;if(y){var v,x=n.combine(n.addOpacity(r._backgroundColor,.75),f);if(!0===y){var b=a.getMaxDepth(r);v=isFinite(b)?a.isLeaf(t)?0:r._maxVisibleLayers-(t.data.depth-r._entryDepth):t.data.height+1}else v=t.data.depth-r._entryDepth,r._atRootLevel||v++;if(v>0)for(var _=0;_<v;_++){var w=.5*_/v;f=n.combine(n.addOpacity(x,w),f)}}}e.call(s,t,r,o,f).style("stroke-width",u).call(n.stroke,c).style("opacity",g)}t.exports={style:function(e){var t=e._fullLayout._treemaplayer.selectAll(".trace");o(e,t,"treemap"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(l,t,i,e,{hovered:!1})}))}))},styleOne:l}}}),nf=p({"src/traces/treemap/draw_ancestors.js"(e,t){var r=v(),n=st(),i=Jt(),a=At(),o=tf(),s=rf().styleOne,l=Zd(),c=Vd(),u=qd(),h=!0;t.exports=function(e,t,p,d,f){var m=f.barDifY,g=f.width,y=f.height,v=f.viewX,x=f.viewY,b=f.pathSlice,_=f.toMoveInsideSlice,w=f.strTransform,k=f.hasTransition,T=f.handleSlicesExit,S=f.makeUpdateSliceInterpolator,A=f.makeUpdateTextInterpolator,M={},E=e._context.staticPlot,C=e._fullLayout,P=t[0],L=P.trace,I=P.hierarchy,z=g/L._entryDepth,O=c.listPath(p.data,"id"),R=o(I.copy(),[g,y],{packing:"dice",pad:{inner:0,top:0,left:0,right:0,bottom:0}}).descendants();(R=R.filter((function(e){var t=O.indexOf(e.data.id);return-1!==t&&(e.x0=z*t,e.x1=z*(t+1),e.y0=m,e.y1=m+y,e.onPathbar=!0,!0)}))).reverse(),(d=d.data(R,c.getPtId)).enter().append("g").classed("pathbar",!0),T(d,h,M,[g,y],b),d.order();var D=d;k&&(D=D.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:!1})}))),D.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-Math.min(g,y)/2),o._hoverY=x(o.y1-y/2);var d=r.select(this),f=n.ensureSingle(d,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));k?f.transition().attrTween("d",(function(e){var t=S(e,h,M,[g,y]);return function(e){return b(t(e))}})):f.attr("d",b),d.call(u,p,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{hideOnRoot:!1,hideOnLeaves:!1,isTransitioning:e._transitioning}),f.call(s,o,L,e,{hovered:!1}),o._text=(c.getPtLabel(o)||"").split("<br>").join(" ")||"";var m=n.ensureSingle(d,"g","slicetext"),T=n.ensureSingle(m,"text","",(function(e){e.attr("data-notex",1)})),P=n.ensureUniformFontSize(e,c.determineTextFont(L,o,C.font,{onPathbar:!0}));T.text(o._text||" ").classed("slicetext",!0).attr("text-anchor","start").call(i.font,P).call(a.convertToTspans,e),o.textBB=i.bBox(T.node()),o.transform=_(o,{fontSize:P.size,onPathbar:!0}),o.transform.fontSize=P.size,k?T.transition().attrTween("transform",(function(e){var t=A(e,h,M,[g,y]);return function(e){return w(t(e))}})):T.attr("transform",w(o))}))}}}),af=p({"src/traces/treemap/plot_one.js"(e,t){var r=v(),n=(Bd(),m(Rd)).interpolate,i=Vd(),a=st(),o=qa().TEXTPAD,s=eo().toMoveInsideBar,l=Ka().recordMinTextSize,c=Zd(),u=nf();function h(e){return i.isHierarchyRoot(e)?"":i.getPtId(e)}t.exports=function(e,t,p,d,f){var m=e._fullLayout,g=t[0],y=g.trace,v="icicle"===y.type,x=g.hierarchy,b=i.findEntryWithLevel(x,y.level),_=r.select(p),w=_.selectAll("g.pathbar"),k=_.selectAll("g.slice");if(!b)return w.remove(),void k.remove();var T=i.isHierarchyRoot(b),S=!m.uniformtext.mode&&i.hasTransition(d),A=i.getMaxDepth(y),M=m._size,E=y.domain,C=M.w*(E.x[1]-E.x[0]),P=M.h*(E.y[1]-E.y[0]),L=C,I=y.pathbar.thickness,z=y.marker.line.width+c.gapWithPathbar,O=y.pathbar.visible?y.pathbar.side.indexOf("bottom")>-1?P+z:-(I+z):0,R={x0:L,x1:L,y0:O,y1:O+I},D=function(e,t,r){var n=y.tiling.pad,i=function(e){return e-n<=t.x0},a=function(e){return e+n>=t.x1},o=function(e){return e-n<=t.y0},s=function(e){return e+n>=t.y1};return e.x0===t.x0&&e.x1===t.x1&&e.y0===t.y0&&e.y1===t.y1?{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1}:{x0:i(e.x0-n)?0:a(e.x0-n)?r[0]:e.x0,x1:i(e.x1+n)?0:a(e.x1+n)?r[0]:e.x1,y0:o(e.y0-n)?0:s(e.y0-n)?r[1]:e.y0,y1:o(e.y1+n)?0:s(e.y1+n)?r[1]:e.y1}},j=null,F={},B={},N=null,U=function(e,t){return t?F[h(e)]:B[h(e)]},V=function(e,t,r,n){if(t)return F[h(x)]||R;var i=B[y.level]||r;return function(e){return e.data.depth-b.data.depth<A}(e)?D(e,i,n):{}};g.hasMultipleRoots&&T&&A++,y._maxDepth=A,y._backgroundColor=m.paper_bgcolor,y._entryDepth=b.data.depth,y._atRootLevel=T;var q=-C/2+M.l+M.w*(E.x[1]+E.x[0])/2,H=-P/2+M.t+M.h*(1-(E.y[1]+E.y[0])/2),G=function(e){return q+e},W=function(e){return H+e},$=W(0),Z=G(0),X=function(e){return Z+e},Y=function(e){return $+e};function K(e,t){return e+","+t}var J=X(0),Q=function(e){e.x=Math.max(J,e.x)},ee=y.pathbar.edgeshape,te=y[v?"tiling":"marker"].pad,re=function(e){return-1!==y.textposition.indexOf(e)},ne=re("top"),ie=re("left"),ae=re("right"),oe=re("bottom"),se=function(e,t){var r=e.x0,n=e.x1,i=e.y0,a=e.y1,c=e.textBB,u=ne||t.isHeader&&!oe?"start":oe?"end":"middle",h=re("right"),p=re("left")||t.onPathbar?-1:h?1:0;if(t.isHeader){if((r+=(v?te:te.l)-o)>=(n-=(v?te:te.r)-o)){var d=(r+n)/2;r=d,n=d}var f;oe?i<(f=a-(v?te:te.b))&&f<a&&(i=f):i<(f=i+(v?te:te.t))&&f<a&&(a=f)}var g=s(r,n,i,a,c,{isHorizontal:!1,constrained:!0,angle:0,anchor:u,leftToRight:p});return g.fontSize=t.fontSize,g.targetX=G(g.targetX),g.targetY=W(g.targetY),isNaN(g.targetX)||isNaN(g.targetY)?{}:(r!==n&&i!==a&&l(y.type,g,m),{scale:g.scale,rotate:g.rotate,textX:g.textX,textY:g.textY,anchorX:g.anchorX,anchorY:g.anchorY,targetX:g.targetX,targetY:g.targetY})},le=function(e,t){for(var r,n=0,i=e;!r&&n<A;)n++,(i=i.parent)?r=U(i,t):n=A;return r||{}},ce=function(e,t,r,i,o){var s,l=U(e,t);if(l)s=l;else if(t)s=R;else if(j)if(e.parent){var c=N||r;c&&!t?s=D(e,c,i):(s={},a.extendFlat(s,le(e,t)))}else s=a.extendFlat({},e),v&&("h"===o.orientation?o.flipX?s.x0=e.x1:s.x1=0:o.flipY?s.y0=e.y1:s.y1=0);else s={};return n(s,{x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})},ue=function(e,t,r,o){var s=U(e,t),c={},u=V(e,t,r,o);a.extendFlat(c,{transform:se({x0:u.x0,x1:u.x1,y0:u.y0,y1:u.y1,textBB:e.textBB,_text:e._text},{isHeader:i.isHeader(e,y)})}),s?c=s:e.parent&&a.extendFlat(c,le(e,t));var h=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&l(y.type,h,m),n(c,{transform:{scale:h.scale,rotate:h.rotate,textX:h.textX,textY:h.textY,anchorX:h.anchorX,anchorY:h.anchorY,targetX:h.targetX,targetY:h.targetY}})},he=function(e,t,i,a,o){var s=a[0],l=a[1];S?e.exit().transition().each((function(){var e=r.select(this);e.select("path.surface").transition().attrTween("d",(function(e){var r=function(e,t,r,i){var a,o=U(e,t);if(t)a=R;else{var s=U(b,t);a=s?D(e,s,i):{}}return n(o,a)}(e,t,0,[s,l]);return function(e){return o(r(e))}})),e.select("g.slicetext").attr("opacity",0)})).remove():e.exit().remove()},pe=function(e){var t=e.transform;return e.x0!==e.x1&&e.y0!==e.y1&&l(y.type,t,m),a.getTextTransform({textX:t.textX,textY:t.textY,anchorX:t.anchorX,anchorY:t.anchorY,targetX:t.targetX,targetY:t.targetY,scale:t.scale,rotate:t.rotate})};S&&(w.each((function(e){F[h(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(F[h(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate})})),k.each((function(e){B[h(e)]={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},e.transform&&(B[h(e)].transform={textX:e.transform.textX,textY:e.transform.textY,anchorX:e.transform.anchorX,anchorY:e.transform.anchorY,targetX:e.transform.targetX,targetY:e.transform.targetY,scale:e.transform.scale,rotate:e.transform.rotate}),!j&&i.isEntry(e)&&(j=e)}))),N=f(e,t,b,k,{width:C,height:P,viewX:G,viewY:W,pathSlice:function(e){var t=G(e.x0),r=G(e.x1),n=W(e.y0),i=W(e.y1),a=r-t,o=i-n;if(!a||!o)return"";var s=y.marker.cornerradius||0,l=Math.min(s,a/2,o/2);l&&e.data&&e.data.data&&e.data.data.label&&(ne&&(l=Math.min(l,te.t)),ie&&(l=Math.min(l,te.l)),ae&&(l=Math.min(l,te.r)),oe&&(l=Math.min(l,te.b)));var c=function(e,t){return l?"a"+K(l,l)+" 0 0 1 "+K(e,t):""};return"M"+K(t,n+l)+c(l,-l)+"L"+K(r-l,n)+c(l,l)+"L"+K(r,i-l)+c(-l,l)+"L"+K(t+l,i)+c(-l,-l)+"Z"},toMoveInsideSlice:se,prevEntry:j,makeUpdateSliceInterpolator:ce,makeUpdateTextInterpolator:ue,handleSlicesExit:he,hasTransition:S,strTransform:pe}),y.pathbar.visible?u(e,t,b,w,{barDifY:O,width:L,height:I,viewX:X,viewY:Y,pathSlice:function(e){var t=X(Math.max(Math.min(e.x0,e.x0),0)),r=X(Math.min(Math.max(e.x1,e.x1),L)),n=Y(e.y0),i=Y(e.y1),a=I/2,o={},s={};o.x=t,s.x=r,o.y=s.y=(n+i)/2;var l={x:t,y:n},c={x:r,y:n},u={x:r,y:i},h={x:t,y:i};return">"===ee?(l.x-=a,c.x-=a,u.x-=a,h.x-=a):"/"===ee?(u.x-=a,h.x-=a,o.x-=a/2,s.x-=a/2):"\\"===ee?(l.x-=a,c.x-=a,o.x-=a/2,s.x-=a/2):"<"===ee&&(o.x-=a,s.x-=a),Q(l),Q(h),Q(o),Q(c),Q(u),Q(s),"M"+K(l.x,l.y)+"L"+K(c.x,c.y)+"L"+K(s.x,s.y)+"L"+K(u.x,u.y)+"L"+K(h.x,h.y)+"L"+K(o.x,o.y)+"Z"},toMoveInsideSlice:se,makeUpdateSliceInterpolator:ce,makeUpdateTextInterpolator:ue,handleSlicesExit:he,hasTransition:S,strTransform:pe}):w.remove()}}}),of=p({"src/traces/treemap/draw.js"(e,t){var r=v(),n=Vd(),i=Ka().clearMinTextSize,a=Qa().resizeText,o=af();t.exports=function(e,t,s,l,c){var u,h,p=c.type,d=c.drawDescendants,f=e._fullLayout,m=f["_"+p+"layer"],g=!s;i(p,f),(u=m.selectAll("g.trace."+p).data(t,(function(e){return e[0].trace.uid}))).enter().append("g").classed("trace",!0).classed(p,!0),u.order(),!f.uniformtext.mode&&n.hasTransition(s)?(l&&(h=l()),r.transition().duration(s.duration).ease(s.easing).each("end",(function(){h&&h()})).each("interrupt",(function(){h&&h()})).each((function(){m.selectAll("g.trace").each((function(t){o(e,t,this,s,d)}))}))):(u.each((function(t){o(e,t,this,s,d)})),f.uniformtext.mode&&a(e,m.selectAll(".trace"),p)),g&&u.exit().remove()}}}),sf=p({"src/traces/treemap/draw_descendants.js"(e,t){var r=v(),n=st(),i=Jt(),a=At(),o=tf(),s=rf().styleOne,l=Zd(),c=Vd(),u=qd(),h=Hd().formatSliceLabel,p=!1;t.exports=function(e,t,d,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),z=-1!==P.textposition.indexOf("bottom"),O=!z&&!P.marker.pad.t||z&&!P.marker.pad.b,R=o(d,[g,y],{packing:P.tiling.packing,squarifyratio:P.tiling.squarifyratio,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,pad:{inner:P.tiling.pad,top:P.marker.pad.t,left:P.marker.pad.l,right:P.marker.pad.r,bottom:P.marker.pad.b}}).descendants(),D=1/0,j=-1/0;R.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(D=Math.min(D,t),j=Math.max(j,t))})),f=f.data(R,c.getPtId),P._maxVisibleLayers=isFinite(j)?j-D+1:0,f.enter().append("g").classed("slice",!0),T(f,p,{},[g,y],b),f.order();var F=null;if(k&&M){var B=c.getPtId(M);f.each((function(e){null===F&&c.getPtId(e)===B&&(F={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var N=function(){return F||{x0:0,x1:g,y0:0,y1:y}},U=f;return k&&(U=U.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),U.each((function(o){var f=c.isHeader(o,P);o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-P.marker.pad.r),o._hoverY=x(z?o.y1-P.marker.pad.b/2:o.y0+P.marker.pad.t/2);var m=r.select(this),T=n.ensureSingle(m,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));k?T.transition().attrTween("d",(function(e){var t=S(e,p,N(),[g,y]);return function(e){return b(t(e))}})):T.attr("d",b),m.call(u,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),T.call(s,o,P,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=f?O?"":c.getPtLabel(o)||"":h(o,d,P,t,C)||"";var M=n.ensureSingle(m,"g","slicetext"),R=n.ensureSingle(M,"text","",(function(e){e.attr("data-notex",1)})),D=n.ensureUniformFontSize(e,c.determineTextFont(P,o,C.font)),j=o._text||" ",F=f&&-1===j.indexOf("<br>");R.text(j).classed("slicetext",!0).attr("text-anchor",I?"end":L||F?"start":"middle").call(i.font,D).call(a.convertToTspans,e),o.textBB=i.bBox(R.node()),o.transform=_(o,{fontSize:D.size,isHeader:f}),o.transform.fontSize=D.size,k?R.transition().attrTween("transform",(function(e){var t=A(e,p,N(),[g,y]);return function(e){return w(t(e))}})):R.attr("transform",w(o))})),F}}}),lf=p({"src/traces/treemap/plot.js"(e,t){var r=of(),n=sf();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"treemap",drawDescendants:n})}}}),cf=p({"src/traces/treemap/index.js"(e,t){t.exports={moduleType:"trace",name:"treemap",basePlotModule:$d(),categories:[],animatable:!0,attributes:Xd(),layoutAttributes:Yd(),supplyDefaults:Kd(),supplyLayoutDefaults:Jd(),calc:Qd().calc,crossTraceCalc:Qd().crossTraceCalc,plot:lf(),style:rf().style,colorbar:pi(),meta:{}}}}),uf=p({"lib/treemap.js"(e,t){t.exports=cf()}}),hf=p({"src/traces/icicle/base_plot.js"(e){var t=kt();e.name="icicle",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),pf=p({"src/traces/icicle/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=Lt(),a=ka().attributes,o=Pu(),s=qu(),l=Xd(),c=Zd(),u=R().extendFlat,h=Ie().pattern;t.exports={labels:s.labels,parents:s.parents,values:s.values,branchvalues:s.branchvalues,count:s.count,level:s.level,maxdepth:s.maxdepth,tiling:{orientation:{valType:"enumerated",values:["v","h"],dflt:"h",editType:"plot"},flip:l.tiling.flip,pad:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},marker:u({colors:s.marker.colors,line:s.marker.line,pattern:h,editType:"calc"},i("marker",{colorAttr:"colors",anim:!1})),leaf:s.leaf,pathbar:l.pathbar,text:o.text,textinfo:s.textinfo,texttemplate:n({editType:"plot"},{keys:c.eventDataKeys.concat(["label","value"])}),hovertext:o.hovertext,hoverinfo:s.hoverinfo,hovertemplate:r({},{keys:c.eventDataKeys}),textfont:o.textfont,insidetextfont:o.insidetextfont,outsidetextfont:l.outsidetextfont,textposition:l.textposition,sort:o.sort,root:s.root,domain:a({name:"icicle",trace:!0,editType:"calc"})}}}),df=p({"src/traces/icicle/layout_attributes.js"(e,t){t.exports={iciclecolorway:{valType:"colorlist",editType:"calc"},extendiciclecolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),ff=p({"src/traces/icicle/defaults.js"(e,t){var r=st(),n=pf(),i=q(),a=ka().defaults,o=$a().handleText,s=qa().TEXTPAD,l=Lu().handleMarkerDefaults,c=Wt(),u=c.hasColorscale,h=c.handleDefaults;t.exports=function(e,t,c,p){function d(i,a){return r.coerce(e,t,n,i,a)}var f=d("labels"),m=d("parents");if(f&&f.length&&m&&m.length){var g=d("values");g&&g.length?d("branchvalues"):d("count"),d("level"),d("maxdepth"),d("tiling.orientation"),d("tiling.flip"),d("tiling.pad");var y=d("text");d("texttemplate"),t.texttemplate||d("textinfo",r.isArrayOrTypedArray(y)?"text+label":"label"),d("hovertext"),d("hovertemplate");var v=d("pathbar.visible");o(e,t,p,d,"auto",{hasPathbar:v,moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1}),d("textposition"),l(e,t,p,d);var x=t._hasColorscale=u(e,"marker","colors")||(e.marker||{}).coloraxis;x&&h(e,t,p,d,{prefix:"marker.",cLetter:"c"}),d("leaf.opacity",x?1:.7),t._hovered={marker:{line:{width:2,color:i.contrast(p.paper_bgcolor)}}},v&&(d("pathbar.thickness",t.pathbar.textfont.size+2*s),d("pathbar.side"),d("pathbar.edgeshape")),d("sort"),d("root.color"),a(t,p,d),t._length=null}else t.visible=!1}}}),mf=p({"src/traces/icicle/layout_defaults.js"(e,t){var r=st(),n=df();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("iciclecolorway",t.colorway),i("extendiciclecolors")}}}),gf=p({"src/traces/icicle/calc.js"(e){var t=Zu();e.calc=function(e,r){return t.calc(e,r)},e.crossTraceCalc=function(e){return t._runCrossTraceCalc("icicle",e)}}}),yf=p({"src/traces/icicle/partition.js"(e,t){var r=$u(),n=ef();t.exports=function(e,t,i){var a=i.flipX,o=i.flipY,s="h"===i.orientation,l=i.maxDepth,c=t[0],u=t[1];l&&(c=(e.height+1)*t[0]/Math.min(e.height+1,l),u=(e.height+1)*t[1]/Math.min(e.height+1,l));var h=r.partition().padding(i.pad.inner).size(s?[t[1],c]:[t[0],u])(e);return(s||a||o)&&n(h,t,{swapXY:s,flipX:a,flipY:o}),h}}}),vf=p({"src/traces/icicle/style.js"(e,t){var r=v(),n=q(),i=st(),a=Ka().resizeText,o=Nd();function s(e,t,r,a){var s=t.data.data,l=!t.children,c=s.i,u=i.castOption(r,c,"marker.line.color")||n.defaultLine,h=i.castOption(r,c,"marker.line.width")||0;e.call(o,t,r,a).style("stroke-width",h).call(n.stroke,u).style("opacity",l?r.leaf.opacity:null)}t.exports={style:function(e){var t=e._fullLayout._iciclelayer.selectAll(".trace");a(e,t,"icicle"),t.each((function(t){var n=r.select(this),i=t[0].trace;n.style("opacity",i.opacity),n.selectAll("path.surface").each((function(t){r.select(this).call(s,t,i,e)}))}))},styleOne:s}}}),xf=p({"src/traces/icicle/draw_descendants.js"(e,t){var r=v(),n=st(),i=Jt(),a=At(),o=yf(),s=vf().styleOne,l=Zd(),c=Vd(),u=qd(),h=Hd().formatSliceLabel,p=!1;t.exports=function(e,t,d,f,m){var g=m.width,y=m.height,v=m.viewX,x=m.viewY,b=m.pathSlice,_=m.toMoveInsideSlice,w=m.strTransform,k=m.hasTransition,T=m.handleSlicesExit,S=m.makeUpdateSliceInterpolator,A=m.makeUpdateTextInterpolator,M=m.prevEntry,E=e._context.staticPlot,C=e._fullLayout,P=t[0].trace,L=-1!==P.textposition.indexOf("left"),I=-1!==P.textposition.indexOf("right"),z=-1!==P.textposition.indexOf("bottom"),O=o(d,[g,y],{flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1,orientation:P.tiling.orientation,pad:{inner:P.tiling.pad},maxDepth:P._maxDepth}).descendants(),R=1/0,D=-1/0;O.forEach((function(e){var t=e.depth;t>=P._maxDepth?(e.x0=e.x1=(e.x0+e.x1)/2,e.y0=e.y1=(e.y0+e.y1)/2):(R=Math.min(R,t),D=Math.max(D,t))})),f=f.data(O,c.getPtId),P._maxVisibleLayers=isFinite(D)?D-R+1:0,f.enter().append("g").classed("slice",!0),T(f,p,{},[g,y],b),f.order();var j=null;if(k&&M){var F=c.getPtId(M);f.each((function(e){null===j&&c.getPtId(e)===F&&(j={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1})}))}var B=function(){return j||{x0:0,x1:g,y0:0,y1:y}},N=f;return k&&(N=N.transition().each("end",(function(){var t=r.select(this);c.setSliceCursor(t,e,{hideOnRoot:!0,hideOnLeaves:!1,isTransitioning:!1})}))),N.each((function(o){o._x0=v(o.x0),o._x1=v(o.x1),o._y0=x(o.y0),o._y1=x(o.y1),o._hoverX=v(o.x1-P.tiling.pad),o._hoverY=x(z?o.y1-P.tiling.pad/2:o.y0+P.tiling.pad/2);var f=r.select(this),m=n.ensureSingle(f,"path","surface",(function(e){e.style("pointer-events",E?"none":"all")}));k?m.transition().attrTween("d",(function(e){var t=S(e,p,B(),[g,y],{orientation:P.tiling.orientation,flipX:P.tiling.flip.indexOf("x")>-1,flipY:P.tiling.flip.indexOf("y")>-1});return function(e){return b(t(e))}})):m.attr("d",b),f.call(u,d,e,t,{styleOne:s,eventDataKeys:l.eventDataKeys,transitionTime:l.CLICK_TRANSITION_TIME,transitionEasing:l.CLICK_TRANSITION_EASING}).call(c.setSliceCursor,e,{isTransitioning:e._transitioning}),m.call(s,o,P,e,{hovered:!1}),o.x0===o.x1||o.y0===o.y1?o._text="":o._text=h(o,d,P,t,C)||"";var T=n.ensureSingle(f,"g","slicetext"),M=n.ensureSingle(T,"text","",(function(e){e.attr("data-notex",1)})),O=n.ensureUniformFontSize(e,c.determineTextFont(P,o,C.font));M.text(o._text||" ").classed("slicetext",!0).attr("text-anchor",I?"end":L?"start":"middle").call(i.font,O).call(a.convertToTspans,e),o.textBB=i.bBox(M.node()),o.transform=_(o,{fontSize:O.size}),o.transform.fontSize=O.size,k?M.transition().attrTween("transform",(function(e){var t=A(e,p,B(),[g,y]);return function(e){return w(t(e))}})):M.attr("transform",w(o))})),j}}}),bf=p({"src/traces/icicle/plot.js"(e,t){var r=of(),n=xf();t.exports=function(e,t,i,a){return r(e,t,i,a,{type:"icicle",drawDescendants:n})}}}),_f=p({"src/traces/icicle/index.js"(e,t){t.exports={moduleType:"trace",name:"icicle",basePlotModule:hf(),categories:[],animatable:!0,attributes:pf(),layoutAttributes:df(),supplyDefaults:ff(),supplyLayoutDefaults:mf(),calc:gf().calc,crossTraceCalc:gf().crossTraceCalc,plot:bf(),style:vf().style,colorbar:pi(),meta:{}}}}),wf=p({"lib/icicle.js"(e,t){t.exports=_f()}}),kf=p({"src/traces/funnelarea/base_plot.js"(e){var t=kt();e.name="funnelarea",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),Tf=p({"src/traces/funnelarea/attributes.js"(e,t){var r=Pu(),n=N(),i=ka().attributes,a=Oe().hovertemplateAttrs,o=Oe().texttemplateAttrs,s=R().extendFlat;t.exports={labels:r.labels,label0:r.label0,dlabel:r.dlabel,values:r.values,marker:{colors:r.marker.colors,line:{color:s({},r.marker.line.color,{dflt:null}),width:s({},r.marker.line.width,{dflt:1}),editType:"calc"},pattern:r.marker.pattern,editType:"calc"},text:r.text,hovertext:r.hovertext,scalegroup:s({},r.scalegroup,{}),textinfo:s({},r.textinfo,{flags:["label","text","value","percent"]}),texttemplate:o({editType:"plot"},{keys:["label","color","value","text","percent"]}),hoverinfo:s({},n.hoverinfo,{flags:["label","text","value","percent","name"]}),hovertemplate:a({},{keys:["label","color","value","text","percent"]}),textposition:s({},r.textposition,{values:["inside","none"],dflt:"inside"}),textfont:r.textfont,insidetextfont:r.insidetextfont,title:{text:r.title.text,font:r.title.font,position:s({},r.title.position,{values:["top left","top center","top right"],dflt:"top center"}),editType:"plot"},domain:i({name:"funnelarea",trace:!0,editType:"calc"}),aspectratio:{valType:"number",min:0,dflt:1,editType:"plot"},baseratio:{valType:"number",min:0,max:1,dflt:.333,editType:"plot"}}}}),Sf=p({"src/traces/funnelarea/layout_attributes.js"(e,t){var r=Iu().hiddenlabels;t.exports={hiddenlabels:r,funnelareacolorway:{valType:"colorlist",editType:"calc"},extendfunnelareacolors:{valType:"boolean",dflt:!0,editType:"calc"}}}}),Af=p({"src/traces/funnelarea/defaults.js"(e,t){var r=st(),n=Tf(),i=ka().defaults,a=$a().handleText,o=Lu().handleLabelsAndValues,s=Lu().handleMarkerDefaults;t.exports=function(e,t,l,c){function u(i,a){return r.coerce(e,t,n,i,a)}var h=u("labels"),p=u("values"),d=o(h,p),f=d.len;if(t._hasLabels=d.hasLabels,t._hasValues=d.hasValues,!t._hasLabels&&t._hasValues&&(u("label0"),u("dlabel")),f){t._length=f,s(e,t,c,u),u("scalegroup");var m,g=u("text"),y=u("texttemplate");if(y||(m=u("textinfo",Array.isArray(g)?"text+percent":"percent")),u("hovertext"),u("hovertemplate"),y||m&&"none"!==m){var v=u("textposition");a(e,t,c,u,v,{moduleHasSelected:!1,moduleHasUnselected:!1,moduleHasConstrain:!1,moduleHasCliponaxis:!1,moduleHasTextangle:!1,moduleHasInsideanchor:!1})}else"none"===m&&u("textposition","none");i(t,c,u),u("title.text")&&(u("title.position"),r.coerceFont(u,"title.font",c.font)),u("aspectratio"),u("baseratio")}else t.visible=!1}}}),Mf=p({"src/traces/funnelarea/layout_defaults.js"(e,t){var r=st(),n=Sf();t.exports=function(e,t){function i(i,a){return r.coerce(e,t,n,i,a)}i("hiddenlabels"),i("funnelareacolorway",t.colorway),i("extendfunnelareacolors")}}}),Ef=p({"src/traces/funnelarea/calc.js"(e,t){var r=Ou();t.exports={calc:function(e,t){return r.calc(e,t)},crossTraceCalc:function(e){r.crossTraceCalc(e,{type:"funnelarea"})}}}}),Cf=p({"src/traces/funnelarea/plot.js"(e,t){var r=v(),n=Jt(),i=st(),a=i.strScale,o=i.strTranslate,s=At(),l=eo().toMoveInsideBar,c=Ka(),u=c.recordMinTextSize,h=c.clearMinTextSize,p=br(),d=Du(),f=d.attachFxHandlers,m=d.determineInsideTextFont,g=d.layoutAreas,y=d.prerenderTitles,x=d.positionTitleOutside,b=d.formatSliceLabel;function _(e,t){return"l"+(t[0]-e[0])+","+(t[1]-e[1])}function w(e,t){return[.5*(e[0]+t[0]),.5*(e[1]+t[1])]}t.exports=function(e,t){var c=e._context.staticPlot,d=e._fullLayout;h("funnelarea",d),y(t,e),g(t,d._size),i.makeTraceGroups(d._funnelarealayer,t,"trace").each((function(t){var h=r.select(this),g=t[0],y=g.trace;!function(e){if(e.length){var t=e[0],r=t.trace,n=r.aspectratio,i=r.baseratio;i>.999&&(i=.999);var a,o,s,l=Math.pow(i,2),c=t.vTotal,u=c,h=c*l/(1-l)/c,p=[];for(p.push(E()),o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var d=s.v/u;h+=d,p.push(E())}var f=1/0,m=-1/0;for(o=0;o<p.length;o++)a=p[o],f=Math.min(f,a[1]),m=Math.max(m,a[1]);for(o=0;o<p.length;o++)p[o][1]-=(m+f)/2;var g=p[p.length-1][0],y=t.r,v=(m-f)/2,x=y/g,b=y/v*n;for(t.r=b*v,o=0;o<p.length;o++)p[o][0]*=x,p[o][1]*=b;var _=[-(a=p[0])[0],a[1]],k=[a[0],a[1]],T=0;for(o=e.length-1;o>-1;o--)if(!(s=e[o]).hidden){var S=p[T+=1][0],A=p[T][1];s.TL=[-S,A],s.TR=[S,A],s.BL=_,s.BR=k,s.pxmid=w(s.TR,s.BR),_=s.TL,k=s.TR}}function M(){var e=Math.sqrt(h);return{x:e,y:-e}}function E(){var e=M();return[e.x,e.y]}}(t),h.each((function(){var h=r.select(this).selectAll("g.slice").data(t);h.enter().append("g").classed("slice",!0),h.exit().remove(),h.each((function(a,o){if(a.hidden)r.select(this).selectAll("path,g").remove();else{a.pointNumber=a.i,a.curveNumber=y.index;var h=g.cx,v=g.cy,x=r.select(this),w=x.selectAll("path.surface").data([a]);w.enter().append("path").classed("surface",!0).style({"pointer-events":c?"none":"all"}),x.call(f,e,t);var k="M"+(h+a.TR[0])+","+(v+a.TR[1])+_(a.TR,a.BR)+_(a.BR,a.BL)+_(a.BL,a.TL)+"Z";w.attr("d",k),b(e,a,g);var T=p.castOption(y.textposition,a.pts),S=x.selectAll("g.slicetext").data(a.text&&"none"!==T?[0]:[]);S.enter().append("g").classed("slicetext",!0),S.exit().remove(),S.each((function(){var c=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),p=i.ensureUniformFontSize(e,m(y,a,d.font));c.text(a.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(n.font,p).call(s.convertToTspans,e);var f,g,x,b=n.bBox(c.node()),_=Math.min(a.BL[1],a.BR[1])+v,w=Math.max(a.TL[1],a.TR[1])+v;g=Math.max(a.TL[0],a.BL[0])+h,x=Math.min(a.TR[0],a.BR[0])+h,(f=l(g,x,_,w,b,{isHorizontal:!0,constrained:!0,angle:0,anchor:"middle"})).fontSize=p.size,u(y.type,f,d),t[o].transform=f,i.setTransormAndDisplay(c,f)}))}}));var v=r.select(this).selectAll("g.titletext").data(y.title.text?[0]:[]);v.enter().append("g").classed("titletext",!0),v.exit().remove(),v.each((function(){var t=i.ensureSingle(r.select(this),"text","",(function(e){e.attr("data-notex",1)})),l=y.title.text;y._meta&&(l=i.templateString(l,y._meta)),t.text(l).attr({class:"titletext",transform:"","text-anchor":"middle"}).call(n.font,y.title.font).call(s.convertToTspans,e);var c=x(g,d._size);t.attr("transform",o(c.x,c.y)+a(Math.min(1,c.scale))+o(c.tx,c.ty))}))}))}))}}}),Pf=p({"src/traces/funnelarea/style.js"(e,t){var r=v(),n=wr(),i=Ka().resizeText;t.exports=function(e){var t=e._fullLayout._funnelarealayer.selectAll(".trace");i(e,t,"funnelarea"),t.each((function(t){var i=t[0].trace,a=r.select(this);a.style({opacity:i.opacity}),a.selectAll("path.surface").each((function(t){r.select(this).call(n,t,i,e)}))}))}}}),Lf=p({"src/traces/funnelarea/index.js"(e,t){t.exports={moduleType:"trace",name:"funnelarea",basePlotModule:kf(),categories:["pie-like","funnelarea","showLegend"],attributes:Tf(),layoutAttributes:Sf(),supplyDefaults:Af(),supplyLayoutDefaults:Mf(),calc:Ef().calc,crossTraceCalc:Ef().crossTraceCalc,plot:Cf(),style:Pf(),styleOne:wr(),meta:{}}}}),If=p({"lib/funnelarea.js"(e,t){t.exports=Lf()}}),zf=p({"stackgl_modules/index.js"(e,t){!function(){var e={1964:function(e,t,r){e.exports={alpha_shape:r(3502),convex_hull:r(7352),delaunay_triangulate:r(7642),gl_cone3d:r(6405),gl_error3d:r(9165),gl_line3d:r(5714),gl_mesh3d:r(7201),gl_plot3d:r(4100),gl_scatter3d:r(8418),gl_streamtube3d:r(7815),gl_surface3d:r(9499),ndarray:r(9618),ndarray_linear_interpolate:r(4317)}},4793:function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=c(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==c(t)?t:t+""}function a(e,t,r){return t=s(t),function(e,t){if(t&&("object"==c(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,r||[],s(e).constructor):t.apply(e,r))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(o=function(){return!!e})()}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var u=r(7507),h=r(3778),p="function"===typeof Symbol&&"function"===typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=m,t.IS=50;var d=2147483647;function f(e){if(e>d)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}function m(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return v(e)}return g(e,t,r)}function g(e,t,r){if("string"===typeof e)return function(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=f(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(re(e,Uint8Array)){var t=new Uint8Array(e);return b(t.buffer,t.byteOffset,t.byteLength)}return x(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e));if(re(e,ArrayBuffer)||e&&re(e.buffer,ArrayBuffer))return b(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&(re(e,SharedArrayBuffer)||e&&re(e.buffer,SharedArrayBuffer)))return b(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return m.from(n,t,r);var i=function(e){if(m.isBuffer(e)){var t=0|_(e.length),r=f(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||ne(e.length)?f(0):x(e):"Buffer"===e.type&&Array.isArray(e.data)?x(e.data):void 0}(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return m.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+c(e))}function y(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function v(e){return y(e),f(e<0?0:0|_(e))}function x(e){for(var t=e.length<0?0:0|_(e.length),r=f(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function b(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,m.prototype),n}function _(e){if(e>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return 0|e}function w(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||re(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+c(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ee(e).length;default:if(i)return n?-1:Q(e).length;t=(""+t).toLowerCase(),i=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return z(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function T(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),ne(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=m.from(t,n)),m.isBuffer(t))return 0===t.length?-1:A(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function A(e,t,r,n,i){var a,o=1,s=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var u=-1;for(a=r;a<s;a++)if(c(e,a)===c(t,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===l)return u*o}else-1!==u&&(a-=a-u),u=-1}else for(r+l>s&&(r=s-l),a=r;a>=0;a--){for(var h=!0,p=0;p<l;p++)if(c(e,a+p)!==c(t,p)){h=!1;break}if(h)return a}return-1}function M(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a,o=t.length;for(n>o/2&&(n=o/2),a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(ne(s))return a;e[r+a]=s}return a}function E(e,t,r,n){return te(Q(t,e.length-r),e,r,n)}function C(e,t,r,n){return te(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function P(e,t,r,n){return te(ee(t),e,r,n)}function L(e,t,r,n){return te(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?u.fromByteArray(e):u.fromByteArray(e.slice(t,r))}function z(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a=e[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var l=void 0,c=void 0,u=void 0,h=void 0;switch(s){case 1:a<128&&(o=a);break;case 2:128===(192&(l=e[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=e[i+1],c=e[i+2],128===(192&l)&&128===(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=e[i+1],c=e[i+2],u=e[i+3],128===(192&l)&&128===(192&c)&&128===(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}m.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}(),m.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||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(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}}),m.poolSize=8192,m.from=function(e,t,r){return g(e,t,r)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array),m.alloc=function(e,t,r){return function(e,t,r){return y(e),e<=0?f(e):void 0!==t?"string"===typeof r?f(e).fill(t,r):f(e).fill(t):f(e)}(e,t,r)},m.allocUnsafe=function(e){return v(e)},m.allocUnsafeSlow=function(e){return v(e)},m.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==m.prototype},m.compare=function(e,t){if(re(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),re(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(e)||!m.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},m.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return m.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=m.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(re(a,Uint8Array))i+a.length>n.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(n,i)):Uint8Array.prototype.set.call(n,a,i);else{if(!m.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i)}i+=a.length}return n},m.byteLength=w,m.prototype._isBuffer=!0,m.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)T(this,t,t+1);return this},m.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 t=0;t<e;t+=4)T(this,t,t+3),T(this,t+1,t+2);return this},m.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 t=0;t<e;t+=8)T(this,t,t+7),T(this,t+1,t+6),T(this,t+2,t+5),T(this,t+3,t+4);return this},m.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?z(this,0,e):k.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(e){if(!m.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===m.compare(this,e)},m.prototype.inspect=function(){var e="",r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},p&&(m.prototype[p]=m.prototype.inspect),m.prototype.compare=function(e,t,r,n,i){if(re(e,Uint8Array)&&(e=m.from(e,e.offset,e.byteLength)),!m.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+c(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),u=e.slice(t,r),h=0;h<s;++h)if(l[h]!==u[h]){a=l[h],o=u[h];break}return a<o?-1:o<a?1:0},m.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},m.prototype.indexOf=function(e,t,r){return S(this,e,t,r,!0)},m.prototype.lastIndexOf=function(e,t,r){return S(this,e,t,r,!1)},m.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return M(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return C(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function j(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=ie[e[a]];return i}function F(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length-1;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function B(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function U(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function V(e,t,r,n,i){X(t,n,i,e,r,7);var a=Number(t&BigInt(4294967295));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;var o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function q(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function H(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,4),h.write(e,t,r,n,23,4),r+4}function G(e,t,r,n,i){return t=+t,r>>>=0,i||q(e,0,r,8),h.write(e,t,r,n,52,8),r+8}m.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,m.prototype),n},m.prototype.readUintLE=m.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},m.prototype.readUintBE=m.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},m.prototype.readUint8=m.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},m.prototype.readBigUInt64LE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24),i=this[++e]+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<<BigInt(32))})),m.prototype.readBigUInt64BE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=t*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e],i=this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),m.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},m.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||B(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},m.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},m.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},m.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},m.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},m.prototype.readBigInt64LE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=this[e+4]+this[e+5]*Math.pow(2,8)+this[e+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*Math.pow(2,8)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,24))})),m.prototype.readBigInt64BE=ae((function(e){Y(e>>>=0,"offset");var t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);var n=(t<<24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+this[++e]*Math.pow(2,16)+this[++e]*Math.pow(2,8)+r)})),m.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),h.read(this,e,!0,23,4)},m.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),h.read(this,e,!1,23,4)},m.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),h.read(this,e,!0,52,8)},m.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),h.read(this,e,!1,52,8)},m.prototype.writeUintLE=m.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},m.prototype.writeUint8=m.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,255,0),this[t]=255&e,t+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigUInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeBigUInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),m.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},m.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o|0)-s&255;return t+r},m.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},m.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},m.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},m.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},m.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},m.prototype.writeBigInt64LE=ae((function(e){return U(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeBigInt64BE=ae((function(e){return V(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),m.prototype.writeFloatLE=function(e,t,r){return H(this,e,t,!0,r)},m.prototype.writeFloatBE=function(e,t,r){return H(this,e,t,!1,r)},m.prototype.writeDoubleLE=function(e,t,r){return G(this,e,t,!0,r)},m.prototype.writeDoubleBE=function(e,t,r){return G(this,e,t,!1,r)},m.prototype.copy=function(e,t,r,n){if(!m.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},m.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!m.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=m.isBuffer(e)?e:m.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var W={};function $(e,t,r){W[e]=function(r){function i(){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r=a(this,i),Object.defineProperty(r,"message",{value:t.apply(r,arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(e,"]"),r.stack,delete r.name,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(i,r),o=i,(s=[{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}])&&n(o.prototype,s),c&&n(o,c),Object.defineProperty(o,"prototype",{writable:!1}),o;var o,s,c}(r)}function Z(e){for(var t="",r=e.length,n="-"===e[0]?1:0;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)}function X(e,t,r,n,i,a){if(e>r||e<t){var o,s="bigint"===typeof t?"n":"";throw o=a>3?0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(a+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(a+1)-1).concat(s,") and < 2 ** ")+"".concat(8*(a+1)-1).concat(s):">= ".concat(t).concat(s," and <= ").concat(r).concat(s),new W.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){Y(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,i,a)}function Y(e,t){if("number"!==typeof e)throw new W.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw Y(e,r),new W.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new W.ERR_BUFFER_OUT_OF_BOUNDS;throw new W.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(t),e)}$("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?"".concat(e," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),$("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(c(t))}),TypeError),$("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=Z(String(r)):"bigint"===typeof r&&(i=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=Z(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var J=/[^+/0-9A-Za-z-_]/g;function Q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function ee(e){return u.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(J,"")).length<2)return"";for(;e.length%4!==0;)e+="=";return e}(e))}function te(e,t,r,n){var i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function re(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ne(e){return e!==e}var ie=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();function ae(e){return"undefined"===typeof BigInt?oe:e}function oe(){throw new Error("BigInt not supported")}},9216:function(e){e.exports=i,e.exports.isMobile=i,e.exports.default=i;var t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});var i=e.ua;if(i||"undefined"===typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"===typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!==typeof i)return!1;var a=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!a&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(a=!0),a}},6296:function(e,t,r){e.exports=function(e){var t=(e=e||{}).eye||[0,0,1],r=e.center||[0,0,0],s=e.up||[0,1,0],l=e.distanceLimits||[0,1/0],c=e.mode||"turntable",u=n(),h=i(),p=a();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,t,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,t,r,s),p.setDistanceLimits(l[0],l[1]),p.lookAt(0,t,r,s),new o({turntable:u,orbit:h,matrix:p},c)};var n=r(7261),i=r(9977),a=r(1811);function o(e,t){this._controllerNames=Object.keys(e),this._controllerList=this._controllerNames.map((function(t){return e[t]})),this._mode=t,this._active=e[t],this._active||(this._mode="turntable",this._active=e.turntable),this.modes=this._controllerNames,this.computedMatrix=this._active.computedMatrix,this.computedEye=this._active.computedEye,this.computedUp=this._active.computedUp,this.computedCenter=this._active.computedCenter,this.computedRadius=this._active.computedRadius}var s=o.prototype;s.flush=function(e){for(var t=this._controllerList,r=0;r<t.length;++r)t[r].flush(e)},s.idle=function(e){for(var t=this._controllerList,r=0;r<t.length;++r)t[r].idle(e)},s.lookAt=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].lookAt(e,t,r,n)},s.rotate=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].rotate(e,t,r,n)},s.pan=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].pan(e,t,r,n)},s.translate=function(e,t,r,n){for(var i=this._controllerList,a=0;a<i.length;++a)i[a].translate(e,t,r,n)},s.setMatrix=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setMatrix(e,t)},s.setDistanceLimits=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistanceLimits(e,t)},s.setDistance=function(e,t){for(var r=this._controllerList,n=0;n<r.length;++n)r[n].setDistance(e,t)},s.recalcMatrix=function(e){this._active.recalcMatrix(e)},s.getDistance=function(e){return this._active.getDistance(e)},s.getDistanceLimits=function(e){return this._active.getDistanceLimits(e)},s.lastT=function(){return this._active.lastT()},s.setMode=function(e){if(e!==this._mode){var t=this._controllerNames.indexOf(e);if(!(t<0)){var r=this._active,n=this._controllerList[t],i=Math.max(r.lastT(),n.lastT());r.recalcMatrix(i),n.setMatrix(i,r.computedMatrix),this._active=n,this._mode=e,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}}},s.getMode=function(){return this._mode}},7169:function(e,t,r){var n="undefined"===typeof WeakMap?r(1538):WeakMap,i=r(2762),a=r(8116),o=new n;e.exports=function(e){var t=o.get(e),r=t&&(t._triangleBuffer.handle||t._triangleBuffer.buffer);if(!r||!e.isBuffer(r)){var n=i(e,new Float32Array([-1,-1,-1,4,4,-1]));(t=a(e,[{buffer:n,type:e.FLOAT,size:2}]))._triangleBuffer=n,o.set(e,t)}t.bind(),e.drawArrays(e.TRIANGLES,0,3),t.unbind()}},1085:function(e,t,r){var n=r(1371);e.exports=function(e,t,r){t="number"===typeof t?t:1,r=r||": ";var i=e.split(/\r?\n/),a=String(i.length+t-1).length;return i.map((function(e,i){var o=i+t,s=String(o).length;return n(o,a-s)+r+e})).join("\n")}},3952:function(e,t,r){e.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[0];for(var r=e[0].length,n=[e[0]],a=[0],o=1;o<t;++o)if(n.push(e[o]),i(n,r)){if(a.push(o),a.length===r+1)return a}else n.pop();return a};var n=r(3250);function i(e,t){for(var r=new Array(t+1),i=0;i<e.length;++i)r[i]=e[i];for(i=0;i<=e.length;++i){for(var a=e.length;a<=t;++a){for(var o=new Array(t),s=0;s<t;++s)o[s]=Math.pow(a+1-i,s);r[a]=o}if(n.apply(void 0,r))return!0}return!1}},5995:function(e,t,r){e.exports=function(e,t){return n(t).filter((function(r){for(var n=new Array(r.length),a=0;a<r.length;++a)n[a]=t[r[a]];return i(n)*e<1}))};var n=r(7642),i=r(6037)},3502:function(e,t,r){e.exports=function(e,t){return i(n(e,t))};var n=r(5995),i=r(9127)},6468:function(e){e.exports=function(e){return atob(e)}},2642:function(e,t,r){e.exports=function(e,t){for(var r=t.length,a=new Array(r+1),o=0;o<r;++o){for(var s=new Array(r+1),l=0;l<=r;++l)s[l]=e[l][o];a[o]=s}for(a[r]=new Array(r+1),o=0;o<=r;++o)a[r][o]=1;var c=new Array(r+1);for(o=0;o<r;++o)c[o]=t[o];c[r]=1;var u=n(a,c),h=i(u[r+1]);0===h&&(h=1);var p=new Array(r+1);for(o=0;o<=r;++o)p[o]=i(u[o])/h;return p};var n=r(727);function i(e){for(var t=0,r=0;r<e.length;++r)t+=e[r];return t}},7507:function(e,t){t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],l=a[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,l)),u=0,h=l>0?o-4:o;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,c=n-i;s<c;s+=o)a.push(l(e,s,s+o>c?c:s+o));return 1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e,t,n){for(var i,a,o=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),o.push(r[(a=i)>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},3865:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).add(t[0].mul(e[1])),e[1].mul(t[1]))}},1318:function(e){e.exports=function(e,t){return e[0].mul(t[1]).cmp(t[0].mul(e[1]))}},8697:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]),e[1].mul(t[0]))}},7842:function(e,t,r){var n=r(6330),i=r(1533),a=r(2651),o=r(6768),s=r(869),l=r(8697);e.exports=function e(t,r){if(n(t))return r?l(t,e(r)):[t[0].clone(),t[1].clone()];var c,u,h=0;if(i(t))c=t.clone();else if("string"===typeof t)c=o(t);else{if(0===t)return[a(0),a(1)];if(t===Math.floor(t))c=a(t);else{for(;t!==Math.floor(t);)t*=Math.pow(2,256),h-=256;c=a(t)}}if(n(r))c.mul(r[1]),u=r[0].clone();else if(i(r))u=r.clone();else if("string"===typeof r)u=o(r);else if(r)if(r===Math.floor(r))u=a(r);else{for(;r!==Math.floor(r);)r*=Math.pow(2,256),h+=256;u=a(r)}else u=a(1);return h>0?c=c.ushln(h):h<0&&(u=u.ushln(-h)),s(c,u)}},6330:function(e,t,r){var n=r(1533);e.exports=function(e){return Array.isArray(e)&&2===e.length&&n(e[0])&&n(e[1])}},5716:function(e,t,r){var n=r(6859);e.exports=function(e){return e.cmp(new n(0))}},1369:function(e,t,r){var n=r(5716);e.exports=function(e){var t=e.length,r=e.words,i=0;if(1===t)i=r[0];else if(2===t)i=r[0]+67108864*r[1];else for(var a=0;a<t;a++)i+=r[a]*Math.pow(67108864,a);return n(e)*i}},4025:function(e,t,r){var n=r(2361),i=r(8828).countTrailingZeros;e.exports=function(e){var t=i(n.lo(e));if(t<32)return t;var r=i(n.hi(e));return r>20?52:r+32}},1533:function(e,t,r){r(6859),e.exports=function(e){return e&&"object"===typeof e&&Boolean(e.words)}},2651:function(e,t,r){var n=r(6859),i=r(2361);e.exports=function(e){var t=i.exponent(e);return t<52?new n(e):new n(e*Math.pow(2,52-t)).ushln(t-52)}},869:function(e,t,r){var n=r(2651),i=r(5716);e.exports=function(e,t){var r=i(e),a=i(t);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(e=e.neg(),t=t.neg());var o=e.gcd(t);return o.cmpn(1)?[e.div(o),t.div(o)]:[e,t]}},6768:function(e,t,r){var n=r(6859);e.exports=function(e){return new n(e)}},6504:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[0]),e[1].mul(t[1]))}},7721:function(e,t,r){var n=r(5716);e.exports=function(e){return n(e[0])*n(e[1])}},5572:function(e,t,r){var n=r(869);e.exports=function(e,t){return n(e[0].mul(t[1]).sub(e[1].mul(t[0])),e[1].mul(t[1]))}},946:function(e,t,r){var n=r(1369),i=r(4025);e.exports=function(e){var t=e[0],r=e[1];if(0===t.cmpn(0))return 0;var a=t.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=t.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(p=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,p=n(l.ushln(h).divRound(r));return h<1023?c*p*Math.pow(2,-h):c*(p*=Math.pow(2,-1023))*Math.pow(2,1023-h)}},2478:function(e){function t(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function o(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}e.exports={ge:function(e,r,n,i,a){return o(e,r,n,i,a,t)},gt:function(e,t,n,i,a){return o(e,t,n,i,a,r)},lt:function(e,t,r,i,a){return o(e,t,r,i,a,n)},le:function(e,t,r,n,a){return o(e,t,r,n,a,i)},eq:function(e,t,r,n,i){return o(e,t,r,n,i,a)}}},8828:function(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e<t)},t.max=function(e,t){return e^(e^t)&-(e<t)},t.isPow2=function(e){return!(e&e-1)&&!!e},t.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}}(n),t.reverse=function(e){return n[255&e]<<24|n[e>>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},6859:function(e,t,r){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function a(e,t,r){if(a.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;"object"===typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(7790).Buffer}catch(S){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"===typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},a.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},a.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=l(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=l(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u<s;u+=n)l=c(e,u,u+n,t),this.imuln(i),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l);if(0!==o){var h=1;for(l=c(e,u,e.length,t),u=0;u<o;u++)h*=t;this.imuln(h),this.words[0]+l<67108864?this.words[0]+=l:this._iaddn(l)}this.strip()},a.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},a.prototype.clone=function(){var e=new a(null);return this.copy(e),e},a.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},a.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var u=l>>>26,h=67108863&l,p=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=p;d++){var f=c-d|0;u+=(o=(i=0|e.words[f])*(a=0|t.words[d])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],l=(16777215&(s<<i|a)).toString(16);r=0!==(a=s>>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=h[e],d=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modn(d).toString(e);r=(f=f.idivn(d)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n("undefined"!==typeof o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===t,c=new e(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s<a;s++)c[s]=0}else{for(s=0;s<a-i;s++)c[s]=0;for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[a-s-1]=o}return c},Math.clz32?a.prototype._countBits=function(e){return 32-Math.clz32(e)}:a.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},a.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},a.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},a.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},a.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},a.prototype.isNeg=function(){return 0!==this.negative},a.prototype.neg=function(){return this.clone().ineg()},a.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},a.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},a.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},a.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},a.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},a.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},a.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},a.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},a.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this},a.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},a.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},a.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var n,i,a,o=e.words,s=t.words,l=r.words,c=0,u=0|o[0],h=8191&u,p=u>>>13,d=0|o[1],f=8191&d,m=d>>>13,g=0|o[2],y=8191&g,v=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],k=8191&w,T=w>>>13,S=0|o[5],A=8191&S,M=S>>>13,E=0|o[6],C=8191&E,P=E>>>13,L=0|o[7],I=8191&L,z=L>>>13,O=0|o[8],R=8191&O,D=O>>>13,j=0|o[9],F=8191&j,B=j>>>13,N=0|s[0],U=8191&N,V=N>>>13,q=0|s[1],H=8191&q,G=q>>>13,W=0|s[2],$=8191&W,Z=W>>>13,X=0|s[3],Y=8191&X,K=X>>>13,J=0|s[4],Q=8191&J,ee=J>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],le=8191&se,ce=se>>>13,ue=0|s[8],he=8191&ue,pe=ue>>>13,de=0|s[9],fe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(p,U)|0))<<13)|0;c=((a=Math.imul(p,V))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(f,U),i=(i=Math.imul(f,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var ye=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(p,H)|0))<<13)|0;c=((a=a+Math.imul(p,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,V))+Math.imul(v,U)|0,a=Math.imul(v,V),n=n+Math.imul(f,H)|0,i=(i=i+Math.imul(f,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var ve=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,Z)|0)+Math.imul(p,$)|0))<<13)|0;c=((a=a+Math.imul(p,Z)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,Z)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,Z)|0;var xe=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(p,Y)|0))<<13)|0;c=((a=a+Math.imul(p,K)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,V))+Math.imul(T,U)|0,a=Math.imul(T,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,Z)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,Z)|0,n=n+Math.imul(f,Y)|0,i=(i=i+Math.imul(f,K)|0)+Math.imul(m,Y)|0,a=a+Math.imul(m,K)|0;var be=(c+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(p,Q)|0))<<13)|0;c=((a=a+Math.imul(p,ee)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(M,U)|0,a=Math.imul(M,V),n=n+Math.imul(k,H)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,Z)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,Z)|0,n=n+Math.imul(y,Y)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(v,Y)|0,a=a+Math.imul(v,K)|0,n=n+Math.imul(f,Q)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,Q)|0,a=a+Math.imul(m,ee)|0;var _e=(c+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(p,re)|0))<<13)|0;c=((a=a+Math.imul(p,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,V))+Math.imul(P,U)|0,a=Math.imul(P,V),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,G)|0,n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,Z)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,Z)|0,n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,Y)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(f,re)|0,i=(i=i+Math.imul(f,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0;var we=(c+(n=n+Math.imul(h,ae)|0)|0)+((8191&(i=(i=i+Math.imul(h,oe)|0)+Math.imul(p,ae)|0))<<13)|0;c=((a=a+Math.imul(p,oe)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(z,U)|0,a=Math.imul(z,V),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,G)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(M,$)|0,a=a+Math.imul(M,Z)|0,n=n+Math.imul(k,Y)|0,i=(i=i+Math.imul(k,K)|0)+Math.imul(T,Y)|0,a=a+Math.imul(T,K)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(_,Q)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(f,ae)|0,i=(i=i+Math.imul(f,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var ke=(c+(n=n+Math.imul(h,le)|0)|0)+((8191&(i=(i=i+Math.imul(h,ce)|0)+Math.imul(p,le)|0))<<13)|0;c=((a=a+Math.imul(p,ce)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,U),i=(i=Math.imul(R,V))+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(z,H)|0,a=a+Math.imul(z,G)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,Z)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,Z)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(M,Y)|0,a=a+Math.imul(M,K)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(f,le)|0,i=(i=i+Math.imul(f,ce)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,ce)|0;var Te=(c+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,pe)|0)+Math.imul(p,he)|0))<<13)|0;c=((a=a+Math.imul(p,pe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(F,U),i=(i=Math.imul(F,V))+Math.imul(B,U)|0,a=Math.imul(B,V),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(z,$)|0,a=a+Math.imul(z,Z)|0,n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(P,Y)|0,a=a+Math.imul(P,K)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(M,Q)|0,a=a+Math.imul(M,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(y,le)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(v,le)|0,a=a+Math.imul(v,ce)|0,n=n+Math.imul(f,he)|0,i=(i=i+Math.imul(f,pe)|0)+Math.imul(m,he)|0,a=a+Math.imul(m,pe)|0;var Se=(c+(n=n+Math.imul(h,fe)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(p,fe)|0))<<13)|0;c=((a=a+Math.imul(p,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,G))+Math.imul(B,H)|0,a=Math.imul(B,G),n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,Z)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,Z)|0,n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(z,Y)|0,a=a+Math.imul(z,K)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(M,re)|0,a=a+Math.imul(M,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,ce)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,ce)|0,n=n+Math.imul(y,he)|0,i=(i=i+Math.imul(y,pe)|0)+Math.imul(v,he)|0,a=a+Math.imul(v,pe)|0;var Ae=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;c=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,Z))+Math.imul(B,$)|0,a=Math.imul(B,Z),n=n+Math.imul(R,Y)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(D,Y)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(z,Q)|0,a=a+Math.imul(z,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(M,ae)|0,a=a+Math.imul(M,oe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,ce)|0)+Math.imul(T,le)|0,a=a+Math.imul(T,ce)|0,n=n+Math.imul(b,he)|0,i=(i=i+Math.imul(b,pe)|0)+Math.imul(_,he)|0,a=a+Math.imul(_,pe)|0;var Me=(c+(n=n+Math.imul(y,fe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(v,fe)|0))<<13)|0;c=((a=a+Math.imul(v,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,K))+Math.imul(B,Y)|0,a=Math.imul(B,K),n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(z,re)|0,a=a+Math.imul(z,ne)|0,n=n+Math.imul(C,ae)|0,i=(i=i+Math.imul(C,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(A,le)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(M,le)|0,a=a+Math.imul(M,ce)|0,n=n+Math.imul(k,he)|0,i=(i=i+Math.imul(k,pe)|0)+Math.imul(T,he)|0,a=a+Math.imul(T,pe)|0;var Ee=(c+(n=n+Math.imul(b,fe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(_,fe)|0))<<13)|0;c=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(F,Q),i=(i=Math.imul(F,ee))+Math.imul(B,Q)|0,a=Math.imul(B,ee),n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(z,ae)|0,a=a+Math.imul(z,oe)|0,n=n+Math.imul(C,le)|0,i=(i=i+Math.imul(C,ce)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,ce)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,pe)|0)+Math.imul(M,he)|0,a=a+Math.imul(M,pe)|0;var Ce=(c+(n=n+Math.imul(k,fe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(T,fe)|0))<<13)|0;c=((a=a+Math.imul(T,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(F,re),i=(i=Math.imul(F,ne))+Math.imul(B,re)|0,a=Math.imul(B,ne),n=n+Math.imul(R,ae)|0,i=(i=i+Math.imul(R,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,n=n+Math.imul(I,le)|0,i=(i=i+Math.imul(I,ce)|0)+Math.imul(z,le)|0,a=a+Math.imul(z,ce)|0,n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,pe)|0)+Math.imul(P,he)|0,a=a+Math.imul(P,pe)|0;var Pe=(c+(n=n+Math.imul(A,fe)|0)|0)+((8191&(i=(i=i+Math.imul(A,me)|0)+Math.imul(M,fe)|0))<<13)|0;c=((a=a+Math.imul(M,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(F,ae),i=(i=Math.imul(F,oe))+Math.imul(B,ae)|0,a=Math.imul(B,oe),n=n+Math.imul(R,le)|0,i=(i=i+Math.imul(R,ce)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,ce)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,pe)|0)+Math.imul(z,he)|0,a=a+Math.imul(z,pe)|0;var Le=(c+(n=n+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(P,fe)|0))<<13)|0;c=((a=a+Math.imul(P,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(F,le),i=(i=Math.imul(F,ce))+Math.imul(B,le)|0,a=Math.imul(B,ce),n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,pe)|0)+Math.imul(D,he)|0,a=a+Math.imul(D,pe)|0;var Ie=(c+(n=n+Math.imul(I,fe)|0)|0)+((8191&(i=(i=i+Math.imul(I,me)|0)+Math.imul(z,fe)|0))<<13)|0;c=((a=a+Math.imul(z,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(F,he),i=(i=Math.imul(F,pe))+Math.imul(B,he)|0,a=Math.imul(B,pe);var ze=(c+(n=n+Math.imul(R,fe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(D,fe)|0))<<13)|0;c=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(ze>>>26)|0,ze&=67108863;var Oe=(c+(n=Math.imul(F,fe))|0)+((8191&(i=(i=Math.imul(F,me))+Math.imul(B,fe)|0))<<13)|0;return c=((a=Math.imul(B,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,l[0]=ge,l[1]=ye,l[2]=ve,l[3]=xe,l[4]=be,l[5]=_e,l[6]=we,l[7]=ke,l[8]=Te,l[9]=Se,l[10]=Ae,l[11]=Me,l[12]=Ee,l[13]=Ce,l[14]=Pe,l[15]=Le,l[16]=Ie,l[17]=ze,l[18]=Oe,0!==c&&(l[19]=c,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=d),a.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):n<63?d(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,l=Math.min(a,t.length-1),c=Math.max(0,a-e.length+1);c<=l;c++){var u=a-c,h=(0|e.words[u])*(0|t.words[c]),p=67108863&h;s=67108863&(p=p+s|0),i+=(o=(o=o+(h/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o<a;o++)n[o]=t[e[o]],i[o]=r[e[o]]},g.prototype.transform=function(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1)for(var s=o<<1,l=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),u=0;u<i;u+=s)for(var h=l,p=c,d=0;d<o;d++){var f=r[u+d],m=n[u+d],g=r[u+d+o],y=n[u+d+o],v=h*g-p*y;y=h*y+p*g,g=v,r[u+d]=f+g,n[u+d]=m+y,r[u+d+o]=f-g,n[u+d+o]=m-y,d!==s&&(v=l*h-c*p,p=l*p+c*h,h=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var a=0,o=0;o<t;o++)a+=0|e[o],r[2*o]=8191&a,a>>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o<i;++o)r[o]=0;n(0===a),n(0===(-8192&a))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),a=this.stub(n),o=new Array(n),s=new Array(n),l=new Array(n),c=new Array(n),u=new Array(n),h=new Array(n),p=r.words;p.length=n,this.convert13b(e.words,e.length,o,n),this.convert13b(t.words,t.length,c,n),this.transform(o,a,s,l,n,i),this.transform(c,a,u,h,n,i);for(var d=0;d<n;d++){var f=s[d]*u[d]-l[d]*h[d];l[d]=s[d]*h[d]+l[d]*u[d],s[d]=f}return this.conjugate(s,l,n),this.transform(s,l,p,a,n,i),this.conjugate(p,a,n),this.normalize13b(p,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},a.prototype.mul=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},a.prototype.mulf=function(e){var t=new a(null);return t.words=new Array(this.length+e.length),m(this,e,t)},a.prototype.imul=function(e){return this.clone().mulTo(e,this)},a.prototype.imuln=function(e){n("number"===typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,a=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},a.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,l=(0|this.words[t])-s<<r;this.words[t]=l|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},a.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},a.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,l=r;if(i-=o,i=Math.max(0,i),l){for(var c=0;c<o;c++)l.words[c]=this.words[c];l.length=o}if(0===o);else if(this.length>o)for(this.length-=o,c=0;c<this.length;c++)this.words[c]=this.words[c+o];else this.words[0]=0,this.length=1;var u=0;for(c=this.length-1;c>=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},a.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},a.prototype.maskn=function(e){return this.clone().imaskn(e)},a.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},a.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},a.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},a.prototype.addn=function(e){return this.clone().iaddn(e)},a.prototype.subn=function(e){return this.clone().isubn(e)},a.prototype.iabs=function(){return this.negative=0,this},a.prototype.abs=function(){return this.clone().iabs()},a.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var l=(0|e.words[i])*t;s=((a-=67108863&l)>>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==t){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var u=n.clone()._ishlnsubmul(i,1,l);0===u.negative&&(n=u,s&&(s.words[l]=1));for(var h=l-1;h>=0;h--){var p=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(p=Math.min(p/o|0,67108863),n._ishlnsubmul(i,p,h);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=t.clone();!t.isZero();){for(var p=0,d=1;0===(t.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var f=0,m=1;0===(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),s.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(l)):(r.isub(t),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0===(t.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(t.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var h=0,p=1;0===(r.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(r.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0===(1&this.words[0])},a.prototype.isOdd=function(){return 1===(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},a.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},a.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new k(e)},a.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"===typeof e){var t=a._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(x,v),x.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(b,v),i(_,v),i(w,v),w.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return y[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2===1),3===t){var r=this.m.add(new a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),p=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),f=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g<f);var y=this.pow(h,new a(1).iushln(f-g-1));p=p.redMul(y),h=y.redSqr(),d=d.redMul(h),f=g}return p},k.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},k.prototype.pow=function(e,t){if(t.isZero())return new a(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new a(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],o=0,s=0,l=t.bitLength()%26;for(0===l&&(l=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new T(e)},i(T,k),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6204:function(e){e.exports=function(e){var t,r,n,i=e.length,a=0;for(t=0;t<i;++t)a+=e[t].length;var o=new Array(a),s=0;for(t=0;t<i;++t){var l=e[t],c=l.length;for(r=0;r<c;++r){var u=o[s++]=new Array(c-1),h=0;for(n=0;n<c;++n)n!==r&&(u[h++]=l[n]);if(1&r){var p=u[1];u[1]=u[0],u[0]=p}}}return o}},6867:function(e,t,r){e.exports=function(e,t,r){switch(arguments.length){case 1:return n=[],c(i=e,i,u,!0),n;case 2:return"function"===typeof t?c(e,e,t,!0):function(e,t){return n=[],c(e,t,u,!1),n}(e,t);case 3:return c(e,t,r,!1);default:throw new Error("box-intersect: Invalid arguments")}var i};var n,i=r(1888),a=r(855),o=r(7150);function s(e,t){for(var r=0;r<e;++r)if(!(t[r]<=t[r+e]))return!0;return!1}function l(e,t,r,n){for(var i=0,a=0,o=0,l=e.length;o<l;++o){var c=e[o];if(!s(t,c)){for(var u=0;u<2*t;++u)r[i++]=c[u];n[a++]=o}}return a}function c(e,t,r,n){var s=e.length,c=t.length;if(!(s<=0||c<=0)){var u=e[0].length>>>1;if(!(u<=0)){var h,p=i.mallocDouble(2*u*s),d=i.mallocInt32(s);if((s=l(e,u,p,d))>0){if(1===u&&n)a.init(s),h=a.sweepComplete(u,r,0,s,p,d,0,s,p,d);else{var f=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(t,u,f,m))>0&&(a.init(s+c),h=1===u?a.sweepBipartite(u,r,0,s,p,d,0,c,f,m):o(u,r,n,s,p,d,c,f,m),i.free(f),i.free(m))}i.free(p),i.free(d)}return h}}}function u(e,t){n.push([e,t])}},2455:function(e,t){function r(e){return e?function(e,t,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=n,d=h*n;p<i;++p,d+=h){var f=a[t+d],m=a[t+d+e],g=o[p];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],b=c[t+v+e],_=u[y];if(!(b<f||m<x)){for(var w=t+1;w<e;++w){var k=a[w+d],T=a[w+e+d],S=c[w+v],A=c[w+e+v];if(T<S||A<k)continue e}var M=r(g,_);if(void 0!==M)return M}}}}(e,t,r,n,i,a,o,s,l,c,u):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=s,d=h*s;p<l;++p,d+=h){var f=c[t+d],m=c[t+d+e],g=u[p];e:for(var y=n,v=h*n;y<i;++y,v+=h){var x=a[t+v],b=a[t+v+e],_=o[y];if(!(m<x||b<f)){for(var w=t+1;w<e;++w){var k=a[w+v],T=a[w+e+v],S=c[w+d],A=c[w+e+d];if(T<S||A<k)continue e}var M=r(_,g);if(void 0!==M)return M}}}}(e,t,r,n,i,a,o,s,l,c,u)}:function(e,t,r,n,i,a,o,s,l,c,u,h){return a-i>c-l?n?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=n,d=h*n;p<i;++p,d+=h){var f=a[t+d],m=a[t+d+e],g=o[p];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],b=u[y];if(!(x<=f||m<x)){for(var _=t+1;_<e;++_){var w=a[_+d],k=a[_+e+d],T=c[_+v],S=c[_+e+v];if(k<T||S<w)continue e}var A=r(b,g);if(void 0!==A)return A}}}}(e,t,r,i,a,o,s,l,c,u,h):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=n,d=h*n;p<i;++p,d+=h){var f=a[t+d],m=a[t+d+e],g=o[p];e:for(var y=s,v=h*s;y<l;++y,v+=h){var x=c[t+v],b=u[y];if(!(x<f||m<x)){for(var _=t+1;_<e;++_){var w=a[_+d],k=a[_+e+d],T=c[_+v],S=c[_+e+v];if(k<T||S<w)continue e}var A=r(g,b);if(void 0!==A)return A}}}}(e,t,r,i,a,o,s,l,c,u,h):n?function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=s,d=h*s;p<l;++p,d+=h){var f=c[t+d],m=u[p];e:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[t+y],x=a[t+y+e],b=o[g];if(!(f<=v||x<f)){for(var _=t+1;_<e;++_){var w=a[_+y],k=a[_+e+y],T=c[_+d],S=c[_+e+d];if(k<T||S<w)continue e}var A=r(m,b);if(void 0!==A)return A}}}}(e,t,r,i,a,o,s,l,c,u,h):function(e,t,r,n,i,a,o,s,l,c,u){for(var h=2*e,p=s,d=h*s;p<l;++p,d+=h){var f=c[t+d],m=u[p];e:for(var g=n,y=h*n;g<i;++g,y+=h){var v=a[t+y],x=a[t+y+e],b=o[g];if(!(f<v||x<f)){for(var _=t+1;_<e;++_){var w=a[_+y],k=a[_+e+y],T=c[_+d],S=c[_+e+d];if(k<T||S<w)continue e}var A=r(b,m);if(void 0!==A)return A}}}}(e,t,r,i,a,o,s,l,c,u,h)}}t.partial=r(!1),t.full=r(!0)},7150:function(e,t,r){e.exports=function(e,t,r,a,u,M,E,C,P){!function(e,t){var r=8*i.log2(t+1)*(e+1)|0,a=i.nextPow2(b*r);w.length<a&&(n.free(w),w=n.mallocInt32(a));var o=i.nextPow2(_*r);k.length<o&&(n.free(k),k=n.mallocDouble(o))}(e,a+E);var L,I=0,z=2*e;for(T(I++,0,0,a,0,E,r?16:0,-1/0,1/0),r||T(I++,0,0,E,0,a,1,-1/0,1/0);I>0;){var O=(I-=1)*b,R=w[O],D=w[O+1],j=w[O+2],F=w[O+3],B=w[O+4],N=w[O+5],U=I*_,V=k[U],q=k[U+1],H=1&N,G=!!(16&N),W=u,$=M,Z=C,X=P;if(H&&(W=C,$=P,Z=u,X=M),!(2&N&&D>=(j=g(e,R,D,j,W,$,q)))&&!(4&N&&(D=y(e,R,D,j,W,$,V))>=j)){var Y=j-D,K=B-F;if(G){if(e*Y*(Y+K)<d){if(void 0!==(L=l.scanComplete(e,R,t,D,j,W,$,F,B,Z,X)))return L;continue}}else{if(e*Math.min(Y,K)<h){if(void 0!==(L=o(e,R,t,H,D,j,W,$,F,B,Z,X)))return L;continue}if(e*Y*K<p){if(void 0!==(L=l.scanBipartite(e,R,t,H,D,j,W,$,F,B,Z,X)))return L;continue}}var J=f(e,R,D,j,W,$,V,q);if(D<J)if(e*(J-D)<h){if(void 0!==(L=s(e,R+1,t,D,J,W,$,F,B,Z,X)))return L}else if(R===e-2){if(void 0!==(L=H?l.sweepBipartite(e,t,F,B,Z,X,D,J,W,$):l.sweepBipartite(e,t,D,J,W,$,F,B,Z,X)))return L}else T(I++,R+1,D,J,F,B,H,-1/0,1/0),T(I++,R+1,F,B,D,J,1^H,-1/0,1/0);if(J<j){var Q=c(e,R,F,B,Z,X),ee=Z[z*Q+R],te=m(e,R,Q,B,Z,X,ee);if(te<B&&T(I++,R,J,j,te,B,(4|H)+(G?16:0),ee,q),F<Q&&T(I++,R,J,j,F,Q,(2|H)+(G?16:0),V,ee),Q+1===te){if(void 0!==(L=G?A(e,R,t,J,j,W,$,Q,Z,X[Q]):S(e,R,t,H,J,j,W,$,Q,Z,X[Q])))return L}else if(Q<te){var re;if(G){if(J<(re=v(e,R,J,j,W,$,ee))){var ne=m(e,R,J,re,W,$,ee);if(R===e-2){if(J<ne&&void 0!==(L=l.sweepComplete(e,t,J,ne,W,$,Q,te,Z,X)))return L;if(ne<re&&void 0!==(L=l.sweepBipartite(e,t,ne,re,W,$,Q,te,Z,X)))return L}else J<ne&&T(I++,R+1,J,ne,Q,te,16,-1/0,1/0),ne<re&&(T(I++,R+1,ne,re,Q,te,0,-1/0,1/0),T(I++,R+1,Q,te,ne,re,1,-1/0,1/0))}}else J<(re=H?x(e,R,J,j,W,$,ee):v(e,R,J,j,W,$,ee))&&(R===e-2?L=H?l.sweepBipartite(e,t,Q,te,Z,X,J,re,W,$):l.sweepBipartite(e,t,J,re,W,$,Q,te,Z,X):(T(I++,R+1,J,re,Q,te,H,-1/0,1/0),T(I++,R+1,Q,te,J,re,1^H,-1/0,1/0)))}}}}};var n=r(1888),i=r(8828),a=r(2455),o=a.partial,s=a.full,l=r(855),c=r(3545),u=r(8105),h=128,p=1<<22,d=1<<22,f=u("!(lo>=p0)&&!(p1>=hi)"),m=u("lo===p0"),g=u("lo<p0"),y=u("hi<=p0"),v=u("lo<=p0&&p0<=hi"),x=u("lo<p0&&p0<=hi"),b=6,_=2,w=n.mallocInt32(1024),k=n.mallocDouble(1024);function T(e,t,r,n,i,a,o,s,l){var c=b*e;w[c]=t,w[c+1]=r,w[c+2]=n,w[c+3]=i,w[c+4]=a,w[c+5]=o;var u=_*e;k[u]=s,k[u+1]=l}function S(e,t,r,n,i,a,o,s,l,c,u){var h=2*e,p=l*h,d=c[p+t];e:for(var f=i,m=i*h;f<a;++f,m+=h){var g=o[m+t],y=o[m+t+e];if(!(d<g||y<d)&&(!n||d!==g)){for(var v,x=s[f],b=t+1;b<e;++b){g=o[m+b],y=o[m+b+e];var _=c[p+b],w=c[p+b+e];if(y<_||w<g)continue e}if(void 0!==(v=n?r(u,x):r(x,u)))return v}}}function A(e,t,r,n,i,a,o,s,l,c){var u=2*e,h=s*u,p=l[h+t];e:for(var d=n,f=n*u;d<i;++d,f+=u){var m=o[d];if(m!==c){var g=a[f+t],y=a[f+t+e];if(!(p<g||y<p)){for(var v=t+1;v<e;++v){g=a[f+v],y=a[f+v+e];var x=l[h+v],b=l[h+v+e];if(y<x||b<g)continue e}var _=r(m,c);if(void 0!==_)return _}}}}},3545:function(e,t,r){e.exports=function(e,t,r,o,s,l){if(o<=r+1)return r;for(var c=r,u=o,h=o+r>>>1,p=2*e,d=h,f=s[p*h+t];c<u;){if(u-c<i){a(e,t,c,u,s,l),f=s[p*h+t];break}var m=u-c,g=Math.random()*m+c|0,y=s[p*g+t],v=Math.random()*m+c|0,x=s[p*v+t],b=Math.random()*m+c|0,_=s[p*b+t];y<=x?_>=x?(d=v,f=x):y>=_?(d=g,f=y):(d=b,f=_):x>=_?(d=v,f=x):_>=y?(d=g,f=y):(d=b,f=_);for(var w=p*(u-1),k=p*d,T=0;T<p;++T,++w,++k){var S=s[w];s[w]=s[k],s[k]=S}var A=l[u-1];for(l[u-1]=l[d],l[d]=A,w=p*(u-1),k=p*(d=n(e,t,c,u-1,s,l,f)),T=0;T<p;++T,++w,++k)S=s[w],s[w]=s[k],s[k]=S;if(A=l[u-1],l[u-1]=l[d],l[d]=A,h<d){for(u=d-1;c<u&&s[p*(u-1)+t]===f;)u-=1;u+=1}else{if(!(d<h))break;for(c=d+1;c<u&&s[p*c+t]===f;)c+=1}}return n(e,t,r,h,s,l,s[p*h+t])};var n=r(8105)("lo<p0"),i=8;function a(e,t,r,n,i,a){for(var o=2*e,s=o*(r+1)+t,l=r+1;l<n;++l,s+=o)for(var c=i[s],u=l,h=o*(l-1);u>r&&i[h+t]>c;--u,h-=o){for(var p=h,d=h+o,f=0;f<o;++f,++p,++d){var m=i[p];i[p]=i[d],i[d]=m}var g=a[u];a[u]=a[u-1],a[u-1]=g}}},8105:function(e){e.exports=function(e){return t[e]};var t={"lo===p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,p=r;n>p;++p,l+=s)if(i[l+h]===o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lo<p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,p=r;n>p;++p,l+=s)if(i[l+h]<o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lo<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"hi<=p0":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=e+t,p=r;n>p;++p,l+=s)if(i[l+h]<=o)if(u===p)u+=1,c+=s;else{for(var d=0;s>d;++d){var f=i[l+d];i[l+d]=i[c],i[c++]=f}var m=a[p];a[p]=a[u],a[u++]=m}return u},"lo<p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,p=e+t,d=r;n>d;++d,l+=s){var f=i[l+h],m=i[l+p];if(f<o&&o<=m)if(u===d)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[d];a[d]=a[u],a[u++]=v}}return u},"lo<=p0&&p0<=hi":function(e,t,r,n,i,a,o){for(var s=2*e,l=s*r,c=l,u=r,h=t,p=e+t,d=r;n>d;++d,l+=s){var f=i[l+h],m=i[l+p];if(f<=o&&o<=m)if(u===d)u+=1,c+=s;else{for(var g=0;s>g;++g){var y=i[l+g];i[l+g]=i[c],i[c++]=y}var v=a[d];a[d]=a[u],a[u++]=v}}return u},"!(lo>=p0)&&!(p1>=hi)":function(e,t,r,n,i,a,o,s){for(var l=2*e,c=l*r,u=c,h=r,p=t,d=e+t,f=r;n>f;++f,c+=l){var m=i[c+p],g=i[c+d];if(!(m>=o)&&!(s>=g))if(h===f)h+=1,u+=l;else{for(var y=0;l>y;++y){var v=i[c+y];i[c+y]=i[u],i[u++]=v}var x=a[f];a[f]=a[h],a[h++]=x}}return h}}},4192:function(e){e.exports=function(e,n){n<=4*t?r(0,n-1,e):c(0,n-1,e)};var t=32;function r(e,t,r){for(var n=2*(e+1),i=e+1;i<=t;++i){for(var a=r[n++],o=r[n++],s=i,l=n-2;s-- >e;){var c=r[l-2],u=r[l-1];if(c<a)break;if(c===a&&u<o)break;r[l]=c,r[l+1]=u,l-=2}r[l]=a,r[l+1]=o}}function n(e,t,r){t*=2;var n=r[e*=2],i=r[e+1];r[e]=r[t],r[e+1]=r[t+1],r[t]=n,r[t+1]=i}function i(e,t,r){t*=2,r[e*=2]=r[t],r[e+1]=r[t+1]}function a(e,t,r,n){t*=2,r*=2;var i=n[e*=2],a=n[e+1];n[e]=n[t],n[e+1]=n[t+1],n[t]=n[r],n[t+1]=n[r+1],n[r]=i,n[r+1]=a}function o(e,t,r,n,i){t*=2,i[e*=2]=i[t],i[t]=r,i[e+1]=i[t+1],i[t+1]=n}function s(e,t,r){t*=2;var n=r[e*=2],i=r[t];return!(n<i)&&(n!==i||r[e+1]>r[t+1])}function l(e,t,r,n){var i=n[e*=2];return i<t||i===t&&n[e+1]<r}function c(e,u,h){var p=(u-e+1)/6|0,d=e+p,f=u-p,m=e+u>>1,g=m-p,y=m+p,v=d,x=g,b=m,_=y,w=f,k=e+1,T=u-1,S=0;s(v,x,h)&&(S=v,v=x,x=S),s(_,w,h)&&(S=_,_=w,w=S),s(v,b,h)&&(S=v,v=b,b=S),s(x,b,h)&&(S=x,x=b,b=S),s(v,_,h)&&(S=v,v=_,_=S),s(b,_,h)&&(S=b,b=_,_=S),s(x,w,h)&&(S=x,x=w,w=S),s(x,b,h)&&(S=x,x=b,b=S),s(_,w,h)&&(S=_,_=w,w=S);for(var A=h[2*x],M=h[2*x+1],E=h[2*_],C=h[2*_+1],P=2*v,L=2*b,I=2*w,z=2*d,O=2*m,R=2*f,D=0;D<2;++D){var j=h[P+D],F=h[L+D],B=h[I+D];h[z+D]=j,h[O+D]=F,h[R+D]=B}i(g,e,h),i(y,u,h);for(var N=k;N<=T;++N)if(l(N,A,M,h))N!==k&&n(N,k,h),++k;else if(!l(N,E,C,h))for(;;){if(l(T,E,C,h)){l(T,A,M,h)?(a(N,k,T,h),++k,--T):(n(N,T,h),--T);break}if(--T<N)break}o(e,k-1,A,M,h),o(u,T+1,E,C,h),k-2-e<=t?r(e,k-2,h):c(e,k-2,h),u-(T+2)<=t?r(T+2,u,h):c(T+2,u,h),T-k<=t?r(k,T,h):c(k,T,h)}},855:function(e,t,r){e.exports={init:function(e){var t=i.nextPow2(e);l.length<t&&(n.free(l),l=n.mallocInt32(t)),c.length<t&&(n.free(c),c=n.mallocInt32(t)),u.length<t&&(n.free(u),u=n.mallocInt32(t)),h.length<t&&(n.free(h),h=n.mallocInt32(t)),p.length<t&&(n.free(p),p=n.mallocInt32(t)),d.length<t&&(n.free(d),d=n.mallocInt32(t));var r=8*t;f.length<r&&(n.free(f),f=n.mallocDouble(r))},sweepBipartite:function(e,t,r,n,i,s,p,d,y,v){for(var x=0,b=2*e,_=e-1,w=b-1,k=r;k<n;++k){var T=s[k],S=b*k;f[x++]=i[S+_],f[x++]=-(T+1),f[x++]=i[S+w],f[x++]=T}for(k=p;k<d;++k){T=v[k]+o;var A=b*k;f[x++]=y[A+_],f[x++]=-T,f[x++]=y[A+w],f[x++]=T}var M=x>>>1;a(f,M);var E=0,C=0;for(k=0;k<M;++k){var P=0|f[2*k+1];if(P>=o)m(u,h,C--,P=P-o|0);else if(P>=0)m(l,c,E--,P);else if(P<=-o){P=-P-o|0;for(var L=0;L<E;++L)if(void 0!==(I=t(l[L],P)))return I;g(u,h,C++,P)}else{for(P=-P-1|0,L=0;L<C;++L){var I;if(void 0!==(I=t(P,u[L])))return I}g(l,c,E++,P)}}},sweepComplete:function(e,t,r,n,i,o,s,y,v,x){for(var b=0,_=2*e,w=e-1,k=_-1,T=r;T<n;++T){var S=o[T]+1<<1,A=_*T;f[b++]=i[A+w],f[b++]=-S,f[b++]=i[A+k],f[b++]=S}for(T=s;T<y;++T){S=x[T]+1<<1;var M=_*T;f[b++]=v[M+w],f[b++]=1|-S,f[b++]=v[M+k],f[b++]=1|S}var E=b>>>1;a(f,E);var C=0,P=0,L=0;for(T=0;T<E;++T){var I=0|f[2*T+1],z=1&I;if(T<E-1&&I>>1===f[2*T+3]>>1&&(z=2,T+=1),I<0){for(var O=-(I>>1)-1,R=0;R<L;++R)if(void 0!==(D=t(p[R],O)))return D;if(0!==z)for(R=0;R<C;++R)if(void 0!==(D=t(l[R],O)))return D;if(1!==z)for(R=0;R<P;++R){var D;if(void 0!==(D=t(u[R],O)))return D}0===z?g(l,c,C++,O):1===z?g(u,h,P++,O):2===z&&g(p,d,L++,O)}else O=(I>>1)-1,0===z?m(l,c,C--,O):1===z?m(u,h,P--,O):2===z&&m(p,d,L--,O)}},scanBipartite:function(e,t,r,n,i,s,u,h,p,d,y,v){var x=0,b=2*e,_=t,w=t+e,k=1,T=1;n?T=o:k=o;for(var S=i;S<s;++S){var A=S+k,M=b*S;f[x++]=u[M+_],f[x++]=-A,f[x++]=u[M+w],f[x++]=A}for(S=p;S<d;++S){A=S+T;var E=b*S;f[x++]=y[E+_],f[x++]=-A}var C=x>>>1;a(f,C);var P=0;for(S=0;S<C;++S){var L=0|f[2*S+1];if(L<0){var I=!1;if((A=-L)>=o?(I=!n,A-=o):(I=!!n,A-=1),I)g(l,c,P++,A);else{var z=v[A],O=b*A,R=y[O+t+1],D=y[O+t+1+e];e:for(var j=0;j<P;++j){var F=l[j],B=b*F;if(!(D<u[B+t+1]||u[B+t+1+e]<R)){for(var N=t+2;N<e;++N)if(y[O+N+e]<u[B+N]||u[B+N+e]<y[O+N])continue e;var U,V=h[F];if(void 0!==(U=n?r(z,V):r(V,z)))return U}}}}else m(l,c,P--,L-k)}},scanComplete:function(e,t,r,n,i,s,c,u,h,p,d){for(var m=0,g=2*e,y=t,v=t+e,x=n;x<i;++x){var b=x+o,_=g*x;f[m++]=s[_+y],f[m++]=-b,f[m++]=s[_+v],f[m++]=b}for(x=u;x<h;++x){b=x+1;var w=g*x;f[m++]=p[w+y],f[m++]=-b}var k=m>>>1;a(f,k);var T=0;for(x=0;x<k;++x){var S=0|f[2*x+1];if(S<0)if((b=-S)>=o)l[T++]=b-o;else{var A=d[b-=1],M=g*b,E=p[M+t+1],C=p[M+t+1+e];e:for(var P=0;P<T;++P){var L=l[P],I=c[L];if(I===A)break;var z=g*L;if(!(C<s[z+t+1]||s[z+t+1+e]<E)){for(var O=t+2;O<e;++O)if(p[M+O+e]<s[z+O]||s[z+O+e]<p[M+O])continue e;var R=r(I,A);if(void 0!==R)return R}}}else{for(b=S-o,P=T-1;P>=0;--P)if(l[P]===b){for(O=P+1;O<T;++O)l[O-1]=l[O];break}--T}}}};var n=r(1888),i=r(8828),a=r(4192),o=1<<28,s=1024,l=n.mallocInt32(s),c=n.mallocInt32(s),u=n.mallocInt32(s),h=n.mallocInt32(s),p=n.mallocInt32(s),d=n.mallocInt32(s),f=n.mallocDouble(8192);function m(e,t,r,n){var i=t[n],a=e[r-1];e[i]=a,t[a]=i}function g(e,t,r,n){e[r]=n,t[n]=r}},2538:function(e,t,r){var n=r(8902),i=r(5542),a=r(2272),o=r(5023);function s(e){return[Math.min(e[0],e[1]),Math.max(e[0],e[1])]}function l(e,t){return e[0]-t[0]||e[1]-t[1]}function c(e,t,r){return t in e?e[t]:r}e.exports=function(e,t,r){Array.isArray(t)?(r=r||{},t=t||[]):(r=t||{},t=[]);var u=!!c(r,"delaunay",!0),h=!!c(r,"interior",!0),p=!!c(r,"exterior",!0),d=!!c(r,"infinity",!1);if(!h&&!p||0===e.length)return[];var f=n(e,t);if(u||h!==p||d){for(var m=i(e.length,function(e){return e.map(s).sort(l)}(t)),g=0;g<f.length;++g){var y=f[g];m.addTriangle(y[0],y[1],y[2])}return u&&a(e,m),p?h?d?o(m,0,d):m.cells():o(m,1,d):o(m,-1)}return f}},2272:function(e,t,r){var n=r(2646)[4];function i(e,t,r,i,a,o){var s=t.opposite(i,a);if(!(s<0)){if(a<i){var l=i;i=a,a=l,l=o,o=s,s=l}t.isConstraint(i,a)||n(e[i],e[a],e[o],e[s])<0&&r.push(i,a)}}r(2478),e.exports=function(e,t){for(var r=[],a=e.length,o=t.stars,s=0;s<a;++s)for(var l=o[s],c=1;c<l.length;c+=2)if(!((d=l[c])<s)&&!t.isConstraint(s,d)){for(var u=l[c-1],h=-1,p=1;p<l.length;p+=2)if(l[p-1]===d){h=l[p];break}h<0||n(e[s],e[d],e[u],e[h])<0&&r.push(s,d)}for(;r.length>0;){for(var d=r.pop(),f=(u=-1,h=-1,l=o[s=r.pop()],1);f<l.length;f+=2){var m=l[f-1],g=l[f];m===d?h=g:g===d&&(u=m)}u<0||h<0||n(e[s],e[d],e[u],e[h])>=0||(t.flip(s,d),i(e,t,r,u,s,h),i(e,t,r,s,h,u),i(e,t,r,h,d,u),i(e,t,r,d,u,h))}}},5023:function(e,t,r){var n=r(2478);function i(e,t,r,n,i,a,o){this.cells=e,this.neighbor=t,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function a(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}e.exports=function(e,t,r){var n=function(e,t){for(var r=e.cells(),n=r.length,o=0;o<n;++o){var s=(y=r[o])[0],l=y[1],c=y[2];l<c?l<s&&(y[0]=l,y[1]=c,y[2]=s):c<s&&(y[0]=c,y[1]=s,y[2]=l)}r.sort(a);var u=new Array(n);for(o=0;o<u.length;++o)u[o]=0;var h=[],p=[],d=new Array(3*n),f=new Array(3*n),m=null;t&&(m=[]);var g=new i(r,d,f,u,h,p,m);for(o=0;o<n;++o)for(var y=r[o],v=0;v<3;++v){s=y[v],l=y[(v+1)%3];var x=d[3*o+v]=g.locate(l,s,e.opposite(l,s)),b=f[3*o+v]=e.isConstraint(s,l);x<0&&(b?p.push(o):(h.push(o),u[o]=1),t&&m.push([l,s,-1]))}return g}(e,r);if(0===t)return r?n.cells.concat(n.boundary):n.cells;for(var o=1,s=n.active,l=n.next,c=n.flags,u=n.cells,h=n.constraint,p=n.neighbor;s.length>0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var f=0;f<3;++f){var m=p[3*d+f];m>=0&&0===c[m]&&(h[3*d+f]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var y=function(e,t,r){for(var n=0,i=0;i<e.length;++i)t[i]===r&&(e[n++]=e[i]);return e.length=n,e}(u,c,t);return r?y.concat(n.boundary):y},i.prototype.locate=function(){var e=[0,0,0];return function(t,r,i){var o=t,s=r,l=i;return r<i?r<t&&(o=r,s=i,l=t):i<t&&(o=i,s=t,l=r),o<0?-1:(e[0]=o,e[1]=s,e[2]=l,n.eq(this.cells,e,a))}}()},8902:function(e,t,r){var n=r(2478),i=r(3250)[3];function a(e,t,r,n,i){this.a=e,this.b=t,this.idx=r,this.lowerIds=n,this.upperIds=i}function o(e,t,r,n){this.a=e,this.b=t,this.type=r,this.idx=n}function s(e,t){var r=e.a[0]-t.a[0]||e.a[1]-t.a[1]||e.type-t.type;return r||(0!==e.type&&(r=i(e.a,e.b,t.b))?r:e.idx-t.idx)}function l(e,t){return i(e.a,e.b,t)}function c(e,t,r,a,o){for(var s=n.lt(t,a,l),c=n.gt(t,a,l),u=s;u<c;++u){for(var h=t[u],p=h.lowerIds,d=p.length;d>1&&i(r[p[d-2]],r[p[d-1]],a)>0;)e.push([p[d-1],p[d-2],o]),d-=1;p.length=d,p.push(o);var f=h.upperIds;for(d=f.length;d>1&&i(r[f[d-2]],r[f[d-1]],a)<0;)e.push([f[d-2],f[d-1],o]),d-=1;f.length=d,f.push(o)}}function u(e,t){var r;return(r=e.a[0]<t.a[0]?i(e.a,e.b,t.a):i(t.b,t.a,e.a))?r:(r=t.b[0]<e.b[0]?i(e.a,e.b,t.b):i(t.b,t.a,e.b))||e.idx-t.idx}function h(e,t,r){var i=n.le(e,r,u),o=e[i],s=o.upperIds,l=s[s.length-1];o.upperIds=[l],e.splice(i+1,0,new a(r.a,r.b,r.idx,[l],s))}function p(e,t,r){var i=r.a;r.a=r.b,r.b=i;var a=n.eq(e,r,u),o=e[a];e[a-1].upperIds=o.upperIds,e.splice(a,1)}e.exports=function(e,t){for(var r=e.length,n=t.length,i=[],l=0;l<r;++l)i.push(new o(e[l],null,0,l));for(l=0;l<n;++l){var u=t[l],d=e[u[0]],f=e[u[1]];d[0]<f[0]?i.push(new o(d,f,2,l),new o(f,d,1,l)):d[0]>f[0]&&i.push(new o(f,d,2,l),new o(d,f,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],y=[],v=(l=0,i.length);l<v;++l){var x=i[l],b=x.type;0===b?c(y,g,e,x.a,x.idx):2===b?h(g,0,x):p(g,0,x)}return y}},5542:function(e,t,r){var n=r(2478);function i(e,t){this.stars=e,this.edges=t}e.exports=function(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=[];return new i(r,t)};var a=i.prototype;function o(e,t,r){for(var n=1,i=e.length;n<i;n+=2)if(e[n-1]===t&&e[n]===r)return e[n-1]=e[i-2],e[n]=e[i-1],void(e.length=i-2)}a.isConstraint=function(){var e=[0,0];function t(e,t){return e[0]-t[0]||e[1]-t[1]}return function(r,i){return e[0]=Math.min(r,i),e[1]=Math.max(r,i),n.eq(this.edges,e,t)>=0}}(),a.removeTriangle=function(e,t,r){var n=this.stars;o(n[e],t,r),o(n[t],r,e),o(n[r],e,t)},a.addTriangle=function(e,t,r){var n=this.stars;n[e].push(t,r),n[t].push(r,e),n[r].push(e,t)},a.opposite=function(e,t){for(var r=this.stars[t],n=1,i=r.length;n<i;n+=2)if(r[n]===e)return r[n-1];return-1},a.flip=function(e,t){var r=this.opposite(e,t),n=this.opposite(t,e);this.removeTriangle(e,t,r),this.removeTriangle(t,e,n),this.addTriangle(e,n,r),this.addTriangle(t,r,n)},a.edges=function(){for(var e=this.stars,t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length;a<o;a+=2)t.push([i[a],i[a+1]]);return t},a.cells=function(){for(var e=this.stars,t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length;a<o;a+=2){var s=i[a],l=i[a+1];r<Math.min(s,l)&&t.push([r,s,l])}return t}},2419:function(e){e.exports=function(e){for(var t=1,r=1;r<e.length;++r)for(var n=0;n<r;++n)if(e[r]<e[n])t=-t;else if(e[n]===e[r])return 0;return t}},3628:function(e,t,r){var n=r(1338),i=r(727);function a(e,t){for(var r=0,n=e.length,i=0;i<n;++i)r+=e[i]*t[i];return r}function o(e){var t=e.length;if(0===t)return[];e[0].length;var r=n([e.length+1,e.length+1],1),o=n([e.length+1],1);r[t][t]=0;for(var s=0;s<t;++s){for(var l=0;l<=s;++l)r[l][s]=r[s][l]=2*a(e[s],e[l]);o[s]=a(e[s],e[s])}var c=i(r,o),u=0,h=c[t+1];for(s=0;s<h.length;++s)u+=h[s];var p=new Array(t);for(s=0;s<t;++s){h=c[s];var d=0;for(l=0;l<h.length;++l)d+=h[l];p[s]=d/u}return p}function s(e){if(0===e.length)return[];for(var t=e[0].length,r=n([t]),i=o(e),a=0;a<e.length;++a)for(var s=0;s<t;++s)r[s]+=e[a][s]*i[a];return r}s.barycenetric=o,e.exports=s},6037:function(e,t,r){e.exports=function(e){for(var t=n(e),r=0,i=0;i<e.length;++i)for(var a=e[i],o=0;o<t.length;++o)r+=Math.pow(a[o]-t[o],2);return Math.sqrt(r/e.length)};var n=r(3628)},332:function(e,t,r){e.exports=function(e,t,r){var n;if(r){n=t;for(var i=new Array(t.length),a=0;a<t.length;++a){var o=t[a];i[a]=[o[0],o[1],r[a]]}t=i}for(var s=function(e,t,r){var n=f(e,[],d(e));return y(t,n,r),!!n}(e,t,!!r);v(e,t,!!r);)s=!0;if(r&&s)for(n.length=0,r.length=0,a=0;a<t.length;++a)o=t[a],n.push([o[0],o[1]]),r.push(o[2]);return s};var n=r(1755),i=r(6867),a=r(1125),o=r(7842),s=r(1318),l=r(946),c=r(5838),u=r(1278),h=r(3637);function p(e){var t=l(e);return[u(t,-1/0),u(t,1/0)]}function d(e){for(var t=new Array(e.length),r=0;r<e.length;++r){var n=e[r];t[r]=[u(n[0],-1/0),u(n[1],-1/0),u(n[0],1/0),u(n[1],1/0)]}return t}function f(e,t,r){for(var a=t.length,o=new n(a),s=[],l=0;l<t.length;++l){var c=t[l],h=p(c[0]),d=p(c[1]);s.push([u(h[0],-1/0),u(d[0],-1/0),u(h[1],1/0),u(d[1],1/0)])}i(s,(function(e,t){o.link(e,t)}));var f=!0,m=new Array(a);for(l=0;l<a;++l)(y=o.find(l))!==l&&(f=!1,e[y]=[Math.min(e[l][0],e[y][0]),Math.min(e[l][1],e[y][1])]);if(f)return null;var g=0;for(l=0;l<a;++l){var y;(y=o.find(l))===l?(m[l]=g,e[g++]=e[l]):m[l]=-1}for(e.length=g,l=0;l<a;++l)m[l]<0&&(m[l]=m[o.find(l)]);return m}function m(e,t){return e[0]-t[0]||e[1]-t[1]}function g(e,t){var r=e[0]-t[0]||e[1]-t[1];return r||(e[2]<t[2]?-1:e[2]>t[2]?1:0)}function y(e,t,r){if(0!==e.length){if(t)for(var n=0;n<e.length;++n){var i=t[(o=e[n])[0]],a=t[o[1]];o[0]=Math.min(i,a),o[1]=Math.max(i,a)}else for(n=0;n<e.length;++n){var o;i=(o=e[n])[0],a=o[1],o[0]=Math.min(i,a),o[1]=Math.max(i,a)}r?e.sort(g):e.sort(m);var s=1;for(n=1;n<e.length;++n){var l=e[n-1],c=e[n];(c[0]!==l[0]||c[1]!==l[1]||r&&c[2]!==l[2])&&(e[s++]=c)}e.length=s}}function v(e,t,r){var n=function(e,t){for(var r=new Array(t.length),n=0;n<t.length;++n){var i=t[n],a=e[i[0]],o=e[i[1]];r[n]=[u(Math.min(a[0],o[0]),-1/0),u(Math.min(a[1],o[1]),-1/0),u(Math.max(a[0],o[0]),1/0),u(Math.max(a[1],o[1]),1/0)]}return r}(e,t),p=function(e,t,r){var n=[];return i(r,(function(r,i){var o=t[r],s=t[i];if(o[0]!==s[0]&&o[0]!==s[1]&&o[1]!==s[0]&&o[1]!==s[1]){var l=e[o[0]],c=e[o[1]],u=e[s[0]],h=e[s[1]];a(l,c,u,h)&&n.push([r,i])}})),n}(e,t,n),m=d(e),g=function(e,t,r,n){var o=[];return i(r,n,(function(r,n){var i=t[r];if(i[0]!==n&&i[1]!==n){var s=e[n],l=e[i[0]],c=e[i[1]];a(l,c,s,s)&&o.push([r,n])}})),o}(e,t,n,m),v=function(e,t,r,n,i){var a,u,p=e.map((function(e){return[o(e[0]),o(e[1])]}));for(a=0;a<r.length;++a){var d=r[a];u=d[0];var f=d[1],m=t[u],g=t[f],y=h(c(e[m[0]]),c(e[m[1]]),c(e[g[0]]),c(e[g[1]]));if(y){var v=e.length;e.push([l(y[0]),l(y[1])]),p.push(y),n.push([u,v],[f,v])}}for(n.sort((function(e,t){if(e[0]!==t[0])return e[0]-t[0];var r=p[e[1]],n=p[t[1]];return s(r[0],n[0])||s(r[1],n[1])})),a=n.length-1;a>=0;--a){var x=t[u=(M=n[a])[0]],b=x[0],_=x[1],w=e[b],k=e[_];if((w[0]-k[0]||w[1]-k[1])<0){var T=b;b=_,_=T}x[0]=b;var S,A=x[1]=M[1];for(i&&(S=x[2]);a>0&&n[a-1][0]===u;){var M,E=(M=n[--a])[1];i?t.push([A,E,S]):t.push([A,E]),A=E}i?t.push([A,_,S]):t.push([A,_])}return p}(e,t,p,g,r),x=f(e,v);return y(t,x,r),!!x||p.length>0||g.length>0}},3637:function(e,t,r){e.exports=function(e,t,r,n){var a=s(t,e),h=s(n,r),p=u(a,h);if(0===o(p))return null;var d=s(e,r),f=u(h,d),m=i(f,p),g=c(a,m);return l(e,g)};var n=r(6504),i=r(8697),a=r(5572),o=r(7721),s=r(544),l=r(2653),c=r(8987);function u(e,t){return a(n(e[0],t[1]),n(e[1],t[0]))}},3642:function(e){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},6729:function(e,t,r){var n=r(3642),i=r(395);function a(e){return[e[0]/255,e[1]/255,e[2]/255,e[3]]}function o(e){for(var t,r="#",n=0;n<3;++n)r+=("00"+(t=(t=e[n]).toString(16))).substr(t.length);return r}function s(e){return"rgba("+e.join(",")+")"}e.exports=function(e){var t,r,l,c,u,h,p,d,f,m;if(e||(e={}),d=(e.nshades||72)-1,p=e.format||"hex",(h=e.colormap)||(h="jet"),"string"===typeof h){if(h=h.toLowerCase(),!n[h])throw Error(h+" not a supported colorscale");u=n[h]}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);u=h.slice()}if(u.length>d+1)throw new Error(h+" map requires nshades to be at least size "+u.length);f=Array.isArray(e.alpha)?2!==e.alpha.length?[1,1]:e.alpha.slice():"number"===typeof e.alpha?[e.alpha,e.alpha]:[1,1],t=u.map((function(e){return Math.round(e.index*d)})),f[0]=Math.min(Math.max(f[0],0),1),f[1]=Math.min(Math.max(f[1],0),1);var g=u.map((function(e,t){var r=u[t].index,n=u[t].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=f[0]+(f[1]-f[0])*r),n})),y=[];for(m=0;m<t.length-1;++m){c=t[m+1]-t[m],r=g[m],l=g[m+1];for(var v=0;v<c;v++){var x=v/c;y.push([Math.round(i(r[0],l[0],x)),Math.round(i(r[1],l[1],x)),Math.round(i(r[2],l[2],x)),i(r[3],l[3],x)])}}return y.push(u[u.length-1].rgb.concat(f[1])),"hex"===p?y=y.map(o):"rgbaString"===p?y=y.map(s):"float"===p&&(y=y.map(a)),y}},3140:function(e,t,r){e.exports=function(e,t,r,a){var o=n(t,r,a);if(0===o){var s=i(n(e,t,r)),c=i(n(e,t,a));if(s===c){if(0===s){var u=l(e,t,r);return u===l(e,t,a)?0:u?1:-1}return 0}return 0===c?s>0||l(e,t,a)?-1:1:0===s?c>0||l(e,t,r)?1:-1:i(c-s)}var h=n(e,t,r);return h>0?o>0&&n(e,t,a)>0?1:-1:h<0?o>0||n(e,t,a)>0?1:-1:n(e,t,a)>0||l(e,t,r)?1:-1};var n=r(3250),i=r(8572),a=r(9362),o=r(5382),s=r(8210);function l(e,t,r){var n=a(e[0],-t[0]),i=a(e[1],-t[1]),l=a(r[0],-t[0]),c=a(r[1],-t[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},8572:function(e){e.exports=function(e){return e<0?-1:e>0?1:0}},8507:function(e){e.exports=function(e,n){var i=e.length,a=e.length-n.length;if(a)return a;switch(i){case 0:return 0;case 1:return e[0]-n[0];case 2:return e[0]+e[1]-n[0]-n[1]||t(e[0],e[1])-t(n[0],n[1]);case 3:var o=e[0]+e[1],s=n[0]+n[1];if(a=o+e[2]-(s+n[2]))return a;var l=t(e[0],e[1]),c=t(n[0],n[1]);return t(l,e[2])-t(c,n[2])||t(l+e[2],o)-t(c+n[2],s);case 4:var u=e[0],h=e[1],p=e[2],d=e[3],f=n[0],m=n[1],g=n[2],y=n[3];return u+h+p+d-(f+m+g+y)||t(u,h,p,d)-t(f,m,g,y,f)||t(u+h,u+p,u+d,h+p,h+d,p+d)-t(f+m,f+g,f+y,m+g,m+y,g+y)||t(u+h+p,u+h+d,u+p+d,h+p+d)-t(f+m+g,f+m+y,f+g+y,m+g+y);default:for(var v=e.slice().sort(r),x=n.slice().sort(r),b=0;b<i;++b)if(a=v[b]-x[b])return a;return 0}};var t=Math.min;function r(e,t){return e-t}},3788:function(e,t,r){var n=r(8507),i=r(2419);e.exports=function(e,t){return n(e,t)||i(e)-i(t)}},7352:function(e,t,r){var n=r(5721),i=r(4750),a=r(2690);e.exports=function(e){var t=e.length;if(0===t)return[];if(1===t)return[[0]];var r=e[0].length;return 0===r?[]:1===r?n(e):2===r?i(e):a(e,r)}},5721:function(e){e.exports=function(e){for(var t=0,r=0,n=1;n<e.length;++n)e[n][0]<e[t][0]&&(t=n),e[n][0]>e[r][0]&&(r=n);return t<r?[[t],[r]]:t>r?[[r],[t]]:[[t]]}},4750:function(e,t,r){e.exports=function(e){var t=n(e),r=t.length;if(r<=2)return[];for(var i=new Array(r),a=t[r-1],o=0;o<r;++o){var s=t[o];i[o]=[a,s],a=s}return i};var n=r(3090)},2690:function(e,t,r){e.exports=function(e,t){try{return n(e,!0)}catch(o){var r=i(e);if(r.length<=t)return[];var a=function(e,t){for(var r=e.length,n=new Array(r),i=0;i<t.length;++i)n[i]=e[t[i]];var a=t.length;for(i=0;i<r;++i)t.indexOf(i)<0&&(n[a++]=e[i]);return n}(e,r);return function(e,t){for(var r=e.length,n=t.length,i=0;i<r;++i)for(var a=e[i],o=0;o<a.length;++o){var s=a[o];if(s<n)a[o]=t[s];else{s-=n;for(var l=0;l<n;++l)s>=t[l]&&(s+=1);a[o]=s}}return e}(n(a,!0),r)}};var n=r(8954),i=r(3952)},4769:function(e){e.exports=function(e,t,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),p=s*o;if(e.length){a||(a=new Array(e.length));for(var d=e.length-1;d>=0;--d)a[d]=c*e[d]+u*t[d]+h*r[d]+p*n[d];return a}return c*e+u*t+h*r+p*n},e.exports.derivative=function(e,t,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(e.length){a||(a=new Array(e.length));for(var u=e.length-1;u>=0;--u)a[u]=o*e[u]+s*t[u]+l*r[u]+c*n[u];return a}return o*e+s*t+l*r[u]+c*n}},7642:function(e,t,r){var n=r(8954),i=r(1682);function a(e,t){this.point=e,this.index=t}function o(e,t){for(var r=e.point,n=t.point,i=r.length,a=0;a<i;++a){var o=n[a]-r[a];if(o)return o}return 0}e.exports=function(e,t){var r=e.length;if(0===r)return[];var s=e[0].length;if(s<1)return[];if(1===s)return function(e,t,r){if(1===e)return r?[[-1,0]]:[];var n=t.map((function(e,t){return[e[0],t]}));n.sort((function(e,t){return e[0]-t[0]}));for(var i=new Array(e-1),a=1;a<e;++a){var o=n[a-1],s=n[a];i[a-1]=[o[1],s[1]]}return r&&i.push([-1,i[0][1]],[i[e-1][1],-1]),i}(r,e,t);for(var l=new Array(r),c=1,u=0;u<r;++u){for(var h=e[u],p=new Array(s+1),d=0,f=0;f<s;++f){var m=h[f];p[f]=m,d+=m*m}p[s]=d,l[u]=new a(p,u),c=Math.max(d,c)}i(l,o),r=l.length;var g=new Array(r+s+1),y=new Array(r+s+1),v=(s+1)*(s+1)*c,x=new Array(s+1);for(u=0;u<=s;++u)x[u]=0;for(x[s]=v,g[0]=x.slice(),y[0]=-1,u=0;u<=s;++u)(p=x.slice())[u]=1,g[u+1]=p,y[u+1]=-1;for(u=0;u<r;++u){var b=l[u];g[u+s+1]=b.point,y[u+s+1]=b.index}var _=n(g,!1);if(_=t?_.filter((function(e){for(var t=0,r=0;r<=s;++r){var n=y[e[r]];if(n<0&&++t>=2)return!1;e[r]=n}return!0})):_.filter((function(e){for(var t=0;t<=s;++t){var r=y[e[t]];if(r<0)return!1;e[t]=r}return!0})),1&s)for(u=0;u<_.length;++u)p=(b=_[u])[0],b[0]=b[1],b[1]=p;return _}},2361:function(e){var t=!1;if("undefined"!==typeof Float64Array){var r=new Float64Array(1),n=new Uint32Array(r.buffer);if(r[0]=1,t=!0,1072693248===n[1]){let t=function(e,t){return n[0]=e,n[1]=t,r[0]},i=function(e){return r[0]=e,n[0]},a=function(e){return r[0]=e,n[1]};e.exports=function(e){return r[0]=e,[n[0],n[1]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else if(1072693248===n[0]){let t=function(e,t){return n[1]=e,n[0]=t,r[0]},i=function(e){return r[0]=e,n[1]},a=function(e){return r[0]=e,n[0]};e.exports=function(e){return r[0]=e,[n[1],n[0]]},e.exports.pack=t,e.exports.lo=i,e.exports.hi=a}else t=!1}if(!t){let t=function(e,t){return i.writeUInt32LE(e,0,!0),i.writeUInt32LE(t,4,!0),i.readDoubleLE(0,!0)},r=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(0,!0)},n=function(e){return i.writeDoubleLE(e,0,!0),i.readUInt32LE(4,!0)};var i=new Buffer(8);e.exports=function(e){return i.writeDoubleLE(e,0,!0),[i.readUInt32LE(0,!0),i.readUInt32LE(4,!0)]},e.exports.pack=t,e.exports.lo=r,e.exports.hi=n}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}},1338:function(e){function t(e,r,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=r;else for(a=0;a<i;++a)o[a]=t(e,r,n+1);return o}e.exports=function(e,r){switch("undefined"===typeof r&&(r=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,r);break;case"object":if("number"===typeof e.length)return t(e,r,0)}return[]}},3134:function(e,t,r){e.exports=function(e,t){var r=e.length;if("number"!==typeof t){t=0;for(var i=0;i<r;++i){var a=e[i];t=Math.max(t,a[0],a[1])}t=1+(0|t)}t|=0;var o=new Array(t);for(i=0;i<t;++i)o[i]=[];for(i=0;i<r;++i)o[(a=e[i])[0]].push(a[1]),o[a[1]].push(a[0]);for(var s=0;s<t;++s)n(o[s],(function(e,t){return e-t}));return o};var n=r(1682)},5033:function(e){e.exports=function(e,t,r){var n=t||0,i=r||1;return[[e[12]+e[0],e[13]+e[1],e[14]+e[2],e[15]+e[3]],[e[12]-e[0],e[13]-e[1],e[14]-e[2],e[15]-e[3]],[e[12]+e[4],e[13]+e[5],e[14]+e[6],e[15]+e[7]],[e[12]-e[4],e[13]-e[5],e[14]-e[6],e[15]-e[7]],[n*e[12]+e[8],n*e[13]+e[9],n*e[14]+e[10],n*e[15]+e[11]],[i*e[12]-e[8],i*e[13]-e[9],i*e[14]-e[10],i*e[15]-e[11]]]}},9215:function(e,t,r){e.exports=function(e,t,r){switch(arguments.length){case 0:return new o([0],[0],0);case 1:return"number"===typeof e?new o(n=l(e),n,0):new o(e,l(e.length),0);case 2:var n;if("number"===typeof t)return new o(e,n=l(e.length),+t);r=0;case 3:if(e.length!==t.length)throw new Error("state and velocity lengths must match");return new o(e,t,r)}};var n=r(4769),i=r(2478);function a(e,t,r){return Math.min(t,Math.max(e,r))}function o(e,t,r){this.dimension=e.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n<this.dimension;++n)this.bounds[0][n]=-1/0,this.bounds[1][n]=1/0;this._state=e.slice().reverse(),this._velocity=t.slice().reverse(),this._time=[r],this._scratch=[e.slice(),e.slice(),e.slice(),e.slice(),e.slice()]}var s=o.prototype;function l(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=0;return t}s.flush=function(e){var t=i.gt(this._time,e)-1;t<=0||(this._time.splice(0,t),this._state.splice(0,t*this.dimension),this._velocity.splice(0,t*this.dimension))},s.curve=function(e){var t=this._time,r=t.length,o=i.le(t,e),s=this._scratch[0],l=this._state,c=this._velocity,u=this.dimension,h=this.bounds;if(o<0)for(var p=u-1,d=0;d<u;++d,--p)s[d]=l[p];else if(o>=r-1){p=l.length-1;var f=e-t[r-1];for(d=0;d<u;++d,--p)s[d]=l[p]+f*c[p]}else{p=u*(o+1)-1;var m=t[o],g=t[o+1]-m||1,y=this._scratch[1],v=this._scratch[2],x=this._scratch[3],b=this._scratch[4],_=!0;for(d=0;d<u;++d,--p)y[d]=l[p],x[d]=c[p]*g,v[d]=l[p+u],b[d]=c[p+u]*g,_=_&&y[d]===v[d]&&x[d]===b[d]&&0===x[d];if(_)for(d=0;d<u;++d)s[d]=y[d];else n(y,x,v,b,(e-m)/g,s)}var w=h[0],k=h[1];for(d=0;d<u;++d)s[d]=a(w[d],k[d],s[d]);return s},s.dcurve=function(e){var t=this._time,r=t.length,a=i.le(t,e),o=this._scratch[0],s=this._state,l=this._velocity,c=this.dimension;if(a>=r-1)for(var u=s.length-1,h=(t[r-1],0);h<c;++h,--u)o[h]=l[u];else{u=c*(a+1)-1;var p=t[a],d=t[a+1]-p||1,f=this._scratch[1],m=this._scratch[2],g=this._scratch[3],y=this._scratch[4],v=!0;for(h=0;h<c;++h,--u)f[h]=s[u],g[h]=l[u]*d,m[h]=s[u+c],y[h]=l[u+c]*d,v=v&&f[h]===m[h]&&g[h]===y[h]&&0===g[h];if(v)for(h=0;h<c;++h)o[h]=0;else for(n.derivative(f,g,m,y,(e-p)/d,o),h=0;h<c;++h)o[h]/=d}return o},s.lastT=function(){var e=this._time;return e[e.length-1]},s.stable=function(){for(var e=this._velocity,t=e.length,r=this.dimension-1;r>=0;--r)if(e[--t])return!1;return!0},s.jump=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1];this._time.push(t,e);for(var u=0;u<2;++u)for(var h=0;h<r;++h)n.push(n[o++]),i.push(0);for(this._time.push(e),h=r;h>0;--h)n.push(a(l[h-1],c[h-1],arguments[h])),i.push(0)}},s.push=function(e){var t=this.lastT(),r=this.dimension;if(!(e<t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=e-t,l=this.bounds,c=l[0],u=l[1],h=s>1e-6?1/s:0;this._time.push(e);for(var p=r;p>0;--p){var d=a(c[p-1],u[p-1],arguments[p]);n.push(d),i.push((d-n[o++])*h)}}},s.set=function(e){var t=this.dimension;if(!(e<this.lastT()||arguments.length!==t+1)){var r=this._state,n=this._velocity,i=this.bounds,o=i[0],s=i[1];this._time.push(e);for(var l=t;l>0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(e){var t=this.lastT(),r=this.dimension;if(!(e<=t||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=e-t,h=u>1e-6?1/u:0;this._time.push(e);for(var p=r;p>0;--p){var d=arguments[p];n.push(a(l[p-1],c[p-1],n[o++]+d)),i.push(d*h)}}},s.idle=function(e){var t=this.lastT();if(!(e<t)){var r=this.dimension,n=this._state,i=this._velocity,o=n.length-r,s=this.bounds,l=s[0],c=s[1],u=e-t;this._time.push(e);for(var h=r-1;h>=0;--h)n.push(a(l[h],c[h],n[o]+u*i[o])),i.push(0),o+=1}}},3840:function(e){function t(e,t,r,n,i,a){this._color=e,this.key=t,this.value=r,this.left=n,this.right=i,this._count=a}function r(e){return new t(e._color,e.key,e.value,e.left,e.right,e._count)}function n(e,r){return new t(e,r.key,r.value,r.left,r.right,r._count)}function i(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}e.exports=function(e){return new a(e||d,null)};var o=a.prototype;function s(e,t){var r;return t.left&&(r=s(e,t.left))?r:(r=e(t.key,t.value))||(t.right?s(e,t.right):void 0)}function l(e,t,r,n){if(t(e,n.key)<=0){var i;if(n.left&&(i=l(e,t,r,n.left)))return i;if(i=r(n.key,n.value))return i}if(n.right)return l(e,t,r,n.right)}function c(e,t,r,n,i){var a,o=r(e,i.key),s=r(t,i.key);if(o<=0){if(i.left&&(a=c(e,t,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return c(e,t,r,n,i.right)}function u(e,t){this.tree=e,this._stack=t}Object.defineProperty(o,"keys",{get:function(){var e=[];return this.forEach((function(t,r){e.push(t)})),e}}),Object.defineProperty(o,"values",{get:function(){var e=[];return this.forEach((function(t,r){e.push(r)})),e}}),Object.defineProperty(o,"length",{get:function(){return this.root?this.root._count:0}}),o.insert=function(e,r){for(var o=this._compare,s=this.root,l=[],c=[];s;){var u=o(e,s.key);l.push(s),c.push(u),s=u<=0?s.left:s.right}l.push(new t(0,e,r,null,null,1));for(var h=l.length-2;h>=0;--h)s=l[h],c[h]<=0?l[h]=new t(s._color,s.key,s.value,l[h+1],s.right,s._count+1):l[h]=new t(s._color,s.key,s.value,s.left,l[h+1],s._count+1);for(h=l.length-1;h>1;--h){var p=l[h-1];if(s=l[h],1===p._color||1===s._color)break;var d=l[h-2];if(d.left===p)if(p.left===s){if(!(f=d.right)||0!==f._color){d._color=0,d.left=p.right,p._color=1,p.right=d,l[h-2]=p,l[h-1]=s,i(d),i(p),h>=3&&((m=l[h-3]).left===d?m.left=p:m.right=p);break}p._color=1,d.right=n(1,f),d._color=0,h-=1}else{if(!(f=d.right)||0!==f._color){p.right=s.left,d._color=0,d.left=s.right,s._color=1,s.left=p,s.right=d,l[h-2]=s,l[h-1]=p,i(d),i(p),i(s),h>=3&&((m=l[h-3]).left===d?m.left=s:m.right=s);break}p._color=1,d.right=n(1,f),d._color=0,h-=1}else if(p.right===s){if(!(f=d.left)||0!==f._color){d._color=0,d.right=p.left,p._color=1,p.left=d,l[h-2]=p,l[h-1]=s,i(d),i(p),h>=3&&((m=l[h-3]).right===d?m.right=p:m.left=p);break}p._color=1,d.left=n(1,f),d._color=0,h-=1}else{var f;if(!(f=d.left)||0!==f._color){var m;p.left=s.right,d._color=0,d.right=s.left,s._color=1,s.right=p,s.left=d,l[h-2]=s,l[h-1]=p,i(d),i(p),i(s),h>=3&&((m=l[h-3]).right===d?m.right=s:m.left=s);break}p._color=1,d.left=n(1,f),d._color=0,h-=1}}return l[0]._color=1,new a(o,l[0])},o.forEach=function(e,t,r){if(this.root)switch(arguments.length){case 1:return s(e,this.root);case 2:return l(t,this._compare,e,this.root);case 3:if(this._compare(t,r)>=0)return;return c(t,r,this._compare,e,this.root)}},Object.defineProperty(o,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new u(this,e)}}),Object.defineProperty(o,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new u(this,e)}}),o.at=function(e){if(e<0)return new u(this,[]);for(var t=this.root,r=[];;){if(r.push(t),t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e)return new u(this,r);if(e-=1,!t.right)break;if(e>=t.right._count)break;t=t.right}return new u(this,[])},o.ge=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.gt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.lt=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new u(this,n)},o.le=function(e){for(var t=this._compare,r=this.root,n=[],i=0;r;){var a=t(e,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new u(this,n)},o.find=function(e){for(var t=this._compare,r=this.root,n=[];r;){var i=t(e,r.key);if(n.push(r),0===i)return new u(this,n);r=i<=0?r.left:r.right}return new u(this,[])},o.remove=function(e){var t=this.find(e);return t?t.remove():this},o.get=function(e){for(var t=this._compare,r=this.root;r;){var n=t(e,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var h=u.prototype;function p(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function d(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(h,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(h,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),h.clone=function(){return new u(this.tree,this._stack.slice())},h.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var o=new Array(e.length),s=e[e.length-1];o[o.length-1]=new t(s._color,s.key,s.value,s.left,s.right,s._count);for(var l=e.length-2;l>=0;--l)(s=e[l]).left===e[l+1]?o[l]=new t(s._color,s.key,s.value,o[l+1],s.right,s._count):o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);if((s=o[o.length-1]).left&&s.right){var c=o.length;for(s=s.left;s.right;)o.push(s),s=s.right;var u=o[c-1];for(o.push(new t(s._color,u.key,u.value,s.left,s.right,s._count)),o[c-1].key=s.key,o[c-1].value=s.value,l=o.length-2;l>=c;--l)s=o[l],o[l]=new t(s._color,s.key,s.value,s.left,o[l+1],s._count);o[c-1].left=o[c]}if(0===(s=o[o.length-1])._color){var h=o[o.length-2];for(h.left===s?h.left=null:h.right===s&&(h.right=null),o.pop(),l=0;l<o.length;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(s.left||s.right){for(s.left?p(s,s.left):s.right&&p(s,s.right),s._color=1,l=0;l<o.length-1;++l)o[l]._count--;return new a(this.tree._compare,o[0])}if(1===o.length)return new a(this.tree._compare,null);for(l=0;l<o.length;++l)o[l]._count--;var d=o[o.length-2];return function(e){for(var t,a,o,s,l=e.length-1;l>=0;--l){if(t=e[l],0===l)return void(t._color=1);if((a=e[l-1]).left===t){if((o=a.right).right&&0===o.right._color)return s=(o=a.right=r(o)).right=r(o.right),a.right=o.left,o.left=a,o.right=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),void(e[l-1]=o);if(o.left&&0===o.left._color)return s=(o=a.right=r(o)).left=r(o.left),a.right=s.left,o.left=s.right,s.left=a,s.right=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).left===a?c.left=s:c.right=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.right=n(0,o));a.right=n(0,o);continue}o=r(o),a.right=o.left,o.left=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).left===a?c.left=o:c.right=o),e[l-1]=o,e[l]=a,l+1<e.length?e[l+1]=t:e.push(t),l+=2}else{if((o=a.left).left&&0===o.left._color)return s=(o=a.left=r(o)).left=r(o.left),a.left=o.right,o.right=a,o.left=s,o._color=a._color,t._color=1,a._color=1,s._color=1,i(a),i(o),l>1&&((c=e[l-2]).right===a?c.right=o:c.left=o),void(e[l-1]=o);if(o.right&&0===o.right._color)return s=(o=a.left=r(o)).right=r(o.right),a.left=s.right,o.right=s.left,s.right=a,s.left=o,s._color=a._color,a._color=1,o._color=1,t._color=1,i(a),i(o),i(s),l>1&&((c=e[l-2]).right===a?c.right=s:c.left=s),void(e[l-1]=s);if(1===o._color){if(0===a._color)return a._color=1,void(a.left=n(0,o));a.left=n(0,o);continue}var c;o=r(o),a.left=o.right,o.right=a,o._color=a._color,a._color=0,i(a),i(o),l>1&&((c=e[l-2]).right===a?c.right=o:c.left=o),e[l-1]=o,e[l]=a,l+1<e.length?e[l+1]=t:e.push(t),l+=2}}}(o),d.left===s?d.left=null:d.right=null,new a(this.tree._compare,o[0])},Object.defineProperty(h,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(h,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(h,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var r=this.tree.root;return r?r._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var n=t.length-2;n>=0;--n)t[n+1]===t[n].right&&(++e,t[n].left&&(e+=t[n].left._count));return e},enumerable:!0}),h.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),h.update=function(e){var r=this._stack;if(0===r.length)throw new Error("Can't update empty node!");var n=new Array(r.length),i=r[r.length-1];n[n.length-1]=new t(i._color,i.key,e,i.left,i.right,i._count);for(var o=r.length-2;o>=0;--o)(i=r[o]).left===r[o+1]?n[o]=new t(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new t(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},h.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(h,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},3837:function(e,t,r){e.exports=function(e,t){var r=new d(e);return r.update(t),r};var n=r(4935),i=r(501),a=r(5304),o=r(6429),s=r(6444),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),c=ArrayBuffer,u=DataView;function h(e){return Array.isArray(e)||function(e){return c.isView(e)&&!(e instanceof u)}(e)}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function d(e){this.gl=e,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickFontStyle=["normal","normal","normal"],this.tickFontWeight=["normal","normal","normal"],this.tickFontVariant=["normal","normal","normal"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["sans-serif","sans-serif","sans-serif"],this.labelFontStyle=["normal","normal","normal"],this.labelFontWeight=["normal","normal","normal"],this.labelFontVariant=["normal","normal","normal"],this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(e)}var f=d.prototype;function m(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(e){function t(t,r,n){if(n in e){var i,a=e[n],o=this[n];(t?h(a)&&h(a[0]):h(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}e=e||{};var r,a=t.bind(this,!1,Number),o=t.bind(this,!1,Boolean),l=t.bind(this,!1,String),c=t.bind(this,!0,(function(e){if(h(e)){if(3===e.length)return[+e[0],+e[1],+e[2],1];if(4===e.length)return[+e[0],+e[1],+e[2],+e[3]]}return[0,0,0,1]})),u=!1,p=!1;if("bounds"in e)for(var d=e.bounds,f=0;f<2;++f)for(var m=0;m<3;++m)d[f][m]!==this.bounds[f][m]&&(p=!0),this.bounds[f][m]=d[f][m];if("ticks"in e)for(r=e.ticks,u=!0,this.autoTicks=!1,f=0;f<3;++f)this.tickSpacing[f]=0;else a("tickSpacing")&&(this.autoTicks=!0,p=!0);if(this._firstInit&&("ticks"in e||"tickSpacing"in e||(this.autoTicks=!0),p=!0,u=!0,this._firstInit=!1),p&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(f=0;f<3;++f)r[f].sort((function(e,t){return e.x-t.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),l("tickFontStyle")&&(u=!0),l("tickFontWeight")&&(u=!0),l("tickFontVariant")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var g=l("labels");l("labelFont")&&(g=!0),l("labelFontStyle")&&(g=!0),l("labelFontWeight")&&(g=!0),l("labelFontVariant")&&(g=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor");var y=[{family:this.labelFont[0],style:this.labelFontStyle[0],weight:this.labelFontWeight[0],variant:this.labelFontVariant[0]},{family:this.labelFont[1],style:this.labelFontStyle[1],weight:this.labelFontWeight[1],variant:this.labelFontVariant[1]},{family:this.labelFont[2],style:this.labelFontStyle[2],weight:this.labelFontWeight[2],variant:this.labelFontVariant[2]}],v=[{family:this.tickFont[0],style:this.tickFontStyle[0],weight:this.tickFontWeight[0],variant:this.tickFontVariant[0]},{family:this.tickFont[1],style:this.tickFontStyle[1],weight:this.tickFontWeight[1],variant:this.tickFontVariant[1]},{family:this.tickFont[2],style:this.tickFontStyle[2],weight:this.tickFontWeight[2],variant:this.tickFontVariant[2]}];this._text?this._text&&(g||u)&&this._text.update(this.bounds,this.labels,y,this.ticks,v):this._text=n(this.gl,this.bounds,this.labels,y,this.ticks,v),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var g=[new m,new m,new m];function y(e,t,r,n,i){for(var a=e.primalOffset,o=e.primalMinor,s=e.mirrorOffset,l=e.mirrorMinor,c=n[t],u=0;u<3;++u)if(t!==u){var h=a,p=s,d=o,f=l;c&1<<u&&(h=s,p=a,d=l,f=o),h[u]=r[0][u],p[u]=r[1][u],i[u]>0?(d[u]=-1,f[u]=0):(d[u]=0,f[u]=1)}}var v=[0,0,0],x={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(e){};var b=[0,0,0],_=[0,0,0],w=[0,0,0];f.draw=function(e){e=e||x;for(var t=this.gl,r=e.model||l,n=e.view||l,i=e.projection||l,a=this.bounds,s=e._ortho||!1,c=o(r,n,i,a,s),u=c.cubeEdges,h=c.axis,d=n[12],f=n[13],m=n[14],k=n[15],T=(s?2:1)*this.pixelRatio*(i[3]*d+i[7]*f+i[11]*m+i[15]*k)/t.drawingBufferHeight,S=0;S<3;++S)this.lastCubeProps.cubeEdges[S]=u[S],this.lastCubeProps.axis[S]=h[S];var A=g;for(S=0;S<3;++S)y(g[S],S,this.bounds,u,h);t=this.gl;var M,E,C,P=v;for(S=0;S<3;++S)this.backgroundEnable[S]?P[S]=h[S]:P[S]=0;for(this._background.draw(r,n,i,a,P,this.backgroundColor),this._lines.bind(r,n,i,this),S=0;S<3;++S){var L=[0,0,0];h[S]>0?L[S]=a[1][S]:L[S]=a[0][S];for(var I=0;I<2;++I){var z=(S+1+I)%3,O=(S+1+(1^I))%3;this.gridEnable[z]&&this._lines.drawGrid(z,O,this.bounds,L,this.gridColor[z],this.gridWidth[z]*this.pixelRatio)}for(I=0;I<2;++I)z=(S+1+I)%3,O=(S+1+(1^I))%3,this.zeroEnable[O]&&Math.min(a[0][O],a[1][O])<=0&&Math.max(a[0][O],a[1][O])>=0&&this._lines.drawZero(z,O,this.bounds,L,this.zeroLineColor[O],this.zeroLineWidth[O]*this.pixelRatio)}for(S=0;S<3;++S){this.lineEnable[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].primalOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio),this.lineMirror[S]&&this._lines.drawAxisLine(S,this.bounds,A[S].mirrorOffset,this.lineColor[S],this.lineWidth[S]*this.pixelRatio);var R=p(b,A[S].primalMinor),D=p(_,A[S].mirrorMinor),j=this.lineTickLength;for(I=0;I<3;++I){var F=T/r[5*I];R[I]*=j[I]*F,D[I]*=j[I]*F}this.lineTickEnable[S]&&this._lines.drawAxisTicks(S,A[S].primalOffset,R,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio),this.lineTickMirror[S]&&this._lines.drawAxisTicks(S,A[S].mirrorOffset,D,this.lineTickColor[S],this.lineTickWidth[S]*this.pixelRatio)}function B(e){(C=[0,0,0])[e]=1}function N(e,t,r){var n=(e+1)%3,i=(e+2)%3,a=t[n],o=t[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?B(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&B(i)}for(this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio),S=0;S<3;++S){var U=A[S].primalMinor,V=A[S].mirrorMinor,q=p(w,A[S].primalOffset);for(I=0;I<3;++I)this.lineTickEnable[S]&&(q[I]+=T*U[I]*Math.max(this.lineTickLength[I],0)/r[5*I]);var H=[0,0,0];if(H[S]=1,this.tickEnable[S]){for(-3600===this.tickAngle[S]?(this.tickAngle[S]=0,this.tickAlign[S]="auto"):this.tickAlign[S]=-1,E=1,"auto"===(M=[this.tickAlign[S],.5,E])[0]?M[0]=0:M[0]=parseInt(""+M[0]),C=[0,0,0],N(S,U,V),I=0;I<3;++I)q[I]+=T*U[I]*this.tickPad[I]/r[5*I];this._text.drawTicks(S,this.tickSize[S],this.tickAngle[S],q,this.tickColor[S],H,C,M)}if(this.labelEnable[S]){for(E=0,C=[0,0,0],this.labels[S].length>4&&(B(S),E=1),"auto"===(M=[this.labelAlign[S],.5,E])[0]?M[0]=0:M[0]=parseInt(""+M[0]),I=0;I<3;++I)q[I]+=T*U[I]*this.labelPad[I]/r[5*I];q[S]+=.5*(a[0][S]+a[1][S]),this._text.drawLabel(S,this.labelSize[S],this.labelAngle[S],q,this.labelColor[S],[0,0,0],C,M)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},5304:function(e,t,r){e.exports=function(e){for(var t=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],p=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=d,p[l]=d;for(var f=-1;f<=1;f+=2){h[c]=f;for(var m=-1;m<=1;m+=2)h[u]=m,t.push(h[0],h[1],h[2],p[0],p[1],p[2]),s+=1}var g=c;c=u,u=g}var y=n(e,new Float32Array(t)),v=n(e,new Uint16Array(r),e.ELEMENT_ARRAY_BUFFER),x=i(e,[{buffer:y,type:e.FLOAT,size:3,offset:0,stride:24},{buffer:y,type:e.FLOAT,size:3,offset:12,stride:24}],v),b=a(e);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(e,y,x,b)};var n=r(2762),i=r(8116),a=r(1879).bg;function o(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(e,t,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:e,view:t,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6429:function(e,t,r){e.exports=function(e,t,r,a,d){i(s,t,e),i(s,r,s);for(var v=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],p(l[v],u,s),v+=1}}var w=-1;for(x=0;x<8;++x){for(var k=l[x][3],T=0;T<3;++T)c[x][T]=l[x][T]/k;d&&(c[x][2]*=-1),k<0&&(w<0||c[x][2]<c[w][2])&&(w=x)}if(w<0){w=0;for(var S=0;S<3;++S){for(var A=(S+2)%3,M=(S+1)%3,E=-1,C=-1,P=0;P<2;++P){var L=(z=P<<S)+(P<<A)+(1-P<<M),I=z+(1-P<<A)+(P<<M);o(c[z],c[L],c[I],h)<0||(P?E=1:C=1)}if(E<0||C<0)C>E&&(w|=1<<S);else{for(P=0;P<2;++P){L=(z=P<<S)+(P<<A)+(1-P<<M),I=z+(1-P<<A)+(P<<M);var z,O=f([l[z],l[L],l[I],l[z+(1<<A)+(1<<M)]]);P?E=O:C=O}C>E&&(w|=1<<S)}}}var R=7^w,D=-1;for(x=0;x<8;++x)x!==w&&x!==R&&(D<0||c[D][1]>c[x][1])&&(D=x);var j=-1;for(x=0;x<3;++x)(B=D^1<<x)!==w&&B!==R&&(j<0&&(j=B),(M=c[B])[0]<c[j][0]&&(j=B));var F=-1;for(x=0;x<3;++x){var B;(B=D^1<<x)!==w&&B!==R&&B!==j&&(F<0&&(F=B),(M=c[B])[0]>c[F][0]&&(F=B))}var N=m;N[0]=N[1]=N[2]=0,N[n.log2(j^D)]=D&j,N[n.log2(D^F)]=D&F;var U=7^F;U===w||U===R?(U=7^j,N[n.log2(F^U)]=U&F):N[n.log2(j^U)]=U&j;var V=g,q=w;for(S=0;S<3;++S)V[S]=q&1<<S?-1:1;return y};var n=r(8828),i=r(6760),a=r(5202),o=r(3250),s=new Array(16),l=new Array(8),c=new Array(8),u=new Array(3),h=[0,0,0];function p(e,t,r){for(var n=0;n<4;++n){e[n]=r[12+n];for(var i=0;i<3;++i)e[n]+=t[i]*r[4*i+n]}}!function(){for(var e=0;e<8;++e)l[e]=[1,1,1,1],c[e]=[1,1,1]}();var d=[[0,0,1,0,0],[0,0,-1,1,0],[0,-1,0,1,0],[0,1,0,1,0],[-1,0,0,1,0],[1,0,0,1,0]];function f(e){for(var t=0;t<d.length;++t)if((e=a.positive(e,d[t])).length<3)return 0;var r=e[0],n=r[0]/r[3],i=r[1]/r[3],o=0;for(t=1;t+1<e.length;++t){var s=e[t],l=e[t+1],c=s[0]/s[3]-n,u=s[1]/s[3]-i,h=l[0]/l[3]-n,p=l[1]/l[3]-i;o+=Math.abs(c*p-u*h)}return o}var m=[1,1,1],g=[0,0,0],y={cubeEdges:m,axis:g}},501:function(e,t,r){e.exports=function(e,t,r){var o=[],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[0,0,0];o.push(0,0,1,0,1,1,0,0,-1,0,0,-1,0,1,1,0,1,-1);for(var h=0;h<3;++h){for(var p=o.length/3|0,f=0;f<r[h].length;++f){var m=+r[h][f].x;o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1)}var g=o.length/3|0;s[h]=p,l[h]=g-p,p=o.length/3|0;for(var y=0;y<r[h].length;++y)m=+r[h][y].x,o.push(m,0,1,m,1,1,m,0,-1,m,0,-1,m,1,1,m,1,-1);g=o.length/3|0,c[h]=p,u[h]=g-p}var v=n(e,new Float32Array(o)),x=i(e,[{buffer:v,type:e.FLOAT,size:3,stride:0,offset:0}]),b=a(e);return b.attributes.position.location=0,new d(e,v,x,b,l,s,u,c)};var n=r(2762),i=r(8116),a=r(1879).n,o=[0,0,0],s=[0,0,0],l=[0,0,0],c=[0,0,0],u=[1,1];function h(e){return e[0]=e[1]=e[2]=0,e}function p(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function d(e,t,r,n,i,a,o,s){this.gl=e,this.vertBuffer=t,this.vao=r,this.shader=n,this.tickCount=i,this.tickOffset=a,this.gridCount=o,this.gridOffset=s}var f=d.prototype;f.bind=function(e,t,r){this.shader.bind(),this.shader.uniforms.model=e,this.shader.uniforms.view=t,this.shader.uniforms.projection=r,u[0]=this.gl.drawingBufferWidth,u[1]=this.gl.drawingBufferHeight,this.shader.uniforms.screenShape=u,this.vao.bind()},f.unbind=function(){this.vao.unbind()},f.drawAxisLine=function(e,t,r,n,i){var a=h(s);this.shader.uniforms.majorAxis=s,a[e]=t[1][e]-t[0][e],this.shader.uniforms.minorAxis=a;var o,u=p(c,r);u[e]+=t[0][e],this.shader.uniforms.offset=u,this.shader.uniforms.lineWidth=i,this.shader.uniforms.color=n,(o=h(l))[(e+2)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6),(o=h(l))[(e+1)%3]=1,this.shader.uniforms.screenAxis=o,this.vao.draw(this.gl.TRIANGLES,6)},f.drawAxisTicks=function(e,t,r,n,i){if(this.tickCount[e]){var a=h(o);a[e]=1,this.shader.uniforms.majorAxis=a,this.shader.uniforms.offset=t,this.shader.uniforms.minorAxis=r,this.shader.uniforms.color=n,this.shader.uniforms.lineWidth=i;var s=h(l);s[e]=1,this.shader.uniforms.screenAxis=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e])}},f.drawGrid=function(e,t,r,n,i,a){if(this.gridCount[e]){var u=h(s);u[t]=r[1][t]-r[0][t],this.shader.uniforms.minorAxis=u;var d=p(c,n);d[t]+=r[0][t],this.shader.uniforms.offset=d;var f=h(o);f[e]=1,this.shader.uniforms.majorAxis=f;var m=h(l);m[e]=1,this.shader.uniforms.screenAxis=m,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,this.gridCount[e],this.gridOffset[e])}},f.drawZero=function(e,t,r,n,i,a){var o=h(s);this.shader.uniforms.majorAxis=o,o[e]=r[1][e]-r[0][e],this.shader.uniforms.minorAxis=o;var u=p(c,n);u[e]+=r[0][e],this.shader.uniforms.offset=u;var d=h(l);d[t]=1,this.shader.uniforms.screenAxis=d,this.shader.uniforms.lineWidth=a,this.shader.uniforms.color=i,this.vao.draw(this.gl.TRIANGLES,6)},f.dispose=function(){this.vao.dispose(),this.vertBuffer.dispose(),this.shader.dispose()}},1879:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, majorAxis, minorAxis, screenAxis;\nuniform float lineWidth;\nuniform vec2 screenShape;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nvoid main() {\n vec3 major = position.x * majorAxis;\n vec3 minor = position.y * minorAxis;\n\n vec3 vPosition = major + minor + offset;\n vec3 pPosition = project(vPosition);\n vec3 offset = project(vPosition + screenAxis * position.z);\n\n vec2 screen = normalize((offset - pPosition).xy * screenShape) / screenShape;\n\n gl_Position = vec4(pPosition + vec3(0.5 * screen * lineWidth, 0), 1.0);\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.n=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"}])};var s=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\nuniform vec3 offset, axis, alignDir, alignOpt;\nuniform float scale, angle, pixelScale;\nuniform vec2 resolution;\n\nvec3 project(vec3 p) {\n vec4 pp = projection * (view * (model * vec4(p, 1.0)));\n return pp.xyz / max(pp.w, 0.0001);\n}\n\nfloat computeViewAngle(vec3 a, vec3 b) {\n vec3 A = project(a);\n vec3 B = project(b);\n\n return atan(\n (B.y - A.y) * resolution.y,\n (B.x - A.x) * resolution.x\n );\n}\n\nconst float PI = 3.141592;\nconst float TWO_PI = 2.0 * PI;\nconst float HALF_PI = 0.5 * PI;\nconst float ONE_AND_HALF_PI = 1.5 * PI;\n\nint option = int(floor(alignOpt.x + 0.001));\nfloat hv_ratio = alignOpt.y;\nbool enableAlign = (alignOpt.z != 0.0);\n\nfloat mod_angle(float a) {\n return mod(a, PI);\n}\n\nfloat positive_angle(float a) {\n return mod_angle((a < 0.0) ?\n a + TWO_PI :\n a\n );\n}\n\nfloat look_upwards(float a) {\n float b = positive_angle(a);\n return ((b > HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}\n"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);t.Q=function(e){return i(e,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * (view * (model * vec4(nPosition, 1.0)));\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}\n"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);t.bg=function(e){return i(e,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},4935:function(e,t,r){e.exports=function(e,t,r,a,s,l){var u=n(e),h=i(e,[{buffer:u,size:3}]),p=o(e);p.attributes.position.location=0;var d=new c(e,p,u,h);return d.update(t,r,a,s,l),d};var n=r(2762),i=r(8116),a=r(4359),o=r(1879).Q,s=window||process.global||{},l=s.__TEXT_CACHE||{};function c(e,t,r,n){this.gl=e,this.shader=t,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}s.__TEXT_CACHE={};var u=c.prototype,h=[0,0];u.bind=function(e,t,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=e,i.view=t,i.projection=r,i.pixelScale=n,h[0]=this.gl.drawingBufferWidth,h[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=h},u.unbind=function(){this.vao.unbind()},u.update=function(e,t,r,n,i){var o=[];function s(e,t,r,n,i,s){var c=[r.style,r.weight,r.variant,r.family].join("_"),u=l[c];u||(u=l[c]={});var h=u[t];h||(h=u[t]=function(e,t){try{return a(e,t)}catch(r){return console.warn('error vectorizing text:"'+e+'" error:',r),{cells:[],positions:[]}}}(t,{triangles:!0,font:r.family,fontStyle:r.style,fontWeight:r.weight,fontVariant:r.variant,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var p=(n||12)/12,d=h.positions,f=h.cells,m=0,g=f.length;m<g;++m)for(var y=f[m],v=2;v>=0;--v){var x=d[y[v]];o.push(p*x[0],-p*x[1],e)}}for(var c=[0,0,0],u=[0,0,0],h=[0,0,0],p=[0,0,0],d={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},f=0;f<3;++f){h[f]=o.length/3|0,s(.5*(e[0][f]+e[1][f]),t[f],r[f],12,1.25,d),p[f]=(o.length/3|0)-h[f],c[f]=o.length/3|0;for(var m=0;m<n[f].length;++m)if(n[f][m].text){var g={family:n[f][m].font||i[f].family,style:i[f].fontStyle||i[f].style,weight:i[f].fontWeight||i[f].weight,variant:i[f].fontVariant||i[f].variant};s(n[f][m].x,n[f][m].text,g,n[f][m].fontSize||12,1.25,d)}u[f]=(o.length/3|0)-c[f]}this.buffer.update(o),this.tickOffset=c,this.tickCount=u,this.labelOffset=h,this.labelCount=p},u.drawTicks=function(e,t,r,n,i,a,o,s){this.tickCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.tickCount[e],this.tickOffset[e]))},u.drawLabel=function(e,t,r,n,i,a,o,s){this.labelCount[e]&&(this.shader.uniforms.axis=a,this.shader.uniforms.color=i,this.shader.uniforms.angle=r,this.shader.uniforms.scale=t,this.shader.uniforms.offset=n,this.shader.uniforms.alignDir=o,this.shader.uniforms.alignOpt=s,this.vao.draw(this.gl.TRIANGLES,this.labelCount[e],this.labelOffset[e]))},u.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()}},6444:function(e,t){function r(e,t){var r=e+"",n=r.indexOf("."),i=0;n>=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(e*t*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length<i;)h="0"+h;return u+"."+h}return u}t.create=function(e,t){for(var n=[],i=0;i<3;++i){for(var a=[],o=(e[0][i],e[1][i],0);o*t[i]<=e[1][i];++o)a.push({x:o*t[i],text:r(t[i],o)});for(o=-1;o*t[i]>=e[0][i];--o)a.push({x:o*t[i],text:r(t[i],o)});n.push(a)}return n},t.equal=function(e,t){for(var r=0;r<3;++r){if(e[r].length!==t[r].length)return!1;for(var n=0;n<e[r].length;++n){var i=e[r][n],a=t[r][n];if(i.x!==a.x||i.text!==a.text||i.font!==a.font||i.fontColor!==a.fontColor||i.fontSize!==a.fontSize||i.dx!==a.dx||i.dy!==a.dy)return!1}}return!0}},5445:function(e,t,r){e.exports=function(e,t,r,l,h){var p=t.model||c,d=t.view||c,y=t.projection||c,v=t._ortho||!1,x=e.bounds,b=(h=h||a(p,d,y,x,v)).axis;o(u,d,p),o(u,y,u);for(var _=m,w=0;w<3;++w)_[w].lo=1/0,_[w].hi=-1/0,_[w].pixelsPerDataUnit=1/0;var k=n(s(u,u));s(u,u);for(var T=0;T<3;++T){var S=(T+1)%3,A=(T+2)%3,M=g;e:for(w=0;w<2;++w){var E=[];if(b[T]<0!==!!w){M[T]=x[w][T];for(var C=0;C<2;++C){M[S]=x[C^w][S];for(var P=0;P<2;++P)M[A]=x[P^C^w][A],E.push(M.slice())}var L=v?5:4;for(C=L;C===L;++C){if(0===E.length)continue e;E=i.positive(E,k[C])}for(C=0;C<E.length;++C){A=E[C];var I=f(g,u,A,r,l);for(P=0;P<3;++P)_[P].lo=Math.min(_[P].lo,A[P]),_[P].hi=Math.max(_[P].hi,A[P]),P!==T&&(_[P].pixelsPerDataUnit=Math.min(_[P].pixelsPerDataUnit,Math.abs(I[P])))}}}}return _};var n=r(5033),i=r(5202),a=r(6429),o=r(6760),s=r(5665),l=r(5352),c=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),u=new Float32Array(16);function h(e,t,r){this.lo=e,this.hi=t,this.pixelsPerDataUnit=r}var p=[0,0,0,1],d=[0,0,0,1];function f(e,t,r,n,i){for(var a=0;a<3;++a){for(var o=p,s=d,c=0;c<3;++c)s[c]=o[c]=r[c];s[3]=o[3]=1,s[a]+=1,l(s,s,t),s[3]<0&&(e[a]=1/0),o[a]-=1,l(o,o,t),o[3]<0&&(e[a]=1/0);var u=(o[0]/o[3]-s[0]/s[3])*n,h=(o[1]/o[3]-s[1]/s[3])*i;e[a]=.25*Math.sqrt(u*u+h*h)}return e}var m=[new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0),new h(1/0,-1/0,1/0)],g=[0,0,0]},2762:function(e,t,r){var n=r(1888),i=r(5298),a=r(9618),o=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"];function s(e,t,r,n,i){this.gl=e,this.type=t,this.handle=r,this.length=n,this.usage=i}var l=s.prototype;function c(e,t,r,n,i,a){var o=i.length*i.BYTES_PER_ELEMENT;if(a<0)return e.bufferData(t,i,n),o;if(o+a>r)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return e.bufferSubData(t,a,i),r}function u(e,t){for(var r=n.malloc(e.length,t),i=e.length,a=0;a<i;++a)r[a]=e[a];return r}l.bind=function(){this.gl.bindBuffer(this.type,this.handle)},l.unbind=function(){this.gl.bindBuffer(this.type,null)},l.dispose=function(){this.gl.deleteBuffer(this.handle)},l.update=function(e,t){if("number"!==typeof t&&(t=-1),this.bind(),"object"===typeof e&&"undefined"!==typeof e.shape){var r=e.dtype;if(o.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER&&(r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"),r===e.dtype&&function(e,t){for(var r=1,n=t.length-1;n>=0;--n){if(t[n]!==r)return!1;r*=e[n]}return!0}(e.shape,e.stride))0===e.offset&&e.data.length===e.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,e.data,t):this.length=c(this.gl,this.type,this.length,this.usage,e.data.subarray(e.offset,e.shape[0]),t);else{var s=n.malloc(e.size,r),l=a(s,e.shape);i.assign(l,e),this.length=c(this.gl,this.type,this.length,this.usage,t<0?s:s.subarray(0,e.size),t),n.free(s)}}else if(Array.isArray(e)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(e,"uint16"):u(e,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,t<0?h:h.subarray(0,e.length),t),n.free(h)}else if("object"===typeof e&&"number"===typeof e.length)this.length=c(this.gl,this.type,this.length,this.usage,e,t);else{if("number"!==typeof e&&void 0!==e)throw new Error("gl-buffer: Invalid data type");if(t>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(e|=0)<=0&&(e=1),this.gl.bufferData(this.type,0|e,this.usage),this.length=e}},e.exports=function(e,t,r,n){if(r=r||e.ARRAY_BUFFER,n=n||e.DYNAMIC_DRAW,r!==e.ARRAY_BUFFER&&r!==e.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==e.DYNAMIC_DRAW&&n!==e.STATIC_DRAW&&n!==e.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=e.createBuffer(),a=new s(e,r,i,0,n);return a.update(t),a}},6405:function(e,t,r){var n=r(2931);e.exports=function(e,t){var r=e.positions,i=e.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:e.vertexIntensityBounds,vectors:[],cells:[],coneOffset:e.coneOffset,colormap:e.colormap};if(0===e.positions.length)return t&&(t[0]=[0,0,0],t[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,h=1/0,p=-1/0,d=null,f=null,m=[],g=1/0,y=!1,v="raw"===e.coneSizemode,x=0;x<r.length;x++){var b=r[x];s=Math.min(b[0],s),l=Math.max(b[0],l),c=Math.min(b[1],c),u=Math.max(b[1],u),h=Math.min(b[2],h),p=Math.max(b[2],p);var _=i[x];if(n.length(_)>o&&(o=n.length(_)),x&&!v){var w=2*n.distance(d,b)/(n.length(f)+n.length(_));w?(g=Math.min(g,w),y=!1):y=!0}y||(d=b,f=_),m.push(_)}var k=[s,c,h],T=[l,u,p];t&&(t[0]=k,t[1]=T),0===o&&(o=1);var S=1/o;isFinite(g)||(g=1),a.vectorScale=g;var A=e.coneSize||(v?1:.5);e.absoluteConeSize&&(A=e.absoluteConeSize*S),a.coneScale=A,x=0;for(var M=0;x<r.length;x++)for(var E=(b=r[x])[0],C=b[1],P=b[2],L=m[x],I=n.length(L)*S,z=0;z<8;z++){a.positions.push([E,C,P,M++]),a.positions.push([E,C,P,M++]),a.positions.push([E,C,P,M++]),a.positions.push([E,C,P,M++]),a.positions.push([E,C,P,M++]),a.positions.push([E,C,P,M++]),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vectors.push(L),a.vertexIntensity.push(I,I,I),a.vertexIntensity.push(I,I,I);var O=a.positions.length;a.cells.push([O-6,O-5,O-4],[O-3,O-2,O-1])}return a};var i=r(614);e.exports.createMesh=r(9060),e.exports.createConeMesh=function(t,r){return e.exports.createMesh(t,r,{shaders:i,traceType:"cone"})}},9060:function(e,t,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(6760),l=r(7608),c=r(9618),u=r(6729),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function p(e,t,r,n,i,a,o,s,l,c,u){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.pickShader=n,this.trianglePositions=i,this.triangleVectors=a,this.triangleColors=s,this.triangleUVs=l,this.triangleIds=o,this.triangleVAO=c,this.triangleCount=0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.traceType=u,this.tubeScale=1,this.coneScale=2,this.vectorScale=1,this.coneOffset=.25,this._model=h,this._view=h,this._projection=h,this._resolution=[1,1]}var d=p.prototype;d.isOpaque=function(){return this.opacity>=1},d.isTransparent=function(){return this.opacity<1},d.pickSlots=1,d.setPickBase=function(e){this.pickId=e},d.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"lightPosition"in e&&(this.lightPosition=e.lightPosition),"opacity"in e&&(this.opacity=e.opacity),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),void 0!==e.tubeScale&&(this.tubeScale=e.tubeScale),void 0!==e.vectorScale&&(this.vectorScale=e.vectorScale),void 0!==e.coneScale&&(this.coneScale=e.coneScale),void 0!==e.coneOffset&&(this.coneOffset=e.coneOffset),e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e){for(var t=u({colormap:e,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=t[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(e.colormap)),this.texture.generateMipmap());var r=e.cells,n=e.positions,i=e.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],h=[];this.cells=r,this.positions=n,this.vectors=i;var p=e.meshColor||[1,1,1,1],d=e.vertexIntensity,f=1/0,m=-1/0;if(d)if(e.vertexIntensityBounds)f=+e.vertexIntensityBounds[0],m=+e.vertexIntensityBounds[1];else for(var g=0;g<d.length;++g){var y=d[g];f=Math.min(f,y),m=Math.max(m,y)}else for(g=0;g<n.length;++g)y=n[g][2],f=Math.min(f,y),m=Math.max(m,y);for(this.intensity=d||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=0;g<n.length;++g)for(var v=n[g],x=0;x<3;++x)!isNaN(v[x])&&isFinite(v[x])&&(this.bounds[0][x]=Math.min(this.bounds[0][x],v[x]),this.bounds[1][x]=Math.max(this.bounds[1][x],v[x]));var b=0;e:for(g=0;g<r.length;++g){var _=r[g];if(3===_.length){for(x=0;x<3;++x){v=n[k=_[x]];for(var w=0;w<3;++w)if(isNaN(v[w])||!isFinite(v[w]))continue e}for(x=0;x<3;++x){var k;v=n[k=_[2-x]],a.push(v[0],v[1],v[2],v[3]);var T=i[k];o.push(T[0],T[1],T[2],T[3]||0);var S,A=p;3===A.length?s.push(A[0],A[1],A[2],1):s.push(A[0],A[1],A[2],A[3]),S=d?[(d[k]-f)/(m-f),0]:[(v[2]-f)/(m-f),0],l.push(S[0],S[1]),h.push(g)}b+=1}}this.triangleCount=b,this.trianglePositions.update(a),this.triangleVectors.update(o),this.triangleColors.update(s),this.triangleUVs.update(l),this.triangleIds.update(new Uint32Array(h))}},d.drawTransparent=d.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||h,n=e.view||h,i=e.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var c={model:r,view:n,projection:i,inverseModel:h.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],opacity:this.opacity,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,texture:0};c.inverseModel=l(c.inverseModel,c.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(s(u,c.view,c.model),s(u,c.projection,u),l(u,u),o=0;o<3;++o)c.eyePosition[o]=u[12+o]/u[15];var p=u[15];for(o=0;o<3;++o)p+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var d=u[12+o],f=0;f<3;++f)d+=u[4*f+o]*this.lightPosition[f];c.lightPosition[o]=d/p}if(this.triangleCount>0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},d.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||h,n=e.view||h,i=e.projection||h,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},d.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=t),i},d.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(e,t,r){var s=r.shaders;1===arguments.length&&(e=(t=e).gl);var l=function(e,t){var r=n(e,t.meshShader.vertex,t.meshShader.fragment,null,t.meshShader.attributes);return r.attributes.position.location=0,r.attributes.color.location=2,r.attributes.uv.location=3,r.attributes.vector.location=4,r}(e,s),u=function(e,t){var r=n(e,t.pickShader.vertex,t.pickShader.fragment,null,t.pickShader.attributes);return r.attributes.position.location=0,r.attributes.id.location=1,r.attributes.vector.location=4,r}(e,s),h=o(e,c(new Uint8Array([255,255,255,255]),[1,1,4]));h.generateMipmap(),h.minFilter=e.LINEAR_MIPMAP_LINEAR,h.magFilter=e.LINEAR;var d=i(e),f=i(e),m=i(e),g=i(e),y=i(e),v=new p(e,h,l,u,d,f,y,m,g,a(e,[{buffer:d,type:e.FLOAT,size:4},{buffer:y,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:g,type:e.FLOAT,size:2},{buffer:f,type:e.FLOAT,size:4}]),r.traceType||"cone");return v.update(t),v}},614:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * (view * conePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},737:function(e){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},5171:function(e,t,r){var n=r(737);e.exports=function(e){return n[e]}},9165:function(e,t,r){e.exports=function(e){var t=e.gl,r=n(t),o=i(t,[{buffer:r,type:t.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:t.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:t.FLOAT,size:3,offset:28,stride:40}]),l=a(t);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(t,r,o,l);return c.update(e),c};var n=r(2762),i=r(8116),a=r(3436),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.shader=n,this.buffer=t,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(e,t){for(var r=0;r<3;++r)e[0][r]=Math.min(e[0][r],t[r]),e[1][r]=Math.max(e[1][r],t[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(e){var t=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=e.view||o,i=r.projection=e.projection||o;r.model=e.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(e._ortho?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/t.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)t.lineWidth(this.lineWidth[h]*this.pixelRatio),r.capSize=this.capSize[h]*u,this.lineCount[h]&&t.drawArrays(t.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var u=function(){for(var e=new Array(3),t=0;t<3;++t){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+t)%3]=i,r.push(a)}e[t]=r}return e}();function h(e,t,r,n){for(var i=u[n],a=0;a<i.length;++a){var o=i[a];e.push(t[0],t[1],t[2],r[0],r[1],r[2],r[3],o[0],o[1],o[2])}return i.length}l.update=function(e){"lineWidth"in(e=e||{})&&(this.lineWidth=e.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in e&&(this.capSize=e.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var t=e.color||[[0,0,0],[0,0,0],[0,0,0]],r=e.position,n=e.error;if(Array.isArray(t[0])||(t=[t,t,t]),r&&n){var i=[],a=r.length,o=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var s=0;s<3;++s){this.lineOffset[s]=o;e:for(var l=0;l<a;++l){for(var u=r[l],p=0;p<3;++p)if(isNaN(u[p])||!isFinite(u[p]))continue e;var d,f=n[l],m=t[s];if(Array.isArray(m[0])&&(m=t[l]),3===m.length?m=[m[0],m[1],m[2],1]:4===m.length&&(m=[m[0],m[1],m[2],m[3]],!this.hasAlpha&&m[3]<1&&(this.hasAlpha=!0)),!isNaN(f[0][s])&&!isNaN(f[1][s]))f[0][s]<0&&((d=u.slice())[s]+=f[0][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,d[0],d[1],d[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,d),o+=2+h(i,d,m,s)),f[1][s]>0&&((d=u.slice())[s]+=f[1][s],i.push(u[0],u[1],u[2],m[0],m[1],m[2],m[3],0,0,0,d[0],d[1],d[2],m[0],m[1],m[2],m[3],0,0,0),c(this.bounds,d),o+=2+h(i,d,m,s))}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},3436:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * (view * worldPosition);\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},2260:function(e,t,r){var n=r(7766);e.exports=function(e,t,r,n){i||(i=e.FRAMEBUFFER_UNSUPPORTED,a=e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=e.getExtension("WEBGL_draw_buffers");if(!l&&c&&function(e,t){var r=e.getParameter(t.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;a<n;++a)i[a]=e.COLOR_ATTACHMENT0+a;for(a=n;a<r;++a)i[a]=e.NONE;l[n]=i}}(e,c),Array.isArray(t)&&(n=r,r=0|t[1],t=0|t[0]),"number"!==typeof t)throw new Error("gl-fbo: Missing shape parameter");var u=e.getParameter(e.MAX_RENDERBUFFER_SIZE);if(t<0||t>u||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var h=1;if("color"in(n=n||{})){if((h=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(h>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(h>e.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+h+" draw buffers")}}var p=e.UNSIGNED_BYTE,d=e.getExtension("OES_texture_float");if(n.float&&h>0){if(!d)throw new Error("gl-fbo: Context does not support floating point textures");p=e.FLOAT}else n.preferFloat&&h>0&&d&&(p=e.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new f(e,t,r,p,h,m,g,c)};var i,a,o,s,l=null;function c(e){return[e.getParameter(e.FRAMEBUFFER_BINDING),e.getParameter(e.RENDERBUFFER_BINDING),e.getParameter(e.TEXTURE_BINDING_2D)]}function u(e,t){e.bindFramebuffer(e.FRAMEBUFFER,t[0]),e.bindRenderbuffer(e.RENDERBUFFER,t[1]),e.bindTexture(e.TEXTURE_2D,t[2])}function h(e){switch(e){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function p(e,t,r,i,a,o){if(!i)return null;var s=n(e,t,r,a,i);return s.magFilter=e.NEAREST,s.minFilter=e.NEAREST,s.mipSamples=1,s.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,o,e.TEXTURE_2D,s.handle,0),s}function d(e,t,r,n,i){var a=e.createRenderbuffer();return e.bindRenderbuffer(e.RENDERBUFFER,a),e.renderbufferStorage(e.RENDERBUFFER,n,t,r),e.framebufferRenderbuffer(e.FRAMEBUFFER,i,e.RENDERBUFFER,a),a}function f(e,t,r,n,i,a,o,s){this.gl=e,this._shape=[0|t,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var f=0;f<i;++f)this.color[f]=null;this._color_rb=null,this.depth=null,this._depth_rb=null,this._colorType=n,this._useDepth=a,this._useStencil=o;var m=this,g=[0|t,0|r];Object.defineProperties(g,{0:{get:function(){return m._shape[0]},set:function(e){return m.width=e}},1:{get:function(){return m._shape[1]},set:function(e){return m.height=e}}}),this._shapeVector=g,function(e){var t=c(e.gl),r=e.gl,n=e.handle=r.createFramebuffer(),i=e._shape[0],a=e._shape[1],o=e.color.length,s=e._ext,f=e._useStencil,m=e._useDepth,g=e._colorType;r.bindFramebuffer(r.FRAMEBUFFER,n);for(var y=0;y<o;++y)e.color[y]=p(r,i,a,g,r.RGBA,r.COLOR_ATTACHMENT0+y);0===o?(e._color_rb=d(r,i,a,r.RGBA4,r.COLOR_ATTACHMENT0),s&&s.drawBuffersWEBGL(l[0])):o>1&&s.drawBuffersWEBGL(l[o]);var v=r.getExtension("WEBGL_depth_texture");v?f?e.depth=p(r,i,a,v.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(e.depth=p(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&f?e._depth_rb=d(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?e._depth_rb=d(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):f&&(e._depth_rb=d(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){for(e._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(e.handle),e.handle=null,e.depth&&(e.depth.dispose(),e.depth=null),e._depth_rb&&(r.deleteRenderbuffer(e._depth_rb),e._depth_rb=null),y=0;y<e.color.length;++y)e.color[y].dispose(),e.color[y]=null;e._color_rb&&(r.deleteRenderbuffer(e._color_rb),e._color_rb=null),u(r,t),h(x)}u(r,t)}(this)}var m=f.prototype;function g(e,t,r){if(e._destroyed)throw new Error("gl-fbo: Can't resize destroyed FBO");if(e._shape[0]!==t||e._shape[1]!==r){var n=e.gl,i=n.getParameter(n.MAX_RENDERBUFFER_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");e._shape[0]=t,e._shape[1]=r;for(var a=c(n),o=0;o<e.color.length;++o)e.color[o].shape=e._shape;e._color_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._color_rb),n.renderbufferStorage(n.RENDERBUFFER,n.RGBA4,e._shape[0],e._shape[1])),e.depth&&(e.depth.shape=e._shape),e._depth_rb&&(n.bindRenderbuffer(n.RENDERBUFFER,e._depth_rb),e._useDepth&&e._useStencil?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_STENCIL,e._shape[0],e._shape[1]):e._useDepth?n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,e._shape[0],e._shape[1]):e._useStencil&&n.renderbufferStorage(n.RENDERBUFFER,n.STENCIL_INDEX,e._shape[0],e._shape[1])),n.bindFramebuffer(n.FRAMEBUFFER,e.handle);var s=n.checkFramebufferStatus(n.FRAMEBUFFER);s!==n.FRAMEBUFFER_COMPLETE&&(e.dispose(),u(n,a),h(s)),u(n,a)}}Object.defineProperties(m,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(e){if(Array.isArray(e)||(e=[0|e,0|e]),2!==e.length)throw new Error("gl-fbo: Shape vector must be length 2");var t=0|e[0],r=0|e[1];return g(this,t,r),[t,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(e){return g(this,e|=0,this._shape[1]),e},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(e){return e|=0,g(this,this._shape[0],e),e},enumerable:!1}}),m.bind=function(){if(!this._destroyed){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.handle),e.viewport(0,0,this._shape[0],this._shape[1])}},m.dispose=function(){if(!this._destroyed){this._destroyed=!0;var e=this.gl;e.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(e.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var t=0;t<this.color.length;++t)this.color[t].dispose(),this.color[t]=null;this._color_rb&&(e.deleteRenderbuffer(this._color_rb),this._color_rb=null)}}},2992:function(e,t,r){var n=r(3387).sprintf,i=r(5171),a=r(1848),o=r(1085);e.exports=function(e,t,r){var s=a(t)||"of unknown name (see npm glsl-shader-name)",l="unknown type";void 0!==r&&(l=r===i.FRAGMENT_SHADER?"fragment":"vertex");for(var c=n("Error compiling %s shader %s:\n",l,s),u=n("%s%s",c,e),h=e.split("\n"),p={},d=0;d<h.length;d++){var f=h[d];if(""!==f&&"\0"!==f){var m=parseInt(f.split(":")[2]);if(isNaN(m))throw new Error(n("Could not parse error: %s",f));p[m]=f}}var g=o(t).split("\n");for(d=0;d<g.length;d++)if((p[d+3]||p[d+2]||p[d+1])&&(c+=g[d]+"\n",p[d+1])){var y=p[d+1];y=y.substr(y.split(":",3).join(":").length+1).trim(),c+=n("^^^ %s\n\n",y)}return{long:c.trim(),short:u.trim()}}},7319:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, nextPosition;\nattribute float arcLength, lineWidth;\nattribute vec4 color;\n\nuniform vec2 screenShape;\nuniform float pixelRatio;\nuniform mat4 model, view, projection;\n\nvarying vec4 fragColor;\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n vec4 startPoint = project(position);\n vec4 endPoint = project(nextPosition);\n\n vec2 A = startPoint.xy / startPoint.w;\n vec2 B = endPoint.xy / endPoint.w;\n\n float clipAngle = atan(\n (B.y - A.y) * screenShape.y,\n (B.x - A.x) * screenShape.x\n );\n\n vec2 offset = 0.5 * pixelRatio * lineWidth * vec2(\n sin(clipAngle),\n -cos(clipAngle)\n ) / screenShape;\n\n gl_Position = vec4(startPoint.xy + startPoint.w * offset, startPoint.zw);\n\n worldPosition = position;\n pixelArcLength = arcLength;\n fragColor = color;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];t.createShader=function(e){return i(e,a,o,null,l)},t.createPickShader=function(e){return i(e,a,s,null,l)}},5714:function(e,t,r){e.exports=function(e){var t=e.gl||e.scene&&e.scene.gl,r=h(t);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=p(t);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(t),l=i(t,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),d=0;d<1024;++d)u.data[d]=255;var f=a(t,u);f.wrap=t.REPEAT;var m=new y(t,r,o,s,l,f);return m.update(e),m};var n=r(2762),i=r(8116),a=r(7766),o=new Uint8Array(4),s=new Float32Array(o.buffer),l=r(2478),c=r(9618),u=r(7319),h=u.createShader,p=u.createPickShader,d=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function f(e,t){for(var r=0,n=0;n<3;++n){var i=e[n]-t[n];r+=i*i}return Math.sqrt(r)}function m(e){for(var t=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)t[0][r]=Math.max(e[0][r],t[0][r]),t[1][r]=Math.min(e[1][r],t[1][r]);return t}function g(e,t,r,n){this.arcLength=e,this.position=t,this.index=r,this.dataCoordinate=n}function y(e,t,r,n,i,a){this.gl=e,this.shader=t,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var v=y.prototype;v.isTransparent=function(){return this.hasAlpha},v.isOpaque=function(){return!this.hasAlpha},v.pickSlots=1,v.setPickBase=function(e){this.pickId=e},v.drawTransparent=v.draw=function(e){if(this.vertexCount){var t=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:e.model||d,view:e.view||d,projection:e.projection||d,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.drawPick=function(e){if(this.vertexCount){var t=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:e.model||d,view:e.view||d,projection:e.projection||d,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[t.drawingBufferWidth,t.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(t.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},v.update=function(e){var t,r;this.dirty=!0;var n=!!e.connectGaps;"dashScale"in e&&(this.dashScale=e.dashScale),this.hasAlpha=!1,"opacity"in e&&(this.opacity=+e.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,h=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],p=e.position||e.positions;if(p){var d=e.color||e.colors||[0,0,0,1],m=e.lineWidth||1,g=!1;e:for(t=1;t<p.length;++t){var y,v,x,b=p[t-1],_=p[t];for(a.push(s),o.push(b.slice()),r=0;r<3;++r){if(isNaN(b[r])||isNaN(_[r])||!isFinite(b[r])||!isFinite(_[r])){if(!n&&i.length>0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue e}h[0][r]=Math.min(h[0][r],b[r],_[r]),h[1][r]=Math.max(h[1][r],b[r],_[r])}Array.isArray(d[0])?(y=d.length>t-1?d[t-1]:d.length>0?d[d.length-1]:[0,0,0,1],v=d.length>t?d[t]:d.length>0?d[d.length-1]:[0,0,0,1]):y=v=d,3===y.length&&(y=[y[0],y[1],y[2],1]),3===v.length&&(v=[v[0],v[1],v[2],1]),!this.hasAlpha&&y[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>t-1?m[t-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var k=s;if(s+=f(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],k,x,y[0],y[1],y[2],y[3],b[0],b[1],b[2],_[0],_[1],_[2],k,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,v[0],v[1],v[2],v[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(p[p.length-1].slice()),this.bounds=h,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in e){var T=e.dashes.slice();for(T.unshift(0),t=1;t<T.length;++t)T[t]=T[t-1]+T[t];var S=c(new Array(1024),[256,1,4]);for(t=0;t<256;++t){for(r=0;r<4;++r)S.set(t,0,r,0);1&l.le(T,T[T.length-1]*t/255)?S.set(t,0,0,0):S.set(t,0,0,255)}this.texture.setPixels(S)}},v.dispose=function(){this.shader.dispose(),this.vao.dispose(),this.buffer.dispose()},v.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=function(e,t,r,n){return o[0]=n,o[1]=r,o[2]=t,o[3]=e,s[0]}(e.value[0],e.value[1],e.value[2],0),r=l.le(this.arcLength,t);if(r<0)return null;if(r===this.arcLength.length-1)return new g(this.arcLength[this.arcLength.length-1],this.points[this.points.length-1].slice(),r);for(var n=this.points[r],i=this.points[Math.min(r+1,this.points.length-1)],a=(t-this.arcLength[r])/(this.arcLength[r+1]-this.arcLength[r]),c=1-a,u=[0,0,0],h=0;h<3;++h)u[h]=c*n[h]+a*i[h];var p=Math.min(a<.5?r:r+1,this.points.length-1);return new g(t,u,p,this.points[p])}},1903:function(e){e.exports=function(e){var t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},6864:function(e){e.exports=function(){var e=new Float32Array(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},9921:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],l=e[7],c=e[8],u=e[9],h=e[10],p=e[11],d=e[12],f=e[13],m=e[14],g=e[15];return(t*o-r*a)*(h*g-p*m)-(t*s-n*a)*(u*g-p*f)+(t*l-i*a)*(u*m-h*f)+(r*s-n*o)*(c*g-p*d)-(r*l-i*o)*(c*m-h*d)+(n*l-i*s)*(c*f-u*d)}},7399:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,p=i*o,d=i*s,f=i*l,m=a*o,g=a*s,y=a*l;return e[0]=1-h-f,e[1]=u+y,e[2]=p-g,e[3]=0,e[4]=u-y,e[5]=1-c-f,e[6]=d+m,e[7]=0,e[8]=p+g,e[9]=d-m,e[10]=1-c-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},6743:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,l=i+i,c=a+a,u=n*s,h=n*l,p=n*c,d=i*l,f=i*c,m=a*c,g=o*s,y=o*l,v=o*c;return e[0]=1-(d+m),e[1]=h+v,e[2]=p-y,e[3]=0,e[4]=h-v,e[5]=1-(u+m),e[6]=f+g,e[7]=0,e[8]=p+y,e[9]=f-g,e[10]=1-(u+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}},7894:function(e){e.exports=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}},7608:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-p*f,A=u*y-d*f,M=h*g-p*m,E=h*y-d*m,C=p*y-d*g,P=v*C-x*E+b*M+_*A-w*S+k*T;return P?(P=1/P,e[0]=(s*C-l*E+c*M)*P,e[1]=(i*E-n*C-a*M)*P,e[2]=(m*k-g*w+y*_)*P,e[3]=(p*w-h*k-d*_)*P,e[4]=(l*A-o*C-c*S)*P,e[5]=(r*C-i*A+a*S)*P,e[6]=(g*b-f*k-y*x)*P,e[7]=(u*k-p*b+d*x)*P,e[8]=(o*E-s*A+c*T)*P,e[9]=(n*A-r*E-a*T)*P,e[10]=(f*w-m*b+y*v)*P,e[11]=(h*b-u*w-d*v)*P,e[12]=(s*S-o*M-l*T)*P,e[13]=(r*M-n*S+i*T)*P,e[14]=(m*x-f*_-g*v)*P,e[15]=(u*_-h*x+p*v)*P,e):null}},6582:function(e,t,r){var n=r(7894);e.exports=function(e,t,r,i){var a,o,s,l,c,u,h,p,d,f,m=t[0],g=t[1],y=t[2],v=i[0],x=i[1],b=i[2],_=r[0],w=r[1],k=r[2];return Math.abs(m-_)<1e-6&&Math.abs(g-w)<1e-6&&Math.abs(y-k)<1e-6?n(e):(h=m-_,p=g-w,d=y-k,f=1/Math.sqrt(h*h+p*p+d*d),a=x*(d*=f)-b*(p*=f),o=b*(h*=f)-v*d,s=v*p-x*h,(f=Math.sqrt(a*a+o*o+s*s))?(a*=f=1/f,o*=f,s*=f):(a=0,o=0,s=0),l=p*s-d*o,c=d*a-h*s,u=h*o-p*a,(f=Math.sqrt(l*l+c*c+u*u))?(l*=f=1/f,c*=f,u*=f):(l=0,c=0,u=0),e[0]=a,e[1]=l,e[2]=h,e[3]=0,e[4]=o,e[5]=c,e[6]=p,e[7]=0,e[8]=s,e[9]=u,e[10]=d,e[11]=0,e[12]=-(a*m+o*g+s*y),e[13]=-(l*m+c*g+u*y),e[14]=-(h*m+p*g+d*y),e[15]=1,e)}},6760:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*h+w*m,e[1]=x*i+b*l+_*p+w*g,e[2]=x*a+b*c+_*d+w*y,e[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*h+w*m,e[5]=x*i+b*l+_*p+w*g,e[6]=x*a+b*c+_*d+w*y,e[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*h+w*m,e[9]=x*i+b*l+_*p+w*g,e[10]=x*a+b*c+_*d+w*y,e[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*h+w*m,e[13]=x*i+b*l+_*p+w*g,e[14]=x*a+b*c+_*d+w*y,e[15]=x*o+b*u+_*f+w*v,e}},4040:function(e){e.exports=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e}},4772:function(e){e.exports=function(e,t,r,n,i){var a=1/Math.tan(t/2),o=1/(n-i);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=(i+n)*o,e[11]=-1,e[12]=0,e[13]=0,e[14]=2*i*n*o,e[15]=0,e}},6079:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E=n[0],C=n[1],P=n[2],L=Math.sqrt(E*E+C*C+P*P);return Math.abs(L)<1e-6?null:(E*=L=1/L,C*=L,P*=L,i=Math.sin(r),a=Math.cos(r),o=1-a,s=t[0],l=t[1],c=t[2],u=t[3],h=t[4],p=t[5],d=t[6],f=t[7],m=t[8],g=t[9],y=t[10],v=t[11],x=E*E*o+a,b=C*E*o+P*i,_=P*E*o-C*i,w=E*C*o-P*i,k=C*C*o+a,T=P*C*o+E*i,S=E*P*o+C*i,A=C*P*o-E*i,M=P*P*o+a,e[0]=s*x+h*b+m*_,e[1]=l*x+p*b+g*_,e[2]=c*x+d*b+y*_,e[3]=u*x+f*b+v*_,e[4]=s*w+h*k+m*T,e[5]=l*w+p*k+g*T,e[6]=c*w+d*k+y*T,e[7]=u*w+f*k+v*T,e[8]=s*S+h*A+m*M,e[9]=l*S+p*A+g*M,e[10]=c*S+d*A+y*M,e[11]=u*S+f*A+v*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}},5567:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+p*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=p*i-l*n,e}},2408:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-u*n,e[2]=s*i-h*n,e[3]=l*i-p*n,e[8]=a*n+c*i,e[9]=o*n+u*i,e[10]=s*n+h*i,e[11]=l*n+p*i,e}},7089:function(e){e.exports=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+p*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=p*i-l*n,e}},2504:function(e){e.exports=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}},7656:function(e){e.exports=function(e,t,r){var n,i,a,o,s,l,c,u,h,p,d,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+p*y+t[13],e[14]=a*m+c*g+d*y+t[14],e[15]=o*m+u*g+f*y+t[15]),e}},5665:function(e){e.exports=function(e,t){if(e===t){var r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}},7626:function(e,t,r){var n=r(2642),i=r(9346);function a(e,t){for(var r=[0,0,0,0],n=0;n<4;++n)for(var i=0;i<4;++i)r[i]+=e[4*n+i]*t[n];return r}function o(e,t,r,n,i){for(var o=a(n,a(r,a(t,[e[0],e[1],e[2],1]))),s=0;s<3;++s)o[s]/=o[3];return[.5*i[0]*(1+o[0]),.5*i[1]*(1-o[1])]}function s(e,t){for(var r=[0,0,0],n=0;n<e.length;++n)for(var i=e[n],a=t[n],o=0;o<3;++o)r[o]+=a*i[o];return r}e.exports=function(e,t,r,a,l,c){if(1===e.length)return[0,e[0].slice()];for(var u=new Array(e.length),h=0;h<e.length;++h)u[h]=o(e[h],r,a,l,c);var p=0,d=1/0;for(h=0;h<u.length;++h){for(var f=0,m=0;m<2;++m)f+=Math.pow(u[h][m]-t[m],2);f<d&&(d=f,p=h)}var g=function(e,t){if(2===e.length){for(var r=0,a=0,o=0;o<2;++o)r+=Math.pow(t[o]-e[0][o],2),a+=Math.pow(t[o]-e[1][o],2);return(r=Math.sqrt(r))+(a=Math.sqrt(a))<1e-6?[1,0]:[a/(r+a),r/(a+r)]}if(3===e.length){var s=[0,0];return i(e[0],e[1],e[2],t,s),n(e,s)}return[]}(u,t),y=0;for(h=0;h<3;++h){if(g[h]<-.001||g[h]>1.0001)return null;y+=g[h]}return Math.abs(y-1)>.001?null:[p,s(e,g),g]}},840:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * (view * (model * vec4(p, 1.0)));\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n f_id = id;\n f_position = position;\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * (view * (model * vec4(position, 1.0)));\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},t.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},t.pickShader={vertex:u,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},t.pointPickShader={vertex:p,fragment:h,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},t.contourShader={vertex:d,fragment:f,attributes:[{name:"position",type:"vec3"}]}},7201:function(e,t,r){var n=r(9405),i=r(2762),a=r(8116),o=r(7766),s=r(8406),l=r(6760),c=r(7608),u=r(9618),h=r(6729),p=r(7765),d=r(1888),f=r(840),m=r(7626),g=f.meshShader,y=f.wireShader,v=f.pointShader,x=f.pickShader,b=f.pointPickShader,_=f.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function k(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,k,T,S,A,M){this.gl=e,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=t,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=p,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=f,this.edgeColors=g,this.edgeUVs=y,this.edgeIds=m,this.edgeVAO=v,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=k,this.pointSizes=T,this.pointIds=b,this.pointVAO=S,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=M,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var T=k.prototype;function S(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}T.isOpaque=function(){return!this.hasAlpha},T.isTransparent=function(){return this.hasAlpha},T.pickSlots=1,T.setPickBase=function(e){this.pickId=e},T.highlight=function(e){if(e&&this.contourEnable){for(var t=p(this.cells,this.intensity,e.intensity),r=t.cells,n=t.vertexIds,i=t.vertexWeights,a=r.length,o=d.mallocFloat32(6*a),s=0,l=0;l<a;++l)for(var c=r[l],u=0;u<2;++u){var h=c[0];2===c.length&&(h=c[u]);for(var f=n[h][0],m=n[h][1],g=i[h],y=1-g,v=this.positions[f],x=this.positions[m],b=0;b<3;++b)o[s++]=g*v[b]+y*x[b]}this.contourCount=s/3|0,this.contourPositions.update(o.subarray(0,s)),d.free(o)}else this.contourCount=0},T.update=function(e){e=e||{};var t=this.gl;this.dirty=!0,"contourEnable"in e&&(this.contourEnable=e.contourEnable),"contourColor"in e&&(this.contourColor=e.contourColor),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"lightPosition"in e&&(this.lightPosition=e.lightPosition),this.hasAlpha=!1,"opacity"in e&&(this.opacity=e.opacity,this.opacity<1&&(this.hasAlpha=!0)),"opacityscale"in e&&(this.opacityscale=e.opacityscale,this.hasAlpha=!0),"ambient"in e&&(this.ambientLight=e.ambient),"diffuse"in e&&(this.diffuseLight=e.diffuse),"specular"in e&&(this.specularLight=e.specular),"roughness"in e&&(this.roughness=e.roughness),"fresnel"in e&&(this.fresnel=e.fresnel),e.texture?(this.texture.dispose(),this.texture=o(t,e.texture)):e.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=t.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=t.LINEAR,this.texture.setPixels(function(e,t){for(var r=h({colormap:e,nshades:256,format:"rgba"}),n=new Uint8Array(1024),i=0;i<256;++i){for(var a=r[i],o=0;o<3;++o)n[4*i+o]=a[o];n[4*i+3]=t?255*S(i/255,t):255*a[3]}return u(n,[256,256,4],[4,0,1])}(e.colormap,this.opacityscale)),this.texture.generateMipmap());var r=e.cells,n=e.positions;if(n&&r){var i=[],a=[],l=[],c=[],p=[],d=[],f=[],m=[],g=[],y=[],v=[],x=[],b=[],_=[];this.cells=r,this.positions=n;var w=e.vertexNormals,k=e.cellNormals,T=void 0===e.vertexNormalsEpsilon?1e-6:e.vertexNormalsEpsilon,A=void 0===e.faceNormalsEpsilon?1e-6:e.faceNormalsEpsilon;e.useFacetNormals&&!k&&(k=s.faceNormals(r,n,A)),k||w||(w=s.vertexNormals(r,n,T));var M=e.vertexColors,E=e.cellColors,C=e.meshColor||[1,1,1,1],P=e.vertexUVs,L=e.vertexIntensity,I=e.cellUVs,z=e.cellIntensity,O=1/0,R=-1/0;if(!P&&!I)if(L)if(e.vertexIntensityBounds)O=+e.vertexIntensityBounds[0],R=+e.vertexIntensityBounds[1];else for(var D=0;D<L.length;++D){var j=L[D];O=Math.min(O,j),R=Math.max(R,j)}else if(z)if(e.cellIntensityBounds)O=+e.cellIntensityBounds[0],R=+e.cellIntensityBounds[1];else for(D=0;D<z.length;++D)j=z[D],O=Math.min(O,j),R=Math.max(R,j);else for(D=0;D<n.length;++D)j=n[D][2],O=Math.min(O,j),R=Math.max(R,j);this.intensity=L||z||function(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e[n][2];return r}(n),this.pickVertex=!(z||E);var F=e.pointSizes,B=e.pointSize||1;for(this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],D=0;D<n.length;++D)for(var N=n[D],U=0;U<3;++U)!isNaN(N[U])&&isFinite(N[U])&&(this.bounds[0][U]=Math.min(this.bounds[0][U],N[U]),this.bounds[1][U]=Math.max(this.bounds[1][U],N[U]));var V=0,q=0,H=0;e:for(D=0;D<r.length;++D){var G=r[D];switch(G.length){case 1:for(N=n[$=G[0]],U=0;U<3;++U)if(isNaN(N[U])||!isFinite(N[U]))continue e;y.push(N[0],N[1],N[2]),Z=M?M[$]:E?E[D]:C,this.opacityscale&&L?a.push(Z[0],Z[1],Z[2],this.opacity*S((L[$]-O)/(R-O),this.opacityscale)):3===Z.length?v.push(Z[0],Z[1],Z[2],this.opacity):(v.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)),X=P?P[$]:L?[(L[$]-O)/(R-O),0]:I?I[D]:z?[(z[D]-O)/(R-O),0]:[(N[2]-O)/(R-O),0],x.push(X[0],X[1]),F?b.push(F[$]):b.push(B),_.push(D),H+=1;break;case 2:for(U=0;U<2;++U){N=n[$=G[U]];for(var W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue e}for(U=0;U<2;++U)N=n[$=G[U]],d.push(N[0],N[1],N[2]),Z=M?M[$]:E?E[D]:C,this.opacityscale&&L?a.push(Z[0],Z[1],Z[2],this.opacity*S((L[$]-O)/(R-O),this.opacityscale)):3===Z.length?f.push(Z[0],Z[1],Z[2],this.opacity):(f.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)),X=P?P[$]:L?[(L[$]-O)/(R-O),0]:I?I[D]:z?[(z[D]-O)/(R-O),0]:[(N[2]-O)/(R-O),0],m.push(X[0],X[1]),g.push(D);q+=1;break;case 3:for(U=0;U<3;++U)for(N=n[$=G[U]],W=0;W<3;++W)if(isNaN(N[W])||!isFinite(N[W]))continue e;for(U=0;U<3;++U){var $,Z,X,Y;N=n[$=G[2-U]],i.push(N[0],N[1],N[2]),(Z=M?M[$]:E?E[D]:C)?this.opacityscale&&L?a.push(Z[0],Z[1],Z[2],this.opacity*S((L[$]-O)/(R-O),this.opacityscale)):3===Z.length?a.push(Z[0],Z[1],Z[2],this.opacity):(a.push(Z[0],Z[1],Z[2],Z[3]*this.opacity),Z[3]<1&&(this.hasAlpha=!0)):a.push(.5,.5,.5,1),X=P?P[$]:L?[(L[$]-O)/(R-O),0]:I?I[D]:z?[(z[D]-O)/(R-O),0]:[(N[2]-O)/(R-O),0],c.push(X[0],X[1]),Y=w?w[$]:k[D],l.push(Y[0],Y[1],Y[2]),p.push(D)}V+=1}}this.pointCount=H,this.edgeCount=q,this.triangleCount=V,this.pointPositions.update(y),this.pointColors.update(v),this.pointUVs.update(x),this.pointSizes.update(b),this.pointIds.update(new Uint32Array(_)),this.edgePositions.update(d),this.edgeColors.update(f),this.edgeUVs.update(m),this.edgeIds.update(new Uint32Array(g)),this.trianglePositions.update(i),this.triangleColors.update(a),this.triangleUVs.update(c),this.triangleNormals.update(l),this.triangleIds.update(new Uint32Array(p))}},T.drawTransparent=T.draw=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);var s={model:r,view:n,projection:i,inverseModel:w.slice(),clipBounds:a,kambient:this.ambientLight,kdiffuse:this.diffuseLight,kspecular:this.specularLight,roughness:this.roughness,fresnel:this.fresnel,eyePosition:[0,0,0],lightPosition:[0,0,0],contourColor:this.contourColor,texture:0};s.inverseModel=c(s.inverseModel,s.model),t.disable(t.CULL_FACE),this.texture.bind(0);var u=new Array(16);for(l(u,s.view,s.model),l(u,s.projection,u),c(u,u),o=0;o<3;++o)s.eyePosition[o]=u[12+o]/u[15];var h,p=u[15];for(o=0;o<3;++o)p+=this.lightPosition[o]*u[4*o+3];for(o=0;o<3;++o){for(var d=u[12+o],f=0;f<3;++f)d+=u[4*f+o]*this.lightPosition[f];s.lightPosition[o]=d/p}this.triangleCount>0&&((h=this.triShader).bind(),h.uniforms=s,this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&this.lineWidth>0&&((h=this.lineShader).bind(),h.uniforms=s,this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((h=this.pointShader).bind(),h.uniforms=s,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind()),this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((h=this.contourShader).bind(),h.uniforms=s,this.contourVAO.bind(),t.drawArrays(t.LINES,0,this.contourCount),this.contourVAO.unbind())},T.drawPick=function(e){e=e||{};for(var t=this.gl,r=e.model||w,n=e.view||w,i=e.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[t.drawingBufferWidth,t.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};(s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),t.drawArrays(t.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),t.lineWidth(this.lineWidth*this.pixelRatio),t.drawArrays(t.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),t.drawArrays(t.POINTS,0,this.pointCount),this.pointVAO.unbind())},T.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;for(var t=e.value[0]+256*e.value[1]+65536*e.value[2],r=this.cells[t],n=this.positions,i=new Array(r.length),a=0;a<r.length;++a)i[a]=n[r[a]];var o=e.coord[0],s=e.coord[1];if(!this.pickVertex){var l=this.positions[r[0]],c=this.positions[r[1]],u=this.positions[r[2]],h=[(l[0]+c[0]+u[0])/3,(l[1]+c[1]+u[1])/3,(l[2]+c[2]+u[2])/3];return{_cellCenter:!0,position:[o,s],index:t,cell:r,cellId:t,intensity:this.intensity[t],dataCoordinate:h}}var p=m(i,[o*this.pixelRatio,this._resolution[1]-s*this.pixelRatio],this._model,this._view,this._projection,this._resolution);if(!p)return null;var d=p[2],f=0;for(a=0;a<r.length;++a)f+=d[a]*this.intensity[r[a]];return{position:p[1],index:r[p[0]],cell:r,cellId:t,intensity:f,dataCoordinate:this.positions[r[p[0]]]}},T.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.lineShader.dispose(),this.pointShader.dispose(),this.pickShader.dispose(),this.pointPickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleNormals.dispose(),this.triangleIds.dispose(),this.edgeVAO.dispose(),this.edgePositions.dispose(),this.edgeColors.dispose(),this.edgeUVs.dispose(),this.edgeIds.dispose(),this.pointVAO.dispose(),this.pointPositions.dispose(),this.pointColors.dispose(),this.pointUVs.dispose(),this.pointSizes.dispose(),this.pointIds.dispose(),this.contourVAO.dispose(),this.contourPositions.dispose(),this.contourShader.dispose()},e.exports=function(e,t){if(1===arguments.length&&(e=(t=e).gl),!(e.getExtension("OES_standard_derivatives")||e.getExtension("MOZ_OES_standard_derivatives")||e.getExtension("WEBKIT_OES_standard_derivatives")))throw new Error("derivatives not supported");var r=function(e){var t=n(e,g.vertex,g.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.normal.location=4,t}(e),s=function(e){var t=n(e,y.vertex,y.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t}(e),l=function(e){var t=n(e,v.vertex,v.fragment);return t.attributes.position.location=0,t.attributes.color.location=2,t.attributes.uv.location=3,t.attributes.pointSize.location=4,t}(e),c=function(e){var t=n(e,x.vertex,x.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t}(e),h=function(e){var t=n(e,b.vertex,b.fragment);return t.attributes.position.location=0,t.attributes.id.location=1,t.attributes.pointSize.location=4,t}(e),p=function(e){var t=n(e,_.vertex,_.fragment);return t.attributes.position.location=0,t}(e),d=o(e,u(new Uint8Array([255,255,255,255]),[1,1,4]));d.generateMipmap(),d.minFilter=e.LINEAR_MIPMAP_LINEAR,d.magFilter=e.LINEAR;var f=i(e),m=i(e),w=i(e),T=i(e),S=i(e),A=a(e,[{buffer:f,type:e.FLOAT,size:3},{buffer:S,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:m,type:e.FLOAT,size:4},{buffer:w,type:e.FLOAT,size:2},{buffer:T,type:e.FLOAT,size:3}]),M=i(e),E=i(e),C=i(e),P=i(e),L=a(e,[{buffer:M,type:e.FLOAT,size:3},{buffer:P,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:E,type:e.FLOAT,size:4},{buffer:C,type:e.FLOAT,size:2}]),I=i(e),z=i(e),O=i(e),R=i(e),D=i(e),j=a(e,[{buffer:I,type:e.FLOAT,size:3},{buffer:D,type:e.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:z,type:e.FLOAT,size:4},{buffer:O,type:e.FLOAT,size:2},{buffer:R,type:e.FLOAT,size:1}]),F=i(e),B=new k(e,d,r,s,l,c,h,p,f,S,m,w,T,A,M,P,E,C,L,I,D,z,O,R,j,F,a(e,[{buffer:F,type:e.FLOAT,size:3}]));return B.update(t),B}},4437:function(e,t,r){e.exports=function(e,t){e=e||document.body;var r=[.01,1/0];"distanceLimits"in(t=t||{})&&(r[0]=t.distanceLimits[0],r[1]=t.distanceLimits[1]),"zoomMin"in t&&(r[0]=t.zoomMin),"zoomMax"in t&&(r[1]=t.zoomMax);var c=i({center:t.center||[0,0,0],up:t.up||[0,1,0],eye:t.eye||[0,0,10],mode:t.mode||"orbit",distanceLimits:r}),u=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0,p=e.clientWidth,d=e.clientHeight,f={keyBindingMode:"rotate",enableWheel:!0,view:c,element:e,delay:t.delay||16,rotateSpeed:t.rotateSpeed||1,zoomSpeed:t.zoomSpeed||1,translateSpeed:t.translateSpeed||1,flipX:!!t.flipX,flipY:!!t.flipY,modes:c.modes,_ortho:t._ortho||t.projection&&"orthographic"===t.projection.type||!1,tick:function(){var t=n(),r=this.delay,i=t-2*r;c.idle(t-r),c.recalcMatrix(i),c.flush(t-(100+2*r));for(var a=!0,o=c.computedMatrix,s=0;s<16;++s)a=a&&u[s]===o[s],u[s]=o[s];var l=e.clientWidth===p&&e.clientHeight===d;return p=e.clientWidth,d=e.clientHeight,a?!l:(h=Math.exp(c.computedRadius[0]),!0)},lookAt:function(e,t,r){c.lookAt(c.lastT(),e,t,r)},rotate:function(e,t,r){c.rotate(c.lastT(),e,t,r)},pan:function(e,t,r){c.pan(c.lastT(),e,t,r)},translate:function(e,t,r){c.translate(c.lastT(),e,t,r)}};return Object.defineProperties(f,{matrix:{get:function(){return c.computedMatrix},set:function(e){return c.setMatrix(c.lastT(),e),c.computedMatrix},enumerable:!0},mode:{get:function(){return c.getMode()},set:function(e){var t=c.computedUp.slice(),r=c.computedEye.slice(),i=c.computedCenter.slice();if(c.setMode(e),"turntable"===e){var a=n();c._active.lookAt(a,r,i,t),c._active.lookAt(a+500,r,i,[0,0,1]),c._active.flush(a)}return c.getMode()},enumerable:!0},center:{get:function(){return c.computedCenter},set:function(e){return c.lookAt(c.lastT(),null,e),c.computedCenter},enumerable:!0},eye:{get:function(){return c.computedEye},set:function(e){return c.lookAt(c.lastT(),e),c.computedEye},enumerable:!0},up:{get:function(){return c.computedUp},set:function(e){return c.lookAt(c.lastT(),null,null,e),c.computedUp},enumerable:!0},distance:{get:function(){return h},set:function(e){return c.setDistance(c.lastT(),e),e},enumerable:!0},distanceLimits:{get:function(){return c.getDistanceLimits(r)},set:function(e){return c.setDistanceLimits(e),e},enumerable:!0}}),e.addEventListener("contextmenu",(function(e){return e.preventDefault(),!1})),f._lastX=-1,f._lastY=-1,f._lastMods={shift:!1,control:!1,alt:!1,meta:!1},f.enableMouseListeners=function(){function t(t,r,i,a){var o=f.keyBindingMode;if(!1!==o){var s="rotate"===o,l="pan"===o,u="zoom"===o,p=!!a.control,d=!!a.alt,m=!!a.shift,g=!!(1&t),y=!!(2&t),v=!!(4&t),x=1/e.clientHeight,b=x*(r-f._lastX),_=x*(i-f._lastY),w=f.flipX?1:-1,k=f.flipY?1:-1,T=Math.PI*f.rotateSpeed,S=n();if(-1!==f._lastX&&-1!==f._lastY&&((s&&g&&!p&&!d&&!m||g&&!p&&!d&&m)&&c.rotate(S,w*T*b,-k*T*_,0),(l&&g&&!p&&!d&&!m||y||g&&p&&!d&&!m)&&c.pan(S,-f.translateSpeed*b*h,f.translateSpeed*_*h,0),u&&g&&!p&&!d&&!m||v||g&&!p&&d&&!m)){var A=-f.zoomSpeed*_/window.innerHeight*(S-c.lastT())*100;c.pan(S,0,0,h*(Math.exp(A)-1))}return f._lastX=r,f._lastY=i,f._lastMods=a,!0}}f.mouseListener=a(e,t),e.addEventListener("touchstart",(function(r){var n=s(r.changedTouches[0],e);t(0,n[0],n[1],f._lastMods),t(1,n[0],n[1],f._lastMods)}),!!l&&{passive:!0}),e.addEventListener("touchmove",(function(r){var n=s(r.changedTouches[0],e);t(1,n[0],n[1],f._lastMods),r.preventDefault()}),!!l&&{passive:!1}),e.addEventListener("touchend",(function(e){t(0,f._lastX,f._lastY,f._lastMods)}),!!l&&{passive:!0}),f.wheelListener=o(e,(function(e,t){if(!1!==f.keyBindingMode&&f.enableWheel){var r=f.flipX?1:-1,i=f.flipY?1:-1,a=n();if(Math.abs(e)>Math.abs(t))c.rotate(a,0,0,-e*r*Math.PI*f.rotateSpeed/window.innerWidth);else if(!f._ortho){var o=-f.zoomSpeed*i*t/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}}),!0)},f.enableMouseListeners(),f};var n=r(3025),i=r(6296),a=r(351),o=r(8512),s=r(24),l=r(7520)},799:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec2"}])}},4100:function(e,t,r){var n=r(4437),i=r(3837),a=r(5445),o=r(4449),s=r(3589),l=r(2260),c=r(7169),u=r(351),h=r(4772),p=r(4040),d=r(799),f=r(9216)({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(e){var t=Math.round(Math.log(Math.abs(e))/Math.log(10));if(t<0){var r=Math.round(Math.pow(10,-t));return Math.ceil(e*r)/r}return t>0?(r=Math.round(Math.pow(10,t)),Math.ceil(e/r)*r):Math.ceil(e)}function y(e){return"boolean"!==typeof e||e}e.exports={createScene:function(e){(e=e||{}).camera=e.camera||{};var t=e.canvas;t||(t=document.createElement("canvas"),e.container?e.container.appendChild(t):document.body.appendChild(t));var r=e.gl;if(r||(e.glOptions&&(f=!!e.glOptions.preserveDrawingBuffer),r=function(e,t){var r=null;try{(r=e.getContext("webgl",t))||(r=e.getContext("experimental-webgl",t))}catch(n){return null}return r}(t,e.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:f})),!r)throw new Error("webgl not supported");var v=e.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!f}),_=d(r),w=e.cameraObject&&!0===e.cameraObject._ortho||e.camera.projection&&"orthographic"===e.camera.projection.type||!1,k={eye:e.camera.eye||[2,0,0],center:e.camera.center||[0,0,0],up:e.camera.up||[0,1,0],zoomMin:e.camera.zoomMax||.1,zoomMax:e.camera.zoomMin||100,mode:e.camera.mode||"turntable",_ortho:w},T=e.axes||{},S=i(r,T);S.enable=!T.disable;var A=e.spikes||{},M=o(r,A),E=[],C=[],P=[],L=[],I=!0,z=!0,O=new Array(16),R=new Array(16),D={view:null,projection:O,model:R,_ortho:!1},j=(z=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),F=e.cameraObject||n(t,k),B={gl:r,contextLost:!1,pixelRatio:e.pixelRatio||1,canvas:t,selection:x,camera:F,axes:S,axesPixels:null,spikes:M,bounds:v,objects:E,shape:j,aspect:e.aspectRatio||[1,1,1],pickRadius:e.pickRadius||10,zNear:e.zNear||.01,zFar:e.zFar||1e3,fovy:e.fovy||Math.PI/4,clearColor:e.clearColor||[0,0,0,0],autoResize:y(e.autoResize),autoBounds:y(e.autoBounds),autoScale:!!e.autoScale,autoCenter:y(e.autoCenter),clipToBounds:y(e.clipToBounds),snapToData:!!e.snapToData,onselect:e.onselect||null,onrender:e.onrender||null,onclick:e.onclick||null,cameraParams:D,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(e){this.aspect[0]=e.x,this.aspect[1]=e.y,this.aspect[2]=e.z,z=!0},setBounds:function(e,t){this.bounds[0][e]=t.min,this.bounds[1][e]=t.max},setClearColor:function(e){this.clearColor=e},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},N=[r.drawingBufferWidth/B.pixelRatio|0,r.drawingBufferHeight/B.pixelRatio|0];function U(){if(!B._stopped&&B.autoResize){var e=t.parentNode,r=1,n=1;e&&e!==document.body?(r=e.clientWidth,n=e.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*B.pixelRatio),a=0|Math.ceil(n*B.pixelRatio);if(i!==t.width||a!==t.height){t.width=i,t.height=a;var o=t.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}function V(){for(var e=E.length,t=L.length,n=0;n<t;++n)P[n]=0;e:for(n=0;n<e;++n){var i=E[n],a=i.pickSlots;if(a){for(var o=0;o<t;++o)if(P[o]+a<255){C[n]=o,i.setPickBase(P[o]+1),P[o]+=a;continue e}var l=s(r,j);C[n]=t,L.push(l),P.push(a),i.setPickBase(1),t+=1}else C[n]=-1}for(;t>0&&0===P[t-1];)P.pop(),L.pop().dispose()}function q(){if(B.contextLost)return!0;r.isContextLost()&&(B.contextLost=!0,B.mouseListener.enabled=!1,B.selection.object=null,B.oncontextloss&&B.oncontextloss())}B.autoResize&&U(),window.addEventListener("resize",U),B.update=function(e){B._stopped||(e=e||{},I=!0,z=!0)},B.add=function(e){B._stopped||(e.axes=S,E.push(e),C.push(-1),I=!0,z=!0,V())},B.remove=function(e){if(!B._stopped){var t=E.indexOf(e);t<0||(E.splice(t,1),C.pop(),I=!0,z=!0,V())}},B.dispose=function(){if(!B._stopped&&(B._stopped=!0,window.removeEventListener("resize",U),t.removeEventListener("webglcontextlost",q),B.mouseListener.enabled=!1,!B.contextLost)){S.dispose(),M.dispose();for(var e=0;e<E.length;++e)E[e].dispose();for(b.dispose(),e=0;e<L.length;++e)L[e].dispose();_.dispose(),r=null,S=null,M=null,E=[]}},B._mouseRotating=!1,B._prevButtons=0,B.enableMouseListeners=function(){B.mouseListener=u(t,(function(e,t,r){if(!B._stopped){var n=L.length,i=E.length,a=x.object;x.distance=1/0,x.mouse[0]=t,x.mouse[1]=r,x.object=null,x.screen=null,x.dataCoordinate=x.dataPosition=null;var o=!1;if(e&&B._prevButtons)B._mouseRotating=!0;else{B._mouseRotating&&(z=!0),B._mouseRotating=!1;for(var s=0;s<n;++s){var l=L[s].query(t,N[1]-r-1,B.pickRadius);if(l){if(l.distance>x.distance)continue;for(var c=0;c<i;++c){var u=E[c];if(C[c]===s){var h=u.pick(l);h&&(x.buttons=e,x.screen=l.coord,x.distance=l.distance,x.object=u,x.index=h.distance,x.dataPosition=h.position,x.dataCoordinate=h.dataCoordinate,x.data=h,o=!0)}}}}}a&&a!==x.object&&(a.highlight&&a.highlight(null),I=!0),x.object&&(x.object.highlight&&x.object.highlight(x.data),I=!0),(o=o||x.object!==a)&&B.onselect&&B.onselect(x),1&e&&!(1&B._prevButtons)&&B.onclick&&B.onclick(x),B._prevButtons=e}}))},t.addEventListener("webglcontextlost",q);var H=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],G=[H[0].slice(),H[1].slice()];function W(){if(!q()){U();var e=B.camera.tick();D.view=B.camera.matrix,I=I||e,z=z||e,S.pixelRatio=B.pixelRatio,M.pixelRatio=B.pixelRatio;var t=E.length,n=H[0],i=H[1];n[0]=n[1]=n[2]=1/0,i[0]=i[1]=i[2]=-1/0;for(var o=0;o<t;++o){(P=E[o]).pixelRatio=B.pixelRatio,P.axes=B.axes,I=I||!!P.dirty,z=z||!!P.dirty;var s=P.bounds;if(s)for(var l=s[0],u=s[1],d=0;d<3;++d)n[d]=Math.min(n[d],l[d]),i[d]=Math.max(i[d],u[d])}var f=B.bounds;if(B.autoBounds)for(d=0;d<3;++d){if(i[d]<n[d])n[d]=-1,i[d]=1;else{n[d]===i[d]&&(n[d]-=1,i[d]+=1);var m=.05*(i[d]-n[d]);n[d]=n[d]-m,i[d]=i[d]+m}f[0][d]=n[d],f[1][d]=i[d]}var y=!1;for(d=0;d<3;++d)y=y||G[0][d]!==f[0][d]||G[1][d]!==f[1][d],G[0][d]=f[0][d],G[1][d]=f[1][d];if(z=z||y,I=I||y){if(y){var v=[0,0,0];for(o=0;o<3;++o)v[o]=g((f[1][o]-f[0][o])/10);S.autoTicks?S.update({bounds:f,tickSpacing:v}):S.update({bounds:f})}var k=r.drawingBufferWidth,T=r.drawingBufferHeight;for(j[0]=k,j[1]=T,N[0]=0|Math.max(k/B.pixelRatio,1),N[1]=0|Math.max(T/B.pixelRatio,1),function(e,t){var r=e.bounds,n=e.cameraParams,i=n.projection,a=n.model,o=e.gl.drawingBufferWidth,s=e.gl.drawingBufferHeight,l=e.zNear,c=e.zFar,u=e.fovy,d=o/s;t?(p(i,-d,d,-1,1,l,c),n._ortho=!0):(h(i,u,d,l,c),n._ortho=!1);for(var f=0;f<16;++f)a[f]=0;a[15]=1;var m=0;for(f=0;f<3;++f)m=Math.max(m,r[1][f]-r[0][f]);for(f=0;f<3;++f)e.autoScale?a[5*f]=e.aspect[f]/(r[1][f]-r[0][f]):a[5*f]=1/m,e.autoCenter&&(a[12+f]=.5*-a[5*f]*(r[0][f]+r[1][f]))}(B,w),o=0;o<t;++o)(P=E[o]).axesBounds=f,B.clipToBounds&&(P.clipBounds=f);x.object&&(B.snapToData?M.position=x.dataCoordinate:M.position=x.dataPosition,M.bounds=f),z&&(z=!1,function(){if(!q()){r.colorMask(!0,!0,!0,!0),r.depthMask(!0),r.disable(r.BLEND),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL);for(var e=E.length,t=L.length,n=0;n<t;++n){var i=L[n];i.shape=N,i.begin();for(var a=0;a<e;++a)if(C[a]===n){var o=E[a];o.drawPick&&(o.pixelRatio=1,o.drawPick(D))}i.end()}}}()),B.axesPixels=a(B.axes,D,k,T),B.onrender&&B.onrender(),r.bindFramebuffer(r.FRAMEBUFFER,null),r.viewport(0,0,k,T),B.clearRGBA(),r.depthMask(!0),r.colorMask(!0,!0,!0,!0),r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL),r.disable(r.BLEND),r.disable(r.CULL_FACE);var A=!1;for(S.enable&&(A=A||S.isTransparent(),S.draw(D)),M.axes=S,x.object&&M.draw(D),r.disable(r.CULL_FACE),o=0;o<t;++o)(P=E[o]).axes=S,P.pixelRatio=B.pixelRatio,P.isOpaque&&P.isOpaque()&&P.draw(D),P.isTransparent&&P.isTransparent()&&(A=!0);if(A){for(b.shape=j,b.bind(),r.clear(r.DEPTH_BUFFER_BIT),r.colorMask(!1,!1,!1,!1),r.depthMask(!0),r.depthFunc(r.LESS),S.enable&&S.isTransparent()&&S.drawTransparent(D),o=0;o<t;++o)(P=E[o]).isOpaque&&P.isOpaque()&&P.draw(D);for(r.enable(r.BLEND),r.blendEquation(r.FUNC_ADD),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.colorMask(!0,!0,!0,!0),r.depthMask(!1),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),S.isTransparent()&&S.drawTransparent(D),o=0;o<t;++o){var P;(P=E[o]).isTransparent&&P.isTransparent()&&P.drawTransparent(D)}r.bindFramebuffer(r.FRAMEBUFFER,null),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.disable(r.DEPTH_TEST),_.bind(),b.color[0].bind(0),_.uniforms.accumBuffer=0,c(r),r.disable(r.BLEND)}for(I=!1,o=0;o<t;++o)E[o].dirty=!1}}}return B.enableMouseListeners(),function e(){B._stopped||B.contextLost||(W(),requestAnimationFrame(e))}(),B.redraw=function(){B._stopped||(I=!0,W())},B},createCamera:n}},783:function(e){e.exports=function(e,t,r,n){var i,a,o,s,l,c=t[0],u=t[1],h=t[2],p=t[3],d=r[0],f=r[1],m=r[2],g=r[3];return(a=c*d+u*f+h*m+p*g)<0&&(a=-a,d=-d,f=-f,m=-m,g=-g),1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n),e[0]=s*c+l*d,e[1]=s*u+l*f,e[2]=s*h+l*m,e[3]=s*p+l*g,e}},5964:function(e){e.exports=function(e){return e||0===e?e.toString():""}},9366:function(e,t,r){var n=r(4359);e.exports=function(e,t,r){var a=[t.style,t.weight,t.variant,t.family].join("_"),o=i[a];if(o||(o=i[a]={}),e in o)return o[e];var s={textAlign:"center",textBaseline:"middle",lineHeight:1,font:t.family,fontStyle:t.style,fontWeight:t.weight,fontVariant:t.variant,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},l=n(e,s);s.triangles=!1;var c,u,h=n(e,s);if(r&&1!==r){for(c=0;c<l.positions.length;++c)for(u=0;u<l.positions[c].length;++u)l.positions[c][u]/=r;for(c=0;c<h.positions.length;++c)for(u=0;u<h.positions[c].length;++u)h.positions[c][u]/=r}var p=[[1/0,1/0],[-1/0,-1/0]],d=h.positions.length;for(c=0;c<d;++c){var f=h.positions[c];for(u=0;u<2;++u)p[0][u]=Math.min(p[0][u],f[u]),p[1][u]=Math.max(p[1][u],f[u])}return o[e]=[l,h,p]};var i={}},1283:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * (view * (model * vec4(position, 1)));\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * (view * (model * vec4(dataPosition, 1)));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],h={vertex:a,fragment:l,attributes:u},p={vertex:o,fragment:l,attributes:u},d={vertex:s,fragment:l,attributes:u},f={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function y(e,t){var r=n(e,t),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}t.createPerspective=function(e){return y(e,h)},t.createOrtho=function(e){return y(e,p)},t.createProject=function(e){return y(e,d)},t.createPickPerspective=function(e){return y(e,f)},t.createPickOrtho=function(e){return y(e,m)},t.createPickProject=function(e){return y(e,g)}},8418:function(e,t,r){var n=r(5219),i=r(2762),a=r(8116),o=r(1888),s=r(6760),l=r(1283),c=r(9366),u=r(5964),h=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],p=ArrayBuffer,d=DataView;function f(e){return Array.isArray(e)||function(e){return p.isView(e)&&!(e instanceof d)}(e)}function m(e,t){var r=e[0],n=e[1],i=e[2],a=e[3];return e[0]=t[0]*r+t[4]*n+t[8]*i+t[12]*a,e[1]=t[1]*r+t[5]*n+t[9]*i+t[13]*a,e[2]=t[2]*r+t[6]*n+t[10]*i+t[14]*a,e[3]=t[3]*r+t[7]*n+t[11]*i+t[15]*a,e}function g(e,t,r,n){return m(n,n),m(n,n),m(n,n)}function y(e,t){this.index=e,this.dataCoordinate=this.position=t}function v(e){return!0===e||e>1?1:e}function x(e,t,r,n,i,a,o,s,l,c,u,h){this.gl=e,this.pixelRatio=1,this.shader=t,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=h,this.points=[],this._selectResult=new y(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(e){var t=e.gl,r=l.createPerspective(t),n=l.createOrtho(t),o=l.createProject(t),s=l.createPickPerspective(t),c=l.createPickOrtho(t),u=l.createPickProject(t),h=i(t),p=i(t),d=i(t),f=i(t),m=a(t,[{buffer:h,size:3,type:t.FLOAT},{buffer:p,size:4,type:t.FLOAT},{buffer:d,size:2,type:t.FLOAT},{buffer:f,size:4,type:t.UNSIGNED_BYTE,normalized:!0}]),g=new x(t,r,n,o,h,p,d,f,m,s,c,u);return g.update(e),g};var b=x.prototype;b.pickSlots=1,b.setPickBase=function(e){this.pickId=e},b.isTransparent=function(){if(this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&this.projectHasAlpha)return!0;return!1},b.isOpaque=function(){if(!this.hasAlpha)return!0;for(var e=0;e<3;++e)if(this.axesProject[e]&&!this.projectHasAlpha)return!0;return!1};var _=[0,0],w=[0,0,0],k=[0,0,0],T=[0,0,0,1],S=[0,0,0,1],A=h.slice(),M=[0,0,0],E=[[0,0,0],[0,0,0]];function C(e){return e[0]=e[1]=e[2]=0,e}function P(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=1,e}function L(e,t,r,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[r]=n,e}function I(e,t,r,n){var i,a=t.axesProject,o=t.gl,l=e.uniforms,c=r.model||h,u=r.view||h,p=r.projection||h,d=t.axesBounds,f=function(e){for(var t=E,r=0;r<2;++r)for(var n=0;n<3;++n)t[r][n]=Math.max(Math.min(e[r][n],1e8),-1e8);return t}(t.clipBounds);i=t.axes&&t.axes.lastCubeProps?t.axes.lastCubeProps.axis:[1,1,1],_[0]=2/o.drawingBufferWidth,_[1]=2/o.drawingBufferHeight,e.bind(),l.view=u,l.projection=p,l.screenSize=_,l.highlightId=t.highlightId,l.highlightScale=t.highlightScale,l.clipBounds=f,l.pickGroup=t.pickId/255,l.pixelRatio=n;for(var m=0;m<3;++m)if(a[m]){l.scale=t.projectScale[m],l.opacity=t.projectOpacity[m];for(var y=A,v=0;v<16;++v)y[v]=0;for(v=0;v<4;++v)y[5*v]=1;y[5*m]=0,i[m]<0?y[12+m]=d[0][m]:y[12+m]=d[1][m],s(y,c,y),l.model=y;var x=(m+1)%3,b=(m+2)%3,I=C(w),z=C(k);I[x]=1,z[b]=1;var O=g(0,0,0,P(T,I)),R=g(0,0,0,P(S,z));if(Math.abs(O[1])>Math.abs(R[1])){var D=O;O=R,R=D,D=I,I=z,z=D;var j=x;x=b,b=j}O[0]<0&&(I[x]=-1),R[1]>0&&(z[b]=-1);var F=0,B=0;for(v=0;v<4;++v)F+=Math.pow(c[4*x+v],2),B+=Math.pow(c[4*b+v],2);I[x]/=Math.sqrt(F),z[b]/=Math.sqrt(B),l.axes[0]=I,l.axes[1]=z,l.fragClipBounds[0]=L(M,f[0],m,-1e8),l.fragClipBounds[1]=L(M,f[1],m,1e8),t.vao.bind(),t.vao.draw(o.TRIANGLES,t.vertexCount),t.lineWidth>0&&(o.lineWidth(t.lineWidth*n),t.vao.draw(o.LINES,t.lineVertexCount,t.vertexCount)),t.vao.unbind()}}var z=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function O(e,t,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&I(t,r,n,i),a===r.hasAlpha||o){e.bind();var l=e.uniforms;l.model=n.model||h,l.view=n.view||h,l.projection=n.projection||h,_[0]=2/s.drawingBufferWidth,_[1]=2/s.drawingBufferHeight,l.screenSize=_,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=z,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function R(e,t,r,i){var a;a=f(e)?t<e.length?e[t]:void 0:e,a=u(a);var o=!0;n(a)&&(a="\u25bc",o=!1),r||(r={});var s=r.family;f(s)&&(s=s[t]),s||(s="normal");var l=r.weight;f(l)&&(l=l[t]),l||(l="normal");var h=r.style;f(h)&&(h=h[t]),h||(h="normal");var p=r.variant;f(p)&&(p=p[t]),p||(p="normal");var d=c(a,{family:s,weight:l,style:h,variant:p},i);return{mesh:(d=c(a,r,i))[0],lines:d[1],bounds:d[2],visible:o}}b.draw=function(e){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!1,!1)},b.drawTransparent=function(e){O(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,e,this.pixelRatio,!0,!1)},b.drawPick=function(e){O(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,e,1,!0,!0)},b.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=e.value[2]+(e.value[1]<<8)+(e.value[0]<<16);if(t>=this.pointCount||t<0)return null;var r=this.points[t],n=this._selectResult;n.index=t;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},b.highlight=function(e){if(e){var t=e.index,r=255&t,n=t>>8&255,i=t>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},b.update=function(e){if("perspective"in(e=e||{})&&(this.useOrtho=!e.perspective),"orthographic"in e&&(this.useOrtho=!!e.orthographic),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"project"in e)if(f(e.project))this.axesProject=e.project;else{var t=!!e.project;this.axesProject=[t,t,t]}if("projectScale"in e)if(f(e.projectScale))this.projectScale=e.projectScale.slice();else{var r=+e.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in e){f(e.projectOpacity)?this.projectOpacity=e.projectOpacity.slice():(r=+e.projectOpacity,this.projectOpacity=[r,r,r]);for(var n=0;n<3;++n)this.projectOpacity[n]=v(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in e&&(this.opacity=v(e.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=e.position,l={family:e.font||"normal",style:e.fontStyle||"normal",weight:e.fontWeight||"normal",variant:e.fontVariant||"normal"},c=e.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else for(i=[],a=[],n=0;n<c.length;++n)i[n]=c[n][0],a[n]=c[n][1];var u=[1/0,1/0,1/0],h=[-1/0,-1/0,-1/0],p=e.glyph,d=e.color,m=e.size,g=e.angle,y=e.lineColor,x=-1,b=0,_=0,w=0;if(s.length){w=s.length;e:for(n=0;n<w;++n){for(var k=s[n],T=0;T<3;++T)if(isNaN(k[T])||!isFinite(k[T]))continue e;var S=(N=R(p,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;b+=3*S.cells.length,_+=2*A.edges.length}}var E=b+_,C=o.mallocFloat(3*E),P=o.mallocFloat(4*E),L=o.mallocFloat(2*E),I=o.mallocUint32(E);if(E>0){var z=0,O=b,D=[0,0,0,1],j=[0,0,0,1],F=f(d)&&f(d[0]),B=f(y)&&f(y[0]);e:for(n=0;n<w;++n){for(x+=1,k=s[n],T=0;T<3;++T){if(isNaN(k[T])||!isFinite(k[T]))continue e;h[T]=Math.max(h[T],k[T]),u[T]=Math.min(u[T],k[T])}S=(N=R(p,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,U=N.visible;if(U)if(f(d)){if(3===(V=F?n<d.length?d[n]:[0,0,0,0]:d).length){for(T=0;T<3;++T)D[T]=V[T];D[3]=1}else if(4===V.length){for(T=0;T<4;++T)D[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else D[0]=D[1]=D[2]=0,D[3]=1;else D=[1,1,1,0];if(U)if(f(y)){var V;if(3===(V=B?n<y.length?y[n]:[0,0,0,0]:y).length){for(T=0;T<3;++T)j[T]=V[T];j[T]=1}else if(4===V.length){for(T=0;T<4;++T)j[T]=V[T];!this.hasAlpha&&V[3]<1&&(this.hasAlpha=!0)}}else j[0]=j[1]=j[2]=0,j[3]=1;else j=[1,1,1,0];var q=.5;U?f(m)?q=n<m.length?+m[n]:12:m?q=+m:this.useOrtho&&(q=12):q=0;var H=0;f(g)?H=n<g.length?+g[n]:0:g&&(H=+g);var G=Math.cos(H),W=Math.sin(H);for(k=s[n],T=0;T<3;++T)h[T]=Math.max(h[T],k[T]),u[T]=Math.min(u[T],k[T]);var $=i,Z=a;$=0,f(i)?$=n<i.length?i[n]:0:i&&($=i),Z=0,f(a)?Z=n<a.length?a[n]:0:a&&(Z=a);var X=[$*=$>0?1-M[0][0]:$<0?1+M[1][0]:1,Z*=Z>0?1-M[0][1]:Z<0?1+M[1][1]:1],Y=S.cells||[],K=S.positions||[];for(T=0;T<Y.length;++T)for(var J=Y[T],Q=0;Q<3;++Q){for(var ee=0;ee<3;++ee)C[3*z+ee]=k[ee];for(ee=0;ee<4;++ee)P[4*z+ee]=D[ee];I[z]=x;var te=K[J[Q]];L[2*z]=q*(G*te[0]-W*te[1]+X[0]),L[2*z+1]=q*(W*te[0]+G*te[1]+X[1]),z+=1}for(Y=A.edges,K=A.positions,T=0;T<Y.length;++T)for(J=Y[T],Q=0;Q<2;++Q){for(ee=0;ee<3;++ee)C[3*O+ee]=k[ee];for(ee=0;ee<4;++ee)P[4*O+ee]=j[ee];I[O]=x,te=K[J[Q]],L[2*O]=q*(G*te[0]-W*te[1]+X[0]),L[2*O+1]=q*(W*te[0]+G*te[1]+X[1]),O+=1}}}this.bounds=[u,h],this.points=s,this.pointCount=s.length,this.vertexCount=b,this.lineVertexCount=_,this.pointBuffer.update(C),this.colorBuffer.update(P),this.glyphBuffer.update(L),this.idBuffer.update(I),o.free(C),o.free(P),o.free(L),o.free(I)},b.dispose=function(){this.shader.dispose(),this.orthoShader.dispose(),this.pickPerspectiveShader.dispose(),this.pickOrthoShader.dispose(),this.vao.dispose(),this.pointBuffer.dispose(),this.colorBuffer.dispose(),this.glyphBuffer.dispose(),this.idBuffer.dispose()}},3589:function(e,t,r){e.exports=function(e,t){var r=t[0],a=t[1],o=n(e,r,a,{}),s=i.mallocUint8(r*a*4);return new l(e,o,s)};var n=r(2260),i=r(1888),a=r(9618),o=r(8828).nextPow2;function s(e,t,r,n,i){this.coord=[e,t],this.id=r,this.value=n,this.distance=i}function l(e,t,r){this.gl=e,this.fbo=t,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(t.bind(),e.readPixels(0,0,t.shape[0],t.shape[1],e.RGBA,e.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(e){if(this.gl){this.fbo.shape=e;var t=this.fbo.shape[0],r=this.fbo.shape[1];if(r*t*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*t*4)),a=0;a<r*t*4;++a)n[a]=255}return e}}}),c.begin=function(){var e=this.gl;this.shape,e&&(this.fbo.bind(),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT))},c.end=function(){var e=this.gl;e&&(e.bindFramebuffer(e.FRAMEBUFFER,null),this._readTimeout||clearTimeout(this._readTimeout),this._readTimeout=setTimeout(this._readCallback,1))},c.query=function(e,t,r){if(!this.gl)return null;var n=this.fbo.shape.slice();e|=0,t|=0,"number"!==typeof r&&(r=1);var i=0|Math.min(Math.max(e-r,0),n[0]),o=0|Math.min(Math.max(e+r,0),n[0]),l=0|Math.min(Math.max(t-r,0),n[1]),c=0|Math.min(Math.max(t+r,0),n[1]);if(o<=i||c<=l)return null;var u=[o-i,c-l],h=a(this.buffer,[u[0],u[1],4],[4,4*n[0],1],4*(i+n[0]*l)),p=function(e,t,r){for(var n=1e8,i=-1,a=-1,o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++){var u=e.get(l,c,0),h=e.get(l,c,1),p=e.get(l,c,2),d=e.get(l,c,3);if(u<255||h<255||p<255||d<255){var f=t-l,m=r-c,g=f*f+m*m;g<n&&(n=g,i=l,a=c)}}return[i,a,n]}(h.hi(u[0],u[1],1),r,r),d=p[0],f=p[1];return d<0||Math.pow(this.radius,2)<p[2]?null:new s(d+i|0,f+l|0,h.get(d,f,0),[h.get(d,f,1),h.get(d,f,2),h.get(d,f,3)],Math.sqrt(p[2]))},c.dispose=function(){this.gl&&(this.fbo.dispose(),i.free(this.buffer),this.gl=null,this._readTimeout&&clearTimeout(this._readTimeout))}},9405:function(e,t,r){var n=r(3327),i=r(8731),a=r(216),o=r(5091),s=r(2145),l=r(8866);function c(e){this.gl=e,this.gl.lastAttribCount=0,this._vref=this._fref=this._relink=this.vertShader=this.fragShader=this.program=this.attributes=this.uniforms=this.types=null}var u=c.prototype;function h(e,t){return e.name<t.name?-1:1}u.bind=function(){var e;this.program||this._relink();var t=this.gl.getProgramParameter(this.program,this.gl.ACTIVE_ATTRIBUTES),r=this.gl.lastAttribCount;if(t>r)for(e=r;e<t;e++)this.gl.enableVertexAttribArray(e);else if(r>t)for(e=t;e<r;e++)this.gl.disableVertexAttribArray(e);this.gl.lastAttribCount=t,this.gl.useProgram(this.program)},u.dispose=function(){for(var e=this.gl.lastAttribCount,t=0;t<e;t++)this.gl.disableVertexAttribArray(t);this.gl.lastAttribCount=0,this._fref&&this._fref.dispose(),this._vref&&this._vref.dispose(),this.attributes=this.types=this.vertShader=this.fragShader=this.program=this._relink=this._fref=this._vref=null},u.update=function(e,t,r,c){if(!t||1===arguments.length){var u=e;e=u.vertex,t=u.fragment,r=u.uniforms,c=u.attributes}var p=this,d=p.gl,f=p._vref;p._vref=o.shader(d,d.VERTEX_SHADER,e),f&&f.dispose(),p.vertShader=p._vref.shader;var m=this._fref;if(p._fref=o.shader(d,d.FRAGMENT_SHADER,t),m&&m.dispose(),p.fragShader=p._fref.shader,!r||!c){var g=d.createProgram();if(d.attachShader(g,p.fragShader),d.attachShader(g,p.vertShader),d.linkProgram(g),!d.getProgramParameter(g,d.LINK_STATUS)){var y=d.getProgramInfoLog(g);throw new l(y,"Error linking program:"+y)}r=r||s.uniforms(d,g),c=c||s.attributes(d,g),d.deleteProgram(g)}(c=c.slice()).sort(h);var v,x=[],b=[],_=[];for(v=0;v<c.length;++v){var w=c[v];if(w.type.indexOf("mat")>=0){for(var k=0|w.type.charAt(w.type.length-1),T=new Array(k),S=0;S<k;++S)T[S]=_.length,b.push(w.name+"["+S+"]"),"number"===typeof w.location?_.push(w.location+S):Array.isArray(w.location)&&w.location.length===k&&"number"===typeof w.location[S]?_.push(0|w.location[S]):_.push(-1);x.push({name:w.name,type:w.type,locations:T})}else x.push({name:w.name,type:w.type,locations:[_.length]}),b.push(w.name),"number"===typeof w.location?_.push(0|w.location):_.push(-1)}var A=0;for(v=0;v<_.length;++v)if(_[v]<0){for(;_.indexOf(A)>=0;)A+=1;_[v]=A}var M=new Array(r.length);function E(){p.program=o.program(d,p._vref,p._fref,b,_);for(var e=0;e<r.length;++e)M[e]=d.getUniformLocation(p.program,r[e].name)}E(),p._relink=E,p.types={uniforms:a(r),attributes:a(c)},p.attributes=i(d,p,x,_),Object.defineProperty(p,"uniforms",n(d,p,r,M))},e.exports=function(e,t,r,n,i){var a=new c(e);return a.update(t,r,n,i),a}},8866:function(e){function t(e,t,r){this.shortMessage=t||"",this.longMessage=r||"",this.rawError=e||"",this.message="gl-shader: "+(t||e||"")+(r?"\n"+r:""),this.stack=(new Error).stack}t.prototype=new Error,t.prototype.name="GLError",t.prototype.constructor=t,e.exports=t},8731:function(e,t,r){e.exports=function(e,t,r,i){for(var a={},o=0,c=r.length;o<c;++o){var u=r[o],h=u.name,p=u.type,d=u.locations;switch(p){case"bool":case"int":case"float":s(e,t,d[0],i,1,a,h);break;default:if(p.indexOf("vec")>=0){if((f=p.charCodeAt(p.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+p);s(e,t,d[0],i,f,a,h)}else{if(!(p.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+h+": "+p);var f;if((f=p.charCodeAt(p.length-1)-48)<2||f>4)throw new n("","Invalid data type for attribute "+h+": "+p);l(e,t,d,i,f,a,h)}}}return a};var n=r(8866);function i(e,t,r,n,i,a){this._gl=e,this._wrapper=t,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(e,t,r,n){var i=this,a=i._gl,o=i._locations[i._index];a.vertexAttribPointer(o,i._dimension,e||a.FLOAT,!!t,r||0,n||0),a.enableVertexAttribArray(o)},a.set=function(e,t,r,n){return this._constFunc(this._locations[this._index],e,t,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(e){return e!==this._locations[this._index]&&(this._locations[this._index]=0|e,this._wrapper.program=null),0|e}});var o=[function(e,t,r){return void 0===r.length?e.vertexAttrib1f(t,r):e.vertexAttrib1fv(t,r)},function(e,t,r,n){return void 0===r.length?e.vertexAttrib2f(t,r,n):e.vertexAttrib2fv(t,r)},function(e,t,r,n,i){return void 0===r.length?e.vertexAttrib3f(t,r,n,i):e.vertexAttrib3fv(t,r)},function(e,t,r,n,i,a){return void 0===r.length?e.vertexAttrib4f(t,r,n,i,a):e.vertexAttrib4fv(t,r)}];function s(e,t,r,n,a,s,l){var c=o[a],u=new i(e,t,r,n,a,c);Object.defineProperty(s,l,{set:function(t){return e.disableVertexAttribArray(n[r]),c(e,n[r],t),t},get:function(){return u},enumerable:!0})}function l(e,t,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u<i;++u)s(e,t,r[u],n,i,l,u),c[u]=l[u];Object.defineProperty(l,"location",{set:function(e){if(Array.isArray(e))for(var t=0;t<i;++t)c[t].location=e[t];else for(t=0;t<i;++t)c[t].location=e+t;return e},get:function(){for(var e=new Array(i),t=0;t<i;++t)e[t]=n[r[t]];return e},enumerable:!0}),l.pointer=function(t,a,o,s){t=t||e.FLOAT,a=!!a,o=o||i*i,s=s||0;for(var l=0;l<i;++l){var c=n[r[l]];e.vertexAttribPointer(c,i,t,a,o,s+l*i),e.enableVertexAttribArray(c)}};var h=new Array(i),p=e["vertexAttrib"+i+"fv"];Object.defineProperty(a,o,{set:function(t){for(var a=0;a<i;++a){var o=n[r[a]];if(e.disableVertexAttribArray(o),Array.isArray(t[0]))p.call(e,o,t[a]);else{for(var s=0;s<i;++s)h[s]=t[i*a+s];p.call(e,o,h)}}return t},get:function(){return l},enumerable:!0})}},3327:function(e,t,r){var n=r(216),i=r(8866);function a(e){return function(){return e}}function o(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}e.exports=function(e,t,r,s){function l(t){return function(n){for(var a=c("",t),o=0;o<a.length;++o){var l=a[o],u=l[0],h=l[1];if(s[h]){var p=n;if("string"===typeof u&&(0===u.indexOf(".")||0===u.indexOf("["))){var d=u;if(0===u.indexOf(".")&&(d=u.slice(1)),d.indexOf("]")===d.length-1){var f=d.indexOf("["),m=d.slice(0,f),g=d.slice(f+1,d.length-1);p=m?n[m][g]:n[g]}else p=n[d]}var y,v=r[h].type;switch(v){case"bool":case"int":case"sampler2D":case"samplerCube":e.uniform1i(s[h],p);break;case"float":e.uniform1f(s[h],p);break;default:var x=v.indexOf("vec");if(!(0<=x&&x<=1&&v.length===4+x)){if(0===v.indexOf("mat")&&4===v.length){if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);e["uniformMatrix"+y+"fv"](s[h],!1,p);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((y=v.charCodeAt(v.length-1)-48)<2||y>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":e["uniform"+y+"iv"](s[h],p);break;case"v":e["uniform"+y+"fv"](s[h],p);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(e,t){if("object"!==typeof t)return[[e,t]];var r=[];for(var n in t){var i=t[n],a=e;parseInt(n)+""===n?a+="["+n+"]":a+="."+n,"object"===typeof i?r.push.apply(r,c(a,i)):r.push([a,i])}return r}function u(e,t,n){if("object"===typeof n){var c=h(n);Object.defineProperty(e,t,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(e,t,{get:(u=n,function(e,t,r){return e.getUniform(t.program,r[u])}),set:l(n),enumerable:!0,configurable:!1}):e[t]=function(e){switch(e){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var t=e.indexOf("vec");if(0<=t&&t<=1&&e.length===4+t){if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===e.charAt(0)?o(r,!1):o(r,0)}if(0===e.indexOf("mat")&&4===e.length){var r;if((r=e.charCodeAt(e.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+e);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+e)}}(r[n].type);var u}function h(e){var t;if(Array.isArray(e)){t=new Array(e.length);for(var r=0;r<e.length;++r)u(t,r,e[r])}else for(var n in t={},e)u(t,n,e[n]);return t}var p=n(r,!0);return{get:a(h(p)),set:l(p),enumerable:!0,configurable:!0}}},216:function(e){e.exports=function(e,t){for(var r={},n=0;n<e.length;++n)for(var i=e[n].name.split("."),a=r,o=0;o<i.length;++o){var s=i[o].split("[");if(s.length>1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l<s.length;++l){var c=parseInt(s[l]);l<s.length-1||o<i.length-1?(c in a||(l<s.length-1?a[c]=[]:a[c]={}),a=a[c]):a[c]=t?n:e[n].type}}else o<i.length-1?(s[0]in a||(a[s[0]]={}),a=a[s[0]]):a[s[0]]=t?n:e[n].type}return r}},2145:function(e,t){t.uniforms=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS),n=[],a=0;a<r;++a){var o=e.getActiveUniform(t,a);if(o){var s=i(e,o.type);if(o.size>1)for(var l=0;l<o.size;++l)n.push({name:o.name.replace("[0]","["+l+"]"),type:s});else n.push({name:o.name,type:s})}}return n},t.attributes=function(e,t){for(var r=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),n=[],a=0;a<r;++a){var o=e.getActiveAttrib(t,a);o&&n.push({name:o.name,type:i(e,o.type)})}return n};var r={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},n=null;function i(e,t){if(!n){var i=Object.keys(r);n={};for(var a=0;a<i.length;++a){var o=i[a];n[e[o]]=r[o]}}return n[t]}},5091:function(e,t,r){t.shader=function(e,t,r){return u(e).getShaderReference(t,r)},t.program=function(e,t,r,n,i){return u(e).getProgram(t,r,n,i)};var n=r(8866),i=r(2992),a=new("undefined"===typeof WeakMap?r(606):WeakMap),o=0;function s(e,t,r,n,i,a,o){this.id=e,this.src=t,this.type=r,this.shader=n,this.count=a,this.programs=[],this.cache=o}function l(e){this.gl=e,this.shaders=[{},{}],this.programs={}}s.prototype.dispose=function(){if(0===--this.count){for(var e=this.cache,t=e.gl,r=this.programs,n=0,i=r.length;n<i;++n){var a=e.programs[r[n]];a&&(delete e.programs[n],t.deleteProgram(a))}t.deleteShader(this.shader),delete e.shaders[this.type===t.FRAGMENT_SHADER|0][this.src]}};var c=l.prototype;function u(e){var t=a.get(e);return t||(t=new l(e),a.set(e,t)),t}c.getShaderReference=function(e,t){var r=this.gl,a=this.shaders[e===r.FRAGMENT_SHADER|0],l=a[t];if(l&&r.isShader(l.shader))l.count+=1;else{var c=function(e,t,r){var a=e.createShader(t);if(e.shaderSource(a,r),e.compileShader(a),!e.getShaderParameter(a,e.COMPILE_STATUS)){var o=e.getShaderInfoLog(a);try{var s=i(o,r,t)}catch(l){throw console.warn("Failed to format compiler error: "+l),new n(o,"Error compiling shader:\n"+o)}throw new n(o,s.short,s.long)}return a}(r,e,t);l=a[t]=new s(o++,t,e,c,[],1,this)}return l},c.getProgram=function(e,t,r,i){var a=[e.id,t.id,r.join(":"),i.join(":")].join("@"),o=this.programs[a];return o&&this.gl.isProgram(o)||(this.programs[a]=o=function(e,t,r,i,a){var o=e.createProgram();e.attachShader(o,t),e.attachShader(o,r);for(var s=0;s<i.length;++s)e.bindAttribLocation(o,a[s],i[s]);if(e.linkProgram(o),!e.getProgramParameter(o,e.LINK_STATUS)){var l=e.getProgramInfoLog(o);throw new n(l,"Error linking program: "+l)}return o}(this.gl,e.shader,t.shader,r,i),e.programs.push(a),t.programs.push(a)),o}},1493:function(e,t,r){var n=r(3236),i=r(9405),a=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * (view * (model * vec4(vertexPosition, 1.0)));\n vec2 clipOffset = (projection * (view * (model * vec4(color, 0.0)))).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}"]);e.exports=function(e){return i(e,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},4449:function(e,t,r){var n=r(2762),i=r(8116),a=r(1493);e.exports=function(e,t){var r=[];function o(e,t,n,i,a,o){var s=[e,t,n,0,0,0,1];s[i+3]=1,s[i]=a,r.push.apply(r,s),s[6]=-1,r.push.apply(r,s),s[i]=o,r.push.apply(r,s),r.push.apply(r,s),s[6]=1,r.push.apply(r,s),s[i]=a,r.push.apply(r,s)}o(0,0,0,0,0,1),o(0,0,0,1,0,1),o(0,0,0,2,0,1),o(1,0,0,1,-1,1),o(1,0,0,2,-1,1),o(0,1,0,0,-1,1),o(0,1,0,2,-1,1),o(0,0,1,0,-1,1),o(0,0,1,1,-1,1);var l=n(e,r),c=i(e,[{type:e.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:e.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:e.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=a(e);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new s(e,l,c,u);return h.update(t),h};var o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(e,t,r,n){this.gl=e,this.buffer=t,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var l=s.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(e){},l.draw=function(e){var t=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=e.model||o,s=e.view||o,l=e.projection||o;this.axes&&(i=this.axes.lastCubeProps.axis);for(var p=c,d=u,f=0;f<3;++f)i&&i[f]<0?(p[f]=this.bounds[0][f],d[f]=this.bounds[1][f]):(p[f]=this.bounds[1][f],d[f]=this.bounds[0][f]);for(h[0]=t.drawingBufferWidth,h[1]=t.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=s,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,p,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h,f=0;f<3;++f)n.uniforms.lineWidth=this.lineWidth[f]*this.pixelRatio,this.enabled[f]&&(r.draw(t.TRIANGLES,6,6*f),this.drawSides[f]&&r.draw(t.TRIANGLES,12,18+12*f));r.unbind()},l.update=function(e){e&&("bounds"in e&&(this.bounds=e.bounds),"position"in e&&(this.position=e.position),"lineWidth"in e&&(this.lineWidth=e.lineWidth),"colors"in e&&(this.colors=e.colors),"enabled"in e&&(this.enabled=e.enabled),"drawSides"in e&&(this.drawSides=e.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},6740:function(e,t,r){var n=r(3236),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * (view * tubePosition);\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);t.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},t.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},7815:function(e,t,r){var n=r(2931),i=r(9970),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(e,t,r,a){for(var o=0,s=0;s<e.length;s++)for(var l=e[s].velocities,c=0;c<l.length;c++)o=Math.max(o,n.length(l[c]));var u=e.map((function(e){return function(e,t,r,a){for(var o=e.points,s=e.velocities,l=e.divergences,c=[],u=[],h=[],p=[],d=[],f=[],m=0,g=0,y=i.create(),v=i.create(),x=0;x<o.length;x++){var b=o[x],_=s[x],w=l[x];0===t&&(w=.05*r),g=n.length(_)/a,y=i.create(),n.copy(y,_),y[3]=w;for(var k=0;k<8;k++)d[k]=[b[0],b[1],b[2],k];if(p.length>0)for(k=0;k<8;k++){var T=(k+1)%8;c.push(p[k],d[k],d[T],d[T],p[T],p[k]),h.push(v,y,y,y,v,v),f.push(m,g,g,g,m,m);var S=c.length;u.push([S-6,S-5,S-4],[S-3,S-2,S-1])}var A=p;p=d,d=A;var M=v;v=y,y=M;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:h,vertexIntensity:f}}(e,r,a,o)})),h=[],p=[],d=[],f=[];for(s=0;s<u.length;s++){var m=u[s],g=h.length;for(h=h.concat(m.positions),d=d.concat(m.vectors),f=f.concat(m.vertexIntensity),c=0;c<m.cells.length;c++){var y=m.cells[c],v=[];p.push(v);for(var x=0;x<y.length;x++)v.push(y[x]+g)}}return{positions:h,cells:p,vectors:d,vertexIntensity:f,colormap:t}},s=function(e,t){var r,n=e.length;for(r=0;r<n;r++){var i=e[r];if(i===t)return r;if(i>t)return r-1}return r},l=function(e,t,r){return e<t?t:e>r?r:e},c=function(e){var t=1/0;e.sort((function(e,t){return e-t}));for(var r=e.length,n=1;n<r;n++){var i=Math.abs(e[n]-e[n-1]);i<t&&(t=i)}return t};e.exports=function(e,t){var r=e.startingPositions,i=e.maxLength||1e3,u=e.tubeSize||1,h=e.absoluteTubeSize,p=e.gridFill||"+x+y+z",d={};-1!==p.indexOf("-x")&&(d.reversedX=!0),-1!==p.indexOf("-y")&&(d.reversedY=!0),-1!==p.indexOf("-z")&&(d.reversedZ=!0),d.filled=a.indexOf(p.replace(/-/g,"").replace(/\+/g,""));var f=e.getVelocity||function(t){return function(e,t,r){var i=t.vectors,a=t.meshgrid,o=e[0],c=e[1],u=e[2],h=a[0].length,p=a[1].length,d=a[2].length,f=s(a[0],o),m=s(a[1],c),g=s(a[2],u),y=f+1,v=m+1,x=g+1;if(f=l(f,0,h-1),y=l(y,0,h-1),m=l(m,0,p-1),v=l(v,0,p-1),g=l(g,0,d-1),x=l(x,0,d-1),f<0||m<0||g<0||y>h-1||v>p-1||x>d-1)return n.create();var b,_,w,k,T,S,A=a[0][f],M=a[0][y],E=a[1][m],C=a[1][v],P=a[2][g],L=(o-A)/(M-A),I=(c-E)/(C-E),z=(u-P)/(a[2][x]-P);switch(isFinite(L)||(L=.5),isFinite(I)||(I=.5),isFinite(z)||(z=.5),r.reversedX&&(f=h-1-f,y=h-1-y),r.reversedY&&(m=p-1-m,v=p-1-v),r.reversedZ&&(g=d-1-g,x=d-1-x),r.filled){case 5:T=g,S=x,w=m*d,k=v*d,b=f*d*p,_=y*d*p;break;case 4:T=g,S=x,b=f*d,_=y*d,w=m*d*h,k=v*d*h;break;case 3:w=m,k=v,T=g*p,S=x*p,b=f*p*d,_=y*p*d;break;case 2:w=m,k=v,b=f*p,_=y*p,T=g*p*h,S=x*p*h;break;case 1:b=f,_=y,T=g*h,S=x*h,w=m*h*d,k=v*h*d;break;default:b=f,_=y,w=m*h,k=v*h,T=g*h*p,S=x*h*p}var O=i[b+w+T],R=i[b+w+S],D=i[b+k+T],j=i[b+k+S],F=i[_+w+T],B=i[_+w+S],N=i[_+k+T],U=i[_+k+S],V=n.create(),q=n.create(),H=n.create(),G=n.create();n.lerp(V,O,F,L),n.lerp(q,R,B,L),n.lerp(H,D,N,L),n.lerp(G,j,U,L);var W=n.create(),$=n.create();n.lerp(W,V,H,I),n.lerp($,q,G,I);var Z=n.create();return n.lerp(Z,W,$,z),Z}(t,e,d)},m=e.getDivergence||function(e,t){var r=n.create(),i=1e-4;n.add(r,e,[i,0,0]);var a=f(r);n.subtract(a,a,t),n.scale(a,a,1/i),n.add(r,e,[0,i,0]);var o=f(r);n.subtract(o,o,t),n.scale(o,o,1/i),n.add(r,e,[0,0,i]);var s=f(r);return n.subtract(s,s,t),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],y=t[0][0],v=t[0][1],x=t[0][2],b=t[1][0],_=t[1][1],w=t[1][2],k=function(e){var t=e[0],r=e[1],n=e[2];return!(t<y||t>b||r<v||r>_||n<x||n>w)},T=10*n.distance(t[0],t[1])/i,S=T*T,A=1,M=0,E=r.length;E>1&&(A=function(e){for(var t=[],r=[],n=[],i={},a={},o={},s=e.length,l=0;l<s;l++){var u=e[l],h=u[0],p=u[1],d=u[2];i[h]||(t.push(h),i[h]=!0),a[p]||(r.push(p),a[p]=!0),o[d]||(n.push(d),o[d]=!0)}var f=c(t),m=c(r),g=c(n),y=Math.min(f,m,g);return isFinite(y)?y:1}(r));for(var C=0;C<E;C++){var P=n.create();n.copy(P,r[C]);var L=[P],I=[],z=f(P),O=P;I.push(z);var R=[],D=m(P,z),j=n.length(D);isFinite(j)&&j>M&&(M=j),R.push(j),g.push({points:L,velocities:I,divergences:R});for(var F=0;F<100*i&&L.length<i&&k(P);){F++;var B=n.clone(z),N=n.squaredLength(B);if(0===N)break;N>S&&n.scale(B,B,T/Math.sqrt(N)),n.add(B,B,P),z=f(B),n.squaredDistance(O,B)-S>-1e-4*S&&(L.push(B),O=B,I.push(z),D=m(B,z),j=n.length(D),isFinite(j)&&j>M&&(M=j),R.push(j)),P=B}}var U=o(g,e.colormap,M,A);return h?U.tubeScale=h:(0===M&&(M=1),U.tubeScale=.5*u*A/M),U};var u=r(6740),h=r(6405).createMesh;e.exports.createTubeMesh=function(e,t){return h(e,t,{shaders:u,traceType:"streamtube"})}},990:function(e,t,r){var n=r(9405),i=r(3236),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(localCoordinate, 1.0);\n vec4 clipPosition = projection * (view * worldPosition);\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n mat4 objectOffsetTranslation = mat4(1.0) + mat4(vec4(0), vec4(0), vec4(0), vec4(objectOffset, 0));\n vec4 worldPosition = (model * objectOffsetTranslation) * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * (view * worldPosition);\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);t.createShader=function(e){var t=n(e,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createPickShader=function(e){var t=n(e,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t.attributes.normal.location=2,t},t.createContourShader=function(e){var t=n(e,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t},t.createPickContourShader=function(e){var t=n(e,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return t.attributes.uv.location=0,t.attributes.f.location=1,t}},9499:function(e,t,r){e.exports=function(e){var t=e.gl,r=v(t),n=b(t),s=x(t),l=_(t),c=i(t),u=a(t,[{buffer:c,size:4,stride:w,offset:0},{buffer:c,size:3,stride:w,offset:16},{buffer:c,size:3,stride:w,offset:28}]),h=i(t),p=a(t,[{buffer:h,size:4,stride:20,offset:0},{buffer:h,size:1,stride:20,offset:16}]),d=i(t),f=a(t,[{buffer:d,size:2,type:t.FLOAT}]),m=o(t,1,M,t.RGBA,t.UNSIGNED_BYTE);m.minFilter=t.LINEAR,m.magFilter=t.LINEAR;var g=new E(t,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,h,p,d,f,[0,0,0]),y={levels:[[],[],[]]};for(var k in e)y[k]=e[k];return y.colormap=y.colormap||"jet",g.update(y),g};var n=r(8828),i=r(2762),a=r(8116),o=r(7766),s=r(1888),l=r(6729),c=r(5298),u=r(9994),h=r(9618),p=r(3711),d=r(6760),f=r(7608),m=r(2478),g=r(6199),y=r(990),v=y.createShader,x=y.createContourShader,b=y.createPickShader,_=y.createPickContourShader,w=40,k=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],S=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function A(e,t,r,n,i){this.position=e,this.index=t,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var e=0;e<3;++e){var t=S[e],r=(e+2)%3;t[(e+1)%3+0]=1,t[r+3]=1,t[e+6]=1}}();var M=256;function E(e,t,r,n,i,a,o,l,c,u,p,d,f,m,g){this.gl=e,this.shape=t,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=p,this._contourVAO=d,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=f,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0]),h(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var C=E.prototype;C.genColormap=function(e,t){var r=!1,n=u([l({colormap:e,nshades:M,format:"rgba"}).map((function(e,n){var i=t?function(e,t){if(!t)return 1;if(!t.length)return 1;for(var r=0;r<t.length;++r){if(t.length<2)return 1;if(t[r][0]===e)return t[r][1];if(t[r][0]>e&&r>0){var n=(t[r][0]-e)/(t[r][0]-t[r-1][0]);return t[r][1]*(1-n)+n*t[r-1][1]}}return 1}(n/255,t):e[3];return i<1&&(r=!0),[e[0],e[1],e[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},C.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},C.isOpaque=function(){return!this.isTransparent()},C.pickSlots=1,C.setPickBase=function(e){this.pickId=e};var P=[0,0,0],L={showSurface:!1,showContour:!1,projections:[k.slice(),k.slice(),k.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function I(e,t){var r,n,i,a=t.axes&&t.axes.lastCubeProps.axis||P,o=t.showSurface,s=t.showContour;for(r=0;r<3;++r)for(o=o||t.surfaceProject[r],n=0;n<3;++n)s=s||t.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=t.axesBounds[+(a[r]>0)][r],d(l,e.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=e.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var z={model:k,view:k,projection:k,inverseModel:k.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},O=k.slice(),R=[1,0,0,0,1,0,0,0,1];function D(e,t){e=e||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=z;n.model=e.model||k,n.view=e.view||k,n.projection=e.projection||k,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=f(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=R,n.vertexColor=this.vertexColor;var s=O;for(d(s,n.view,n.model),d(s,n.projection,s),f(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=I(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var p=this._contourVAO;for(p.bind(),i=0;i<3;++i)for(h.uniforms.permutation=S[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o<this.contourLevels[i].length;++o)o===this.highlightLevel[i]?(h.uniforms.contourColor=this.highlightColor[i],h.uniforms.contourTint=this.highlightTint[i]):0!==o&&o-1!==this.highlightLevel[i]||(h.uniforms.contourColor=this.contourColor[i],h.uniforms.contourTint=this.contourTint[i]),this._contourCounts[i][o]&&(h.uniforms.height=this.contourLevels[i][o],p.draw(r.LINES,this._contourCounts[i][o],this._contourOffsets[i][o]));for(i=0;i<3;++i)for(h.uniforms.model=u.projections[i],h.uniforms.clipBounds=u.clipBounds[i],o=0;o<3;++o)if(this.contourProject[i][o]){h.uniforms.permutation=S[o],r.lineWidth(this.contourWidth[o]*this.pixelRatio);for(var m=0;m<this.contourLevels[o].length;++m)m===this.highlightLevel[o]?(h.uniforms.contourColor=this.highlightColor[o],h.uniforms.contourTint=this.highlightTint[o]):0!==m&&m-1!==this.highlightLevel[o]||(h.uniforms.contourColor=this.contourColor[o],h.uniforms.contourTint=this.contourTint[o]),this._contourCounts[o][m]&&(h.uniforms.height=this.contourLevels[o][m],p.draw(r.LINES,this._contourCounts[o][m],this._contourOffsets[o][m]))}for(p.unbind(),(p=this._dynamicVAO).bind(),i=0;i<3;++i)if(0!==this._dynamicCounts[i])for(h.uniforms.model=n.model,h.uniforms.clipBounds=n.clipBounds,h.uniforms.permutation=S[i],r.lineWidth(this.dynamicWidth[i]*this.pixelRatio),h.uniforms.contourColor=this.dynamicColor[i],h.uniforms.contourTint=this.dynamicTint[i],h.uniforms.height=this.dynamicLevel[i],p.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]),o=0;o<3;++o)this.contourProject[o][i]&&(h.uniforms.model=u.projections[o],h.uniforms.clipBounds=u.clipBounds[o],p.draw(r.LINES,this._dynamicCounts[i],this._dynamicOffsets[i]));p.unbind()}}C.draw=function(e){return D.call(this,e,!1)},C.drawTransparent=function(e){return D.call(this,e,!0)};var j={model:k,view:k,projection:k,inverseModel:k,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,objectOffset:[0,0,0],permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};function F(e,t){return Array.isArray(e)?[t(e[0]),t(e[1]),t(e[2])]:[t(e),t(e),t(e)]}function B(e){return Array.isArray(e)?3===e.length?[e[0],e[1],e[2],1]:[e[0],e[1],e[2],e[3]]:[0,0,0,1]}function N(e){if(Array.isArray(e)){if(Array.isArray(e))return[B(e[0]),B(e[1]),B(e[2])];var t=B(e);return[t.slice(),t.slice(),t.slice()]}}C.drawPick=function(e){e=e||{};var t=this.gl;t.disable(t.CULL_FACE);var r=j;r.model=e.model||k,r.view=e.view||k,r.projection=e.projection||k,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.objectOffset=this.objectOffset,r.permutation=R;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var o=I(r,this);if(o.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(t.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=o.projections[n],this._pickShader.uniforms.clipBounds=o.clipBounds[n],this._vao.draw(t.TRIANGLES,this._vertexCount));this._vao.unbind()}if(o.showContour){var s=this._contourPickShader;s.bind(),s.uniforms=r;var l=this._contourVAO;for(l.bind(),a=0;a<3;++a)for(t.lineWidth(this.contourWidth[a]*this.pixelRatio),s.uniforms.permutation=S[a],n=0;n<this.contourLevels[a].length;++n)this._contourCounts[a][n]&&(s.uniforms.height=this.contourLevels[a][n],l.draw(t.LINES,this._contourCounts[a][n],this._contourOffsets[a][n]));for(n=0;n<3;++n)for(s.uniforms.model=o.projections[n],s.uniforms.clipBounds=o.clipBounds[n],a=0;a<3;++a)if(this.contourProject[n][a]){s.uniforms.permutation=S[a],t.lineWidth(this.contourWidth[a]*this.pixelRatio);for(var c=0;c<this.contourLevels[a].length;++c)this._contourCounts[a][c]&&(s.uniforms.height=this.contourLevels[a][c],l.draw(t.LINES,this._contourCounts[a][c],this._contourOffsets[a][c]))}l.unbind()}},C.pick=function(e){if(!e)return null;if(e.id!==this.pickId)return null;var t=this._field[2].shape,r=this._pickResult,n=t[0]*(e.value[0]+(e.value[2]>>4)/16)/255,i=Math.floor(n),a=n-i,o=t[1]*(e.value[1]+(15&e.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,p=0;p<2;++p)for(var d=i+u,f=s+p,g=h*(p?l:1-l),y=0;y<3;++y)c[y]+=this._field[y].get(d,f)*g;for(var v=this._pickResult.level,x=0;x<3;++x)if(v[x]=m.le(this.contourLevels[x],c[x]),v[x]<0)this.contourLevels[x].length>0&&(v[x]=0);else if(v[x]<this.contourLevels[x].length-1){var b=this.contourLevels[x][v[x]],_=this.contourLevels[x][v[x]+1];Math.abs(b-c[x])>Math.abs(_-c[x])&&(v[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/t[0],r.uv[1]=o/t[1],y=0;y<3;++y)r.dataCoordinate[y]=this._field[y].get(r.index[0],r.index[1]);return r},C.padField=function(e,t){var r=t.shape.slice(),n=e.shape.slice();c.assign(e.lo(1,1).hi(r[0],r[1]),t),c.assign(e.lo(1).hi(r[0],1),t.hi(r[0],1)),c.assign(e.lo(1,n[1]-1).hi(r[0],1),t.lo(0,r[1]-1).hi(r[0],1)),c.assign(e.lo(0,1).hi(1,r[1]),t.hi(1)),c.assign(e.lo(n[0]-1,1).hi(1,r[1]),t.lo(r[0]-1)),e.set(0,0,t.get(0,0)),e.set(0,n[1]-1,t.get(0,r[1]-1)),e.set(n[0]-1,0,t.get(r[0]-1,0)),e.set(n[0]-1,n[1]-1,t.get(r[0]-1,r[1]-1))},C.update=function(e){e=e||{},this.objectOffset=e.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in e&&(this.contourWidth=F(e.contourWidth,Number)),"showContour"in e&&(this.showContour=F(e.showContour,Boolean)),"showSurface"in e&&(this.showSurface=!!e.showSurface),"contourTint"in e&&(this.contourTint=F(e.contourTint,Boolean)),"contourColor"in e&&(this.contourColor=N(e.contourColor)),"contourProject"in e&&(this.contourProject=F(e.contourProject,(function(e){return F(e,Boolean)}))),"surfaceProject"in e&&(this.surfaceProject=e.surfaceProject),"dynamicColor"in e&&(this.dynamicColor=N(e.dynamicColor)),"dynamicTint"in e&&(this.dynamicTint=F(e.dynamicTint,Number)),"dynamicWidth"in e&&(this.dynamicWidth=F(e.dynamicWidth,Number)),"opacity"in e&&(this.opacity=e.opacity),"opacityscale"in e&&(this.opacityscale=e.opacityscale),"colorBounds"in e&&(this.colorBounds=e.colorBounds),"vertexColor"in e&&(this.vertexColor=e.vertexColor?1:0),"colormap"in e&&this._colorMap.setPixels(this.genColormap(e.colormap,this.opacityscale));var t=e.field||e.coords&&e.coords[2]||null,r=!1;if(t||(t=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in e||"coords"in e){var i=(t.shape[0]+2)*(t.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=h(this._field[2].data,[t.shape[0]+2,t.shape[1]+2]),this.padField(this._field[2],t),this.shape=t.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2]);if(e.coords){var l=e.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(y=0;y<2;++y)if(c.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(e.ticks){var u=e.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var d=u[o];if((Array.isArray(d)||d.length)&&(d=h(d)),d.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var f=h(d.data,a);f.stride[o]=d.stride[0],f.stride[1^o]=0,this.padField(this._field[o],f)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=h(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var y=0;y<a[0];++y)this._field[0].set(y+1,0,y);for(this._field[0].set(a[0]+1,0,a[0]-1),this._field[1].set(0,0,0),y=0;y<a[1];++y)this._field[1].set(0,y+1,y);this._field[1].set(0,a[1]+1,a[1]-1)}var v=this._field,x=h(s.mallocFloat(3*v[2].size*2),[3,a[0]+2,a[1]+2,2]);for(o=0;o<3;++o)g(x.pick(o),v[o],"mirror");var b=h(s.mallocFloat(3*v[2].size),[a[0]+2,a[1]+2,3]);for(o=0;o<a[0]+2;++o)for(y=0;y<a[1]+2;++y){var _=x.get(0,o,y,0),w=x.get(0,o,y,1),k=x.get(1,o,y,0),S=x.get(1,o,y,1),A=x.get(2,o,y,0),M=x.get(2,o,y,1),E=k*M-S*A,C=A*w-M*_,P=_*S-w*k,L=Math.sqrt(E*E+C*C+P*P);L<1e-8?(L=Math.max(Math.abs(E),Math.abs(C),Math.abs(P)))<1e-8?(P=1,C=E=0,L=1):L=1/L:L=1/Math.sqrt(L),b.set(o,y,0,E*L),b.set(o,y,1,C*L),b.set(o,y,2,P*L)}s.free(x.data);var I=[1/0,1/0,1/0],z=[-1/0,-1/0,-1/0],O=1/0,R=-1/0,D=(a[0]-1)*(a[1]-1)*6,j=s.mallocFloat(n.nextPow2(10*D)),B=0,U=0;for(o=0;o<a[0]-1;++o)e:for(y=0;y<a[1]-1;++y){for(var V=0;V<2;++V)for(var q=0;q<2;++q)for(var H=0;H<3;++H){var G=this._field[H].get(1+o+V,1+y+q);if(isNaN(G)||!isFinite(G))continue e}for(H=0;H<6;++H){var W=o+T[H][0],$=y+T[H][1],Z=this._field[0].get(W+1,$+1),X=this._field[1].get(W+1,$+1);G=this._field[2].get(W+1,$+1),E=b.get(W+1,$+1,0),C=b.get(W+1,$+1,1),P=b.get(W+1,$+1,2),e.intensity&&(Y=e.intensity.get(W,$));var Y=e.intensity?e.intensity.get(W,$):G+this.objectOffset[2];j[B++]=W,j[B++]=$,j[B++]=Z,j[B++]=X,j[B++]=G,j[B++]=0,j[B++]=Y,j[B++]=E,j[B++]=C,j[B++]=P,I[0]=Math.min(I[0],Z+this.objectOffset[0]),I[1]=Math.min(I[1],X+this.objectOffset[1]),I[2]=Math.min(I[2],G+this.objectOffset[2]),O=Math.min(O,Y),z[0]=Math.max(z[0],Z+this.objectOffset[0]),z[1]=Math.max(z[1],X+this.objectOffset[1]),z[2]=Math.max(z[2],G+this.objectOffset[2]),R=Math.max(R,Y),U+=1}}for(e.intensityBounds&&(O=+e.intensityBounds[0],R=+e.intensityBounds[1]),o=6;o<B;o+=10)j[o]=(j[o]-O)/(R-O);this._vertexCount=U,this._coordinateBuffer.update(j.subarray(0,B)),s.freeFloat(j),s.free(b.data),this.bounds=[I,z],this.intensity=e.intensity||this._field[2],this.intensityBounds[0]===O&&this.intensityBounds[1]===R||(r=!0),this.intensityBounds=[O,R]}if("levels"in e){var K=e.levels;for(K=Array.isArray(K[0])?K.slice():[[],[],K],o=0;o<3;++o)K[o]=K[o].slice(),K[o].sort((function(e,t){return e-t}));for(o=0;o<3;++o)for(y=0;y<K[o].length;++y)K[o][y]-=this.objectOffset[o];e:for(o=0;o<3;++o){if(K[o].length!==this.contourLevels[o].length){r=!0;break}for(y=0;y<K[o].length;++y)if(K[o][y]!==this.contourLevels[o][y]){r=!0;break e}}this.contourLevels=K}if(r){v=this._field,a=this.shape;for(var J=[],Q=0;Q<3;++Q){var ee=this.contourLevels[Q],te=[],re=[],ne=[0,0,0];for(o=0;o<ee.length;++o){var ie=p(this._field[Q],ee[o]);te.push(J.length/5|0),U=0;e:for(y=0;y<ie.cells.length;++y){var ae=ie.cells[y];for(H=0;H<2;++H){var oe=ie.positions[ae[H]],se=oe[0],le=0|Math.floor(se),ce=se-le,ue=oe[1],he=0|Math.floor(ue),pe=ue-he,de=!1;t:for(var fe=0;fe<3;++fe){ne[fe]=0;var me=(Q+fe+1)%3;for(V=0;V<2;++V){var ge=V?ce:1-ce;for(W=0|Math.min(Math.max(le+V,0),a[0]),q=0;q<2;++q){var ye=q?pe:1-pe;if($=0|Math.min(Math.max(he+q,0),a[1]),G=fe<2?this._field[me].get(W,$):(this.intensity.get(W,$)-this.intensityBounds[0])/(this.intensityBounds[1]-this.intensityBounds[0]),!isFinite(G)||isNaN(G)){de=!0;break t}var ve=ge*ye;ne[fe]+=ve*G}}}if(de){if(H>0){for(var xe=0;xe<5;++xe)J.pop();U-=1}continue e}J.push(ne[0],ne[1],oe[0],oe[1],ne[2]),U+=1}}re.push(U)}this._contourOffsets[Q]=te,this._contourCounts[Q]=re}var be=s.mallocFloat(J.length);for(o=0;o<J.length;++o)be[o]=J[o];this._contourBuffer.update(be),s.freeFloat(be)}},C.dispose=function(){this._shader.dispose(),this._vao.dispose(),this._coordinateBuffer.dispose(),this._colorMap.dispose(),this._contourBuffer.dispose(),this._contourVAO.dispose(),this._contourShader.dispose(),this._contourPickShader.dispose(),this._dynamicBuffer.dispose(),this._dynamicVAO.dispose();for(var e=0;e<3;++e)s.freeFloat(this._field[e].data)},C.highlight=function(e){var t,r;if(!e)return this._dynamicCounts=[0,0,0],this.dyanamicLevel=[NaN,NaN,NaN],void(this.highlightLevel=[-1,-1,-1]);for(t=0;t<3;++t)this.enableHighlight[t]?this.highlightLevel[t]=e.level[t]:this.highlightLevel[t]=-1;for(r=this.snapToData?e.dataCoordinate:e.position,t=0;t<3;++t)r[t]-=this.objectOffset[t];if(this.enableDynamic[0]&&r[0]!==this.dynamicLevel[0]||this.enableDynamic[1]&&r[1]!==this.dynamicLevel[1]||this.enableDynamic[2]&&r[2]!==this.dynamicLevel[2]){for(var n=0,i=this.shape,a=s.mallocFloat(12*i[0]*i[1]),o=0;o<3;++o)if(this.enableDynamic[o]){this.dynamicLevel[o]=r[o];var l=(o+1)%3,c=(o+2)%3,u=this._field[o],h=this._field[l],d=this._field[c],f=p(u,r[o]),m=f.cells,g=f.positions;for(this._dynamicOffsets[o]=n,t=0;t<m.length;++t)for(var y=m[t],v=0;v<2;++v){var x=g[y[v]],b=+x[0],_=0|b,w=0|Math.min(_+1,i[0]),k=b-_,T=1-k,S=+x[1],A=0|S,M=0|Math.min(A+1,i[1]),E=S-A,C=1-E,P=T*C,L=T*E,I=k*C,z=k*E,O=P*h.get(_,A)+L*h.get(_,M)+I*h.get(w,A)+z*h.get(w,M),R=P*d.get(_,A)+L*d.get(_,M)+I*d.get(w,A)+z*d.get(w,M);if(isNaN(O)||isNaN(R)){v&&(n-=1);break}a[2*n+0]=O,a[2*n+1]=R,n+=1}this._dynamicCounts[o]=n-this._dynamicOffsets[o]}else this.dynamicLevel[o]=NaN,this._dynamicCounts[o]=0;this._dynamicBuffer.update(a.subarray(0,2*n)),s.freeFloat(a)}}},7766:function(e,t,r){var n=r(9618),i=r(5298),a=r(1888);e.exports=function(e){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(o||function(e){o=[e.LINEAR,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_NEAREST],s=[e.NEAREST,e.LINEAR,e.NEAREST_MIPMAP_NEAREST,e.NEAREST_MIPMAP_LINEAR,e.LINEAR_MIPMAP_NEAREST,e.LINEAR_MIPMAP_LINEAR],l=[e.REPEAT,e.CLAMP_TO_EDGE,e.MIRRORED_REPEAT]}(e),"number"===typeof arguments[1])return g(e,arguments[1],arguments[2],arguments[3]||e.RGBA,arguments[4]||e.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return g(e,0|arguments[1][0],0|arguments[1][1],arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if("object"===typeof arguments[1]){var t=arguments[1],r=c(t)?t:t.raw;if(r)return function(e,t,r,n,i,a){var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,i,i,a,t),new p(e,o,r,n,i,a)}(e,r,0|t.width,0|t.height,arguments[2]||e.RGBA,arguments[3]||e.UNSIGNED_BYTE);if(t.shape&&t.data&&t.stride)return function(e,t){var r=t.dtype,o=t.shape.slice(),s=e.getParameter(e.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=f(o,t.stride.slice()),c=0;"float32"===r?c=e.FLOAT:"float64"===r?(c=e.FLOAT,l=!1,r="float32"):"uint8"===r?c=e.UNSIGNED_BYTE:(c=e.UNSIGNED_BYTE,l=!1,r="uint8");var h,d,g=0;if(2===o.length)g=e.LUMINANCE,o=[o[0],o[1],1],t=n(t.data,o,[t.stride[0],t.stride[1],1],t.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])g=e.ALPHA;else if(2===o[2])g=e.LUMINANCE_ALPHA;else if(3===o[2])g=e.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}}c!==e.FLOAT||e.getExtension("OES_texture_float")||(c=e.UNSIGNED_BYTE,l=!1);var y=t.size;if(l)h=0===t.offset&&t.data.length===y?t.data:t.data.subarray(t.offset,t.offset+y);else{var v=[o[2],o[2]*o[0],1];d=a.malloc(y,r);var x=n(d,o,v,0);"float32"!==r&&"float64"!==r||c!==e.UNSIGNED_BYTE?i.assign(x,t):u(x,t),h=d.subarray(0,y)}var b=m(e);return e.texImage2D(e.TEXTURE_2D,0,g,o[0],o[1],0,g,c,h),l||a.free(d),new p(e,b,o[0],o[1],g,c)}(e,t)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var o=null,s=null,l=null;function c(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement||"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement||"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement||"undefined"!=typeof ImageData&&e instanceof ImageData}var u=function(e,t){i.muls(e,t,255)};function h(e,t,r){var n=e.gl,i=n.getParameter(n.MAX_TEXTURE_SIZE);if(t<0||t>i||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return e._shape=[t,r],e.bind(),n.texImage2D(n.TEXTURE_2D,0,e.format,t,r,0,e.format,e.type,null),e._mipLevels=[0],e}function p(e,t,r,n,i,a){this.gl=e,this.handle=t,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=e.NEAREST,this._minFilter=e.NEAREST,this._wrapS=e.CLAMP_TO_EDGE,this._wrapT=e.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(e){return o.wrapS=e}},{get:function(){return o._wrapT},set:function(e){return o.wrapT=e}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(e){return o.width=e}},{get:function(){return o._shape[1]},set:function(e){return o.height=e}}]),this._shapeVector=l}var d=p.prototype;function f(e,t){return 3===e.length?1===t[2]&&t[1]===e[0]*e[2]&&t[0]===e[2]:1===t[0]&&t[1]===e[0]}function m(e){var t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.NEAREST),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),t}function g(e,t,r,n,i){var a=e.getParameter(e.MAX_TEXTURE_SIZE);if(t<0||t>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===e.FLOAT&&!e.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=m(e);return e.texImage2D(e.TEXTURE_2D,0,n,t,r,0,n,i,null),new p(e,o,t,r,n,i)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e),this._minFilter=e}},magFilter:{get:function(){return this._magFilter},set:function(e){this.bind();var t=this.gl;if(this.type===t.FLOAT&&o.indexOf(e)>=0&&(t.getExtension("OES_texture_float_linear")||(e=t.NEAREST)),s.indexOf(e)<0)throw new Error("gl-texture2d: Unknown filter mode "+e);return t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e),this._magFilter=e}},mipSamples:{get:function(){return this._anisoSamples},set:function(e){var t=this._anisoSamples;if(this._anisoSamples=0|Math.max(e,1),t!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,e),this._wrapS=e}},wrapT:{get:function(){return this._wrapT},set:function(e){if(this.bind(),l.indexOf(e)<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,e),this._wrapT=e}},wrap:{get:function(){return this._wrapVector},set:function(e){if(Array.isArray(e)||(e=[e,e]),2!==e.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var t=0;t<2;++t)if(l.indexOf(e[t])<0)throw new Error("gl-texture2d: Unknown wrap mode "+e);this._wrapS=e[0],this._wrapT=e[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),e}},shape:{get:function(){return this._shapeVector},set:function(e){if(Array.isArray(e)){if(2!==e.length)throw new Error("gl-texture2d: Invalid texture shape")}else e=[0|e,0|e];return h(this,0|e[0],0|e[1]),[0|e[0],0|e[1]]}},width:{get:function(){return this._shape[0]},set:function(e){return h(this,e|=0,this._shape[1]),e}},height:{get:function(){return this._shape[1]},set:function(e){return e|=0,h(this,this._shape[0],e),e}}}),d.bind=function(e){var t=this.gl;return void 0!==e&&t.activeTexture(t.TEXTURE0+(0|e)),t.bindTexture(t.TEXTURE_2D,this.handle),void 0!==e?0|e:t.getParameter(t.ACTIVE_TEXTURE)-t.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var e=Math.min(this._shape[0],this._shape[1]),t=0;e>0;++t,e>>>=1)this._mipLevels.indexOf(t)<0&&this._mipLevels.push(t)},d.setPixels=function(e,t,r,o){var s=this.gl;this.bind(),Array.isArray(t)?(o=r,r=0|t[1],t=0|t[0]):(t=t||0,r=r||0),o=o||0;var l=c(e)?e:e.raw;if(l)this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,t,r,this.format,this.type,l);else{if(!(e.shape&&e.stride&&e.data))throw new Error("gl-texture2d: Unsupported data type");if(e.shape.length<2||t+e.shape[1]>this._shape[1]>>>o||r+e.shape[0]>this._shape[0]>>>o||t<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(e,t,r,o,s,l,c,h){var p=h.dtype,d=h.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var m=0,g=0,y=f(d,h.stride.slice());if("float32"===p?m=e.FLOAT:"float64"===p?(m=e.FLOAT,y=!1,p="float32"):"uint8"===p?m=e.UNSIGNED_BYTE:(m=e.UNSIGNED_BYTE,y=!1,p="uint8"),2===d.length)g=e.LUMINANCE,d=[d[0],d[1],1],h=n(h.data,d,[h.stride[0],h.stride[1],1],h.offset);else{if(3!==d.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===d[2])g=e.ALPHA;else if(2===d[2])g=e.LUMINANCE_ALPHA;else if(3===d[2])g=e.RGB;else{if(4!==d[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=e.RGBA}d[2]}if(g!==e.LUMINANCE&&g!==e.ALPHA||s!==e.LUMINANCE&&s!==e.ALPHA||(g=s),g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var v=h.size,x=c.indexOf(o)<0;if(x&&c.push(o),m===l&&y)0===h.offset&&h.data.length===v?x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,h.data):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,h.data):x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,h.data.subarray(h.offset,h.offset+v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,h.data.subarray(h.offset,h.offset+v));else{var b;b=l===e.FLOAT?a.mallocFloat32(v):a.mallocUint8(v);var _=n(b,d,[d[2],d[2]*d[0],1]);m===e.FLOAT&&l===e.UNSIGNED_BYTE?u(_,h):i.assign(_,h),x?e.texImage2D(e.TEXTURE_2D,o,s,d[0],d[1],0,s,l,b.subarray(0,v)):e.texSubImage2D(e.TEXTURE_2D,o,t,r,d[0],d[1],s,l,b.subarray(0,v)),l===e.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,t,r,o,this.format,this.type,this._mipLevels,e)}}},1433:function(e){e.exports=function(e,t,r){t?t.bind():e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,null);var n=0|e.getParameter(e.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i<r.length;++i){var a=r[i];if(a.buffer){var o=a.buffer,s=a.size||4,l=a.type||e.FLOAT,c=!!a.normalized,u=a.stride||0,h=a.offset||0;o.bind(),e.enableVertexAttribArray(i),e.vertexAttribPointer(i,s,l,c,u,h)}else{if("number"===typeof a)e.vertexAttrib1f(i,a);else if(1===a.length)e.vertexAttrib1f(i,a[0]);else if(2===a.length)e.vertexAttrib2f(i,a[0],a[1]);else if(3===a.length)e.vertexAttrib3f(i,a[0],a[1],a[2]);else{if(4!==a.length)throw new Error("gl-vao: Invalid vertex attribute");e.vertexAttrib4f(i,a[0],a[1],a[2],a[3])}e.disableVertexAttribArray(i)}}for(;i<n;++i)e.disableVertexAttribArray(i)}else for(e.bindBuffer(e.ARRAY_BUFFER,null),i=0;i<n;++i)e.disableVertexAttribArray(i)}},870:function(e,t,r){var n=r(1433);function i(e){this.gl=e,this._elements=null,this._attributes=null,this._elementsType=e.UNSIGNED_SHORT}i.prototype.bind=function(){n(this.gl,this._elements,this._attributes)},i.prototype.update=function(e,t,r){this._elements=t,this._attributes=e,this._elementsType=r||this.gl.UNSIGNED_SHORT},i.prototype.dispose=function(){},i.prototype.unbind=function(){},i.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._elements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},e.exports=function(e){return new i(e)}},7518:function(e,t,r){var n=r(1433);function i(e,t,r,n,i,a){this.location=e,this.dimension=t,this.a=r,this.b=n,this.c=i,this.d=a}function a(e,t,r){this.gl=e,this._ext=t,this.handle=r,this._attribs=[],this._useElements=!1,this._elementsType=e.UNSIGNED_SHORT}i.prototype.bind=function(e){switch(this.dimension){case 1:e.vertexAttrib1f(this.location,this.a);break;case 2:e.vertexAttrib2f(this.location,this.a,this.b);break;case 3:e.vertexAttrib3f(this.location,this.a,this.b,this.c);break;case 4:e.vertexAttrib4f(this.location,this.a,this.b,this.c,this.d)}},a.prototype.bind=function(){this._ext.bindVertexArrayOES(this.handle);for(var e=0;e<this._attribs.length;++e)this._attribs[e].bind(this.gl)},a.prototype.unbind=function(){this._ext.bindVertexArrayOES(null)},a.prototype.dispose=function(){this._ext.deleteVertexArrayOES(this.handle)},a.prototype.update=function(e,t,r){if(this.bind(),n(this.gl,t,e),this.unbind(),this._attribs.length=0,e)for(var a=0;a<e.length;++a){var o=e[a];"number"===typeof o?this._attribs.push(new i(a,1,o)):Array.isArray(o)&&this._attribs.push(new i(a,o.length,o[0],o[1],o[2],o[3]))}this._useElements=!!t,this._elementsType=r||this.gl.UNSIGNED_SHORT},a.prototype.draw=function(e,t,r){r=r||0;var n=this.gl;this._useElements?n.drawElements(e,t,this._elementsType,r):n.drawArrays(e,r,t)},e.exports=function(e,t){return new a(e,t,t.createVertexArrayOES())}},8116:function(e,t,r){var n=r(7518),i=r(870);function a(e){this.bindVertexArrayOES=e.bindVertexArray.bind(e),this.createVertexArrayOES=e.createVertexArray.bind(e),this.deleteVertexArrayOES=e.deleteVertexArray.bind(e)}e.exports=function(e,t,r,o){var s,l=e.createVertexArray?new a(e):e.getExtension("OES_vertex_array_object");return(s=l?n(e,l):i(e)).update(t,r,o),s}},5632:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}},8192:function(e,t,r){e.exports=function(e,t){var r=n(e[0],e[1],e[2]),o=n(t[0],t[1],t[2]);i(r,r),i(o,o);var s=a(r,o);return s>1?0:Math.acos(s)};var n=r(2825),i=r(3536),a=r(244)},9226:function(e){e.exports=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}},3126:function(e){e.exports=function(e){var t=new Float32Array(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},3990:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},1091:function(e){e.exports=function(){var e=new Float32Array(3);return e[0]=0,e[1]=0,e[2]=0,e}},5911:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}},5455:function(e,t,r){e.exports=r(7056)},7056:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}},4008:function(e,t,r){e.exports=r(6690)},6690:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}},244:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}},2613:function(e){e.exports=1e-6},9922:function(e,t,r){e.exports=function(e,t){var r=e[0],i=e[1],a=e[2],o=t[0],s=t[1],l=t[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=r(2613)},9265:function(e){e.exports=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}},2681:function(e){e.exports=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}},5137:function(e,t,r){e.exports=function(e,t,r,i,a,o){var s,l;for(t||(t=3),r||(r=0),l=i?Math.min(i*t+r,e.length):e.length,s=r;s<l;s+=t)n[0]=e[s],n[1]=e[s+1],n[2]=e[s+2],a(n,n,o),e[s]=n[0],e[s+1]=n[1],e[s+2]=n[2];return e};var n=r(1091)()},2825:function(e){e.exports=function(e,t,r){var n=new Float32Array(3);return n[0]=e,n[1]=t,n[2]=r,n}},2931:function(e,t,r){e.exports={EPSILON:r(2613),create:r(1091),clone:r(3126),angle:r(8192),fromValues:r(2825),copy:r(3990),set:r(1463),equals:r(9922),exactEquals:r(9265),add:r(5632),subtract:r(6843),sub:r(2229),multiply:r(5847),mul:r(4505),divide:r(6690),div:r(4008),min:r(8107),max:r(7417),floor:r(2681),ceil:r(9226),round:r(2447),scale:r(6621),scaleAndAdd:r(8489),distance:r(7056),dist:r(5455),squaredDistance:r(2953),sqrDist:r(6141),length:r(1387),len:r(868),squaredLength:r(3066),sqrLen:r(5486),negate:r(5093),inverse:r(811),normalize:r(3536),dot:r(244),cross:r(5911),lerp:r(6658),random:r(7636),transformMat4:r(5673),transformMat3:r(492),transformQuat:r(264),rotateX:r(6894),rotateY:r(109),rotateZ:r(8692),forEach:r(5137)}},811:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}},868:function(e,t,r){e.exports=r(1387)},1387:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}},6658:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}},7417:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}},8107:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}},4505:function(e,t,r){e.exports=r(5847)},5847:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}},5093:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}},3536:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a),e}},7636:function(e){e.exports=function(e,t){t=t||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}},6894:function(e){e.exports=function(e,t,r,n){var i=r[1],a=r[2],o=t[1]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=t[0],e[1]=i+o*c-s*l,e[2]=a+o*l+s*c,e}},109:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[2],o=t[0]-i,s=t[2]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+s*l+o*c,e[1]=t[1],e[2]=a+s*c-o*l,e}},8692:function(e){e.exports=function(e,t,r,n){var i=r[0],a=r[1],o=t[0]-i,s=t[1]-a,l=Math.sin(n),c=Math.cos(n);return e[0]=i+o*c-s*l,e[1]=a+o*l+s*c,e[2]=t[2],e}},2447:function(e){e.exports=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e}},6621:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}},8489:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}},1463:function(e){e.exports=function(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}},6141:function(e,t,r){e.exports=r(2953)},5486:function(e,t,r){e.exports=r(3066)},2953:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}},3066:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}},2229:function(e,t,r){e.exports=r(6843)},6843:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}},492:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}},5673:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}},264:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,d=-o*n-s*i-l*a;return e[0]=u*c+d*-o+h*-l-p*-s,e[1]=h*c+d*-s+p*-o-u*-l,e[2]=p*c+d*-l+u*-s-h*-o,e}},4361:function(e){e.exports=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}},2335:function(e){e.exports=function(e){var t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},2933:function(e){e.exports=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},7536:function(e){e.exports=function(){var e=new Float32Array(4);return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}},4691:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},1373:function(e){e.exports=function(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}},3750:function(e){e.exports=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}},3390:function(e){e.exports=function(e,t,r,n){var i=new Float32Array(4);return i[0]=e,i[1]=t,i[2]=r,i[3]=n,i}},9970:function(e,t,r){e.exports={create:r(7536),clone:r(2335),fromValues:r(3390),copy:r(2933),set:r(4578),add:r(4361),subtract:r(6860),multiply:r(3576),divide:r(1373),min:r(2334),max:r(160),scale:r(9288),scaleAndAdd:r(4844),distance:r(4691),squaredDistance:r(7960),length:r(6808),squaredLength:r(483),negate:r(1498),inverse:r(4494),normalize:r(5177),dot:r(3750),lerp:r(2573),random:r(9131),transformMat4:r(5352),transformQuat:r(4041)}},4494:function(e){e.exports=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}},6808:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}},2573:function(e){e.exports=function(e,t,r,n){var i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}},160:function(e){e.exports=function(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}},2334:function(e){e.exports=function(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}},3576:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}},1498:function(e){e.exports=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}},5177:function(e){e.exports=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o),e}},9131:function(e,t,r){var n=r(5177),i=r(9288);e.exports=function(e,t){return t=t||1,e[0]=Math.random(),e[1]=Math.random(),e[2]=Math.random(),e[3]=Math.random(),n(e,e),i(e,e,t),e}},9288:function(e){e.exports=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}},4844:function(e){e.exports=function(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e}},4578:function(e){e.exports=function(e,t,r,n,i){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e}},7960:function(e){e.exports=function(e,t){var r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2],a=t[3]-e[3];return r*r+n*n+i*i+a*a}},483:function(e){e.exports=function(e){var t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}},6860:function(e){e.exports=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}},5352:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}},4041:function(e){e.exports=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,p=c*a+o*i-s*n,d=-o*n-s*i-l*a;return e[0]=u*c+d*-o+h*-l-p*-s,e[1]=h*c+d*-s+p*-o-u*-l,e[2]=p*c+d*-l+u*-s-h*-o,e[3]=t[3],e}},1848:function(e,t,r){var n=r(4905),i=r(6468);e.exports=function(e){for(var t=Array.isArray(e)?e:n(e),r=0;r<t.length;r++){var a=t[r];if("preprocessor"===a.type){var o=a.data.match(/\#define\s+SHADER_NAME(_B64)?\s+(.+)$/);if(o&&o[2]){var s=o[1],l=o[2];return(s?i(l):l).trim()}}}}},5874:function(e,t,r){e.exports=function(e){var t,r,k,T=0,S=0,A=l,M=[],E=[],C=1,P=0,L=0,I=!1,z=!1,O="",R=a,D=n;"300 es"===(e=e||{}).version&&(R=s,D=o);var j={},F={};for(T=0;T<R.length;T++)j[R[T]]=!0;for(T=0;T<D.length;T++)F[D[T]]=!0;return function(e){return E=[],null!==e?function(e){var r;for(T=0,e.toString&&(e=e.toString()),O+=e.replace(/\r\n/g,"\n"),k=O.length;t=O[T],T<k;){switch(r=T,A){case u:T=H();break;case h:T=q();break;case p:T=V();break;case d:T=G();break;case f:T=Z();break;case _:T=$();break;case m:T=X();break;case c:T=Y();break;case x:T=U();break;case l:T=N()}r!==T&&("\n"===O[r]?(P=0,++C):++P)}return S+=T,O=O.slice(T),E}(e):(M.length&&B(M.join("")),A=b,B("(eof)"),E)};function B(e){e.length&&E.push({type:w[A],data:e,position:L,line:C,column:P})}function N(){return M=M.length?[]:M,"/"===r&&"*"===t?(L=S+T-1,A=u,r=t,T+1):"/"===r&&"/"===t?(L=S+T-1,A=h,r=t,T+1):"#"===t?(A=p,L=S+T,T):/\s/.test(t)?(A=x,L=S+T,T):(I=/\d/.test(t),z=/[^\w_]/.test(t),L=S+T,A=I?f:z?d:c,T)}function U(){return/[^\s]/g.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function V(){return"\r"!==t&&"\n"!==t||"\\"===r?(M.push(t),r=t,T+1):(B(M.join("")),A=l,T)}function q(){return V()}function H(){return"/"===t&&"*"===r?(M.push(t),B(M.join("")),A=l,T+1):(M.push(t),r=t,T+1)}function G(){if("."===r&&/\d/.test(t))return A=m,T;if("/"===r&&"*"===t)return A=u,T;if("/"===r&&"/"===t)return A=h,T;if("."===t&&M.length){for(;W(M););return A=m,T}if(";"===t||")"===t||"("===t){if(M.length)for(;W(M););return B(t),A=l,T+1}var e=2===M.length&&"="!==t;if(/[\w_\d\s]/.test(t)||e){for(;W(M););return A=l,T}return M.push(t),r=t,T+1}function W(e){for(var t,r,n=0;;){if(t=i.indexOf(e.slice(0,e.length+n).join("")),r=i[t],-1===t){if(n--+e.length>0)continue;r=e.slice(0,1).join("")}return B(r),L+=r.length,(M=M.slice(r.length)).length}}function $(){return/[^a-fA-F0-9]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function Z(){return"."===t||/[eE]/.test(t)?(M.push(t),A=m,r=t,T+1):"x"===t&&1===M.length&&"0"===M[0]?(A=_,M.push(t),r=t,T+1):/[^\d]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function X(){return"f"===t&&(M.push(t),r=t,T+=1),/[eE]/.test(t)?(M.push(t),r=t,T+1):("-"!==t&&"+"!==t||!/[eE]/.test(r))&&/[^\d]/.test(t)?(B(M.join("")),A=l,T):(M.push(t),r=t,T+1)}function Y(){if(/[^\d\w_]/.test(t)){var e=M.join("");return A=F[e]?v:j[e]?y:g,B(M.join("")),A=l,T}return M.push(t),r=t,T+1}};var n=r(620),i=r(7827),a=r(6852),o=r(7932),s=r(3508),l=999,c=9999,u=0,h=1,p=2,d=3,f=4,m=5,g=6,y=7,v=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},3508:function(e,t,r){var n=r(6852);n=n.slice().filter((function(e){return!/^(gl\_|texture)/.test(e)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},6852:function(e){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},7932:function(e,t,r){var n=r(620);e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},620:function(e){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},7827:function(e){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},4905:function(e,t,r){var n=r(5874);e.exports=function(e,t){var r=n(t),i=[];return i=(i=i.concat(r(e))).concat(r(null))}},3236:function(e){e.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}},7520:function(e,t,r){var n=r(9507);e.exports=n&&function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(r){e=!1}return e}()},3778:function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m}},8954:function(e,t,r){e.exports=function(e,t){var r=e.length;if(0===r)throw new Error("Must have at least d+1 points");var i=e[0].length;if(r<=i)throw new Error("Must input at least d+1 points");var o=e.slice(0,i+1),s=n.apply(void 0,o);if(0===s)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;s<0&&(l[0]=1,l[1]=0);var h=new a(l,new Array(i+1),!1),p=h.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var f=l.slice(),m=0;m<=i;++m)m===u&&(f[m]=-1);var g=f[0];f[0]=f[1],f[1]=g;var y=new a(f,new Array(i+1),!0);p[u]=y,d[u]=y}for(d[i+1]=h,u=0;u<=i;++u){f=p[u].vertices;var v=p[u].adjacent;for(m=0;m<=i;++m){var x=f[m];if(x<0)v[m]=h;else for(var b=0;b<=i;++b)p[b].vertices.indexOf(x)<0&&(v[m]=p[b])}}var _=new c(i,o,d),w=!!t;for(u=i+1;u<r;++u)_.insert(e[u],w);return _.boundary()};var n=r(3250),i=r(6803).Fw;function a(e,t,r){this.vertices=e,this.adjacent=t,this.boundary=r,this.lastVisited=-1}function o(e,t,r){this.vertices=e,this.cell=t,this.index=r}function s(e,t){return i(e.vertices,t.vertices)}a.prototype.flip=function(){var e=this.vertices[0];this.vertices[0]=this.vertices[1],this.vertices[1]=e;var t=this.adjacent[0];this.adjacent[0]=this.adjacent[1],this.adjacent[1]=t};var l=[];function c(e,t,r){this.dimension=e,this.vertices=t,this.simplices=r,this.interior=r.filter((function(e){return!e.boundary})),this.tuple=new Array(e+1);for(var i=0;i<=e;++i)this.tuple[i]=this.vertices[i];var a=l[e];a||(a=l[e]=function(e){var t=n[e+1];return t||(t=n),function(e){return function(){var t=this.tuple;return e.apply(this,t)}}(t)}(e)),this.orient=a}var u=c.prototype;u.handleBoundaryDegeneracy=function(e,t){var r=this.dimension,n=this.vertices.length-1,i=this.tuple,a=this.vertices,o=[e];for(e.lastVisited=-n;o.length>0;)for(var s=(e=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var p=u[h];i[h]=p<0?t:a[p]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}return null},u.walk=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=t?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];e:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];for(s.lastVisited=r,u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var p=a[u];a[u]=e;var d=this.orient();if(a[u]=p,d<0){s=h;continue e}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(e,t){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[t];t.lastVisited=r,t.vertices[t.vertices.indexOf(-1)]=r,t.boundary=!1,c.push(t);for(var p=[];h.length>0;){var d=(t=h.pop()).vertices,f=t.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var y=f[g];if(y.boundary&&!(y.lastVisited>=r)){var v=y.vertices;if(y.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)v[b]<0?(x=b,l[b]=e):l[b]=i[v[b]];if(this.orient()>0){v[x]=r,y.boundary=!1,c.push(y),h.push(y),y.lastVisited=r;continue}y.lastVisited=-r}var _=y.adjacent,w=d.slice(),k=f.slice(),T=new a(w,k,!0);u.push(T);var S=_.indexOf(t);if(!(S<0))for(_[S]=T,k[m]=y,w[g]=-1,k[g]=t,f[g]=T,T.flip(),b=0;b<=n;++b){var A=w[b];if(!(A<0||A===r)){for(var M=new Array(n-1),E=0,C=0;C<=n;++C){var P=w[C];P<0||C===b||(M[E++]=P)}p.push(new o(M,T,b))}}}}}for(p.sort(s),g=0;g+1<p.length;g+=2){var L=p[g],I=p[g+1],z=L.index,O=I.index;z<0||O<0||(L.cell.adjacent[L.index]=I.cell,I.cell.adjacent[I.index]=L.cell)}},u.insert=function(e,t){var r=this.vertices;r.push(e);var n=this.walk(e,t);if(n){for(var i=this.dimension,a=this.tuple,o=0;o<=i;++o){var s=n.vertices[o];a[o]=s<0?e:r[s]}var l=this.orient(a);l<0||(0!==l||(n=this.handleBoundaryDegeneracy(n,e)))&&this.addPeaks(e,n)}},u.boundary=function(){for(var e=this.dimension,t=[],r=this.simplices,n=r.length,i=0;i<n;++i){var a=r[i];if(a.boundary){for(var o=new Array(e),s=a.vertices,l=0,c=0,u=0;u<=e;++u)s[u]>=0?o[l++]=s[u]:c=1&u;if(c===(1&e)){var h=o[0];o[0]=o[1],o[1]=h}t.push(o)}}return t}},3352:function(e,t,r){var n=r(2478);function i(e,t,r,n,i){this.mid=e,this.left=t,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(t?t.count:0)+(r?r.count:0)+n.length}e.exports=function(e){return e&&0!==e.length?new y(g(e)):new y(null)};var a=i.prototype;function o(e,t){e.mid=t.mid,e.left=t.left,e.right=t.right,e.leftPoints=t.leftPoints,e.rightPoints=t.rightPoints,e.count=t.count}function s(e,t){var r=g(t);e.mid=r.mid,e.left=r.left,e.right=r.right,e.leftPoints=r.leftPoints,e.rightPoints=r.rightPoints,e.count=r.count}function l(e,t){var r=e.intervals([]);r.push(t),s(e,r)}function c(e,t){var r=e.intervals([]),n=r.indexOf(t);return n<0?0:(r.splice(n,1),s(e,r),1)}function u(e,t,r){for(var n=0;n<e.length&&e[n][0]<=t;++n){var i=r(e[n]);if(i)return i}}function h(e,t,r){for(var n=e.length-1;n>=0&&e[n][1]>=t;--n){var i=r(e[n]);if(i)return i}}function p(e,t){for(var r=0;r<e.length;++r){var n=t(e[r]);if(n)return n}}function d(e,t){return e-t}function f(e,t){var r=e[0]-t[0];return r||e[1]-t[1]}function m(e,t){var r=e[1]-t[1];return r||e[0]-t[0]}function g(e){if(0===e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e[r][0],e[r][1]);t.sort(d);var n=t[t.length>>1],a=[],o=[],s=[];for(r=0;r<e.length;++r){var l=e[r];l[1]<n?a.push(l):n<l[0]?o.push(l):s.push(l)}var c=s,u=s.slice();return c.sort(f),u.sort(m),new i(n,g(a),g(o),c,u)}function y(e){this.root=e}a.intervals=function(e){return e.push.apply(e,this.leftPoints),this.left&&this.left.intervals(e),this.right&&this.right.intervals(e),e},a.insert=function(e){var t=this.count-this.leftPoints.length;if(this.count+=1,e[1]<this.mid)this.left?4*(this.left.count+1)>3*(t+1)?l(this,e):this.left.insert(e):this.left=g([e]);else if(e[0]>this.mid)this.right?4*(this.right.count+1)>3*(t+1)?l(this,e):this.right.insert(e):this.right=g([e]);else{var r=n.ge(this.leftPoints,e,f),i=n.ge(this.rightPoints,e,m);this.leftPoints.splice(r,0,e),this.rightPoints.splice(i,0,e)}},a.remove=function(e){var t=this.count-this.leftPoints;if(e[1]<this.mid)return this.left?4*(this.right?this.right.count:0)>3*(t-1)?c(this,e):2===(s=this.left.remove(e))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(e[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(t-1)?c(this,e):2===(s=this.right.remove(e))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===e?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===e){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,e,f);a<this.leftPoints.length&&this.leftPoints[a][0]===e[0];++a)if(this.leftPoints[a]===e)for(this.count-=1,this.leftPoints.splice(a,1),s=n.ge(this.rightPoints,e,m);s<this.rightPoints.length&&this.rightPoints[s][1]===e[1];++s)if(this.rightPoints[s]===e)return this.rightPoints.splice(s,1),1;return 0},a.queryPoint=function(e,t){return e<this.mid?this.left&&(r=this.left.queryPoint(e,t))?r:u(this.leftPoints,e,t):e>this.mid?this.right&&(r=this.right.queryPoint(e,t))?r:h(this.rightPoints,e,t):p(this.leftPoints,t);var r},a.queryInterval=function(e,t,r){var n;return e<this.mid&&this.left&&(n=this.left.queryInterval(e,t,r))||t>this.mid&&this.right&&(n=this.right.queryInterval(e,t,r))?n:t<this.mid?u(this.leftPoints,t,r):e>this.mid?h(this.rightPoints,e,r):p(this.leftPoints,r)};var v=y.prototype;v.insert=function(e){this.root?this.root.insert(e):this.root=new i(e[0],null,null,[e],[e])},v.remove=function(e){if(this.root){var t=this.root.remove(e);return 2===t&&(this.root=null),0!==t}return!1},v.queryPoint=function(e,t){if(this.root)return this.root.queryPoint(e,t)},v.queryInterval=function(e,t,r){if(e<=t&&this.root)return this.root.queryInterval(e,t,r)},Object.defineProperty(v,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(v,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},9507:function(e){e.exports=!0},7163:function(e){function t(e){return!!e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"===typeof e.readFloatLE&&"function"===typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},5219:function(e){e.exports=function(e){for(var t,r=e.length,n=0;n<r;n++)if(((t=e.charCodeAt(n))<9||t>13)&&32!==t&&133!==t&&160!==t&&5760!==t&&6158!==t&&(t<8192||t>8205)&&8232!==t&&8233!==t&&8239!==t&&8287!==t&&8288!==t&&12288!==t&&65279!==t)return!1;return!0}},395:function(e){e.exports=function(e,t,r){return e*(1-r)+t*r}},2652:function(e,t,r){var n=r(4335),i=r(6864),a=r(1903),o=r(9921),s=r(7608),l=r(5665),c={length:r(1387),normalize:r(3536),dot:r(244),cross:r(5911)},u=i(),h=i(),p=[0,0,0,0],d=[[0,0,0],[0,0,0],[0,0,0]],f=[0,0,0];function m(e,t,r,n,i){e[0]=t[0]*n+r[0]*i,e[1]=t[1]*n+r[1]*i,e[2]=t[2]*n+r[2]*i}e.exports=function(e,t,r,i,g,y){if(t||(t=[0,0,0]),r||(r=[0,0,0]),i||(i=[0,0,0]),g||(g=[0,0,0,1]),y||(y=[0,0,0,1]),!n(u,e))return!1;if(a(h,u),h[3]=0,h[7]=0,h[11]=0,h[15]=1,Math.abs(o(h)<1e-8))return!1;var v,x,b=u[3],_=u[7],w=u[11],k=u[12],T=u[13],S=u[14],A=u[15];if(0!==b||0!==_||0!==w){if(p[0]=b,p[1]=_,p[2]=w,p[3]=A,!s(h,h))return!1;l(h,h),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o}(g,p,h)}else g[0]=g[1]=g[2]=0,g[3]=1;if(t[0]=k,t[1]=T,t[2]=S,x=u,(v=d)[0][0]=x[0],v[0][1]=x[1],v[0][2]=x[2],v[1][0]=x[4],v[1][1]=x[5],v[1][2]=x[6],v[2][0]=x[8],v[2][1]=x[9],v[2][2]=x[10],r[0]=c.length(d[0]),c.normalize(d[0],d[0]),i[0]=c.dot(d[0],d[1]),m(d[1],d[1],d[0],1,-i[0]),r[1]=c.length(d[1]),c.normalize(d[1],d[1]),i[0]/=r[1],i[1]=c.dot(d[0],d[2]),m(d[2],d[2],d[0],1,-i[1]),i[2]=c.dot(d[1],d[2]),m(d[2],d[2],d[1],1,-i[2]),r[2]=c.length(d[2]),c.normalize(d[2],d[2]),i[1]/=r[2],i[2]/=r[2],c.cross(f,d[1],d[2]),c.dot(d[0],f)<0)for(var M=0;M<3;M++)r[M]*=-1,d[M][0]*=-1,d[M][1]*=-1,d[M][2]*=-1;return y[0]=.5*Math.sqrt(Math.max(1+d[0][0]-d[1][1]-d[2][2],0)),y[1]=.5*Math.sqrt(Math.max(1-d[0][0]+d[1][1]-d[2][2],0)),y[2]=.5*Math.sqrt(Math.max(1-d[0][0]-d[1][1]+d[2][2],0)),y[3]=.5*Math.sqrt(Math.max(1+d[0][0]+d[1][1]+d[2][2],0)),d[2][1]>d[1][2]&&(y[0]=-y[0]),d[0][2]>d[2][0]&&(y[1]=-y[1]),d[1][0]>d[0][1]&&(y[2]=-y[2]),!0}},4335:function(e){e.exports=function(e,t){var r=t[15];if(0===r)return!1;for(var n=1/r,i=0;i<16;i++)e[i]=t[i]*n;return!0}},7442:function(e,t,r){var n=r(6658),i=r(7182),a=r(2652),o=r(9921),s=r(8648),l=h(),c=h(),u=h();function h(){return{translate:p(),scale:p(1),skew:p(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function p(e){return[e||0,e||0,e||0]}e.exports=function(e,t,r,h){if(0===o(t)||0===o(r))return!1;var p=a(t,l.translate,l.scale,l.skew,l.perspective,l.quaternion),d=a(r,c.translate,c.scale,c.skew,c.perspective,c.quaternion);return!(!p||!d)&&(n(u.translate,l.translate,c.translate,h),n(u.skew,l.skew,c.skew,h),n(u.scale,l.scale,c.scale,h),n(u.perspective,l.perspective,c.perspective,h),s(u.quaternion,l.quaternion,c.quaternion,h),i(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),!0)}},7182:function(e,t,r){var n={identity:r(7894),translate:r(7656),multiply:r(6760),create:r(6864),scale:r(2504),fromRotationTranslation:r(6743)},i=(n.create(),n.create());e.exports=function(e,t,r,a,o,s){return n.identity(e),n.fromRotationTranslation(e,s,t),e[3]=o[0],e[7]=o[1],e[11]=o[2],e[15]=o[3],n.identity(i),0!==a[2]&&(i[9]=a[2],n.multiply(e,e,i)),0!==a[1]&&(i[9]=0,i[8]=a[1],n.multiply(e,e,i)),0!==a[0]&&(i[8]=0,i[4]=a[0],n.multiply(e,e,i)),n.scale(e,e,r),e}},1811:function(e,t,r){var n=r(2478),i=r(7442),a=r(7608),o=r(5567),s=r(2408),l=r(7089),c=r(6582),u=r(7656),h=(r(2504),r(3536)),p=[0,0,0];function d(e){this._components=e.slice(),this._time=[0],this.prevMatrix=e.slice(),this.nextMatrix=e.slice(),this.computedMatrix=e.slice(),this.computedInverse=e.slice(),this.computedEye=[0,0,0],this.computedUp=[0,0,0],this.computedCenter=[0,0,0],this.computedRadius=[0],this._limits=[-1/0,1/0]}e.exports=function(e){return new d((e=e||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var f=d.prototype;f.recalcMatrix=function(e){var t=this._time,r=n.le(t,e),o=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===t.length-1)for(var l=16*r,c=0;c<16;++c)o[c]=s[l++];else{var u=t[r+1]-t[r],p=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)p[c]=s[l++];var f=this.nextMatrix;for(c=0;c<16;++c)f[c]=s[l++],d=d&&p[c]===f[c];if(u<1e-6||d)for(c=0;c<16;++c)o[c]=p[c];else i(o,p,f,(e-t[r])/u)}var m=this.computedUp;m[0]=o[1],m[1]=o[5],m[2]=o[9],h(m,m);var g=this.computedInverse;a(g,o);var y=this.computedEye,v=g[15];y[0]=g[12]/v,y[1]=g[13]/v,y[2]=g[14]/v;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=y[c]-o[2+4*c]*b}},f.idle=function(e){if(!(e<this.lastT())){for(var t=this._components,r=t.length-16,n=0;n<16;++n)t.push(t[r++]);this._time.push(e)}},f.flush=function(e){var t=n.gt(this._time,e)-2;t<0||(this._time.splice(0,t),this._components.splice(0,16*t))},f.lastT=function(){return this._time[this._time.length-1]},f.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||p,n=n||this.computedUp,this.setMatrix(e,c(this.computedMatrix,t,r,n));for(var i=0,a=0;a<3;++a)i+=Math.pow(r[a]-t[a],2);i=Math.log(Math.sqrt(i)),this.computedRadius[0]=i},f.rotate=function(e,t,r,n){this.recalcMatrix(e);var i=this.computedInverse;t&&s(i,i,t),r&&o(i,i,r),n&&l(i,i,n),this.setMatrix(e,a(this.computedMatrix,i))};var m=[0,0,0];f.pan=function(e,t,r,n){m[0]=-(t||0),m[1]=-(r||0),m[2]=-(n||0),this.recalcMatrix(e);var i=this.computedInverse;u(i,i,m),this.setMatrix(e,a(i,i))},f.translate=function(e,t,r,n){m[0]=t||0,m[1]=r||0,m[2]=n||0,this.recalcMatrix(e);var i=this.computedMatrix;u(i,i,m),this.setMatrix(e,i)},f.setMatrix=function(e,t){if(!(e<this.lastT())){this._time.push(e);for(var r=0;r<16;++r)this._components.push(t[r])}},f.setDistance=function(e,t){this.computedRadius[0]=t},f.setDistanceLimits=function(e,t){var r=this._limits;r[0]=e,r[1]=t},f.getDistanceLimits=function(e){var t=this._limits;return e?(e[0]=t[0],e[1]=t[1],e):t}},3090:function(e,t,r){e.exports=function(e){var t=e.length;if(t<3){for(var r=new Array(t),i=0;i<t;++i)r[i]=i;return 2===t&&e[0][0]===e[1][0]&&e[0][1]===e[1][1]?[0]:r}var a=new Array(t);for(i=0;i<t;++i)a[i]=i;a.sort((function(t,r){var n=e[t][0]-e[r][0];return n||e[t][1]-e[r][1]}));var o=[a[0],a[1]],s=[a[0],a[1]];for(i=2;i<t;++i){for(var l=a[i],c=e[l],u=o.length;u>1&&n(e[o[u-2]],e[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(e[s[u-2]],e[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,p=(i=0,o.length);i<p;++i)r[h++]=o[i];for(var d=s.length-2;d>0;--d)r[h++]=s[d];return r};var n=r(3250)[3]},351:function(e,t,r){e.exports=function(e,t){t||(t=e,e=window);var r=0,i=0,a=0,o={shift:!1,alt:!1,control:!1,meta:!1},s=!1;function l(e){var t=!1;return"altKey"in e&&(t=t||e.altKey!==o.alt,o.alt=!!e.altKey),"shiftKey"in e&&(t=t||e.shiftKey!==o.shift,o.shift=!!e.shiftKey),"ctrlKey"in e&&(t=t||e.ctrlKey!==o.control,o.control=!!e.ctrlKey),"metaKey"in e&&(t=t||e.metaKey!==o.meta,o.meta=!!e.metaKey),t}function c(e,s){var c=n.x(s),u=n.y(s);"buttons"in s&&(e=0|s.buttons),(e!==r||c!==i||u!==a||l(s))&&(r=0|e,i=c||0,a=u||0,t&&t(r,i,a,o))}function u(e){c(0,e)}function h(){(r||i||a||o.shift||o.alt||o.meta||o.control)&&(i=a=0,r=0,o.shift=o.alt=o.control=o.meta=!1,t&&t(0,0,0,o))}function p(e){l(e)&&t&&t(r,i,a,o)}function d(e){0===n.buttons(e)?c(0,e):c(r,e)}function f(e){c(r|n.buttons(e),e)}function m(e){c(r&~n.buttons(e),e)}function g(){s||(s=!0,e.addEventListener("mousemove",d),e.addEventListener("mousedown",f),e.addEventListener("mouseup",m),e.addEventListener("mouseleave",u),e.addEventListener("mouseenter",u),e.addEventListener("mouseout",u),e.addEventListener("mouseover",u),e.addEventListener("blur",h),e.addEventListener("keyup",p),e.addEventListener("keydown",p),e.addEventListener("keypress",p),e!==window&&(window.addEventListener("blur",h),window.addEventListener("keyup",p),window.addEventListener("keydown",p),window.addEventListener("keypress",p)))}g();var y={element:e};return Object.defineProperties(y,{enabled:{get:function(){return s},set:function(t){t?g():s&&(s=!1,e.removeEventListener("mousemove",d),e.removeEventListener("mousedown",f),e.removeEventListener("mouseup",m),e.removeEventListener("mouseleave",u),e.removeEventListener("mouseenter",u),e.removeEventListener("mouseout",u),e.removeEventListener("mouseover",u),e.removeEventListener("blur",h),e.removeEventListener("keyup",p),e.removeEventListener("keydown",p),e.removeEventListener("keypress",p),e!==window&&(window.removeEventListener("blur",h),window.removeEventListener("keyup",p),window.removeEventListener("keydown",p),window.removeEventListener("keypress",p)))},enumerable:!0},buttons:{get:function(){return r},enumerable:!0},x:{get:function(){return i},enumerable:!0},y:{get:function(){return a},enumerable:!0},mods:{get:function(){return o},enumerable:!0}}),y};var n=r(4687)},24:function(e){var t={left:0,top:0};e.exports=function(e,r,n){r=r||e.currentTarget||e.srcElement,Array.isArray(n)||(n=[0,0]);var i,a=e.clientX||0,o=e.clientY||0,s=(i=r)===window||i===document||i===document.body?t:i.getBoundingClientRect();return n[0]=a-s.left,n[1]=o-s.top,n}},4687:function(e,t){function r(e){return e.target||e.srcElement||window}t.buttons=function(e){if("object"===typeof e){if("buttons"in e)return e.buttons;if("which"in e){if(2===(t=e.which))return 4;if(3===t)return 2;if(t>0)return 1<<t-1}else if("button"in e){var t;if(1===(t=e.button))return 4;if(2===t)return 2;if(t>=0)return 1<<t}}return 0},t.element=r,t.x=function(e){if("object"===typeof e){if("offsetX"in e)return e.offsetX;var t=r(e).getBoundingClientRect();return e.clientX-t.left}return 0},t.y=function(e){if("object"===typeof e){if("offsetY"in e)return e.offsetY;var t=r(e).getBoundingClientRect();return e.clientY-t.top}return 0}},8512:function(e,t,r){var n=r(665);e.exports=function(e,t,r){"function"===typeof e&&(r=!!t,t=e,e=window);var i=n("ex",e),a=function(e){r&&e.preventDefault();var n=e.deltaX||0,a=e.deltaY||0,o=e.deltaZ||0,s=1;switch(e.deltaMode){case 1:s=i;break;case 2:s=window.innerHeight}if(a*=s,o*=s,(n*=s)||a||o)return t(n,a,o,e)};return e.addEventListener("wheel",a),a}},2640:function(e,t,r){var n=r(1888);e.exports=function(e){function t(e){throw new Error("ndarray-extract-contour: "+e)}"object"!==typeof e&&t("Must specify arguments");var r=e.order;Array.isArray(r)||t("Must specify order");var a=e.arrayArguments||1;a<1&&t("Must have at least one array argument");var o=e.scalarArguments||0;o<0&&t("Scalar arg count must be > 0"),"function"!==typeof e.vertex&&t("Must specify vertex creation function"),"function"!==typeof e.cell&&t("Must specify cell creation function"),"function"!==typeof e.phase&&t("Must specify phase function");for(var s=e.getters||[],l=new Array(a),c=0;c<a;++c)s.indexOf(c)>=0?l[c]=!0:l[c]=!1;return function(e,t,r,a,o,s){var l=[s,o].join(",");return(0,i[l])(e,t,r,n.mallocUint32,n.freeUint32)}(e.vertex,e.cell,e.phase,0,r,l)};var i={"false,0,1":function(e,t,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],p=a.data,d=0|a.offset,f=0|a.stride[0],m=0|a.stride[1],g=d,y=0|-f,v=0,x=0|-m,b=0,_=-f-m|0,w=0,k=0|f,T=m-f*u|0,S=0,A=0,M=0,E=2*u|0,C=n(E),P=n(E),L=0,I=0,z=-1,O=-1,R=0,D=0|-u,j=0|u,F=0,B=-u-1|0,N=u-1|0,U=0,V=0,q=0;for(S=0;S<u;++S)C[L++]=r(p[g],o,s,l),g+=k;if(g+=T,h>0){if(A=1,C[L++]=r(p[g],o,s,l),g+=k,u>0)for(S=1,c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++),L+=1,g+=k,S=2;S<u;++S)c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++,U!==R&&t(P[L+z],V,w,v,U,R,o,s,l)),L+=1,g+=k;for(g+=T,L=0,q=z,z=O,O=q,q=D,D=j,j=q,q=B,B=N,N=q,A=2;A<h;++A){if(C[L++]=r(p[g],o,s,l),g+=k,u>0)for(S=1,c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++,U!==F&&t(P[L+D],V,b,w,F,U,o,s,l)),L+=1,g+=k,S=2;S<u;++S)c=p[g],I=C[L]=r(c,o,s,l),R=C[L+z],F=C[L+D],U=C[L+B],I===R&&I===F&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,R,F,U,o,s,l),V=P[L]=M++,U!==F&&t(P[L+D],V,b,w,F,U,o,s,l),U!==R&&t(P[L+z],V,w,v,U,R,o,s,l)),L+=1,g+=k;1&A&&(L=0),q=z,z=O,O=q,q=D,D=j,j=q,q=B,B=N,N=q,g+=T}}i(P),i(C)}},"false,1,0":function(e,t,r,n,i){return function(a,o,s,l){var c,u=0|a.shape[0],h=0|a.shape[1],p=a.data,d=0|a.offset,f=0|a.stride[0],m=0|a.stride[1],g=d,y=0|-f,v=0,x=0|-m,b=0,_=-f-m|0,w=0,k=0|m,T=f-m*h|0,S=0,A=0,M=0,E=2*h|0,C=n(E),P=n(E),L=0,I=0,z=-1,O=-1,R=0,D=0|-h,j=0|h,F=0,B=-h-1|0,N=h-1|0,U=0,V=0,q=0;for(A=0;A<h;++A)C[L++]=r(p[g],o,s,l),g+=k;if(g+=T,u>0){if(S=1,C[L++]=r(p[g],o,s,l),g+=k,h>0)for(A=1,c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++),L+=1,g+=k,A=2;A<h;++A)c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++,U!==R&&t(P[L+z],V,b,w,R,U,o,s,l)),L+=1,g+=k;for(g+=T,L=0,q=D,D=j,j=q,q=z,z=O,O=q,q=B,B=N,N=q,S=2;S<u;++S){if(C[L++]=r(p[g],o,s,l),g+=k,h>0)for(A=1,c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++,U!==F&&t(P[L+D],V,w,v,U,F,o,s,l)),L+=1,g+=k,A=2;A<h;++A)c=p[g],I=C[L]=r(c,o,s,l),F=C[L+D],R=C[L+z],U=C[L+B],I===F&&I===R&&I===U||(v=p[g+y],b=p[g+x],w=p[g+_],e(S,A,c,v,b,w,I,F,R,U,o,s,l),V=P[L]=M++,U!==R&&t(P[L+z],V,b,w,R,U,o,s,l),U!==F&&t(P[L+D],V,w,v,U,F,o,s,l)),L+=1,g+=k;1&S&&(L=0),q=D,D=j,j=q,q=z,z=O,O=q,q=B,B=N,N=q,g+=T}}i(P),i(C)}}}},6199:function(e,t,r){var n=r(1338),i={zero:function(e,t,r,n){var i=e[0];n|=0;var a=0,o=r[0];for(a=0;a<i;++a)t[n]=0,n+=o},fdTemplate1:function(e,t,r,n,i,a,o){var s=e[0],l=r[0],c=-1*l,u=l;n|=0,o|=0;var h=0,p=l,d=a[0];for(h=0;h<s;++h)i[o]=.5*(t[n+c]-t[n+u]),n+=p,o+=d},fdTemplate2:function(e,t,r,n,i,a,o,s,l,c){var u=e[0],h=e[1],p=r[0],d=r[1],f=a[0],m=a[1],g=l[0],y=l[1],v=-1*p,x=p,b=-1*d,_=d;n|=0,o|=0,c|=0;var w=0,k=0,T=d,S=p-h*d,A=m,M=f-h*m,E=y,C=g-h*y;for(k=0;k<u;++k){for(w=0;w<h;++w)i[o]=.5*(t[n+v]-t[n+x]),s[c]=.5*(t[n+b]-t[n+_]),n+=T,o+=A,c+=E;n+=S,o+=M,c+=C}}},a={cdiff:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),p=t[h];return p||(t[h]=p=e([a,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},zero:function(e){var t={};return function(r){var n=r.dtype,i=r.order,a=[n,i.join()].join(),o=t[a];return o||(t[a]=o=e([n,i])),o(r.shape.slice(0),r.data,r.stride,0|r.offset)}},fdTemplate1:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}},fdTemplate2:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),p=t[h];return p||(t[h]=p=e([a,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}}};function o(e){return(0,a[e.funcName])(s.bind(void 0,e))}function s(e){return i[e.funcName]}function l(e){return o({funcName:e.funcName})}var c={},u={},h=l({funcName:"cdiff"}),p=l({funcName:"zero"});function d(e){return e in c?c[e]:c[e]=l({funcName:"fdTemplate"+e})}function f(e,t,r,n){return function(e,i){var a=i.shape.slice();return a[0]>2&&a[1]>2&&n(i.pick(-1,-1).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,0).lo(1,1).hi(a[0]-2,a[1]-2),e.pick(-1,-1,1).lo(1,1).hi(a[0]-2,a[1]-2)),a[1]>2&&(r(i.pick(0,-1).lo(1).hi(a[1]-2),e.pick(0,-1,1).lo(1).hi(a[1]-2)),t(e.pick(0,-1,0).lo(1).hi(a[1]-2))),a[1]>2&&(r(i.pick(a[0]-1,-1).lo(1).hi(a[1]-2),e.pick(a[0]-1,-1,1).lo(1).hi(a[1]-2)),t(e.pick(a[0]-1,-1,0).lo(1).hi(a[1]-2))),a[0]>2&&(r(i.pick(-1,0).lo(1).hi(a[0]-2),e.pick(-1,0,0).lo(1).hi(a[0]-2)),t(e.pick(-1,0,1).lo(1).hi(a[0]-2))),a[0]>2&&(r(i.pick(-1,a[1]-1).lo(1).hi(a[0]-2),e.pick(-1,a[1]-1,0).lo(1).hi(a[0]-2)),t(e.pick(-1,a[1]-1,1).lo(1).hi(a[0]-2))),e.set(0,0,0,0),e.set(0,0,1,0),e.set(a[0]-1,0,0,0),e.set(a[0]-1,0,1,0),e.set(0,a[1]-1,0,0),e.set(0,a[1]-1,1,0),e.set(a[0]-1,a[1]-1,0,0),e.set(a[0]-1,a[1]-1,1,0),e}}e.exports=function(e,t,r){return Array.isArray(r)||(r=n(t.dimension,"string"===typeof r?r:"clamp")),0===t.size?e:0===t.dimension?(e.set(0),e):function(e){var t=e.join();if(a=u[t])return a;for(var r=e.length,n=[h,p],i=1;i<=r;++i)n.push(d(i));var a=f.apply(void 0,n);return u[t]=a,a}(r)(e,t)}},4317:function(e){function t(e,t){var r=Math.floor(t),n=t-r,i=0<=r&&r<e.shape[0],a=0<=r+1&&r+1<e.shape[0];return(1-n)*(i?+e.get(r):0)+n*(a?+e.get(r+1):0)}function r(e,t,r){var n=Math.floor(t),i=t-n,a=0<=n&&n<e.shape[0],o=0<=n+1&&n+1<e.shape[0],s=Math.floor(r),l=r-s,c=0<=s&&s<e.shape[1],u=0<=s+1&&s+1<e.shape[1],h=a&&c?e.get(n,s):0,p=a&&u?e.get(n,s+1):0;return(1-l)*((1-i)*h+i*(o&&c?e.get(n+1,s):0))+l*((1-i)*p+i*(o&&u?e.get(n+1,s+1):0))}function n(e,t,r,n){var i=Math.floor(t),a=t-i,o=0<=i&&i<e.shape[0],s=0<=i+1&&i+1<e.shape[0],l=Math.floor(r),c=r-l,u=0<=l&&l<e.shape[1],h=0<=l+1&&l+1<e.shape[1],p=Math.floor(n),d=n-p,f=0<=p&&p<e.shape[2],m=0<=p+1&&p+1<e.shape[2],g=o&&u&&f?e.get(i,l,p):0,y=o&&h&&f?e.get(i,l+1,p):0,v=s&&u&&f?e.get(i+1,l,p):0,x=s&&h&&f?e.get(i+1,l+1,p):0,b=o&&u&&m?e.get(i,l,p+1):0,_=o&&h&&m?e.get(i,l+1,p+1):0;return(1-d)*((1-c)*((1-a)*g+a*v)+c*((1-a)*y+a*x))+d*((1-c)*((1-a)*b+a*(s&&u&&m?e.get(i+1,l,p+1):0))+c*((1-a)*_+a*(s&&h&&m?e.get(i+1,l+1,p+1):0)))}function i(e){var t,r,n=0|e.shape.length,i=new Array(n),a=new Array(n),o=new Array(n),s=new Array(n);for(t=0;t<n;++t)r=+arguments[t+1],i[t]=Math.floor(r),a[t]=r-i[t],o[t]=0<=i[t]&&i[t]<e.shape[t],s[t]=0<=i[t]+1&&i[t]+1<e.shape[t];var l,c,u,h=0;e:for(t=0;t<1<<n;++t){for(c=1,u=e.offset,l=0;l<n;++l)if(t&1<<l){if(!s[l])continue e;c*=a[l],u+=e.stride[l]*(i[l]+1)}else{if(!o[l])continue e;c*=1-a[l],u+=e.stride[l]*i[l]}h+=c*e.data[u]}return h}e.exports=function(e,a,o,s){switch(e.shape.length){case 0:return 0;case 1:return t(e,a);case 2:return r(e,a,o);case 3:return n(e,a,o,s);default:return i.apply(void 0,arguments)}},e.exports.d1=t,e.exports.d2=r,e.exports.d3=n},5298:function(e,t){var r={"float64,2,1,0":function(){return function(e,t,r,n,i){var a=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2];n|=0;var h=0,p=0,d=0,f=u,m=c-s*u,g=l-o*c;for(d=0;d<a;++d){for(p=0;p<o;++p){for(h=0;h<s;++h)t[n]/=i,n+=f;n+=m}n+=g}}},"uint8,2,0,1,float64,2,1,0":function(){return function(e,t,r,n,i,a,o,s){for(var l=e[0],c=e[1],u=e[2],h=r[0],p=r[1],d=r[2],f=a[0],m=a[1],g=a[2],y=n|=0,v=o|=0,x=0|e[0];x>0;){x<64?(l=x,x=0):(l=64,x-=64);for(var b=0|e[1];b>0;){b<64?(c=b,b=0):(c=64,b-=64),n=y+x*h+b*p,o=v+x*f+b*m;var _=0,w=0,k=0,T=d,S=h-u*d,A=p-l*h,M=g,E=f-u*g,C=m-l*f;for(k=0;k<c;++k){for(w=0;w<l;++w){for(_=0;_<u;++_)t[n]=i[o]*s,n+=T,o+=M;n+=S,o+=E}n+=A,o+=C}}}}},"float32,1,0,float32,1,0":function(){return function(e,t,r,n,i,a,o){var s=e[0],l=e[1],c=r[0],u=r[1],h=a[0],p=a[1];n|=0,o|=0;var d=0,f=0,m=u,g=c-l*u,y=p,v=h-l*p;for(f=0;f<s;++f){for(d=0;d<l;++d)t[n]=i[o],n+=m,o+=y;n+=g,o+=v}}},"float32,1,0,float32,0,1":function(){return function(e,t,r,n,i,a,o){for(var s=e[0],l=e[1],c=r[0],u=r[1],h=a[0],p=a[1],d=n|=0,f=o|=0,m=0|e[1];m>0;){m<64?(l=m,m=0):(l=64,m-=64);for(var g=0|e[0];g>0;){g<64?(s=g,g=0):(s=64,g-=64),n=d+m*u+g*c,o=f+m*p+g*h;var y=0,v=0,x=u,b=c-l*u,_=p,w=h-l*p;for(v=0;v<s;++v){for(y=0;y<l;++y)t[n]=i[o],n+=x,o+=_;n+=b,o+=w}}}}},"uint8,2,0,1,uint8,1,2,0":function(){return function(e,t,r,n,i,a,o){for(var s=e[0],l=e[1],c=e[2],u=r[0],h=r[1],p=r[2],d=a[0],f=a[1],m=a[2],g=n|=0,y=o|=0,v=0|e[2];v>0;){v<64?(c=v,v=0):(c=64,v-=64);for(var x=0|e[0];x>0;){x<64?(s=x,x=0):(s=64,x-=64);for(var b=0|e[1];b>0;){b<64?(l=b,b=0):(l=64,b-=64),n=g+v*p+x*u+b*h,o=y+v*m+x*d+b*f;var _=0,w=0,k=0,T=p,S=u-c*p,A=h-s*u,M=m,E=d-c*m,C=f-s*d;for(k=0;k<l;++k){for(w=0;w<s;++w){for(_=0;_<c;++_)t[n]=i[o],n+=T,o+=M;n+=S,o+=E}n+=A,o+=C}}}}}},"uint8,2,0,1,array,2,0,1":function(){return function(e,t,r,n,i,a,o){var s=e[0],l=e[1],c=e[2],u=r[0],h=r[1],p=r[2],d=a[0],f=a[1],m=a[2];n|=0,o|=0;var g=0,y=0,v=0,x=p,b=u-c*p,_=h-s*u,w=m,k=d-c*m,T=f-s*d;for(v=0;v<l;++v){for(y=0;y<s;++y){for(g=0;g<c;++g)t[n]=i[o],n+=x,o+=w;n+=b,o+=k}n+=_,o+=T}}}},n=function(e,t){var n=t.join(",");return(0,r[n])()},i={mul:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),p=t[h];return p||(t[h]=p=e([a,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},muls:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},mulseq:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},div:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=i.dtype,u=i.order,h=[a,o.join(),s,l.join(),c,u.join()].join(),p=t[h];return p||(t[h]=p=e([a,o,s,l,c,u])),p(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i.data,i.stride,0|i.offset)}},divs:function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=n.dtype,l=n.order,c=[a,o.join(),s,l.join()].join(),u=t[c];return u||(t[c]=u=e([a,o,s,l])),u(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset,i)}},divseq:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}},assign:function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=n.dtype,s=n.order,l=[i,a.join(),o,s.join()].join(),c=t[l];return c||(t[l]=c=e([i,a,o,s])),c(r.shape.slice(0),r.data,r.stride,0|r.offset,n.data,n.stride,0|n.offset)}}};function a(e){return t={funcName:e.funcName},(0,i[t.funcName])(n.bind(void 0,t));var t}var o={mul:"*",div:"/"};!function(){for(var e in o)t[e]=a({funcName:e}),t[e+"s"]=a({funcName:e+"s"}),t[e+"seq"]=a({funcName:e+"seq"})}(),t.assign=a({funcName:"assign"})},9994:function(e,t,r){var n=r(9618),i=r(8277);e.exports=function(e,t){for(var r=[],a=e,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(t||(t=n(new Float64Array(o),r)),i(t,e),t)}},8277:function(e){var t=function(){return function(e,t,r,n,i){var a=e[0],o=e[1],s=e[2],l=r[0],c=r[1],u=r[2],h=[0,0,0];n|=0;var p=0,d=0,f=0,m=u,g=c-s*u,y=l-o*c;for(f=0;f<a;++f){for(d=0;d<o;++d){for(p=0;p<s;++p){var v,x=i;for(v=0;v<h.length-1;++v)x=x[h[v]];t[n]=x[h[h.length-1]],n+=m,++h[2]}n+=g,h[2]-=s,++h[1]}n+=y,h[1]-=o,++h[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n){var i=r.dtype,a=r.order,o=[i,a.join()].join(),s=t[o];return s||(t[o]=s=e([i,a])),s(r.shape.slice(0),r.data,r.stride,0|r.offset,n)}}(t.bind(void 0,r));var r}({funcName:"convert"})},7640:function(e,t,r){var n=r(1888);function i(e){return"uint32"===e?[n.mallocUint32,n.freeUint32]:null}var a={"uint32,1,0":function(e,t){return function(r,n,i,a,o,s,l,c,u,h,p){var d,f,m,g,y,v,x,b,_=r*o+a,w=e(c);for(d=r+1;d<=n;++d){for(f=d,m=_+=o,y=0,v=_,g=0;g<c;++g)w[y++]=i[v],v+=u;e:for(;f-- >r;){y=0,v=m-o;t:for(g=0;g<c;++g){if((x=i[v])<(b=w[y]))break e;if(x>b)break t;v+=h,y+=p}for(y=m,v=m-o,g=0;g<c;++g)i[y]=i[v],y+=u,v+=u;m-=o}for(y=m,v=0,g=0;g<c;++g)i[y]=w[v++],y+=u}t(w)}}},o={"uint32,1,0":function(e,t,r){return function n(i,a,o,s,l,c,u,h,p,d,f){var m,g,y,v,x,b,_,w,k,T,S,A,M,E,C,P,L,I,z,O,R,D,j,F,B,N=(a-i+1)/6|0,U=i+N,V=a-N,q=i+a>>1,H=q-N,G=q+N,W=U,$=H,Z=q,X=G,Y=V,K=i+1,J=a-1,Q=!0,ee=0,te=0,re=0,ne=h,ie=t(ne),ae=t(ne);S=l*W,A=l*$,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=W,W=$,$=g;break e}if(re<0)break e;B+=d}S=l*X,A=l*Y,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=X,X=Y,Y=g;break e}if(re<0)break e;B+=d}S=l*W,A=l*Z,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=W,W=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Z,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=$,$=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*W,A=l*X,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=W,W=X,X=g;break e}if(re<0)break e;B+=d}S=l*Z,A=l*X,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=Z,Z=X,X=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Y,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=$,$=Y,Y=g;break e}if(re<0)break e;B+=d}S=l*$,A=l*Z,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=$,$=Z,Z=g;break e}if(re<0)break e;B+=d}S=l*X,A=l*Y,B=s;e:for(T=0;T<h;++T){if(w=A+B,(re=o[_=S+B]-o[w])>0){g=X,X=Y,Y=g;break e}if(re<0)break e;B+=d}for(S=l*W,A=l*$,M=l*Z,E=l*X,C=l*Y,P=l*U,L=l*q,I=l*V,F=0,B=s,T=0;T<h;++T)_=S+B,w=A+B,k=M+B,z=E+B,O=C+B,R=P+B,D=L+B,j=I+B,ie[F]=o[w],ae[F]=o[z],Q=Q&&ie[F]===ae[F],y=o[_],v=o[k],x=o[O],o[R]=y,o[D]=v,o[j]=x,++F,B+=p;for(S=l*H,A=l*i,B=s,T=0;T<h;++T)w=A+B,o[_=S+B]=o[w],B+=p;for(S=l*G,A=l*a,B=s,T=0;T<h;++T)w=A+B,o[_=S+B]=o[w],B+=p;if(Q)for(b=K;b<=J;++b){for(_=s+b*l,F=0,T=0;T<h&&0===(re=o[_]-ie[F]);++T)F+=f,_+=d;if(0!==re)if(re<0){if(b!==K)for(S=l*b,A=l*K,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;++K}else for(;;){for(_=s+J*l,F=0,T=0;T<h&&0===(re=o[_]-ie[F]);++T)F+=f,_+=d;if(!(re>0)){if(re<0){for(S=l*b,A=l*K,M=l*J,B=s,T=0;T<h;++T)w=A+B,k=M+B,m=o[_=S+B],o[_]=o[w],o[w]=o[k],o[k]=m,B+=p;++K,--J;break}for(S=l*b,A=l*J,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;--J;break}J--}}else for(b=K;b<=J;++b){for(_=s+b*l,F=0,T=0;T<h&&0===(ee=o[_]-ie[F]);++T)F+=f,_+=d;if(ee<0){if(b!==K)for(S=l*b,A=l*K,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;++K}else{for(_=s+b*l,F=0,T=0;T<h&&0===(te=o[_]-ae[F]);++T)F+=f,_+=d;if(te>0)for(;;){for(_=s+J*l,F=0,T=0;T<h&&0===(re=o[_]-ae[F]);++T)F+=f,_+=d;if(!(re>0)){for(_=s+J*l,F=0,T=0;T<h&&0===(re=o[_]-ie[F]);++T)F+=f,_+=d;if(re<0){for(S=l*b,A=l*K,M=l*J,B=s,T=0;T<h;++T)w=A+B,k=M+B,m=o[_=S+B],o[_]=o[w],o[w]=o[k],o[k]=m,B+=p;++K,--J}else{for(S=l*b,A=l*J,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;--J}break}if(--J<b)break}}}for(S=l*i,A=l*(K-1),F=0,B=s,T=0;T<h;++T)w=A+B,o[_=S+B]=o[w],o[w]=ie[F],++F,B+=p;for(S=l*a,A=l*(J+1),F=0,B=s,T=0;T<h;++T)w=A+B,o[_=S+B]=o[w],o[w]=ae[F],++F,B+=p;if(K-2-i<=32?e(i,K-2,o,s,l,c,u,h,p,d,f):n(i,K-2,o,s,l,c,u,h,p,d,f),a-(J+2)<=32?e(J+2,a,o,s,l,c,u,h,p,d,f):n(J+2,a,o,s,l,c,u,h,p,d,f),Q)return r(ie),void r(ae);if(K<U&&J>V){e:for(;;){for(_=s+K*l,F=0,B=s,T=0;T<h;++T){if(o[_]!==ie[F])break e;++F,_+=p}++K}e:for(;;){for(_=s+J*l,F=0,B=s,T=0;T<h;++T){if(o[_]!==ae[F])break e;++F,_+=p}--J}for(b=K;b<=J;++b){for(_=s+b*l,F=0,T=0;T<h&&0===(ee=o[_]-ie[F]);++T)F+=f,_+=d;if(0===ee){if(b!==K)for(S=l*b,A=l*K,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;++K}else{for(_=s+b*l,F=0,T=0;T<h&&0===(te=o[_]-ae[F]);++T)F+=f,_+=d;if(0===te)for(;;){for(_=s+J*l,F=0,T=0;T<h&&0===(re=o[_]-ae[F]);++T)F+=f,_+=d;if(0!==re){for(_=s+J*l,F=0,T=0;T<h&&0===(re=o[_]-ie[F]);++T)F+=f,_+=d;if(re<0){for(S=l*b,A=l*K,M=l*J,B=s,T=0;T<h;++T)w=A+B,k=M+B,m=o[_=S+B],o[_]=o[w],o[w]=o[k],o[k]=m,B+=p;++K,--J}else{for(S=l*b,A=l*J,B=s,T=0;T<h;++T)w=A+B,m=o[_=S+B],o[_]=o[w],o[w]=m,B+=p;--J}break}if(--J<b)break}}}}r(ie),r(ae),J-K<=32?e(K,J,o,s,l,c,u,h,p,d,f):n(K,J,o,s,l,c,u,h,p,d,f)}}},s={"uint32,1,0":function(e,t){return function(r){var n=r.data,i=0|r.offset,a=r.shape,o=r.stride,s=0|o[0],l=0|a[0],c=0|o[1],u=0|a[1],h=c,p=c;l<=32?e(0,l-1,n,i,s,c,l,u,h,p,1):t(0,l-1,n,i,s,c,l,u,h,p,1)}}};e.exports=function(e,t){var r=[t,e].join(","),n=s[r],l=function(e,t){var r=i(t),n=[t,e].join(","),o=a[n];return r?o(r[0],r[1]):o()}(e,t),c=function(e,t,r){var n=i(t),a=[t,e].join(","),s=o[a];return e.length>1&&n?s(r,n[0],n[1]):s(r)}(e,t,l);return n(l,c)}},446:function(e,t,r){var n=r(7640),i={};e.exports=function(e){var t=e.order,r=e.dtype,a=[t,r].join(":"),o=i[a];return o||(i[a]=o=n(t,r)),o(e),e}},9618:function(e,t,r){var n=r(7163),i="undefined"!==typeof Float64Array;function a(e,t){return e[0]-t[0]}function o(){var e,t=this.stride,r=new Array(t.length);for(e=0;e<r.length;++e)r[e]=[Math.abs(t[e]),e];r.sort(a);var n=new Array(r.length);for(e=0;e<n.length;++e)n[e]=r[e][1];return n}var s={T:function(e){function t(e){this.data=e}var r=t.prototype;return r.dtype=e,r.index=function(){return-1},r.size=0,r.dimension=-1,r.shape=r.stride=r.order=[],r.lo=r.hi=r.transpose=r.step=function(){return new t(this.data)},r.get=r.set=function(){},r.pick=function(){return null},function(e){return new t(e)}},0:function(e,t){function r(e,t){this.data=e,this.offset=t}var n=r.prototype;return n.dtype=e,n.index=function(){return this.offset},n.dimension=0,n.size=1,n.shape=n.stride=n.order=[],n.lo=n.hi=n.transpose=n.step=function(){return new r(this.data,this.offset)},n.pick=function(){return t(this.data)},n.valueOf=n.get=function(){return"generic"===e?this.data.get(this.offset):this.data[this.offset]},n.set=function(t){return"generic"===e?this.data.set(this.offset,t):this.data[this.offset]=t},function(e,t,n,i){return new r(e,i)}},1:function(e,t,r){function n(e,t,r,n){this.data=e,this.shape=[t],this.stride=[r],this.offset=0|n}var i=n.prototype;return i.dtype=e,i.dimension=1,Object.defineProperty(i,"size",{get:function(){return this.shape[0]}}),i.order=[0],i.set=function(t,r){return"generic"===e?this.data.set(this.offset+this.stride[0]*t,r):this.data[this.offset+this.stride[0]*t]=r},i.get=function(t){return"generic"===e?this.data.get(this.offset+this.stride[0]*t):this.data[this.offset+this.stride[0]*t]},i.index=function(e){return this.offset+this.stride[0]*e},i.hi=function(e){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,this.stride[0],this.offset)},i.lo=function(e){var t=this.offset,r=0,i=this.shape[0],a=this.stride[0];return"number"===typeof e&&e>=0&&(t+=a*(r=0|e),i-=r),new n(this.data,i,a,t)},i.step=function(e){var t=this.shape[0],r=this.stride[0],i=this.offset,a=0,o=Math.ceil;return"number"===typeof e&&((a=0|e)<0?(i+=r*(t-1),t=o(-t/a)):t=o(t/a),r*=a),new n(this.data,t,r,i)},i.transpose=function(e){e=void 0===e?0:0|e;var t=this.shape,r=this.stride;return new n(this.data,t[e],r[e],this.offset)},i.pick=function(e){var r=[],n=[],i=this.offset;return"number"===typeof e&&e>=0?i=i+this.stride[0]*e|0:(r.push(this.shape[0]),n.push(this.stride[0])),(0,t[r.length+1])(this.data,r,n,i)},function(e,t,r,i){return new n(e,t[0],r[0],i)}},2:function(e,t,r){function n(e,t,r,n,i,a){this.data=e,this.shape=[t,r],this.stride=[n,i],this.offset=0|a}var i=n.prototype;return i.dtype=e,i.dimension=2,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]}}),Object.defineProperty(i,"order",{get:function(){return Math.abs(this.stride[0])>Math.abs(this.stride[1])?[1,0]:[0,1]}}),i.set=function(t,r,n){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r,n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]=n},i.get=function(t,r){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r):this.data[this.offset+this.stride[0]*t+this.stride[1]*r]},i.index=function(e,t){return this.offset+this.stride[0]*e+this.stride[1]*t},i.hi=function(e,t){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,this.stride[0],this.stride[1],this.offset)},i.lo=function(e,t){var r=this.offset,i=0,a=this.shape[0],o=this.shape[1],s=this.stride[0],l=this.stride[1];return"number"===typeof e&&e>=0&&(r+=s*(i=0|e),a-=i),"number"===typeof t&&t>=0&&(r+=l*(i=0|t),o-=i),new n(this.data,a,o,s,l,r)},i.step=function(e,t){var r=this.shape[0],i=this.shape[1],a=this.stride[0],o=this.stride[1],s=this.offset,l=0,c=Math.ceil;return"number"===typeof e&&((l=0|e)<0?(s+=a*(r-1),r=c(-r/l)):r=c(r/l),a*=l),"number"===typeof t&&((l=0|t)<0?(s+=o*(i-1),i=c(-i/l)):i=c(i/l),o*=l),new n(this.data,r,i,a,o,s)},i.transpose=function(e,t){e=void 0===e?0:0|e,t=void 0===t?1:0|t;var r=this.shape,i=this.stride;return new n(this.data,r[e],r[t],i[e],i[t],this.offset)},i.pick=function(e,r){var n=[],i=[],a=this.offset;return"number"===typeof e&&e>=0?a=a+this.stride[0]*e|0:(n.push(this.shape[0]),i.push(this.stride[0])),"number"===typeof r&&r>=0?a=a+this.stride[1]*r|0:(n.push(this.shape[1]),i.push(this.stride[1])),(0,t[n.length+1])(this.data,n,i,a)},function(e,t,r,i){return new n(e,t[0],t[1],r[0],r[1],i)}},3:function(e,t,r){function n(e,t,r,n,i,a,o,s){this.data=e,this.shape=[t,r,n],this.stride=[i,a,o],this.offset=0|s}var i=n.prototype;return i.dtype=e,i.dimension=3,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]}}),Object.defineProperty(i,"order",{get:function(){var e=Math.abs(this.stride[0]),t=Math.abs(this.stride[1]),r=Math.abs(this.stride[2]);return e>t?t>r?[2,1,0]:e>r?[1,2,0]:[1,0,2]:e>r?[2,0,1]:r>t?[0,1,2]:[0,2,1]}}),i.set=function(t,r,n,i){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n,i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]=i},i.get=function(t,r,n){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n]},i.index=function(e,t,r){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r},i.hi=function(e,t,r){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,this.stride[0],this.stride[1],this.stride[2],this.offset)},i.lo=function(e,t,r){var i=this.offset,a=0,o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.stride[0],u=this.stride[1],h=this.stride[2];return"number"===typeof e&&e>=0&&(i+=c*(a=0|e),o-=a),"number"===typeof t&&t>=0&&(i+=u*(a=0|t),s-=a),"number"===typeof r&&r>=0&&(i+=h*(a=0|r),l-=a),new n(this.data,o,s,l,c,u,h,i)},i.step=function(e,t,r){var i=this.shape[0],a=this.shape[1],o=this.shape[2],s=this.stride[0],l=this.stride[1],c=this.stride[2],u=this.offset,h=0,p=Math.ceil;return"number"===typeof e&&((h=0|e)<0?(u+=s*(i-1),i=p(-i/h)):i=p(i/h),s*=h),"number"===typeof t&&((h=0|t)<0?(u+=l*(a-1),a=p(-a/h)):a=p(a/h),l*=h),"number"===typeof r&&((h=0|r)<0?(u+=c*(o-1),o=p(-o/h)):o=p(o/h),c*=h),new n(this.data,i,a,o,s,l,c,u)},i.transpose=function(e,t,r){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r;var i=this.shape,a=this.stride;return new n(this.data,i[e],i[t],i[r],a[e],a[t],a[r],this.offset)},i.pick=function(e,r,n){var i=[],a=[],o=this.offset;return"number"===typeof e&&e>=0?o=o+this.stride[0]*e|0:(i.push(this.shape[0]),a.push(this.stride[0])),"number"===typeof r&&r>=0?o=o+this.stride[1]*r|0:(i.push(this.shape[1]),a.push(this.stride[1])),"number"===typeof n&&n>=0?o=o+this.stride[2]*n|0:(i.push(this.shape[2]),a.push(this.stride[2])),(0,t[i.length+1])(this.data,i,a,o)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],r[0],r[1],r[2],i)}},4:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c){this.data=e,this.shape=[t,r,n,i],this.stride=[a,o,s,l],this.offset=0|c}var i=n.prototype;return i.dtype=e,i.dimension=4,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i,a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]=a},i.get=function(t,r,n,i){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i]},i.index=function(e,t,r,n){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n},i.hi=function(e,t,r,i){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.offset)},i.lo=function(e,t,r,i){var a=this.offset,o=0,s=this.shape[0],l=this.shape[1],c=this.shape[2],u=this.shape[3],h=this.stride[0],p=this.stride[1],d=this.stride[2],f=this.stride[3];return"number"===typeof e&&e>=0&&(a+=h*(o=0|e),s-=o),"number"===typeof t&&t>=0&&(a+=p*(o=0|t),l-=o),"number"===typeof r&&r>=0&&(a+=d*(o=0|r),c-=o),"number"===typeof i&&i>=0&&(a+=f*(o=0|i),u-=o),new n(this.data,s,l,c,u,h,p,d,f,a)},i.step=function(e,t,r,i){var a=this.shape[0],o=this.shape[1],s=this.shape[2],l=this.shape[3],c=this.stride[0],u=this.stride[1],h=this.stride[2],p=this.stride[3],d=this.offset,f=0,m=Math.ceil;return"number"===typeof e&&((f=0|e)<0?(d+=c*(a-1),a=m(-a/f)):a=m(a/f),c*=f),"number"===typeof t&&((f=0|t)<0?(d+=u*(o-1),o=m(-o/f)):o=m(o/f),u*=f),"number"===typeof r&&((f=0|r)<0?(d+=h*(s-1),s=m(-s/f)):s=m(s/f),h*=f),"number"===typeof i&&((f=0|i)<0?(d+=p*(l-1),l=m(-l/f)):l=m(l/f),p*=f),new n(this.data,a,o,s,l,c,u,h,p,d)},i.transpose=function(e,t,r,i){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i;var a=this.shape,o=this.stride;return new n(this.data,a[e],a[t],a[r],a[i],o[e],o[t],o[r],o[i],this.offset)},i.pick=function(e,r,n,i){var a=[],o=[],s=this.offset;return"number"===typeof e&&e>=0?s=s+this.stride[0]*e|0:(a.push(this.shape[0]),o.push(this.stride[0])),"number"===typeof r&&r>=0?s=s+this.stride[1]*r|0:(a.push(this.shape[1]),o.push(this.stride[1])),"number"===typeof n&&n>=0?s=s+this.stride[2]*n|0:(a.push(this.shape[2]),o.push(this.stride[2])),"number"===typeof i&&i>=0?s=s+this.stride[3]*i|0:(a.push(this.shape[3]),o.push(this.stride[3])),(0,t[a.length+1])(this.data,a,o,s)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],r[0],r[1],r[2],r[3],i)}},5:function(e,t,r){function n(e,t,r,n,i,a,o,s,l,c,u,h){this.data=e,this.shape=[t,r,n,i,a],this.stride=[o,s,l,c,u],this.offset=0|h}var i=n.prototype;return i.dtype=e,i.dimension=5,Object.defineProperty(i,"size",{get:function(){return this.shape[0]*this.shape[1]*this.shape[2]*this.shape[3]*this.shape[4]}}),Object.defineProperty(i,"order",{get:r}),i.set=function(t,r,n,i,a,o){return"generic"===e?this.data.set(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a,o):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]=o},i.get=function(t,r,n,i,a){return"generic"===e?this.data.get(this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a):this.data[this.offset+this.stride[0]*t+this.stride[1]*r+this.stride[2]*n+this.stride[3]*i+this.stride[4]*a]},i.index=function(e,t,r,n,i){return this.offset+this.stride[0]*e+this.stride[1]*t+this.stride[2]*r+this.stride[3]*n+this.stride[4]*i},i.hi=function(e,t,r,i,a){return new n(this.data,"number"!==typeof e||e<0?this.shape[0]:0|e,"number"!==typeof t||t<0?this.shape[1]:0|t,"number"!==typeof r||r<0?this.shape[2]:0|r,"number"!==typeof i||i<0?this.shape[3]:0|i,"number"!==typeof a||a<0?this.shape[4]:0|a,this.stride[0],this.stride[1],this.stride[2],this.stride[3],this.stride[4],this.offset)},i.lo=function(e,t,r,i,a){var o=this.offset,s=0,l=this.shape[0],c=this.shape[1],u=this.shape[2],h=this.shape[3],p=this.shape[4],d=this.stride[0],f=this.stride[1],m=this.stride[2],g=this.stride[3],y=this.stride[4];return"number"===typeof e&&e>=0&&(o+=d*(s=0|e),l-=s),"number"===typeof t&&t>=0&&(o+=f*(s=0|t),c-=s),"number"===typeof r&&r>=0&&(o+=m*(s=0|r),u-=s),"number"===typeof i&&i>=0&&(o+=g*(s=0|i),h-=s),"number"===typeof a&&a>=0&&(o+=y*(s=0|a),p-=s),new n(this.data,l,c,u,h,p,d,f,m,g,y,o)},i.step=function(e,t,r,i,a){var o=this.shape[0],s=this.shape[1],l=this.shape[2],c=this.shape[3],u=this.shape[4],h=this.stride[0],p=this.stride[1],d=this.stride[2],f=this.stride[3],m=this.stride[4],g=this.offset,y=0,v=Math.ceil;return"number"===typeof e&&((y=0|e)<0?(g+=h*(o-1),o=v(-o/y)):o=v(o/y),h*=y),"number"===typeof t&&((y=0|t)<0?(g+=p*(s-1),s=v(-s/y)):s=v(s/y),p*=y),"number"===typeof r&&((y=0|r)<0?(g+=d*(l-1),l=v(-l/y)):l=v(l/y),d*=y),"number"===typeof i&&((y=0|i)<0?(g+=f*(c-1),c=v(-c/y)):c=v(c/y),f*=y),"number"===typeof a&&((y=0|a)<0?(g+=m*(u-1),u=v(-u/y)):u=v(u/y),m*=y),new n(this.data,o,s,l,c,u,h,p,d,f,m,g)},i.transpose=function(e,t,r,i,a){e=void 0===e?0:0|e,t=void 0===t?1:0|t,r=void 0===r?2:0|r,i=void 0===i?3:0|i,a=void 0===a?4:0|a;var o=this.shape,s=this.stride;return new n(this.data,o[e],o[t],o[r],o[i],o[a],s[e],s[t],s[r],s[i],s[a],this.offset)},i.pick=function(e,r,n,i,a){var o=[],s=[],l=this.offset;return"number"===typeof e&&e>=0?l=l+this.stride[0]*e|0:(o.push(this.shape[0]),s.push(this.stride[0])),"number"===typeof r&&r>=0?l=l+this.stride[1]*r|0:(o.push(this.shape[1]),s.push(this.stride[1])),"number"===typeof n&&n>=0?l=l+this.stride[2]*n|0:(o.push(this.shape[2]),s.push(this.stride[2])),"number"===typeof i&&i>=0?l=l+this.stride[3]*i|0:(o.push(this.shape[3]),s.push(this.stride[3])),"number"===typeof a&&a>=0?l=l+this.stride[4]*a|0:(o.push(this.shape[4]),s.push(this.stride[4])),(0,t[o.length+1])(this.data,o,s,l)},function(e,t,r,i){return new n(e,t[0],t[1],t[2],t[3],t[4],r[0],r[1],r[2],r[3],r[4],i)}}};function l(e,t){var r=-1===t?"T":String(t),n=s[r];return-1===t?n(e):0===t?n(e,c[e][0]):n(e,c[e],o)}var c={generic:[],buffer:[],array:[],float32:[],float64:[],int8:[],int16:[],int32:[],uint8_clamped:[],uint8:[],uint16:[],uint32:[],bigint64:[],biguint64:[]};e.exports=function(e,t,r,a){if(void 0===e)return(0,c.array[0])([]);"number"===typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var o=t.length;if(void 0===r){r=new Array(o);for(var s=o-1,u=1;s>=0;--s)r[s]=u,u*=t[s]}if(void 0===a)for(a=0,s=0;s<o;++s)r[s]<0&&(a-=(t[s]-1)*r[s]);for(var h=function(e){if(n(e))return"buffer";if(i)switch(Object.prototype.toString.call(e)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8ClampedArray]":return"uint8_clamped";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object BigInt64Array]":return"bigint64";case"[object BigUint64Array]":return"biguint64"}return Array.isArray(e)?"array":"generic"}(e),p=c[h];p.length<=o+1;)p.push(l(h,p.length-1));return(0,p[o+1])(e,t,r,a)}},1278:function(e,t,r){var n=r(2361),i=Math.pow(2,-1074),a=-1>>>0;e.exports=function(e,t){if(isNaN(e)||isNaN(t))return NaN;if(e===t)return e;if(0===e)return t<0?-i:i;var r=n.hi(e),o=n.lo(e);return t>e===e>0?o===a?(r+=1,o=0):o+=1:0===o?(o=a,r-=1):o-=1,n.pack(o,r)}},8406:function(e,t){t.vertexNormals=function(e,t,r){for(var n=t.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o)i[o]=[0,0,0];for(o=0;o<e.length;++o)for(var s=e[o],l=0,c=s[s.length-1],u=s[0],h=0;h<s.length;++h){l=c,c=u,u=s[(h+1)%s.length];for(var p=t[l],d=t[c],f=t[u],m=new Array(3),g=0,y=new Array(3),v=0,x=0;x<3;++x)m[x]=p[x]-d[x],g+=m[x]*m[x],y[x]=f[x]-d[x],v+=y[x]*y[x];if(g*v>a){var b=i[c],_=1/Math.sqrt(g*v);for(x=0;x<3;++x){var w=(x+1)%3,k=(x+2)%3;b[x]+=_*(y[w]*m[k]-y[k]*m[w])}}}for(o=0;o<n;++o){b=i[o];var T=0;for(x=0;x<3;++x)T+=b[x]*b[x];if(T>a)for(_=1/Math.sqrt(T),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},t.faceNormals=function(e,t,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;o<n;++o){for(var s=e[o],l=new Array(3),c=0;c<3;++c)l[c]=t[s[c]];var u=new Array(3),h=new Array(3);for(c=0;c<3;++c)u[c]=l[1][c]-l[0][c],h[c]=l[2][c]-l[0][c];var p=new Array(3),d=0;for(c=0;c<3;++c){var f=(c+1)%3,m=(c+2)%3;p[c]=u[f]*h[m]-u[m]*h[f],d+=p[c]*p[c]}for(d=d>a?1/Math.sqrt(d):0,c=0;c<3;++c)p[c]*=d;i[o]=p}return i}},4081:function(e){e.exports=function(e,t,r,n,i,a,o,s,l,c){var u=t+a+c;if(h>0){var h=Math.sqrt(u+1);e[0]=.5*(o-l)/h,e[1]=.5*(s-n)/h,e[2]=.5*(r-a)/h,e[3]=.5*h}else{var p=Math.max(t,a,c);h=Math.sqrt(2*p-u+1),t>=p?(e[0]=.5*h,e[1]=.5*(i+r)/h,e[2]=.5*(s+n)/h,e[3]=.5*(o-l)/h):a>=p?(e[0]=.5*(r+i)/h,e[1]=.5*h,e[2]=.5*(l+o)/h,e[3]=.5*(s-n)/h):(e[0]=.5*(n+s)/h,e[1]=.5*(o+l)/h,e[2]=.5*h,e[3]=.5*(r-i)/h)}return e}},9977:function(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.rotation||[0,0,0,1],n=e.radius||1;t=[].slice.call(t,0,3),u(r=[].slice.call(r,0,4),r);var i=new h(r,t,Math.log(n));return i.setDistanceLimits(e.zoomMin,e.zoomMax),("eye"in e||"up"in e)&&i.lookAt(0,e.eye,e.center,e.up),i};var n=r(9215),i=r(6582),a=r(7399),o=r(7608),s=r(4081);function l(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function c(e,t,r,n){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2)+Math.pow(n,2))}function u(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=c(r,n,i,a);o>1e-6?(e[0]=r/o,e[1]=n/o,e[2]=i/o,e[3]=a/o):(e[0]=e[1]=e[2]=0,e[3]=1)}function h(e,t,r){this.radius=n([r]),this.center=n(t),this.rotation=n(e),this.computedRadius=this.radius.curve(0),this.computedCenter=this.center.curve(0),this.computedRotation=this.rotation.curve(0),this.computedUp=[.1,0,0],this.computedEye=[.1,0,0],this.computedMatrix=[.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.recalcMatrix(0)}var p=h.prototype;p.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},p.recalcMatrix=function(e){this.radius.curve(e),this.center.curve(e),this.rotation.curve(e);var t=this.computedRotation;u(t,t);var r=this.computedMatrix;a(r,t);var n=this.computedCenter,i=this.computedEye,o=this.computedUp,s=Math.exp(this.computedRadius[0]);i[0]=n[0]+s*r[2],i[1]=n[1]+s*r[6],i[2]=n[2]+s*r[10],o[0]=r[1],o[1]=r[5],o[2]=r[9];for(var l=0;l<3;++l){for(var c=0,h=0;h<3;++h)c+=r[l+4*h]*i[h];r[12+l]=-c}},p.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r},p.idle=function(e){this.center.idle(e),this.radius.idle(e),this.rotation.idle(e)},p.flush=function(e){this.center.flush(e),this.radius.flush(e),this.rotation.flush(e)},p.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=i[1],o=i[5],s=i[9],c=l(a,o,s);a/=c,o/=c,s/=c;var u=i[0],h=i[4],p=i[8],d=u*a+h*o+p*s,f=l(u-=a*d,h-=o*d,p-=s*d);u/=f,h/=f,p/=f;var m=i[2],g=i[6],y=i[10],v=m*a+g*o+y*s,x=m*u+g*h+y*p,b=l(m-=v*a+x*u,g-=v*o+x*h,y-=v*s+x*p);m/=b,g/=b,y/=b;var _=u*t+a*r,w=h*t+o*r,k=p*t+s*r;this.center.move(e,_,w,k);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+n),this.radius.set(e,Math.log(T))},p.rotate=function(e,t,r,n){this.recalcMatrix(e),t=t||0,r=r||0;var i=this.computedMatrix,a=i[0],o=i[4],s=i[8],u=i[1],h=i[5],p=i[9],d=i[2],f=i[6],m=i[10],g=t*a+r*u,y=t*o+r*h,v=t*s+r*p,x=-(f*v-m*y),b=-(m*g-d*v),_=-(d*y-f*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),k=c(x,b,_,w);k>1e-6?(x/=k,b/=k,_/=k,w/=k):(x=b=_=0,w=1);var T=this.computedRotation,S=T[0],A=T[1],M=T[2],E=T[3],C=S*w+E*x+A*_-M*b,P=A*w+E*b+M*x-S*_,L=M*w+E*_+S*b-A*x,I=E*w-S*x-A*b-M*_;if(n){x=d,b=f,_=m;var z=Math.sin(n)/l(x,b,_);x*=z,b*=z,_*=z,I=I*(w=Math.cos(t))-(C=C*w+I*x+P*_-L*b)*x-(P=P*w+I*b+L*x-C*_)*b-(L=L*w+I*_+C*b-P*x)*_}var O=c(C,P,L,I);O>1e-6?(C/=O,P/=O,L/=O,I/=O):(C=P=L=0,I=1),this.rotation.set(e,C,P,L,I)},p.lookAt=function(e,t,r,n){this.recalcMatrix(e),r=r||this.computedCenter,t=t||this.computedEye,n=n||this.computedUp;var a=this.computedMatrix;i(a,t,r,n);var o=this.computedRotation;s(o,a[0],a[1],a[2],a[4],a[5],a[6],a[8],a[9],a[10]),u(o,o),this.rotation.set(e,o[0],o[1],o[2],o[3]);for(var l=0,c=0;c<3;++c)l+=Math.pow(r[c]-t[c],2);this.radius.set(e,.5*Math.log(Math.max(l,1e-6))),this.center.set(e,r[0],r[1],r[2])},p.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},p.setMatrix=function(e,t){var r=this.computedRotation;s(r,t[0],t[1],t[2],t[4],t[5],t[6],t[8],t[9],t[10]),u(r,r),this.rotation.set(e,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;o(n,t);var i=n[15];if(Math.abs(i)>1e-6){var a=n[12]/i,l=n[13]/i,c=n[14]/i;this.recalcMatrix(e);var h=Math.exp(this.computedRadius[0]);this.center.set(e,a-n[2]*h,l-n[6]*h,c-n[10]*h),this.radius.idle(e)}else this.center.idle(e),this.radius.idle(e)},p.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},p.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},p.getDistanceLimits=function(e){var t=this.radius.bounds;return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},p.toJSON=function(){return this.recalcMatrix(this.lastT()),{center:this.computedCenter.slice(),rotation:this.computedRotation.slice(),distance:Math.log(this.computedRadius[0]),zoomMin:this.radius.bounds[0][0],zoomMax:this.radius.bounds[1][0]}},p.fromJSON=function(e){var t=this.lastT(),r=e.center;r&&this.center.set(t,r[0],r[1],r[2]);var n=e.rotation;n&&this.rotation.set(t,n[0],n[1],n[2],n[3]);var i=e.distance;i&&i>0&&this.radius.set(t,Math.log(i)),this.setDistanceLimits(e.zoomMin,e.zoomMax)}},1371:function(e,t,r){var n=r(3233);e.exports=function(e,t,r){return n(r="undefined"!==typeof r?r+"":" ",t)+e}},3202:function(e){e.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}},3088:function(e,t,r){e.exports=function(e,t){for(var r=0|t.length,i=e.length,a=[new Array(r),new Array(r)],o=0;o<r;++o)a[0][o]=[],a[1][o]=[];for(o=0;o<i;++o){var s=e[o];a[0][s[0]].push(s),a[1][s[1]].push(s)}var l,c=[];for(o=0;o<r;++o)a[0][o].length+a[1][o].length===0&&c.push([o]);function u(e,t){var r=a[t][e[t]];r.splice(r.indexOf(e),1)}function h(e,r,i){for(var o,s,l,c=0;c<2;++c)if(a[c][r].length>0){o=a[c][r][0],l=c;break}s=o[1^l];for(var h=0;h<2;++h)for(var p=a[h][r],d=0;d<p.length;++d){var f=p[d],m=f[1^h];n(t[e],t[r],t[s],t[m])>0&&(o=f,s=m,l=h)}return i||o&&u(o,l),s}function p(e,r){var i=a[r][e][0],o=[e];u(i,r);for(var s=i[1^r];;){for(;s!==e;)o.push(s),s=h(o[o.length-2],s,!1);if(a[0][e].length+a[1][e].length===0)break;var l=o[o.length-1],c=e,p=o[1],d=h(l,c,!0);if(n(t[l],t[c],t[p],t[d])<0)break;o.push(e),s=h(l,c)}return o}for(o=0;o<r;++o)for(var d=0;d<2;++d){for(var f=[];a[d][o].length>0;){a[0][o].length;var m=p(o,d);(l=m)[1]===l[l.length-1]?f.push.apply(f,m):(f.length>0&&c.push(f),f=m)}f.length>0&&c.push(f)}return c};var n=r(3140)},5609:function(e,t,r){e.exports=function(e,t){for(var r=n(e,t.length),i=new Array(t.length),a=new Array(t.length),o=[],s=0;s<t.length;++s){var l=r[s].length;a[s]=l,i[s]=!0,l<=1&&o.push(s)}for(;o.length>0;){i[d=o.pop()]=!1;var c=r[d];for(s=0;s<c.length;++s){var u=c[s];0===--a[u]&&o.push(u)}}var h=new Array(t.length),p=[];for(s=0;s<t.length;++s)if(i[s]){var d=p.length;h[s]=d,p.push(t[s])}else h[s]=-1;var f=[];for(s=0;s<e.length;++s){var m=e[s];i[m[0]]&&i[m[1]]&&f.push([h[m[0]],h[m[1]]])}return[f,p]};var n=r(3134)},2095:function(e,t,r){e.exports=function(e,t){var r=c(e,t);e=r[0];for(var h=(t=r[1]).length,p=(e.length,n(e,t.length)),d=0;d<h;++d)if(p[d].length%2===1)throw new Error("planar-graph-to-polyline: graph must be manifold");var f=i(e,t),m=(f=f.filter((function(e){for(var r=e.length,n=[0],i=0;i<r;++i){var a=t[e[i]],l=t[e[(i+1)%r]],c=o(-a[0],a[1]),u=o(-a[0],l[1]),h=o(l[0],a[1]),p=o(l[0],l[1]);n=s(n,s(s(c,u),s(h,p)))}return n[n.length-1]>0}))).length,g=new Array(m),y=new Array(m);for(d=0;d<m;++d){g[d]=d;var v=new Array(m),x=f[d].map((function(e){return t[e]})),b=a([x]),_=0;e:for(var w=0;w<m;++w)if(v[w]=0,d!==w){for(var k=(q=f[w]).length,T=0;T<k;++T){var S=b(t[q[T]]);if(0!==S){S<0&&(v[w]=1,_+=1);continue e}}v[w]=1,_+=1}y[d]=[_,d,v]}for(y.sort((function(e,t){return t[0]-e[0]})),d=0;d<m;++d){var A=(v=y[d])[1],M=v[2];for(w=0;w<m;++w)M[w]&&(g[w]=A)}var E=function(e){for(var t=new Array(e),r=0;r<e;++r)t[r]=[];return t}(m);for(d=0;d<m;++d)E[d].push(g[d]),E[g[d]].push(d);var C={},P=u(h,!1);for(d=0;d<m;++d)for(k=(q=f[d]).length,w=0;w<k;++w){var L=q[w],I=q[(w+1)%k],z=Math.min(L,I)+":"+Math.max(L,I);if(z in C){var O=C[z];E[O].push(d),E[d].push(O),P[L]=P[I]=!0}else C[z]=d}function R(e){for(var t=e.length,r=0;r<t;++r)if(!P[e[r]])return!1;return!0}var D=[],j=u(m,-1);for(d=0;d<m;++d)g[d]!==d||R(f[d])?j[d]=-1:(D.push(d),j[d]=0);for(r=[];D.length>0;){var F=D.pop(),B=E[F];l(B,(function(e,t){return e-t}));var N,U=B.length,V=j[F];for(0===V&&(N=[q=f[F]]),d=0;d<U;++d){var q,H=B[d];j[H]>=0||(j[H]=1^V,D.push(H),0===V&&(R(q=f[H])||(q.reverse(),N.push(q))))}0===V&&r.push(N)}return r};var n=r(3134),i=r(3088),a=r(5085),o=r(5250),s=r(8210),l=r(1682),c=r(5609);function u(e,t){for(var r=new Array(e),n=0;n<e;++n)r[n]=t;return r}},5085:function(e,t,r){e.exports=function(e){for(var t=e.length,r=[],a=[],s=0;s<t;++s)for(var u=e[s],h=u.length,p=h-1,d=0;d<h;p=d++){var f=u[p],m=u[d];f[0]===m[0]?a.push([f,m]):r.push([f,m])}if(0===r.length)return 0===a.length?c:(g=l(a),function(e){return g(e[0],e[1])?0:1});var g,y=i(r),v=function(e,t){return function(r){var i=o.le(t,r[0]);if(i<0)return 1;var a=e[i];if(!a){if(!(i>0&&t[i]===r[0]))return 1;a=e[i-1]}for(var s=1;a;){var l=a.key,c=n(r,l[0],l[1]);if(l[0][0]<l[1][0])if(c<0)a=a.left;else{if(!(c>0))return 0;s=-1,a=a.right}else if(c>0)a=a.left;else{if(!(c<0))return 0;s=1,a=a.right}}return s}}(y.slabs,y.coordinates);return 0===a.length?v:function(e,t){return function(r){return e(r[0],r[1])?0:t(r)}}(l(a),v)};var n=r(3250)[3],i=r(4209),a=r(3352),o=r(2478);function s(){return!0}function l(e){for(var t={},r=0;r<e.length;++r){var n=e[r],i=n[0][0],o=n[0][1],l=n[1][1],c=[Math.min(o,l),Math.max(o,l)];i in t?t[i].push(c):t[i]=[c]}var u={},h=Object.keys(t);for(r=0;r<h.length;++r){var p=t[h[r]];u[h[r]]=a(p)}return function(e){return function(t,r){var n=e[t];return!!n&&!!n.queryPoint(r,s)}}(u)}function c(e){return 1}},9346:function(e){var t=new Float64Array(4),r=new Float64Array(4),n=new Float64Array(4);e.exports=function(e,i,a,o,s){t.length<o.length&&(t=new Float64Array(o.length),r=new Float64Array(o.length),n=new Float64Array(o.length));for(var l=0;l<o.length;++l)t[l]=e[l]-o[l],r[l]=i[l]-e[l],n[l]=a[l]-e[l];var c=0,u=0,h=0,p=0,d=0,f=0;for(l=0;l<o.length;++l){var m=r[l],g=n[l],y=t[l];c+=m*m,u+=m*g,h+=g*g,p+=y*m,d+=y*g,f+=y*y}var v,x,b,_,w,k=Math.abs(c*h-u*u),T=u*d-h*p,S=u*p-c*d;if(T+S<=k)if(T<0)S<0&&p<0?(S=0,-p>=c?(T=1,v=c+2*p+f):v=p*(T=-p/c)+f):(T=0,d>=0?(S=0,v=f):-d>=h?(S=1,v=h+2*d+f):v=d*(S=-d/h)+f);else if(S<0)S=0,p>=0?(T=0,v=f):-p>=c?(T=1,v=c+2*p+f):v=p*(T=-p/c)+f;else{var A=1/k;v=(T*=A)*(c*T+u*(S*=A)+2*p)+S*(u*T+h*S+2*d)+f}else T<0?(b=h+d)>(x=u+p)?(_=b-x)>=(w=c-2*u+h)?(T=1,S=0,v=c+2*p+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*p)+S*(u*T+h*S+2*d)+f:(T=0,b<=0?(S=1,v=h+2*d+f):d>=0?(S=0,v=f):v=d*(S=-d/h)+f):S<0?(b=c+p)>(x=u+d)?(_=b-x)>=(w=c-2*u+h)?(S=1,T=0,v=h+2*d+f):v=(T=1-(S=_/w))*(c*T+u*S+2*p)+S*(u*T+h*S+2*d)+f:(S=0,b<=0?(T=1,v=c+2*p+f):p>=0?(T=0,v=f):v=p*(T=-p/c)+f):(_=h+d-u-p)<=0?(T=0,S=1,v=h+2*d+f):_>=(w=c-2*u+h)?(T=1,S=0,v=c+2*p+f):v=(T=_/w)*(c*T+u*(S=1-T)+2*p)+S*(u*T+h*S+2*d)+f;var M=1-T-S;for(l=0;l<o.length;++l)s[l]=M*e[l]+T*i[l]+S*a[l];return v<0?0:v}},8648:function(e,t,r){e.exports=r(783)},2653:function(e,t,r){var n=r(3865);e.exports=function(e,t){for(var r=e.length,i=new Array(r),a=0;a<r;++a)i[a]=n(e[a],t[a]);return i}},5838:function(e,t,r){e.exports=function(e){for(var t=new Array(e.length),r=0;r<e.length;++r)t[r]=n(e[r]);return t};var n=r(7842)},8987:function(e,t,r){var n=r(7842),i=r(6504);e.exports=function(e,t){for(var r=n(t),a=e.length,o=new Array(a),s=0;s<a;++s)o[s]=i(e[s],r);return o}},544:function(e,t,r){var n=r(5572);e.exports=function(e,t){for(var r=e.length,i=new Array(r),a=0;a<r;++a)i[a]=n(e[a],t[a]);return i}},5771:function(e,t,r){var n=r(8507),i=r(3788),a=r(2419);e.exports=function(e){e.sort(i);for(var t=e.length,r=0,o=0;o<t;++o){var s=e[o],l=a(s);if(0!==l){if(r>0){var c=e[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}e[r++]=s}}return e.length=r,e}},3233:function(e){var t,r="";e.exports=function(e,n){if("string"!==typeof e)throw new TypeError("expected a string");if(1===n)return e;if(2===n)return e+e;var i=e.length*n;if(t!==e||"undefined"===typeof t)t=e,r="";else if(r.length>=i)return r.substr(0,i);for(;i>r.length&&n>1;)1&n&&(r+=e),n>>=1,e+=e;return r=(r+=e).substr(0,i)}},3025:function(e,t,r){e.exports=r.g.performance&&r.g.performance.now?function(){return performance.now()}:Date.now||function(){return+new Date}},7004:function(e){e.exports=function(e){for(var t=e.length,r=e[e.length-1],n=t,i=t-2;i>=0;--i){var a=r;(l=(s=e[i])-((r=a+s)-a))&&(e[--n]=r,r=l)}var o=0;for(i=n;i<t;++i){var s,l;(l=(s=r)-((r=(a=e[i])+s)-a))&&(e[o++]=l)}return e[o++]=r,e.length=o,e}},2962:function(e,t,r){var n=r(5250),i=r(8210),a=r(3012),o=r(7004);function s(e,t,r,n){return function(t){return n(e(r(t[0][0],t[1][1]),r(-t[0][1],t[1][0])))}}function l(e,t,r,n){return function(i){return n(e(t(e(r(i[1][1],i[2][2]),r(-i[1][2],i[2][1])),i[0][0]),e(t(e(r(i[1][0],i[2][2]),r(-i[1][2],i[2][0])),-i[0][1]),t(e(r(i[1][0],i[2][1]),r(-i[1][1],i[2][0])),i[0][2]))))}}function c(e,t,r,n){return function(i){return n(e(e(t(e(t(e(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][1]),e(t(e(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),-i[1][2]),t(e(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][3]))),i[0][0]),t(e(t(e(r(i[2][2],i[3][3]),r(-i[2][3],i[3][2])),i[1][0]),e(t(e(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][2]),t(e(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),i[1][3]))),-i[0][1])),e(t(e(t(e(r(i[2][1],i[3][3]),r(-i[2][3],i[3][1])),i[1][0]),e(t(e(r(i[2][0],i[3][3]),r(-i[2][3],i[3][0])),-i[1][1]),t(e(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][3]))),i[0][2]),t(e(t(e(r(i[2][1],i[3][2]),r(-i[2][2],i[3][1])),i[1][0]),e(t(e(r(i[2][0],i[3][2]),r(-i[2][2],i[3][0])),-i[1][1]),t(e(r(i[2][0],i[3][1]),r(-i[2][1],i[3][0])),i[1][2]))),-i[0][3]))))}}function u(e,t,r,n){return function(i){return n(e(e(t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][1]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),-i[1][2])),e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),-i[1][4]))),i[0][0]),t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][2]),e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),-i[2][3]),t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][2])),e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][4]))),-i[0][1])),e(t(e(e(t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][3]),t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][3],i[4][4]),r(-i[3][4],i[4][3])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][3]),t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][3]),t(e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),-i[1][4]))),i[0][2]),e(t(e(e(t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][4]))),i[1][0]),t(e(t(e(r(i[3][2],i[4][4]),r(-i[3][4],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][4]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][4]),r(-i[3][4],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][4]),r(-i[3][4],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][4]))),i[1][2]),t(e(t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][4]))),-i[0][3]),t(e(e(t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][1]),e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),-i[2][2]),t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][3]))),i[1][0]),t(e(t(e(r(i[3][2],i[4][3]),r(-i[3][3],i[4][2])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][2]),t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),i[2][3]))),-i[1][1])),e(t(e(t(e(r(i[3][1],i[4][3]),r(-i[3][3],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][3]),r(-i[3][3],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][3]))),i[1][2]),t(e(t(e(r(i[3][1],i[4][2]),r(-i[3][2],i[4][1])),i[2][0]),e(t(e(r(i[3][0],i[4][2]),r(-i[3][2],i[4][0])),-i[2][1]),t(e(r(i[3][0],i[4][1]),r(-i[3][1],i[4][0])),i[2][2]))),-i[1][3]))),i[0][4])))))}}function h(e){return(2===e?s:3===e?l:4===e?c:5===e?u:void 0)(i,a,n,o)}var p=[function(){return[0]},function(e){return[e[0][0]]}];function d(e,t,r,n,i,a,o,s){return function(l){switch(l.length){case 0:return e(l);case 1:return t(l);case 2:return r(l);case 3:return n(l);case 4:return i(l);case 5:return a(l)}var c=o[l.length];return c||(c=o[l.length]=s(l.length)),c(l)}}!function(){for(;p.length<6;)p.push(h(p.length));e.exports=d.apply(void 0,p.concat([p,h]));for(var t=0;t<p.length;++t)e.exports[t]=p[t]}()},1944:function(e,t,r){var n=r(5250),i=r(8210);e.exports=function(e,t){for(var r=n(e[0],t[0]),a=1;a<e.length;++a)r=i(r,n(e[a],t[a]));return r}},2646:function(e,t,r){var n=r(5250),i=r(8210),a=r(8545),o=r(3012);function s(e){return(3===e?l:4===e?c:5===e?u:h)(i,a,n,o)}function l(e,t,r,n){return function(i,a,o){var s=r(i[0],i[0]),l=n(s,a[0]),c=n(s,o[0]),u=r(a[0],a[0]),h=n(u,i[0]),p=n(u,o[0]),d=r(o[0],o[0]),f=n(d,i[0]),m=n(d,a[0]),g=e(t(m,p),t(h,l)),y=t(f,c),v=t(g,y);return v[v.length-1]}}function c(e,t,r,n){return function(i,a,o,s){var l=e(r(i[0],i[0]),r(i[1],i[1])),c=n(l,a[0]),u=n(l,o[0]),h=n(l,s[0]),p=e(r(a[0],a[0]),r(a[1],a[1])),d=n(p,i[0]),f=n(p,o[0]),m=n(p,s[0]),g=e(r(o[0],o[0]),r(o[1],o[1])),y=n(g,i[0]),v=n(g,a[0]),x=n(g,s[0]),b=e(r(s[0],s[0]),r(s[1],s[1])),_=n(b,i[0]),w=n(b,a[0]),k=n(b,o[0]),T=e(e(n(t(k,x),a[1]),e(n(t(w,m),-o[1]),n(t(v,f),s[1]))),e(n(t(w,m),i[1]),e(n(t(_,h),-a[1]),n(t(d,c),s[1])))),S=e(e(n(t(k,x),i[1]),e(n(t(_,h),-o[1]),n(t(y,u),s[1]))),e(n(t(v,f),i[1]),e(n(t(y,u),-a[1]),n(t(d,c),o[1])))),A=t(T,S);return A[A.length-1]}}function u(e,t,r,n){return function(i,a,o,s,l){var c=e(r(i[0],i[0]),e(r(i[1],i[1]),r(i[2],i[2]))),u=n(c,a[0]),h=n(c,o[0]),p=n(c,s[0]),d=n(c,l[0]),f=e(r(a[0],a[0]),e(r(a[1],a[1]),r(a[2],a[2]))),m=n(f,i[0]),g=n(f,o[0]),y=n(f,s[0]),v=n(f,l[0]),x=e(r(o[0],o[0]),e(r(o[1],o[1]),r(o[2],o[2]))),b=n(x,i[0]),_=n(x,a[0]),w=n(x,s[0]),k=n(x,l[0]),T=e(r(s[0],s[0]),e(r(s[1],s[1]),r(s[2],s[2]))),S=n(T,i[0]),A=n(T,a[0]),M=n(T,o[0]),E=n(T,l[0]),C=e(r(l[0],l[0]),e(r(l[1],l[1]),r(l[2],l[2]))),P=n(C,i[0]),L=n(C,a[0]),I=n(C,o[0]),z=n(C,s[0]),O=e(e(e(n(e(n(t(z,E),o[1]),e(n(t(I,k),-s[1]),n(t(M,w),l[1]))),a[2]),e(n(e(n(t(z,E),a[1]),e(n(t(L,v),-s[1]),n(t(A,y),l[1]))),-o[2]),n(e(n(t(I,k),a[1]),e(n(t(L,v),-o[1]),n(t(_,g),l[1]))),s[2]))),e(n(e(n(t(M,w),a[1]),e(n(t(A,y),-o[1]),n(t(_,g),s[1]))),-l[2]),e(n(e(n(t(z,E),a[1]),e(n(t(L,v),-s[1]),n(t(A,y),l[1]))),i[2]),n(e(n(t(z,E),i[1]),e(n(t(P,d),-s[1]),n(t(S,p),l[1]))),-a[2])))),e(e(n(e(n(t(L,v),i[1]),e(n(t(P,d),-a[1]),n(t(m,u),l[1]))),s[2]),e(n(e(n(t(A,y),i[1]),e(n(t(S,p),-a[1]),n(t(m,u),s[1]))),-l[2]),n(e(n(t(M,w),a[1]),e(n(t(A,y),-o[1]),n(t(_,g),s[1]))),i[2]))),e(n(e(n(t(M,w),i[1]),e(n(t(S,p),-o[1]),n(t(b,h),s[1]))),-a[2]),e(n(e(n(t(A,y),i[1]),e(n(t(S,p),-a[1]),n(t(m,u),s[1]))),o[2]),n(e(n(t(_,g),i[1]),e(n(t(b,h),-a[1]),n(t(m,u),o[1]))),-s[2]))))),R=e(e(e(n(e(n(t(z,E),o[1]),e(n(t(I,k),-s[1]),n(t(M,w),l[1]))),i[2]),n(e(n(t(z,E),i[1]),e(n(t(P,d),-s[1]),n(t(S,p),l[1]))),-o[2])),e(n(e(n(t(I,k),i[1]),e(n(t(P,d),-o[1]),n(t(b,h),l[1]))),s[2]),n(e(n(t(M,w),i[1]),e(n(t(S,p),-o[1]),n(t(b,h),s[1]))),-l[2]))),e(e(n(e(n(t(I,k),a[1]),e(n(t(L,v),-o[1]),n(t(_,g),l[1]))),i[2]),n(e(n(t(I,k),i[1]),e(n(t(P,d),-o[1]),n(t(b,h),l[1]))),-a[2])),e(n(e(n(t(L,v),i[1]),e(n(t(P,d),-a[1]),n(t(m,u),l[1]))),o[2]),n(e(n(t(_,g),i[1]),e(n(t(b,h),-a[1]),n(t(m,u),o[1]))),-l[2])))),D=t(O,R);return D[D.length-1]}}function h(e,t,r,n){return function(i,a,o,s,l,c){var u=e(e(r(i[0],i[0]),r(i[1],i[1])),e(r(i[2],i[2]),r(i[3],i[3]))),h=n(u,a[0]),p=n(u,o[0]),d=n(u,s[0]),f=n(u,l[0]),m=n(u,c[0]),g=e(e(r(a[0],a[0]),r(a[1],a[1])),e(r(a[2],a[2]),r(a[3],a[3]))),y=n(g,i[0]),v=n(g,o[0]),x=n(g,s[0]),b=n(g,l[0]),_=n(g,c[0]),w=e(e(r(o[0],o[0]),r(o[1],o[1])),e(r(o[2],o[2]),r(o[3],o[3]))),k=n(w,i[0]),T=n(w,a[0]),S=n(w,s[0]),A=n(w,l[0]),M=n(w,c[0]),E=e(e(r(s[0],s[0]),r(s[1],s[1])),e(r(s[2],s[2]),r(s[3],s[3]))),C=n(E,i[0]),P=n(E,a[0]),L=n(E,o[0]),I=n(E,l[0]),z=n(E,c[0]),O=e(e(r(l[0],l[0]),r(l[1],l[1])),e(r(l[2],l[2]),r(l[3],l[3]))),R=n(O,i[0]),D=n(O,a[0]),j=n(O,o[0]),F=n(O,s[0]),B=n(O,c[0]),N=e(e(r(c[0],c[0]),r(c[1],c[1])),e(r(c[2],c[2]),r(c[3],c[3]))),U=n(N,i[0]),V=n(N,a[0]),q=n(N,o[0]),H=n(N,s[0]),G=n(N,l[0]),W=e(e(e(n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),o[2]),n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),-s[2])),e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),l[2]),n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),-c[2]))),a[3]),e(n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),a[2]),n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),-s[2])),e(n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),l[2]),n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),a[2]),n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),-o[2])),e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),l[2]),n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),a[2]),n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),-o[2])),e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),s[2]),n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),a[2]),n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),-o[2])),e(n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),s[2]),n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),a[2]),n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),-s[2])),e(n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),l[2]),n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),-c[2]))),i[3]),n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-s[2])),e(n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),l[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-c[2]))),-a[3])))),e(e(e(n(e(e(n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),l[2]),n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),-c[2]))),s[3]),n(e(e(n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),s[2]),n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),i[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-a[2])),e(n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),s[2]),n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),a[2]),n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),-o[2])),e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),s[2]),n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),-c[2]))),i[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),-o[2])),e(n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),s[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-c[2]))),-a[3]),n(e(e(n(e(n(t(H,z),a[1]),e(n(t(V,_),-s[1]),n(t(P,x),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),s[2]),n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),-c[2]))),o[3])),e(n(e(e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),i[2]),n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-c[2]))),-s[3]),n(e(e(n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),i[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-a[2])),e(n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-s[2]))),c[3]))))),$=e(e(e(n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),o[2]),n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),-s[2])),e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),l[2]),n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),-c[2]))),i[3]),e(n(e(e(n(e(n(t(G,B),s[1]),e(n(t(H,z),-l[1]),n(t(F,I),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-s[2])),e(n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),l[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-c[2]))),-o[3]),n(e(e(n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-o[2])),e(n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),l[2]),n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),-c[2]))),s[3]))),e(e(n(e(e(n(e(n(t(H,z),o[1]),e(n(t(q,M),-s[1]),n(t(L,S),c[1]))),i[2]),n(e(n(t(H,z),i[1]),e(n(t(U,m),-s[1]),n(t(C,d),c[1]))),-o[2])),e(n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),s[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-c[2]))),-l[3]),n(e(e(n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),i[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-o[2])),e(n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),s[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-l[2]))),c[3])),e(n(e(e(n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),a[2]),n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),-o[2])),e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),l[2]),n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),-c[2]))),i[3]),n(e(e(n(e(n(t(G,B),o[1]),e(n(t(q,M),-l[1]),n(t(j,A),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-o[2])),e(n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),l[2]),n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),-c[2]))),-a[3])))),e(e(e(n(e(e(n(e(n(t(G,B),a[1]),e(n(t(V,_),-l[1]),n(t(D,b),c[1]))),i[2]),n(e(n(t(G,B),i[1]),e(n(t(U,m),-l[1]),n(t(R,f),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),l[2]),n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),-c[2]))),o[3]),n(e(e(n(e(n(t(q,M),a[1]),e(n(t(V,_),-o[1]),n(t(T,v),c[1]))),i[2]),n(e(n(t(q,M),i[1]),e(n(t(U,m),-o[1]),n(t(k,p),c[1]))),-a[2])),e(n(e(n(t(V,_),i[1]),e(n(t(U,m),-a[1]),n(t(y,h),c[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-c[2]))),-l[3])),e(n(e(e(n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),i[2]),n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),-a[2])),e(n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-l[2]))),c[3]),n(e(e(n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),a[2]),n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),-o[2])),e(n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),s[2]),n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),-l[2]))),i[3]))),e(e(n(e(e(n(e(n(t(F,I),o[1]),e(n(t(j,A),-s[1]),n(t(L,S),l[1]))),i[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-o[2])),e(n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),s[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-l[2]))),-a[3]),n(e(e(n(e(n(t(F,I),a[1]),e(n(t(D,b),-s[1]),n(t(P,x),l[1]))),i[2]),n(e(n(t(F,I),i[1]),e(n(t(R,f),-s[1]),n(t(C,d),l[1]))),-a[2])),e(n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),s[2]),n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),-l[2]))),o[3])),e(n(e(e(n(e(n(t(j,A),a[1]),e(n(t(D,b),-o[1]),n(t(T,v),l[1]))),i[2]),n(e(n(t(j,A),i[1]),e(n(t(R,f),-o[1]),n(t(k,p),l[1]))),-a[2])),e(n(e(n(t(D,b),i[1]),e(n(t(R,f),-a[1]),n(t(y,h),l[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-l[2]))),-s[3]),n(e(e(n(e(n(t(L,S),a[1]),e(n(t(P,x),-o[1]),n(t(T,v),s[1]))),i[2]),n(e(n(t(L,S),i[1]),e(n(t(C,d),-o[1]),n(t(k,p),s[1]))),-a[2])),e(n(e(n(t(P,x),i[1]),e(n(t(C,d),-a[1]),n(t(y,h),s[1]))),o[2]),n(e(n(t(T,v),i[1]),e(n(t(k,p),-a[1]),n(t(y,h),o[1]))),-s[2]))),l[3]))))),Z=t(W,$);return Z[Z.length-1]}}var p=[function(){return 0},function(){return 0},function(){return 0}];function d(e){var t=p[e.length];return t||(t=p[e.length]=s(e.length)),t.apply(void 0,e)}function f(e,t,r,n,i,a,o,s){return function(t,r,l,c,u,h){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,l);case 4:return a(t,r,l,c);case 5:return o(t,r,l,c,u);case 6:return s(t,r,l,c,u,h)}for(var p=new Array(arguments.length),d=0;d<arguments.length;++d)p[d]=arguments[d];return e(p)}}!function(){for(;p.length<=6;)p.push(s(p.length));e.exports=f.apply(void 0,[d].concat(p));for(var t=0;t<=6;++t)e.exports[t]=p[t]}()},727:function(e,t,r){var n=r(2962);function i(e){var t=2===e?a:3===e?o:4===e?s:5===e?l:c;return t(e<6?n[e]:n)}function a(e){return function(t,r){return[e([[+r[0],+t[0][1]],[+r[1],+t[1][1]]]),e([[+t[0][0],+r[0]],[+t[1][0],+r[1]]]),e(t)]}}function o(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2]],[+r[1],+t[1][1],+t[1][2]],[+r[2],+t[2][1],+t[2][2]]]),e([[+t[0][0],+r[0],+t[0][2]],[+t[1][0],+r[1],+t[1][2]],[+t[2][0],+r[2],+t[2][2]]]),e([[+t[0][0],+t[0][1],+r[0]],[+t[1][0],+t[1][1],+r[1]],[+t[2][0],+t[2][1],+r[2]]]),e(t)]}}function s(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3]],[+r[1],+t[1][1],+t[1][2],+t[1][3]],[+r[2],+t[2][1],+t[2][2],+t[2][3]],[+r[3],+t[3][1],+t[3][2],+t[3][3]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3]],[+t[1][0],+r[1],+t[1][2],+t[1][3]],[+t[2][0],+r[2],+t[2][2],+t[2][3]],[+t[3][0],+r[3],+t[3][2],+t[3][3]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3]],[+t[1][0],+t[1][1],+r[1],+t[1][3]],[+t[2][0],+t[2][1],+r[2],+t[2][3]],[+t[3][0],+t[3][1],+r[3],+t[3][3]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+r[3]]]),e(t)]}}function l(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4]],[+r[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4]],[+r[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4]],[+r[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4]],[+r[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3],+t[0][4]],[+t[1][0],+r[1],+t[1][2],+t[1][3],+t[1][4]],[+t[2][0],+r[2],+t[2][2],+t[2][3],+t[2][4]],[+t[3][0],+r[3],+t[3][2],+t[3][3],+t[3][4]],[+t[4][0],+r[4],+t[4][2],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3],+t[0][4]],[+t[1][0],+t[1][1],+r[1],+t[1][3],+t[1][4]],[+t[2][0],+t[2][1],+r[2],+t[2][3],+t[2][4]],[+t[3][0],+t[3][1],+r[3],+t[3][3],+t[3][4]],[+t[4][0],+t[4][1],+r[4],+t[4][3],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0],+t[0][4]],[+t[1][0],+t[1][1],+t[1][2],+r[1],+t[1][4]],[+t[2][0],+t[2][1],+t[2][2],+r[2],+t[2][4]],[+t[3][0],+t[3][1],+t[3][2],+r[3],+t[3][4]],[+t[4][0],+t[4][1],+t[4][2],+r[4],+t[4][4]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+r[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+r[4]]]),e(t)]}}function c(e){return function(t,r){return[e([[+r[0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+r[1],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+r[2],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+r[3],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+r[4],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+r[5],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+r[0],+t[0][2],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+r[1],+t[1][2],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+r[2],+t[2][2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+r[3],+t[3][2],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+r[4],+t[4][2],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+r[5],+t[5][2],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+r[0],+t[0][3],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+r[1],+t[1][3],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+r[2],+t[2][3],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+r[3],+t[3][3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+r[4],+t[4][3],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+r[5],+t[5][3],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+r[0],+t[0][4],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+r[1],+t[1][4],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+r[2],+t[2][4],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+r[3],+t[3][4],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+r[4],+t[4][4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+r[5],+t[5][4],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+r[0],+t[0][5]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+r[1],+t[1][5]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+r[2],+t[2][5]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+r[3],+t[3][5]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+r[4],+t[4][5]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+r[5],+t[5][5]]]),e([[+t[0][0],+t[0][1],+t[0][2],+t[0][3],+t[0][4],+r[0]],[+t[1][0],+t[1][1],+t[1][2],+t[1][3],+t[1][4],+r[1]],[+t[2][0],+t[2][1],+t[2][2],+t[2][3],+t[2][4],+r[2]],[+t[3][0],+t[3][1],+t[3][2],+t[3][3],+t[3][4],+r[3]],[+t[4][0],+t[4][1],+t[4][2],+t[4][3],+t[4][4],+r[4]],[+t[5][0],+t[5][1],+t[5][2],+t[5][3],+t[5][4],+r[5]]]),e(t)]}}var u=[function(){return[[0]]},function(e,t){return[[t[0]],[e[0][0]]]}];function h(e,t,r,n,i,a,o,s){return function(l,c){switch(l.length){case 0:return e(l,c);case 1:return t(l,c);case 2:return r(l,c);case 3:return n(l,c);case 4:return i(l,c);case 5:return a(l,c)}var u=o[l.length];return u||(u=o[l.length]=s(l.length)),u(l,c)}}!function(){for(;u.length<6;)u.push(i(u.length));e.exports=h.apply(void 0,u.concat([u,i]));for(var t=0;t<6;++t)e.exports[t]=u[t]}()},3250:function(e,t,r){var n=r(5250),i=r(8210),a=r(3012),o=r(8545);function s(e,t,r,n){return function(r,i,a){var o=e(e(t(i[1],a[0]),t(-a[1],i[0])),e(t(r[1],i[0]),t(-i[1],r[0]))),s=e(t(r[1],a[0]),t(-a[1],r[0])),l=n(o,s);return l[l.length-1]}}function l(e,t,r,n){return function(i,a,o,s){var l=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2])))),c=e(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2])))),u=n(l,c);return u[u.length-1]}}function c(e,t,r,n){return function(i,a,o,s,l){var c=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),a[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),-o[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),s[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),-l[3]),e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-s[2]),r(e(t(a[1],s[0]),t(-s[1],a[0])),l[2]))),i[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),-a[3])))),e(e(r(e(r(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),s[3]),e(r(e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),-l[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),a[2]),e(r(e(t(a[1],s[0]),t(-s[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),s[2]))),i[3]))),e(r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-a[3]),e(r(e(r(e(t(a[1],s[0]),t(-s[1],a[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),s[2]))),o[3]),r(e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-s[3]))))),u=e(e(e(r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),o[2]),e(r(e(t(o[1],l[0]),t(-l[1],o[0])),-s[2]),r(e(t(o[1],s[0]),t(-s[1],o[0])),l[2]))),i[3]),r(e(r(e(t(s[1],l[0]),t(-l[1],s[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-s[2]),r(e(t(i[1],s[0]),t(-s[1],i[0])),l[2]))),-o[3])),e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),s[3]),r(e(r(e(t(o[1],s[0]),t(-s[1],o[0])),i[2]),e(r(e(t(i[1],s[0]),t(-s[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),s[2]))),-l[3]))),e(e(r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),a[2]),e(r(e(t(a[1],l[0]),t(-l[1],a[0])),-o[2]),r(e(t(a[1],o[0]),t(-o[1],a[0])),l[2]))),i[3]),r(e(r(e(t(o[1],l[0]),t(-l[1],o[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-o[2]),r(e(t(i[1],o[0]),t(-o[1],i[0])),l[2]))),-a[3])),e(r(e(r(e(t(a[1],l[0]),t(-l[1],a[0])),i[2]),e(r(e(t(i[1],l[0]),t(-l[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),l[2]))),o[3]),r(e(r(e(t(a[1],o[0]),t(-o[1],a[0])),i[2]),e(r(e(t(i[1],o[0]),t(-o[1],i[0])),-a[2]),r(e(t(i[1],a[0]),t(-a[1],i[0])),o[2]))),-l[3])))),h=n(c,u);return h[h.length-1]}}function u(e){return(3===e?s:4===e?l:c)(i,n,a,o)}var h=u(3),p=u(4),d=[function(){return 0},function(){return 0},function(e,t){return t[0]-e[0]},function(e,t,r){var n,i=(e[1]-r[1])*(t[0]-r[0]),a=(e[0]-r[0])*(t[1]-r[1]),o=i-a;if(i>0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=33306690738754716e-32*n;return o>=s||o<=-s?o:h(e,t,r)},function(e,t,r,n){var i=e[0]-n[0],a=t[0]-n[0],o=r[0]-n[0],s=e[1]-n[1],l=t[1]-n[1],c=r[1]-n[1],u=e[2]-n[2],h=t[2]-n[2],d=r[2]-n[2],f=a*c,m=o*l,g=o*s,y=i*c,v=i*l,x=a*s,b=u*(f-m)+h*(g-y)+d*(v-x),_=7771561172376103e-31*((Math.abs(f)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(y))*Math.abs(h)+(Math.abs(v)+Math.abs(x))*Math.abs(d));return b>_||-b>_?b:p(e,t,r,n)}];function f(e){var t=d[e.length];return t||(t=d[e.length]=u(e.length)),t.apply(void 0,e)}function m(e,t,r,n,i,a,o){return function(t,r,s,l,c){switch(arguments.length){case 0:case 1:return 0;case 2:return n(t,r);case 3:return i(t,r,s);case 4:return a(t,r,s,l);case 5:return o(t,r,s,l,c)}for(var u=new Array(arguments.length),h=0;h<arguments.length;++h)u[h]=arguments[h];return e(u)}}!function(){for(;d.length<=5;)d.push(u(d.length));e.exports=m.apply(void 0,[f].concat(d));for(var t=0;t<=5;++t)e.exports[t]=d[t]}()},5382:function(e,t,r){var n=r(8210),i=r(3012);e.exports=function(e,t){if(1===e.length)return i(t,e[0]);if(1===t.length)return i(e,t[0]);if(0===e.length||0===t.length)return[0];var r=[0];if(e.length<t.length)for(var a=0;a<e.length;++a)r=n(r,i(t,e[a]));else for(a=0;a<t.length;++a)r=n(r,i(e,t[a]));return r}},3012:function(e,t,r){var n=r(5250),i=r(9362);e.exports=function(e,t){var r=e.length;if(1===r){var a=n(e[0],t);return a[0]?a:[a[1]]}var o=new Array(2*r),s=[.1,.1],l=[.1,.1],c=0;n(e[0],t,s),s[0]&&(o[c++]=s[0]);for(var u=1;u<r;++u){n(e[u],t,l);var h=s[1];i(h,l[0],s),s[0]&&(o[c++]=s[0]);var p=l[1],d=s[1],f=p+d,m=d-(f-p);s[1]=f,m&&(o[c++]=m)}return s[1]&&(o[c++]=s[1]),0===c&&(o[c++]=0),o.length=c,o}},1125:function(e,t,r){e.exports=function(e,t,r,i){var a=n(e,r,i),o=n(t,r,i);if(a>0&&o>0||a<0&&o<0)return!1;var s=n(r,e,t),l=n(i,e,t);return!(s>0&&l>0||s<0&&l<0)&&(0!==a||0!==o||0!==s||0!==l||function(e,t,r,n){for(var i=0;i<2;++i){var a=e[i],o=t[i],s=Math.min(a,o),l=Math.max(a,o),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)<s||l<h)return!1}return!0}(e,t,r,i))};var n=r(3250)[3]},8545:function(e){e.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,i=r-n,a=t-n,o=e-i,s=o+a;return s?[s,r]:[r]}(e[0],-t[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=e[l],p=u(h),d=-t[c],f=u(d);p<f?(a=h,(l+=1)<r&&(p=u(h=e[l]))):(a=d,(c+=1)<n&&(f=u(d=-t[c]))),l<r&&p<f||c>=n?(i=h,(l+=1)<r&&(p=u(h=e[l]))):(i=d,(c+=1)<n&&(f=u(d=-t[c])));for(var m,g,y=i+a,v=y-i,x=a-v,b=x,_=y;l<r&&c<n;)p<f?(i=h,(l+=1)<r&&(p=u(h=e[l]))):(i=d,(c+=1)<n&&(f=u(d=-t[c]))),(x=(a=b)-(v=(y=i+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(x=(a=b)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(h=e[l]);for(;c<n;)(x=(a=b)-(v=(y=(i=d)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(d=-t[c]);return b&&(o[s++]=b),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},8210:function(e){e.exports=function(e,t){var r=0|e.length,n=0|t.length;if(1===r&&1===n)return function(e,t){var r=e+t,n=r-e,i=r-n,a=t-n,o=e-i,s=o+a;return s?[s,r]:[r]}(e[0],t[0]);var i,a,o=new Array(r+n),s=0,l=0,c=0,u=Math.abs,h=e[l],p=u(h),d=t[c],f=u(d);p<f?(a=h,(l+=1)<r&&(p=u(h=e[l]))):(a=d,(c+=1)<n&&(f=u(d=t[c]))),l<r&&p<f||c>=n?(i=h,(l+=1)<r&&(p=u(h=e[l]))):(i=d,(c+=1)<n&&(f=u(d=t[c])));for(var m,g,y=i+a,v=y-i,x=a-v,b=x,_=y;l<r&&c<n;)p<f?(i=h,(l+=1)<r&&(p=u(h=e[l]))):(i=d,(c+=1)<n&&(f=u(d=t[c]))),(x=(a=b)-(v=(y=i+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m;for(;l<r;)(x=(a=b)-(v=(y=(i=h)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(l+=1)<r&&(h=e[l]);for(;c<n;)(x=(a=b)-(v=(y=(i=d)+a)-i))&&(o[s++]=x),b=_-((m=_+y)-(g=m-_))+(y-g),_=m,(c+=1)<n&&(d=t[c]);return b&&(o[s++]=b),_&&(o[s++]=_),s||(o[s++]=0),o.length=s,o}},9127:function(e,t,r){e.exports=function(e){return i(n(e))};var n=r(6204),i=r(5771)},7765:function(e,t,r){e.exports=function(e,t,r,s){if(r=r||0,"undefined"===typeof s&&(s=function(e){for(var t=e.length,r=0,n=0;n<t;++n)r=0|Math.max(r,e[n].length);return r-1}(e)),0===e.length||s<1)return{cells:[],vertexIds:[],vertexWeights:[]};var l=function(e,t){for(var r=e.length,n=i.mallocUint8(r),a=0;a<r;++a)n[a]=e[a]<t|0;return n}(t,+r),c=function(e,t){for(var r=e.length,o=t*(t+1)/2*r|0,s=i.mallocUint32(2*o),l=0,c=0;c<r;++c)for(var u=e[c],h=(t=u.length,0);h<t;++h)for(var p=0;p<h;++p){var d=u[p],f=u[h];s[l++]=0|Math.min(d,f),s[l++]=0|Math.max(d,f)}a(n(s,[l/2|0,2]));var m=2;for(c=2;c<l;c+=2)s[c-2]===s[c]&&s[c-1]===s[c+1]||(s[m++]=s[c],s[m++]=s[c+1]);return n(s,[m/2|0,2])}(e,s),u=function(e,t,r,a){for(var o=e.data,s=e.shape[0],l=i.mallocDouble(s),c=0,u=0;u<s;++u){var h=o[2*u],p=o[2*u+1];if(r[h]!==r[p]){var d=t[h],f=t[p];o[2*c]=h,o[2*c+1]=p,l[c++]=(f-a)/(f-d)}}return e.shape[0]=c,n(l,[c])}(c,t,l,+r),h=function(e,t){var r=i.mallocInt32(2*t),n=e.shape[0],a=e.data;r[0]=0;for(var o=0,s=0;s<n;++s){var l=a[2*s];if(l!==o){for(r[2*o+1]=s;++o<l;)r[2*o]=s,r[2*o+1]=s;r[2*o]=s}}for(r[2*o+1]=n;++o<t;)r[2*o]=r[2*o+1]=n;return r}(c,0|t.length),p=o(s)(e,c.data,h,l),d=function(e){for(var t=0|e.shape[0],r=e.data,n=new Array(t),i=0;i<t;++i)n[i]=[r[2*i],r[2*i+1]];return n}(c),f=[].slice.call(u.data,0,u.shape[0]);return i.free(l),i.free(c.data),i.free(u.data),i.free(h),{cells:p,vertexIds:d,vertexWeights:f}};var n=r(9618),i=r(1888),a=r(446),o=r(1570)},1570:function(e){e.exports=function(e){return t[e]()};var t=[function(){return function(e,t,r,n){for(var i=e.length,a=0;a<i;++a)e[a].length;return[]}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s];if(2===l.length){var c=(0|i[l[0]])+(i[l[1]]<<1);if(0===c||3===c)continue;switch(c){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s],c=l.length;if(3===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0===(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}},function(){function e(e,t,r,n){for(var i=0|Math.min(r,n),a=0|Math.max(r,n),o=e[2*i],s=e[2*i+1];o<s;){var l=o+s>>1,c=t[2*l+1];if(c===a)return l;a<c?s=l:o=l+1}return o}return function(t,r,n,i){for(var a=t.length,o=[],s=0;s<a;++s){var l=t[s],c=l.length;if(4===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2)+(i[l[3]]<<3))||15===u)continue;switch(u){case 0:case 15:break;case 1:o.push([e(n,r,l[0],l[1]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])]);break;case 2:o.push([e(n,r,l[1],l[2]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])]);break;case 3:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[0],l[3])],[e(n,r,l[1],l[3]),e(n,r,l[1],l[2]),e(n,r,l[0],l[3])]);break;case 4:o.push([e(n,r,l[2],l[0]),e(n,r,l[2],l[1]),e(n,r,l[2],l[3])]);break;case 5:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[0],l[3])],[e(n,r,l[2],l[1]),e(n,r,l[2],l[3]),e(n,r,l[0],l[3])]);break;case 6:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[1],l[3])],[e(n,r,l[2],l[3]),e(n,r,l[2],l[0]),e(n,r,l[1],l[3])]);break;case 7:o.push([e(n,r,l[0],l[3]),e(n,r,l[1],l[3]),e(n,r,l[2],l[3])]);break;case 8:o.push([e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[3],l[2])]);break;case 9:o.push([e(n,r,l[3],l[1]),e(n,r,l[0],l[1]),e(n,r,l[0],l[2])],[e(n,r,l[3],l[2]),e(n,r,l[3],l[1]),e(n,r,l[0],l[2])]);break;case 10:o.push([e(n,r,l[1],l[0]),e(n,r,l[3],l[0]),e(n,r,l[1],l[2])],[e(n,r,l[3],l[0]),e(n,r,l[3],l[2]),e(n,r,l[1],l[2])]);break;case 11:o.push([e(n,r,l[1],l[2]),e(n,r,l[0],l[2]),e(n,r,l[3],l[2])]);break;case 12:o.push([e(n,r,l[3],l[0]),e(n,r,l[2],l[0]),e(n,r,l[2],l[1])],[e(n,r,l[3],l[1]),e(n,r,l[3],l[0]),e(n,r,l[2],l[1])]);break;case 13:o.push([e(n,r,l[0],l[1]),e(n,r,l[2],l[1]),e(n,r,l[3],l[1])]);break;case 14:o.push([e(n,r,l[2],l[0]),e(n,r,l[1],l[0]),e(n,r,l[3],l[0])])}}else if(3===c){if(0===(u=(0|i[l[0]])+(i[l[1]]<<1)+(i[l[2]]<<2))||7===u)continue;switch(u){case 0:case 7:break;case 1:o.push([e(n,r,l[0],l[2]),e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0]),e(n,r,l[1],l[2])]);break;case 3:o.push([e(n,r,l[0],l[2]),e(n,r,l[1],l[2])]);break;case 4:o.push([e(n,r,l[2],l[1]),e(n,r,l[2],l[0])]);break;case 5:o.push([e(n,r,l[2],l[1]),e(n,r,l[0],l[1])]);break;case 6:o.push([e(n,r,l[1],l[0]),e(n,r,l[2],l[0])])}}else if(2===c){var u;if(0===(u=(0|i[l[0]])+(i[l[1]]<<1))||3===u)continue;switch(u){case 0:case 3:break;case 1:o.push([e(n,r,l[0],l[1])]);break;case 2:o.push([e(n,r,l[1],l[0])])}}}return o}}]},6803:function(e,t,r){r(8828),r(1755);function n(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),c=i(t[0],t[1]);return(s=i(l,e[2])-i(c,t[2]))||i(l+e[2],a)-i(c+t[2],o);default:var u=e.slice(0);u.sort();var h=t.slice(0);h.sort();for(var p=0;p<r;++p)if(n=u[p]-h[p])return n;return 0}}t.Fw=n},3105:function(e,t){function r(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}t.INT_BITS=32,t.INT_MAX=2147483647,t.INT_MIN=-1<<31,t.sign=function(e){return(e>0)-(e<0)},t.abs=function(e){var t=e>>31;return(e^t)-t},t.min=function(e,t){return t^(e^t)&-(e<t)},t.max=function(e,t){return e^(e^t)&-(e<t)},t.isPow2=function(e){return!(e&e-1)&&!!e},t.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},t.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},t.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},t.countTrailingZeros=r,t.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},t.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}}(n),t.reverse=function(e){return n[255&e]<<24|n[e>>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},t.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},t.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},t.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},t.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},t.nextCombination=function(e){var t=e|e-1;return t+1|(~t&-~t)-1>>>r(e)+1}},2014:function(e,t,r){var n=r(3105),i=r(4623);function a(e,t){var r=e.length,n=e.length-t.length,i=Math.min;if(n)return n;switch(r){case 0:return 0;case 1:return e[0]-t[0];case 2:return(s=e[0]+e[1]-t[0]-t[1])||i(e[0],e[1])-i(t[0],t[1]);case 3:var a=e[0]+e[1],o=t[0]+t[1];if(s=a+e[2]-(o+t[2]))return s;var s,l=i(e[0],e[1]),c=i(t[0],t[1]);return(s=i(l,e[2])-i(c,t[2]))||i(l+e[2],a)-i(c+t[2],o);default:var u=e.slice(0);u.sort();var h=t.slice(0);h.sort();for(var p=0;p<r;++p)if(n=u[p]-h[p])return n;return 0}}function o(e,t){return a(e[0],t[0])}function s(e,t){if(t){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=[e[i],t[i]];for(n.sort(o),i=0;i<r;++i)e[i]=n[i][0],t[i]=n[i][1];return e}return e.sort(a),e}function l(e){if(0===e.length)return[];for(var t=1,r=e.length,n=1;n<r;++n){var i=e[n];if(a(i,e[n-1])){if(n===t){t++;continue}e[t++]=i}}return e.length=t,e}function c(e,t){for(var r=0,n=e.length-1,i=-1;r<=n;){var o=r+n>>1,s=a(e[o],t);s<=0?(0===s&&(i=o),r=o+1):s>0&&(n=o-1)}return i}function u(e,t){for(var r=new Array(e.length),i=0,o=r.length;i<o;++i)r[i]=[];for(var s=[],l=(i=0,t.length);i<l;++i)for(var u=t[i],h=u.length,p=1,d=1<<h;p<d;++p){s.length=n.popCount(p);for(var f=0,m=0;m<h;++m)p&1<<m&&(s[f++]=u[m]);var g=c(e,s);if(!(g<0))for(;r[g++].push(i),!(g>=e.length||0!==a(e[g],s)););}return r}function h(e,t){if(t<0)return[];for(var r=[],i=(1<<t+1)-1,a=0;a<e.length;++a)for(var o=e[a],l=i;l<1<<o.length;l=n.nextCombination(l)){for(var c=new Array(t+1),u=0,h=0;h<o.length;++h)l&1<<h&&(c[u++]=o[h]);r.push(c)}return s(r)}t.dimension=function(e){for(var t=0,r=Math.max,n=0,i=e.length;n<i;++n)t=r(t,e[n].length);return t-1},t.countVertices=function(e){for(var t=-1,r=Math.max,n=0,i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o)t=r(t,a[o]);return t+1},t.cloneCells=function(e){for(var t=new Array(e.length),r=0,n=e.length;r<n;++r)t[r]=e[r].slice(0);return t},t.compareCells=a,t.normalize=s,t.unique=l,t.findCell=c,t.incidence=u,t.dual=function(e,t){if(!t)return u(l(h(e,0)),e);for(var r=new Array(t),n=0;n<t;++n)r[n]=[];n=0;for(var i=e.length;n<i;++n)for(var a=e[n],o=0,s=a.length;o<s;++o)r[a[o]].push(n);return r},t.explode=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0|i.length,o=1,l=1<<a;o<l;++o){for(var c=[],u=0;u<a;++u)o>>>u&1&&c.push(i[u]);t.push(c)}return s(t)},t.skeleton=h,t.boundary=function(e){for(var t=[],r=0,n=e.length;r<n;++r)for(var i=e[r],a=0,o=i.length;a<o;++a){for(var l=new Array(i.length-1),c=0,u=0;c<o;++c)c!==a&&(l[u++]=i[c]);t.push(l)}return s(t)},t.connectedComponents=function(e,t){return t?function(e,t){for(var r=new i(t),n=0;n<e.length;++n)for(var a=e[n],o=0;o<a.length;++o)for(var s=o+1;s<a.length;++s)r.link(a[o],a[s]);var l=[],c=r.ranks;for(n=0;n<c.length;++n)c[n]=-1;for(n=0;n<e.length;++n){var u=r.find(e[n][0]);c[u]<0?(c[u]=l.length,l.push([e[n].slice(0)])):l[c[u]].push(e[n].slice(0))}return l}(e,t):function(e){for(var t=l(s(h(e,0))),r=new i(t.length),n=0;n<e.length;++n)for(var a=e[n],o=0;o<a.length;++o)for(var u=c(t,[a[o]]),p=o+1;p<a.length;++p)r.link(u,c(t,[a[p]]));var d=[],f=r.ranks;for(n=0;n<f.length;++n)f[n]=-1;for(n=0;n<e.length;++n){var m=r.find(c(t,[e[n][0]]));f[m]<0?(f[m]=d.length,d.push([e[n].slice(0)])):d[f[m]].push(e[n].slice(0))}return d}(e)}},4623:function(e){function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}e.exports=t,t.prototype.length=function(){return this.roots.length},t.prototype.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},t.prototype.find=function(e){for(var t=this.roots;t[e]!==e;){var r=t[e];t[e]=t[r],e=r}return e},t.prototype.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},5878:function(e,t,r){e.exports=function(e,t,r){for(var a=t.length,o=e.length,s=new Array(a),l=new Array(a),c=new Array(a),u=new Array(a),h=0;h<a;++h)s[h]=l[h]=-1,c[h]=1/0,u[h]=!1;for(h=0;h<o;++h){var p=e[h];if(2!==p.length)throw new Error("Input must be a graph");var d=p[1],f=p[0];-1!==l[f]?l[f]=-2:l[f]=d,-1!==s[d]?s[d]=-2:s[d]=f}function m(e){if(u[e])return 1/0;var r=s[e],i=l[e];return r<0||i<0?1/0:function(e,t,r){var i=Math.abs(n(e,t,r)),a=Math.sqrt(Math.pow(t[0]-r[0],2)+Math.pow(t[1]-r[1],2));return i/a}(t[e],t[r],t[i])}function g(e,t){var r=T[e],n=T[t];T[e]=n,T[t]=r,S[r]=t,S[n]=e}function y(e){return c[T[e]]}function v(e){return 1&e?e-1>>1:(e>>1)-1}function x(e){for(var t=y(e);;){var r=t,n=2*e+1,i=2*(e+1),a=e;if(n<A){var o=y(n);o<r&&(a=n,r=o)}if(i<A&&y(i)<r&&(a=i),a===e)return e;g(e,a),e=a}}function b(e){for(var t=y(e);e>0;){var r=v(e);if(!(r>=0&&t<y(r)))return e;g(e,r),e=r}}function _(){if(A>0){var e=T[0];return g(0,A-1),A-=1,x(0),e}return-1}function w(e,t){var r=T[e];return c[r]===t?e:(c[r]=-1/0,b(e),_(),c[r]=t,b((A+=1)-1))}function k(e){if(!u[e]){u[e]=!0;var t=s[e],r=l[e];s[r]>=0&&(s[r]=t),l[t]>=0&&(l[t]=r),S[t]>=0&&w(S[t],m(t)),S[r]>=0&&w(S[r],m(r))}}var T=[],S=new Array(a);for(h=0;h<a;++h)(c[h]=m(h))<1/0?(S[h]=T.length,T.push(h)):S[h]=-1;var A=T.length;for(h=A>>1;h>=0;--h)x(h);for(;;){var M=_();if(M<0||c[M]>r)break;k(M)}var E=[];for(h=0;h<a;++h)u[h]||(S[h]=E.length,E.push(t[h].slice()));function C(e,t){if(e[t]<0)return t;var r=t,n=t;do{var i=e[n];if(!u[n]||i<0||i===n)break;if(i=e[n=i],!u[n]||i<0||i===n)break;n=i,r=e[r]}while(r!==n);for(var a=t;a!==n;a=e[a])e[a]=n;return n}E.length;var P=[];return e.forEach((function(e){var t=C(s,e[0]),r=C(l,e[1]);if(t>=0&&r>=0&&t!==r){var n=S[t],i=S[r];n!==i&&P.push([n,i])}})),i.unique(i.normalize(P)),{positions:E,edges:P}};var n=r(3250),i=r(2014)},1303:function(e,t,r){e.exports=function(e,t){var r,a,o,s;if(t[0][0]<t[1][0])r=t[0],a=t[1];else{if(!(t[0][0]>t[1][0]))return i(t,e);r=t[1],a=t[0]}if(e[0][0]<e[1][0])o=e[0],s=e[1];else{if(!(e[0][0]>e[1][0]))return-i(e,t);o=e[1],s=e[0]}var l=n(r,a,s),c=n(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=n(s,o,a),c=n(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var n=r(3250);function i(e,t){var r,i,a,o;if(t[0][0]<t[1][0])r=t[0],i=t[1];else{if(!(t[0][0]>t[1][0])){var s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]),c=Math.min(t[0][1],t[1][1]),u=Math.max(t[0][1],t[1][1]);return l<c?l-c:s>u?s-u:l-u}r=t[1],i=t[0]}e[0][1]<e[1][1]?(a=e[0],o=e[1]):(a=e[1],o=e[0]);var h=n(i,r,a);return h||(h=n(i,r,o))||o-i}},4209:function(e,t,r){e.exports=function(e){for(var t=e.length,r=2*t,n=new Array(r),a=0;a<t;++a){var l=e[a],c=l[0][0]<l[1][0];n[2*a]=new h(l[0][0],l,c,a),n[2*a+1]=new h(l[1][0],l,!c,a)}n.sort((function(e,t){var r=e.x-t.x;return r||(r=e.create-t.create)||Math.min(e.segment[0][1],e.segment[1][1])-Math.min(t.segment[0][1],t.segment[1][1])}));var p=i(o),d=[],f=[],m=[];for(a=0;a<r;){for(var g=n[a].x,y=[];a<r;){var v=n[a];if(v.x!==g)break;a+=1,v.segment[0][0]===v.x&&v.segment[1][0]===v.x?v.create&&(v.segment[0][1]<v.segment[1][1]?(y.push(new u(v.segment[0][1],v.index,!0,!0)),y.push(new u(v.segment[1][1],v.index,!1,!1))):(y.push(new u(v.segment[1][1],v.index,!0,!1)),y.push(new u(v.segment[0][1],v.index,!1,!0)))):p=v.create?p.insert(v.segment,v.index):p.remove(v.segment)}d.push(p.root),f.push(g),m.push(y)}return new s(d,f,m)};var n=r(2478),i=r(3840),a=r(3250),o=r(1303);function s(e,t,r){this.slabs=e,this.coordinates=t,this.horizontal=r}function l(e,t){return e.y-t}function c(e,t){for(var r=null;e;){var n,i,o=e.key;o[0][0]<o[1][0]?(n=o[0],i=o[1]):(n=o[1],i=o[0]);var s=a(n,i,t);if(s<0)e=e.left;else if(s>0)if(t[0]!==o[1][0])r=e,e=e.right;else{if(l=c(e.right,t))return l;e=e.left}else{if(t[0]!==o[1][0])return e;var l;if(l=c(e.right,t))return l;e=e.left}}return r}function u(e,t,r,n){this.y=e,this.index=t,this.start=r,this.closed=n}function h(e,t,r,n){this.x=e,this.segment=t,this.create=r,this.index=n}s.prototype.castUp=function(e){var t=n.le(this.coordinates,e[0]);if(t<0)return-1;this.slabs[t];var r=c(this.slabs[t],e),i=-1;if(r&&(i=r.value),this.coordinates[t]===e[0]){var s=null;if(r&&(s=r.key),t>0){var u=c(this.slabs[t-1],e);u&&(s?o(u.key,s)>0&&(s=u.key,i=u.value):(i=u.value,s=u.key))}var h=this.horizontal[t];if(h.length>0){var p=n.ge(h,e[1],l);if(p<h.length){var d=h[p];if(e[1]===d.y){if(d.closed)return d.index;for(;p<h.length-1&&h[p+1].y===e[1];)if((d=h[p+=1]).closed)return d.index;if(d.y===e[1]&&!d.start){if((p+=1)>=h.length)return i;d=h[p]}}if(d.start)if(s){var f=a(s[0],s[1],[e[0],d.y]);s[0][0]>s[1][0]&&(f=-f),f>0&&(i=d.index)}else i=d.index;else d.y!==e[1]&&(i=d.index)}}}return i}},5202:function(e,t,r){var n=r(1944),i=r(8210);function a(e,t){var r=i(n(e,t),[t[t.length-1]]);return r[r.length-1]}function o(e,t,r,n){var i=-t/(n-t);i<0?i=0:i>1&&(i=1);for(var a=1-i,o=e.length,s=new Array(o),l=0;l<o;++l)s[l]=i*e[l]+a*r[l];return s}e.exports=function(e,t){for(var r=[],n=[],i=a(e[e.length-1],t),s=e[e.length-1],l=e[0],c=0;c<e.length;++c,s=l){var u=a(l=e[c],t);if(i<0&&u>0||i>0&&u<0){var h=o(s,u,l,i);r.push(h),n.push(h.slice())}u<0?n.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),n.push(l.slice())),i=u}return{positive:r,negative:n}},e.exports.positive=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l<e.length;++l,i=s){var c=a(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c>=0&&r.push(s.slice()),n=c}return r},e.exports.negative=function(e,t){for(var r=[],n=a(e[e.length-1],t),i=e[e.length-1],s=e[0],l=0;l<e.length;++l,i=s){var c=a(s=e[l],t);(n<0&&c>0||n>0&&c<0)&&r.push(o(i,c,s,n)),c<=0&&r.push(s.slice()),n=c}return r}},3387:function(e,t,r){var n;!function(){var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(e){return function(e,t){var r,n,o,s,l,c,u,h,p,d=1,f=e.length,m="";for(n=0;n<f;n++)if("string"===typeof e[n])m+=e[n];else if("object"===typeof e[n]){if((s=e[n]).keys)for(r=t[d],o=0;o<s.keys.length;o++){if(void 0==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?t[s.param_no]:t[d++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!==typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(h=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?m+=r:(!i.number.test(s.type)||h&&!s.sign?p="":(p=h?"+":"-",r=r.toString().replace(i.sign,"")),c=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",u=s.width-(p+r).length,l=s.width&&u>0?c.repeat(u):"",m+=s.align?p+r+l:"0"===c?p+l+r:l+p+r)}return m}(function(e){if(s[e])return s[e];for(var t,r=e,n=[],a=0;r;){if(null!==(t=i.text.exec(r)))n.push(t[0]);else if(null!==(t=i.modulo.exec(r)))n.push("%");else{if(null===(t=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){a|=1;var o=[],l=t[2],c=[];if(null===(c=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=i.key_access.exec(l)))o.push(c[1]);else{if(null===(c=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(c[1])}t[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}r=r.substring(t[0].length)}return s[e]=n}(e),arguments)}function o(e,t){return a.apply(null,[e].concat(t||[]))}var s=Object.create(null);t.sprintf=a,t.vsprintf=o,"undefined"!==typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(t,r,t,e))||(e.exports=n))}()},3711:function(e,t,r){e.exports=function(e,t){if(e.dimension<=0)return{positions:[],cells:[]};if(1===e.dimension)return function(e,t){for(var r=i(e,t),n=r.length,a=new Array(n),o=new Array(n),s=0;s<n;++s)a[s]=[r[s]],o[s]=[s];return{positions:a,cells:o}}(e,t);var r=e.order.join()+"-"+e.dtype,s=o[r];return t=+t||0,s||(s=o[r]=function(e,t){var r=e.length+"d",i=a[r];if(i)return i(n,e,t)}(e.order,e.dtype)),s(e,t)};var n=r(2640),i=r(781),a={"2d":function(e,t,r){var n=e({order:t,scalarArguments:3,getters:"generic"===r?[0]:void 0,phase:function(e,t,r,n){return e>n|0},vertex:function(e,t,r,n,i,a,o,s,l,c,u,h,p){var d=(0|o)+(s<<1)+(l<<2)+(c<<3)|0;if(0!==d&&15!==d)switch(d){case 0:case 15:u.push([e-.5,t-.5]);break;case 1:u.push([e-.25-.25*(n+r-2*p)/(r-n),t-.25-.25*(i+r-2*p)/(r-i)]);break;case 2:u.push([e-.75-.25*(-n-r+2*p)/(n-r),t-.25-.25*(a+n-2*p)/(n-a)]);break;case 3:u.push([e-.5,t-.5-.5*(i+r+a+n-4*p)/(r-i+n-a)]);break;case 4:u.push([e-.25-.25*(a+i-2*p)/(i-a),t-.75-.25*(-i-r+2*p)/(i-r)]);break;case 5:u.push([e-.5-.5*(n+r+a+i-4*p)/(r-n+i-a),t-.5]);break;case 6:u.push([e-.5-.25*(-n-r+a+i)/(n-r+i-a),t-.5-.25*(-i-r+a+n)/(i-r+n-a)]);break;case 7:u.push([e-.75-.25*(a+i-2*p)/(i-a),t-.75-.25*(a+n-2*p)/(n-a)]);break;case 8:u.push([e-.75-.25*(-a-i+2*p)/(a-i),t-.75-.25*(-a-n+2*p)/(a-n)]);break;case 9:u.push([e-.5-.25*(n+r+-a-i)/(r-n+a-i),t-.5-.25*(i+r+-a-n)/(r-i+a-n)]);break;case 10:u.push([e-.5-.5*(-n-r-a-i+4*p)/(n-r+a-i),t-.5]);break;case 11:u.push([e-.25-.25*(-a-i+2*p)/(a-i),t-.75-.25*(i+r-2*p)/(r-i)]);break;case 12:u.push([e-.5,t-.5-.5*(-i-r-a-n+4*p)/(i-r+a-n)]);break;case 13:u.push([e-.75-.25*(n+r-2*p)/(r-n),t-.25-.25*(-a-n+2*p)/(a-n)]);break;case 14:u.push([e-.25-.25*(-n-r+2*p)/(n-r),t-.25-.25*(-i-r+2*p)/(i-r)])}},cell:function(e,t,r,n,i,a,o,s,l){i?s.push([e,t]):s.push([t,e])}});return function(e,t){var r=[],i=[];return n(e,r,i,t),{positions:r,cells:i}}}},o={}},665:function(e,t,r){var n=r(3202);e.exports=o;var i=96;function a(e,t){var r=n(getComputedStyle(e).getPropertyValue(t));return r[0]*o(r[1],e)}function o(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var n=a(r,"font-size")/128;return t.removeChild(r),n}(e,t);case"em":return a(t,"font-size");case"rem":return a(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return i;case"cm":return i/2.54;case"mm":return i/25.4;case"pt":return i/72;case"pc":return i/6}return 1}},7261:function(e,t,r){e.exports=function(e){var t=(e=e||{}).center||[0,0,0],r=e.up||[0,1,0],n=e.right||h(r),i=e.radius||1,a=e.theta||0,u=e.phi||0;if(t=[].slice.call(t,0,3),r=[].slice.call(r,0,3),s(r,r),n=[].slice.call(n,0,3),s(n,n),"eye"in e){var d=e.eye,f=[d[0]-t[0],d[1]-t[1],d[2]-t[2]];o(n,f,r),c(n[0],n[1],n[2])<1e-6?n=h(r):s(n,n),i=c(f[0],f[1],f[2]);var m=l(r,f)/i,g=l(n,f)/i;u=Math.acos(m),a=Math.acos(g)}return i=Math.log(i),new p(e.zoomMin,e.zoomMax,t,r,n,i,a,u)};var n=r(9215),i=r(7608),a=r(6079),o=r(5911),s=r(3536),l=r(244);function c(e,t,r){return Math.sqrt(Math.pow(e,2)+Math.pow(t,2)+Math.pow(r,2))}function u(e){return Math.min(1,Math.max(-1,e))}function h(e){var t=Math.abs(e[0]),r=Math.abs(e[1]),n=Math.abs(e[2]),i=[0,0,0];t>Math.max(r,n)?i[2]=1:r>Math.max(t,n)?i[0]=1:i[1]=1;for(var a=0,o=0,l=0;l<3;++l)a+=e[l]*e[l],o+=i[l]*e[l];for(l=0;l<3;++l)i[l]-=o/a*e[l];return s(i,i),i}function p(e,t,r,i,a,o,s,l){this.center=n(r),this.up=n(i),this.right=n(a),this.radius=n([o]),this.angle=n([s,l]),this.angle.bounds=[[-1/0,-Math.PI/2],[1/0,Math.PI/2]],this.setDistanceLimits(e,t),this.computedCenter=this.center.curve(0),this.computedUp=this.up.curve(0),this.computedRight=this.right.curve(0),this.computedRadius=this.radius.curve(0),this.computedAngle=this.angle.curve(0),this.computedToward=[0,0,0],this.computedEye=[0,0,0],this.computedMatrix=new Array(16);for(var c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}var d=p.prototype;d.setDistanceLimits=function(e,t){e=e>0?Math.log(e):-1/0,t=t>0?Math.log(t):1/0,t=Math.max(t,e),this.radius.bounds[0][0]=e,this.radius.bounds[1][0]=t},d.getDistanceLimits=function(e){var t=this.radius.bounds[0];return e?(e[0]=Math.exp(t[0][0]),e[1]=Math.exp(t[1][0]),e):[Math.exp(t[0][0]),Math.exp(t[1][0])]},d.recalcMatrix=function(e){this.center.curve(e),this.up.curve(e),this.right.curve(e),this.radius.curve(e),this.angle.curve(e);for(var t=this.computedUp,r=this.computedRight,n=0,i=0,a=0;a<3;++a)i+=t[a]*r[a],n+=t[a]*t[a];var l=Math.sqrt(n),u=0;for(a=0;a<3;++a)r[a]-=t[a]*i/n,u+=r[a]*r[a],t[a]/=l;var h=Math.sqrt(u);for(a=0;a<3;++a)r[a]/=h;var p=this.computedToward;o(p,t,r),s(p,p);var d=Math.exp(this.computedRadius[0]),f=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(f),y=Math.sin(f),v=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*v,w=y*v,k=x,T=-g*x,S=-y*x,A=v,M=this.computedEye,E=this.computedMatrix;for(a=0;a<3;++a){var C=_*r[a]+w*p[a]+k*t[a];E[4*a+1]=T*r[a]+S*p[a]+A*t[a],E[4*a+2]=C,E[4*a+3]=0}var P=E[1],L=E[5],I=E[9],z=E[2],O=E[6],R=E[10],D=L*R-I*O,j=I*z-P*R,F=P*O-L*z,B=c(D,j,F);for(D/=B,j/=B,F/=B,E[0]=D,E[4]=j,E[8]=F,a=0;a<3;++a)M[a]=b[a]+E[2+4*a]*d;for(a=0;a<3;++a){u=0;for(var N=0;N<3;++N)u+=E[a+4*N]*M[N];E[12+a]=-u}E[15]=1},d.getMatrix=function(e,t){this.recalcMatrix(e);var r=this.computedMatrix;if(t){for(var n=0;n<16;++n)t[n]=r[n];return t}return r};var f=[0,0,0];d.rotate=function(e,t,r,n){if(this.angle.move(e,t,r),n){this.recalcMatrix(e);var i=this.computedMatrix;f[0]=i[2],f[1]=i[6],f[2]=i[10];for(var o=this.computedUp,s=this.computedRight,l=this.computedToward,c=0;c<3;++c)i[4*c]=o[c],i[4*c+1]=s[c],i[4*c+2]=l[c];for(a(i,i,n,f),c=0;c<3;++c)o[c]=i[4*c],s[c]=i[4*c+1];this.up.set(e,o[0],o[1],o[2]),this.right.set(e,s[0],s[1],s[2])}},d.pan=function(e,t,r,n){t=t||0,r=r||0,n=n||0,this.recalcMatrix(e);var i=this.computedMatrix,a=(Math.exp(this.computedRadius[0]),i[1]),o=i[5],s=i[9],l=c(a,o,s);a/=l,o/=l,s/=l;var u=i[0],h=i[4],p=i[8],d=u*a+h*o+p*s,f=c(u-=a*d,h-=o*d,p-=s*d),m=(u/=f)*t+a*r,g=(h/=f)*t+o*r,y=(p/=f)*t+s*r;this.center.move(e,m,g,y);var v=Math.exp(this.computedRadius[0]);v=Math.max(1e-4,v+n),this.radius.set(e,Math.log(v))},d.translate=function(e,t,r,n){this.center.move(e,t||0,r||0,n||0)},d.setMatrix=function(e,t,r,n){var a=1;"number"===typeof r&&(a=0|r),(a<0||a>3)&&(a=1);var o=(a+2)%3;t||(this.recalcMatrix(e),t=this.computedMatrix);var s=t[a],l=t[a+4],h=t[a+8];if(n){var p=Math.abs(s),d=Math.abs(l),f=Math.abs(h),m=Math.max(p,d,f);p===m?(s=s<0?-1:1,l=h=0):f===m?(h=h<0?-1:1,s=l=0):(l=l<0?-1:1,s=h=0)}else{var g=c(s,l,h);s/=g,l/=g,h/=g}var y,v,x=t[o],b=t[o+4],_=t[o+8],w=x*s+b*l+_*h,k=c(x-=s*w,b-=l*w,_-=h*w),T=l*(_/=k)-h*(b/=k),S=h*(x/=k)-s*_,A=s*b-l*x,M=c(T,S,A);if(T/=M,S/=M,A/=M,this.center.jump(e,H,G,W),this.radius.idle(e),this.up.jump(e,s,l,h),this.right.jump(e,x,b,_),2===a){var E=t[1],C=t[5],P=t[9],L=E*x+C*b+P*_,I=E*T+C*S+P*A;y=D<0?-Math.PI/2:Math.PI/2,v=Math.atan2(I,L)}else{var z=t[2],O=t[6],R=t[10],D=z*s+O*l+R*h,j=z*x+O*b+R*_,F=z*T+O*S+R*A;y=Math.asin(u(D)),v=Math.atan2(F,j)}this.angle.jump(e,v,y),this.recalcMatrix(e);var B=t[2],N=t[6],U=t[10],V=this.computedMatrix;i(V,t);var q=V[15],H=V[12]/q,G=V[13]/q,W=V[14]/q,$=Math.exp(this.computedRadius[0]);this.center.jump(e,H-B*$,G-N*$,W-U*$)},d.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},d.idle=function(e){this.center.idle(e),this.up.idle(e),this.right.idle(e),this.radius.idle(e),this.angle.idle(e)},d.flush=function(e){this.center.flush(e),this.up.flush(e),this.right.flush(e),this.radius.flush(e),this.angle.flush(e)},d.setDistance=function(e,t){t>0&&this.radius.set(e,Math.log(t))},d.lookAt=function(e,t,r,n){this.recalcMatrix(e),t=t||this.computedEye,r=r||this.computedCenter;var i=(n=n||this.computedUp)[0],a=n[1],o=n[2],s=c(i,a,o);if(!(s<1e-6)){i/=s,a/=s,o/=s;var l=t[0]-r[0],h=t[1]-r[1],p=t[2]-r[2],d=c(l,h,p);if(!(d<1e-6)){l/=d,h/=d,p/=d;var f=this.computedRight,m=f[0],g=f[1],y=f[2],v=i*m+a*g+o*y,x=c(m-=v*i,g-=v*a,y-=v*o);if(!(x<.01&&(x=c(m=a*p-o*h,g=o*l-i*p,y=i*h-a*l))<1e-6)){m/=x,g/=x,y/=x,this.up.set(e,i,a,o),this.right.set(e,m,g,y),this.center.set(e,r[0],r[1],r[2]),this.radius.set(e,Math.log(d));var b=a*y-o*g,_=o*m-i*y,w=i*g-a*m,k=c(b,_,w),T=i*l+a*h+o*p,S=m*l+g*h+y*p,A=(b/=k)*l+(_/=k)*h+(w/=k)*p,M=Math.asin(u(T)),E=Math.atan2(A,S),C=this.angle._state,P=C[C.length-1],L=C[C.length-2];P%=2*Math.PI;var I=Math.abs(P+2*Math.PI-E),z=Math.abs(P-E),O=Math.abs(P-2*Math.PI-E);I<z&&(P+=2*Math.PI),O<z&&(P-=2*Math.PI),this.angle.jump(this.angle.lastT(),P,L),this.angle.set(e,E,M)}}}}},5250:function(e){e.exports=function(e,r,n){var i=e*r,a=t*e,o=a-(a-e),s=e-o,l=t*r,c=l-(l-r),u=r-c,h=s*u-(i-o*c-s*c-o*u);return n?(n[0]=h,n[1]=i,n):[h,i]};var t=+(Math.pow(2,27)+1)},9362:function(e){e.exports=function(e,t,r){var n=e+t,i=n-e,a=t-i,o=e-(n-i);return r?(r[0]=o+a,r[1]=n,r):[o+a,n]}},1888:function(e,t,r){var n=r(8828),i=r(1338),a=r(4793).hp;r.g.__TYPEDARRAY_POOL||(r.g.__TYPEDARRAY_POOL={UINT8:i([32,0]),UINT16:i([32,0]),UINT32:i([32,0]),BIGUINT64:i([32,0]),INT8:i([32,0]),INT16:i([32,0]),INT32:i([32,0]),BIGINT64:i([32,0]),FLOAT:i([32,0]),DOUBLE:i([32,0]),DATA:i([32,0]),UINT8C:i([32,0]),BUFFER:i([32,0])});var o="undefined"!==typeof Uint8ClampedArray,s="undefined"!==typeof BigUint64Array,l="undefined"!==typeof BigInt64Array,c=r.g.__TYPEDARRAY_POOL;c.UINT8C||(c.UINT8C=i([32,0])),c.BIGUINT64||(c.BIGUINT64=i([32,0])),c.BIGINT64||(c.BIGINT64=i([32,0])),c.BUFFER||(c.BUFFER=i([32,0]));var u=c.DATA,h=c.BUFFER;function p(e){if(e){var t=e.length||e.byteLength,r=n.log2(t);u[r].push(e)}}function d(e){e=n.nextPow2(e);var t=n.log2(e),r=u[t];return r.length>0?r.pop():new ArrayBuffer(e)}function f(e){return new Uint8Array(d(e),0,e)}function m(e){return new Uint16Array(d(2*e),0,e)}function g(e){return new Uint32Array(d(4*e),0,e)}function y(e){return new Int8Array(d(e),0,e)}function v(e){return new Int16Array(d(2*e),0,e)}function x(e){return new Int32Array(d(4*e),0,e)}function b(e){return new Float32Array(d(4*e),0,e)}function _(e){return new Float64Array(d(8*e),0,e)}function w(e){return o?new Uint8ClampedArray(d(e),0,e):f(e)}function k(e){return s?new BigUint64Array(d(8*e),0,e):null}function T(e){return l?new BigInt64Array(d(8*e),0,e):null}function S(e){return new DataView(d(e),0,e)}function A(e){e=n.nextPow2(e);var t=n.log2(e),r=h[t];return r.length>0?r.pop():new a(e)}t.free=function(e){if(a.isBuffer(e))h[n.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var t=e.length||e.byteLength,r=0|n.log2(t);u[r].push(e)}},t.freeUint8=t.freeUint16=t.freeUint32=t.freeBigUint64=t.freeInt8=t.freeInt16=t.freeInt32=t.freeBigInt64=t.freeFloat32=t.freeFloat=t.freeFloat64=t.freeDouble=t.freeUint8Clamped=t.freeDataView=function(e){p(e.buffer)},t.freeArrayBuffer=p,t.freeBuffer=function(e){h[n.log2(e.length)].push(e)},t.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return d(e);switch(t){case"uint8":return f(e);case"uint16":return m(e);case"uint32":return g(e);case"int8":return y(e);case"int16":return v(e);case"int32":return x(e);case"float":case"float32":return b(e);case"double":case"float64":return _(e);case"uint8_clamped":return w(e);case"bigint64":return T(e);case"biguint64":return k(e);case"buffer":return A(e);case"data":case"dataview":return S(e);default:return null}return null},t.mallocArrayBuffer=d,t.mallocUint8=f,t.mallocUint16=m,t.mallocUint32=g,t.mallocInt8=y,t.mallocInt16=v,t.mallocInt32=x,t.mallocFloat32=t.mallocFloat=b,t.mallocFloat64=t.mallocDouble=_,t.mallocUint8Clamped=w,t.mallocBigUint64=k,t.mallocBigInt64=T,t.mallocDataView=S,t.mallocBuffer=A,t.clearCache=function(){for(var e=0;e<32;++e)c.UINT8[e].length=0,c.UINT16[e].length=0,c.UINT32[e].length=0,c.INT8[e].length=0,c.INT16[e].length=0,c.INT32[e].length=0,c.FLOAT[e].length=0,c.DOUBLE[e].length=0,c.BIGUINT64[e].length=0,c.BIGINT64[e].length=0,c.UINT8C[e].length=0,u[e].length=0,h[e].length=0}},1755:function(e){function t(e){this.roots=new Array(e),this.ranks=new Array(e);for(var t=0;t<e;++t)this.roots[t]=t,this.ranks[t]=0}e.exports=t;var r=t.prototype;Object.defineProperty(r,"length",{get:function(){return this.roots.length}}),r.makeSet=function(){var e=this.roots.length;return this.roots.push(e),this.ranks.push(0),e},r.find=function(e){for(var t=e,r=this.roots;r[e]!==e;)e=r[e];for(;r[t]!==e;){var n=r[t];r[t]=e,t=n}return e},r.link=function(e,t){var r=this.find(e),n=this.find(t);if(r!==n){var i=this.ranks,a=this.roots,o=i[r],s=i[n];o<s?a[r]=n:s<o?a[n]=r:(a[n]=r,++i[r])}}},1682:function(e){e.exports=function(e,t,r){return 0===e.length?e:t?(r||e.sort(t),function(e,t){for(var r=1,n=e.length,i=e[0],a=e[0],o=1;o<n;++o)if(a=i,t(i=e[o],a)){if(o===r){r++;continue}e[r++]=i}return e.length=r,e}(e,t)):(r||e.sort(),function(e){for(var t=1,r=e.length,n=e[0],i=e[0],a=1;a<r;++a,i=n)if(i=n,(n=e[a])!==i){if(a===t){t++;continue}e[t++]=n}return e.length=t,e}(e))}},4359:function(e,t,r){e.exports=function(e,t){return"object"===typeof t&&null!==t||(t={}),n(e,t.canvas||i,t.context||a,t)};var n=r(7718),i=null,a=null;"undefined"!==typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},7718:function(e,t,r){e.exports=function(e,t,r,n){var a=64,o=1.25,s={breaklines:!1,bolds:!1,italics:!1,subscripts:!1,superscripts:!1};return n&&(n.size&&n.size>0&&(a=n.size),n.lineSpacing&&n.lineSpacing>0&&(o=n.lineSpacing),n.styletags&&n.styletags.breaklines&&(s.breaklines=!!n.styletags.breaklines),n.styletags&&n.styletags.bolds&&(s.bolds=!!n.styletags.bolds),n.styletags&&n.styletags.italics&&(s.italics=!!n.styletags.italics),n.styletags&&n.styletags.subscripts&&(s.subscripts=!!n.styletags.subscripts),n.styletags&&n.styletags.superscripts&&(s.superscripts=!!n.styletags.superscripts)),r.font=[n.fontStyle,n.fontVariant,n.fontWeight,a+"px",n.font].filter((function(e){return e})).join(" "),r.textAlign="start",r.textBaseline="alphabetic",r.direction="ltr",_(function(e,t,r,n,a,o){r=r.replace(/\n/g,""),r=!0===o.breaklines?r.replace(/\<br\>/g,"\n"):r.replace(/\<br\>/g," ");var s="",l=[];for(k=0;k<r.length;++k)l[k]=s;!0===o.bolds&&(l=x(c,u,r,l)),!0===o.italics&&(l=x(h,p,r,l)),!0===o.superscripts&&(l=x(d,m,r,l)),!0===o.subscripts&&(l=x(g,v,r,l));var b=[],_="";for(k=0;k<r.length;++k)null!==l[k]&&(_+=r[k],b.push(l[k]));var w,k,T,S,A,M=_.split("\n"),E=M.length,C=Math.round(a*n),P=n,L=2*n,I=0,z=E*C+L;e.height<z&&(e.height=z),t.fillStyle="#000",t.fillRect(0,0,e.width,e.height),t.fillStyle="#fff";var O=0,R="";function D(){if(""!==R){var e=t.measureText(R).width;t.fillText(R,P+T,L+S),T+=e}}function j(){return Math.round(A)+"px "}function F(e,r){var n=""+t.font;if(!0===o.subscripts){var i=e.indexOf(y),a=r.indexOf(y),s=i>-1?parseInt(e[1+i]):0,l=a>-1?parseInt(r[1+a]):0;s!==l&&(n=n.replace(j(),"?px "),A*=Math.pow(.75,l-s),n=n.replace("?px ",j())),S+=.25*C*(l-s)}if(!0===o.superscripts){var c=e.indexOf(f),h=r.indexOf(f),d=c>-1?parseInt(e[1+c]):0,m=h>-1?parseInt(r[1+h]):0;d!==m&&(n=n.replace(j(),"?px "),A*=Math.pow(.75,m-d),n=n.replace("?px ",j())),S-=.25*C*(m-d)}if(!0===o.bolds){var g=e.indexOf(u)>-1,v=r.indexOf(u)>-1;!g&&v&&(n=x?n.replace("italic ","italic bold "):"bold "+n),g&&!v&&(n=n.replace("bold ",""))}if(!0===o.italics){var x=e.indexOf(p)>-1,b=r.indexOf(p)>-1;!x&&b&&(n="italic "+n),x&&!b&&(n=n.replace("italic ",""))}t.font=n}for(w=0;w<E;++w){var B=M[w]+"\n";for(T=0,S=w*C,A=n,R="",k=0;k<B.length;++k){var N=k+O<b.length?b[k+O]:b[b.length-1];s===N?R+=B[k]:(D(),R=B[k],void 0!==N&&(F(s,N),s=N))}D(),O+=B.length;var U=0|Math.round(T+2*P);I<U&&(I=U)}var V=I,q=L+C*E;return i(t.getImageData(0,0,V,q).data,[q,V,4]).pick(-1,-1,0).transpose(1,0)}(t,r,e,a,o,s),n,a)},e.exports.processPixels=_;var n=r(3711),i=r(9618),a=r(5878),o=r(332),s=r(2538),l=r(2095),c="b",u="b|",h="i",p="i|",d="sup",f="+",m="+1",g="sub",y="-",v="-1";function x(e,t,r,n){for(var i="<"+e+">",a="</"+e+">",o=i.length,s=a.length,l=t[0]===f||t[0]===y,c=0,u=-s;c>-1&&-1!==(c=r.indexOf(i,c))&&-1!==(u=r.indexOf(a,c+o))&&!(u<=c);){for(var h=c;h<u+s;++h)if(h<c+o||h>=u)n[h]=null,r=r.substr(0,h)+" "+r.substr(h+1);else if(null!==n[h]){var p=n[h].indexOf(t[0]);-1===p?n[h]+=t:l&&(n[h]=n[h].substr(0,p+1)+(1+parseInt(n[h][p+1]))+n[h].substr(p+2))}var d=c+o,m=r.substr(d,u-d).indexOf(i);c=-1!==m?m:u+s}return n}function b(e,t,r,i){var c=function(e,t){var r=n(e,128);return t?a(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(e,i),u=function(e,t,r){for(var n=t.textAlign||"start",i=t.textBaseline||"alphabetic",a=[1<<30,1<<30],o=[0,0],s=e.length,l=0;l<s;++l)for(var c=e[l],u=0;u<2;++u)a[u]=0|Math.min(a[u],c[u]),o[u]=0|Math.max(o[u],c[u]);var h=0;switch(n){case"center":h=-.5*(a[0]+o[0]);break;case"right":case"end":h=-o[0];break;case"left":case"start":h=-a[0];break;default:throw new Error("vectorize-text: Unrecognized textAlign: '"+n+"'")}var p=0;switch(i){case"hanging":case"top":p=-a[1];break;case"middle":p=-.5*(a[1]+o[1]);break;case"alphabetic":case"ideographic":p=-3*r;break;case"bottom":p=-o[1];break;default:throw new Error("vectorize-text: Unrecoginized textBaseline: '"+i+"'")}var d=1/r;return"lineHeight"in t?d*=+t.lineHeight:"width"in t?d=t.width/(o[0]-a[0]):"height"in t&&(d=t.height/(o[1]-a[1])),e.map((function(e){return[d*(e[0]+h),d*(e[1]+p)]}))}(c.positions,t,r),h=c.edges,p="ccw"===t.orientation;if(o(u,h),t.polygons||t.polygon||t.polyline){for(var d=l(h,u),f=new Array(d.length),m=0;m<d.length;++m){for(var g=d[m],y=new Array(g.length),v=0;v<g.length;++v){for(var x=g[v],b=new Array(x.length),_=0;_<x.length;++_)b[_]=u[x[_]].slice();p&&b.reverse(),y[v]=b}f[m]=y}return f}return t.triangles||t.triangulate||t.triangle?{cells:s(u,h,{delaunay:!1,exterior:!1,interior:!0}),positions:u}:{edges:h,positions:u}}function _(e,t,r){try{return b(e,t,r,!0)}catch(n){}try{return b(e,t,r,!1)}catch(n){}return t.polygons||t.polyline||t.polygon?[]:t.triangles||t.triangulate||t.triangle?{cells:[],positions:[]}:{edges:[],positions:[]}}},1538:function(e){!function(){if("undefined"===typeof ses||!ses.ok||ses.ok()){"undefined"!==typeof ses&&(ses.weakMapPermitHostObjects=g);var t=!1;if("function"===typeof WeakMap){var r=WeakMap;if("undefined"!==typeof navigator&&/Firefox/.test(navigator.userAgent));else{var n=new r,i=Object.freeze({});if(n.set(i,1),1===n.get(i))return void(e.exports=WeakMap);t=!0}}Object.prototype.hasOwnProperty;var a=Object.getOwnPropertyNames,o=Object.defineProperty,s=Object.isExtensible,l="weakmap:",c=l+"ident:"+Math.random()+"___";if("undefined"!==typeof crypto&&"function"===typeof crypto.getRandomValues&&"function"===typeof ArrayBuffer&&"function"===typeof Uint8Array){var u=new ArrayBuffer(25),h=new Uint8Array(u);crypto.getRandomValues(h),c=l+"rand:"+Array.prototype.map.call(h,(function(e){return(e%36).toString(36)})).join("")+"___"}if(o(Object,"getOwnPropertyNames",{value:function(e){return a(e).filter(y)}}),"getPropertyNames"in Object){var p=Object.getPropertyNames;o(Object,"getPropertyNames",{value:function(e){return p(e).filter(y)}})}!function(){var e=Object.freeze;o(Object,"freeze",{value:function(t){return v(t),e(t)}});var t=Object.seal;o(Object,"seal",{value:function(e){return v(e),t(e)}});var r=Object.preventExtensions;o(Object,"preventExtensions",{value:function(e){return v(e),r(e)}})}();var d=!1,f=0,m=function(){this instanceof m||b();var e=[],t=[],r=f++;return Object.create(m.prototype,{get___:{value:x((function(n,i){var a,o=v(n);return o?r in o?o[r]:i:(a=e.indexOf(n))>=0?t[a]:i}))},has___:{value:x((function(t){var n=v(t);return n?r in n:e.indexOf(t)>=0}))},set___:{value:x((function(n,i){var a,o=v(n);return o?o[r]=i:(a=e.indexOf(n))>=0?t[a]=i:(a=e.length,t[a]=i,e[a]=n),this}))},delete___:{value:x((function(n){var i,a,o=v(n);return o?r in o&&delete o[r]:!((i=e.indexOf(n))<0)&&(a=e.length-1,e[i]=void 0,t[i]=t[a],e[i]=e[a],e.length=a,t.length=a,!0)}))}})};m.prototype=Object.create(Object.prototype,{get:{value:function(e,t){return this.get___(e,t)},writable:!0,configurable:!0},has:{value:function(e){return this.has___(e)},writable:!0,configurable:!0},set:{value:function(e,t){return this.set___(e,t)},writable:!0,configurable:!0},delete:{value:function(e){return this.delete___(e)},writable:!0,configurable:!0}}),"function"===typeof r?function(){function n(){this instanceof m||b();var e,n=new r,i=void 0,a=!1;return e=t?function(e,t){return n.set(e,t),n.has(e)||(i||(i=new m),i.set(e,t)),this}:function(e,t){if(a)try{n.set(e,t)}catch(r){i||(i=new m),i.set___(e,t)}else n.set(e,t);return this},Object.create(m.prototype,{get___:{value:x((function(e,t){return i?n.has(e)?n.get(e):i.get___(e,t):n.get(e,t)}))},has___:{value:x((function(e){return n.has(e)||!!i&&i.has___(e)}))},set___:{value:x(e)},delete___:{value:x((function(e){var t=!!n.delete(e);return i&&i.delete___(e)||t}))},permitHostObjects___:{value:x((function(e){if(e!==g)throw new Error("bogus call to permitHostObjects___");a=!0}))}})}t&&"undefined"!==typeof Proxy&&(Proxy=void 0),n.prototype=m.prototype,e.exports=n,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!==typeof Proxy&&(Proxy=void 0),e.exports=m)}function g(e){e.permitHostObjects___&&e.permitHostObjects___(g)}function y(e){return!(e.substr(0,8)==l&&"___"===e.substr(e.length-3))}function v(e){if(e!==Object(e))throw new TypeError("Not an object: "+e);var t=e[c];if(t&&t.key===e)return t;if(s(e)){t={key:e};try{return o(e,c,{value:t,writable:!1,enumerable:!1,configurable:!1}),t}catch(r){return}}}function x(e){return e.prototype=null,Object.freeze(e)}function b(){d||"undefined"===typeof console||(d=!0,console.warn("WeakMap should be invoked as new WeakMap(), not WeakMap(). This will be an error in the future."))}}()},236:function(e,t,r){var n=r(8284);e.exports=function(){var e={};return function(t){if(("object"!==typeof t||null===t)&&"function"!==typeof t)throw new Error("Weakmap-shim: Key must be object");var r=t.valueOf(e);return r&&r.identity===e?r:n(t,e)}}},8284:function(e){e.exports=function(e,t){var r={identity:t},n=e.valueOf;return Object.defineProperty(e,"valueOf",{value:function(e){return e!==t?n.apply(this,arguments):r},writable:!0}),r}},606:function(e,t,r){var n=r(236);e.exports=function(){var e=n();return{get:function(t,r){var n=e(t);return n.hasOwnProperty("value")?n.value:r},set:function(t,r){return e(t).value=r,this},has:function(t){return"value"in e(t)},delete:function(t){return delete e(t).value}}}},3349:function(e){var t=function(){return function(e,t,r,n,i,a){var o=e[0],s=r[0],l=[0],c=s;n|=0;var u=0,h=s;for(u=0;u<o;++u){var p=t[n]-a,d=t[n+c]-a;p>=0!==d>=0&&i.push(l[0]+.5+.5*(p+d)/(p-d)),n+=h,++l[0]}}};e.exports=function(e){return r={funcName:e.funcName},function(e){var t={};return function(r,n,i){var a=r.dtype,o=r.order,s=[a,o.join()].join(),l=t[s];return l||(t[s]=l=e([a,o])),l(r.shape.slice(0),r.data,r.stride,0|r.offset,n,i)}}(t.bind(void 0,r));var r}({funcName:"zeroCrossings"})},781:function(e,t,r){e.exports=function(e,t){var r=[];return t=+t||0,n(e.hi(e.shape[0]-1),r,t),r};var n=r(3349)},7790:function(){}},r={};function n(t){var i=r[t];if(void 0!==i)return i.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.loaded=!0,a.exports}n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e};var i=n(1964);t.exports=i}()}}),Of=p({"node_modules/color-name/index.js"(e,t){t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}}}),Rf=p({"node_modules/color-normalize/node_modules/color-parse/index.js"(e,t){var r=Of();t.exports=function(e){var t,i,a=[],o=1;if("string"===typeof e)if(e=e.toLowerCase(),r[e])a=r[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(e)){var s=e.slice(1);o=1,(u=s.length)<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===u&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===u&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(t=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(e)){var l=t[1],c="rgb"===l;i=s=l.replace(/a$/,"");var u="cmyk"===s?4:"gray"===s?1:3;a=t[2].trim().split(/\s*[,\/]\s*|\s+/).map((function(e,t){if(/%$/.test(e))return t===u?parseFloat(e)/100:"rgb"===s?255*parseFloat(e)/100:parseFloat(e);if("h"===s[t]){if(/deg$/.test(e))return parseFloat(e);if(void 0!==n[e])return n[e]}return parseFloat(e)})),l===s&&a.push(1),o=c||void 0===a[u]?1:a[u],a=a.slice(0,u)}else e.length>10&&/[0-9](?:\s|\/)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=e.match(/([a-z])/gi).join("").toLowerCase());else isNaN(e)?Array.isArray(e)||e.length?(a=[e[0],e[1],e[2]],i="rgb",o=4===e.length?e[3]:1):e instanceof Object&&(null!=e.r||null!=e.red||null!=e.R?(i="rgb",a=[e.r||e.red||e.R||0,e.g||e.green||e.G||0,e.b||e.blue||e.B||0]):(i="hsl",a=[e.h||e.hue||e.H||0,e.s||e.saturation||e.S||0,e.l||e.lightness||e.L||e.b||e.brightness]),o=e.a||e.alpha||e.opacity||1,null!=e.opacity&&(o/=100)):(i="rgb",a=[e>>>16,(65280&e)>>>8,255&e]);return{space:i,values:a,alpha:o}};var n={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Df=p({"node_modules/color-normalize/node_modules/color-rgba/index.js"(e,t){var r=Rf();t.exports=function(e){var t;Array.isArray(e)&&e.raw&&(e=String.raw.apply(null,arguments));var n=r(e);if(!n.space)return[];var i=[0,0,0],a="h"===n.space[0]?[360,100,100]:[255,255,255];return(t=Array(3))[0]=Math.min(Math.max(n.values[0],i[0]),a[0]),t[1]=Math.min(Math.max(n.values[1],i[1]),a[1]),t[2]=Math.min(Math.max(n.values[2],i[2]),a[2]),"h"===n.space[0]&&(t=function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}(t)),t.push(Math.min(Math.max(n.alpha,0),1)),t}}}),jf=p({"node_modules/clamp/index.js"(e,t){t.exports=function(e,t,r){return t<r?e<t?t:e>r?r:e:e<r?r:e>t?t:e}}}),Ff=p({"node_modules/dtype/index.js"(e,t){t.exports=function(e){switch(e){case"int8":return Int8Array;case"int16":return Int16Array;case"int32":return Int32Array;case"uint8":return Uint8Array;case"uint16":return Uint16Array;case"uint32":return Uint32Array;case"float32":return Float32Array;case"float64":return Float64Array;case"array":return Array;case"uint8_clamped":return Uint8ClampedArray}}}}),Bf=p({"node_modules/color-normalize/index.js"(e,t){var r=Df(),n=jf(),i=Ff();t.exports=function(e,t){"float"!==t&&t||(t="array"),"uint"===t&&(t="uint8"),"uint_clamped"===t&&(t="uint8_clamped");var a=new(i(t))(4),o="uint8"!==t&&"uint8_clamped"!==t;return e.length&&"string"!==typeof e||((e=r(e))[0]/=255,e[1]/=255,e[2]/=255),function(e){return e instanceof Uint8Array||e instanceof Uint8ClampedArray||!!(Array.isArray(e)&&(e[0]>1||0===e[0])&&(e[1]>1||0===e[1])&&(e[2]>1||0===e[2])&&(!e[3]||e[3]>1))}(e)?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:255,o&&(a[0]/=255,a[1]/=255,a[2]/=255,a[3]/=255),a):(o?(a[0]=e[0],a[1]=e[1],a[2]=e[2],a[3]=null!=e[3]?e[3]:1):(a[0]=n(Math.floor(255*e[0]),0,255),a[1]=n(Math.floor(255*e[1]),0,255),a[2]=n(Math.floor(255*e[2]),0,255),a[3]=null==e[3]?255:n(Math.floor(255*e[3]),0,255)),a)}}}),Nf=p({"src/lib/str2rgbarray.js"(e,t){var r=Bf();t.exports=function(e){return e?r(e):[0,0,0,1]}}}),Uf=p({"src/lib/gl_format_color.js"(e,t){var r=k(),n=O(),i=Bf(),a=Wt(),o=V().defaultLine,s=M().isArrayOrTypedArray,l=i(o);function c(e,t){var r=e;return r[3]*=t,r}function u(e){if(r(e))return l;var t=i(e);return t.length?t:l}function h(e){return r(e)?e:1}t.exports={formatColor:function(e,t,r){var n=e.color;n&&n._inputArray&&(n=n._inputArray);var o,p,d,f,m,g=s(n),y=s(t),v=a.extractOpts(e),x=[];if(o=void 0!==v.colorscale?a.makeColorScaleFuncFromTrace(e):u,p=g?function(e,t){return void 0===e[t]?l:i(o(e[t]))}:u,d=y?function(e,t){return void 0===e[t]?1:h(e[t])}:h,g||y)for(var b=0;b<r;b++)f=p(n,b),m=d(t,b),x[b]=c(f,m);else x=c(i(n),t);return x},parseColorScale:function(e){var t=a.extractOpts(e),r=t.colorscale;return t.reversescale&&(r=a.flipScale(t.colorscale)),r.map((function(e){var t=e[0],r=n(e[1]).toRgb();return{index:t,rgb:[r.r,r.g,r.b,r.a]}}))}}}}),Vf=p({"src/constants/gl3d_dashes.js"(e,t){t.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]}}}),qf=p({"src/constants/gl3d_markers.js"(e,t){t.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}}}),Hf=p({"src/traces/scatter3d/calc_errors.js"(e,t){var r=Ve();function n(e,t,n,i){if(!t||!t.visible)return null;for(var a=r.getComponentMethod("errorbars","makeComputeError")(t),o=new Array(e.length),s=0;s<e.length;s++){var l=a(+e[s],s);if("log"===i.type){var c=i.c2l(e[s]),u=e[s]-l[0],h=e[s]+l[1];if(o[s]=[(i.c2l(u,!0)-c)*n,(i.c2l(h,!0)-c)*n],u>0){var p=i.c2l(u);i._lowerLogErrorBound||(i._lowerLogErrorBound=p),i._lowerErrorBound=Math.min(i._lowerLogErrorBound,p)}}else o[s]=[-l[0]*n,l[1]*n]}return o}t.exports=function(e,t,r){var i=[n(e.x,e.error_x,t[0],r.xaxis),n(e.y,e.error_y,t[1],r.yaxis),n(e.z,e.error_z,t[2],r.zaxis)],a=function(e){for(var t=0;t<e.length;t++)if(e[t])return e[t].length;return 0}(i);if(0===a)return null;for(var o=new Array(a),s=0;s<a;s++){for(var l=[[0,0,0],[0,0,0]],c=0;c<3;c++)if(i[c])for(var u=0;u<2;u++)l[u][c]=i[c][s][u];o[s]=l}return o}}}),Gf=p({"src/traces/scatter3d/convert.js"(e,t){var r=zf().gl_line3d,n=zf().gl_scatter3d,i=zf().gl_error3d,a=zf().gl_mesh3d,o=zf().delaunay_triangulate,s=st(),l=Nf(),c=Uf().formatColor,u=Zt(),h=Vf(),p=qf(),d=nr(),f=Xt().appendArrayPointValue,m=Hf();function g(e,t){this.scene=e,this.uid=t,this.linePlot=null,this.scatterPlot=null,this.errorBars=null,this.textMarkers=null,this.delaunayMesh=null,this.color=null,this.mode="",this.dataPoints=[],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.textLabels=null,this.data=null}var y=g.prototype;function v(e){return null===e||void 0===e?0:e.indexOf("left")>-1?-1:e.indexOf("right")>-1?1:0}function x(e){return null===e||void 0===e?0:e.indexOf("top")>-1?-1:e.indexOf("bottom")>-1?1:0}function b(e,t){return t(4*e)}function _(e){return p[e]}function w(e,t,r,n,i){var a=null;if(s.isArrayOrTypedArray(e)){a=[];for(var o=0;o<t;o++)void 0===e[o]?a[o]=n:a[o]=r(e[o],i)}else a=r(e,s.identity);return a}function k(e,t){var r,n,i,a,o,h,p=[],g=e.fullSceneLayout,y=e.dataScale,k=g.xaxis,T=g.yaxis,S=g.zaxis,A=t.marker,M=t.line,E=t.x||[],C=t.y||[],P=t.z||[],L=E.length,I=t.xcalendar,z=t.ycalendar,O=t.zcalendar;for(o=0;o<L;o++)r=k.d2l(E[o],0,I)*y[0],n=T.d2l(C[o],0,z)*y[1],i=S.d2l(P[o],0,O)*y[2],p[o]=[r,n,i];if(Array.isArray(t.text))h=t.text;else if(s.isTypedArray(t.text))h=Array.from(t.text);else if(void 0!==t.text)for(h=new Array(L),o=0;o<L;o++)h[o]=t.text;function R(e,t){var r=g[e];return d.tickText(r,r.d2l(t),!0).text}var D=t.texttemplate;if(D){var j=e.fullLayout._d3locale,F=Array.isArray(D),B=F?Math.min(D.length,L):L,N=F?function(e){return D[e]}:function(){return D};for(h=new Array(B),o=0;o<B;o++){var U={x:E[o],y:C[o],z:P[o]},V={xLabel:R("xaxis",E[o]),yLabel:R("yaxis",C[o]),zLabel:R("zaxis",P[o])},q={};f(q,t,o);var H=t._meta||{};h[o]=s.texttemplateString(N(o),V,j,q,U,H)}}if(a={position:p,mode:t.mode,text:h},"line"in t&&(a.lineColor=c(M,1,L),a.lineWidth=M.width,a.lineDashes=M.dash),"marker"in t){var G=u(t);a.scatterColor=c(A,1,L),a.scatterSize=w(A.size,L,b,20,G),a.scatterMarker=w(A.symbol,L,_,"\u25cf"),a.scatterLineWidth=A.line.width,a.scatterLineColor=c(A.line,1,L),a.scatterAngle=0}"textposition"in t&&(a.textOffset=function(e){var t=[0,0];if(Array.isArray(e))for(var r=0;r<e.length;r++)t[r]=[0,0],e[r]&&(t[r][0]=v(e[r]),t[r][1]=x(e[r]));else t[0]=v(e),t[1]=x(e);return t}(t.textposition),a.textColor=c(t.textfont,1,L),a.textSize=w(t.textfont.size,L,s.identity,12),a.textFontFamily=t.textfont.family,a.textFontWeight=t.textfont.weight,a.textFontStyle=t.textfont.style,a.textFontVariant=t.textfont.variant,a.textAngle=0);var W=["x","y","z"];for(a.project=[!1,!1,!1],a.projectScale=[1,1,1],a.projectOpacity=[1,1,1],o=0;o<3;++o){var $=t.projection[W[o]];(a.project[o]=$.show)&&(a.projectOpacity[o]=$.opacity,a.projectScale[o]=$.scale)}a.errorBounds=m(t,y,g);var Z=function(e){for(var t=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[1,1,1],i=0;i<3;i++){var a=e[i];a&&!1!==a.copy_zstyle&&!1!==e[2].visible&&(a=e[2]),a&&a.visible&&(t[i]=a.width/2,r[i]=l(a.color),n[i]=a.thickness)}return{capSize:t,color:r,lineWidth:n}}([t.error_x,t.error_y,t.error_z]);return a.errorColor=Z.color,a.errorLineWidth=Z.lineWidth,a.errorCapSize=Z.capSize,a.delaunayAxis=t.surfaceaxis,a.delaunayColor=l(t.surfacecolor),a}function T(e){if(s.isArrayOrTypedArray(e)){var t=e[0];return s.isArrayOrTypedArray(t)&&(e=t),"rgb("+e.slice(0,3).map((function(e){return Math.round(255*e)}))+")"}return null}function S(e){return s.isArrayOrTypedArray(e)?4===e.length&&"number"===typeof e[0]?T(e):e.map(T):null}y.handlePick=function(e){if(e.object&&(e.object===this.linePlot||e.object===this.delaunayMesh||e.object===this.textMarkers||e.object===this.scatterPlot)){var t=e.index=e.data.index;return e.object.highlight&&e.object.highlight(null),this.scatterPlot&&(e.object=this.scatterPlot,this.scatterPlot.highlight(e.data)),e.textLabel="",this.textLabels&&(s.isArrayOrTypedArray(this.textLabels)?(this.textLabels[t]||0===this.textLabels[t])&&(e.textLabel=this.textLabels[t]):e.textLabel=this.textLabels),e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]],!0}},y.update=function(e){var t,s,l,c,u=this.scene.glplot.gl,p=h.solid;this.data=e;var d=k(this.scene,e);"mode"in d&&(this.mode=d.mode),"lineDashes"in d&&d.lineDashes in h&&(p=h[d.lineDashes]),this.color=S(d.scatterColor)||S(d.lineColor),this.dataPoints=d.position,t={gl:this.scene.glplot.gl,position:d.position,color:d.lineColor,lineWidth:d.lineWidth||1,dashes:p[0],dashScale:p[1],opacity:e.opacity,connectGaps:e.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(t):(this.linePlot=r(t),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var f=e.opacity;if(e.marker&&void 0!==e.marker.opacity&&(f*=e.marker.opacity),s={gl:this.scene.glplot.gl,position:d.position,color:d.scatterColor,size:d.scatterSize,glyph:d.scatterMarker,opacity:f,orthographic:!0,lineWidth:d.scatterLineWidth,lineColor:d.scatterLineColor,project:d.project,projectScale:d.projectScale,projectOpacity:d.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(s):(this.scatterPlot=n(s),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),c={gl:this.scene.glplot.gl,position:d.position,glyph:d.text,color:d.textColor,size:d.textSize,angle:d.textAngle,alignment:d.textOffset,font:d.textFontFamily,fontWeight:d.textFontWeight,fontStyle:d.textFontStyle,fontVariant:d.textFontVariant,orthographic:!0,lineWidth:0,project:!1,opacity:e.opacity},this.textLabels=e.hovertext||e.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(c):(this.textMarkers=n(c),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),l={gl:this.scene.glplot.gl,position:d.position,color:d.errorColor,error:d.errorBounds,lineWidth:d.errorLineWidth,capSize:d.errorCapSize,opacity:e.opacity},this.errorBars?d.errorBounds?this.errorBars.update(l):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):d.errorBounds&&(this.errorBars=i(l),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),d.delaunayAxis>=0){var m=function(e,t,r){var n,i=(r+1)%3,a=(r+2)%3,s=[],l=[];for(n=0;n<e.length;++n){var c=e[n];!isNaN(c[i])&&isFinite(c[i])&&!isNaN(c[a])&&isFinite(c[a])&&(s.push([c[i],c[a]]),l.push(n))}var u=o(s);for(n=0;n<u.length;++n)for(var h=u[n],p=0;p<h.length;++p)h[p]=l[h[p]];return{positions:e,cells:u,meshColor:t}}(d.position,d.delaunayColor,d.delaunayAxis);m.opacity=e.opacity,this.delaunayMesh?this.delaunayMesh.update(m):(m.gl=u,this.delaunayMesh=a(m),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},y.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},t.exports=function(e,t){var r=new g(e,t.uid);return r.update(t),r}}}),Wf=p({"src/traces/scatter3d/attributes.js"(e,t){var r=wn(),n=D(),i=Lt(),a=Et().axisHoverFormat,o=Oe().hovertemplateAttrs,s=Oe().texttemplateAttrs,l=N(),c=Vf(),u=qf(),h=R().extendFlat,p=Le().overrideAll,d=We(),f=r.line,m=r.marker,g=m.line,y=h({width:f.width,dash:{valType:"enumerated",values:d(c),dflt:"solid"}},i("line")),v=t.exports=p({x:r.x,y:r.y,z:{valType:"data_array"},text:h({},r.text,{}),texttemplate:s({},{}),hovertext:h({},r.hovertext,{}),hovertemplate:o(),xhoverformat:a("x"),yhoverformat:a("y"),zhoverformat:a("z"),mode:h({},r.mode,{dflt:"lines+markers"}),surfaceaxis:{valType:"enumerated",values:[-1,0,1,2],dflt:-1},surfacecolor:{valType:"color"},projection:{x:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},y:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}},z:{show:{valType:"boolean",dflt:!1},opacity:{valType:"number",min:0,max:1,dflt:1},scale:{valType:"number",min:0,max:10,dflt:2/3}}},connectgaps:r.connectgaps,line:y,marker:h({symbol:{valType:"enumerated",values:d(u),dflt:"circle",arrayOk:!0},size:h({},m.size,{dflt:8}),sizeref:m.sizeref,sizemin:m.sizemin,sizemode:m.sizemode,opacity:h({},m.opacity,{arrayOk:!1}),colorbar:m.colorbar,line:h({width:h({},g.width,{arrayOk:!1})},i("marker.line"))},i("marker")),textposition:h({},r.textposition,{dflt:"top center"}),textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,variantValues:["normal","small-caps"]}),opacity:l.opacity,hoverinfo:h({},l.hoverinfo)},"calc","nested");v.x.editType=v.y.editType=v.z.editType="calc+clearAxisTypes"}}),$f=p({"src/traces/scatter3d/defaults.js"(e,t){var r=Ve(),n=st(),i=$t(),a=Wn(),o=$n(),s=Xn(),l=Wf();t.exports=function(e,t,c,u){function h(r,i){return n.coerce(e,t,l,r,i)}var p=function(e,t,n,i){var a=0,o=n("x"),s=n("y"),l=n("z");return r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],i),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),t._length=t._xlength=t._ylength=t._zlength=a),a}(e,t,h,u);if(p){h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),h("mode"),i.hasMarkers(t)&&a(e,t,c,u,h,{noSelect:!0,noAngle:!0}),i.hasLines(t)&&(h("connectgaps"),o(e,t,c,u,h)),i.hasText(t)&&(h("texttemplate"),s(e,t,u,h,{noSelect:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var d=(t.line||{}).color,f=(t.marker||{}).color;h("surfaceaxis")>=0&&h("surfacecolor",d||f);for(var m=["x","y","z"],g=0;g<3;++g){var y="projection."+m[g];h(y+".show")&&(h(y+".opacity"),h(y+".scale"))}var v=r.getComponentMethod("errorbars","supplyDefaults");v(e,t,d||f||c,{axis:"z"}),v(e,t,d||f||c,{axis:"y",inherit:"z"}),v(e,t,d||f||c,{axis:"x",inherit:"z"})}else t.visible=!1}}}),Zf=p({"src/traces/scatter3d/calc.js"(e,t){var r=ni(),n=ri();t.exports=function(e,t){var i=[{x:!1,y:!1,trace:t,t:{}}];return r(i,t),n(e,t),i}}}),Xf=p({"node_modules/get-canvas-context/index.js"(e,t){t.exports=function(e,t){if("string"!==typeof e)throw new TypeError("must specify type string");if(t=t||{},"undefined"===typeof document&&!t.canvas)return null;var r=t.canvas||document.createElement("canvas");"number"===typeof t.width&&(r.width=t.width),"number"===typeof t.height&&(r.height=t.height);var n,i=t;try{var a=[e];0===e.indexOf("webgl")&&a.push("experimental-"+e);for(var o=0;o<a.length;o++)if(n=r.getContext(a[o],i))return n}catch(s){n=null}return n||null}}}),Yf=p({"node_modules/webgl-context/index.js"(e,t){var r=Xf();t.exports=function(e){return r("webgl",e)}}}),Kf=p({"src/lib/show_no_webgl_msg.js"(e,t){var r=q(),n=function(){};t.exports=function(e){for(var t in e)"function"===typeof e[t]&&(e[t]=n);e.destroy=function(){e.container.parentNode.removeChild(e.container)};var i=document.createElement("div");i.className="no-webgl",i.style.cursor="pointer",i.style.fontSize="24px",i.style.color=r.defaults[0],i.style.position="absolute",i.style.left=i.style.top="0px",i.style.width=i.style.height="100%",i.style["background-color"]=r.lightLine,i.style["z-index"]=30;var a=document.createElement("p");return a.textContent="WebGL is not supported by your browser - visit https://get.webgl.org for more info",a.style.position="relative",a.style.top="50%",a.style.left="50%",a.style.height="30%",a.style.width="50%",a.style.margin="-15% 0 0 -25%",i.appendChild(a),e.container.appendChild(i),e.container.style.background="#FFFFFF",e.container.onclick=function(){window.open("https://get.webgl.org")},!1}}}),Jf=p({"src/plots/gl3d/layout/convert.js"(e,t){var r=Nf(),n=st(),i=["xaxis","yaxis","zaxis"];function a(){this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickFontWeight=["normal","normal","normal","normal"],this.tickFontStyle=["normal","normal","normal","normal"],this.tickFontVariant=["normal","normal","normal","normal"],this.tickAngle=[0,0,0],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[18,18,18],this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont=["Open Sans","Open Sans","Open Sans"],this.labelSize=[20,20,20],this.labelFontWeight=["normal","normal","normal","normal"],this.labelFontStyle=["normal","normal","normal","normal"],this.labelFontVariant=["normal","normal","normal","normal"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[30,30,30],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=[10,10,10],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=[!0,!0,!0],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._defaultTickPad=this.tickPad.slice(),this._defaultLabelPad=this.labelPad.slice(),this._defaultLineTickLength=this.lineTickLength.slice()}a.prototype.merge=function(e,t){for(var a=this,o=0;o<3;++o){var s=t[i[o]];s.visible?(a.labels[o]=e._meta?n.templateString(s.title.text,e._meta):s.title.text,"font"in s.title&&(s.title.font.color&&(a.labelColor[o]=r(s.title.font.color)),s.title.font.family&&(a.labelFont[o]=s.title.font.family),s.title.font.size&&(a.labelSize[o]=s.title.font.size),s.title.font.weight&&(a.labelFontWeight[o]=s.title.font.weight),s.title.font.style&&(a.labelFontStyle[o]=s.title.font.style),s.title.font.variant&&(a.labelFontVariant[o]=s.title.font.variant)),"showline"in s&&(a.lineEnable[o]=s.showline),"linecolor"in s&&(a.lineColor[o]=r(s.linecolor)),"linewidth"in s&&(a.lineWidth[o]=s.linewidth),"showgrid"in s&&(a.gridEnable[o]=s.showgrid),"gridcolor"in s&&(a.gridColor[o]=r(s.gridcolor)),"gridwidth"in s&&(a.gridWidth[o]=s.gridwidth),"log"===s.type?a.zeroEnable[o]=!1:"zeroline"in s&&(a.zeroEnable[o]=s.zeroline),"zerolinecolor"in s&&(a.zeroLineColor[o]=r(s.zerolinecolor)),"zerolinewidth"in s&&(a.zeroLineWidth[o]=s.zerolinewidth),"ticks"in s&&s.ticks?a.lineTickEnable[o]=!0:a.lineTickEnable[o]=!1,"ticklen"in s&&(a.lineTickLength[o]=a._defaultLineTickLength[o]=s.ticklen),"tickcolor"in s&&(a.lineTickColor[o]=r(s.tickcolor)),"tickwidth"in s&&(a.lineTickWidth[o]=s.tickwidth),"tickangle"in s&&(a.tickAngle[o]="auto"===s.tickangle?-3600:Math.PI*-s.tickangle/180),"showticklabels"in s&&(a.tickEnable[o]=s.showticklabels),"tickfont"in s&&(s.tickfont.color&&(a.tickColor[o]=r(s.tickfont.color)),s.tickfont.family&&(a.tickFont[o]=s.tickfont.family),s.tickfont.size&&(a.tickSize[o]=s.tickfont.size),s.tickfont.weight&&(a.tickFontWeight[o]=s.tickfont.weight),s.tickfont.style&&(a.tickFontStyle[o]=s.tickfont.style),s.tickfont.variant&&(a.tickFontVariant[o]=s.tickfont.variant)),"mirror"in s?-1!==["ticks","all","allticks"].indexOf(s.mirror)?(a.lineTickMirror[o]=!0,a.lineMirror[o]=!0):!0===s.mirror?(a.lineTickMirror[o]=!1,a.lineMirror[o]=!0):(a.lineTickMirror[o]=!1,a.lineMirror[o]=!1):a.lineMirror[o]=!1,"showbackground"in s&&!1!==s.showbackground?(a.backgroundEnable[o]=!0,a.backgroundColor[o]=r(s.backgroundcolor)):a.backgroundEnable[o]=!1):(a.tickEnable[o]=!1,a.labelEnable[o]=!1,a.lineEnable[o]=!1,a.lineTickEnable[o]=!1,a.gridEnable[o]=!1,a.zeroEnable[o]=!1,a.backgroundEnable[o]=!1)}},t.exports=function(e,t){var r=new a;return r.merge(e,t),r}}}),Qf=p({"src/plots/gl3d/layout/spikes.js"(e,t){var r=Nf(),n=["xaxis","yaxis","zaxis"];function i(){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]}i.prototype.merge=function(e){for(var t=0;t<3;++t){var i=e[n[t]];i.visible?(this.enabled[t]=i.showspikes,this.colors[t]=r(i.spikecolor),this.drawSides[t]=i.spikesides,this.lineWidth[t]=i.spikethickness):(this.enabled[t]=!1,this.drawSides[t]=!1)}},t.exports=function(e){var t=new i;return t.merge(e),t}}}),em=p({"src/plots/gl3d/layout/tick_marks.js"(e,t){t.exports=function(e){for(var t=e.axesOptions,o=e.glplot.axesPixels,s=e.fullSceneLayout,l=[[],[],[]],c=0;c<3;++c){var u=s[i[c]];if(u._length=(o[c].hi-o[c].lo)*o[c].pixelsPerDataUnit/e.dataScale[c],Math.abs(u._length)===1/0||isNaN(u._length))l[c]=[];else{u._input_range=u.range.slice(),u.range[0]=o[c].lo/e.dataScale[c],u.range[1]=o[c].hi/e.dataScale[c],u._m=1/(e.dataScale[c]*o[c].pixelsPerDataUnit),u.range[0]===u.range[1]&&(u.range[0]-=1,u.range[1]+=1);var h=u.tickmode;if("auto"===u.tickmode){u.tickmode="linear";var p=u.nticks||n.constrain(u._length/40,4,9);r.autoTicks(u,Math.abs(u.range[1]-u.range[0])/p)}for(var d=r.calcTicks(u,{msUTC:!0}),f=0;f<d.length;++f)d[f].x=d[f].x*e.dataScale[c],"date"===u.type&&(d[f].text=d[f].text.replace(/\<br\>/g," "));l[c]=d,u.tickmode=h}}for(t.ticks=l,c=0;c<3;++c)for(a[c]=.5*(e.glplot.bounds[0][c]+e.glplot.bounds[1][c]),f=0;f<2;++f)t.bounds[f][c]=e.glplot.bounds[f][c];e.contourLevels=function(e){for(var t=new Array(3),r=0;r<3;++r){for(var n=e[r],i=new Array(n.length),a=0;a<n.length;++a)i[a]=n[a].x;t[r]=i}return t}(l)};var r=nr(),n=st(),i=["xaxis","yaxis","zaxis"],a=[0,0,0]}}),tm=p({"src/plots/gl3d/scene.js"(e,t){var r,n,i=zf().gl_plot3d,a=i.createCamera,o=i.createScene,s=Yf(),l=sr(),c=Ve(),u=st(),h=u.preserveDrawingBuffer(),p=nr(),d=zr(),f=Nf(),m=Kf(),g=Bi(),y=Jf(),v=Qf(),x=em(),b=rr().applyAutorangeOptions,_=!1;function w(e,t){var r=document.createElement("div"),n=e.container;this.graphDiv=e.graphDiv;var i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.style.position="absolute",i.style.top=i.style.left="0px",i.style.width=i.style.height="100%",i.style["z-index"]=20,i.style["pointer-events"]="none",r.appendChild(i),this.svgContainer=i,r.id=e.id,r.style.position="absolute",r.style.top=r.style.left="0px",r.style.width=r.style.height="100%",n.appendChild(r),this.fullLayout=t,this.id=e.id||"scene",this.fullSceneLayout=t[this.id],this.plotArgs=[[],{},{}],this.axesOptions=y(t,t[this.id]),this.spikeOptions=v(t[this.id]),this.container=r,this.staticMode=!!e.staticPlot,this.pixelRatio=this.pixelRatio||e.plotGlPixelRatio||2,this.dataScale=[1,1,1],this.contourLevels=[[],[],[]],this.convertAnnotations=c.getComponentMethod("annotations3d","convert"),this.drawAnnotations=c.getComponentMethod("annotations3d","draw"),this.initializeGLPlot()}var k=w.prototype;k.prepareOptions=function(){var e=this,t={canvas:e.canvas,gl:e.gl,glOptions:{preserveDrawingBuffer:h,premultipliedAlpha:!0,antialias:!0},container:e.container,axes:e.axesOptions,spikes:e.spikeOptions,pickRadius:10,snapToData:!0,autoScale:!0,autoBounds:!1,cameraObject:e.camera,pixelRatio:e.pixelRatio};if(e.staticMode){if(!n&&(r=document.createElement("canvas"),!(n=s({canvas:r,preserveDrawingBuffer:!0,premultipliedAlpha:!0,antialias:!0}))))throw new Error("error creating static canvas/context for image server");t.gl=n,t.canvas=r}return t};var T=!0;k.tryCreatePlot=function(){var e=this,t=e.prepareOptions(),r=!0;try{e.glplot=o(t)}catch(n){if(e.staticMode||!T||h)r=!1;else{u.warn(["webgl setup failed possibly due to","false preserveDrawingBuffer config.","The mobile/tablet device may not be detected by is-mobile module.","Enabling preserveDrawingBuffer in second attempt to create webgl scene..."].join(" "));try{h=t.glOptions.preserveDrawingBuffer=!0,e.glplot=o(t)}catch(i){h=t.glOptions.preserveDrawingBuffer=!1,r=!1}}}return T=!1,r},k.initializeGLCamera=function(){var e=this,t=e.fullSceneLayout.camera,r="orthographic"===t.projection.type;e.camera=a(e.container,{center:[t.center.x,t.center.y,t.center.z],eye:[t.eye.x,t.eye.y,t.eye.z],up:[t.up.x,t.up.y,t.up.z],_ortho:r,zoomMin:.01,zoomMax:100,mode:"orbit"})},k.initializeGLPlot=function(){var e=this;if(e.initializeGLCamera(),!e.tryCreatePlot())return m(e);e.traces={},e.make4thDimension();var t=e.graphDiv,r=t.layout,n=function(){var t={};return e.isCameraChanged(r)&&(t[e.id+".camera"]=e.getCamera()),e.isAspectChanged(r)&&(t[e.id+".aspectratio"]=e.glplot.getAspectratio(),"manual"!==r[e.id].aspectmode&&(e.fullSceneLayout.aspectmode=r[e.id].aspectmode=t[e.id+".aspectmode"]="manual")),t},i=function(e){if(!1!==e.fullSceneLayout.dragmode){var t=n();e.saveLayout(r),e.graphDiv.emit("plotly_relayout",t)}};return e.glplot.canvas&&(e.glplot.canvas.addEventListener("mouseup",(function(){i(e)})),e.glplot.canvas.addEventListener("touchstart",(function(){_=!0})),e.glplot.canvas.addEventListener("wheel",(function(r){if(t._context._scrollZoom.gl3d){if(e.camera._ortho){var n=r.deltaX>r.deltaY?1.1:1/1.1,a=e.glplot.getAspectratio();e.glplot.setAspectratio({x:n*a.x,y:n*a.y,z:n*a.z})}i(e)}}),!!l&&{passive:!1}),e.glplot.canvas.addEventListener("mousemove",(function(){if(!1!==e.fullSceneLayout.dragmode&&0!==e.camera.mouseListener.buttons){var t=n();e.graphDiv.emit("plotly_relayouting",t)}})),e.staticMode||e.glplot.canvas.addEventListener("webglcontextlost",(function(r){t&&t.emit&&t.emit("plotly_webglcontextlost",{event:r,layer:e.id})}),!1)),e.glplot.oncontextloss=function(){e.recoverContext()},e.glplot.onrender=function(){e.render()},!0},k.render=function(){var e,t=this,r=t.graphDiv,n=t.svgContainer,i=t.container.getBoundingClientRect();r._fullLayout._calcInverseTransform(r);var a=r._fullLayout._invScaleX,o=r._fullLayout._invScaleY,s=i.width*a,l=i.height*o;n.setAttributeNS(null,"viewBox","0 0 "+s+" "+l),n.setAttributeNS(null,"width",s),n.setAttributeNS(null,"height",l),x(t),t.glplot.axes.update(t.axesOptions);for(var c=Object.keys(t.traces),h=null,f=t.glplot.selection,m=0;m<c.length;++m)"skip"!==(e=t.traces[c[m]]).data.hoverinfo&&e.handlePick(f)&&(h=e),e.setContourLevels&&e.setContourLevels();function y(e,r,n){var i=t.fullSceneLayout[e+"axis"];return"log"!==i.type&&(r=i.d2l(r)),p.hoverLabelText(i,r,n)}if(null!==h){var v=g(t.glplot.cameraParams,f.dataCoordinate);e=h.data;var b,w=r._fullData[e.index],k=f.index,T={xLabel:y("x",f.traceCoordinate[0],e.xhoverformat),yLabel:y("y",f.traceCoordinate[1],e.yhoverformat),zLabel:y("z",f.traceCoordinate[2],e.zhoverformat)},S=d.castHoverinfo(w,t.fullLayout,k),A=(S||"").split("+"),M=S&&"all"===S;w.hovertemplate||M||(-1===A.indexOf("x")&&(T.xLabel=void 0),-1===A.indexOf("y")&&(T.yLabel=void 0),-1===A.indexOf("z")&&(T.zLabel=void 0),-1===A.indexOf("text")&&(f.textLabel=void 0),-1===A.indexOf("name")&&(h.name=void 0));var E=[];"cone"===e.type||"streamtube"===e.type?(T.uLabel=y("x",f.traceCoordinate[3],e.uhoverformat),(M||-1!==A.indexOf("u"))&&E.push("u: "+T.uLabel),T.vLabel=y("y",f.traceCoordinate[4],e.vhoverformat),(M||-1!==A.indexOf("v"))&&E.push("v: "+T.vLabel),T.wLabel=y("z",f.traceCoordinate[5],e.whoverformat),(M||-1!==A.indexOf("w"))&&E.push("w: "+T.wLabel),T.normLabel=f.traceCoordinate[6].toPrecision(3),(M||-1!==A.indexOf("norm"))&&E.push("norm: "+T.normLabel),"streamtube"===e.type&&(T.divergenceLabel=f.traceCoordinate[7].toPrecision(3),(M||-1!==A.indexOf("divergence"))&&E.push("divergence: "+T.divergenceLabel)),f.textLabel&&E.push(f.textLabel),b=E.join("<br>")):"isosurface"===e.type||"volume"===e.type?(T.valueLabel=p.hoverLabelText(t._mockAxis,t._mockAxis.d2l(f.traceCoordinate[3]),e.valuehoverformat),E.push("value: "+T.valueLabel),f.textLabel&&E.push(f.textLabel),b=E.join("<br>")):b=f.textLabel;var C={x:f.traceCoordinate[0],y:f.traceCoordinate[1],z:f.traceCoordinate[2],data:w._input,fullData:w,curveNumber:w.index,pointNumber:k};d.appendArrayPointValue(C,w,k),e._module.eventData&&(C=w._module.eventData(C,f,w,{},k));var P={points:[C]};if(t.fullSceneLayout.hovermode){var L=[];d.loneHover({trace:w,x:(.5+.5*v[0]/v[3])*s,y:(.5-.5*v[1]/v[3])*l,xLabel:T.xLabel,yLabel:T.yLabel,zLabel:T.zLabel,text:b,name:h.name,color:d.castHoverOption(w,k,"bgcolor")||h.color,borderColor:d.castHoverOption(w,k,"bordercolor"),fontFamily:d.castHoverOption(w,k,"font.family"),fontSize:d.castHoverOption(w,k,"font.size"),fontColor:d.castHoverOption(w,k,"font.color"),nameLength:d.castHoverOption(w,k,"namelength"),textAlign:d.castHoverOption(w,k,"align"),hovertemplate:u.castOption(w,k,"hovertemplate"),hovertemplateLabels:u.extendFlat({},C,T),eventData:[C]},{container:n,gd:r,inOut_bbox:L}),C.bbox=L[0]}f.distance<5&&(f.buttons||_)?r.emit("plotly_click",P):r.emit("plotly_hover",P),this.oldEventData=P}else d.loneUnhover(n),this.oldEventData&&r.emit("plotly_unhover",this.oldEventData),this.oldEventData=void 0;t.drawAnnotations(t)},k.recoverContext=function(){var e=this;e.glplot.dispose();var t=function(){e.glplot.gl.isContextLost()?requestAnimationFrame(t):e.initializeGLPlot()?e.plot.apply(e,e.plotArgs):u.error("Catastrophic and unrecoverable WebGL error. Context lost.")};requestAnimationFrame(t)};var S=["xaxis","yaxis","zaxis"];function A(e,t,r){for(var n=e.fullSceneLayout,i=0;i<3;i++){var a=S[i],o=a.charAt(0),s=n[a],l=t[o],c=t[o+"calendar"],h=t["_"+o+"length"];if(u.isArrayOrTypedArray(l))for(var p,d=0;d<(h||l.length);d++)if(u.isArrayOrTypedArray(l[d]))for(var f=0;f<l[d].length;++f)p=s.d2l(l[d][f],0,c),!isNaN(p)&&isFinite(p)&&(r[0][i]=Math.min(r[0][i],p),r[1][i]=Math.max(r[1][i],p));else p=s.d2l(l[d],0,c),!isNaN(p)&&isFinite(p)&&(r[0][i]=Math.min(r[0][i],p),r[1][i]=Math.max(r[1][i],p));else r[0][i]=Math.min(r[0][i],0),r[1][i]=Math.max(r[1][i],h-1)}}k.plot=function(e,t,r){var n=this;if(n.plotArgs=[e,t,r],!n.glplot.contextLost){var i,a,o,s,l,c,u=t[n.id],h=r[n.id];n.fullLayout=t,n.fullSceneLayout=u,n.axesOptions.merge(t,u),n.spikeOptions.merge(u),n.setViewport(u),n.updateFx(u.dragmode,u.hovermode),n.camera.enableWheel=n.graphDiv._context._scrollZoom.gl3d,n.glplot.setClearColor(f(u.bgcolor)),n.setConvert(l),e?Array.isArray(e)||(e=[e]):e=[];var p=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]];for(o=0;o<e.length;++o)!0===(i=e[o]).visible&&0!==i._length&&A(this,i,p);!function(e,t){for(var r=e.fullSceneLayout,n=r.annotations||[],i=0;i<3;i++)for(var a=S[i],o=a.charAt(0),s=r[a],l=0;l<n.length;l++){var c=n[l];if(c.visible){var u=s.r2l(c[o]);!isNaN(u)&&isFinite(u)&&(t[0][i]=Math.min(t[0][i],u),t[1][i]=Math.max(t[1][i],u))}}}(this,p);var d=[1,1,1];for(s=0;s<3;++s)p[1][s]===p[0][s]?d[s]=1:d[s]=1/(p[1][s]-p[0][s]);for(n.dataScale=d,n.convertAnnotations(this),o=0;o<e.length;++o)!0===(i=e[o]).visible&&0!==i._length&&((a=n.traces[i.uid])?a.data.type===i.type?a.update(i):(a.dispose(),a=i._module.plot(this,i),n.traces[i.uid]=a):(a=i._module.plot(this,i),n.traces[i.uid]=a),a.name=i.name);var m=Object.keys(n.traces);e:for(o=0;o<m.length;++o){for(s=0;s<e.length;++s)if(e[s].uid===m[o]&&!0===e[s].visible&&0!==e[s]._length)continue e;(a=n.traces[m[o]]).dispose(),delete n.traces[m[o]]}n.glplot.objects.sort((function(e,t){return e._trace.data.index-t._trace.data.index}));var g,y=[[0,0,0],[0,0,0]],v=[],x={};for(o=0;o<3;++o){var _;if((c=(l=u[S[o]]).type)in x?(x[c].acc*=d[o],x[c].count+=1):x[c]={acc:d[o],count:1},l.autorange){y[0][o]=1/0,y[1][o]=-1/0;var w=n.glplot.objects,k=n.fullSceneLayout.annotations||[],T=l._name.charAt(0);for(s=0;s<w.length;s++){var M=w[s],E=M.bounds,C=M._trace.data._pad||0;"ErrorBars"===M.constructor.name&&l._lowerLogErrorBound?y[0][o]=Math.min(y[0][o],l._lowerLogErrorBound):y[0][o]=Math.min(y[0][o],E[0][o]/d[o]-C),y[1][o]=Math.max(y[1][o],E[1][o]/d[o]+C)}for(s=0;s<k.length;s++){var P=k[s];if(P.visible){var L=l.r2l(P[T]);y[0][o]=Math.min(y[0][o],L),y[1][o]=Math.max(y[1][o],L)}}if("rangemode"in l&&"tozero"===l.rangemode&&(y[0][o]=Math.min(y[0][o],0),y[1][o]=Math.max(y[1][o],0)),y[0][o]>y[1][o])y[0][o]=-1,y[1][o]=1;else{var I=y[1][o]-y[0][o];y[0][o]-=I/32,y[1][o]+=I/32}if(_=[y[0][o],y[1][o]],_=b(_,l),y[0][o]=_[0],y[1][o]=_[1],l.isReversed()){var z=y[0][o];y[0][o]=y[1][o],y[1][o]=z}}else _=l.range,y[0][o]=l.r2l(_[0]),y[1][o]=l.r2l(_[1]);y[0][o]===y[1][o]&&(y[0][o]-=1,y[1][o]+=1),v[o]=y[1][o]-y[0][o],l.range=[y[0][o],y[1][o]],l.limitRange(),n.glplot.setBounds(o,{min:l.range[0]*d[o],max:l.range[1]*d[o]})}var O=u.aspectmode;if("cube"===O)g=[1,1,1];else if("manual"===O){var R=u.aspectratio;g=[R.x,R.y,R.z]}else{if("auto"!==O&&"data"!==O)throw new Error("scene.js aspectRatio was not one of the enumerated types");var D=[1,1,1];for(o=0;o<3;++o){var j=x[c=(l=u[S[o]]).type];D[o]=Math.pow(j.acc,1/j.count)/d[o]}g="data"===O||Math.max.apply(null,D)/Math.min.apply(null,D)<=4?D:[1,1,1]}u.aspectratio.x=h.aspectratio.x=g[0],u.aspectratio.y=h.aspectratio.y=g[1],u.aspectratio.z=h.aspectratio.z=g[2],n.glplot.setAspectratio(u.aspectratio),n.viewInitial.aspectratio||(n.viewInitial.aspectratio={x:u.aspectratio.x,y:u.aspectratio.y,z:u.aspectratio.z}),n.viewInitial.aspectmode||(n.viewInitial.aspectmode=u.aspectmode);var F=u.domain||null,B=t._size||null;if(F&&B){var N=n.container.style;N.position="absolute",N.left=B.l+F.x[0]*B.w+"px",N.top=B.t+(1-F.y[1])*B.h+"px",N.width=B.w*(F.x[1]-F.x[0])+"px",N.height=B.h*(F.y[1]-F.y[0])+"px"}n.glplot.redraw()}},k.destroy=function(){var e=this;e.glplot&&(e.camera.mouseListener.enabled=!1,e.container.removeEventListener("wheel",e.camera.wheelListener),e.camera=null,e.glplot.dispose(),e.container.parentNode.removeChild(e.container),e.glplot=null)},k.getCamera=function(){var e,t=this;return t.camera.view.recalcMatrix(t.camera.view.lastT()),{up:{x:(e=t.camera).up[0],y:e.up[1],z:e.up[2]},center:{x:e.center[0],y:e.center[1],z:e.center[2]},eye:{x:e.eye[0],y:e.eye[1],z:e.eye[2]},projection:{type:!0===e._ortho?"orthographic":"perspective"}}},k.setViewport=function(e){var t,r=this,n=e.camera;r.camera.lookAt.apply(this,[[(t=n).eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]),r.glplot.setAspectratio(e.aspectratio),"orthographic"===n.projection.type!==r.camera._ortho&&(r.glplot.redraw(),r.glplot.clearRGBA(),r.glplot.dispose(),r.initializeGLPlot())},k.isCameraChanged=function(e){var t=this.getCamera(),r=u.nestedProperty(e,this.id+".camera").get();function n(e,t,r,n){var i=["up","center","eye"],a=["x","y","z"];return t[i[r]]&&e[i[r]][a[n]]===t[i[r]][a[n]]}var i=!1;if(void 0===r)i=!0;else{for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!n(t,r,a,o)){i=!0;break}(!r.projection||t.projection&&t.projection.type!==r.projection.type)&&(i=!0)}return i},k.isAspectChanged=function(e){var t=this.glplot.getAspectratio(),r=u.nestedProperty(e,this.id+".aspectratio").get();return void 0===r||r.x!==t.x||r.y!==t.y||r.z!==t.z},k.saveLayout=function(e){var t,r,n,i,a,o,s=this,l=s.fullLayout,h=s.isCameraChanged(e),p=s.isAspectChanged(e),d=h||p;if(d){var f={};h&&(t=s.getCamera(),n=(r=u.nestedProperty(e,s.id+".camera")).get(),f[s.id+".camera"]=n),p&&(i=s.glplot.getAspectratio(),o=(a=u.nestedProperty(e,s.id+".aspectratio")).get(),f[s.id+".aspectratio"]=o),c.call("_storeDirectGUIEdit",e,l._preGUI,f),h&&(r.set(t),u.nestedProperty(l,s.id+".camera").set(t)),p&&(a.set(i),u.nestedProperty(l,s.id+".aspectratio").set(i),s.glplot.redraw())}return d},k.updateFx=function(e,t){var r=this,n=r.camera;if(n)if("orbit"===e)n.mode="orbit",n.keyBindingMode="rotate";else if("turntable"===e){n.up=[0,0,1],n.mode="turntable",n.keyBindingMode="rotate";var i=r.graphDiv,a=i._fullLayout,o=r.fullSceneLayout.camera,s=o.up.x,l=o.up.y,h=o.up.z;if(h/Math.sqrt(s*s+l*l+h*h)<.999){var p=r.id+".camera.up",d={x:0,y:0,z:1},f={};f[p]=d;var m=i.layout;c.call("_storeDirectGUIEdit",m,a._preGUI,f),o.up=d,u.nestedProperty(m,p).set(d)}}else n.keyBindingMode=e;r.fullSceneLayout.hovermode=t},k.toImage=function(e){var t=this;e||(e="png"),t.staticMode&&t.container.appendChild(r),t.glplot.redraw();var n=t.glplot.gl,i=n.drawingBufferWidth,a=n.drawingBufferHeight;n.bindFramebuffer(n.FRAMEBUFFER,null);var o=new Uint8Array(i*a*4);n.readPixels(0,0,i,a,n.RGBA,n.UNSIGNED_BYTE,o),function(e,t,r){for(var n=0,i=r-1;n<i;++n,--i)for(var a=0;a<t;++a)for(var o=0;o<4;++o){var s=4*(t*n+a)+o,l=4*(t*i+a)+o,c=e[s];e[s]=e[l],e[l]=c}}(o,i,a),function(e,t,r){for(var n=0;n<r;++n)for(var i=0;i<t;++i){var a=4*(t*n+i),o=e[a+3];if(o>0)for(var s=255/o,l=0;l<3;++l)e[a+l]=Math.min(s*e[a+l],255)}}(o,i,a);var s=document.createElement("canvas");s.width=i,s.height=a;var l,c=s.getContext("2d",{willReadFrequently:!0}),u=c.createImageData(i,a);switch(u.data.set(o),c.putImageData(u,0,0),e){case"jpeg":l=s.toDataURL("image/jpeg");break;case"webp":l=s.toDataURL("image/webp");break;default:l=s.toDataURL("image/png")}return t.staticMode&&t.container.removeChild(r),l},k.setConvert=function(){for(var e=0;e<3;e++){var t=this.fullSceneLayout[S[e]];p.setConvert(t,this.fullLayout),t.setScale=u.noop}},k.make4thDimension=function(){var e=this,t=e.graphDiv._fullLayout;e._mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},p.setConvert(e._mockAxis,t)},t.exports=w}}),rm=p({"src/plots/gl3d/layout/attributes.js"(e,t){t.exports={scene:{valType:"subplotid",dflt:"scene",editType:"calc+clearAxisTypes"}}}}),nm=p({"src/plots/gl3d/layout/axis_attributes.js"(e,t){var r=q(),n=Ct(),i=R().extendFlat,a=Le().overrideAll;t.exports=a({visible:n.visible,showspikes:{valType:"boolean",dflt:!0},spikesides:{valType:"boolean",dflt:!0},spikethickness:{valType:"number",min:0,dflt:2},spikecolor:{valType:"color",dflt:r.defaultLine},showbackground:{valType:"boolean",dflt:!1},backgroundcolor:{valType:"color",dflt:"rgba(204, 204, 204, 0.5)"},showaxeslabels:{valType:"boolean",dflt:!0},color:n.color,categoryorder:n.categoryorder,categoryarray:n.categoryarray,title:{text:n.title.text,font:n.title.font},type:i({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorange:n.autorange,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},rangemode:n.rangemode,minallowed:n.minallowed,maxallowed:n.maxallowed,range:i({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],anim:!1}),tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,mirror:n.mirror,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,tickfont:n.tickfont,tickangle:n.tickangle,tickprefix:n.tickprefix,showtickprefix:n.showtickprefix,ticksuffix:n.ticksuffix,showticksuffix:n.showticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickformat:n.tickformat,tickformatstops:n.tickformatstops,hoverformat:n.hoverformat,showline:n.showline,linecolor:n.linecolor,linewidth:n.linewidth,showgrid:n.showgrid,gridcolor:i({},n.gridcolor,{dflt:"rgb(204, 204, 204)"}),gridwidth:n.gridwidth,zeroline:n.zeroline,zerolinecolor:n.zerolinecolor,zerolinewidth:n.zerolinewidth},"plot","from-root")}}),im=p({"src/plots/gl3d/layout/layout_attributes.js"(e,t){var r=nm(),n=ka().attributes,i=R().extendFlat,a=st().counterRegex;function o(e,t,r){return{x:{valType:"number",dflt:e,editType:"camera"},y:{valType:"number",dflt:t,editType:"camera"},z:{valType:"number",dflt:r,editType:"camera"},editType:"camera"}}t.exports={_arrayAttrRegexps:[a("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:i(o(0,0,1),{}),center:i(o(0,0,0),{}),eye:i(o(1.25,1.25,1.25),{}),projection:{type:{valType:"enumerated",values:["perspective","orthographic"],dflt:"perspective",editType:"calc"},editType:"calc"},editType:"camera"},domain:n({name:"scene",editType:"plot"}),aspectmode:{valType:"enumerated",values:["auto","cube","data","manual"],dflt:"auto",editType:"plot",impliedEdits:{"aspectratio.x":void 0,"aspectratio.y":void 0,"aspectratio.z":void 0}},aspectratio:{x:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},y:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},z:{valType:"number",min:0,editType:"plot",impliedEdits:{"^aspectmode":"manual"}},editType:"plot",impliedEdits:{aspectmode:"manual"}},xaxis:r,yaxis:r,zaxis:r,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},uirevision:{valType:"any",editType:"none"},editType:"plot"}}}),am=p({"src/plots/gl3d/layout/axis_defaults.js"(e,t){var r=O().mix,n=st(),i=gt(),a=nm(),o=xi(),s=wi(),l=["xaxis","yaxis","zaxis"],c=13600/187;t.exports=function(e,t,u){var h,p;function d(e,t){return n.coerce(h,p,a,e,t)}for(var f=0;f<l.length;f++){var m=l[f];h=e[m]||{},(p=i.newContainer(t,m))._id=m[0]+u.scene,p._name=m,o(h,p,d,u),s(h,p,d,{font:u.font,letter:m[0],data:u.data,showGrid:!0,noAutotickangles:!0,noTicklabelindex:!0,noTickson:!0,noTicklabelmode:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noTicklabelposition:!0,noTicklabeloverflow:!0,noInsiderange:!0,bgColor:u.bgColor,calendar:u.calendar},u.fullLayout),d("gridcolor",r(p.color,u.bgColor,c).toRgbString()),d("title.text",m[0]),p.setScale=n.noop,d("showspikes")&&(d("spikesides"),d("spikethickness"),d("spikecolor",p.color)),d("showaxeslabels"),d("showbackground")&&d("backgroundcolor")}}}}),om=p({"src/plots/gl3d/layout/defaults.js"(e,t){var r=st(),n=q(),i=Ve(),a=qs(),o=am(),s=im(),l=_t().getSubplotData,c="gl3d";function u(e,t,r,a){for(var s=r("bgcolor"),u=n.combine(s,a.paper_bgcolor),h=["up","center","eye"],p=0;p<h.length;p++)r("camera."+h[p]+".x"),r("camera."+h[p]+".y"),r("camera."+h[p]+".z");r("camera.projection.type");var d=!!r("aspectratio.x")&&!!r("aspectratio.y")&&!!r("aspectratio.z"),f=r("aspectmode",d?"manual":"auto");d||(e.aspectratio=t.aspectratio={x:1,y:1,z:1},"manual"===f&&(t.aspectmode="auto"),e.aspectmode=t.aspectmode);var m=l(a.fullData,c,a.id);o(e,t,{font:a.font,scene:a.id,data:m,bgColor:u,calendar:a.calendar,autotypenumbersDflt:a.autotypenumbersDflt,fullLayout:a.fullLayout}),i.getComponentMethod("annotations3d","handleDefaults")(e,t,a);var g=a.getDfltFromLayout("dragmode");if(!1!==g&&!g)if(g="orbit",e.camera&&e.camera.up){var y=e.camera.up.x,v=e.camera.up.y,x=e.camera.up.z;0!==x&&(y&&v&&x?x/Math.sqrt(y*y+v*v+x*x)>.999&&(g="turntable"):g="turntable")}else g="turntable";r("dragmode",g),r("hovermode",a.getDfltFromLayout("hovermode"))}t.exports=function(e,t,n){var i=t._basePlotModules.length>1;a(e,t,n,{type:c,attributes:s,handleDefaults:u,fullLayout:t,font:t.font,fullData:n,getDfltFromLayout:function(t){if(!i)return r.validate(e[t],s[t])?e[t]:void 0},autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,calendar:t.calendar})}}}),sm=p({"src/plots/gl3d/index.js"(e){var t=Le().overrideAll,r=F(),n=tm(),i=_t().getSubplotData,a=st(),o=Tt(),s="gl3d",l="scene";e.name=s,e.attr=l,e.idRoot=l,e.idRegex=e.attrRegex=a.counterRegex("scene"),e.attributes=rm(),e.layoutAttributes=im(),e.baseLayoutAttrOverrides=t({hoverlabel:r.hoverlabel},"plot","nested"),e.supplyLayoutDefaults=om(),e.plot=function(e){for(var t=e._fullLayout,r=e._fullData,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=i(r,s,l),u=t[l],h=u.camera,p=u._scene;p||(p=new n({id:l,graphDiv:e,container:e.querySelector(".gl-container"),staticPlot:e._context.staticPlot,plotGlPixelRatio:e._context.plotGlPixelRatio,camera:h},t),u._scene=p),p.viewInitial||(p.viewInitial={up:{x:h.up.x,y:h.up.y,z:h.up.z},eye:{x:h.eye.x,y:h.eye.y,z:h.eye.z},center:{x:h.center.x,y:h.center.y,z:h.center.z}}),p.plot(c,t,e.layout)}},e.clean=function(e,t,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._scene&&(n[o]._scene.destroy(),n._infolayer&&n._infolayer.selectAll(".annotation-"+o).remove())}},e.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots[s],n=t._size,i=0;i<r.length;i++){var a=t[r[i]],l=a.domain,c=a._scene,u=c.toImage("png");t._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":u,x:n.l+n.w*l.x[0],y:n.t+n.h*(1-l.y[1]),width:n.w*(l.x[1]-l.x[0]),height:n.h*(l.y[1]-l.y[0]),preserveAspectRatio:"none"}),c.destroy()}},e.cleanId=function(e){if(e.match(/^scene[0-9]*$/)){var t=e.substr(5);return"1"===t&&(t=""),l+t}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[s],n=0;n<r.length;n++)t[r[n]]._scene.updateFx(t.dragmode,t.hovermode)}}}),lm=p({"src/traces/scatter3d/index.js"(e,t){t.exports={plot:Gf(),attributes:Wf(),markerSymbols:qf(),supplyDefaults:$f(),colorbar:[{container:"marker",min:"cmin",max:"cmax"},{container:"line",min:"cmin",max:"cmax"}],calc:Zf(),moduleType:"trace",name:"scatter3d",basePlotModule:sm(),categories:["gl3d","symbols","showLegend","scatter-like"],meta:{}}}}),cm=p({"lib/scatter3d.js"(e,t){t.exports=lm()}}),um=p({"src/traces/surface/attributes.js"(e,t){var r=q(),n=Lt(),i=Et().axisHoverFormat,a=Oe().hovertemplateAttrs,o=N(),s=R().extendFlat,l=Le().overrideAll;function c(e){return{show:{valType:"boolean",dflt:!1},start:{valType:"number",dflt:null,editType:"plot"},end:{valType:"number",dflt:null,editType:"plot"},size:{valType:"number",dflt:null,min:0,editType:"plot"},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:r.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:r.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var u=t.exports=l(s({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:a(),xhoverformat:i("x"),yhoverformat:i("y"),zhoverformat:i("z"),connectgaps:{valType:"boolean",dflt:!1,editType:"calc"},surfacecolor:{valType:"data_array"}},n("",{colorAttr:"z or surfacecolor",showScaleDflt:!0,autoColorDflt:!1,editTypeOverride:"calc"}),{contours:{x:c(),y:c(),z:c()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},opacityscale:{valType:"any",editType:"calc"},hoverinfo:s({},o.hoverinfo),showlegend:s({},o.showlegend,{dflt:!1})}),"calc","nested");u.x.editType=u.y.editType=u.z.editType="calc+clearAxisTypes"}}),hm=p({"src/traces/surface/defaults.js"(e,t){var r=Ve(),n=st(),i=Vt(),a=um();function o(e,t,r,n){var i=n("opacityscale");"max"===i?t.opacityscale=[[0,.1],[1,1]]:"min"===i?t.opacityscale=[[0,1],[1,.1]]:"extremes"===i?t.opacityscale=function(e,t){for(var r=[],n=0;n<32;n++){var i=n/31,a=t+(1-t)*(1-Math.pow(Math.sin(e*i*Math.PI),2));r.push([i,Math.max(0,Math.min(1,a))])}return r}(1,.1):function(e){var t=0;if(!Array.isArray(e)||e.length<2)return!1;if(!e[0]||!e[e.length-1])return!1;if(0!==+e[0][0]||1!==+e[e.length-1][0])return!1;for(var r=0;r<e.length;r++){var n=e[r];if(2!==n.length||+n[0]<t)return!1;t=+n[0]}return!0}(i)||(t.opacityscale=void 0)}t.exports={supplyDefaults:function(e,t,s,l){var c,u;function h(r,i){return n.coerce(e,t,a,r,i)}var p=h("x"),d=h("y"),f=h("z");if(!f||!f.length||p&&p.length<1||d&&d.length<1)t.visible=!1;else{t._xlength=Array.isArray(p)&&n.isArrayOrTypedArray(p[0])?f.length:f[0].length,t._ylength=f.length,r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],l),h("text"),h("hovertext"),h("hovertemplate"),h("xhoverformat"),h("yhoverformat"),h("zhoverformat"),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lightposition.x","lightposition.y","lightposition.z","hidesurface","connectgaps","opacity"].forEach((function(e){h(e)})),h("surfacecolor");var m=["x","y","z"];for(c=0;c<3;++c){var g="contours."+m[c],y=h(g+".show"),v=h(g+".highlight");if(y||v)for(u=0;u<3;++u)h(g+".project."+m[u]);y&&(h(g+".color"),h(g+".width"),h(g+".usecolormap")),v&&(h(g+".highlightcolor"),h(g+".highlightwidth")),h(g+".start"),h(g+".end"),h(g+".size")}i(e,t,l,h,{prefix:"",cLetter:"c"}),o(0,t,0,h),t._length=null}},opacityscaleDefaults:o}}}),pm=p({"src/traces/surface/calc.js"(e,t){var r=Gt();t.exports=function(e,t){t.surfacecolor?r(e,t,{vals:t.surfacecolor,containerStr:"",cLetter:"c"}):r(e,t,{vals:t.z,containerStr:"",cLetter:"c"})}}}),dm=p({"src/traces/surface/convert.js"(e,t){var r=zf().gl_surface3d,n=zf().ndarray,i=zf().ndarray_linear_interpolate.d2,a=zo(),o=Oo(),s=st().isArrayOrTypedArray,l=Uf().parseColorScale,c=Nf(),u=Wt().extractOpts;function h(e,t,r){this.scene=e,this.uid=r,this.surface=t,this.data=null,this.showContour=[!1,!1,!1],this.contourStart=[null,null,null],this.contourEnd=[null,null,null],this.contourSize=[0,0,0],this.minValues=[1/0,1/0,1/0],this.maxValues=[-1/0,-1/0,-1/0],this.dataScaleX=1,this.dataScaleY=1,this.refineData=!0,this.objectOffset=[0,0,0]}var p=h.prototype;p.getXat=function(e,t,r,n){var i=s(this.data.x)?s(this.data.x[0])?this.data.x[t][e]:this.data.x[e]:e;return void 0===r?i:n.d2l(i,0,r)},p.getYat=function(e,t,r,n){var i=s(this.data.y)?s(this.data.y[0])?this.data.y[t][e]:this.data.y[t]:t;return void 0===r?i:n.d2l(i,0,r)},p.getZat=function(e,t,r,n){var i=this.data.z[t][e];return null===i&&this.data.connectgaps&&this.data._interpolatedZ&&(i=this.data._interpolatedZ[t][e]),void 0===r?i:n.d2l(i,0,r)},p.handlePick=function(e){if(e.object===this.surface){var t=(e.data.index[0]-1)/this.dataScaleX-1,r=(e.data.index[1]-1)/this.dataScaleY-1,n=Math.max(Math.min(Math.round(t),this.data.z[0].length-1),0),i=Math.max(Math.min(Math.round(r),this.data._ylength-1),0);e.index=[n,i],e.traceCoordinate=[this.getXat(n,i),this.getYat(n,i),this.getZat(n,i)],e.dataCoordinate=[this.getXat(n,i,this.data.xcalendar,this.scene.fullSceneLayout.xaxis),this.getYat(n,i,this.data.ycalendar,this.scene.fullSceneLayout.yaxis),this.getZat(n,i,this.data.zcalendar,this.scene.fullSceneLayout.zaxis)];for(var a=0;a<3;a++){var o=e.dataCoordinate[a];null!==o&&void 0!==o&&(e.dataCoordinate[a]*=this.scene.dataScale[a])}var l=this.data.hovertext||this.data.text;return s(l)&&l[i]&&void 0!==l[i][n]?e.textLabel=l[i][n]:e.textLabel=l||"",e.data.dataCoordinate=e.dataCoordinate.slice(),this.surface.highlight(e.data),this.scene.glplot.spikes.position=e.dataCoordinate,!0}};var d=[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 f(e,t){if(e<t)return 0;for(var r=0;0===Math.floor(e%t);)e/=t,r++;return r}function m(e){for(var t=[],r=0;r<d.length;r++){var n=d[r];t.push(f(e,n))}return t}function g(e){for(var t=m(e),r=e,n=0;n<d.length;n++)if(t[n]>0){r=d[n];break}return r}function y(e,t){if(!(e<1||t<1)){for(var r=m(e),n=m(t),i=1,a=0;a<d.length;a++)i*=Math.pow(d[a],Math.max(r[a],n[a]));return i}}p.calcXnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getXat(t-1,0),i=this.getXat(t,0);r[t-1]=i!==n&&void 0!==n&&null!==n&&void 0!==i&&null!==i?Math.abs(i-n):0}var a=0;for(t=1;t<e;t++)a+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(a/r[t-1]);return r},p.calcYnums=function(e){var t,r=[];for(t=1;t<e;t++){var n=this.getYat(0,t-1),i=this.getYat(0,t);r[t-1]=i!==n&&void 0!==n&&null!==n&&void 0!==i&&null!==i?Math.abs(i-n):0}var a=0;for(t=1;t<e;t++)a+=r[t-1];for(t=1;t<e;t++)0===r[t-1]?r[t-1]=1:r[t-1]=Math.round(a/r[t-1]);return r};var v=[1,2,4,6,12,24,36,48,60,120,180,240,360,720,840,1260],x=v[9],b=v[13];function _(e,t,r){var n=r[8]+r[2]*t[0]+r[5]*t[1];return e[0]=(r[6]+r[0]*t[0]+r[3]*t[1])/n,e[1]=(r[7]+r[1]*t[0]+r[4]*t[1])/n,e}function w(e,t,r){return function(e,t,r,n){for(var a=[0,0],o=e.shape[0],s=e.shape[1],l=0;l<o;l++)for(var c=0;c<s;c++)r(a,[l,c],n),e.set(l,c,i(t,a[0],a[1]))}(e,t,_,r),e}function k(e,t){for(var r=!1,n=0;n<e.length;n++)if(t===e[n]){r=!0;break}!1===r&&e.push(t)}p.estimateScale=function(e,t){for(var r=1+function(e){if(0!==e.length){for(var t=1,r=0;r<e.length;r++)t=y(t,e[r]);return t}}(0===t?this.calcXnums(e):this.calcYnums(e));r<x;)r*=2;for(;r>b;)r--,r/=g(r),++r<x&&(r=b);var n=Math.round(r/e);return n>1?n:1},p.refineCoords=function(e){for(var t=this.dataScaleX,r=this.dataScaleY,i=e[0].shape[0],a=e[0].shape[1],o=0|Math.floor(e[0].shape[0]*t+1),s=0|Math.floor(e[0].shape[1]*r+1),l=1+i+1,c=1+a+1,u=n(new Float32Array(l*c),[l,c]),h=[1/t,0,0,0,1/r,0,0,0,1],p=0;p<e.length;++p){this.surface.padField(u,e[p]);var d=n(new Float32Array(o*s),[o,s]);w(d,u,h),e[p]=d}},p.setContourLevels=function(){var e,t,r,n=[[],[],[]],i=[!1,!1,!1],a=!1;for(e=0;e<3;++e)if(this.showContour[e]&&(a=!0,this.contourSize[e]>0&&null!==this.contourStart[e]&&null!==this.contourEnd[e]&&this.contourEnd[e]>this.contourStart[e]))for(i[e]=!0,t=this.contourStart[e];t<this.contourEnd[e];t+=this.contourSize[e])r=t*this.scene.dataScale[e],k(n[e],r);if(a){var o=[[],[],[]];for(e=0;e<3;++e)this.showContour[e]&&(o[e]=i[e]?n[e]:this.scene.contourLevels[e]);this.surface.update({levels:o})}},p.update=function(e){var t,r,i,s,h=this.scene,p=h.fullSceneLayout,d=this.surface,f=l(e),m=h.dataScale,g=e.z[0].length,y=e._ylength,v=h.contourLevels;this.data=e;var x=[];for(t=0;t<3;t++)for(x[t]=[],r=0;r<g;r++)x[t][r]=[];for(r=0;r<g;r++)for(i=0;i<y;i++)x[0][r][i]=this.getXat(r,i,e.xcalendar,p.xaxis),x[1][r][i]=this.getYat(r,i,e.ycalendar,p.yaxis),x[2][r][i]=this.getZat(r,i,e.zcalendar,p.zaxis);if(e.connectgaps)for(e._emptypoints=o(x[2]),a(x[2],e._emptypoints),e._interpolatedZ=[],r=0;r<g;r++)for(e._interpolatedZ[r]=[],i=0;i<y;i++)e._interpolatedZ[r][i]=x[2][r][i];for(t=0;t<3;t++)for(r=0;r<g;r++)for(i=0;i<y;i++)null===(s=x[t][r][i])||void 0===s?x[t][r][i]=NaN:s=x[t][r][i]*=m[t];for(t=0;t<3;t++)for(r=0;r<g;r++)for(i=0;i<y;i++)null!==(s=x[t][r][i])&&void 0!==s&&(this.minValues[t]>s&&(this.minValues[t]=s),this.maxValues[t]<s&&(this.maxValues[t]=s));for(t=0;t<3;t++)this.objectOffset[t]=.5*(this.minValues[t]+this.maxValues[t]);for(t=0;t<3;t++)for(r=0;r<g;r++)for(i=0;i<y;i++)null!==(s=x[t][r][i])&&void 0!==s&&(x[t][r][i]-=this.objectOffset[t]);var _=[n(new Float32Array(g*y),[g,y]),n(new Float32Array(g*y),[g,y]),n(new Float32Array(g*y),[g,y])];for(t=0;t<3;t++)for(r=0;r<g;r++)for(i=0;i<y;i++)_[t].set(r,i,x[t][r][i]);x=[];var w={colormap:f,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!e.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacityscale:e.opacityscale,opacity:e.opacity},k=u(e);if(w.intensityBounds=[k.min,k.max],e.surfacecolor){var T=n(new Float32Array(g*y),[g,y]);for(r=0;r<g;r++)for(i=0;i<y;i++)T.set(r,i,e.surfacecolor[i][r]);_.push(T)}else w.intensityBounds[0]*=m[2],w.intensityBounds[1]*=m[2];(b<_[0].shape[0]||b<_[0].shape[1])&&(this.refineData=!1),!0===this.refineData&&(this.dataScaleX=this.estimateScale(_[0].shape[0],0),this.dataScaleY=this.estimateScale(_[0].shape[1],1),1===this.dataScaleX&&1===this.dataScaleY||this.refineCoords(_)),e.surfacecolor&&(w.intensity=_.pop());var S=[!0,!0,!0],A=["x","y","z"];for(t=0;t<3;++t){var M=e.contours[A[t]];S[t]=M.highlight,w.showContour[t]=M.show||M.highlight,w.showContour[t]&&(w.contourProject[t]=[M.project.x,M.project.y,M.project.z],M.show?(this.showContour[t]=!0,w.levels[t]=v[t],d.highlightColor[t]=w.contourColor[t]=c(M.color),M.usecolormap?d.highlightTint[t]=w.contourTint[t]=0:d.highlightTint[t]=w.contourTint[t]=1,w.contourWidth[t]=M.width,this.contourStart[t]=M.start,this.contourEnd[t]=M.end,this.contourSize[t]=M.size):(this.showContour[t]=!1,this.contourStart[t]=null,this.contourEnd[t]=null,this.contourSize[t]=0),M.highlight&&(w.dynamicColor[t]=c(M.highlightcolor),w.dynamicWidth[t]=M.highlightwidth))}(function(e){var t=e[0].rgb,r=e[e.length-1].rgb;return t[0]===r[0]&&t[1]===r[1]&&t[2]===r[2]&&t[3]===r[3]})(f)&&(w.vertexColor=!0),w.objectOffset=this.objectOffset,w.coords=_,d.update(w),d.visible=e.visible,d.enableDynamic=S,d.enableHighlight=S,d.snapToData=!0,"lighting"in e&&(d.ambientLight=e.lighting.ambient,d.diffuseLight=e.lighting.diffuse,d.specularLight=e.lighting.specular,d.roughness=e.lighting.roughness,d.fresnel=e.lighting.fresnel),"lightposition"in e&&(d.lightPosition=[e.lightposition.x,e.lightposition.y,e.lightposition.z])},p.dispose=function(){this.scene.glplot.remove(this.surface),this.surface.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new h(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),fm=p({"src/traces/surface/index.js"(e,t){t.exports={attributes:um(),supplyDefaults:hm().supplyDefaults,colorbar:{min:"cmin",max:"cmax"},calc:pm(),plot:dm(),moduleType:"trace",name:"surface",basePlotModule:sm(),categories:["gl3d","2dMap","showLegend"],meta:{}}}}),mm=p({"lib/surface.js"(e,t){t.exports=fm()}}),gm=p({"src/traces/mesh3d/attributes.js"(e,t){var r=Lt(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=um(),o=N(),s=R().extendFlat;t.exports=s({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:i({editType:"calc"}),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("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"}},r("",{colorAttr:"`intensity`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,flatshading:{valType:"boolean",dflt:!1,editType:"calc"},contour:{show:s({},a.contours.x.show,{}),color:a.contours.x.color,width:a.contours.x.width,editType:"calc"},lightposition:{x:s({},a.lightposition.x,{dflt:1e5}),y:s({},a.lightposition.y,{dflt:1e5}),z:s({},a.lightposition.z,{dflt:0}),editType:"calc"},lighting:s({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"},a.lighting),hoverinfo:s({},o.hoverinfo,{editType:"calc"}),showlegend:s({},o.showlegend,{dflt:!1})})}}),ym=p({"src/traces/isosurface/attributes.js"(e,t){var r=Lt(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=gm(),o=N(),s=R().extendFlat,l=Le().overrideAll,c=t.exports=l(s({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:i(),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),valuehoverformat:n("value",1),showlegend:s({},o.showlegend,{dflt:!1})},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{opacity:a.opacity,lightposition:a.lightposition,lighting:a.lighting,flatshading:a.flatshading,contour:a.contour,hoverinfo:s({},o.hoverinfo)}),"calc","nested");c.flatshading.dflt=!0,c.lighting.facenormalsepsilon.dflt=0,c.x.editType=c.y.editType=c.z.editType=c.value.editType="calc+clearAxisTypes"}}),vm=p({"src/traces/isosurface/defaults.js"(e,t){var r=st(),n=Ve(),i=ym(),a=Vt();function o(e,t,r,i,o){var s=o("isomin"),l=o("isomax");void 0!==l&&null!==l&&void 0!==s&&null!==s&&s>l&&(t.isomin=null,t.isomax=null);var c=o("x"),u=o("y"),h=o("z"),p=o("value");c&&c.length&&u&&u.length&&h&&h.length&&p&&p.length?(n.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],i),o("valuehoverformat"),["x","y","z"].forEach((function(e){o(e+"hoverformat");var t="caps."+e;o(t+".show")&&o(t+".fill");var r="slices."+e;o(r+".show")&&(o(r+".fill"),o(r+".locations"))})),o("spaceframe.show")&&o("spaceframe.fill"),o("surface.show")&&(o("surface.count"),o("surface.fill"),o("surface.pattern")),o("contour.show")&&(o("contour.color"),o("contour.width")),["text","hovertext","hovertemplate","lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","opacity"].forEach((function(e){o(e)})),a(e,t,i,o,{prefix:"",cLetter:"c"}),t._length=null):t.visible=!1}t.exports={supplyDefaults:function(e,t,n,a){o(e,t,0,a,(function(n,a){return r.coerce(e,t,i,n,a)}))},supplyIsoDefaults:o}}}),xm=p({"src/traces/streamtube/calc.js"(e,t){var r=st(),n=Gt();function i(e){var t,n,i,o,s,l,c,u,h,p,d,f,m=e._x,g=e._y,y=e._z,v=e._len,x=-1/0,b=1/0,_=-1/0,w=1/0,k=-1/0,T=1/0,S="";for(v&&(c=m[0],h=g[0],d=y[0]),v>1&&(u=m[v-1],p=g[v-1],f=y[v-1]),t=0;t<v;t++)x=Math.max(x,m[t]),b=Math.min(b,m[t]),_=Math.max(_,g[t]),w=Math.min(w,g[t]),k=Math.max(k,y[t]),T=Math.min(T,y[t]),o||m[t]===c||(o=!0,S+="x"),s||g[t]===h||(s=!0,S+="y"),l||y[t]===d||(l=!0,S+="z");o||(S+="x"),s||(S+="y"),l||(S+="z");var A=a(e._x),M=a(e._y),E=a(e._z);S=(S=(S=S.replace("x",(c>u?"-":"+")+"x")).replace("y",(h>p?"-":"+")+"y")).replace("z",(d>f?"-":"+")+"z");var C=function(){v=0,A=[],M=[],E=[]};(!v||v<A.length*M.length*E.length)&&C();var P=function(e){return"x"===e?m:"y"===e?g:y},L=function(e){return"x"===e?A:"y"===e?M:E},I=function(e){return e[v-1]<e[0]?-1:1},z=P(S[1]),O=P(S[3]),R=P(S[5]),D=L(S[1]).length,j=L(S[3]).length,F=L(S[5]).length,B=!1,N=function(e,t,r){return D*(j*e+t)+r},U=I(P(S[1])),V=I(P(S[3])),q=I(P(S[5]));for(t=0;t<F-1;t++){for(n=0;n<j-1;n++){for(i=0;i<D-1;i++){var H=N(t,n,i),G=N(t,n,i+1),W=N(t,n+1,i),$=N(t+1,n,i);if(z[H]*U<z[G]*U&&O[H]*V<O[W]*V&&R[H]*q<R[$]*q||(B=!0),B)break}if(B)break}if(B)break}return B&&(r.warn("Encountered arbitrary coordinates! Unable to input data grid."),C()),{xMin:b,yMin:w,zMin:T,xMax:x,yMax:_,zMax:k,Xs:A,Ys:M,Zs:E,len:v,fill:S}}function a(e){return r.distinctVals(e).vals}function o(e,t){if(void 0===t&&(t=e.length),r.isTypedArray(e))return e.subarray(0,t);for(var n=[],i=0;i<t;i++)n[i]=+e[i];return n}t.exports={calc:function(e,t){t._len=Math.min(t.u.length,t.v.length,t.w.length,t.x.length,t.y.length,t.z.length),t._u=o(t.u,t._len),t._v=o(t.v,t._len),t._w=o(t.w,t._len),t._x=o(t.x,t._len),t._y=o(t.y,t._len),t._z=o(t.z,t._len);var r=i(t);t._gridFill=r.fill,t._Xs=r.Xs,t._Ys=r.Ys,t._Zs=r.Zs,t._len=r.len;var a,s,l,c=0;t.starts&&(a=o(t.starts.x||[]),s=o(t.starts.y||[]),l=o(t.starts.z||[]),c=Math.min(a.length,s.length,l.length)),t._startsX=a||[],t._startsY=s||[],t._startsZ=l||[];var u,h=0,p=1/0;for(u=0;u<t._len;u++){var d=t._u[u],f=t._v[u],m=t._w[u],g=Math.sqrt(d*d+f*f+m*m);h=Math.max(h,g),p=Math.min(p,g)}for(n(e,t,{vals:[p,h],containerStr:"",cLetter:"c"}),u=0;u<c;u++){var y=a[u];r.xMax=Math.max(r.xMax,y),r.xMin=Math.min(r.xMin,y);var v=s[u];r.yMax=Math.max(r.yMax,v),r.yMin=Math.min(r.yMin,v);var x=l[u];r.zMax=Math.max(r.zMax,x),r.zMin=Math.min(r.zMin,x)}t._slen=c,t._normMax=h,t._xbnds=[r.xMin,r.xMax],t._ybnds=[r.yMin,r.yMax],t._zbnds=[r.zMin,r.zMax]},filter:o,processGrid:i}}}),bm=p({"src/traces/isosurface/calc.js"(e,t){var r=Gt(),n=xm().processGrid,i=xm().filter;t.exports=function(e,t){t._len=Math.min(t.x.length,t.y.length,t.z.length,t.value.length),t._x=i(t.x,t._len),t._y=i(t.y,t._len),t._z=i(t.z,t._len),t._value=i(t.value,t._len);var a=n(t);t._gridFill=a.fill,t._Xs=a.Xs,t._Ys=a.Ys,t._Zs=a.Zs,t._len=a.len;for(var o=1/0,s=-1/0,l=0;l<t._len;l++){var c=t._value[l];o=Math.min(o,c),s=Math.max(s,c)}t._minValues=o,t._maxValues=s,t._vMin=void 0===t.isomin||null===t.isomin?o:t.isomin,t._vMax=void 0===t.isomax||null===t.isomax?s:t.isomax,r(e,t,{vals:[t._vMin,t._vMax],containerStr:"",cLetter:"c"})}}}),_m=p({"src/plots/gl3d/zip3.js"(e,t){t.exports=function(e,t,r,n){n=n||e.length;for(var i=new Array(n),a=0;a<n;a++)i[a]=[e[a],t[a],r[a]];return i}}}),wm=p({"src/traces/isosurface/convert.js"(e,t){var r=zf().gl_mesh3d,n=Uf().parseColorScale,i=st().isArrayOrTypedArray,a=Nf(),o=Wt().extractOpts,s=_m(),l=function(e,t){for(var r=t.length-1;r>0;r--){var n=Math.min(t[r],t[r-1]),i=Math.max(t[r],t[r-1]);if(i>n&&n<e&&e<=i)return{id:r,distRatio:(i-e)/(i-n)}}return{id:0,distRatio:0}};function c(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,p=e.index=h+s*u+s*o*c;e.traceCoordinate=[this.data._meshX[p],this.data._meshY[p],this.data._meshZ[p],this.data._value[p]];var d=this.data.hovertext||this.data.text;return i(d)&&void 0!==d[p]?e.textLabel=d[p]:d&&(e.textLabel=d),!0}},u.update=function(e){var t=this.scene,r=t.fullSceneLayout;function i(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=p(e);var l={positions:s(i(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},c=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[c.min,c.max],l.colormap=n(e),this.mesh.update(l)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()};var h=["xyz","xzy","yxz","yzx","zxy","zyx"];function p(e){e._meshI=[],e._meshJ=[],e._meshK=[];var t,r,n,i,a,o,s,c=e.surface.show,u=e.spaceframe.show,p=e.surface.fill,d=e.spaceframe.fill,f=!1,m=!1,g=0,y=e._Xs,v=e._Ys,x=e._Zs,b=y.length,_=v.length,w=x.length,k=h.indexOf(e._gridFill.replace(/-/g,"").replace(/\+/g,"")),T=function(e,t,r){switch(k){case 5:return r+w*t+w*_*e;case 4:return r+w*e+w*b*t;case 3:return t+_*r+_*w*e;case 2:return t+_*e+_*b*r;case 1:return e+b*r+b*w*t;default:return e+b*t+b*_*r}},S=e._minValues,A=e._maxValues,M=e._vMin,E=e._vMax;function C(e,t,s){for(var l=o.length,c=r;c<l;c++)if(e===n[c]&&t===i[c]&&s===a[c])return c;return-1}function P(){r=t}function L(){n=[],i=[],a=[],o=[],t=0,P()}function I(e,r,s,l){return n.push(e),i.push(r),a.push(s),o.push(l),++t-1}function z(e,t,r){for(var n=[],i=0;i<e.length;i++)n[i]=e[i]*(1-r)+r*t[i];return n}function O(e){s=e}function R(e,t){return"all"===e||null===e||e.indexOf(t)>-1}function D(e,t){return null===e?t:e}function j(t,r,n){P();var i,a,o,l=[r],c=[n];if(s>=1)l=[r],c=[n];else if(s>0){var u=function(e,t){var r=e[0],n=e[1],i=e[2],a=function(e,t,r){for(var n=[],i=0;i<e.length;i++)n[i]=(e[i]+t[i]+r[i])/3;return n}(r,n,i),o=Math.sqrt(1-s),l=z(a,r,o),c=z(a,n,o),u=z(a,i,o),h=t[0],p=t[1],d=t[2];return{xyzv:[[r,n,c],[c,l,r],[n,i,u],[u,c,n],[i,r,l],[l,u,i]],abc:[[h,p,-1],[-1,-1,h],[p,d,-1],[-1,-1,p],[d,h,-1],[-1,-1,d]]}}(r,n);l=u.xyzv,c=u.abc}for(var h=0;h<l.length;h++){r=l[h],n=c[h];for(var p=[],d=0;d<3;d++){var f=r[d][0],m=r[d][1],y=r[d][2],v=r[d][3],x=n[d]>-1?n[d]:C(f,m,y);p[d]=x>-1?x:I(f,m,y,D(t,v))}i=p[0],a=p[1],o=p[2],e._meshI.push(i),e._meshJ.push(a),e._meshK.push(o),++g}}function F(e,t,r,n){var i=e[3];i<r&&(i=r),i>n&&(i=n);for(var a=(e[3]-i)/(e[3]-t[3]+1e-9),o=[],s=0;s<4;s++)o[s]=(1-a)*e[s]+a*t[s];return o}function B(e,t,r){return e>=t&&e<=r}function N(e){var t=.001*(E-M);return e>=M-t&&e<=E+t}function U(t){for(var r=[],n=0;n<4;n++){var i=t[n];r.push([e._x[i],e._y[i],e._z[i],e._value[i]])}return r}function V(e,t,r,n,i,a){a||(a=1),r=[-1,-1,-1];var o=!1,s=[B(t[0][3],n,i),B(t[1][3],n,i),B(t[2][3],n,i)];if(!s[0]&&!s[1]&&!s[2])return!1;var l=function(e,t,r){return N(t[0][3])&&N(t[1][3])&&N(t[2][3])?(j(e,t,r),!0):a<3&&V(e,t,r,M,E,++a)};if(s[0]&&s[1]&&s[2])return l(e,t,r)||o;var c=!1;return[[0,1,2],[2,0,1],[1,2,0]].forEach((function(a){if(s[a[0]]&&s[a[1]]&&!s[a[2]]){var u=t[a[0]],h=t[a[1]],p=t[a[2]],d=F(p,u,n,i),f=F(p,h,n,i);o=l(e,[f,d,u],[-1,-1,r[a[0]]])||o,o=l(e,[u,h,f],[r[a[0]],r[a[1]],-1])||o,c=!0}})),c||[[0,1,2],[1,2,0],[2,0,1]].forEach((function(a){if(s[a[0]]&&!s[a[1]]&&!s[a[2]]){var u=t[a[0]],h=t[a[1]],p=t[a[2]],d=F(h,u,n,i),f=F(p,u,n,i);o=l(e,[f,d,u],[-1,-1,r[a[0]]])||o,c=!0}})),o}function q(e,t,r,n){var i=!1,a=U(t),o=[B(a[0][3],r,n),B(a[1][3],r,n),B(a[2][3],r,n),B(a[3][3],r,n)];if(!o[0]&&!o[1]&&!o[2]&&!o[3])return i;if(o[0]&&o[1]&&o[2]&&o[3])return m&&(i=function(e,t,r){var n=function(n,i,a){j(e,[t[n],t[i],t[a]],[r[n],r[i],r[a]])};n(0,1,2),n(3,0,1),n(2,3,0),n(1,2,3)}(e,a,t)||i),i;var s=!1;return[[0,1,2,3],[3,0,1,2],[2,3,0,1],[1,2,3,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]];if(m)i=j(e,[c,u,h],[t[l[0]],t[l[1]],t[l[2]]])||i;else{var d=F(p,c,r,n),f=F(p,u,r,n),g=F(p,h,r,n);i=j(null,[d,f,g],[-1,-1,-1])||i}s=!0}})),s||([[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2],[0,2,3,1],[1,3,2,0]].forEach((function(l){if(o[l[0]]&&o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],d=F(h,c,r,n),f=F(h,u,r,n),g=F(p,u,r,n),y=F(p,c,r,n);m?(i=j(e,[c,y,d],[t[l[0]],-1,-1])||i,i=j(e,[u,f,g],[t[l[1]],-1,-1])||i):i=function(e,t,r){var n=function(n,i,a){j(e,[t[n],t[i],t[a]],[r[n],r[i],r[a]])};n(0,1,2),n(2,3,0)}(null,[d,f,g,y],[-1,-1,-1,-1])||i,s=!0}})),s||[[0,1,2,3],[1,2,3,0],[2,3,0,1],[3,0,1,2]].forEach((function(l){if(o[l[0]]&&!o[l[1]]&&!o[l[2]]&&!o[l[3]]){var c=a[l[0]],u=a[l[1]],h=a[l[2]],p=a[l[3]],d=F(u,c,r,n),f=F(h,c,r,n),g=F(p,c,r,n);m?(i=j(e,[c,d,f],[t[l[0]],-1,-1])||i,i=j(e,[c,f,g],[t[l[0]],-1,-1])||i,i=j(e,[c,g,d],[t[l[0]],-1,-1])||i):i=j(null,[d,f,g],[-1,-1,-1])||i,s=!0}}))),i}function H(e,t,r,n,i,a,o,s,l,c,u){var h=!1;return f&&(R(e,"A")&&(h=q(null,[t,r,n,a],c,u)||h),R(e,"B")&&(h=q(null,[r,n,i,l],c,u)||h),R(e,"C")&&(h=q(null,[r,a,o,l],c,u)||h),R(e,"D")&&(h=q(null,[n,a,s,l],c,u)||h),R(e,"E")&&(h=q(null,[r,n,a,l],c,u)||h)),m&&(h=q(e,[r,n,a,l],c,u)||h),h}function G(e,t,r,n,i,a,o,s){return[!0===s[0]||V(e,U([t,r,n]),[t,r,n],a,o),!0===s[1]||V(e,U([n,i,t]),[n,i,t],a,o)]}function W(e,t,r,n,i,a,o,s,l){return s?G(e,t,r,i,n,a,o,l):G(e,r,i,n,t,a,o,l)}function $(e,t,r,n,i,a,o){var s,l,c,u,h=!1,p=function(){h=V(e,[s,l,c],[-1,-1,-1],i,a)||h,h=V(e,[c,u,s],[-1,-1,-1],i,a)||h},d=o[0],f=o[1],m=o[2];return d&&(s=z(U([T(t,r-0,n-0)])[0],U([T(t-1,r-0,n-0)])[0],d),l=z(U([T(t,r-0,n-1)])[0],U([T(t-1,r-0,n-1)])[0],d),c=z(U([T(t,r-1,n-1)])[0],U([T(t-1,r-1,n-1)])[0],d),u=z(U([T(t,r-1,n-0)])[0],U([T(t-1,r-1,n-0)])[0],d),p()),f&&(s=z(U([T(t-0,r,n-0)])[0],U([T(t-0,r-1,n-0)])[0],f),l=z(U([T(t-0,r,n-1)])[0],U([T(t-0,r-1,n-1)])[0],f),c=z(U([T(t-1,r,n-1)])[0],U([T(t-1,r-1,n-1)])[0],f),u=z(U([T(t-1,r,n-0)])[0],U([T(t-1,r-1,n-0)])[0],f),p()),m&&(s=z(U([T(t-0,r-0,n)])[0],U([T(t-0,r-0,n-1)])[0],m),l=z(U([T(t-0,r-1,n)])[0],U([T(t-0,r-1,n-1)])[0],m),c=z(U([T(t-1,r-1,n)])[0],U([T(t-1,r-1,n-1)])[0],m),u=z(U([T(t-1,r-0,n)])[0],U([T(t-1,r-0,n-1)])[0],m),p()),h}function Z(e,t,r,n,i,a,o,s,l,c,u,h){var p=e;return h?(f&&"even"===e&&(p=null),H(p,t,r,n,i,a,o,s,l,c,u)):(f&&"odd"===e&&(p=null),H(p,l,s,o,a,i,n,r,t,c,u))}function X(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<w;c++)for(var u=1;u<_;u++)a.push(W(e,T(l,u-1,c-1),T(l,u-1,c),T(l,u,c-1),T(l,u,c),r,n,(l+u+c)%2,i&&i[o]?i[o]:[])),o++;return a}function Y(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<b;c++)for(var u=1;u<w;u++)a.push(W(e,T(c-1,l,u-1),T(c,l,u-1),T(c-1,l,u),T(c,l,u),r,n,(c+l+u)%2,i&&i[o]?i[o]:[])),o++;return a}function K(e,t,r,n,i){for(var a=[],o=0,s=0;s<t.length;s++)for(var l=t[s],c=1;c<_;c++)for(var u=1;u<b;u++)a.push(W(e,T(u-1,c-1,l),T(u-1,c,l),T(u,c-1,l),T(u,c,l),r,n,(u+c+l)%2,i&&i[o]?i[o]:[])),o++;return a}function J(e,t,r){for(var n=1;n<w;n++)for(var i=1;i<_;i++)for(var a=1;a<b;a++)Z(e,T(a-1,i-1,n-1),T(a-1,i-1,n),T(a-1,i,n-1),T(a-1,i,n),T(a,i-1,n-1),T(a,i-1,n),T(a,i,n-1),T(a,i,n),t,r,(a+i+n)%2)}function Q(e,t,r){f=!0,J(e,t,r),f=!1}function ee(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<w;u++)for(var h=1;h<_;h++)o.push($(e,c,h,u,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function te(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<b;u++)for(var h=1;h<w;h++)o.push($(e,u,c,h,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function re(e,t,r,n,i,a){for(var o=[],s=0,l=0;l<t.length;l++)for(var c=t[l],u=1;u<_;u++)for(var h=1;h<b;h++)o.push($(e,h,u,c,r,n,i[l],a&&a[s]&&a[s])),s++;return o}function ne(e,t){for(var r=[],n=e;n<t;n++)r.push(n);return r}return function(){L(),function(){for(var t=0;t<b;t++)for(var r=0;r<_;r++)for(var n=0;n<w;n++){var i=T(t,r,n);I(e._x[i],e._y[i],e._z[i],e._value[i])}}();var t=null;if(u&&d&&(O(d),m=!0,J(t,M,E),m=!1),c&&p){O(p);for(var r=e.surface.pattern,s=e.surface.count,h=0;h<s;h++){var f=1===s?.5:h/(s-1),k=(1-f)*M+f*E,C=Math.abs(k-S)>Math.abs(k-A)?[S,k]:[k,A];Q(r,C[0],C[1])}}var P=[[Math.min(M,A),Math.max(M,A)],[Math.min(S,E),Math.max(S,E)]];["x","y","z"].forEach((function(r){for(var n=[],i=0;i<P.length;i++){var a=0,o=P[i][0],s=P[i][1],c=e.slices[r];if(c.show&&c.fill){O(c.fill);var u=[],h=[],p=[];if(c.locations.length)for(var d=0;d<c.locations.length;d++){var f=l(c.locations[d],"x"===r?y:"y"===r?v:x);0===f.distRatio?u.push(f.id):f.id>0&&(h.push(f.id),"x"===r?p.push([f.distRatio,0,0]):"y"===r?p.push([0,f.distRatio,0]):p.push([0,0,f.distRatio]))}else u=ne(1,"x"===r?b-1:"y"===r?_-1:w-1);h.length>0&&(n[a]="x"===r?ee(t,h,o,s,p,n[a]):"y"===r?te(t,h,o,s,p,n[a]):re(t,h,o,s,p,n[a]),a++),u.length>0&&(n[a]="x"===r?X(t,u,o,s,n[a]):"y"===r?Y(t,u,o,s,n[a]):K(t,u,o,s,n[a]),a++)}var m=e.caps[r];m.show&&m.fill&&(O(m.fill),n[a]="x"===r?X(t,[0,b-1],o,s,n[a]):"y"===r?Y(t,[0,_-1],o,s,n[a]):K(t,[0,w-1],o,s,n[a]),a++)}})),0===g&&L(),e._meshX=n,e._meshY=i,e._meshZ=a,e._meshIntensity=o,e._Xs=y,e._Ys=v,e._Zs=x}(),e}t.exports={findNearestOnAxis:l,generateIsoMeshes:p,createIsosurfaceTrace:function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new c(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}}),km=p({"src/traces/isosurface/index.js"(e,t){t.exports={attributes:ym(),supplyDefaults:vm().supplyDefaults,calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:wm().createIsosurfaceTrace,moduleType:"trace",name:"isosurface",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Tm=p({"lib/isosurface.js"(e,t){t.exports=km()}}),Sm=p({"src/traces/volume/attributes.js"(e,t){var r=Lt(),n=ym(),i=um(),a=N(),o=R().extendFlat,s=Le().overrideAll,l=t.exports=s(o({x:n.x,y:n.y,z:n.z,value:n.value,isomin:n.isomin,isomax:n.isomax,surface:n.surface,spaceframe:{show:{valType:"boolean",dflt:!1},fill:{valType:"number",min:0,max:1,dflt:1}},slices:n.slices,caps:n.caps,text:n.text,hovertext:n.hovertext,xhoverformat:n.xhoverformat,yhoverformat:n.yhoverformat,zhoverformat:n.zhoverformat,valuehoverformat:n.valuehoverformat,hovertemplate:n.hovertemplate},r("",{colorAttr:"`value`",showScaleDflt:!0,editTypeOverride:"calc"}),{colorbar:n.colorbar,opacity:n.opacity,opacityscale:i.opacityscale,lightposition:n.lightposition,lighting:n.lighting,flatshading:n.flatshading,contour:n.contour,hoverinfo:o({},a.hoverinfo),showlegend:o({},a.showlegend,{dflt:!1})}),"calc","nested");l.x.editType=l.y.editType=l.z.editType=l.value.editType="calc+clearAxisTypes"}}),Am=p({"src/traces/volume/defaults.js"(e,t){var r=st(),n=Sm(),i=vm().supplyIsoDefaults,a=hm().opacityscaleDefaults;t.exports=function(e,t,o,s){function l(i,a){return r.coerce(e,t,n,i,a)}i(e,t,o,s,l),a(e,t,s,l)}}}),Mm=p({"src/traces/volume/convert.js"(e,t){var r=zf().gl_mesh3d,n=Uf().parseColorScale,i=st().isArrayOrTypedArray,a=Nf(),o=Wt().extractOpts,s=_m(),l=wm().findNearestOnAxis,c=wm().generateIsoMeshes;function u(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.data=null,this.showContour=!1}var h=u.prototype;h.handlePick=function(e){if(e.object===this.mesh){var t=e.data.index,r=this.data._meshX[t],n=this.data._meshY[t],a=this.data._meshZ[t],o=this.data._Ys.length,s=this.data._Zs.length,c=l(r,this.data._Xs).id,u=l(n,this.data._Ys).id,h=l(a,this.data._Zs).id,p=e.index=h+s*u+s*o*c;e.traceCoordinate=[this.data._meshX[p],this.data._meshY[p],this.data._meshZ[p],this.data._value[p]];var d=this.data.hovertext||this.data.text;return i(d)&&void 0!==d[p]?e.textLabel=d[p]:d&&(e.textLabel=d),!0}},h.update=function(e){var t=this.scene,r=t.fullSceneLayout;function i(e,t,r,n){return t.map((function(t){return e.d2l(t,0,n)*r}))}this.data=c(e);var l={positions:s(i(r.xaxis,e._meshX,t.dataScale[0],e.xcalendar),i(r.yaxis,e._meshY,t.dataScale[1],e.ycalendar),i(r.zaxis,e._meshZ,t.dataScale[2],e.zcalendar)),cells:s(e._meshI,e._meshJ,e._meshK),lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,opacityscale:e.opacityscale,contourEnable:e.contour.show,contourColor:a(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading},u=o(e);l.vertexIntensity=e._meshIntensity,l.vertexIntensityBounds=[u.min,u.max],l.colormap=n(e),this.mesh.update(l)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new u(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),Em=p({"src/traces/volume/index.js"(e,t){t.exports={attributes:Sm(),supplyDefaults:Am(),calc:bm(),colorbar:{min:"cmin",max:"cmax"},plot:Mm(),moduleType:"trace",name:"volume",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Cm=p({"lib/volume.js"(e,t){t.exports=Em()}}),Pm=p({"src/traces/mesh3d/defaults.js"(e,t){var r=Ve(),n=st(),i=Vt(),a=gm();t.exports=function(e,t,o,s){function l(r,i){return n.coerce(e,t,a,r,i)}function c(e){var t=e.map((function(e){var t=l(e);return t&&n.isArrayOrTypedArray(t)?t:null}));return t.every((function(e){return e&&e.length===t[0].length}))&&t}c(["x","y","z"])?(c(["i","j","k"]),(!t.i||t.j&&t.k)&&(!t.j||t.k&&t.i)&&(!t.k||t.i&&t.j)?(r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x","y","z"],s),["lighting.ambient","lighting.diffuse","lighting.specular","lighting.roughness","lighting.fresnel","lighting.vertexnormalsepsilon","lighting.facenormalsepsilon","lightposition.x","lightposition.y","lightposition.z","flatshading","alphahull","delaunayaxis","opacity"].forEach((function(e){l(e)})),l("contour.show")&&(l("contour.color"),l("contour.width")),"intensity"in e?(l("intensity"),l("intensitymode"),i(e,t,s,l,{prefix:"",cLetter:"c"})):(t.showscale=!1,"facecolor"in e?l("facecolor"):"vertexcolor"in e?l("vertexcolor"):l("color",o)),l("text"),l("hovertext"),l("hovertemplate"),l("xhoverformat"),l("yhoverformat"),l("zhoverformat"),t._length=null):t.visible=!1):t.visible=!1}}}),Lm=p({"src/traces/mesh3d/calc.js"(e,t){var r=Gt();t.exports=function(e,t){t.intensity&&r(e,t,{vals:t.intensity,containerStr:"",cLetter:"c"})}}}),Im=p({"src/traces/mesh3d/convert.js"(e,t){var r=zf().gl_mesh3d,n=zf().delaunay_triangulate,i=zf().alpha_shape,a=zf().convex_hull,o=Uf().parseColorScale,s=st().isArrayOrTypedArray,l=Nf(),c=Wt().extractOpts,u=_m();function h(e,t,r){this.scene=e,this.uid=r,this.mesh=t,this.name="",this.color="#fff",this.data=null,this.showContour=!1}var p=h.prototype;function d(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=l(e[n]);return t}function f(e,t,r,n){for(var i=[],a=t.length,o=0;o<a;o++)i[o]=e.d2l(t[o],0,n)*r;return i}function m(e){for(var t=[],r=e.length,n=0;n<r;n++)t[n]=Math.round(e[n]);return t}function g(e,t){for(var r=e.length,n=0;n<r;n++)if(e[n]<=-.5||e[n]>=t-.5)return!1;return!0}p.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index;e.data._cellCenter?e.traceCoordinate=e.data.dataCoordinate:e.traceCoordinate=[this.data.x[t],this.data.y[t],this.data.z[t]];var r=this.data.hovertext||this.data.text;return s(r)&&void 0!==r[t]?e.textLabel=r[t]:r&&(e.textLabel=r),!0}},p.update=function(e){var t=this.scene,r=t.fullSceneLayout;this.data=e;var s,h=e.x.length,p=u(f(r.xaxis,e.x,t.dataScale[0],e.xcalendar),f(r.yaxis,e.y,t.dataScale[1],e.ycalendar),f(r.zaxis,e.z,t.dataScale[2],e.zcalendar));if(e.i&&e.j&&e.k){if(e.i.length!==e.j.length||e.j.length!==e.k.length||!g(e.i,h)||!g(e.j,h)||!g(e.k,h))return;s=u(m(e.i),m(e.j),m(e.k))}else s=0===e.alphahull?a(p):e.alphahull>0?i(e.alphahull,p):function(e,t){for(var r=["x","y","z"].indexOf(e),i=[],a=t.length,o=0;o<a;o++)i[o]=[t[o][(r+1)%3],t[o][(r+2)%3]];return n(i)}(e.delaunayaxis,p);var y={positions:p,cells:s,lightPosition:[e.lightposition.x,e.lightposition.y,e.lightposition.z],ambient:e.lighting.ambient,diffuse:e.lighting.diffuse,specular:e.lighting.specular,roughness:e.lighting.roughness,fresnel:e.lighting.fresnel,vertexNormalsEpsilon:e.lighting.vertexnormalsepsilon,faceNormalsEpsilon:e.lighting.facenormalsepsilon,opacity:e.opacity,contourEnable:e.contour.show,contourColor:l(e.contour.color).slice(0,3),contourWidth:e.contour.width,useFacetNormals:e.flatshading};if(e.intensity){var v=c(e);this.color="#fff";var x=e.intensitymode;y[x+"Intensity"]=e.intensity,y[x+"IntensityBounds"]=[v.min,v.max],y.colormap=o(e)}else e.vertexcolor?(this.color=e.vertexcolor[0],y.vertexColors=d(e.vertexcolor)):e.facecolor?(this.color=e.facecolor[0],y.cellColors=d(e.facecolor)):(this.color=e.color,y.meshColor=l(e.color));this.mesh.update(y)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var n=e.glplot.gl,i=r({gl:n}),a=new h(e,i,t.uid);return i._trace=a,a.update(t),e.glplot.add(i),a}}}),zm=p({"src/traces/mesh3d/index.js"(e,t){t.exports={attributes:gm(),supplyDefaults:Pm(),calc:Lm(),colorbar:{min:"cmin",max:"cmax"},plot:Im(),moduleType:"trace",name:"mesh3d",basePlotModule:sm(),categories:["gl3d","showLegend"],meta:{}}}}),Om=p({"lib/mesh3d.js"(e,t){t.exports=zm()}}),Rm=p({"src/traces/cone/attributes.js"(e,t){var r=Lt(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=gm(),o=N(),s=R().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},sizemode:{valType:"enumerated",values:["scaled","absolute","raw"],editType:"calc",dflt:"scaled"},sizeref:{valType:"number",editType:"calc",min:0},anchor:{valType:"enumerated",editType:"calc",values:["tip","tail","cm","center"],dflt:"cm"},text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["norm"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){l[e]=a[e]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","text","name"],dflt:"x+y+z+norm+text+name"}),t.exports=l}}),Dm=p({"src/traces/cone/defaults.js"(e,t){var r=st(),n=Vt(),i=Rm();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),p=s("y"),d=s("z");if(l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&p&&p.length&&d&&d.length){var f=s("sizemode");s("sizeref","raw"===f?1:.5),s("anchor"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(e,t,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),t._length=null}else t.visible=!1}}}),jm=p({"src/traces/cone/calc.js"(e,t){var r=Gt();t.exports=function(e,t){for(var n=t.u,i=t.v,a=t.w,o=Math.min(t.x.length,t.y.length,t.z.length,n.length,i.length,a.length),s=-1/0,l=1/0,c=0;c<o;c++){var u=n[c],h=i[c],p=a[c],d=Math.sqrt(u*u+h*h+p*p);s=Math.max(s,d),l=Math.min(l,d)}t._len=o,t._normMax=s,r(e,t,{vals:[l,s],containerStr:"",cLetter:"c"})}}}),Fm=p({"src/traces/cone/convert.js"(e,t){var r=zf().gl_cone3d,n=zf().gl_cone3d.createConeMesh,i=st().simpleMap,a=Uf().parseColorScale,o=Wt().extractOpts,s=st().isArrayOrTypedArray,l=_m();function c(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=c.prototype;u.handlePick=function(e){if(e.object===this.mesh){var t=e.index=e.data.index,r=this.data.x[t],n=this.data.y[t],i=this.data.z[t],a=this.data.u[t],o=this.data.v[t],l=this.data.w[t];e.traceCoordinate=[r,n,i,a,o,l,Math.sqrt(a*a+o*o+l*l)];var c=this.data.hovertext||this.data.text;return s(c)&&void 0!==c[t]?e.textLabel=c[t]:c&&(e.textLabel=c),!0}};var h={xaxis:0,yaxis:1,zaxis:2},p={tip:1,tail:0,cm:.25,center:.5},d={tip:1,tail:1,cm:.75,center:.5};function f(e,t){var n=e.fullSceneLayout,s=e.dataScale,c={};function u(e,t){var r=n[t],a=s[h[t]];return i(e,(function(e){return r.d2l(e)*a}))}c.vectors=l(u(t.u,"xaxis"),u(t.v,"yaxis"),u(t.w,"zaxis"),t._len),c.positions=l(u(t.x,"xaxis"),u(t.y,"yaxis"),u(t.z,"zaxis"),t._len);var f=o(t);c.colormap=a(t),c.vertexIntensityBounds=[f.min/t._normMax,f.max/t._normMax],c.coneOffset=p[t.anchor];var m=t.sizemode;"scaled"===m?c.coneSize=t.sizeref||.5:"absolute"===m?c.coneSize=t.sizeref&&t._normMax?t.sizeref/t._normMax:.5:"raw"===m&&(c.coneSize=t.sizeref),c.coneSizemode=m;var g=r(c),y=t.lightposition;return g.lightPosition=[y.x,y.y,y.z],g.ambient=t.lighting.ambient,g.diffuse=t.lighting.diffuse,g.specular=t.lighting.specular,g.roughness=t.lighting.roughness,g.fresnel=t.lighting.fresnel,g.opacity=t.opacity,t._pad=d[t.anchor]*g.vectorScale*g.coneScale*t._normMax,g}u.update=function(e){this.data=e;var t=f(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,i=f(e,t),a=n(r,i),o=new c(e,t.uid);return o.mesh=a,o.data=t,a._trace=o,e.glplot.add(a),o}}}),Bm=p({"src/traces/cone/index.js"(e,t){t.exports={moduleType:"trace",name:"cone",basePlotModule:sm(),categories:["gl3d","showLegend"],attributes:Rm(),supplyDefaults:Dm(),colorbar:{min:"cmin",max:"cmax"},calc:jm(),plot:Fm(),eventData:function(e,t){return e.norm=t.traceCoordinate[6],e},meta:{}}}}),Nm=p({"lib/cone.js"(e,t){t.exports=Bm()}}),Um=p({"src/traces/streamtube/attributes.js"(e,t){var r=Lt(),n=Et().axisHoverFormat,i=Oe().hovertemplateAttrs,a=gm(),o=N(),s=R().extendFlat,l={x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},z:{valType:"data_array",editType:"calc+clearAxisTypes"},u:{valType:"data_array",editType:"calc"},v:{valType:"data_array",editType:"calc"},w:{valType:"data_array",editType:"calc"},starts:{x:{valType:"data_array",editType:"calc"},y:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},editType:"calc"},maxdisplayed:{valType:"integer",min:0,dflt:1e3,editType:"calc"},sizeref:{valType:"number",editType:"calc",min:0,dflt:1},text:{valType:"string",dflt:"",editType:"calc"},hovertext:{valType:"string",dflt:"",editType:"calc"},hovertemplate:i({editType:"calc"},{keys:["tubex","tubey","tubez","tubeu","tubev","tubew","norm","divergence"]}),uhoverformat:n("u",1),vhoverformat:n("v",1),whoverformat:n("w",1),xhoverformat:n("x"),yhoverformat:n("y"),zhoverformat:n("z"),showlegend:s({},o.showlegend,{dflt:!1})};s(l,r("",{colorAttr:"u/v/w norm",showScaleDflt:!0,editTypeOverride:"calc"})),["opacity","lightposition","lighting"].forEach((function(e){l[e]=a[e]})),l.hoverinfo=s({},o.hoverinfo,{editType:"calc",flags:["x","y","z","u","v","w","norm","divergence","text","name"],dflt:"x+y+z+norm+text+name"}),t.exports=l}}),Vm=p({"src/traces/streamtube/defaults.js"(e,t){var r=st(),n=Vt(),i=Um();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("u"),c=s("v"),u=s("w"),h=s("x"),p=s("y"),d=s("z");l&&l.length&&c&&c.length&&u&&u.length&&h&&h.length&&p&&p.length&&d&&d.length?(s("starts.x"),s("starts.y"),s("starts.z"),s("maxdisplayed"),s("sizeref"),s("lighting.ambient"),s("lighting.diffuse"),s("lighting.specular"),s("lighting.roughness"),s("lighting.fresnel"),s("lightposition.x"),s("lightposition.y"),s("lightposition.z"),n(e,t,o,s,{prefix:"",cLetter:"c"}),s("text"),s("hovertext"),s("hovertemplate"),s("uhoverformat"),s("vhoverformat"),s("whoverformat"),s("xhoverformat"),s("yhoverformat"),s("zhoverformat"),t._length=null):t.visible=!1}}}),qm=p({"src/traces/streamtube/convert.js"(e,t){var r=zf().gl_streamtube3d,n=r.createTubeMesh,i=st(),a=Uf().parseColorScale,o=Wt().extractOpts,s=_m(),l={xaxis:0,yaxis:1,zaxis:2};function c(e,t){this.scene=e,this.uid=t,this.mesh=null,this.data=null}var u=c.prototype;function h(e){var t=e.length;return t>2?e.slice(1,t-1):2===t?[(e[0]+e[1])/2]:e}function p(e){var t=e.length;return 1===t?[.5,.5]:[e[1]-e[0],e[t-1]-e[t-2]]}function d(e,t){var n=e.fullSceneLayout,c=e.dataScale,u=t._len,d={};function f(e,t){var r=n[t],a=c[l[t]];return i.simpleMap(e,(function(e){return r.d2l(e)*a}))}if(d.vectors=s(f(t._u,"xaxis"),f(t._v,"yaxis"),f(t._w,"zaxis"),u),!u)return{positions:[],cells:[]};var m=f(t._Xs,"xaxis"),g=f(t._Ys,"yaxis"),y=f(t._Zs,"zaxis");if(d.meshgrid=[m,g,y],d.gridFill=t._gridFill,t._slen)d.startingPositions=s(f(t._startsX,"xaxis"),f(t._startsY,"yaxis"),f(t._startsZ,"zaxis"));else{for(var v=g[0],x=h(m),b=h(y),_=new Array(x.length*b.length),w=0,k=0;k<x.length;k++)for(var T=0;T<b.length;T++)_[w++]=[x[k],v,b[T]];d.startingPositions=_}d.colormap=a(t),d.tubeSize=t.sizeref,d.maxLength=t.maxdisplayed;var S=f(t._xbnds,"xaxis"),A=f(t._ybnds,"yaxis"),M=f(t._zbnds,"zaxis"),E=p(m),C=p(g),P=p(y),L=[[S[0]-E[0],A[0]-C[0],M[0]-P[0]],[S[1]+E[1],A[1]+C[1],M[1]+P[1]]],I=r(d,L),z=o(t);I.vertexIntensityBounds=[z.min/t._normMax,z.max/t._normMax];var O=t.lightposition;return I.lightPosition=[O.x,O.y,O.z],I.ambient=t.lighting.ambient,I.diffuse=t.lighting.diffuse,I.specular=t.lighting.specular,I.roughness=t.lighting.roughness,I.fresnel=t.lighting.fresnel,I.opacity=t.opacity,t._pad=I.tubeScale*t.sizeref*2,I}u.handlePick=function(e){var t=this.scene.fullSceneLayout,r=this.scene.dataScale;function n(e,n){var i=t[n],a=r[l[n]];return i.l2c(e)/a}if(e.object===this.mesh){var i=e.data.position,a=e.data.velocity;return e.traceCoordinate=[n(i[0],"xaxis"),n(i[1],"yaxis"),n(i[2],"zaxis"),n(a[0],"xaxis"),n(a[1],"yaxis"),n(a[2],"zaxis"),e.data.intensity*this.data._normMax,e.data.divergence],e.textLabel=this.data.hovertext||this.data.text,!0}},u.update=function(e){this.data=e;var t=d(this.scene,e);this.mesh.update(t)},u.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},t.exports=function(e,t){var r=e.glplot.gl,i=d(e,t),a=n(r,i),o=new c(e,t.uid);return o.mesh=a,o.data=t,a._trace=o,e.glplot.add(a),o}}}),Hm=p({"src/traces/streamtube/index.js"(e,t){t.exports={moduleType:"trace",name:"streamtube",basePlotModule:sm(),categories:["gl3d","showLegend"],attributes:Um(),supplyDefaults:Vm(),colorbar:{min:"cmin",max:"cmax"},calc:xm().calc,plot:qm(),eventData:function(e,t){return e.tubex=e.x,e.tubey=e.y,e.tubez=e.z,e.tubeu=t.traceCoordinate[3],e.tubev=t.traceCoordinate[4],e.tubew=t.traceCoordinate[5],e.norm=t.traceCoordinate[6],e.divergence=t.traceCoordinate[7],delete e.x,delete e.y,delete e.z,e},meta:{}}}}),Gm=p({"lib/streamtube.js"(e,t){t.exports=Hm()}}),Wm=p({"src/traces/scattergeo/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=wn(),o=N(),s=Lt(),l=Ie().dash,c=R().extendFlat,u=Le().overrideAll,h=a.marker,p=a.line,d=h.line;t.exports=u({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:c({},a.mode,{dflt:"markers"}),text:c({},a.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","location","text"]}),hovertext:c({},a.hovertext,{}),textfont:a.textfont,textposition:a.textposition,line:{color:p.color,width:p.width,dash:l},connectgaps:a.connectgaps,marker:c({symbol:h.symbol,opacity:h.opacity,angle:h.angle,angleref:c({},h.angleref,{values:["previous","up","north"]}),standoff:h.standoff,size:h.size,sizeref:h.sizeref,sizemin:h.sizemin,sizemode:h.sizemode,colorbar:h.colorbar,line:c({width:d.width},s("marker.line")),gradient:h.gradient},s("marker")),fill:{valType:"enumerated",values:["none","toself"],dflt:"none"},fillcolor:i(),selected:a.selected,unselected:a.unselected,hoverinfo:c({},o.hoverinfo,{flags:["lon","lat","location","text","name"]}),hovertemplate:r()},"calc","nested")}}),$m=p({"src/traces/scattergeo/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Xn(),s=Yn(),l=Wm();t.exports=function(e,t,c,u){function h(n,i){return r.coerce(e,t,l,n,i)}var p,d=h("locations");if(d&&d.length){var f,m=h("geojson");("string"===typeof m&&""!==m||r.isPlainObject(m))&&(f="geojson-id"),"geojson-id"===h("locationmode",f)&&h("featureidkey"),p=d.length}else{var g=h("lon")||[],y=h("lat")||[];p=Math.min(g.length,y.length)}p?(t._length=p,h("text"),h("hovertext"),h("hovertemplate"),h("mode"),n.hasMarkers(t)&&i(e,t,c,u,h,{gradient:!0}),n.hasLines(t)&&(a(e,t,c,u,h),h("connectgaps")),n.hasText(t)&&(h("texttemplate"),o(e,t,u,h)),h("fill"),"none"!==t.fill&&s(e,t,c,h),r.coerceSelectionMarkerOpacity(t,h)):t.visible=!1}}}),Zm=p({"src/traces/scattergeo/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.geo]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),Xm=p({"src/traces/scattergeo/calc.js"(e,t){var r=k(),n=T().BADNUM,i=ri(),a=ni(),o=ii(),s=st().isArrayOrTypedArray,l=st()._;function c(e){return e&&"string"===typeof e}t.exports=function(e,t){var u,h=s(t.locations),p=h?t.locations.length:t._length,d=new Array(p);u=t.geojson?function(e){return c(e)||r(e)}:c;for(var f=0;f<p;f++){var m=d[f]={};if(h){var g=t.locations[f];m.loc=u(g)?g:null}else{var y=t.lon[f],v=t.lat[f];r(y)&&r(v)?m.lonlat=[+y,+v]:m.lonlat=[n,n]}}return a(d,t),i(e,t),o(d,t),p&&(d[0].t={labels:{lat:l(e,"lat:")+" ",lon:l(e,"lon:")+" "}}),d}}}),Ym=p({"src/plots/geo/constants.js"(e){e.projNames={airy:"airy",aitoff:"aitoff","albers usa":"albersUsa",albers:"albers",august:"august","azimuthal equal area":"azimuthalEqualArea","azimuthal equidistant":"azimuthalEquidistant",baker:"baker",bertin1953:"bertin1953",boggs:"boggs",bonne:"bonne",bottomley:"bottomley",bromley:"bromley",collignon:"collignon","conic conformal":"conicConformal","conic equal area":"conicEqualArea","conic equidistant":"conicEquidistant",craig:"craig",craster:"craster","cylindrical equal area":"cylindricalEqualArea","cylindrical stereographic":"cylindricalStereographic",eckert1:"eckert1",eckert2:"eckert2",eckert3:"eckert3",eckert4:"eckert4",eckert5:"eckert5",eckert6:"eckert6",eisenlohr:"eisenlohr","equal earth":"equalEarth",equirectangular:"equirectangular",fahey:"fahey","foucaut sinusoidal":"foucautSinusoidal",foucaut:"foucaut",ginzburg4:"ginzburg4",ginzburg5:"ginzburg5",ginzburg6:"ginzburg6",ginzburg8:"ginzburg8",ginzburg9:"ginzburg9",gnomonic:"gnomonic","gringorten quincuncial":"gringortenQuincuncial",gringorten:"gringorten",guyou:"guyou",hammer:"hammer",hill:"hill",homolosine:"homolosine",hufnagel:"hufnagel",hyperelliptical:"hyperelliptical",kavrayskiy7:"kavrayskiy7",lagrange:"lagrange",larrivee:"larrivee",laskowski:"laskowski",loximuthal:"loximuthal",mercator:"mercator",miller:"miller",mollweide:"mollweide","mt flat polar parabolic":"mtFlatPolarParabolic","mt flat polar quartic":"mtFlatPolarQuartic","mt flat polar sinusoidal":"mtFlatPolarSinusoidal","natural earth":"naturalEarth","natural earth1":"naturalEarth1","natural earth2":"naturalEarth2","nell hammer":"nellHammer",nicolosi:"nicolosi",orthographic:"orthographic",patterson:"patterson","peirce quincuncial":"peirceQuincuncial",polyconic:"polyconic","rectangular polyconic":"rectangularPolyconic",robinson:"robinson",satellite:"satellite","sinu mollweide":"sinuMollweide",sinusoidal:"sinusoidal",stereographic:"stereographic",times:"times","transverse mercator":"transverseMercator","van der grinten":"vanDerGrinten","van der grinten2":"vanDerGrinten2","van der grinten3":"vanDerGrinten3","van der grinten4":"vanDerGrinten4",wagner4:"wagner4",wagner6:"wagner6",wiechel:"wiechel","winkel tripel":"winkel3",winkel3:"winkel3"},e.axesNames=["lonaxis","lataxis"],e.lonaxisSpan={orthographic:180,"azimuthal equal area":360,"azimuthal equidistant":360,"conic conformal":180,gnomonic:160,stereographic:180,"transverse mercator":180,"*":360},e.lataxisSpan={"conic conformal":150,stereographic:179.5,"*":180},e.scopeDefaults={world:{lonaxisRange:[-180,180],lataxisRange:[-90,90],projType:"equirectangular",projRotate:[0,0,0]},usa:{lonaxisRange:[-180,-50],lataxisRange:[15,80],projType:"albers usa"},europe:{lonaxisRange:[-30,60],lataxisRange:[30,85],projType:"conic conformal",projRotate:[15,0,0],projParallels:[0,60]},asia:{lonaxisRange:[22,160],lataxisRange:[-15,55],projType:"mercator",projRotate:[0,0,0]},africa:{lonaxisRange:[-30,60],lataxisRange:[-40,40],projType:"mercator",projRotate:[0,0,0]},"north america":{lonaxisRange:[-180,-45],lataxisRange:[5,85],projType:"conic conformal",projRotate:[-100,0,0],projParallels:[29.5,45.5]},"south america":{lonaxisRange:[-100,-30],lataxisRange:[-60,15],projType:"mercator",projRotate:[0,0,0]}},e.clipPad=.001,e.precision=.1,e.landColor="#F0DC82",e.waterColor="#3399FF",e.locationmodeToLayer={"ISO-3":"countries","USA-states":"subunits","country names":"countries"},e.sphereSVG={type:"Sphere"},e.fillLayers={ocean:1,land:1,lakes:1},e.lineLayers={subunits:1,countries:1,coastlines:1,rivers:1,frame:1},e.layers=["bg","ocean","land","lakes","subunits","countries","coastlines","rivers","lataxis","lonaxis","frame","backplot","frontplot"],e.layersForChoropleth=["bg","ocean","land","subunits","countries","coastlines","lataxis","lonaxis","frame","backplot","rivers","lakes","frontplot"],e.layerNameToAdjective={ocean:"ocean",land:"land",lakes:"lake",subunits:"subunit",countries:"country",coastlines:"coastline",rivers:"river",frame:"frame"}}}),Km=p({"node_modules/topojson-client/dist/topojson-client.js"(e,t){var r,n;r=e,n=function(e){function t(e){return e}function r(e){if(null==e)return t;var r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c);for(u[0]=(r+=e[0])*i+o,u[1]=(n+=e[1])*a+s;l<c;)u[l]=e[l],++l;return u}}function n(e){var t,n=r(e.transform),i=1/0,a=i,o=-i,s=-i;function l(e){(e=n(e))[0]<i&&(i=e[0]),e[0]>o&&(o=e[0]),e[1]<a&&(a=e[1]),e[1]>s&&(s=e[1])}function c(e){switch(e.type){case"GeometryCollection":e.geometries.forEach(c);break;case"Point":l(e.coordinates);break;case"MultiPoint":e.coordinates.forEach(l)}}for(t in e.arcs.forEach((function(e){for(var t,r=-1,l=e.length;++r<l;)(t=n(e[r],r))[0]<i&&(i=t[0]),t[0]>o&&(o=t[0]),t[1]<a&&(a=t[1]),t[1]>s&&(s=t[1])})),e.objects)c(e.objects[t]);return[i,a,o,s]}function i(e,t){var r=t.id,n=t.bbox,i=null==t.properties?{}:t.properties,o=a(e,t);return null==r&&null==n?{type:"Feature",properties:i,geometry:o}:null==n?{type:"Feature",id:r,properties:i,geometry:o}:{type:"Feature",id:r,bbox:n,properties:i,geometry:o}}function a(e,t){var n=r(e.transform),i=e.arcs;function a(e,t){t.length&&t.pop();for(var r=i[e<0?~e:e],a=0,o=r.length;a<o;++a)t.push(n(r[a],a));e<0&&function(e,t){for(var r,n=e.length,i=n-t;i<--n;)r=e[i],e[i++]=e[n],e[n]=r}(t,o)}function o(e){return n(e)}function s(e){for(var t=[],r=0,n=e.length;r<n;++r)a(e[r],t);return t.length<2&&t.push(t[0]),t}function l(e){for(var t=s(e);t.length<4;)t.push(t[0]);return t}function c(e){return e.map(l)}return function e(t){var r,n=t.type;switch(n){case"GeometryCollection":return{type:n,geometries:t.geometries.map(e)};case"Point":r=o(t.coordinates);break;case"MultiPoint":r=t.coordinates.map(o);break;case"LineString":r=s(t.arcs);break;case"MultiLineString":r=t.arcs.map(s);break;case"Polygon":r=c(t.arcs);break;case"MultiPolygon":r=t.arcs.map(c);break;default:return null}return{type:n,coordinates:r}}(t)}function o(e,t){var r={},n={},i={},a=[],o=-1;function s(e,t){for(var n in e){var i=e[n];delete t[i.start],delete i.start,delete i.end,i.forEach((function(e){r[e<0?~e:e]=1})),a.push(i)}}return t.forEach((function(r,n){var i,a=e.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=t[++o],t[o]=r,t[n]=i)})),t.forEach((function(t){var r,a,o=function(t){var r,n=e.arcs[t<0?~t:t],i=n[0];return e.transform?(r=[0,0],n.forEach((function(e){r[0]+=e[0],r[1]+=e[1]}))):r=n[n.length-1],t<0?[r,i]:[i,r]}(t),s=o[0],l=o[1];if(r=i[s])if(delete i[r.end],r.push(t),r.end=l,a=n[l]){delete n[a.start];var c=a===r?r:r.concat(a);n[c.start=r.start]=i[c.end=a.end]=c}else n[r.start]=i[r.end]=r;else if(r=n[l])if(delete n[r.start],r.unshift(t),r.start=s,a=i[s]){delete i[a.end];var u=a===r?r:a.concat(r);n[u.start=a.start]=i[u.end=r.end]=u}else n[r.start]=i[r.end]=r;else n[(r=[t]).start=s]=i[r.end=l]=r})),s(i,n),s(n,i),t.forEach((function(e){r[e<0?~e:e]||a.push([e])})),a}function s(e,t,r){var n,i,a;if(arguments.length>1)n=function(e,t,r){var n,i=[],a=[];function o(e){var t=e<0?~e:e;(a[t]||(a[t]=[])).push({i:e,g:n})}function s(e){e.forEach(o)}function l(e){e.forEach(s)}function c(e){e.forEach(l)}function u(e){switch(n=e,e.type){case"GeometryCollection":e.geometries.forEach(u);break;case"LineString":s(e.arcs);break;case"MultiLineString":case"Polygon":l(e.arcs);break;case"MultiPolygon":c(e.arcs)}}return u(t),a.forEach(null==r?function(e){i.push(e[0].i)}:function(e){r(e[0].g,e[e.length-1].g)&&i.push(e[0].i)}),i}(0,t,r);else for(i=0,n=new Array(a=e.arcs.length);i<a;++i)n[i]=i;return{type:"MultiLineString",arcs:o(e,n)}}function l(e,t){var r={},n=[],i=[];function s(e){e.forEach((function(t){t.forEach((function(t){(r[t=t<0?~t:t]||(r[t]=[])).push(e)}))})),n.push(e)}function l(t){return function(e){for(var t,r=-1,n=e.length,i=e[n-1],a=0;++r<n;)t=i,i=e[r],a+=t[0]*i[1]-t[1]*i[0];return Math.abs(a)}(a(e,{type:"Polygon",arcs:[t]}).coordinates[0])}return t.forEach((function e(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(e);break;case"Polygon":s(t.arcs);break;case"MultiPolygon":t.arcs.forEach(s)}})),n.forEach((function(e){if(!e._){var t=[],n=[e];for(e._=1,i.push(t);e=n.pop();)t.push(e),e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].forEach((function(e){e._||(e._=1,n.push(e))}))}))}))}})),n.forEach((function(e){delete e._})),{type:"MultiPolygon",arcs:i.map((function(t){var n,i=[];if(t.forEach((function(e){e.forEach((function(e){e.forEach((function(e){r[e<0?~e:e].length<2&&i.push(e)}))}))})),(n=(i=o(e,i)).length)>1)for(var a,s,c=1,u=l(i[0]);c<n;++c)(a=l(i[c]))>u&&(s=i[0],i[0]=i[c],i[c]=s,u=a);return i})).filter((function(e){return e.length>0}))}}function c(e,t){for(var r=0,n=e.length;r<n;){var i=r+n>>>1;e[i]<t?r=i+1:n=i}return r}function u(e){if(null==e)return t;var r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],s=e.translate[1];return function(e,t){t||(r=n=0);var l=2,c=e.length,u=new Array(c),h=Math.round((e[0]-o)/i),p=Math.round((e[1]-s)/a);for(u[0]=h-r,r=h,u[1]=p-n,n=p;l<c;)u[l]=e[l],++l;return u}}e.bbox=n,e.feature=function(e,t){return"string"===typeof t&&(t=e.objects[t]),"GeometryCollection"===t.type?{type:"FeatureCollection",features:t.geometries.map((function(t){return i(e,t)}))}:i(e,t)},e.merge=function(e){return a(e,l.apply(this,arguments))},e.mergeArcs=l,e.mesh=function(e){return a(e,s.apply(this,arguments))},e.meshArcs=s,e.neighbors=function(e){var t={},r=e.map((function(){return[]}));function n(e,r){e.forEach((function(e){e<0&&(e=~e);var n=t[e];n?n.push(r):t[e]=[r]}))}function i(e,t){e.forEach((function(e){n(e,t)}))}var a={LineString:n,MultiLineString:i,Polygon:i,MultiPolygon:function(e,t){e.forEach((function(e){i(e,t)}))}};for(var o in e.forEach((function e(t,r){"GeometryCollection"===t.type?t.geometries.forEach((function(t){e(t,r)})):t.type in a&&a[t.type](t.arcs,r)})),t)for(var s=t[o],l=s.length,u=0;u<l;++u)for(var h=u+1;h<l;++h){var p,d=s[u],f=s[h];(p=r[d])[o=c(p,f)]!==f&&p.splice(o,0,f),(p=r[f])[o=c(p,d)]!==d&&p.splice(o,0,d)}return r},e.quantize=function(e,t){if(e.transform)throw new Error("already quantized");if(t&&t.scale)l=e.bbox;else{if(!((r=Math.floor(t))>=2))throw new Error("n must be \u22652");var r,i=(l=e.bbox||n(e))[0],a=l[1],o=l[2],s=l[3];t={scale:[o-i?(o-i)/(r-1):1,s-a?(s-a)/(r-1):1],translate:[i,a]}}var l,c,h=u(t),p=e.objects,d={};function f(e){return h(e)}function m(e){var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(m)};break;case"Point":t={type:"Point",coordinates:f(e.coordinates)};break;case"MultiPoint":t={type:"MultiPoint",coordinates:e.coordinates.map(f)};break;default:return e}return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}for(c in p)d[c]=m(p[c]);return{type:"Topology",bbox:l,transform:t,objects:d,arcs:e.arcs.map((function(e){var t,r=0,n=1,i=e.length,a=new Array(i);for(a[0]=h(e[0],0);++r<i;)((t=h(e[r],r))[0]||t[1])&&(a[n++]=t);return 1===n&&(a[n++]=[0,0]),a.length=n,a}))}},e.transform=r,e.untransform=u,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).topojson=r.topojson||{})}}),Jm=p({"src/lib/topojson_utils.js"(e,t){var r=t.exports={},n=Ym().locationmodeToLayer,i=Km().feature;r.getTopojsonName=function(e){return[e.scope.replace(/ /g,"-"),"_",e.resolution.toString(),"m"].join("")},r.getTopojsonPath=function(e,t){return e+t+".json"},r.getTopojsonFeatures=function(e,t){var r=n[e.locationmode],a=t.objects[r];return i(t,a).features}}}),Qm=p({"src/lib/geojson_utils.js"(e){var t=T().BADNUM;e.calcTraceToLineCoords=function(e){for(var r=e[0].trace.connectgaps,n=[],i=[],a=0;a<e.length;a++){var o=e[a].lonlat;o[0]!==t?i.push(o):!r&&i.length>0&&(n.push(i),i=[])}return i.length>0&&n.push(i),n},e.makeLine=function(e){return 1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}},e.makePolygon=function(e){if(1===e.length)return{type:"Polygon",coordinates:e};for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=[e[r]];return{type:"MultiPolygon",coordinates:t}},e.makeBlank=function(){return{type:"Point",coordinates:[]}}}}),eg=p({"node_modules/country-regex/index.js"(e,t){t.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}}}),tg=p({"node_modules/@turf/helpers/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=6371008.8,r={centimeters:637100880,centimetres:637100880,degrees:360/(2*Math.PI),feet:20902260.511392,inches:39.37*t,kilometers:6371.0088,kilometres:6371.0088,meters:t,metres:t,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:t/1852,radians:1,yards:6967335.223679999},n={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,nauticalmiles:2.9155334959812285e-7,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=t||{},n.geometry=e,n}function a(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!m(e[0])||!m(e[1]))throw new Error("coordinates must contain numbers");return i({type:"Point",coordinates:e},t,r)}function o(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(const n of e){if(n.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(n[n.length-1].length!==n[0].length)throw new Error("First and last Position are not equivalent.");for(let e=0;e<n[n.length-1].length;e++)if(n[n.length-1][e]!==n[0][e])throw new Error("First and last Position are not equivalent.")}return i({type:"Polygon",coordinates:e},t,r)}function s(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e.length<2)throw new Error("coordinates must be an array of two or more positions");return i({type:"LineString",coordinates:e},t,r)}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r={type:"FeatureCollection"};return t.id&&(r.id=t.id),t.bbox&&(r.bbox=t.bbox),r.features=e,r}function c(e,t){return i({type:"MultiLineString",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function u(e,t){return i({type:"MultiPoint",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function h(e,t){return i({type:"MultiPolygon",coordinates:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})}function p(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[t];if(!n)throw new Error(t+" units is invalid");return e*n}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers";const n=r[t];if(!n)throw new Error(t+" units is invalid");return e/n}function f(e){return e%(2*Math.PI)*180/Math.PI}function m(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}e.areaFactors=n,e.azimuthToBearing=function(e){return(e%=360)>0?e>180?e-360:e:e<-180?e+360:e},e.bearingToAzimuth=function(e){let t=e%360;return t<0&&(t+=360),t},e.convertArea=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"meters",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(e>=0))throw new Error("area must be a positive number");const i=n[t];if(!i)throw new Error("invalid original units");const a=n[r];if(!a)throw new Error("invalid final units");return e/i*a},e.convertLength=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kilometers",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"kilometers";if(!(e>=0))throw new Error("length must be a positive number");return p(d(e,t),r)},e.degreesToRadians=function(e){return e%360*Math.PI/180},e.earthRadius=t,e.factors=r,e.feature=i,e.featureCollection=l,e.geometry=function(e,t){switch(e){case"Point":return a(t).geometry;case"LineString":return s(t).geometry;case"Polygon":return o(t).geometry;case"MultiPoint":return u(t).geometry;case"MultiLineString":return c(t).geometry;case"MultiPolygon":return h(t).geometry;default:throw new Error(e+" is invalid")}},e.geometryCollection=function(e,t){return i({type:"GeometryCollection",geometries:e},t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},e.isNumber=m,e.isObject=function(e){return null!==e&&"object"===typeof e&&!Array.isArray(e)},e.lengthToDegrees=function(e,t){return f(d(e,t))},e.lengthToRadians=d,e.lineString=s,e.lineStrings=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>s(e,t))),r)},e.multiLineString=c,e.multiPoint=u,e.multiPolygon=h,e.point=a,e.points=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>a(e,t))),r)},e.polygon=o,e.polygons=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return l(e.map((e=>o(e,t))),r)},e.radiansToDegrees=f,e.radiansToLength=p,e.round=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t&&!(t>=0))throw new Error("precision must be a positive number");const r=Math.pow(10,t||0);return Math.round(e*r)/r},e.validateBBox=function(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((e=>{if(!m(e))throw new Error("bbox must only contain numbers")}))},e.validateId=function(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof e))throw new Error("id must be a number or a string")}}}),rg=p({"node_modules/@turf/meta/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tg();function r(e,t,n){if(null!==e)for(var i,a,o,s,l,c,u,h,p=0,d=0,f=e.type,m="FeatureCollection"===f,g="Feature"===f,y=m?e.features.length:1,v=0;v<y;v++){l=(h=!!(u=m?e.features[v].geometry:g?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var x=0;x<l;x++){var b=0,_=0;if(null!==(s=h?u.geometries[x]:u)){c=s.coordinates;var w=s.type;switch(p=!n||"Polygon"!==w&&"MultiPolygon"!==w?0:1,w){case null:break;case"Point":if(!1===t(c,d,v,b,_))return!1;d++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<c.length;i++){if(!1===t(c[i],d,v,b,_))return!1;d++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<c.length;i++){for(a=0;a<c[i].length-p;a++){if(!1===t(c[i][a],d,v,b,_))return!1;d++}"MultiLineString"===w&&b++,"Polygon"===w&&_++}"Polygon"===w&&b++;break;case"MultiPolygon":for(i=0;i<c.length;i++){for(_=0,a=0;a<c[i].length;a++){for(o=0;o<c[i][a].length-p;o++){if(!1===t(c[i][a][o],d,v,b,_))return!1;d++}_++}b++}break;case"GeometryCollection":for(i=0;i<s.geometries.length;i++)if(!1===r(s.geometries[i],t,n))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function n(e,t){var r;switch(e.type){case"FeatureCollection":for(r=0;r<e.features.length&&!1!==t(e.features[r].properties,r);r++);break;case"Feature":t(e.properties,0)}}function i(e,t){if("Feature"===e.type)t(e,0);else if("FeatureCollection"===e.type)for(var r=0;r<e.features.length&&!1!==t(e.features[r],r);r++);}function a(e,t){var r,n,i,a,o,s,l,c,u,h,p=0,d="FeatureCollection"===e.type,f="Feature"===e.type,m=d?e.features.length:1;for(r=0;r<m;r++){for(s=d?e.features[r].geometry:f?e.geometry:e,c=d?e.features[r].properties:f?e.properties:{},u=d?e.features[r].bbox:f?e.bbox:void 0,h=d?e.features[r].id:f?e.id:void 0,o=(l=!!s&&"GeometryCollection"===s.type)?s.geometries.length:1,i=0;i<o;i++)if(null!==(a=l?s.geometries[i]:s))switch(a.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":if(!1===t(a,p,c,u,h))return!1;break;case"GeometryCollection":for(n=0;n<a.geometries.length;n++)if(!1===t(a.geometries[n],p,c,u,h))return!1;break;default:throw new Error("Unknown Geometry Type")}else if(!1===t(null,p,c,u,h))return!1;p++}}function o(e,r){a(e,(function(e,n,i,a,o){var s,l=null===e?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return!1!==r(t.feature.call(void 0,e,i,{bbox:a,id:o}),n,0)&&void 0}switch(l){case"MultiPoint":s="Point";break;case"MultiLineString":s="LineString";break;case"MultiPolygon":s="Polygon"}for(var c=0;c<e.coordinates.length;c++){var u={type:s,coordinates:e.coordinates[c]};if(!1===r(t.feature.call(void 0,u,i),n,c))return!1}}))}function s(e,n){o(e,(function(e,i,a){var o=0;if(e.geometry){var s=e.geometry.type;if("Point"!==s&&"MultiPoint"!==s){var l,c=0,u=0,h=0;return!1!==r(e,(function(r,s,p,d,f){if(void 0===l||i>c||d>u||f>h)return l=r,c=i,u=d,h=f,void(o=0);var m=t.lineString.call(void 0,[l,r],e.properties);if(!1===n(m,i,a,f,o))return!1;o++,l=r}))&&void 0}}}))}function l(e,r){if(!e)throw new Error("geojson is required");o(e,(function(e,n,i){if(null!==e.geometry){var a=e.geometry.type,o=e.geometry.coordinates;switch(a){case"LineString":if(!1===r(e,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s<o.length;s++)if(!1===r(t.lineString.call(void 0,o[s],e.properties),n,i,s))return!1}}}))}e.coordAll=function(e){var t=[];return r(e,(function(e){t.push(e)})),t},e.coordEach=r,e.coordReduce=function(e,t,n,i){var a=n;return r(e,(function(e,r,i,o,s){a=0===r&&void 0===n?e:t(a,e,r,i,o,s)}),i),a},e.featureEach=i,e.featureReduce=function(e,t,r){var n=r;return i(e,(function(e,i){n=0===i&&void 0===r?e:t(n,e,i)})),n},e.findPoint=function(e,r){if(r=r||{},!t.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.coordIndex||0,l=r.properties;switch(e.type){case"FeatureCollection":i<0&&(i=e.features.length+i),l=l||e.features[i].properties,n=e.features[i].geometry;break;case"Feature":l=l||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":return t.point.call(void 0,c,l,r);case"MultiPoint":return a<0&&(a=c.length+a),t.point.call(void 0,c[a],l,r);case"LineString":return s<0&&(s=c.length+s),t.point.call(void 0,c[s],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),t.point.call(void 0,c[o][s],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s),t.point.call(void 0,c[a][s],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s),t.point.call(void 0,c[a][o][s],l,r)}throw new Error("geojson is invalid")},e.findSegment=function(e,r){if(r=r||{},!t.isObject.call(void 0,r))throw new Error("options is invalid");var n,i=r.featureIndex||0,a=r.multiFeatureIndex||0,o=r.geometryIndex||0,s=r.segmentIndex||0,l=r.properties;switch(e.type){case"FeatureCollection":i<0&&(i=e.features.length+i),l=l||e.features[i].properties,n=e.features[i].geometry;break;case"Feature":l=l||e.properties,n=e.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":n=e;break;default:throw new Error("geojson is invalid")}if(null===n)return null;var c=n.coordinates;switch(n.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),t.lineString.call(void 0,[c[s],c[s+1]],l,r);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),t.lineString.call(void 0,[c[o][s],c[o][s+1]],l,r);case"MultiLineString":return a<0&&(a=c.length+a),s<0&&(s=c[a].length+s-1),t.lineString.call(void 0,[c[a][s],c[a][s+1]],l,r);case"MultiPolygon":return a<0&&(a=c.length+a),o<0&&(o=c[a].length+o),s<0&&(s=c[a][o].length-s-1),t.lineString.call(void 0,[c[a][o][s],c[a][o][s+1]],l,r)}throw new Error("geojson is invalid")},e.flattenEach=o,e.flattenReduce=function(e,t,r){var n=r;return o(e,(function(e,i,a){n=0===i&&0===a&&void 0===r?e:t(n,e,i,a)})),n},e.geomEach=a,e.geomReduce=function(e,t,r){var n=r;return a(e,(function(e,i,a,o,s){n=0===i&&void 0===r?e:t(n,e,i,a,o,s)})),n},e.lineEach=l,e.lineReduce=function(e,t,r){var n=r;return l(e,(function(e,i,a,o){n=0===i&&void 0===r?e:t(n,e,i,a,o)})),n},e.propEach=n,e.propReduce=function(e,t,r){var i=r;return n(e,(function(e,n){i=0===n&&void 0===r?e:t(i,e,n)})),i},e.segmentEach=s,e.segmentReduce=function(e,t,r){var n=r,i=!1;return s(e,(function(e,a,o,s,l){n=!1===i&&void 0===r?e:t(n,e,a,o,s,l),i=!0})),n}}}),ng=p({"node_modules/@turf/area/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tg(),r=rg();function n(e){return r.geomReduce.call(void 0,e,((e,t)=>e+function(e){let t,r=0;switch(e.type){case"Polygon":return i(e.coordinates);case"MultiPolygon":for(t=0;t<e.coordinates.length;t++)r+=i(e.coordinates[t]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}(t)),0)}function i(e){let t=0;if(e&&e.length>0){t+=Math.abs(s(e[0]));for(let r=1;r<e.length;r++)t-=Math.abs(s(e[r]))}return t}var a=t.earthRadius*t.earthRadius/2,o=Math.PI/180;function s(e){const t=e.length-1;if(t<=2)return 0;let r=0,n=0;for(;n<t;){const i=e[n],a=e[n+1===t?0:n+1],s=e[n+2>=t?(n+2)%t:n+2],l=i[0]*o,c=a[1]*o;r+=(s[0]*o-l)*Math.sin(c),n++}return r*a}var l=n;e.area=n,e.default=l}}),ig=p({"node_modules/@turf/centroid/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=tg(),r=rg();function n(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=0,a=0,o=0;return r.coordEach.call(void 0,e,(function(e){i+=e[0],a+=e[1],o++}),!0),t.point.call(void 0,[i/o,a/o],n.properties)}var i=n;e.centroid=n,e.default=i}}),ag=p({"node_modules/@turf/bbox/dist/cjs/index.cjs"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=rg();function r(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!=e.bbox&&!0!==r.recompute)return e.bbox;const n=[1/0,1/0,-1/0,-1/0];return t.coordEach.call(void 0,e,(e=>{n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])})),n}var n=r;e.bbox=r,e.default=n}}),og=p({"src/lib/geo_location_utils.js"(e,t){var r=v(),n=eg(),{area:i}=ng(),{centroid:a}=ig(),{bbox:o}=ag(),s=He(),l=X(),c=A(),u=E(),h=fn(),p=Object.keys(n),d={"ISO-3":s,"USA-states":s,"country names":function(e){for(var t=0;t<p.length;t++){var r=p[t];if(new RegExp(n[r]).test(e.trim().toLowerCase()))return r}return l.log("Unrecognized country name: "+e+"."),!1}};function f(e){var t=e.geojson,r=window.PlotlyGeoAssets||{},n="string"===typeof t?r[t]:t;return c(n)?n:(l.error("Oops ... something went wrong when fetching "+t),!1)}t.exports={locationToFeature:function(e,t,r){if(!t||"string"!==typeof t)return!1;var n,i,a,o=d[e](t);if(o){if("USA-states"===e)for(n=[],a=0;a<r.length;a++)(i=r[a]).properties&&i.properties.gu&&"USA"===i.properties.gu&&n.push(i);else n=r;for(a=0;a<n.length;a++)if((i=n[a]).id===o)return i;l.log(["Location with id",o,"does not have a matching topojson feature at this resolution."].join(" "))}return!1},feature2polygons:function(e){var t,r,n,i,a=e.geometry,o=a.coordinates,s=e.id,l=[];function c(e){for(var t=0;t<e.length-1;t++)if(e[t][0]>0&&e[t+1][0]<0)return t;return null}switch(t="RUS"===s||"FJI"===s?function(e){var t;if(null===c(e))t=e;else for(t=new Array(e.length),i=0;i<e.length;i++)t[i]=[e[i][0]<0?e[i][0]+360:e[i][0],e[i][1]];l.push(h.tester(t))}:"ATA"===s?function(e){var t=c(e);if(null===t)return l.push(h.tester(e));var r=new Array(e.length+1),n=0;for(i=0;i<e.length;i++)i>t?r[n++]=[e[i][0]+360,e[i][1]]:i===t?(r[n++]=e[i],r[n++]=[e[i][0],-90]):r[n++]=e[i];var a=h.tester(r);a.pts.pop(),l.push(a)}:function(e){l.push(h.tester(e))},a.type){case"MultiPolygon":for(r=0;r<o.length;r++)for(n=0;n<o[r].length;n++)t(o[r][n]);break;case"Polygon":for(r=0;r<o.length;r++)t(o[r])}return l},getTraceGeojson:f,extractTraceFeature:function(e){var t=e[0].trace,r=f(t);if(!r)return!1;var n,o={},s=[];for(n=0;n<t._length;n++){var c=e[n];(c.loc||0===c.loc)&&(o[c.loc]=c)}function h(e){var r=u(e,t.featureidkey||"id").get(),n=o[r];if(n){var c=e.geometry;if("Polygon"===c.type||"MultiPolygon"===c.type){var h={type:"Feature",id:r,geometry:c,properties:{}};h.geometry.coordinates.length>0?h.properties.ct=function(e){var t,r=e.geometry;if("MultiPolygon"===r.type)for(var n=r.coordinates,o=0,s=0;s<n.length;s++){var l={type:"Polygon",coordinates:n[s]},c=i(l);c>o&&(o=c,t=l)}else t=r;return a(t).geometry.coordinates}(h):h.properties.ct=[NaN,NaN],n.fIn=e,n.fOut=h,s.push(h)}else l.log(["Location",n.loc,"does not have a valid GeoJSON geometry.","Traces with locationmode *geojson-id* only support","*Polygon* and *MultiPolygon* geometries."].join(" "))}delete o[r]}switch(r.type){case"FeatureCollection":var p=r.features;for(n=0;n<p.length;n++)h(p[n]);break;case"Feature":h(r);break;default:return l.warn(["Invalid GeoJSON type",(r.type||"none")+".","Traces with locationmode *geojson-id* only support","*FeatureCollection* and *Feature* types."].join(" ")),!1}for(var d in o)l.log(["Location *"+d+"*","does not have a matching feature with id-key","*"+t.featureidkey+"*."].join(" "));return s},fetchTraceGeoData:function(e){var t=window.PlotlyGeoAssets||{},n=[];function i(e){return new Promise((function(n,i){r.json(e,(function(r,a){if(r){delete t[e];var o=404===r.status?'GeoJSON at URL "'+e+'" does not exist.':"Unexpected error while fetching from "+e;return i(new Error(o))}return t[e]=a,n(a)}))}))}function a(e){return new Promise((function(r,n){var i=0,a=setInterval((function(){return t[e]&&"pending"!==t[e]?(clearInterval(a),r(t[e])):i>100?(clearInterval(a),n("Unexpected error while fetching from "+e)):void i++}),50)}))}for(var o=0;o<e.length;o++){var s=e[o][0].trace.geojson;"string"===typeof s&&(t[s]?"pending"===t[s]&&n.push(a(s)):(t[s]="pending",n.push(i(s))))}return n},computeBbox:function(e){return o(e)}}}}),sg=p({"src/traces/scattergeo/style.js"(e,t){var r=v(),n=Jt(),i=q(),a=fi(),o=a.stylePoints,s=a.styleText;t.exports=function(e,t){t&&function(e,t){var a=t[0].trace,l=t[0].node3;l.style("opacity",t[0].trace.opacity),o(l,a,e),s(l,a,e),l.selectAll("path.js-line").style("fill","none").each((function(e){var t=r.select(this),a=e.trace,o=a.line||{};t.call(i.stroke,o.color).call(n.dashLine,o.dash||"",o.width||0),"none"!==a.fill&&t.call(i.fill,a.fillcolor)}))}(e,t)}}}),lg=p({"src/traces/scattergeo/plot.js"(e,t){var r=v(),n=st(),i=Jm().getTopojsonFeatures,a=Qm(),o=og(),s=rr().findExtremes,l=T().BADNUM,c=ai().calcMarkerSize,u=$t(),h=sg();t.exports={calcGeoJSON:function(e,t){var r,a,u=e[0].trace,h=t[u.geo],p=h._subplot,d=u._length;if(n.isArrayOrTypedArray(u.locations)){var f=u.locationmode,m="geojson-id"===f?o.extractTraceFeature(e):i(u,p.topojson);for(r=0;r<d;r++){a=e[r];var g="geojson-id"===f?a.fOut:o.locationToFeature(f,a.loc,m);a.lonlat=g?g.properties.ct:[l,l]}}var y,v,x={padded:!0};if("geojson"===h.fitbounds&&"geojson-id"===u.locationmode){var b=o.computeBbox(o.getTraceGeojson(u));y=[b[0],b[2]],v=[b[1],b[3]]}else{for(y=new Array(d),v=new Array(d),r=0;r<d;r++)a=e[r],y[r]=a.lonlat[0],v[r]=a.lonlat[1];x.ppad=c(u,d)}u._extremes.lon=s(h.lonaxis._ax,y,x),u._extremes.lat=s(h.lataxis._ax,v,x)},plot:function(e,t,i){var o=t.layers.frontplot.select(".scatterlayer"),s=n.makeTraceGroups(o,i,"trace scattergeo");function c(e,t){e.lonlat[0]===l&&r.select(t).remove()}s.selectAll("*").remove(),s.each((function(t){var i=r.select(this),o=t[0].trace;if(u.hasLines(o)||"none"!==o.fill){var s=a.calcTraceToLineCoords(t),l="none"!==o.fill?a.makePolygon(s):a.makeLine(s);i.selectAll("path.js-line").data([{geojson:l,trace:o}]).enter().append("path").classed("js-line",!0).style("stroke-miterlimit",2)}u.hasMarkers(o)&&i.selectAll("path.point").data(n.identity).enter().append("path").classed("point",!0).each((function(e){c(e,this)})),u.hasText(o)&&i.selectAll("g").data(n.identity).enter().append("g").append("text").each((function(e){c(e,this)})),h(e,t)}))}}}}),cg=p({"src/traces/scattergeo/hover.js"(e,t){var r=zr(),n=T().BADNUM,i=mi(),a=st().fillText,o=Wm();t.exports=function(e,t,s){var l=e.cd,c=l[0].trace,u=e.xa,h=e.ya,p=e.subplot,d=p.projection.isLonLatOverEdges,f=p.project;if(r.getClosest(l,(function(e){var r=e.lonlat;if(r[0]===n)return 1/0;if(d(r))return 1/0;var i=f(r),a=f([t,s]),o=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),c=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(o*o+l*l)-c,1-3/c)}),e),!1!==e.index){var m=l[e.index],g=m.lonlat,y=[u.c2p(g),h.c2p(g)],v=m.mrc||1;e.x0=y[0]-v,e.x1=y[0]+v,e.y0=y[1]-v,e.y1=y[1]+v,e.loc=m.loc,e.lon=g[0],e.lat=g[1];var x={};x[c.geo]={_subplot:p};var b=c._module.formatLabels(m,c,x);return e.lonLabel=b.lonLabel,e.latLabel=b.latLabel,e.color=i(c,m),e.extraText=function(e,t,r,n){if(!e.hovertemplate){var i=t.hi||e.hoverinfo,s="all"===i?o.hoverinfo.flags:i.split("+"),l=-1!==s.indexOf("location")&&Array.isArray(e.locations),c=-1!==s.indexOf("lon"),u=-1!==s.indexOf("lat"),h=-1!==s.indexOf("text"),p=[];return l?p.push(t.loc):c&&u?p.push("("+d(r.latLabel)+", "+d(r.lonLabel)+")"):c?p.push(n.lon+d(r.lonLabel)):u&&p.push(n.lat+d(r.latLabel)),h&&a(t,e,p),p.join("<br>")}function d(e){return e+"\xb0"}}(c,m,e,l[0].t.labels),e.hovertemplate=c.hovertemplate,[e]}}}}),ug=p({"src/traces/scattergeo/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.lon=t.lon,e.lat=t.lat,e.location=t.loc?t.loc:null;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e}}}),hg=p({"src/traces/scattergeo/select.js"(e,t){var r=$t(),n=T().BADNUM;t.exports=function(e,t){var i,a,o,s,l,c=e.cd,u=e.xaxis,h=e.yaxis,p=[],d=c[0].trace;if(!r.hasMarkers(d)&&!r.hasText(d))return[];if(!1===t)for(l=0;l<c.length;l++)c[l].selected=0;else for(l=0;l<c.length;l++)(a=(i=c[l]).lonlat)[0]!==n&&(o=u.c2p(a),s=h.c2p(a),t.contains([o,s],null,l,e)?(p.push({pointNumber:l,lon:a[0],lat:a[1]}),i.selected=1):i.selected=0);return p}}}),pg=p({"node_modules/d3-array/dist/d3-array.js"(e,t){var r,n;r=e,n=function(e){function t(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function r(e){var r;return 1===e.length&&(r=e,e=function(e,n){return t(r(e),n)}),{left:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)<0?n=a+1:i=a}return n},right:function(t,r,n,i){for(null==n&&(n=0),null==i&&(i=t.length);n<i;){var a=n+i>>>1;e(t[a],r)>0?i=a:n=a+1}return n}}}var n=r(t),i=n.right,a=n.left;function o(e,t){return[e,t]}function s(e){return null===e?NaN:+e}function l(e,t){var r,n,i=e.length,a=0,o=-1,l=0,c=0;if(null==t)for(;++o<i;)isNaN(r=s(e[o]))||(c+=(n=r-l)*(r-(l+=n/++a)));else for(;++o<i;)isNaN(r=s(t(e[o],o,e)))||(c+=(n=r-l)*(r-(l+=n/++a)));if(a>1)return c/(a-1)}function c(e,t){var r=l(e,t);return r?Math.sqrt(r):r}function u(e,t){var r,n,i,a=e.length,o=-1;if(null==t){for(;++o<a;)if(null!=(r=e[o])&&r>=r)for(n=i=r;++o<a;)null!=(r=e[o])&&(n>r&&(n=r),i<r&&(i=r))}else for(;++o<a;)if(null!=(r=t(e[o],o,e))&&r>=r)for(n=i=r;++o<a;)null!=(r=t(e[o],o,e))&&(n>r&&(n=r),i<r&&(i=r));return[n,i]}var h=Array.prototype,p=h.slice,d=h.map;function f(e){return function(){return e}}function m(e){return e}function g(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=0|Math.max(0,Math.ceil((t-e)/r)),a=new Array(i);++n<i;)a[n]=e+n*r;return a}var y=Math.sqrt(50),v=Math.sqrt(10),x=Math.sqrt(2);function b(e,t,r){var n=(t-e)/Math.max(0,r),i=Math.floor(Math.log(n)/Math.LN10),a=n/Math.pow(10,i);return i>=0?(a>=y?10:a>=v?5:a>=x?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=y?10:a>=v?5:a>=x?2:1)}function _(e,t,r){var n=Math.abs(t-e)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=y?i*=10:a>=v?i*=5:a>=x&&(i*=2),t<e?-i:i}function w(e){return Math.ceil(Math.log(e.length)/Math.LN2)+1}function k(e,t,r){if(null==r&&(r=s),n=e.length){if((t=+t)<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e);return o+(+r(e[a+1],a+1,e)-o)*(i-a)}}function T(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a<i;)if(null!=(r=e[a])&&r>=r)for(n=r;++a<i;)null!=(r=e[a])&&n>r&&(n=r)}else for(;++a<i;)if(null!=(r=t(e[a],a,e))&&r>=r)for(n=r;++a<i;)null!=(r=t(e[a],a,e))&&n>r&&(n=r);return n}function S(e){if(!(i=e.length))return[];for(var t=-1,r=T(e,A),n=new Array(r);++t<r;)for(var i,a=-1,o=n[t]=new Array(i);++a<i;)o[a]=e[a][t];return n}function A(e){return e.length}e.bisect=i,e.bisectRight=i,e.bisectLeft=a,e.ascending=t,e.bisector=r,e.cross=function(e,t,r){var n,i,a,s,l=e.length,c=t.length,u=new Array(l*c);for(null==r&&(r=o),n=a=0;n<l;++n)for(s=e[n],i=0;i<c;++i,++a)u[a]=r(s,t[i]);return u},e.descending=function(e,t){return t<e?-1:t>e?1:t>=e?0:NaN},e.deviation=c,e.extent=u,e.histogram=function(){var e=m,t=u,r=w;function n(n){var a,o,s=n.length,l=new Array(s);for(a=0;a<s;++a)l[a]=e(n[a],a,n);var c=t(l),u=c[0],h=c[1],p=r(l,u,h);Array.isArray(p)||(p=_(u,h,p),p=g(Math.ceil(u/p)*p,h,p));for(var d=p.length;p[0]<=u;)p.shift(),--d;for(;p[d-1]>h;)p.pop(),--d;var f,m=new Array(d+1);for(a=0;a<=d;++a)(f=m[a]=[]).x0=a>0?p[a-1]:u,f.x1=a<d?p[a]:h;for(a=0;a<s;++a)u<=(o=l[a])&&o<=h&&m[i(p,o,0,d)].push(n[a]);return m}return n.value=function(t){return arguments.length?(e="function"===typeof t?t:f(t),n):e},n.domain=function(e){return arguments.length?(t="function"===typeof e?e:f([e[0],e[1]]),n):t},n.thresholds=function(e){return arguments.length?(r="function"===typeof e?e:Array.isArray(e)?f(p.call(e)):f(e),n):r},n},e.thresholdFreedmanDiaconis=function(e,r,n){return e=d.call(e,s).sort(t),Math.ceil((n-r)/(2*(k(e,.75)-k(e,.25))*Math.pow(e.length,-1/3)))},e.thresholdScott=function(e,t,r){return Math.ceil((r-t)/(3.5*c(e)*Math.pow(e.length,-1/3)))},e.thresholdSturges=w,e.max=function(e,t){var r,n,i=e.length,a=-1;if(null==t){for(;++a<i;)if(null!=(r=e[a])&&r>=r)for(n=r;++a<i;)null!=(r=e[a])&&r>n&&(n=r)}else for(;++a<i;)if(null!=(r=t(e[a],a,e))&&r>=r)for(n=r;++a<i;)null!=(r=t(e[a],a,e))&&r>n&&(n=r);return n},e.mean=function(e,t){var r,n=e.length,i=n,a=-1,o=0;if(null==t)for(;++a<n;)isNaN(r=s(e[a]))?--i:o+=r;else for(;++a<n;)isNaN(r=s(t(e[a],a,e)))?--i:o+=r;if(i)return o/i},e.median=function(e,r){var n,i=e.length,a=-1,o=[];if(null==r)for(;++a<i;)isNaN(n=s(e[a]))||o.push(n);else for(;++a<i;)isNaN(n=s(r(e[a],a,e)))||o.push(n);return k(o.sort(t),.5)},e.merge=function(e){for(var t,r,n,i=e.length,a=-1,o=0;++a<i;)o+=e[a].length;for(r=new Array(o);--i>=0;)for(t=(n=e[i]).length;--t>=0;)r[--o]=n[t];return r},e.min=T,e.pairs=function(e,t){null==t&&(t=o);for(var r=0,n=e.length-1,i=e[0],a=new Array(n<0?0:n);r<n;)a[r]=t(i,i=e[++r]);return a},e.permute=function(e,t){for(var r=t.length,n=new Array(r);r--;)n[r]=e[t[r]];return n},e.quantile=k,e.range=g,e.scan=function(e,r){if(n=e.length){var n,i,a=0,o=0,s=e[o];for(null==r&&(r=t);++a<n;)(r(i=e[a],s)<0||0!==r(s,s))&&(s=i,o=a);return 0===r(s,s)?o:void 0}},e.shuffle=function(e,t,r){for(var n,i,a=(null==r?e.length:r)-(t=null==t?0:+t);a;)i=Math.random()*a--|0,n=e[a+t],e[a+t]=e[i+t],e[i+t]=n;return e},e.sum=function(e,t){var r,n=e.length,i=-1,a=0;if(null==t)for(;++i<n;)(r=+e[i])&&(a+=r);else for(;++i<n;)(r=+t(e[i],i,e))&&(a+=r);return a},e.ticks=function(e,t,r){var n,i,a,o,s=-1;if(r=+r,(e=+e)===(t=+t)&&r>0)return[e];if((n=t<e)&&(i=e,e=t,t=i),0===(o=b(e,t,r))||!isFinite(o))return[];if(o>0)for(e=Math.ceil(e/o),t=Math.floor(t/o),a=new Array(i=Math.ceil(t-e+1));++s<i;)a[s]=(e+s)*o;else for(e=Math.floor(e*o),t=Math.ceil(t*o),a=new Array(i=Math.ceil(e-t+1));++s<i;)a[s]=(e-s)/o;return n&&a.reverse(),a},e.tickIncrement=b,e.tickStep=_,e.transpose=S,e.variance=l,e.zip=function(){return S(arguments)},Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:r.d3=r.d3||{})}}),dg=p({"node_modules/d3-geo/dist/d3-geo.js"(e,t){var r,n;r=e,n=function(e,t){function r(){return new n}function n(){this.reset()}n.prototype={constructor:n,reset:function(){this.s=this.t=0},add:function(e){a(i,e,this.t),a(this,i.s,this.s),this.s?this.t+=i.t:this.s=i.t},valueOf:function(){return this.s}};var i=new n;function a(e,t,r){var n=e.s=t+r,i=n-t,a=n-i;e.t=t-a+(r-i)}var o=1e-6,s=1e-12,l=Math.PI,c=l/2,u=l/4,h=2*l,p=180/l,d=l/180,f=Math.abs,m=Math.atan,g=Math.atan2,y=Math.cos,v=Math.ceil,x=Math.exp,b=Math.log,_=Math.pow,w=Math.sin,k=Math.sign||function(e){return e>0?1:e<0?-1:0},T=Math.sqrt,S=Math.tan;function A(e){return e>1?0:e<-1?l:Math.acos(e)}function M(e){return e>1?c:e<-1?-c:Math.asin(e)}function E(e){return(e=w(e/2))*e}function C(){}function P(e,t){e&&I.hasOwnProperty(e.type)&&I[e.type](e,t)}var L={Feature:function(e,t){P(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)P(r[n].geometry,t)}},I={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)e=r[n],t.point(e[0],e[1],e[2])},LineString:function(e,t){z(e.coordinates,t,0)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)z(r[n],t,0)},Polygon:function(e,t){O(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)O(r[n],t)},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)P(r[n],t)}};function z(e,t,r){var n,i=-1,a=e.length-r;for(t.lineStart();++i<a;)n=e[i],t.point(n[0],n[1],n[2]);t.lineEnd()}function O(e,t){var r=-1,n=e.length;for(t.polygonStart();++r<n;)z(e[r],t,1);t.polygonEnd()}function R(e,t){e&&L.hasOwnProperty(e.type)?L[e.type](e,t):P(e,t)}var D,j,F,B,N,U=r(),V=r(),q={point:C,lineStart:C,lineEnd:C,polygonStart:function(){U.reset(),q.lineStart=H,q.lineEnd=G},polygonEnd:function(){var e=+U;V.add(e<0?h+e:e),this.lineStart=this.lineEnd=this.point=C},sphere:function(){V.add(h)}};function H(){q.point=W}function G(){$(D,j)}function W(e,t){q.point=$,D=e,j=t,F=e*=d,B=y(t=(t*=d)/2+u),N=w(t)}function $(e,t){var r=(e*=d)-F,n=r>=0?1:-1,i=n*r,a=y(t=(t*=d)/2+u),o=w(t),s=N*o,l=B*a+s*y(i),c=s*n*w(i);U.add(g(c,l)),F=e,B=a,N=o}function Z(e){return[g(e[1],e[0]),M(e[2])]}function X(e){var t=e[0],r=e[1],n=y(r);return[n*y(t),n*w(t),w(r)]}function Y(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function K(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function J(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function Q(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function ee(e){var t=T(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}var te,re,ne,ie,ae,oe,se,le,ce,ue,he,pe,de,fe,me,ge,ye,ve,xe,be,_e,we,ke,Te,Se,Ae,Me=r(),Ee={point:Ce,lineStart:Le,lineEnd:Ie,polygonStart:function(){Ee.point=ze,Ee.lineStart=Oe,Ee.lineEnd=Re,Me.reset(),q.polygonStart()},polygonEnd:function(){q.polygonEnd(),Ee.point=Ce,Ee.lineStart=Le,Ee.lineEnd=Ie,U<0?(te=-(ne=180),re=-(ie=90)):Me>o?ie=90:Me<-o&&(re=-90),ue[0]=te,ue[1]=ne},sphere:function(){te=-(ne=180),re=-(ie=90)}};function Ce(e,t){ce.push(ue=[te=e,ne=e]),t<re&&(re=t),t>ie&&(ie=t)}function Pe(e,t){var r=X([e*d,t*d]);if(le){var n=K(le,r),i=K([n[1],-n[0],0],n);ee(i),i=Z(i);var a,o=e-ae,s=o>0?1:-1,l=i[0]*p*s,c=f(o)>180;c^(s*ae<l&&l<s*e)?(a=i[1]*p)>ie&&(ie=a):c^(s*ae<(l=(l+360)%360-180)&&l<s*e)?(a=-i[1]*p)<re&&(re=a):(t<re&&(re=t),t>ie&&(ie=t)),c?e<ae?De(te,e)>De(te,ne)&&(ne=e):De(e,ne)>De(te,ne)&&(te=e):ne>=te?(e<te&&(te=e),e>ne&&(ne=e)):e>ae?De(te,e)>De(te,ne)&&(ne=e):De(e,ne)>De(te,ne)&&(te=e)}else ce.push(ue=[te=e,ne=e]);t<re&&(re=t),t>ie&&(ie=t),le=r,ae=e}function Le(){Ee.point=Pe}function Ie(){ue[0]=te,ue[1]=ne,Ee.point=Ce,le=null}function ze(e,t){if(le){var r=e-ae;Me.add(f(r)>180?r+(r>0?360:-360):r)}else oe=e,se=t;q.point(e,t),Pe(e,t)}function Oe(){q.lineStart()}function Re(){ze(oe,se),q.lineEnd(),f(Me)>o&&(te=-(ne=180)),ue[0]=te,ue[1]=ne,le=null}function De(e,t){return(t-=e)<0?t+360:t}function je(e,t){return e[0]-t[0]}function Fe(e,t){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:t<e[0]||e[1]<t}var Be={sphere:C,point:Ne,lineStart:Ve,lineEnd:Ge,polygonStart:function(){Be.lineStart=We,Be.lineEnd=$e},polygonEnd:function(){Be.lineStart=Ve,Be.lineEnd=Ge}};function Ne(e,t){e*=d;var r=y(t*=d);Ue(r*y(e),r*w(e),w(t))}function Ue(e,t,r){++he,de+=(e-de)/he,fe+=(t-fe)/he,me+=(r-me)/he}function Ve(){Be.point=qe}function qe(e,t){e*=d;var r=y(t*=d);Te=r*y(e),Se=r*w(e),Ae=w(t),Be.point=He,Ue(Te,Se,Ae)}function He(e,t){e*=d;var r=y(t*=d),n=r*y(e),i=r*w(e),a=w(t),o=g(T((o=Se*a-Ae*i)*o+(o=Ae*n-Te*a)*o+(o=Te*i-Se*n)*o),Te*n+Se*i+Ae*a);pe+=o,ge+=o*(Te+(Te=n)),ye+=o*(Se+(Se=i)),ve+=o*(Ae+(Ae=a)),Ue(Te,Se,Ae)}function Ge(){Be.point=Ne}function We(){Be.point=Ze}function $e(){Xe(we,ke),Be.point=Ne}function Ze(e,t){we=e,ke=t,e*=d,t*=d,Be.point=Xe;var r=y(t);Te=r*y(e),Se=r*w(e),Ae=w(t),Ue(Te,Se,Ae)}function Xe(e,t){e*=d;var r=y(t*=d),n=r*y(e),i=r*w(e),a=w(t),o=Se*a-Ae*i,s=Ae*n-Te*a,l=Te*i-Se*n,c=T(o*o+s*s+l*l),u=M(c),h=c&&-u/c;xe+=h*o,be+=h*s,_e+=h*l,pe+=u,ge+=u*(Te+(Te=n)),ye+=u*(Se+(Se=i)),ve+=u*(Ae+(Ae=a)),Ue(Te,Se,Ae)}function Ye(e){return function(){return e}}function Ke(e,t){function r(r,n){return r=e(r,n),t(r[0],r[1])}return e.invert&&t.invert&&(r.invert=function(r,n){return(r=t.invert(r,n))&&e.invert(r[0],r[1])}),r}function Je(e,t){return[f(e)>l?e+Math.round(-e/h)*h:e,t]}function Qe(e,t,r){return(e%=h)?t||r?Ke(tt(e),rt(t,r)):tt(e):t||r?rt(t,r):Je}function et(e){return function(t,r){return[(t+=e)>l?t-h:t<-l?t+h:t,r]}}function tt(e){var t=et(e);return t.invert=et(-e),t}function rt(e,t){var r=y(e),n=w(e),i=y(t),a=w(t);function o(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*r+s*n;return[g(l*i-u*a,s*r-c*n),M(u*i+l*a)]}return o.invert=function(e,t){var o=y(t),s=y(e)*o,l=w(e)*o,c=w(t),u=c*i-l*a;return[g(l*i+c*a,s*r+u*n),M(u*r-s*n)]},o}function nt(e){function t(t){return(t=e(t[0]*d,t[1]*d))[0]*=p,t[1]*=p,t}return e=Qe(e[0]*d,e[1]*d,e.length>2?e[2]*d:0),t.invert=function(t){return(t=e.invert(t[0]*d,t[1]*d))[0]*=p,t[1]*=p,t},t}function it(e,t,r,n,i,a){if(r){var o=y(t),s=w(t),l=n*r;null==i?(i=t+n*h,a=t-l/2):(i=at(o,i),a=at(o,a),(n>0?i<a:i>a)&&(i+=n*h));for(var c,u=i;n>0?u>a:u<a;u-=l)c=Z([o,-s*y(u),-s*w(u)]),e.point(c[0],c[1])}}function at(e,t){(t=X(t))[0]-=e,ee(t);var r=A(-t[1]);return((-t[2]<0?-r:r)+h-o)%h}function ot(){var e,t=[];return{point:function(t,r,n){e.push([t,r,n])},lineStart:function(){t.push(e=[])},lineEnd:C,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],e=null,r}}}function st(e,t){return f(e[0]-t[0])<o&&f(e[1]-t[1])<o}function lt(e,t,r,n){this.x=e,this.z=t,this.o=r,this.e=n,this.v=!1,this.n=this.p=null}function ct(e,t,r,n,i){var a,o,s=[],l=[];if(e.forEach((function(e){if(!((t=e.length-1)<=0)){var t,r,n=e[0],o=e[t];if(st(n,o)){if(!n[2]&&!o[2]){for(i.lineStart(),a=0;a<t;++a)i.point((n=e[a])[0],n[1]);return void i.lineEnd()}o[0]+=2e-6}s.push(r=new lt(n,e,null,!0)),l.push(r.o=new lt(n,null,r,!1)),s.push(r=new lt(o,e,null,!1)),l.push(r.o=new lt(o,null,r,!0))}})),s.length){for(l.sort(t),ut(s),ut(l),a=0,o=l.length;a<o;++a)l[a].e=r=!r;for(var c,u,h=s[0];;){for(var p=h,d=!0;p.v;)if((p=p.n)===h)return;c=p.z,i.lineStart();do{if(p.v=p.o.v=!0,p.e){if(d)for(a=0,o=c.length;a<o;++a)i.point((u=c[a])[0],u[1]);else n(p.x,p.n.x,1,i);p=p.n}else{if(d)for(c=p.p.z,a=c.length-1;a>=0;--a)i.point((u=c[a])[0],u[1]);else n(p.x,p.p.x,-1,i);p=p.p}c=(p=p.o).z,d=!d}while(!p.v);i.lineEnd()}}}function ut(e){if(t=e.length){for(var t,r,n=0,i=e[0];++n<t;)i.n=r=e[n],r.p=i,i=r;i.n=r=e[0],r.p=i}}Je.invert=Je;var ht=r();function pt(e){return f(e[0])<=l?e[0]:k(e[0])*((f(e[0])+l)%h-l)}function dt(e,t){var r=pt(t),n=t[1],i=w(n),a=[w(r),-y(r),0],s=0,p=0;ht.reset(),1===i?n=c+o:-1===i&&(n=-c-o);for(var d=0,f=e.length;d<f;++d)if(v=(m=e[d]).length)for(var m,v,x=m[v-1],b=pt(x),_=x[1]/2+u,k=w(_),T=y(_),S=0;S<v;++S,b=E,k=P,T=L,x=A){var A=m[S],E=pt(A),C=A[1]/2+u,P=w(C),L=y(C),I=E-b,z=I>=0?1:-1,O=z*I,R=O>l,D=k*P;if(ht.add(g(D*z*w(O),T*L+D*y(O))),s+=R?I+z*h:I,R^b>=r^E>=r){var j=K(X(x),X(A));ee(j);var F=K(a,j);ee(F);var B=(R^I>=0?-1:1)*M(F[2]);(n>B||n===B&&(j[0]||j[1]))&&(p+=R^I>=0?1:-1)}}return(s<-o||s<o&&ht<-o)^1&p}function ft(e,r,n,i){return function(a){var o,s,l,c=r(a),u=ot(),h=r(u),p=!1,d={point:f,lineStart:g,lineEnd:y,polygonStart:function(){d.point=v,d.lineStart=x,d.lineEnd=b,s=[],o=[]},polygonEnd:function(){d.point=f,d.lineStart=g,d.lineEnd=y,s=t.merge(s);var e=dt(o,i);s.length?(p||(a.polygonStart(),p=!0),ct(s,gt,e,n,a)):e&&(p||(a.polygonStart(),p=!0),a.lineStart(),n(null,null,1,a),a.lineEnd()),p&&(a.polygonEnd(),p=!1),s=o=null},sphere:function(){a.polygonStart(),a.lineStart(),n(null,null,1,a),a.lineEnd(),a.polygonEnd()}};function f(t,r){e(t,r)&&a.point(t,r)}function m(e,t){c.point(e,t)}function g(){d.point=m,c.lineStart()}function y(){d.point=f,c.lineEnd()}function v(e,t){l.push([e,t]),h.point(e,t)}function x(){h.lineStart(),l=[]}function b(){v(l[0][0],l[0][1]),h.lineEnd();var e,t,r,n,i=h.clean(),c=u.result(),d=c.length;if(l.pop(),o.push(l),l=null,d)if(1&i){if((t=(r=c[0]).length-1)>0){for(p||(a.polygonStart(),p=!0),a.lineStart(),e=0;e<t;++e)a.point((n=r[e])[0],n[1]);a.lineEnd()}}else d>1&&2&i&&c.push(c.pop().concat(c.shift())),s.push(c.filter(mt))}return d}}function mt(e){return e.length>1}function gt(e,t){return((e=e.x)[0]<0?e[1]-c-o:c-e[1])-((t=t.x)[0]<0?t[1]-c-o:c-t[1])}var yt=ft((function(){return!0}),(function(e){var t,r=NaN,n=NaN,i=NaN;return{lineStart:function(){e.lineStart(),t=1},point:function(a,s){var u=a>0?l:-l,h=f(a-r);f(h-l)<o?(e.point(r,n=(n+s)/2>0?c:-c),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),e.point(a,n),t=0):i!==u&&h>=l&&(f(r-i)<o&&(r-=i*o),f(a-u)<o&&(a-=u*o),n=function(e,t,r,n){var i,a,s=w(e-r);return f(s)>o?m((w(t)*(a=y(n))*w(r)-w(n)*(i=y(t))*w(e))/(i*a*s)):(t+n)/2}(r,n,a,s),e.point(i,n),e.lineEnd(),e.lineStart(),e.point(u,n),t=0),e.point(r=a,n=s),i=u},lineEnd:function(){e.lineEnd(),r=n=NaN},clean:function(){return 2-t}}}),(function(e,t,r,n){var i;if(null==e)i=r*c,n.point(-l,i),n.point(0,i),n.point(l,i),n.point(l,0),n.point(l,-i),n.point(0,-i),n.point(-l,-i),n.point(-l,0),n.point(-l,i);else if(f(e[0]-t[0])>o){var a=e[0]<t[0]?l:-l;i=r*a/2,n.point(-a,i),n.point(0,i),n.point(a,i)}else n.point(t[0],t[1])}),[-l,-c]);function vt(e){var t=y(e),r=6*d,n=t>0,i=f(t)>o;function a(e,r){return y(e)*y(r)>t}function s(e,r,n){var i=[1,0,0],a=K(X(e),X(r)),s=Y(a,a),c=a[0],u=s-c*c;if(!u)return!n&&e;var h=t*s/u,p=-t*c/u,d=K(i,a),m=Q(i,h);J(m,Q(a,p));var g=d,y=Y(m,g),v=Y(g,g),x=y*y-v*(Y(m,m)-1);if(!(x<0)){var b=T(x),_=Q(g,(-y-b)/v);if(J(_,m),_=Z(_),!n)return _;var w,k=e[0],S=r[0],A=e[1],M=r[1];S<k&&(w=k,k=S,S=w);var E=S-k,C=f(E-l)<o;if(!C&&M<A&&(w=A,A=M,M=w),C||E<o?C?A+M>0^_[1]<(f(_[0]-k)<o?A:M):A<=_[1]&&_[1]<=M:E>l^(k<=_[0]&&_[0]<=S)){var P=Q(g,(-y+b)/v);return J(P,m),[_,Z(P)]}}}function c(t,r){var i=n?e:l-e,a=0;return t<-i?a|=1:t>i&&(a|=2),r<-i?a|=4:r>i&&(a|=8),a}return ft(a,(function(e){var t,r,o,u,h;return{lineStart:function(){u=o=!1,h=1},point:function(p,d){var f,m=[p,d],g=a(p,d),y=n?g?0:c(p,d):g?c(p+(p<0?l:-l),d):0;if(!t&&(u=o=g)&&e.lineStart(),g!==o&&(!(f=s(t,m))||st(t,f)||st(m,f))&&(m[2]=1),g!==o)h=0,g?(e.lineStart(),f=s(m,t),e.point(f[0],f[1])):(f=s(t,m),e.point(f[0],f[1],2),e.lineEnd()),t=f;else if(i&&t&&n^g){var v;y&r||!(v=s(m,t,!0))||(h=0,n?(e.lineStart(),e.point(v[0][0],v[0][1]),e.point(v[1][0],v[1][1]),e.lineEnd()):(e.point(v[1][0],v[1][1]),e.lineEnd(),e.lineStart(),e.point(v[0][0],v[0][1],3)))}!g||t&&st(t,m)||e.point(m[0],m[1]),t=m,o=g,r=y},lineEnd:function(){o&&e.lineEnd(),t=null},clean:function(){return h|(u&&o)<<1}}}),(function(t,n,i,a){it(a,e,r,i,t,n)}),n?[0,-e]:[-l,e-l])}var xt=1e9,bt=-xt;function _t(e,r,n,i){function a(t,a){return e<=t&&t<=n&&r<=a&&a<=i}function s(t,a,o,s){var c=0,h=0;if(null==t||(c=l(t,o))!==(h=l(a,o))||u(t,a)<0^o>0)do{s.point(0===c||3===c?e:n,c>1?i:r)}while((c=(c+o+4)%4)!==h);else s.point(a[0],a[1])}function l(t,i){return f(t[0]-e)<o?i>0?0:3:f(t[0]-n)<o?i>0?2:1:f(t[1]-r)<o?i>0?1:0:i>0?3:2}function c(e,t){return u(e.x,t.x)}function u(e,t){var r=l(e,1),n=l(t,1);return r!==n?r-n:0===r?t[1]-e[1]:1===r?e[0]-t[0]:2===r?e[1]-t[1]:t[0]-e[0]}return function(o){var l,u,h,p,d,f,m,g,y,v,x,b=o,_=ot(),w={point:k,lineStart:function(){w.point=T,u&&u.push(h=[]),v=!0,y=!1,m=g=NaN},lineEnd:function(){l&&(T(p,d),f&&y&&_.rejoin(),l.push(_.result())),w.point=k,y&&b.lineEnd()},polygonStart:function(){b=_,l=[],u=[],x=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,n=u.length;r<n;++r)for(var a,o,s=u[r],l=1,c=s.length,h=s[0],p=h[0],d=h[1];l<c;++l)a=p,o=d,p=(h=s[l])[0],d=h[1],o<=i?d>i&&(p-a)*(i-o)>(d-o)*(e-a)&&++t:d<=i&&(p-a)*(i-o)<(d-o)*(e-a)&&--t;return t}(),n=x&&r,a=(l=t.merge(l)).length;(n||a)&&(o.polygonStart(),n&&(o.lineStart(),s(null,null,1,o),o.lineEnd()),a&&ct(l,c,r,s,o),o.polygonEnd()),b=o,l=u=h=null}};function k(e,t){a(e,t)&&b.point(e,t)}function T(t,o){var s=a(t,o);if(u&&h.push([t,o]),v)p=t,d=o,f=s,v=!1,s&&(b.lineStart(),b.point(t,o));else if(s&&y)b.point(t,o);else{var l=[m=Math.max(bt,Math.min(xt,m)),g=Math.max(bt,Math.min(xt,g))],c=[t=Math.max(bt,Math.min(xt,t)),o=Math.max(bt,Math.min(xt,o))];!function(e,t,r,n,i,a){var o,s=e[0],l=e[1],c=0,u=1,h=t[0]-s,p=t[1]-l;if(o=r-s,h||!(o>0)){if(o/=h,h<0){if(o<c)return;o<u&&(u=o)}else if(h>0){if(o>u)return;o>c&&(c=o)}if(o=i-s,h||!(o<0)){if(o/=h,h<0){if(o>u)return;o>c&&(c=o)}else if(h>0){if(o<c)return;o<u&&(u=o)}if(o=n-l,p||!(o>0)){if(o/=p,p<0){if(o<c)return;o<u&&(u=o)}else if(p>0){if(o>u)return;o>c&&(c=o)}if(o=a-l,p||!(o<0)){if(o/=p,p<0){if(o>u)return;o>c&&(c=o)}else if(p>0){if(o<c)return;o<u&&(u=o)}return c>0&&(e[0]=s+c*h,e[1]=l+c*p),u<1&&(t[0]=s+u*h,t[1]=l+u*p),!0}}}}}(l,c,e,r,n,i)?s&&(b.lineStart(),b.point(t,o),x=!1):(y||(b.lineStart(),b.point(l[0],l[1])),b.point(c[0],c[1]),s||b.lineEnd(),x=!1)}m=t,g=o,y=s}return w}}var wt,kt,Tt,St=r(),At={sphere:C,point:C,lineStart:function(){At.point=Et,At.lineEnd=Mt},lineEnd:C,polygonStart:C,polygonEnd:C};function Mt(){At.point=At.lineEnd=C}function Et(e,t){wt=e*=d,kt=w(t*=d),Tt=y(t),At.point=Ct}function Ct(e,t){e*=d;var r=w(t*=d),n=y(t),i=f(e-wt),a=y(i),o=n*w(i),s=Tt*r-kt*n*a,l=kt*r+Tt*n*a;St.add(g(T(o*o+s*s),l)),wt=e,kt=r,Tt=n}function Pt(e){return St.reset(),R(e,At),+St}var Lt=[null,null],It={type:"LineString",coordinates:Lt};function zt(e,t){return Lt[0]=e,Lt[1]=t,Pt(It)}var Ot={Feature:function(e,t){return Dt(e.geometry,t)},FeatureCollection:function(e,t){for(var r=e.features,n=-1,i=r.length;++n<i;)if(Dt(r[n].geometry,t))return!0;return!1}},Rt={Sphere:function(){return!0},Point:function(e,t){return jt(e.coordinates,t)},MultiPoint:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(jt(r[n],t))return!0;return!1},LineString:function(e,t){return Ft(e.coordinates,t)},MultiLineString:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(Ft(r[n],t))return!0;return!1},Polygon:function(e,t){return Bt(e.coordinates,t)},MultiPolygon:function(e,t){for(var r=e.coordinates,n=-1,i=r.length;++n<i;)if(Bt(r[n],t))return!0;return!1},GeometryCollection:function(e,t){for(var r=e.geometries,n=-1,i=r.length;++n<i;)if(Dt(r[n],t))return!0;return!1}};function Dt(e,t){return!(!e||!Rt.hasOwnProperty(e.type))&&Rt[e.type](e,t)}function jt(e,t){return 0===zt(e,t)}function Ft(e,t){for(var r,n,i,a=0,o=e.length;a<o;a++){if(0===(n=zt(e[a],t)))return!0;if(a>0&&(i=zt(e[a],e[a-1]))>0&&r<=i&&n<=i&&(r+n-i)*(1-Math.pow((r-n)/i,2))<s*i)return!0;r=n}return!1}function Bt(e,t){return!!dt(e.map(Nt),Ut(t))}function Nt(e){return(e=e.map(Ut)).pop(),e}function Ut(e){return[e[0]*d,e[1]*d]}function Vt(e,r,n){var i=t.range(e,r-o,n).concat(r);return function(e){return i.map((function(t){return[e,t]}))}}function qt(e,r,n){var i=t.range(e,r-o,n).concat(r);return function(e){return i.map((function(t){return[t,e]}))}}function Ht(){var e,r,n,i,a,s,l,c,u,h,p,d,m=10,g=m,y=90,x=360,b=2.5;function _(){return{type:"MultiLineString",coordinates:w()}}function w(){return t.range(v(i/y)*y,n,y).map(p).concat(t.range(v(c/x)*x,l,x).map(d)).concat(t.range(v(r/m)*m,e,m).filter((function(e){return f(e%y)>o})).map(u)).concat(t.range(v(s/g)*g,a,g).filter((function(e){return f(e%x)>o})).map(h))}return _.lines=function(){return w().map((function(e){return{type:"LineString",coordinates:e}}))},_.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(d(l).slice(1),p(n).reverse().slice(1),d(c).reverse().slice(1))]}},_.extent=function(e){return arguments.length?_.extentMajor(e).extentMinor(e):_.extentMinor()},_.extentMajor=function(e){return arguments.length?(i=+e[0][0],n=+e[1][0],c=+e[0][1],l=+e[1][1],i>n&&(e=i,i=n,n=e),c>l&&(e=c,c=l,l=e),_.precision(b)):[[i,c],[n,l]]},_.extentMinor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],s=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),s>a&&(t=s,s=a,a=t),_.precision(b)):[[r,s],[e,a]]},_.step=function(e){return arguments.length?_.stepMajor(e).stepMinor(e):_.stepMinor()},_.stepMajor=function(e){return arguments.length?(y=+e[0],x=+e[1],_):[y,x]},_.stepMinor=function(e){return arguments.length?(m=+e[0],g=+e[1],_):[m,g]},_.precision=function(t){return arguments.length?(b=+t,u=Vt(s,a,90),h=qt(r,e,b),p=Vt(c,l,90),d=qt(i,n,b),_):b},_.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Gt(e){return e}var Wt,$t,Zt,Xt,Yt=r(),Kt=r(),Jt={point:C,lineStart:C,lineEnd:C,polygonStart:function(){Jt.lineStart=Qt,Jt.lineEnd=rr},polygonEnd:function(){Jt.lineStart=Jt.lineEnd=Jt.point=C,Yt.add(f(Kt)),Kt.reset()},result:function(){var e=Yt/2;return Yt.reset(),e}};function Qt(){Jt.point=er}function er(e,t){Jt.point=tr,Wt=Zt=e,$t=Xt=t}function tr(e,t){Kt.add(Xt*e-Zt*t),Zt=e,Xt=t}function rr(){tr(Wt,$t)}var nr,ir,ar,or,sr=1/0,lr=sr,cr=-sr,ur=cr,hr={point:function(e,t){e<sr&&(sr=e),e>cr&&(cr=e),t<lr&&(lr=t),t>ur&&(ur=t)},lineStart:C,lineEnd:C,polygonStart:C,polygonEnd:C,result:function(){var e=[[sr,lr],[cr,ur]];return cr=ur=-(lr=sr=1/0),e}},pr=0,dr=0,fr=0,mr=0,gr=0,yr=0,vr=0,xr=0,br=0,_r={point:wr,lineStart:kr,lineEnd:Ar,polygonStart:function(){_r.lineStart=Mr,_r.lineEnd=Er},polygonEnd:function(){_r.point=wr,_r.lineStart=kr,_r.lineEnd=Ar},result:function(){var e=br?[vr/br,xr/br]:yr?[mr/yr,gr/yr]:fr?[pr/fr,dr/fr]:[NaN,NaN];return pr=dr=fr=mr=gr=yr=vr=xr=br=0,e}};function wr(e,t){pr+=e,dr+=t,++fr}function kr(){_r.point=Tr}function Tr(e,t){_r.point=Sr,wr(ar=e,or=t)}function Sr(e,t){var r=e-ar,n=t-or,i=T(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,wr(ar=e,or=t)}function Ar(){_r.point=wr}function Mr(){_r.point=Cr}function Er(){Pr(nr,ir)}function Cr(e,t){_r.point=Pr,wr(nr=ar=e,ir=or=t)}function Pr(e,t){var r=e-ar,n=t-or,i=T(r*r+n*n);mr+=i*(ar+e)/2,gr+=i*(or+t)/2,yr+=i,vr+=(i=or*e-ar*t)*(ar+e),xr+=i*(or+t),br+=3*i,wr(ar=e,or=t)}function Lr(e){this._context=e}Lr.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._context.moveTo(e,t),this._point=1;break;case 1:this._context.lineTo(e,t);break;default:this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,h)}},result:C};var Ir,zr,Or,Rr,Dr,jr=r(),Fr={point:C,lineStart:function(){Fr.point=Br},lineEnd:function(){Ir&&Nr(zr,Or),Fr.point=C},polygonStart:function(){Ir=!0},polygonEnd:function(){Ir=null},result:function(){var e=+jr;return jr.reset(),e}};function Br(e,t){Fr.point=Nr,zr=Rr=e,Or=Dr=t}function Nr(e,t){Rr-=e,Dr-=t,jr.add(T(Rr*Rr+Dr*Dr)),Rr=e,Dr=t}function Ur(){this._string=[]}function Vr(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+-2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function qr(e){return function(t){var r=new Hr;for(var n in e)r[n]=e[n];return r.stream=t,r}}function Hr(){}function Gr(e,t,r){var n=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),null!=n&&e.clipExtent(null),R(r,e.stream(hr)),t(hr.result()),null!=n&&e.clipExtent(n),e}function Wr(e,t,r){return Gr(e,(function(r){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=Math.min(n/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),o=+t[0][0]+(n-a*(r[1][0]+r[0][0]))/2,s=+t[0][1]+(i-a*(r[1][1]+r[0][1]))/2;e.scale(150*a).translate([o,s])}),r)}function $r(e,t,r){return Wr(e,[[0,0],t],r)}function Zr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][0]-r[0][0]),a=(n-i*(r[1][0]+r[0][0]))/2,o=-i*r[0][1];e.scale(150*i).translate([a,o])}),r)}function Xr(e,t,r){return Gr(e,(function(r){var n=+t,i=n/(r[1][1]-r[0][1]),a=-i*r[0][0],o=(n-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([a,o])}),r)}Ur.prototype={_radius:4.5,_circle:Vr(4.5),pointRadius:function(e){return(e=+e)!==this._radius&&(this._radius=e,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(e,t){switch(this._point){case 0:this._string.push("M",e,",",t),this._point=1;break;case 1:this._string.push("L",e,",",t);break;default:null==this._circle&&(this._circle=Vr(this._radius)),this._string.push("M",e,",",t,this._circle)}},result:function(){if(this._string.length){var e=this._string.join("");return this._string=[],e}return null}},Hr.prototype={constructor:Hr,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Yr=y(30*d);function Kr(e,t){return+t?function(e,t){function r(n,i,a,s,l,c,u,h,p,d,m,y,v,x){var b=u-n,_=h-i,w=b*b+_*_;if(w>4*t&&v--){var k=s+d,S=l+m,A=c+y,E=T(k*k+S*S+A*A),C=M(A/=E),P=f(f(A)-1)<o||f(a-p)<o?(a+p)/2:g(S,k),L=e(P,C),I=L[0],z=L[1],O=I-n,R=z-i,D=_*O-b*R;(D*D/w>t||f((b*O+_*R)/w-.5)>.3||s*d+l*m+c*y<Yr)&&(r(n,i,a,s,l,c,I,z,P,k/=E,S/=E,A,v,x),x.point(I,z),r(I,z,P,k,S,A,u,h,p,d,m,y,v,x))}}return function(t){var n,i,a,o,s,l,c,u,h,p,d,f,m={point:g,lineStart:y,lineEnd:x,polygonStart:function(){t.polygonStart(),m.lineStart=b},polygonEnd:function(){t.polygonEnd(),m.lineStart=y}};function g(r,n){r=e(r,n),t.point(r[0],r[1])}function y(){u=NaN,m.point=v,t.lineStart()}function v(n,i){var a=X([n,i]),o=e(n,i);r(u,h,c,p,d,f,u=o[0],h=o[1],c=n,p=a[0],d=a[1],f=a[2],16,t),t.point(u,h)}function x(){m.point=g,t.lineEnd()}function b(){y(),m.point=_,m.lineEnd=w}function _(e,t){v(n=e,t),i=u,a=h,o=p,s=d,l=f,m.point=v}function w(){r(u,h,c,p,d,f,i,a,n,o,s,l,16,t),m.lineEnd=x,x()}return m}}(e,t):function(e){return qr({point:function(t,r){t=e(t,r),this.stream.point(t[0],t[1])}})}(e)}var Jr=qr({point:function(e,t){this.stream.point(e*d,t*d)}});function Qr(e,t,r,n,i){function a(a,o){return[t+e*(a*=n),r-e*(o*=i)]}return a.invert=function(a,o){return[(a-t)/e*n,(r-o)/e*i]},a}function en(e,t,r,n,i,a){var o=y(a),s=w(a),l=o*e,c=s*e,u=o/e,h=s/e,p=(s*r-o*t)/e,d=(s*t+o*r)/e;function f(e,a){return[l*(e*=n)-c*(a*=i)+t,r-c*e-l*a]}return f.invert=function(e,t){return[n*(u*e-h*t+p),i*(d-h*e-u*t)]},f}function tn(e){return rn((function(){return e}))()}function rn(e){var t,r,n,i,a,o,s,l,c,u,h=150,f=480,m=250,g=0,y=0,v=0,x=0,b=0,_=0,w=1,k=1,S=null,A=yt,M=null,E=Gt,C=.5;function P(e){return l(e[0]*d,e[1]*d)}function L(e){return(e=l.invert(e[0],e[1]))&&[e[0]*p,e[1]*p]}function I(){var e=en(h,0,0,w,k,_).apply(null,t(g,y)),n=(_?en:Qr)(h,f-e[0],m-e[1],w,k,_);return r=Qe(v,x,b),s=Ke(t,n),l=Ke(r,s),o=Kr(s,C),z()}function z(){return c=u=null,P}return P.stream=function(e){return c&&u===e?c:c=Jr(function(e){return qr({point:function(t,r){var n=e(t,r);return this.stream.point(n[0],n[1])}})}(r)(A(o(E(u=e)))))},P.preclip=function(e){return arguments.length?(A=e,S=void 0,z()):A},P.postclip=function(e){return arguments.length?(E=e,M=n=i=a=null,z()):E},P.clipAngle=function(e){return arguments.length?(A=+e?vt(S=e*d):(S=null,yt),z()):S*p},P.clipExtent=function(e){return arguments.length?(E=null==e?(M=n=i=a=null,Gt):_t(M=+e[0][0],n=+e[0][1],i=+e[1][0],a=+e[1][1]),z()):null==M?null:[[M,n],[i,a]]},P.scale=function(e){return arguments.length?(h=+e,I()):h},P.translate=function(e){return arguments.length?(f=+e[0],m=+e[1],I()):[f,m]},P.center=function(e){return arguments.length?(g=e[0]%360*d,y=e[1]%360*d,I()):[g*p,y*p]},P.rotate=function(e){return arguments.length?(v=e[0]%360*d,x=e[1]%360*d,b=e.length>2?e[2]%360*d:0,I()):[v*p,x*p,b*p]},P.angle=function(e){return arguments.length?(_=e%360*d,I()):_*p},P.reflectX=function(e){return arguments.length?(w=e?-1:1,I()):w<0},P.reflectY=function(e){return arguments.length?(k=e?-1:1,I()):k<0},P.precision=function(e){return arguments.length?(o=Kr(s,C=e*e),z()):T(C)},P.fitExtent=function(e,t){return Wr(P,e,t)},P.fitSize=function(e,t){return $r(P,e,t)},P.fitWidth=function(e,t){return Zr(P,e,t)},P.fitHeight=function(e,t){return Xr(P,e,t)},function(){return t=e.apply(this,arguments),P.invert=t.invert&&L,I()}}function nn(e){var t=0,r=l/3,n=rn(e),i=n(t,r);return i.parallels=function(e){return arguments.length?n(t=e[0]*d,r=e[1]*d):[t*p,r*p]},i}function an(e,t){var r=w(e),n=(r+w(t))/2;if(f(n)<o)return function(e){var t=y(e);function r(e,r){return[e*t,w(r)/t]}return r.invert=function(e,r){return[e/t,M(r*t)]},r}(e);var i=1+r*(2*n-r),a=T(i)/n;function s(e,t){var r=T(i-2*n*w(t))/n;return[r*w(e*=n),a-r*y(e)]}return s.invert=function(e,t){var r=a-t,o=g(e,f(r))*k(r);return r*n<0&&(o-=l*k(e)*k(r)),[o/n,M((i-(e*e+r*r)*n*n)/(2*n))]},s}function on(){return nn(an).scale(155.424).center([0,33.6442])}function sn(){return on().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function ln(e){return function(t,r){var n=y(t),i=y(r),a=e(n*i);return[a*i*w(t),a*w(r)]}}function cn(e){return function(t,r){var n=T(t*t+r*r),i=e(n),a=w(i),o=y(i);return[g(t*a,n*o),M(n&&r*a/n)]}}var un=ln((function(e){return T(2/(1+e))}));un.invert=cn((function(e){return 2*M(e/2)}));var hn=ln((function(e){return(e=A(e))&&e/w(e)}));function pn(e,t){return[e,b(S((c+t)/2))]}function dn(e){var t,r,n,i=tn(e),a=i.center,o=i.scale,s=i.translate,c=i.clipExtent,u=null;function h(){var a=l*o(),s=i(nt(i.rotate()).invert([0,0]));return c(null==u?[[s[0]-a,s[1]-a],[s[0]+a,s[1]+a]]:e===pn?[[Math.max(s[0]-a,u),t],[Math.min(s[0]+a,r),n]]:[[u,Math.max(s[1]-a,t)],[r,Math.min(s[1]+a,n)]])}return i.scale=function(e){return arguments.length?(o(e),h()):o()},i.translate=function(e){return arguments.length?(s(e),h()):s()},i.center=function(e){return arguments.length?(a(e),h()):a()},i.clipExtent=function(e){return arguments.length?(null==e?u=t=r=n=null:(u=+e[0][0],t=+e[0][1],r=+e[1][0],n=+e[1][1]),h()):null==u?null:[[u,t],[r,n]]},h()}function fn(e){return S((c+e)/2)}function mn(e,t){var r=y(e),n=e===t?w(e):b(r/y(t))/b(fn(t)/fn(e)),i=r*_(fn(e),n)/n;if(!n)return pn;function a(e,t){i>0?t<-c+o&&(t=-c+o):t>c-o&&(t=c-o);var r=i/_(fn(t),n);return[r*w(n*e),i-r*y(n*e)]}return a.invert=function(e,t){var r=i-t,a=k(n)*T(e*e+r*r),o=g(e,f(r))*k(r);return r*n<0&&(o-=l*k(e)*k(r)),[o/n,2*m(_(i/a,1/n))-c]},a}function gn(e,t){return[e,t]}function yn(e,t){var r=y(e),n=e===t?w(e):(r-y(t))/(t-e),i=r/n+e;if(f(n)<o)return gn;function a(e,t){var r=i-t,a=n*e;return[r*w(a),i-r*y(a)]}return a.invert=function(e,t){var r=i-t,a=g(e,f(r))*k(r);return r*n<0&&(a-=l*k(e)*k(r)),[a/n,i-k(n)*T(e*e+r*r)]},a}hn.invert=cn((function(e){return e})),pn.invert=function(e,t){return[e,2*m(x(t))-c]},gn.invert=gn;var vn=1.340264,xn=-.081106,bn=893e-6,_n=.003796,wn=T(3)/2;function kn(e,t){var r=M(wn*w(t)),n=r*r,i=n*n*n;return[e*y(r)/(wn*(vn+3*xn*n+i*(7*bn+9*_n*n))),r*(vn+xn*n+i*(bn+_n*n))]}function Tn(e,t){var r=y(t),n=y(e)*r;return[r*w(e)/n,w(t)/n]}function Sn(e,t){var r=t*t,n=r*r;return[e*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),t*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function An(e,t){return[y(t)*w(e),w(t)]}function Mn(e,t){var r=y(t),n=1+y(e)*r;return[r*w(e)/n,w(t)/n]}function En(e,t){return[b(S((c+t)/2)),-e]}kn.invert=function(e,t){for(var r,n=t,i=n*n,a=i*i*i,o=0;o<12&&(a=(i=(n-=r=(n*(vn+xn*i+a*(bn+_n*i))-t)/(vn+3*xn*i+a*(7*bn+9*_n*i)))*n)*i*i,!(f(r)<s));++o);return[wn*e*(vn+3*xn*i+a*(7*bn+9*_n*i))/y(n),M(w(n)/wn)]},Tn.invert=cn(m),Sn.invert=function(e,t){var r,n=t,i=25;do{var a=n*n,s=a*a;n-=r=(n*(1.007226+a*(.015085+s*(.028874*a-.044475-.005916*s)))-t)/(1.007226+a*(.045255+s*(.259866*a-.311325-.005916*11*s)))}while(f(r)>o&&--i>0);return[e/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},An.invert=cn(M),Mn.invert=cn((function(e){return 2*m(e)})),En.invert=function(e,t){return[-t,2*m(x(e))-c]},e.geoAlbers=sn,e.geoAlbersUsa=function(){var e,t,r,n,i,a,s=sn(),l=on().rotate([154,0]).center([-2,58.5]).parallels([55,65]),c=on().rotate([157,0]).center([-3,19.9]).parallels([8,18]),u={point:function(e,t){a=[e,t]}};function h(e){var t=e[0],o=e[1];return a=null,r.point(t,o),a||(n.point(t,o),a)||(i.point(t,o),a)}function p(){return e=t=null,h}return h.invert=function(e){var t=s.scale(),r=s.translate(),n=(e[0]-r[0])/t,i=(e[1]-r[1])/t;return(i>=.12&&i<.234&&n>=-.425&&n<-.214?l:i>=.166&&i<.234&&n>=-.214&&n<-.115?c:s).invert(e)},h.stream=function(r){return e&&t===r?e:e=function(e){var t=e.length;return{point:function(r,n){for(var i=-1;++i<t;)e[i].point(r,n)},sphere:function(){for(var r=-1;++r<t;)e[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)e[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)e[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)e[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)e[r].polygonEnd()}}}([s.stream(t=r),l.stream(r),c.stream(r)])},h.precision=function(e){return arguments.length?(s.precision(e),l.precision(e),c.precision(e),p()):s.precision()},h.scale=function(e){return arguments.length?(s.scale(e),l.scale(.35*e),c.scale(e),h.translate(s.translate())):s.scale()},h.translate=function(e){if(!arguments.length)return s.translate();var t=s.scale(),a=+e[0],h=+e[1];return r=s.translate(e).clipExtent([[a-.455*t,h-.238*t],[a+.455*t,h+.238*t]]).stream(u),n=l.translate([a-.307*t,h+.201*t]).clipExtent([[a-.425*t+o,h+.12*t+o],[a-.214*t-o,h+.234*t-o]]).stream(u),i=c.translate([a-.205*t,h+.212*t]).clipExtent([[a-.214*t+o,h+.166*t+o],[a-.115*t-o,h+.234*t-o]]).stream(u),p()},h.fitExtent=function(e,t){return Wr(h,e,t)},h.fitSize=function(e,t){return $r(h,e,t)},h.fitWidth=function(e,t){return Zr(h,e,t)},h.fitHeight=function(e,t){return Xr(h,e,t)},h.scale(1070)},e.geoArea=function(e){return V.reset(),R(e,q),2*V},e.geoAzimuthalEqualArea=function(){return tn(un).scale(124.75).clipAngle(179.999)},e.geoAzimuthalEqualAreaRaw=un,e.geoAzimuthalEquidistant=function(){return tn(hn).scale(79.4188).clipAngle(179.999)},e.geoAzimuthalEquidistantRaw=hn,e.geoBounds=function(e){var t,r,n,i,a,o,s;if(ie=ne=-(te=re=1/0),ce=[],R(e,Ee),r=ce.length){for(ce.sort(je),t=1,a=[n=ce[0]];t<r;++t)Fe(n,(i=ce[t])[0])||Fe(n,i[1])?(De(n[0],i[1])>De(n[0],n[1])&&(n[1]=i[1]),De(i[0],n[1])>De(n[0],n[1])&&(n[0]=i[0])):a.push(n=i);for(o=-1/0,t=0,n=a[r=a.length-1];t<=r;n=i,++t)i=a[t],(s=De(n[1],i[0]))>o&&(o=s,te=i[0],ne=n[1])}return ce=ue=null,te===1/0||re===1/0?[[NaN,NaN],[NaN,NaN]]:[[te,re],[ne,ie]]},e.geoCentroid=function(e){he=pe=de=fe=me=ge=ye=ve=xe=be=_e=0,R(e,Be);var t=xe,r=be,n=_e,i=t*t+r*r+n*n;return i<s&&(t=ge,r=ye,n=ve,pe<o&&(t=de,r=fe,n=me),(i=t*t+r*r+n*n)<s)?[NaN,NaN]:[g(r,t)*p,M(n/T(i))*p]},e.geoCircle=function(){var e,t,r=Ye([0,0]),n=Ye(90),i=Ye(6),a={point:function(r,n){e.push(r=t(r,n)),r[0]*=p,r[1]*=p}};function o(){var o=r.apply(this,arguments),s=n.apply(this,arguments)*d,l=i.apply(this,arguments)*d;return e=[],t=Qe(-o[0]*d,-o[1]*d,0).invert,it(a,s,l,1),o={type:"Polygon",coordinates:[e]},e=t=null,o}return o.center=function(e){return arguments.length?(r="function"===typeof e?e:Ye([+e[0],+e[1]]),o):r},o.radius=function(e){return arguments.length?(n="function"===typeof e?e:Ye(+e),o):n},o.precision=function(e){return arguments.length?(i="function"===typeof e?e:Ye(+e),o):i},o},e.geoClipAntimeridian=yt,e.geoClipCircle=vt,e.geoClipExtent=function(){var e,t,r,n=0,i=0,a=960,o=500;return r={stream:function(r){return e&&t===r?e:e=_t(n,i,a,o)(t=r)},extent:function(s){return arguments.length?(n=+s[0][0],i=+s[0][1],a=+s[1][0],o=+s[1][1],e=t=null,r):[[n,i],[a,o]]}}},e.geoClipRectangle=_t,e.geoConicConformal=function(){return nn(mn).scale(109.5).parallels([30,30])},e.geoConicConformalRaw=mn,e.geoConicEqualArea=on,e.geoConicEqualAreaRaw=an,e.geoConicEquidistant=function(){return nn(yn).scale(131.154).center([0,13.9389])},e.geoConicEquidistantRaw=yn,e.geoContains=function(e,t){return(e&&Ot.hasOwnProperty(e.type)?Ot[e.type]:Dt)(e,t)},e.geoDistance=zt,e.geoEqualEarth=function(){return tn(kn).scale(177.158)},e.geoEqualEarthRaw=kn,e.geoEquirectangular=function(){return tn(gn).scale(152.63)},e.geoEquirectangularRaw=gn,e.geoGnomonic=function(){return tn(Tn).scale(144.049).clipAngle(60)},e.geoGnomonicRaw=Tn,e.geoGraticule=Ht,e.geoGraticule10=function(){return Ht()()},e.geoIdentity=function(){var e,t,r,n,i,a,o,s=1,l=0,c=0,u=1,h=1,f=0,m=null,g=1,v=1,x=qr({point:function(e,t){var r=k([e,t]);this.stream.point(r[0],r[1])}}),b=Gt;function _(){return g=s*u,v=s*h,a=o=null,k}function k(r){var n=r[0]*g,i=r[1]*v;if(f){var a=i*e-n*t;n=n*e+i*t,i=a}return[n+l,i+c]}return k.invert=function(r){var n=r[0]-l,i=r[1]-c;if(f){var a=i*e+n*t;n=n*e-i*t,i=a}return[n/g,i/v]},k.stream=function(e){return a&&o===e?a:a=x(b(o=e))},k.postclip=function(e){return arguments.length?(b=e,m=r=n=i=null,_()):b},k.clipExtent=function(e){return arguments.length?(b=null==e?(m=r=n=i=null,Gt):_t(m=+e[0][0],r=+e[0][1],n=+e[1][0],i=+e[1][1]),_()):null==m?null:[[m,r],[n,i]]},k.scale=function(e){return arguments.length?(s=+e,_()):s},k.translate=function(e){return arguments.length?(l=+e[0],c=+e[1],_()):[l,c]},k.angle=function(r){return arguments.length?(t=w(f=r%360*d),e=y(f),_()):f*p},k.reflectX=function(e){return arguments.length?(u=e?-1:1,_()):u<0},k.reflectY=function(e){return arguments.length?(h=e?-1:1,_()):h<0},k.fitExtent=function(e,t){return Wr(k,e,t)},k.fitSize=function(e,t){return $r(k,e,t)},k.fitWidth=function(e,t){return Zr(k,e,t)},k.fitHeight=function(e,t){return Xr(k,e,t)},k},e.geoInterpolate=function(e,t){var r=e[0]*d,n=e[1]*d,i=t[0]*d,a=t[1]*d,o=y(n),s=w(n),l=y(a),c=w(a),u=o*y(r),h=o*w(r),f=l*y(i),m=l*w(i),v=2*M(T(E(a-n)+o*l*E(i-r))),x=w(v),b=v?function(e){var t=w(e*=v)/x,r=w(v-e)/x,n=r*u+t*f,i=r*h+t*m,a=r*s+t*c;return[g(i,n)*p,g(a,T(n*n+i*i))*p]}:function(){return[r*p,n*p]};return b.distance=v,b},e.geoLength=Pt,e.geoMercator=function(){return dn(pn).scale(961/h)},e.geoMercatorRaw=pn,e.geoNaturalEarth1=function(){return tn(Sn).scale(175.295)},e.geoNaturalEarth1Raw=Sn,e.geoOrthographic=function(){return tn(An).scale(249.5).clipAngle(90.000001)},e.geoOrthographicRaw=An,e.geoPath=function(e,t){var r,n,i=4.5;function a(e){return e&&("function"===typeof i&&n.pointRadius(+i.apply(this,arguments)),R(e,r(n))),n.result()}return a.area=function(e){return R(e,r(Jt)),Jt.result()},a.measure=function(e){return R(e,r(Fr)),Fr.result()},a.bounds=function(e){return R(e,r(hr)),hr.result()},a.centroid=function(e){return R(e,r(_r)),_r.result()},a.projection=function(t){return arguments.length?(r=null==t?(e=null,Gt):(e=t).stream,a):e},a.context=function(e){return arguments.length?(n=null==e?(t=null,new Ur):new Lr(t=e),"function"!==typeof i&&n.pointRadius(i),a):t},a.pointRadius=function(e){return arguments.length?(i="function"===typeof e?e:(n.pointRadius(+e),+e),a):i},a.projection(e).context(t)},e.geoProjection=tn,e.geoProjectionMutator=rn,e.geoRotation=nt,e.geoStereographic=function(){return tn(Mn).scale(250).clipAngle(142)},e.geoStereographicRaw=Mn,e.geoStream=R,e.geoTransform=function(e){return{stream:qr(e)}},e.geoTransverseMercator=function(){var e=dn(En),t=e.center,r=e.rotate;return e.center=function(e){return arguments.length?t([-e[1],e[0]]):[(e=t())[1],-e[0]]},e.rotate=function(e){return arguments.length?r([e[0],e[1],e.length>2?e[2]+90:90]):[(e=r())[0],e[1],e[2]-90]},r([0,0,90]).scale(159.155)},e.geoTransverseMercatorRaw=En,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,pg()):n((r=r||self).d3=r.d3||{},r.d3)}}),fg=p({"node_modules/d3-geo-projection/dist/d3-geo-projection.js"(e,t){var r,n;r=e,n=function(e,t,r){var n=Math.abs,i=Math.atan,a=Math.atan2,o=Math.cos,s=Math.exp,l=Math.floor,c=Math.log,u=Math.max,h=Math.min,p=Math.pow,d=Math.round,f=Math.sign||function(e){return e>0?1:e<0?-1:0},m=Math.sin,g=Math.tan,y=1e-6,v=1e-12,x=Math.PI,b=x/2,_=x/4,w=Math.SQRT1_2,k=P(2),T=P(x),S=2*x,A=180/x,M=x/180;function E(e){return e>1?b:e<-1?-b:Math.asin(e)}function C(e){return e>1?0:e<-1?x:Math.acos(e)}function P(e){return e>0?Math.sqrt(e):0}function L(e){return(s(e)-s(-e))/2}function I(e){return(s(e)+s(-e))/2}function z(e){var t=g(e/2),r=2*c(o(e/2))/(t*t);function i(e,t){var n=o(e),i=o(t),a=m(t),s=i*n,l=-((1-s?c((1+s)/2)/(1-s):-.5)+r/(1+s));return[l*i*m(e),l*a]}return i.invert=function(t,i){var s,l=P(t*t+i*i),u=-e/2,h=50;if(!l)return[0,0];do{var p=u/2,d=o(p),f=m(p),g=f/d,v=-c(n(d));u-=s=(2/g*v-r*g-l)/(-v/(f*f)+1-r/(2*d*d))*(d<0?.7:1)}while(n(s)>y&&--h>0);var x=m(u);return[a(t*x,l*o(u)),E(i*x/l)]},i}function O(e,t){var r=o(t),n=function(e){return e?e/Math.sin(e):1}(C(r*o(e/=2)));return[2*r*m(e)*n,m(t)*n]}function R(e){var t=m(e),r=o(e),i=e>=0?1:-1,s=g(i*e),l=(1+t-r)/2;function c(e,n){var c=o(n),u=o(e/=2);return[(1+c)*m(e),(i*n>-a(u,s)-.001?0:10*-i)+l+m(n)*r-(1+c)*t*u]}return c.invert=function(e,c){var u=0,h=0,p=50;do{var d=o(u),f=m(u),g=o(h),v=m(h),x=1+g,b=x*f-e,_=l+v*r-x*t*d-c,w=x*d/2,k=-f*v,T=t*x*f/2,S=r*g+t*d*v,A=k*T-S*w,M=(_*k-b*S)/A/2,E=(b*T-_*w)/A;n(E)>2&&(E/=2),u-=M,h-=E}while((n(M)>y||n(E)>y)&&--p>0);return i*h>-a(o(u),s)-.001?[2*u,h]:null},c}function D(e,t){var r=g(t/2),n=P(1-r*r),i=1+n*o(e/=2),a=m(e)*n/i,s=r/i,l=a*a,c=s*s;return[4/3*a*(3+l-3*c),4/3*s*(3+3*l-c)]}O.invert=function(e,t){if(!(e*e+4*t*t>x*x+y)){var r=e,i=t,a=25;do{var s,l=m(r),c=m(r/2),u=o(r/2),h=m(i),p=o(i),d=m(2*i),f=h*h,g=p*p,v=c*c,b=1-g*u*u,_=b?C(p*u)*P(s=1/b):s=0,w=2*_*p*c-e,k=_*h-t,T=s*(g*v+_*p*u*f),S=s*(.5*l*d-2*_*h*c),A=.25*s*(d*c-_*h*g*l),M=s*(f*u+_*v*p),E=S*A-M*T;if(!E)break;var L=(k*S-w*M)/E,I=(w*A-k*T)/E;r-=L,i-=I}while((n(L)>y||n(I)>y)&&--a>0);return[r,i]}},D.invert=function(e,t){if(t*=3/8,!(e*=3/8)&&n(t)>1)return null;var r=1+e*e+t*t,i=P((r-P(r*r-4*t*t))/2),s=E(i)/3,l=i?function(e){return c(e+P(e*e-1))}(n(t/i))/3:function(e){return c(e+P(e*e+1))}(n(e))/3,u=o(s),h=I(l),p=h*h-u*u;return[2*f(e)*a(L(l)*u,.25-p),2*f(t)*a(h*m(s),.25+p)]};var j=P(8),F=c(1+k);function B(e,t){var r=n(t);return r<_?[e,c(g(_+t/2))]:[e*o(r)*(2*k-1/m(r)),f(t)*(2*k*(r-_)-c(g(r/2)))]}function N(e){var r=2*x/e;function s(e,i){var s=t.geoAzimuthalEquidistantRaw(e,i);if(n(e)>b){var l=a(s[1],s[0]),c=P(s[0]*s[0]+s[1]*s[1]),u=r*d((l-b)/r)+b,h=a(m(l-=u),2-o(l));l=u+E(x/c*m(h))-h,s[0]=c*o(l),s[1]=c*m(l)}return s}return s.invert=function(e,n){var s=P(e*e+n*n);if(s>b){var l=a(n,e),c=r*d((l-b)/r)+b,u=l>c?-1:1,h=s*o(c-l),p=1/g(u*C((h-x)/P(x*(x-2*h)+s*s)));l=c+2*i((p+u*P(p*p-3))/3),e=s*o(l),n=s*m(l)}return t.geoAzimuthalEquidistantRaw.invert(e,n)},s}function U(e,r){if(arguments.length<2&&(r=e),1===r)return t.geoAzimuthalEqualAreaRaw;if(r===1/0)return V;function n(n,i){var a=t.geoAzimuthalEqualAreaRaw(n/r,i);return a[0]*=e,a}return n.invert=function(n,i){var a=t.geoAzimuthalEqualAreaRaw.invert(n/e,i);return a[0]*=r,a},n}function V(e,t){return[e*o(t)/o(t/=2),2*m(t)]}function q(e,t,r){var i,a,o,s=100;r=void 0===r?0:+r,t=+t;do{(a=e(r))===(o=e(r+y))&&(o=a+y),r-=i=-1e-6*(a-t)/(a-o)}while(s-- >0&&n(i)>y);return s<0?NaN:r}function H(e,t,r){return void 0===t&&(t=40),void 0===r&&(r=v),function(i,a,o,s){var l,c,u;o=void 0===o?0:+o,s=void 0===s?0:+s;for(var h=0;h<t;h++){var p=e(o,s),d=p[0]-i,f=p[1]-a;if(n(d)<r&&n(f)<r)break;var m=d*d+f*f;if(m>l)o-=c/=2,s-=u/=2;else{l=m;var g=(o>0?-1:1)*r,y=(s>0?-1:1)*r,v=e(o+g,s),x=e(o,s+y),b=(v[0]-p[0])/g,_=(v[1]-p[1])/g,w=(x[0]-p[0])/y,k=(x[1]-p[1])/y,T=k*b-_*w,S=(n(T)<.5?.5:1)/T;if(o+=c=(f*w-d*k)*S,s+=u=(d*_-f*b)*S,n(c)<r&&n(u)<r)break}}return[o,s]}}function G(){var e=U(1.68,2);function t(t,r){if(t+r<-1.4){var n=(t-r+1.6)*(t+r+1.4)/8;t+=n,r-=.8*n*m(r+x/2)}var i=e(t,r),a=(1-o(t*r))/12;return i[1]<0&&(i[0]*=1+a),i[1]>0&&(i[1]*=1+a/1.5*i[0]*i[0]),i}return t.invert=H(t),t}function W(e,t){var r,i=e*m(t),a=30;do{t-=r=(t+m(t)-i)/(1+o(t))}while(n(r)>y&&--a>0);return t/2}function $(e,t,r){function n(n,i){return[e*n*o(i=W(r,i)),t*m(i)]}return n.invert=function(n,i){return i=E(i/t),[n/(e*o(i)),E((2*i+m(2*i))/r)]},n}B.invert=function(e,t){if((a=n(t))<F)return[e,2*i(s(t))-b];var r,a,l=_,u=25;do{var h=o(l/2),p=g(l/2);l-=r=(j*(l-_)-c(p)-a)/(j-h*h/(2*p))}while(n(r)>v&&--u>0);return[e/(o(l)*(j-1/m(l))),f(t)*l]},V.invert=function(e,t){var r=2*E(t/2);return[e*o(r/2)/o(r),r]};var Z=$(k/b,k,x),X=2.00276,Y=1.11072;function K(e,t){var r=W(x,t);return[X*e/(1/o(t)+Y/o(r)),(t+k*m(r))/X]}function J(e){var r=0,n=t.geoProjectionMutator(e),i=n(r);return i.parallel=function(e){return arguments.length?n(r=e*M):r*A},i}function Q(e,t){return[e*o(t),t]}function ee(e){if(!e)return Q;var t=1/g(e);function r(r,n){var i=t+e-n,a=i?r*o(n)/i:i;return[i*m(a),t-i*o(a)]}return r.invert=function(r,n){var i=P(r*r+(n=t-n)*n),s=t+e-i;return[i/o(s)*a(r,n),s]},r}function te(e){function t(t,r){var n=b-r,i=n?t*e*m(n)/n:n;return[n*m(i)/e,b-n*o(i)]}return t.invert=function(t,r){var n=t*e,i=b-r,o=P(n*n+i*i),s=a(n,i);return[(o?o/m(o):1)*s/e,b-o]},t}K.invert=function(e,t){var r,i,a=X*t,s=t<0?-_:_,l=25;do{i=a-k*m(s),s-=r=(m(2*s)+2*s-x*m(i))/(2*o(2*s)+2+x*o(i)*k*o(s))}while(n(r)>y&&--l>0);return i=a-k*m(s),[e*(1/o(i)+Y/o(s))/X,i]},Q.invert=function(e,t){return[e/o(t),t]};var re=$(1,4/x,x);function ne(e,t,r,i,s,l){var c,u=o(l);if(n(e)>1||n(l)>1)c=C(r*s+t*i*u);else{var h=m(e/2),p=m(l/2);c=2*E(P(h*h+t*i*p*p))}return n(c)>y?[c,a(i*m(l),t*s-r*i*u)]:[0,0]}function ie(e,t,r){return C((e*e+t*t-r*r)/(2*e*t))}function ae(e){return e-2*x*l((e+x)/(2*x))}function oe(e,t,r){for(var n,i=[[e[0],e[1],m(e[1]),o(e[1])],[t[0],t[1],m(t[1]),o(t[1])],[r[0],r[1],m(r[1]),o(r[1])]],a=i[2],s=0;s<3;++s,a=n)n=i[s],a.v=ne(n[1]-a[1],a[3],a[2],n[3],n[2],n[0]-a[0]),a.point=[0,0];var l=ie(i[0].v[0],i[2].v[0],i[1].v[0]),c=ie(i[0].v[0],i[1].v[0],i[2].v[0]),u=x-l;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var h=[i[2].point[0]=i[0].point[0]+i[2].v[0]*o(l),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*m(l))];return function(e,t){var r,n=m(t),a=o(t),s=new Array(3);for(r=0;r<3;++r){var l=i[r];if(s[r]=ne(t-l[1],l[3],l[2],a,n,e-l[0]),!s[r][0])return l.point;s[r][1]=ae(s[r][1]-l.v[1])}var p=h.slice();for(r=0;r<3;++r){var d=2==r?0:r+1,f=ie(i[r].v[0],s[r][0],s[d][0]);s[r][1]<0&&(f=-f),r?1==r?(f=c-f,p[0]-=s[r][0]*o(f),p[1]-=s[r][0]*m(f)):(f=u-f,p[0]+=s[r][0]*o(f),p[1]+=s[r][0]*m(f)):(p[0]+=s[r][0]*o(f),p[1]-=s[r][0]*m(f))}return p[0]/=3,p[1]/=3,p}}function se(e){return e[0]*=M,e[1]*=M,e}function le(e,r,n){var i=t.geoCentroid({type:"MultiPoint",coordinates:[e,r,n]}),a=[-i[0],-i[1]],o=t.geoRotation(a),s=oe(se(o(e)),se(o(r)),se(o(n)));s.invert=H(s);var l=t.geoProjection(s).rotate(a),c=l.center;return delete l.rotate,l.center=function(e){return arguments.length?c(o(e)):o.invert(c())},l.clipAngle(90)}function ce(e,t){var r=P(1-m(t));return[2/T*e*r,T*(1-r)]}function ue(e){var t=g(e);function r(e,r){return[e,(e?e/m(e):1)*(m(r)*o(e)-t*o(r))]}return r.invert=t?function(e,r){e&&(r*=m(e)/e);var n=o(e);return[e,2*a(P(n*n+t*t-r*r)-n,t-r)]}:function(e,t){return[e,E(e?t*g(e)/e:t)]},r}ce.invert=function(e,t){var r=(r=t/T-1)*r;return[r>0?e*P(x/r)/2:0,E(1-r)]};var he=P(3);function pe(e,t){return[he*e*(2*o(2*t/3)-1)/T,he*T*m(t/3)]}function de(e){var t=o(e);function r(e,r){return[e*t,m(r)/t]}return r.invert=function(e,r){return[e/t,E(r*t)]},r}function fe(e){var t=o(e);function r(e,r){return[e*t,(1+t)*g(r/2)]}return r.invert=function(e,r){return[e/t,2*i(r/(1+t))]},r}function me(e,t){var r=P(8/(3*x));return[r*e*(1-n(t)/x),r*t]}function ge(e,t){var r=P(4-3*m(n(t)));return[2/P(6*x)*e*r,f(t)*P(2*x/3)*(2-r)]}function ye(e,t){var r=P(x*(4+x));return[2/r*e*(1+P(1-4*t*t/(x*x))),4/r*t]}function ve(e,t){var r=(2+b)*m(t);t/=2;for(var i=0,a=1/0;i<10&&n(a)>y;i++){var s=o(t);t-=a=(t+m(t)*(s+2)-r)/(2*s*(1+s))}return[2/P(x*(4+x))*e*(1+o(t)),2*P(x/(4+x))*m(t)]}function xe(e,t){return[e*(1+o(t))/P(2+x),2*t/P(2+x)]}function be(e,t){for(var r=(1+b)*m(t),i=0,a=1/0;i<10&&n(a)>y;i++)t-=a=(t+m(t)-r)/(1+o(t));return r=P(2+x),[e*(1+o(t))/r,2*t/r]}pe.invert=function(e,t){var r=3*E(t/(he*T));return[T*e/(he*(2*o(2*r/3)-1)),r]},me.invert=function(e,t){var r=P(8/(3*x)),i=t/r;return[e/(r*(1-n(i)/x)),i]},ge.invert=function(e,t){var r=2-n(t)/P(2*x/3);return[e*P(6*x)/(2*r),f(t)*E((4-r*r)/3)]},ye.invert=function(e,t){var r=P(x*(4+x))/2;return[e*r/(1+P(1-t*t*(4+x)/(4*x))),t*r/2]},ve.invert=function(e,t){var r=t*P((4+x)/x)/2,n=E(r),i=o(n);return[e/(2/P(x*(4+x))*(1+i)),E((n+r*(i+2))/(2+b))]},xe.invert=function(e,t){var r=P(2+x),n=t*r/2;return[r*e/(1+o(n)),n]},be.invert=function(e,t){var r=1+b,n=P(r/2);return[2*e*n/(1+o(t*=n)),E((t+m(t))/r)]};var _e=3+2*k;function we(e,t){var r=m(e/=2),n=o(e),a=P(o(t)),s=o(t/=2),l=m(t)/(s+k*n*a),u=P(2/(1+l*l)),h=P((k*s+(n+r)*a)/(k*s+(n-r)*a));return[_e*(u*(h-1/h)-2*c(h)),_e*(u*l*(h+1/h)-2*i(l))]}we.invert=function(e,t){if(!(r=D.invert(e/1.2,1.065*t)))return null;var r,a=r[0],s=r[1],l=20;e/=_e,t/=_e;do{var p=a/2,d=s/2,f=m(p),g=o(p),v=m(d),x=o(d),_=o(s),T=P(_),S=v/(x+k*g*T),A=S*S,M=P(2/(1+A)),E=(k*x+(g+f)*T)/(k*x+(g-f)*T),C=P(E),L=C-1/C,I=C+1/C,z=M*L-2*c(C)-e,O=M*S*I-2*i(S)-t,R=v&&w*T*f*A/v,j=(k*g*x+T)/(2*(x+k*g*T)*(x+k*g*T)*T),F=-.5*S*M*M*M,B=F*R,N=F*j,U=(U=2*x+k*T*(g-f))*U*C,V=(k*g*x*T+_)/U,q=-k*f*v/(T*U),H=L*B-2*V/C+M*(V+V/E),G=L*N-2*q/C+M*(q+q/E),W=S*I*B-2*R/(1+A)+M*I*R+M*S*(V-V/E),$=S*I*N-2*j/(1+A)+M*I*j+M*S*(q-q/E),Z=G*W-$*H;if(!Z)break;var X=(O*G-z*$)/Z,Y=(z*W-O*H)/Z;a-=X,s=u(-b,h(b,s-Y))}while((n(X)>y||n(Y)>y)&&--l>0);return n(n(s)-b)<y?[0,s]:l&&[a,s]};var ke=o(35*M);function Te(e,t){var r=g(t/2);return[e*ke*P(1-r*r),(1+ke)*r]}function Se(e,t){var r=t/2,n=o(r);return[2*e/T*o(t)*n*n,T*g(r)]}function Ae(e){var t=1-e,r=i(x,0)[0]-i(-x,0)[0],n=P(2*(i(0,b)[1]-i(0,-b)[1])/r);function i(r,n){var i=o(n),a=m(n);return[i/(t+e*i)*r,t*n+e*a]}function a(e,t){var r=i(e,t);return[r[0]*n,r[1]/n]}function s(e){return a(0,e)[1]}return a.invert=function(r,i){var a=q(s,i);return[r/n*(e+t/o(a)),a]},a}function Me(e){return[e[0]/2,E(g(e[1]/2*M))*A]}function Ee(e){return[2*e[0],2*i(m(e[1]*M))*A]}function Ce(e,r){var i=2*x/r,s=e*e;function l(r,l){var c=t.geoAzimuthalEquidistantRaw(r,l),u=c[0],h=c[1],p=u*u+h*h;if(p>s){var f=P(p),g=a(h,u),v=i*d(g/i),_=g-v,w=e*o(_),k=(e*m(_)-_*m(w))/(b-w),T=Pe(_,k),S=(x-e)/Le(T,w,x);u=f;var A,M=50;do{u-=A=(e+Le(T,w,u)*S-f)/(T(u)*S)}while(n(A)>y&&--M>0);h=_*m(u),u<b&&(h-=k*(u-b));var E=m(v),C=o(v);c[0]=u*C-h*E,c[1]=u*E+h*C}return c}return l.invert=function(r,l){var c=r*r+l*l;if(c>s){var u=P(c),h=a(l,r),p=i*d(h/i),f=h-p;r=u*o(f),l=u*m(f);for(var g=r-b,y=m(r),_=l/y,w=r<b?1/0:0,k=10;;){var T=e*m(_),S=e*o(_),A=m(S),M=b-S,E=(T-_*A)/M,C=Pe(_,E);if(n(w)<v||! --k)break;_-=w=(_*y-E*g-l)/(y-2*g*(M*(S+_*T*o(S)-A)-T*(T-_*A))/(M*M))}r=(u=e+Le(C,S,r)*(x-e)/Le(C,S,x))*o(h=p+_),l=u*m(h)}return t.geoAzimuthalEquidistantRaw.invert(r,l)},l}function Pe(e,t){return function(r){var n=e*o(r);return r<b&&(n-=t),P(1+n*n)}}function Le(e,t,r){for(var n=(r-t)/50,i=e(t)+e(r),a=1,o=t;a<50;++a)i+=2*e(o+=n);return.5*i*n}function Ie(e,t,r,i,a,s,l,c){function u(n,u){if(!u)return[e*n/x,0];var h=u*u,p=e+h*(t+h*(r+h*i)),d=u*(a-1+h*(s-c+h*l)),f=(p*p+d*d)/(2*d),g=n*E(p/f)/x;return[f*m(g),u*(1+h*c)+f*(1-o(g))]}return arguments.length<8&&(c=0),u.invert=function(u,h){var p,d,f=x*u/e,g=h,v=50;do{var b=g*g,_=e+b*(t+b*(r+b*i)),w=g*(a-1+b*(s-c+b*l)),k=_*_+w*w,T=2*w,S=k/T,A=S*S,M=E(_/S)/x,C=f*M,L=_*_,I=(2*t+b*(4*r+6*b*i))*g,z=a+b*(3*s+5*b*l),O=(2*(_*I+w*(z-1))*T-k*(2*(z-1)))/(T*T),R=o(C),D=m(C),j=S*R,F=S*D,B=f/x*(1/P(1-L/A))*(I*S-_*O)/A,N=F-u,U=g*(1+b*c)+S-j-h,V=O*D+j*B,q=j*M,H=1+O-(O*R-F*B),G=F*M,W=V*G-H*q;if(!W)break;f-=p=(U*V-N*H)/W,g-=d=(N*G-U*q)/W}while((n(p)>y||n(d)>y)&&--v>0);return[f,g]},u}Te.invert=function(e,t){var r=t/(1+ke);return[e&&e/(ke*P(1-r*r)),2*i(r)]},Se.invert=function(e,t){var r=i(t/T),n=o(r),a=2*r;return[e*T/2/(o(a)*n*n),a]};var ze=Ie(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Oe=Ie(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Re=Ie(5/6*x,-.62636,-.0344,0,1.3493,-.05524,0,.045);function De(e,t){var r=e*e,n=t*t;return[e*(1-.162388*n)*(.87-952426e-9*r*r),t*(1+n/12)]}De.invert=function(e,t){var r,i=e,a=t,o=50;do{var s=a*a;a-=r=(a*(1+s/12)-t)/(1+s/4)}while(n(r)>y&&--o>0);o=50,e/=1-.162388*s;do{var l=(l=i*i)*l;i-=r=(i*(.87-952426e-9*l)-e)/(.87-.00476213*l)}while(n(r)>y&&--o>0);return[i,a]};var je=Ie(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762);function Fe(e){var t=e(b,0)[0]-e(-b,0)[0];function r(r,n){var i=r>0?-.5:.5,a=e(r+i*x,n);return a[0]-=i*t,a}return e.invert&&(r.invert=function(r,n){var i=r>0?-.5:.5,a=e.invert(r+i*t,n),o=a[0]-i*x;return o<-x?o+=2*x:o>x&&(o-=2*x),a[0]=o,a}),r}function Be(e,t){var r=f(e),i=f(t),s=o(t),l=o(e)*s,c=m(e)*s,u=m(i*t);e=n(a(c,u)),t=E(l),n(e-b)>y&&(e%=b);var h=function(e,t){if(t===b)return[0,0];var r,i,a=m(t),s=a*a,l=s*s,c=1+l,u=1+3*l,h=1-l,p=E(1/P(c)),d=h+s*c*p,f=(1-a)/d,g=P(f),v=f*c,_=P(v),w=g*h;if(0===e)return[0,-(w+s*_)];var k,T=o(t),S=1/T,A=2*a*T,M=(-3*s+p*u)*A,C=(-d*T-(1-a)*M)/(d*d),L=-S*A,I=-S*(s*c*C+f*u*A),z=-2*S*(h*(.5*C/g)-2*s*g*A),O=4*e/x;if(e>.222*x||t<x/4&&e>.175*x){if(r=(w+s*P(v*(1+l)-w*w))/(1+l),e>x/4)return[r,r];var R=r,D=.5*r;r=.5*(D+R),i=50;do{var j=r*(z+L*P(v-r*r))+I*E(r/_)-O;if(!j)break;j<0?D=r:R=r,r=.5*(D+R)}while(n(R-D)>y&&--i>0)}else{r=y,i=25;do{var F=r*r,B=P(v-F),N=z+L*B,U=r*N+I*E(r/_)-O;r-=k=B?U/(N+(I-L*F)/B):0}while(n(k)>y&&--i>0)}return[r,-w-s*P(v-r*r)]}(e>x/4?b-e:e,t);return e>x/4&&(u=h[0],h[0]=-h[1],h[1]=-u),h[0]*=r,h[1]*=-i,h}function Ne(e,t){var r,a,l,c,u,h;if(t<y)return[(c=m(e))-(r=t*(e-c*(a=o(e)))/4)*a,a+r*c,1-t*c*c/2,e-r];if(t>=.999999)return r=(1-t)/4,l=1/(a=I(e)),[(c=((h=s(2*(h=e)))-1)/(h+1))+r*((u=a*L(e))-e)/(a*a),l-r*c*l*(u-e),l+r*c*l*(u+e),2*i(s(e))-b+r*(u-e)/a];var p=[1,0,0,0,0,0,0,0,0],d=[P(t),0,0,0,0,0,0,0,0],f=0;for(a=P(1-t),u=1;n(d[f]/p[f])>y&&f<8;)r=p[f++],d[f]=(r-a)/2,p[f]=(r+a)/2,a=P(r*a),u*=2;l=u*p[f]*e;do{l=(E(c=d[f]*m(a=l)/p[f])+l)/2}while(--f);return[m(l),c=o(l),c/o(l-a),l]}function Ue(e,t){if(!t)return e;if(1===t)return c(g(e/2+_));for(var r=1,a=P(1-t),o=P(t),s=0;n(o)>y;s++){if(e%x){var l=i(a*g(e)/r);l<0&&(l+=x),e+=l+~~(e/x)*x}else e+=e;o=(r+a)/2,a=P(r*a),o=((r=o)-a)/2}return e/(p(2,s)*r)}function Ve(e,t){var r=(k-1)/(k+1),l=P(1-r*r),u=Ue(b,l*l),h=c(g(x/4+n(t)/2)),p=s(-1*h)/P(r),d=function(e,t){var r=e*e,n=t+1,i=1-r-t*t;return[.5*((e>=0?b:-b)-a(i,2*e)),-.25*c(i*i+4*r)+.5*c(n*n+r)]}(p*o(-1*e),p*m(-1*e)),y=function(e,t,r){var a=n(e),o=L(n(t));if(a){var s=1/m(a),l=1/(g(a)*g(a)),c=-(l+r*(o*o*s*s)-1+r),u=(-c+P(c*c-(r-1)*l*4))/2;return[Ue(i(1/P(u)),r)*f(e),Ue(i(P((u/l-1)/r)),1-r)*f(t)]}return[0,Ue(i(o),1-r)*f(t)]}(d[0],d[1],l*l);return[-y[1],(t>=0?1:-1)*(.5*u-y[0])]}function qe(e){var t=m(e),r=o(e),i=He(e);function s(e,a){var s=i(e,a);e=s[0],a=s[1];var l=m(a),c=o(a),u=o(e),h=C(t*l+r*c*u),p=m(h),d=n(p)>y?h/p:1;return[d*r*m(e),(n(e)>b?d:-d)*(t*c-r*l*u)]}return i.invert=He(-e),s.invert=function(e,r){var n=P(e*e+r*r),s=-m(n),l=o(n),c=n*l,u=-r*s,h=n*t,p=P(c*c+u*u-h*h),d=a(c*h+u*p,u*h-c*p),f=(n>b?-1:1)*a(e*s,n*o(d)*l+r*m(d)*s);return i.invert(f,d)},s}function He(e){var t=m(e),r=o(e);return function(e,n){var i=o(n),s=o(e)*i,l=m(e)*i,c=m(n);return[a(l,s*r-c*t),E(c*r+s*t)]}}Be.invert=function(e,t){n(e)>1&&(e=2*f(e)-e),n(t)>1&&(t=2*f(t)-t);var r=f(e),i=f(t),s=-r*e,l=-i*t,c=l/s<1,u=function(e,t){for(var r=0,i=1,a=.5,s=50;;){var l=a*a,c=P(a),u=E(1/P(1+l)),h=1-l+a*(1+l)*u,p=(1-c)/h,d=P(p),f=p*(1+l),m=d*(1-l),g=P(f-e*e),y=t+m+a*g;if(n(i-r)<v||0===--s||0===y)break;y>0?r=a:i=a,a=.5*(r+i)}if(!s)return null;var b=E(c),_=o(b),w=1/_,k=2*c*_,T=(-h*_-(-3*a+u*(1+3*l))*k*(1-c))/(h*h),S=.5*T/d,A=(1-l)*S-2*a*d*k;return[x/4*(e*(-2*w*A+-w*k*g)+-w*(a*(1+l)*T+p*(1+3*l)*k)*E(e/P(f))),b]}(c?l:s,c?s:l),h=u[0],p=u[1],d=o(p);return c&&(h=-b-h),[r*(a(m(h)*d,-m(p))+x),i*E(o(h)*d)]},Ve.invert=function(e,t){var r=(k-1)/(k+1),n=P(1-r*r),o=function(e,t,r){var n,i,a;return e?(n=Ne(e,r),t?(a=(i=Ne(t,1-r))[1]*i[1]+r*n[0]*n[0]*i[0]*i[0],[[n[0]*i[2]/a,n[1]*n[2]*i[0]*i[1]/a],[n[1]*i[1]/a,-n[0]*n[2]*i[0]*i[2]/a],[n[2]*i[1]*i[2]/a,-r*n[0]*n[1]*i[0]/a]]):[[n[0],0],[n[1],0],[n[2],0]]):[[0,(i=Ne(t,1-r))[0]/i[1]],[1/i[1],0],[i[2]/i[1],0]]}(.5*Ue(b,n*n)-t,-e,n*n),l=function(e,t){var r=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/r,(e[1]*t[0]-e[0]*t[1])/r]}(o[0],o[1]);return[a(l[1],l[0])/-1,2*i(s(-.5*c(r*l[0]*l[0]+r*l[1]*l[1])))-b]};var Ge=E(1-1/3)*A,We=de(0);function $e(e){var t=Ge*M,r=ce(x,t)[0]-ce(-x,t)[0],i=We(0,t)[1],a=ce(0,t)[1],o=T-a,s=S/e,c=4/S,p=i+o*o*4/S;function d(d,f){var m,g=n(f);if(g>t){var y=h(e-1,u(0,l((d+x)/s)));(m=ce(d+=x*(e-1)/e-y*s,g))[0]=m[0]*S/r-S*(e-1)/(2*e)+y*S/e,m[1]=i+4*(m[1]-a)*o/S,f<0&&(m[1]=-m[1])}else m=We(d,f);return m[0]*=c,m[1]/=p,m}return d.invert=function(t,d){t/=c;var f=n(d*=p);if(f>i){var m=h(e-1,u(0,l((t+x)/s)));t=(t+x*(e-1)/e-m*s)*r/S;var g=ce.invert(t,.25*(f-i)*S/o+a);return g[0]-=x*(e-1)/e-m*s,d<0&&(g[1]=-g[1]),g}return We.invert(t,d)},d}function Ze(e,t){return[e,1&t?89.999999:Ge]}function Xe(e,t){return[e,1&t?-89.999999:-Ge]}function Ye(e){return[.999999*e[0],e[1]]}function Ke(e){var t,r=1+e,i=E(m(1/r)),s=2*P(x/(t=x+4*i*r)),l=.5*s*(r+P(e*(2+e))),c=e*e,u=r*r;function h(h,p){var d,f,g=1-m(p);if(g&&g<2){var y,_=b-p,w=25;do{var k=m(_),T=o(_),S=i+a(k,r-T),A=1+u-2*r*T;_-=y=(_-c*i-r*k+A*S-.5*g*t)/(2*r*k*S)}while(n(y)>v&&--w>0);d=s*P(A),f=h*S/x}else d=s*(e+g),f=h*i/x;return[d*m(f),l-d*o(f)]}return h.invert=function(e,n){var o=e*e+(n-=l)*n,h=(1+u-o/(s*s))/(2*r),p=C(h),d=m(p),f=i+a(d,r-h);return[E(e/P(o))*x/f,E(1-2*(p-c*i-r*d+(1+u-2*r*h)*f)/t)]},h}var Je=.7109889596207567,Qe=.0528035274542;function et(e,t){return t>-Je?((e=Z(e,t))[1]+=Qe,e):Q(e,t)}function tt(e,t){return n(t)>Je?((e=Z(e,t))[1]-=t>0?Qe:-Qe,e):Q(e,t)}function rt(e,t,r,n){var i=P(4*x/(2*r+(1+e-t/2)*m(2*r)+(e+t)/2*m(4*r)+t/2*m(6*r))),a=P(n*m(r)*P((1+e*o(2*r)+t*o(4*r))/(1+e+t))),s=r*c(1);function l(r){return P(1+e*o(2*r)+t*o(4*r))}function c(n){var i=n*r;return(2*i+(1+e-t/2)*m(2*i)+(e+t)/2*m(4*i)+t/2*m(6*i))/r}function u(e){return l(e)*m(e)}var h=function(e,t){var n=r*q(c,s*m(t)/r,t/x);isNaN(n)&&(n=r*f(t));var u=i*l(n);return[u*a*e/x*o(n),u/a*m(n)]};return h.invert=function(e,t){var n=q(u,t*a/i);return[e*x/(o(n)*i*a*l(n)),E(r*c(n/r)/s)]},0===r&&(i=P(n/x),(h=function(e,t){return[e*i,m(t)/i]}).invert=function(e,t){return[e/i,E(t*i)]}),h}function nt(e,t,r,n,i,a,o,s,l,c,u){if(u.nanEncountered)return NaN;var h,p,d,f,m,g,y,v,x,b;if(p=e(t+.25*(h=r-t)),d=e(r-.25*h),isNaN(p))u.nanEncountered=!0;else{if(!isNaN(d))return b=((g=(f=h*(n+4*p+i)/12)+(m=h*(i+4*d+a)/12))-o)/15,c>l?(u.maxDepthCount++,g+b):Math.abs(b)<s?g+b:(v=nt(e,t,y=t+.5*h,n,p,i,f,.5*s,l,c+1,u),isNaN(v)?(u.nanEncountered=!0,NaN):(x=nt(e,y,r,i,d,a,m,.5*s,l,c+1,u),isNaN(x)?(u.nanEncountered=!0,NaN):v+x));u.nanEncountered=!0}}function it(e,t,r,n,i){void 0===n&&(n=1e-8),void 0===i&&(i=20);var a=e(t),o=e(.5*(t+r)),s=e(r);return nt(e,t,r,a,o,s,(a+4*o+s)*(r-t)/6,n,i,1,{maxDepthCount:0,nanEncountered:!1})}function at(e,t,r){function i(r){return e+(1-e)*p(1-p(r,t),1/t)}function a(e){return it(i,0,e,1e-4)}for(var o=1/a(1),s=1e3,l=(1+1e-8)*o,c=[],u=0;u<=s;u++)c.push(a(u/s)*l);function h(e){var t=0,r=s,n=500;do{c[n]>e?r=n:t=n,n=t+r>>1}while(n>t);var i=c[n+1]-c[n];return i&&(i=(e-c[n+1])/i),(n+1+i)/s}var d=2*h(1)/x*o/r,g=function(e,t){var r=h(n(m(t))),a=i(r)*e;return r/=d,[a,t>=0?r:-r]};return g.invert=function(e,t){var r;return n(t*=d)<1&&(r=f(t)*E(a(n(t))*o)),[e/i(n(t)),r]},g}function ot(e,t){return n(e[0]-t[0])<y&&n(e[1]-t[1])<y}function st(e,t){for(var r,n,i,a=-1,o=e.length,s=e[0],l=[];++a<o;){n=((r=e[a])[0]-s[0])/t,i=(r[1]-s[1])/t;for(var c=0;c<t;++c)l.push([s[0]+c*n,s[1]+c*i]);s=r}return l.push(r),l}function lt(e,n,i){var a,o;function s(t,r){for(var i=r<0?-1:1,a=n[+(r<0)],o=0,s=a.length-1;o<s&&t>a[o][2][0];++o);var l=e(t-a[o][1][0],r);return l[0]+=e(a[o][1][0],i*r>i*a[o][0][1]?a[o][0][1]:r)[0],l}i?s.invert=i(s):e.invert&&(s.invert=function(t,r){for(var i=o[+(r<0)],a=n[+(r<0)],l=0,c=i.length;l<c;++l){var u=i[l];if(u[0][0]<=t&&t<u[1][0]&&u[0][1]<=r&&r<u[1][1]){var h=e.invert(t-e(a[l][1][0],0)[0],r);return h[0]+=a[l][1][0],ot(s(h[0],h[1]),[t,r])?h:null}}});var l=t.geoProjection(s),c=l.stream;return l.stream=function(e){var r=l.rotate(),n=c(e),i=(l.rotate([0,0]),c(e));return l.rotate(r),n.sphere=function(){t.geoStream(a,i)},n},l.lobes=function(t){return arguments.length?(a=function(e){var t,n,i,a,o,s,l,c=[],u=e[0].length;for(l=0;l<u;++l)n=(t=e[0][l])[0][0],i=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],c.push(st([[n+y,i+y],[n+y,a-y],[o-y,a-y],[o-y,s+y]],30));for(l=e[1].length-1;l>=0;--l)n=(t=e[1][l])[0][0],i=t[0][1],a=t[1][1],o=t[2][0],s=t[2][1],c.push(st([[o-y,s-y],[o-y,a+y],[n+y,a+y],[n+y,i-y]],30));return{type:"Polygon",coordinates:[r.merge(c)]}}(t),n=t.map((function(e){return e.map((function(e){return[[e[0][0]*M,e[0][1]*M],[e[1][0]*M,e[1][1]*M],[e[2][0]*M,e[2][1]*M]]}))})),o=n.map((function(t){return t.map((function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]}))})),l):n.map((function(e){return e.map((function(e){return[[e[0][0]*A,e[0][1]*A],[e[1][0]*A,e[1][1]*A],[e[2][0]*A,e[2][1]*A]]}))}))},null!=n&&l.lobes(n),l}et.invert=function(e,t){return t>-Je?Z.invert(e,t-Qe):Q.invert(e,t)},tt.invert=function(e,t){return n(t)>Je?Z.invert(e,t+(t>0?Qe:-Qe)):Q.invert(e,t)};var ct=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ut=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],ht=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],pt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],dt=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],ft=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]];function mt(e,t){return[3/S*e*P(x*x/3-t*t),t]}function gt(e){function t(t,r){if(n(n(r)-b)<y)return[0,r<0?-2:2];var i=m(r),a=p((1+i)/(1-i),e/2),s=.5*(a+1/a)+o(t*=e);return[2*m(t)/s,(a-1/a)/s]}return t.invert=function(t,r){var i=n(r);if(n(i-2)<y)return t?null:[0,f(r)*b];if(i>2)return null;var o=(t/=2)*t,s=(r/=2)*r,l=2*r/(1+o+s);return l=p((1+l)/(1-l),1/e),[a(2*t,1-o-s)/e,E((l-1)/(l+1))]},t}mt.invert=function(e,t){return[S/3*e/P(x*x/3-t*t),t]};var yt=x/k;function vt(e,t){return[e*(1+P(o(t)))/2,t/(o(t/2)*o(e/6))]}function xt(e,t){var r=e*e,n=t*t;return[e*(.975534+n*(-.0143059*r-.119161+-.0547009*n)),t*(1.00384+r*(.0802894+-.02855*n+199025e-9*r)+n*(.0998909+-.0491032*n))]}function bt(e,t){return[m(e)/o(t),g(t)*o(e)]}function _t(e){var t=o(e),r=g(_+e/2);function i(i,a){var o=a-e,s=n(o)<y?i*t:n(s=_+a/2)<y||n(n(s)-b)<y?0:i*o/c(g(s)/r);return[s,o]}return i.invert=function(i,a){var o,s=a+e;return[n(a)<y?i/t:n(o=_+s/2)<y||n(n(o)-b)<y?0:i*c(g(o)/r)/a,s]},i}function wt(e,t){return[e,1.25*c(g(_+.4*t))]}function kt(e){var t=e.length-1;function r(r,n){for(var i,a=o(n),s=2/(1+a*o(r)),l=s*a*m(r),c=s*m(n),u=t,h=e[u],p=h[0],d=h[1];--u>=0;)p=(h=e[u])[0]+l*(i=p)-c*d,d=h[1]+l*d+c*i;return[p=l*(i=p)-c*d,d=l*d+c*i]}return r.invert=function(r,s){var l=20,c=r,u=s;do{for(var h,p=t,d=e[p],f=d[0],g=d[1],y=0,v=0;--p>=0;)y=f+c*(h=y)-u*v,v=g+c*v+u*h,f=(d=e[p])[0]+c*(h=f)-u*g,g=d[1]+c*g+u*h;var x,b,_=(y=f+c*(h=y)-u*v)*y+(v=g+c*v+u*h)*v;c-=x=((f=c*(h=f)-u*g-r)*y+(g=c*g+u*h-s)*v)/_,u-=b=(g*y-f*v)/_}while(n(x)+n(b)>1e-12&&--l>0);if(l){var w=P(c*c+u*u),k=2*i(.5*w),T=m(k);return[a(c*T,w*o(k)),w?E(u*T/w):0]}},r}vt.invert=function(e,t){var r=n(e),i=n(t),a=y,s=b;i<yt?s*=i/yt:a+=6*C(yt/i);for(var l=0;l<25;l++){var c=m(s),u=P(o(s)),h=m(s/2),p=o(s/2),d=m(a/6),f=o(a/6),g=.5*a*(1+u)-r,v=s/(p*f)-i,x=u?-.25*a*c/u:0,_=.5*(1+u),w=(1+.5*s*h/p)/(p*f),k=s/p*(d/6)/(f*f),T=x*k-w*_,S=(g*k-v*_)/T,A=(v*x-g*w)/T;if(s-=S,a-=A,n(S)<y&&n(A)<y)break}return[e<0?-a:a,t<0?-s:s]},xt.invert=function(e,t){var r=f(e)*x,i=t/2,a=50;do{var o=r*r,s=i*i,l=r*i,c=r*(.975534+s*(-.0143059*o-.119161+-.0547009*s))-e,u=i*(1.00384+o*(.0802894+-.02855*s+199025e-9*o)+s*(.0998909+-.0491032*s))-t,h=.975534-s*(.119161+3*o*.0143059+.0547009*s),p=-l*(.238322+.2188036*s+.0286118*o),d=l*(.1605788+7961e-7*o+-.0571*s),m=1.00384+o*(.0802894+199025e-9*o)+s*(3*(.0998909-.02855*o)-.245516*s),g=p*d-m*h,v=(u*p-c*m)/g,b=(c*d-u*h)/g;r-=v,i-=b}while((n(v)>y||n(b)>y)&&--a>0);return a&&[r,i]},bt.invert=function(e,t){var r=e*e,n=t*t+1,i=r+n,a=e?w*P((i-P(i*i-4*r))/r):1/P(n);return[E(e*a),f(t)*C(a)]},wt.invert=function(e,t){return[e,2.5*i(s(.8*t))-.625*x]};var Tt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],St=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],At=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Mt=[[.9245,0],[0,0],[.01943,0]],Et=[[.721316,0],[0,0],[-.00881625,-.00617325]];function Ct(e,r){var n=t.geoProjection(kt(e)).rotate(r).clipAngle(90),i=t.geoRotation(r),a=n.center;return delete n.rotate,n.center=function(e){return arguments.length?a(i(e)):i.invert(a())},n}var Pt=P(6),Lt=P(7);function It(e,t){var r=E(7*m(t)/(3*Pt));return[Pt*e*(2*o(2*r/3)-1)/Lt,9*m(r/3)/Lt]}function zt(e,t){for(var r,i=(1+w)*m(t),a=t,s=0;s<25&&(a-=r=(m(a/2)+m(a)-i)/(.5*o(a/2)+o(a)),!(n(r)<y));s++);return[e*(1+2*o(a)/o(a/2))/(3*k),2*P(3)*m(a/2)/P(2+k)]}function Ot(e,t){for(var r,i=P(6/(4+x)),a=(1+x/4)*m(t),s=t/2,l=0;l<25&&(s-=r=(s/2+m(s)-a)/(.5+o(s)),!(n(r)<y));l++);return[i*(.5+o(s))*e/1.5,i*s]}function Rt(e,t){var r=t*t,n=r*r,i=r*n;return[e*(.84719-.13063*r+i*i*(.05494*r-.04515-.02326*n+.00331*i)),t*(1.01183+n*n*(.01926*r-.02625-.00396*n))]}function Dt(e,t){return[e*(1+o(t))/2,2*(t-g(t/2))]}It.invert=function(e,t){var r=3*E(t*Lt/9);return[e*Lt/(Pt*(2*o(2*r/3)-1)),E(3*m(r)*Pt/7)]},zt.invert=function(e,t){var r=t*P(2+k)/(2*P(3)),n=2*E(r);return[3*k*e/(1+2*o(n)/o(n/2)),E((r+m(n))/(1+w))]},Ot.invert=function(e,t){var r=P(6/(4+x)),i=t/r;return n(n(i)-b)<y&&(i=i<0?-b:b),[1.5*e/(r*(.5+o(i))),E((i/2+m(i))/(1+x/4))]},Rt.invert=function(e,t){var r,i,a,o,s=t,l=25;do{s-=r=(s*(1.01183+(a=(i=s*s)*i)*a*(.01926*i-.02625-.00396*a))-t)/(1.01183+a*a*(.21186*i-.23625+-.05148*a))}while(n(r)>v&&--l>0);return[e/(.84719-.13063*(i=s*s)+(o=i*(a=i*i))*o*(.05494*i-.04515-.02326*a+.00331*o)),s]},Dt.invert=function(e,t){for(var r=t/2,i=0,a=1/0;i<10&&n(a)>y;++i){var s=o(t/2);t-=a=(t-g(t/2)-r)/(1-.5/(s*s))}return[2*e/(1+o(t)),t]};var jt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]];function Ft(e,t){var r=m(t),i=o(t),a=f(e);if(0===e||n(t)===b)return[0,t];if(0===t)return[e,0];if(n(e)===b)return[e*i,b*r];var s=x/(2*e)-2*e/x,l=2*t/x,c=(1-l*l)/(r-l),u=s*s,h=c*c,p=1+u/h,d=1+h/u,g=(s*r/c-s/2)/p,y=(h*r/u+c/2)/d,v=y*y-(h*r*r/u+c*r-1)/d;return[b*(g+P(g*g+i*i/p)*a),b*(y+P(v<0?0:v)*f(-t*s)*a)]}Ft.invert=function(e,t){var r=(e/=b)*e,n=r+(t/=b)*t,i=x*x;return[e?(n-1+P((1-n)*(1-n)+4*r))/(2*e)*b:0,q((function(e){return n*(x*m(e)-2*e)*x+4*e*e*(t-m(e))+2*x*e-i*t}),0)]};var Bt=1.0148,Nt=.23185,Ut=-.14499,Vt=.02406,qt=Bt,Ht=5*Nt,Gt=1.790857183;function Wt(e,t){var r=t*t;return[e,t*(Bt+r*r*(Nt+r*(Ut+Vt*r)))]}function $t(e,t){if(n(t)<y)return[e,0];var r=g(t),i=e*m(t);return[m(i)/r,t+(1-o(i))/r]}function Zt(e,t){var r=Yt(e[1],e[0]),n=Yt(t[1],t[0]),i=function(e,t){return a(e[0]*t[1]-e[1]*t[0],e[0]*t[0]+e[1]*t[1])}(r,n),s=Kt(r)/Kt(n);return Xt([1,0,e[0][0],0,1,e[0][1]],Xt([s,0,0,0,s,0],Xt([o(i),m(i),0,-m(i),o(i),0],[1,0,-t[0][0],0,1,-t[0][1]])))}function Xt(e,t){return[e[0]*t[0]+e[1]*t[3],e[0]*t[1]+e[1]*t[4],e[0]*t[2]+e[1]*t[5]+e[2],e[3]*t[0]+e[4]*t[3],e[3]*t[1]+e[4]*t[4],e[3]*t[2]+e[4]*t[5]+e[5]]}function Yt(e,t){return[e[0]-t[0],e[1]-t[1]]}function Kt(e){return P(e[0]*e[0]+e[1]*e[1])}function Jt(e,r,n){function i(e,t){var n,i=r(e,t),a=i.project([e*A,t*A]);return(n=i.transform)?[n[0]*a[0]+n[1]*a[1]+n[2],-(n[3]*a[0]+n[4]*a[1]+n[5])]:(a[1]=-a[1],a)}function a(e,t){var n=e.project.invert,i=e.transform,o=t;if(i&&(o=[(i=function(e){var t=1/(e[0]*e[4]-e[1]*e[3]);return[t*e[4],-t*e[1],t*(e[1]*e[5]-e[2]*e[4]),-t*e[3],t*e[0],t*(e[2]*e[3]-e[0]*e[5])]}(i))[0]*o[0]+i[1]*o[1]+i[2],i[3]*o[0]+i[4]*o[1]+i[5]]),n&&e===function(e){return r(e[0]*M,e[1]*M)}(s=n(o)))return s;for(var s,l=e.children,c=0,u=l&&l.length;c<u;++c)if(s=a(l[c],t))return s}!function e(t,r){if(t.edges=function(e){for(var t=e.length,r=[],n=e[t-1],i=0;i<t;++i)r.push([n,n=e[i]]);return r}(t.face),r.face){var n=t.shared=function(e,t){for(var r,n,i=e.length,a=null,o=0;o<i;++o){r=e[o];for(var s=t.length;--s>=0;)if(n=t[s],r[0]===n[0]&&r[1]===n[1]){if(a)return[a,r];a=r}}}(t.face,r.face),i=Zt(n.map(r.project),n.map(t.project));t.transform=r.transform?Xt(r.transform,i):i;for(var a=r.edges,o=0,s=a.length;o<s;++o)er(n[0],a[o][1])&&er(n[1],a[o][0])&&(a[o]=t),er(n[0],a[o][0])&&er(n[1],a[o][1])&&(a[o]=t);for(o=0,s=(a=t.edges).length;o<s;++o)er(n[0],a[o][0])&&er(n[1],a[o][1])&&(a[o]=r),er(n[0],a[o][1])&&er(n[1],a[o][0])&&(a[o]=r)}else t.transform=r.transform;return t.children&&t.children.forEach((function(r){e(r,t)})),t}(e,{transform:null}),tr(e)&&(i.invert=function(t,r){var n=a(e,[t,-r]);return n&&(n[0]*=M,n[1]*=M,n)});var o=t.geoProjection(i),s=o.stream;return o.stream=function(t){var r=o.rotate(),n=s(t),i=(o.rotate([0,0]),s(t));return o.rotate(r),n.sphere=function(){i.polygonStart(),i.lineStart(),Qt(i,e),i.lineEnd(),i.polygonEnd()},n},o.angle(null==n?-30:n*A)}function Qt(e,r,i){var a,o,s=r.edges,l=s.length,c={type:"MultiPoint",coordinates:r.face},u=r.face.filter((function(e){return 90!==n(e[1])})),h=t.geoBounds({type:"MultiPoint",coordinates:u}),p=!1,d=-1,f=h[1][0]-h[0][0],m=180===f||360===f?[(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]:t.geoCentroid(c);if(i)for(;++d<l&&s[d]!==i;);++d;for(var g=0;g<l;++g)o=s[(g+d)%l],Array.isArray(o)?(p||(e.point((a=t.geoInterpolate(o[0],m)(y))[0],a[1]),p=!0),e.point((a=t.geoInterpolate(o[1],m)(y))[0],a[1])):(p=!1,o!==i&&Qt(e,o,r))}function er(e,t){return e&&t&&e[0]===t[0]&&e[1]===t[1]}function tr(e){return e.project.invert||e.children&&e.children.some(tr)}Wt.invert=function(e,t){t>Gt?t=Gt:t<-1.790857183&&(t=-1.790857183);var r,i=t;do{var a=i*i;i-=r=(i*(Bt+a*a*(Nt+a*(Ut+Vt*a)))-t)/(qt+a*a*(Ht+a*(.21654*a-1.01493)))}while(n(r)>y);return[e,i]},$t.invert=function(e,t){if(n(t)<y)return[e,0];var r,i=e*e+t*t,a=.5*t,s=10;do{var l=g(a),c=1/o(a),u=i-2*t*a+a*a;a-=r=(l*u+2*(a-t))/(2+u*c*c+2*(a-t)*l)}while(n(r)>y&&--s>0);return l=g(a),[(n(t)<n(a+1/l)?E(e*l):f(t)*f(e)*(C(n(e*l))+b))/m(a),a]};var rr=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],nr=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map((function(e){return e.map((function(e){return rr[e]}))})),ir=2/P(3);function ar(e,t){var r=ce(e,t);return[r[0]*ir,r[1]]}function or(e,t){for(var r=0,n=e.length,i=0;r<n;++r)i+=e[r]*t[r];return i}function sr(e){return[a(e[1],e[0])*A,E(u(-1,h(1,e[2])))*A]}function lr(e){var t=e[0]*M,r=e[1]*M,n=o(r);return[n*o(t),n*m(t),m(r)]}function cr(){}function ur(e,t){return{type:"FeatureCollection",features:e.features.map((function(e){return hr(e,t)}))}}function hr(e,t){return{type:"Feature",id:e.id,properties:e.properties,geometry:pr(e.geometry,t)}}function pr(e,r){if(!e)return null;if("GeometryCollection"===e.type)return function(e,t){return{type:"GeometryCollection",geometries:e.geometries.map((function(e){return pr(e,t)}))}}(e,r);var n;switch(e.type){case"Point":case"MultiPoint":n=mr;break;case"LineString":case"MultiLineString":n=gr;break;case"Polygon":case"MultiPolygon":case"Sphere":n=yr;break;default:return null}return t.geoStream(e,r(n)),n.result()}ar.invert=function(e,t){return ce.invert(e/ir,t)};var dr=[],fr=[],mr={point:function(e,t){dr.push([e,t])},result:function(){var e=dr.length?dr.length<2?{type:"Point",coordinates:dr[0]}:{type:"MultiPoint",coordinates:dr}:null;return dr=[],e}},gr={lineStart:cr,point:function(e,t){dr.push([e,t])},lineEnd:function(){dr.length&&(fr.push(dr),dr=[])},result:function(){var e=fr.length?fr.length<2?{type:"LineString",coordinates:fr[0]}:{type:"MultiLineString",coordinates:fr}:null;return fr=[],e}},yr={polygonStart:cr,lineStart:cr,point:function(e,t){dr.push([e,t])},lineEnd:function(){var e=dr.length;if(e){do{dr.push(dr[0].slice())}while(++e<4);fr.push(dr),dr=[]}},polygonEnd:cr,result:function(){if(!fr.length)return null;var e=[],t=[];return fr.forEach((function(r){!function(e){if((t=e.length)<4)return!1;for(var t,r=0,n=e[t-1][1]*e[0][0]-e[t-1][0]*e[0][1];++r<t;)n+=e[r-1][1]*e[r][0]-e[r-1][0]*e[r][1];return n<=0}(r)?t.push(r):e.push([r])})),t.forEach((function(t){var r=t[0];e.some((function(e){if(function(e,t){for(var r=t[0],n=t[1],i=!1,a=0,o=e.length,s=o-1;a<o;s=a++){var l=e[a],c=l[0],u=l[1],h=e[s],p=h[0],d=h[1];u>n^d>n&&r<(p-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(e[0],r))return e.push(t),!0}))||e.push([t])})),fr=[],e.length?e.length>1?{type:"MultiPolygon",coordinates:e}:{type:"Polygon",coordinates:e[0]}:null}};function vr(e){var r=e(b,0)[0]-e(-b,0)[0];function i(t,i){var a=n(t)<b,o=e(a?t:t>0?t-x:t+x,i),s=(o[0]-o[1])*w,l=(o[0]+o[1])*w;if(a)return[s,l];var c=r*w,u=s>0^l>0?-1:1;return[u*s-f(l)*c,u*l-f(s)*c]}return e.invert&&(i.invert=function(t,i){var a=(t+i)*w,o=(i-t)*w,s=n(a)<.5*r&&n(o)<.5*r;if(!s){var l=r*w,c=a>0^o>0?-1:1,u=-c*t+(o>0?1:-1)*l,h=-c*i+(a>0?1:-1)*l;a=(-u-h)*w,o=(u-h)*w}var p=e.invert(a,o);return s||(p[0]+=a>0?x:-x),p}),t.geoProjection(i).rotate([-90,-90,45]).clipAngle(179.999)}function xr(){return vr(Ve).scale(111.48)}function br(e){var t=m(e);function r(r,n){var a=t?g(r*t/2)/t:r/2;if(!n)return[2*a,-e];var s=2*i(a*m(n)),l=1/g(n);return[m(s)*l,n+(1-o(s))*l-e]}return r.invert=function(r,a){if(n(a+=e)<y)return[t?2*i(t*r/2)/t:r,0];var s,l=r*r+a*a,c=0,u=10;do{var h=g(c),p=1/o(c),d=l-2*a*c+c*c;c-=s=(h*d+2*(c-a))/(2+d*p*p+2*(c-a)*h)}while(n(s)>y&&--u>0);var f=r*(h=g(c)),v=g(n(a)<n(c+1/h)?.5*E(f):.5*C(f)+x/4)/m(c);return[t?2*i(t*v)/t:2*v,c]},r}var _r=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];function wr(e,t){var r,i=h(18,36*n(t)/x),a=l(i),o=i-a,s=(r=_r[a])[0],c=r[1],u=(r=_r[++a])[0],p=r[1],d=(r=_r[h(19,++a)])[0],f=r[1];return[e*(u+o*(d-s)/2+o*o*(d-2*u+s)/2),(t>0?b:-b)*(p+o*(f-c)/2+o*o*(f-2*p+c)/2)]}function kr(e,t){var r=function(e){function t(t,r){var n=o(r),i=(e-1)/(e-n*o(t));return[i*n*m(t),i*m(r)]}return t.invert=function(t,r){var n=t*t+r*r,i=P(n),o=(e-P(1-n*(e+1)/(e-1)))/((e-1)/i+i/(e-1));return[a(t*o,i*P(1-o*o)),i?E(r*o/i):0]},t}(e);if(!t)return r;var n=o(t),i=m(t);function s(t,a){var o=r(t,a),s=o[1],l=s*i/(e-1)+n;return[o[0]*n/l,s/l]}return s.invert=function(t,a){var o=(e-1)/(e-1-a*i);return r.invert(o*t,o*a*n)},s}_r.forEach((function(e){e[1]*=1.0144})),wr.invert=function(e,t){var r=t/b,i=90*r,a=h(18,n(i/5)),o=u(0,l(a));do{var s=_r[o][1],c=_r[o+1][1],p=_r[h(19,o+2)][1],d=p-s,f=p-2*c+s,m=2*(n(r)-c)/d,g=f/d,y=m*(1-g*m*(1-2*g*m));if(y>=0||1===o){i=(t>=0?5:-5)*(y+a);var x,_=50;do{y=(a=h(18,n(i)/5))-(o=l(a)),s=_r[o][1],c=_r[o+1][1],p=_r[h(19,o+2)][1],i-=(x=(t>=0?b:-b)*(c+y*(p-s)/2+y*y*(p-2*c+s)/2)-t)*A}while(n(x)>v&&--_>0);break}}while(--o>=0);var w=_r[o][0],k=_r[o+1][0],T=_r[h(19,o+2)][0];return[e/(k+y*(T-w)/2+y*y*(T-2*k+w)/2),i*M]};var Tr=-180,Sr=-179.9999,Ar=179.9999,Mr=-89.9999,Er=89.9999;function Cr(e){return e.length>0}function Pr(e){return-90===e||90===e?[0,e]:[Tr,(t=e,Math.floor(1e4*t)/1e4)];var t}function Lr(e){var t=e[0],r=e[1],n=!1;return t<=Sr?(t=Tr,n=!0):t>=Ar&&(t=180,n=!0),r<=Mr?(r=-90,n=!0):r>=Er&&(r=90,n=!0),n?[t,r]:e}function Ir(e){return e.map(Lr)}function zr(e,t,r){for(var n=0,i=e.length;n<i;++n){var a=e[n].slice();r.push({index:-1,polygon:t,ring:a});for(var o=0,s=a.length;o<s;++o){var l=a[o],c=l[0],u=l[1];if(c<=Sr||c>=Ar||u<=Mr||u>=Er){a[o]=Lr(l);for(var h=o+1;h<s;++h){var p=a[h],d=p[0],f=p[1];if(d>Sr&&d<Ar&&f>Mr&&f<Er)break}if(h===o+1)continue;if(o){var m={index:-1,polygon:t,ring:a.slice(0,o+1)};m.ring[m.ring.length-1]=Pr(u),r[r.length-1]=m}else r.pop();if(h>=s)break;r.push({index:-1,polygon:t,ring:a=a.slice(h-1)}),a[0]=Pr(a[0][1]),o=-1,s=a.length}}}}function Or(e){var t,r,n,i,a,o,s=e.length,l={},c={};for(t=0;t<s;++t)n=(r=e[t]).ring[0],a=r.ring[r.ring.length-1],n[0]!==a[0]||n[1]!==a[1]?(r.index=t,l[n]=c[a]=r):(r.polygon.push(r.ring),e[t]=null);for(t=0;t<s;++t)if(r=e[t]){if(n=r.ring[0],a=r.ring[r.ring.length-1],i=c[n],o=l[a],delete l[n],delete c[a],n[0]===a[0]&&n[1]===a[1]){r.polygon.push(r.ring);continue}i?(delete c[n],delete l[i.ring[0]],i.ring.pop(),e[i.index]=null,r={index:-1,polygon:i.polygon,ring:i.ring.concat(r.ring)},i===o?r.polygon.push(r.ring):(r.index=s++,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r))):o?(delete l[a],delete c[o.ring[o.ring.length-1]],r.ring.pop(),r={index:s++,polygon:o.polygon,ring:r.ring.concat(o.ring)},e[o.index]=null,e.push(l[r.ring[0]]=c[r.ring[r.ring.length-1]]=r)):(r.ring.push(r.ring[0]),r.polygon.push(r.ring))}}function Rr(e){var t={type:"Feature",geometry:Dr(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),null!=e.properties&&(t.properties=e.properties),t}function Dr(e){if(null==e)return e;var t,r,n,i;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(Dr)};break;case"Point":t={type:"Point",coordinates:Lr(e.coordinates)};break;case"MultiPoint":case"LineString":t={type:e.type,coordinates:Ir(e.coordinates)};break;case"MultiLineString":t={type:"MultiLineString",coordinates:e.coordinates.map(Ir)};break;case"Polygon":var a=[];zr(e.coordinates,a,r=[]),Or(r),t={type:"Polygon",coordinates:a};break;case"MultiPolygon":r=[],n=-1,i=e.coordinates.length;for(var o=new Array(i);++n<i;)zr(e.coordinates[n],o[n]=[],r);Or(r),t={type:"MultiPolygon",coordinates:o.filter(Cr)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function jr(e,t){var r=g(t/2),n=m(_*r);return[e*(.74482-.34588*n*n),1.70711*r]}function Fr(e,r,n){var i=t.geoInterpolate(r,n),a=i(.5),o=t.geoRotation([-a[0],-a[1]])(r),s=i.distance/2,l=-E(m(o[1]*M)/m(s)),c=[-a[0],-a[1],-(o[0]>0?x-l:l)*A],u=t.geoProjection(e(s)).rotate(c),h=t.geoRotation(c),p=u.center;return delete u.rotate,u.center=function(e){return arguments.length?p(h(e)):h.invert(p())},u.clipAngle(90)}function Br(e){var r=o(e);function n(e,n){var i=t.geoGnomonicRaw(e,n);return i[0]*=r,i}return n.invert=function(e,n){return t.geoGnomonicRaw.invert(e/r,n)},n}function Nr(e,t){return Fr(Br,e,t)}function Ur(e){if(!(e*=2))return t.geoAzimuthalEquidistantRaw;var r=-e/2,n=-r,i=e*e,s=g(n),l=.5/m(n);function c(t,a){var s=C(o(a)*o(t-r)),l=C(o(a)*o(t-n));return[((s*=s)-(l*=l))/(2*e),(a<0?-1:1)*P(4*i*l-(i-s+l)*(i-s+l))/(2*e)]}return c.invert=function(e,t){var i,c,u=t*t,h=o(P(u+(i=e+r)*i)),p=o(P(u+(i=e+n)*i));return[a(c=h-p,i=(h+p)*s),(t<0?-1:1)*C(P(i*i+c*c)*l)]},c}function Vr(e,t){return Fr(Ur,e,t)}function qr(e,t){if(n(t)<y)return[e,0];var r=n(t/b),i=E(r);if(n(e)<y||n(n(t)-b)<y)return[0,f(t)*x*g(i/2)];var a=o(i),s=n(x/e-e/x)/2,l=s*s,c=a/(r+a-1),u=c*(2/r-1),h=u*u,p=h+l,d=c-h,m=l+c;return[f(e)*x*(s*d+P(l*d*d-p*(c*c-h)))/p,f(t)*x*(u*m-s*P((l+1)*p-m*m))/p]}function Hr(e,t){if(n(t)<y)return[e,0];var r=n(t/b),i=E(r);if(n(e)<y||n(n(t)-b)<y)return[0,f(t)*x*g(i/2)];var a=o(i),s=n(x/e-e/x)/2,l=s*s,c=a*(P(1+l)-s*a)/(1+l*r*r);return[f(e)*x*c,f(t)*x*P(1-c*(2*s+c))]}function Gr(e,t){if(n(t)<y)return[e,0];var r=t/b,i=E(r);if(n(e)<y||n(n(t)-b)<y)return[0,x*g(i/2)];var a=(x/e-e/x)/2,s=r/(1+o(i));return[x*(f(e)*P(a*a+1-s*s)-a),x*s]}function Wr(e,t){if(!t)return[e,0];var r=n(t);if(!e||r===b)return[0,t];var i=r/b,a=i*i,o=(8*i-a*(a+2)-5)/(2*a*(i-1)),s=o*o,l=i*o,c=a+s+2*l,u=i+3*o,h=e/b,p=h+1/h,d=f(n(e)-b)*P(p*p-4),m=d*d,g=(d*(c+s-1)+2*P(c*(a+s*m-1)+(1-a)*(a*(u*u+4*s)+12*l*s+4*s*s)))/(4*c+m);return[f(e)*b*g,f(t)*b*P(1+d*n(g)-g*g)]}function $r(e,t,r,n){var i=x/3;e=u(e,y),t=u(t,y),e=h(e,b),t=h(t,x-y),r=u(r,0),r=h(r,99.999999);var s=(n=u(n,y))/100,l=C((r/100+1)*o(i))/i,c=m(e)/m(l*b),p=t/x,d=P(s*m(e/2)/m(t/2));return function(e,t,r,n,i){function s(a,s){var l=r*m(n*s),c=P(1-l*l),u=P(2/(1+c*o(a*=i)));return[e*c*u*m(a),t*l*u]}return s.invert=function(o,s){var l=o/e,c=s/t,u=P(l*l+c*c),h=2*E(u/2);return[a(o*g(h),e*u)/i,u&&E(s*m(h)/(t*r*u))/n]},s}(d/P(p*c*l),1/(d*P(p*c*l)),c,l,p)}function Zr(){var e=65*M,r=60*M,n=20,i=200,a=t.geoProjectionMutator($r),o=a(e,r,n,i);return o.poleline=function(t){return arguments.length?a(e=+t*M,r,n,i):e*A},o.parallels=function(t){return arguments.length?a(e,r=+t*M,n,i):r*A},o.inflation=function(t){return arguments.length?a(e,r,n=+t,i):n},o.ratio=function(t){return arguments.length?a(e,r,n,i=+t):i},o.scale(163.775)}jr.invert=function(e,t){var r=t/1.70711,n=m(_*r);return[e/(.74482-.34588*n*n),2*i(r)]},qr.invert=function(e,t){if(n(t)<y)return[e,0];if(n(e)<y)return[0,b*m(2*i(t/x))];var r=(e/=x)*e,a=(t/=x)*t,s=r+a,l=s*s,c=-n(t)*(1+s),u=c-2*a+r,h=-2*c+1+2*a+l,p=a/h+(2*u*u*u/(h*h*h)-9*c*u/(h*h))/27,d=(c-u*u/(3*h))/h,g=2*P(-d/3),v=C(3*p/(d*g))/3;return[x*(s-1+P(1+2*(r-a)+l))/(2*e),f(t)*x*(-g*o(v+x/3)-u/(3*h))]},Hr.invert=function(e,t){if(!e)return[0,b*m(2*i(t/x))];var r=n(e/x),o=(1-r*r-(t/=x)*t)/(2*r),s=P(o*o+1);return[f(e)*x*(s-o),f(t)*b*m(2*a(P((1-2*o*r)*(o+s)-r),P(s+o+r)))]},Gr.invert=function(e,t){if(!t)return[e,0];var r=t/x,n=(x*x*(1-r*r)-e*e)/(2*x*e);return[e?x*(f(e)*P(n*n+1)-n):0,b*m(2*i(r))]},Wr.invert=function(e,t){var r;if(!e||!t)return[e,t];t/=x;var i=f(e)*e/b,a=(i*i-1+4*t*t)/n(i),o=a*a,s=2*t,l=50;do{var c=s*s,u=(8*s-c*(c+2)-5)/(2*c*(s-1)),h=(3*s-c*s-10)/(2*c*s),p=u*u,d=s*u,m=s+u,g=m*m,v=s+3*u,_=-2*m*(4*d*p+(1-4*c+3*c*c)*(1+h)+p*(14*c-6-o+(8*c-8-2*o)*h)+d*(12*c-8+(10*c-10-o)*h)),w=P(g*(c+p*o-1)+(1-c)*(c*(v*v+4*p)+p*(12*d+4*p)));s-=r=(a*(g+p-1)+2*w-i*(4*g+o))/(a*(2*u*h+2*m*(1+h))+_/w-8*m*(a*(-1+p+g)+2*w)*(1+h)/(o+4*g))}while(r>y&&--l>0);return[f(e)*(P(a*a+4)+a)*x/4,b*s]};var Xr=4*x+3*P(3),Yr=2*P(2*x*P(3)/Xr),Kr=$(Yr*P(3)/x,Yr,Xr/6);function Jr(e,t){return[e*P(1-3*t*t/(x*x)),t]}function Qr(e,t){var r=o(t),n=o(e)*r,i=1-n,s=o(e=a(m(e)*r,-m(t))),l=m(e);return[l*(r=P(1-n*n))-s*i,-s*r-l*i]}function en(e,t){var r=O(e,t);return[(r[0]+e/b)/2,(r[1]+t)/2]}Jr.invert=function(e,t){return[e/P(1-3*t*t/(x*x)),t]},Qr.invert=function(e,t){var r=(e*e+t*t)/-2,n=P(-r*(2+r)),i=t*r+e*n,o=e*r-t*n,s=P(o*o+i*i);return[a(n*i,s*(1+r)),s?-E(n*o/s):0]},en.invert=function(e,t){var r=e,i=t,a=25;do{var s,l=o(i),c=m(i),u=m(2*i),h=c*c,p=l*l,d=m(r),f=o(r/2),g=m(r/2),v=g*g,x=1-p*f*f,_=x?C(l*f)*P(s=1/x):s=0,w=.5*(2*_*l*g+r/b)-e,k=.5*(_*c+i)-t,T=.5*s*(p*v+_*l*f*h)+.5/b,S=s*(d*u/4-_*c*g),A=.125*s*(u*g-_*c*p*d),M=.5*s*(h*f+_*v*l)+.5,E=S*A-M*T,L=(k*S-w*M)/E,I=(w*A-k*T)/E;r-=L,i-=I}while((n(L)>y||n(I)>y)&&--a>0);return[r,i]},e.geoNaturalEarth=t.geoNaturalEarth1,e.geoNaturalEarthRaw=t.geoNaturalEarth1Raw,e.geoAiry=function(){var e=b,r=t.geoProjectionMutator(z),n=r(e);return n.radius=function(t){return arguments.length?r(e=t*M):e*A},n.scale(179.976).clipAngle(147)},e.geoAiryRaw=z,e.geoAitoff=function(){return t.geoProjection(O).scale(152.63)},e.geoAitoffRaw=O,e.geoArmadillo=function(){var e=20*M,r=e>=0?1:-1,n=g(r*e),i=t.geoProjectionMutator(R),s=i(e),l=s.stream;return s.parallel=function(t){return arguments.length?(n=g((r=(e=t*M)>=0?1:-1)*e),i(e)):e*A},s.stream=function(t){var i=s.rotate(),c=l(t),u=(s.rotate([0,0]),l(t)),h=s.precision();return s.rotate(i),c.sphere=function(){u.polygonStart(),u.lineStart();for(var t=-180*r;r*t<180;t+=90*r)u.point(t,90*r);if(e)for(;r*(t-=3*r*h)>=-180;)u.point(t,r*-a(o(t*M/2),n)*A);u.lineEnd(),u.polygonEnd()},c},s.scale(218.695).center([0,28.0974])},e.geoArmadilloRaw=R,e.geoAugust=function(){return t.geoProjection(D).scale(66.1603)},e.geoAugustRaw=D,e.geoBaker=function(){return t.geoProjection(B).scale(112.314)},e.geoBakerRaw=B,e.geoBerghaus=function(){var e=5,r=t.geoProjectionMutator(N),n=r(e),i=n.stream,s=.01,l=-o(s*M),c=m(s*M);return n.lobes=function(t){return arguments.length?r(e=+t):e},n.stream=function(t){var r=n.rotate(),u=i(t),h=(n.rotate([0,0]),i(t));return n.rotate(r),u.sphere=function(){h.polygonStart(),h.lineStart();for(var t=0,r=360/e,n=2*x/e,i=90-180/e,u=b;t<e;++t,i-=r,u-=n)h.point(a(c*o(u),l)*A,E(c*m(u))*A),i<-90?(h.point(-90,-180-i-s),h.point(-90,-180-i+s)):(h.point(90,i+s),h.point(90,i-s));h.lineEnd(),h.polygonEnd()},u},n.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},e.geoBerghausRaw=N,e.geoBertin1953=function(){return t.geoProjection(G()).rotate([-16.5,-42]).scale(176.57).center([7.93,.09])},e.geoBertin1953Raw=G,e.geoBoggs=function(){return t.geoProjection(K).scale(160.857)},e.geoBoggsRaw=K,e.geoBonne=function(){return J(ee).scale(123.082).center([0,26.1441]).parallel(45)},e.geoBonneRaw=ee,e.geoBottomley=function(){var e=.5,r=t.geoProjectionMutator(te),n=r(e);return n.fraction=function(t){return arguments.length?r(e=+t):e},n.scale(158.837)},e.geoBottomleyRaw=te,e.geoBromley=function(){return t.geoProjection(re).scale(152.63)},e.geoBromleyRaw=re,e.geoChamberlin=le,e.geoChamberlinRaw=oe,e.geoChamberlinAfrica=function(){return le([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},e.geoCollignon=function(){return t.geoProjection(ce).scale(95.6464).center([0,30])},e.geoCollignonRaw=ce,e.geoCraig=function(){return J(ue).scale(249.828).clipAngle(90)},e.geoCraigRaw=ue,e.geoCraster=function(){return t.geoProjection(pe).scale(156.19)},e.geoCrasterRaw=pe,e.geoCylindricalEqualArea=function(){return J(de).parallel(38.58).scale(195.044)},e.geoCylindricalEqualAreaRaw=de,e.geoCylindricalStereographic=function(){return J(fe).scale(124.75)},e.geoCylindricalStereographicRaw=fe,e.geoEckert1=function(){return t.geoProjection(me).scale(165.664)},e.geoEckert1Raw=me,e.geoEckert2=function(){return t.geoProjection(ge).scale(165.664)},e.geoEckert2Raw=ge,e.geoEckert3=function(){return t.geoProjection(ye).scale(180.739)},e.geoEckert3Raw=ye,e.geoEckert4=function(){return t.geoProjection(ve).scale(180.739)},e.geoEckert4Raw=ve,e.geoEckert5=function(){return t.geoProjection(xe).scale(173.044)},e.geoEckert5Raw=xe,e.geoEckert6=function(){return t.geoProjection(be).scale(173.044)},e.geoEckert6Raw=be,e.geoEisenlohr=function(){return t.geoProjection(we).scale(62.5271)},e.geoEisenlohrRaw=we,e.geoFahey=function(){return t.geoProjection(Te).scale(137.152)},e.geoFaheyRaw=Te,e.geoFoucaut=function(){return t.geoProjection(Se).scale(135.264)},e.geoFoucautRaw=Se,e.geoFoucautSinusoidal=function(){var e=.5,r=t.geoProjectionMutator(Ae),n=r(e);return n.alpha=function(t){return arguments.length?r(e=+t):e},n.scale(168.725)},e.geoFoucautSinusoidalRaw=Ae,e.geoGilbert=function(e){null==e&&(e=t.geoOrthographic);var r=e(),n=t.geoEquirectangular().scale(A).precision(0).clipAngle(null).translate([0,0]);function i(e){return r(Me(e))}function a(e){i[e]=function(){return arguments.length?(r[e].apply(r,arguments),i):r[e]()}}return r.invert&&(i.invert=function(e){return Ee(r.invert(e))}),i.stream=function(e){var t=r.stream(e),i=n.stream({point:function(e,r){t.point(e/2,E(g(-r/2*M))*A)},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}});return i.sphere=t.sphere,i},i.rotate=function(e){return arguments.length?(n.rotate(e),i):n.rotate()},i.center=function(e){return arguments.length?(r.center(Me(e)),i):Ee(r.center())},a("angle"),a("clipAngle"),a("clipExtent"),a("fitExtent"),a("fitHeight"),a("fitSize"),a("fitWidth"),a("scale"),a("translate"),a("precision"),i.scale(249.5)},e.geoGingery=function(){var e=6,r=30*M,n=o(r),i=m(r),s=t.geoProjectionMutator(Ce),l=s(r,e),c=l.stream,u=-o(.01*M),h=m(.01*M);return l.radius=function(t){return arguments.length?(n=o(r=t*M),i=m(r),s(r,e)):r*A},l.lobes=function(t){return arguments.length?s(r,e=+t):e},l.stream=function(t){var r=l.rotate(),s=c(t),p=(l.rotate([0,0]),c(t));return l.rotate(r),s.sphere=function(){p.polygonStart(),p.lineStart();for(var t=0,r=2*x/e,s=0;t<e;++t,s-=r)p.point(a(h*o(s),u)*A,E(h*m(s))*A),p.point(a(i*o(s-r/2),n)*A,E(i*m(s-r/2))*A);p.lineEnd(),p.polygonEnd()},s},l.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},e.geoGingeryRaw=Ce,e.geoGinzburg4=function(){return t.geoProjection(ze).scale(149.995)},e.geoGinzburg4Raw=ze,e.geoGinzburg5=function(){return t.geoProjection(Oe).scale(153.93)},e.geoGinzburg5Raw=Oe,e.geoGinzburg6=function(){return t.geoProjection(Re).scale(130.945)},e.geoGinzburg6Raw=Re,e.geoGinzburg8=function(){return t.geoProjection(De).scale(131.747)},e.geoGinzburg8Raw=De,e.geoGinzburg9=function(){return t.geoProjection(je).scale(131.087)},e.geoGinzburg9Raw=je,e.geoGringorten=function(){return t.geoProjection(Fe(Be)).scale(239.75)},e.geoGringortenRaw=Be,e.geoGuyou=function(){return t.geoProjection(Fe(Ve)).scale(151.496)},e.geoGuyouRaw=Ve,e.geoHammer=function(){var e=2,r=t.geoProjectionMutator(U),n=r(e);return n.coefficient=function(t){return arguments.length?r(e=+t):e},n.scale(169.529)},e.geoHammerRaw=U,e.geoHammerRetroazimuthal=function(){var e=0,r=t.geoProjectionMutator(qe),n=r(e),i=n.rotate,a=n.stream,o=t.geoCircle();return n.parallel=function(t){if(!arguments.length)return e*A;var i=n.rotate();return r(e=t*M).rotate(i)},n.rotate=function(t){return arguments.length?(i.call(n,[t[0],t[1]-e*A]),o.center([-t[0],-t[1]]),n):((t=i.call(n))[1]+=e*A,t)},n.stream=function(e){return(e=a(e)).sphere=function(){e.polygonStart();var t,r=o.radius(89.99)().coordinates[0],n=r.length-1,i=-1;for(e.lineStart();++i<n;)e.point((t=r[i])[0],t[1]);for(e.lineEnd(),n=(r=o.radius(90.01)().coordinates[0]).length-1,e.lineStart();--i>=0;)e.point((t=r[i])[0],t[1]);e.lineEnd(),e.polygonEnd()},e},n.scale(79.4187).parallel(45).clipAngle(179.999)},e.geoHammerRetroazimuthalRaw=qe,e.geoHealpix=function(){var e=4,n=t.geoProjectionMutator($e),i=n(e),a=i.stream;return i.lobes=function(t){return arguments.length?n(e=+t):e},i.stream=function(n){var o=i.rotate(),s=a(n),l=(i.rotate([0,0]),a(n));return i.rotate(o),s.sphere=function(){t.geoStream(function(e){var t=[].concat(r.range(-180,180+e/2,e).map(Ze),r.range(180,-180-e/2,-e).map(Xe));return{type:"Polygon",coordinates:[180===e?t.map(Ye):t]}}(180/e),l)},s},i.scale(239.75)},e.geoHealpixRaw=$e,e.geoHill=function(){var e=1,r=t.geoProjectionMutator(Ke),n=r(e);return n.ratio=function(t){return arguments.length?r(e=+t):e},n.scale(167.774).center([0,18.67])},e.geoHillRaw=Ke,e.geoHomolosine=function(){return t.geoProjection(tt).scale(152.63)},e.geoHomolosineRaw=tt,e.geoHufnagel=function(){var e=1,r=0,n=45*M,i=2,a=t.geoProjectionMutator(rt),o=a(e,r,n,i);return o.a=function(t){return arguments.length?a(e=+t,r,n,i):e},o.b=function(t){return arguments.length?a(e,r=+t,n,i):r},o.psiMax=function(t){return arguments.length?a(e,r,n=+t*M,i):n*A},o.ratio=function(t){return arguments.length?a(e,r,n,i=+t):i},o.scale(180.739)},e.geoHufnagelRaw=rt,e.geoHyperelliptical=function(){var e=0,r=2.5,n=1.183136,i=t.geoProjectionMutator(at),a=i(e,r,n);return a.alpha=function(t){return arguments.length?i(e=+t,r,n):e},a.k=function(t){return arguments.length?i(e,r=+t,n):r},a.gamma=function(t){return arguments.length?i(e,r,n=+t):n},a.scale(152.63)},e.geoHyperellipticalRaw=at,e.geoInterrupt=lt,e.geoInterruptedBoggs=function(){return lt(K,ct).scale(160.857)},e.geoInterruptedHomolosine=function(){return lt(tt,ut).scale(152.63)},e.geoInterruptedMollweide=function(){return lt(Z,ht).scale(169.529)},e.geoInterruptedMollweideHemispheres=function(){return lt(Z,pt).scale(169.529).rotate([20,0])},e.geoInterruptedSinuMollweide=function(){return lt(et,dt,H).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoInterruptedSinusoidal=function(){return lt(Q,ft).scale(152.63).rotate([-20,0])},e.geoKavrayskiy7=function(){return t.geoProjection(mt).scale(158.837)},e.geoKavrayskiy7Raw=mt,e.geoLagrange=function(){var e=.5,r=t.geoProjectionMutator(gt),n=r(e);return n.spacing=function(t){return arguments.length?r(e=+t):e},n.scale(124.75)},e.geoLagrangeRaw=gt,e.geoLarrivee=function(){return t.geoProjection(vt).scale(97.2672)},e.geoLarriveeRaw=vt,e.geoLaskowski=function(){return t.geoProjection(xt).scale(139.98)},e.geoLaskowskiRaw=xt,e.geoLittrow=function(){return t.geoProjection(bt).scale(144.049).clipAngle(89.999)},e.geoLittrowRaw=bt,e.geoLoximuthal=function(){return J(_t).parallel(40).scale(158.837)},e.geoLoximuthalRaw=_t,e.geoMiller=function(){return t.geoProjection(wt).scale(108.318)},e.geoMillerRaw=wt,e.geoModifiedStereographic=Ct,e.geoModifiedStereographicRaw=kt,e.geoModifiedStereographicAlaska=function(){return Ct(Tt,[152,-64]).scale(1400).center([-160.908,62.4864]).clipAngle(30).angle(7.8)},e.geoModifiedStereographicGs48=function(){return Ct(St,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},e.geoModifiedStereographicGs50=function(){return Ct(At,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},e.geoModifiedStereographicMiller=function(){return Ct(Mt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},e.geoModifiedStereographicLee=function(){return Ct(Et,[165,10]).scale(250).clipAngle(130).center([-165,-10])},e.geoMollweide=function(){return t.geoProjection(Z).scale(169.529)},e.geoMollweideRaw=Z,e.geoMtFlatPolarParabolic=function(){return t.geoProjection(It).scale(164.859)},e.geoMtFlatPolarParabolicRaw=It,e.geoMtFlatPolarQuartic=function(){return t.geoProjection(zt).scale(188.209)},e.geoMtFlatPolarQuarticRaw=zt,e.geoMtFlatPolarSinusoidal=function(){return t.geoProjection(Ot).scale(166.518)},e.geoMtFlatPolarSinusoidalRaw=Ot,e.geoNaturalEarth2=function(){return t.geoProjection(Rt).scale(175.295)},e.geoNaturalEarth2Raw=Rt,e.geoNellHammer=function(){return t.geoProjection(Dt).scale(152.63)},e.geoNellHammerRaw=Dt,e.geoInterruptedQuarticAuthalic=function(){return lt(U(1/0),jt).rotate([20,0]).scale(152.63)},e.geoNicolosi=function(){return t.geoProjection(Ft).scale(127.267)},e.geoNicolosiRaw=Ft,e.geoPatterson=function(){return t.geoProjection(Wt).scale(139.319)},e.geoPattersonRaw=Wt,e.geoPolyconic=function(){return t.geoProjection($t).scale(103.74)},e.geoPolyconicRaw=$t,e.geoPolyhedral=Jt,e.geoPolyhedralButterfly=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(101.858).center([0,45])},e.geoPolyhedralCollignon=function(e){e=e||function(e){var r=t.geoCentroid({type:"MultiPoint",coordinates:e});return t.geoProjection(ar).translate([0,0]).scale(1).rotate(r[1]>0?[-r[0],0]:[180-r[0],180])};var r=nr.map((function(t){return{face:t,project:e(t)}}));return[-1,0,0,1,0,1,4,5].forEach((function(e,t){var n=r[e];n&&(n.children||(n.children=[])).push(r[t])})),Jt(r[0],(function(e,t){return r[e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5]})).angle(-30).scale(121.906).center([0,48.5904])},e.geoPolyhedralWaterman=function(e){e=e||function(e){var r=6===e.length?t.geoCentroid({type:"MultiPoint",coordinates:e}):e[0];return t.geoGnomonic().scale(1).translate([0,0]).rotate([-r[0],-r[1]])};var r=nr.map((function(e){for(var t,r=e.map(lr),n=r.length,i=r[n-1],a=[],o=0;o<n;++o)t=r[o],a.push(sr([.9486832980505138*i[0]+.31622776601683794*t[0],.9486832980505138*i[1]+.31622776601683794*t[1],.9486832980505138*i[2]+.31622776601683794*t[2]]),sr([.9486832980505138*t[0]+.31622776601683794*i[0],.9486832980505138*t[1]+.31622776601683794*i[1],.9486832980505138*t[2]+.31622776601683794*i[2]])),i=t;return a})),n=[],i=[-1,0,0,1,0,1,4,5];r.forEach((function(e,t){for(var a,o,s=nr[t],l=s.length,c=n[t]=[],u=0;u<l;++u)r.push([s[u],e[(2*u+2)%(2*l)],e[(2*u+1)%(2*l)]]),i.push(t),c.push((a=lr(e[(2*u+2)%(2*l)]),o=lr(e[(2*u+1)%(2*l)]),[a[1]*o[2]-a[2]*o[1],a[2]*o[0]-a[0]*o[2],a[0]*o[1]-a[1]*o[0]]))}));var a=r.map((function(t){return{project:e(t),face:t}}));return i.forEach((function(e,t){var r=a[e];r&&(r.children||(r.children=[])).push(a[t])})),Jt(a[0],(function(e,t){var r=o(t),i=[r*o(e),r*m(e),m(t)],s=e<-x/2?t<0?6:4:e<0?t<0?2:0:e<x/2?t<0?3:1:t<0?7:5,l=n[s];return a[or(l[0],i)<0?8+3*s:or(l[1],i)<0?8+3*s+1:or(l[2],i)<0?8+3*s+2:s]})).angle(-30).scale(110.625).center([0,45])},e.geoProject=function(e,t){var r,n=t.stream;if(!n)throw new Error("invalid projection");switch(e&&e.type){case"Feature":r=hr;break;case"FeatureCollection":r=ur;break;default:r=pr}return r(e,n)},e.geoGringortenQuincuncial=function(){return vr(Be).scale(176.423)},e.geoPeirceQuincuncial=xr,e.geoPierceQuincuncial=xr,e.geoQuantize=function(e,t){if(!(0<=(t=+t)&&t<=20))throw new Error("invalid digits");function r(e){var r=e.length,n=2,i=new Array(r);for(i[0]=+e[0].toFixed(t),i[1]=+e[1].toFixed(t);n<r;)i[n]=e[n],++n;return i}function n(e){return e.map(r)}function i(e){for(var t=r(e[0]),n=[t],i=1;i<e.length;i++){var a=r(e[i]);(a.length>2||a[0]!=t[0]||a[1]!=t[1])&&(n.push(a),t=a)}return 1===n.length&&e.length>1&&n.push(r(e[e.length-1])),n}function a(e){return e.map(i)}function o(e){if(null==e)return e;var t;switch(e.type){case"GeometryCollection":t={type:"GeometryCollection",geometries:e.geometries.map(o)};break;case"Point":t={type:"Point",coordinates:r(e.coordinates)};break;case"MultiPoint":t={type:e.type,coordinates:n(e.coordinates)};break;case"LineString":t={type:e.type,coordinates:i(e.coordinates)};break;case"MultiLineString":case"Polygon":t={type:e.type,coordinates:a(e.coordinates)};break;case"MultiPolygon":t={type:"MultiPolygon",coordinates:e.coordinates.map(a)};break;default:return e}return null!=e.bbox&&(t.bbox=e.bbox),t}function s(e){var t={type:"Feature",properties:e.properties,geometry:o(e.geometry)};return null!=e.id&&(t.id=e.id),null!=e.bbox&&(t.bbox=e.bbox),t}if(null!=e)switch(e.type){case"Feature":return s(e);case"FeatureCollection":var l={type:"FeatureCollection",features:e.features.map(s)};return null!=e.bbox&&(l.bbox=e.bbox),l;default:return o(e)}return e},e.geoQuincuncial=vr,e.geoRectangularPolyconic=function(){return J(br).scale(131.215)},e.geoRectangularPolyconicRaw=br,e.geoRobinson=function(){return t.geoProjection(wr).scale(152.63)},e.geoRobinsonRaw=wr,e.geoSatellite=function(){var e=2,r=0,n=t.geoProjectionMutator(kr),i=n(e,r);return i.distance=function(t){return arguments.length?n(e=+t,r):e},i.tilt=function(t){return arguments.length?n(e,r=t*M):r*A},i.scale(432.147).clipAngle(C(1/e)*A-1e-6)},e.geoSatelliteRaw=kr,e.geoSinuMollweide=function(){return t.geoProjection(et).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},e.geoSinuMollweideRaw=et,e.geoSinusoidal=function(){return t.geoProjection(Q).scale(152.63)},e.geoSinusoidalRaw=Q,e.geoStitch=function(e){if(null==e)return e;switch(e.type){case"Feature":return Rr(e);case"FeatureCollection":var t={type:"FeatureCollection",features:e.features.map(Rr)};return null!=e.bbox&&(t.bbox=e.bbox),t;default:return Dr(e)}},e.geoTimes=function(){return t.geoProjection(jr).scale(146.153)},e.geoTimesRaw=jr,e.geoTwoPointAzimuthal=Nr,e.geoTwoPointAzimuthalRaw=Br,e.geoTwoPointAzimuthalUsa=function(){return Nr([-158,21.5],[-77,39]).clipAngle(60).scale(400)},e.geoTwoPointEquidistant=Vr,e.geoTwoPointEquidistantRaw=Ur,e.geoTwoPointEquidistantUsa=function(){return Vr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},e.geoVanDerGrinten=function(){return t.geoProjection(qr).scale(79.4183)},e.geoVanDerGrintenRaw=qr,e.geoVanDerGrinten2=function(){return t.geoProjection(Hr).scale(79.4183)},e.geoVanDerGrinten2Raw=Hr,e.geoVanDerGrinten3=function(){return t.geoProjection(Gr).scale(79.4183)},e.geoVanDerGrinten3Raw=Gr,e.geoVanDerGrinten4=function(){return t.geoProjection(Wr).scale(127.16)},e.geoVanDerGrinten4Raw=Wr,e.geoWagner=Zr,e.geoWagner7=function(){return Zr().poleline(65).parallels(60).inflation(0).ratio(200).scale(172.633)},e.geoWagnerRaw=$r,e.geoWagner4=function(){return t.geoProjection(Kr).scale(176.84)},e.geoWagner4Raw=Kr,e.geoWagner6=function(){return t.geoProjection(Jr).scale(152.63)},e.geoWagner6Raw=Jr,e.geoWiechel=function(){return t.geoProjection(Qr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},e.geoWiechelRaw=Qr,e.geoWinkel3=function(){return t.geoProjection(en).scale(158.837)},e.geoWinkel3Raw=en,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,dg(),pg()):n(r.d3=r.d3||{},r.d3,r.d3)}}),mg=p({"src/plots/geo/zoom.js"(e,t){var r=v(),n=st(),i=Ve(),a=Math.PI/180,o=180/Math.PI,s={cursor:"pointer"},l={cursor:"auto"};function c(e,t){return r.behavior.zoom().translate(t.translate()).scale(t.scale())}function u(e,t,r){var a=e.id,o=e.graphDiv,s=o.layout,l=s[a],c=o._fullLayout,u=c[a],h={},p={};function d(e,t){h[a+"."+e]=n.nestedProperty(l,e).get(),i.call("_storeDirectGUIEdit",s,c._preGUI,h);var r=n.nestedProperty(u,e);r.get()!==t&&(r.set(t),n.nestedProperty(l,e).set(t),p[a+"."+e]=t)}r(d),d("projection.scale",t.scale()/e.fitScale),d("fitbounds",!1),o.emit("plotly_relayout",p)}function h(e,t){var n=c(0,t);function i(r){var n=t.invert(e.midPt);r("center.lon",n[0]),r("center.lat",n[1])}return n.on("zoomstart",(function(){r.select(this).style(s)})).on("zoom",(function(){t.scale(r.event.scale).translate(r.event.translate),e.render(!0);var n=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":n[0],"geo.center.lat":n[1]})})).on("zoomend",(function(){r.select(this).style(l),u(e,t,i)})),n}function p(e,t){var n,i,a,o,h,p,d,f,m,g=c(0,t);function y(e){return t.invert(e)}function v(r){var n=t.rotate(),i=t.invert(e.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}return g.on("zoomstart",(function(){r.select(this).style(s),n=r.mouse(this),i=t.rotate(),a=t.translate(),o=i,h=y(n)})).on("zoom",(function(){if(p=r.mouse(this),function(e){var r=y(e);if(!r)return!0;var n=t(r);return Math.abs(n[0]-e[0])>2||Math.abs(n[1]-e[1])>2}(n))return g.scale(t.scale()),void g.translate(t.translate());t.scale(r.event.scale),t.translate([a[0],r.event.translate[1]]),h?y(p)&&(f=y(p),d=[o[0]+(f[0]-h[0]),i[1],i[2]],t.rotate(d),o=d):h=y(n=p),m=!0,e.render(!0);var s=t.rotate(),l=t.invert(e.midPt);e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.center.lon":l[0],"geo.center.lat":l[1],"geo.projection.rotation.lon":-s[0]})})).on("zoomend",(function(){r.select(this).style(l),m&&u(e,t,v)})),g}function d(e,t){var n,i={r:t.rotate(),k:t.scale()},h=c(0,t),p=function(e){for(var t=0,n=arguments.length,i=[];++t<n;)i.push(arguments[t]);var a=r.dispatch.apply(null,i);return a.of=function(t,n){return function(i){var o;try{o=i.sourceEvent=r.event,i.target=e,r.event=i,a[i.type].apply(t,n)}finally{r.event=o}}},a}(h,"zoomstart","zoom","zoomend"),d=0,g=h.on;function v(e){var r=t.rotate();e("projection.rotation.lon",-r[0]),e("projection.rotation.lat",-r[1])}return h.on("zoomstart",(function(){r.select(this).style(s);var e,l=r.mouse(this),c=t.rotate(),u=c,v=t.translate(),b=function(e){var t=.5*e[0]*a,r=.5*e[1]*a,n=.5*e[2]*a,i=Math.sin(t),o=Math.cos(t),s=Math.sin(r),l=Math.cos(r),c=Math.sin(n),u=Math.cos(n);return[o*l*u+i*s*c,i*l*u-o*s*c,o*s*u+i*l*c,o*l*c-i*s*u]}(c);n=f(t,l),g.call(h,"zoom",(function(){var e=r.mouse(this);if(t.scale(i.k=r.event.scale),n){if(f(t,e)){t.rotate(c).translate(v);var a=f(t,e),s=function(e,t){if(e&&t){var r=function(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}(e,t),n=Math.sqrt(x(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,x(e,t)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}(n,a),h=function(e){return[Math.atan2(2*(e[0]*e[1]+e[2]*e[3]),1-2*(e[1]*e[1]+e[2]*e[2]))*o,Math.asin(Math.max(-1,Math.min(1,2*(e[0]*e[2]-e[3]*e[1]))))*o,Math.atan2(2*(e[0]*e[3]+e[1]*e[2]),1-2*(e[2]*e[2]+e[3]*e[3]))*o]}(function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=t[0],s=t[1],l=t[2],c=t[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}(b,s)),d=i.r=function(e,t,r){var n=y(t,2,e[0]);n=y(n,1,e[1]),n=y(n,0,e[2]-r[2]);var i,a,s=t[0],l=t[1],c=t[2],u=n[0],h=n[1],p=n[2],d=Math.atan2(l,s)*o,f=Math.sqrt(s*s+l*l);Math.abs(h)>f?(a=(h>0?90:-90)-d,i=0):(a=Math.asin(h/f)*o-d,i=Math.sqrt(f*f-h*h));var g=180-a-2*d,v=(Math.atan2(p,u)-Math.atan2(c,i))*o,x=(Math.atan2(p,u)-Math.atan2(c,-i))*o,b=m(r[0],r[1],a,v),_=m(r[0],r[1],g,x);return b<=_?[a,v,r[2]]:[g,x,r[2]]}(h,n,u);isFinite(d[0])&&isFinite(d[1])&&isFinite(d[2])||(d=u),t.rotate(d),u=d}}else n=f(t,l=e);p.of(this,arguments)({type:"zoom"})})),e=p.of(this,arguments),d++||e({type:"zoomstart"})})).on("zoomend",(function(){var n;r.select(this).style(l),g.call(h,"zoom",null),n=p.of(this,arguments),--d||n({type:"zoomend"}),u(e,t,v)})).on("zoom.redraw",(function(){e.render(!0);var r=t.rotate();e.graphDiv.emit("plotly_relayouting",{"geo.projection.scale":t.scale()/e.fitScale,"geo.projection.rotation.lon":-r[0],"geo.projection.rotation.lat":-r[1]})})),r.rebind(h,p,"on")}function f(e,t){var r=e.invert(t);return r&&isFinite(r[0])&&isFinite(r[1])&&function(e){var t=e[0]*a,r=e[1]*a,n=Math.cos(r);return[n*Math.cos(t),n*Math.sin(t),Math.sin(r)]}(r)}function m(e,t,r,n){var i=g(r-e),a=g(n-t);return Math.sqrt(i*i+a*a)}function g(e){return(e%360+540)%360-180}function y(e,t,r){var n=r*a,i=e.slice(),o=0===t?1:0,s=2===t?1:2,l=Math.cos(n),c=Math.sin(n);return i[o]=e[o]*l-e[s]*c,i[s]=e[s]*l+e[o]*c,i}function x(e,t){for(var r=0,n=0,i=e.length;n<i;++n)r+=e[n]*t[n];return r}t.exports=function(e,t){var r=e.projection;return(t._isScoped?h:t._isClipped?d:p)(e,r)}}}),gg=p({"src/plots/geo/geo.js"(e,t){var r=v(),n=dg(),i=n.geoPath,a=n.geoDistance,o=fg(),s=Ve(),l=st(),c=l.strTranslate,u=q(),h=Jt(),p=zr(),d=kt(),f=nr(),m=rr().getAutoRange,g=hr(),y=Mn().prepSelect,x=Mn().clearOutline,b=Mn().selectOnClick,_=mg(),w=Ym(),k=og(),T=Jm(),S=Km().feature;function A(e){this.id=e.id,this.graphDiv=e.graphDiv,this.container=e.container,this.topojsonURL=e.topojsonURL,this.isStatic=e.staticPlot,this.topojsonName=null,this.topojson=null,this.projection=null,this.scope=null,this.viewInitial=null,this.fitScale=null,this.bounds=null,this.midPt=null,this.hasChoropleth=!1,this.traceHash={},this.layers={},this.basePaths={},this.dataPaths={},this.dataPoints={},this.clipDef=null,this.clipRect=null,this.bgRect=null,this.makeFramework()}var M=A.prototype;function E(e,t){var r=w.clipPad,n=e[0]+r,i=e[1]-r,a=t[0]+r,o=t[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}t.exports=function(e){return new A(e)},M.plot=function(e,t,r,n){var i=this;if(n)return i.update(e,t,!0);i._geoCalcData=e,i._fullLayout=t;var a=t[this.id],o=[],s=!1;for(var l in w.layerNameToAdjective)if("frame"!==l&&a["show"+l]){s=!0;break}for(var c=!1,u=0;u<e.length;u++){var h=e[0][0].trace;h._geo=i,h.locationmode&&(s=!0);var p=h.marker;if(p){var d=p.angle,f=p.angleref;(d||"north"===f||"previous"===f)&&(c=!0)}}if(this._hasMarkerAngles=c,s){var m=T.getTopojsonName(a);null!==i.topojson&&m===i.topojsonName||(i.topojsonName=m,void 0===PlotlyGeoAssets.topojson[i.topojsonName]&&o.push(i.fetchTopojson()))}o=o.concat(k.fetchTraceGeoData(e)),r.push(new Promise((function(r,n){Promise.all(o).then((function(){i.topojson=PlotlyGeoAssets.topojson[i.topojsonName],i.update(e,t),r()})).catch(n)})))},M.fetchTopojson=function(){var e=this,t=T.getTopojsonPath(e.topojsonURL,e.topojsonName);return new Promise((function(n,i){r.json(t,(function(r,a){if(r)return 404===r.status?i(new Error(["plotly.js could not find topojson file at",t+".","Make sure the *topojsonURL* plot config option","is set properly."].join(" "))):i(new Error(["unexpected error while fetching topojson file at",t].join(" ")));PlotlyGeoAssets.topojson[e.topojsonName]=a,n()}))}))},M.update=function(e,t,r){var n=t[this.id];this.hasChoropleth=!1;for(var i=0;i<e.length;i++){var a=e[i],o=a[0].trace;"choropleth"===o.type&&(this.hasChoropleth=!0),!0===o.visible&&o._length>0&&o._module.calcGeoJSON(a,t)}if(!r){if(this.updateProjection(e,t))return;this.viewInitial&&this.scope===n.scope||this.saveViewInitial(n)}this.scope=n.scope,this.updateBaseLayers(t,n),this.updateDims(t,n),this.updateFx(t,n),d.generalUpdatePerTraceModule(this.graphDiv,this,e,n);var s=this.layers.frontplot.select(".scatterlayer");this.dataPoints.point=s.selectAll(".point"),this.dataPoints.text=s.selectAll("text"),this.dataPaths.line=s.selectAll(".js-line");var l=this.layers.backplot.select(".choroplethlayer");this.dataPaths.choropleth=l.selectAll("path"),this._render()},M.updateProjection=function(e,t){var r=this.graphDiv,s=t[this.id],c=t._size,u=s.domain,h=s.projection,p=s.lonaxis,d=s.lataxis,f=p._ax,g=d._ax,y=this.projection=function(e){var t=e.projection,r=t.type,s=w.projNames[r];s="geo"+l.titleCase(s);for(var c=(n[s]||o[s])(),u=e._isSatellite?180*Math.acos(1/t.distance)/Math.PI:e._isClipped?w.lonaxisSpan[r]/2:null,h=["center","rotate","parallels","clipExtent"],p=function(e){return e?c:[]},d=0;d<h.length;d++){var f=h[d];"function"!==typeof c[f]&&(c[f]=p)}return c.isLonLatOverEdges=function(e){if(null===c(e))return!0;if(u){var t=c.rotate();return a(e,[-t[0],-t[1]])>u*Math.PI/180}return!1},c.getPath=function(){return i().projection(c)},c.getBounds=function(e){return c.getPath().bounds(e)},c.precision(w.precision),e._isSatellite&&c.tilt(t.tilt).distance(t.distance),u&&c.clipAngle(u-w.clipPad),c}(s),v=[[c.l+c.w*u.x[0],c.t+c.h*(1-u.y[1])],[c.l+c.w*u.x[1],c.t+c.h*(1-u.y[0])]],x=s.center||{},b=h.rotation||{},_=p.range||[],k=d.range||[];if(s.fitbounds){f._length=v[1][0]-v[0][0],g._length=v[1][1]-v[0][1],f.range=m(r,f),g.range=m(r,g);var T=(f.range[0]+f.range[1])/2,S=(g.range[0]+g.range[1])/2;if(s._isScoped)x={lon:T,lat:S};else if(s._isClipped){x={lon:T,lat:S},b={lon:T,lat:S,roll:b.roll};var A=h.type,M=w.lonaxisSpan[A]/2||180,C=w.lataxisSpan[A]/2||90;_=[T-M,T+M],k=[S-C,S+C]}else x={lon:T,lat:S},b={lon:T,lat:b.lat,roll:b.roll}}y.center([x.lon-b.lon,x.lat-b.lat]).rotate([-b.lon,-b.lat,b.roll]).parallels(h.parallels);var P=E(_,k);y.fitExtent(v,P);var L=this.bounds=y.getBounds(P),I=this.fitScale=y.scale(),z=y.translate();if(s.fitbounds){var O=y.getBounds(E(f.range,g.range)),R=Math.min((L[1][0]-L[0][0])/(O[1][0]-O[0][0]),(L[1][1]-L[0][1])/(O[1][1]-O[0][1]));isFinite(R)?y.scale(R*I):l.warn("Something went wrong during"+this.id+"fitbounds computations.")}else y.scale(h.scale*I);var D=this.midPt=[(L[0][0]+L[1][0])/2,(L[0][1]+L[1][1])/2];if(y.translate([z[0]+(D[0]-z[0]),z[1]+(D[1]-z[1])]).clipExtent(L),s._isAlbersUsa){var j=y([x.lon,x.lat]),F=y.translate();y.translate([F[0]-(j[0]-F[0]),F[1]-(j[1]-F[1])])}},M.updateBaseLayers=function(e,t){var n=this,i=n.topojson,a=n.layers,o=n.basePaths;function s(e){return"lonaxis"===e||"lataxis"===e}function l(e){return Boolean(w.lineLayers[e])}function c(e){return Boolean(w.fillLayers[e])}var p=(this.hasChoropleth?w.layersForChoropleth:w.layers).filter((function(e){return l(e)||c(e)?t["show"+e]:!s(e)||t[e].showgrid})),d=n.framework.selectAll(".layer").data(p,String);d.exit().each((function(e){delete a[e],delete o[e],r.select(this).remove()})),d.enter().append("g").attr("class",(function(e){return"layer "+e})).each((function(e){var t=a[e]=r.select(this);"bg"===e?n.bgRect=t.append("rect").style("pointer-events","all"):s(e)?o[e]=t.append("path").style("fill","none"):"backplot"===e?t.append("g").classed("choroplethlayer",!0):"frontplot"===e?t.append("g").classed("scatterlayer",!0):l(e)?o[e]=t.append("path").style("fill","none").style("stroke-miterlimit",2):c(e)&&(o[e]=t.append("path").style("stroke","none"))})),d.order(),d.each((function(r){var n=o[r],a=w.layerNameToAdjective[r];"frame"===r?n.datum(w.sphereSVG):l(r)||c(r)?n.datum(S(i,i.objects[r])):s(r)&&n.datum(function(e,t,r){var n,i,a,o=1e-6,s=2.5,l=t[e],c=w.scopeDefaults[t.scope];"lonaxis"===e?(n=c.lonaxisRange,i=c.lataxisRange,a=function(e,t){return[e,t]}):"lataxis"===e&&(n=c.lataxisRange,i=c.lonaxisRange,a=function(e,t){return[t,e]});var u={type:"linear",range:[n[0],n[1]-o],tick0:l.tick0,dtick:l.dtick};f.setConvert(u,r);var h=f.calcTicks(u);t.isScoped||"lonaxis"!==e||h.pop();for(var p=h.length,d=new Array(p),m=0;m<p;m++)for(var g=h[m].x,y=d[m]=[],v=i[0];v<i[1]+s;v+=s)y.push(a(g,v));return{type:"MultiLineString",coordinates:d}}(r,t,e)).call(u.stroke,t[r].gridcolor).call(h.dashLine,t[r].griddash,t[r].gridwidth),l(r)?n.call(u.stroke,t[a+"color"]).call(h.dashLine,"",t[a+"width"]):c(r)&&n.call(u.fill,t[a+"color"])}))},M.updateDims=function(e,t){var r=this.bounds,n=(t.framewidth||0)/2,i=r[0][0]-n,a=r[0][1]-n,o=r[1][0]-i+n,s=r[1][1]-a+n;h.setRect(this.clipRect,i,a,o,s),this.bgRect.call(h.setRect,i,a,o,s).call(u.fill,t.bgcolor),this.xaxis._offset=i,this.xaxis._length=o,this.yaxis._offset=a,this.yaxis._length=s},M.updateFx=function(e,t){var n=this,i=n.graphDiv,a=n.bgRect,o=e.dragmode,c=e.clickmode;if(!n.isStatic){var u={element:n.bgRect.node(),gd:i,plotinfo:{id:n.id,xaxis:n.xaxis,yaxis:n.yaxis,fillRangeItems:function(e,t){t.isRect?(e.range={})[n.id]=[h([t.xmin,t.ymin]),h([t.xmax,t.ymax])]:(e.lassoPoints={})[n.id]=t.map(h)}},xaxes:[n.xaxis],yaxes:[n.yaxis],subplot:n.id,clickFn:function(e){2===e&&x(i)}};"pan"===o?(a.node().onmousedown=null,a.call(_(n,t)),a.on("dblclick.zoom",(function(){var e=n.viewInitial,t={};for(var r in e)t[n.id+"."+r]=e[r];s.call("_guiRelayout",i,t),i.emit("plotly_doubleclick",null)})),i._context._scrollZoom.geo||a.on("wheel.zoom",null)):"select"!==o&&"lasso"!==o||(a.on(".zoom",null),u.prepFn=function(e,t,r){y(e,t,r,u,o)},g.init(u)),a.on("mousemove",(function(){var e=n.projection.invert(l.getPositionFromD3Event());if(!e)return g.unhover(i,r.event);n.xaxis.p2c=function(){return e[0]},n.yaxis.p2c=function(){return e[1]},p.hover(i,r.event,n.id)})),a.on("mouseout",(function(){i._dragging||g.unhover(i,r.event)})),a.on("click",(function(){"select"!==o&&"lasso"!==o&&(c.indexOf("select")>-1&&b(r.event,i,[n.xaxis],[n.yaxis],n.id,u),c.indexOf("event")>-1&&p.click(i,r.event))}))}function h(e){return n.projection.invert([e[0]+n.xaxis._offset,e[1]+n.yaxis._offset])}},M.makeFramework=function(){var e=this,t=e.graphDiv,n=t._fullLayout,i="clip"+n._uid+e.id;e.clipDef=n._clips.append("clipPath").attr("id",i),e.clipRect=e.clipDef.append("rect"),e.framework=r.select(e.container).append("g").attr("class","geo "+e.id).call(h.setClipUrl,i,t),e.project=function(t){var r=e.projection(t);return r?[r[0]-e.xaxis._offset,r[1]-e.yaxis._offset]:[null,null]},e.xaxis={_id:"x",c2p:function(t){return e.project(t)[0]}},e.yaxis={_id:"y",c2p:function(t){return e.project(t)[1]}},e.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},f.setConvert(e.mockAxis,n)},M.saveViewInitial=function(e){var t,r=e.center||{},n=e.projection,i=n.rotation||{};this.viewInitial={fitbounds:e.fitbounds,"projection.scale":n.scale},t=e._isScoped?{"center.lon":r.lon,"center.lat":r.lat}:e._isClipped?{"projection.rotation.lon":i.lon,"projection.rotation.lat":i.lat}:{"center.lon":r.lon,"center.lat":r.lat,"projection.rotation.lon":i.lon},l.extendFlat(this.viewInitial,t)},M.render=function(e){this._hasMarkerAngles&&e?this.plot(this._geoCalcData,this._fullLayout,[],!0):this._render()},M._render=function(){var e,t=this.projection,r=t.getPath();function n(e){var r=t(e.lonlat);return r?c(r[0],r[1]):null}function i(e){return t.isLonLatOverEdges(e.lonlat)?"none":null}for(e in this.basePaths)this.basePaths[e].attr("d",r);for(e in this.dataPaths)this.dataPaths[e].attr("d",(function(e){return r(e.geojson)}));for(e in this.dataPoints)this.dataPoints[e].attr("display",i).attr("transform",n)}}}),yg=p({"src/plots/geo/layout_attributes.js"(e,t){var r=V(),n=ka().attributes,i=Ie().dash,a=Ym(),o=Le().overrideAll,s=We(),l={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number",dflt:0},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:r.lightLine},gridwidth:{valType:"number",min:0,dflt:1},griddash:i};(t.exports=o({domain:n({name:"geo"},{}),fitbounds:{valType:"enumerated",values:[!1,"locations","geojson"],dflt:!1,editType:"plot"},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:s(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:s(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},tilt:{valType:"number",dflt:0},distance:{valType:"number",min:1.001,dflt:2},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},visible:{valType:"boolean",dflt:!0},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:r.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:r.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:r.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:r.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:r.background},lonaxis:l,lataxis:l},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),vg=p({"src/plots/geo/layout_defaults.js"(e,t){var r=st(),n=qs(),i=_t().getSubplotData,a=Ym(),o=yg(),s=a.axesNames;function l(e,t,n,o){var l=i(o.fullData,"geo",o.id).map((function(e){return e.index})),c=n("resolution"),u=n("scope"),h=a.scopeDefaults[u],p=n("projection.type",h.projType),d=t._isAlbersUsa="albers usa"===p;d&&(u=t.scope="usa");var f=t._isScoped="world"!==u,m=t._isSatellite="satellite"===p,g=t._isConic=-1!==p.indexOf("conic")||"albers"===p,y=t._isClipped=!!a.lonaxisSpan[p];if(!1===e.visible){var v=r.extendDeep({},t._template);v.showcoastlines=!1,v.showcountries=!1,v.showframe=!1,v.showlakes=!1,v.showland=!1,v.showocean=!1,v.showrivers=!1,v.showsubunits=!1,v.lonaxis&&(v.lonaxis.showgrid=!1),v.lataxis&&(v.lataxis.showgrid=!1),t._template=v}for(var x=n("visible"),b=0;b<s.length;b++){var _,w=s[b],k=[30,10][b];if(f)_=h[w+"Range"];else{var T=a[w+"Span"],S=(T[p]||T["*"])/2,A=n("projection.rotation."+w.substr(0,3),h.projRotate[b]);_=[A-S,A+S]}var M=n(w+".range",_);n(w+".tick0"),n(w+".dtick",k),n(w+".showgrid",!!x&&void 0)&&(n(w+".gridcolor"),n(w+".gridwidth"),n(w+".griddash")),t[w]._ax={type:"linear",_id:w.slice(0,3),_traceIndices:l,setScale:r.identity,c2l:r.identity,r2l:r.identity,autorange:!0,range:M.slice(),_m:1,_input:{}}}var E=t.lonaxis.range,C=t.lataxis.range,P=E[0],L=E[1];P>0&&L<0&&(L+=360);var I,z,O,R=(P+L)/2;if(!d){var D=f?h.projRotate:[R,0,0];I=n("projection.rotation.lon",D[0]),n("projection.rotation.lat",D[1]),n("projection.rotation.roll",D[2]),n("showcoastlines",!f&&x)&&(n("coastlinecolor"),n("coastlinewidth")),n("showocean",!!x&&void 0)&&n("oceancolor")}d?(z=-96.6,O=38.7):(z=f?R:I,O=(C[0]+C[1])/2),n("center.lon",z),n("center.lat",O),m&&(n("projection.tilt"),n("projection.distance")),g&&n("projection.parallels",h.projParallels||[0,60]),n("projection.scale"),n("showland",!!x&&void 0)&&n("landcolor"),n("showlakes",!!x&&void 0)&&n("lakecolor"),n("showrivers",!!x&&void 0)&&(n("rivercolor"),n("riverwidth")),n("showcountries",f&&"usa"!==u&&x)&&(n("countrycolor"),n("countrywidth")),("usa"===u||"north america"===u&&50===c)&&(n("showsubunits",x),n("subunitcolor"),n("subunitwidth")),f||n("showframe",x)&&(n("framecolor"),n("framewidth")),n("bgcolor"),n("fitbounds")&&(delete t.projection.scale,f?(delete t.center.lon,delete t.center.lat):y?(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon,delete t.projection.rotation.lat,delete t.lonaxis.range,delete t.lataxis.range):(delete t.center.lon,delete t.center.lat,delete t.projection.rotation.lon))}t.exports=function(e,t,r){n(e,t,r,{type:"geo",attributes:o,handleDefaults:l,fullData:r,partition:"y"})}}}),xg=p({"src/plots/geo/index.js"(e,t){var r=_t().getSubplotCalcData,n=st().counterRegex,i=gg(),a="geo",o=n(a),s={};s[a]={valType:"subplotid",dflt:a,editType:"calc"},t.exports={attr:a,name:a,idRoot:a,idRegex:o,attrRegex:o,attributes:s,layoutAttributes:yg(),supplyLayoutDefaults:vg(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,o=t._subplots[a],s=0;s<o.length;s++){var l=o[s],c=r(n,a,l),u=t[l]._subplot;u||(u=i({id:l,graphDiv:e,container:t._geolayer.node(),topojsonURL:e._context.topojsonURL,staticPlot:e._context.staticPlot}),t[l]._subplot=u),u.plot(c,t,e._promises)}},updateFx:function(e){for(var t=e._fullLayout,r=t._subplots[a],n=0;n<r.length;n++){var i=t[r[n]];i._subplot.updateFx(t,i)}},clean:function(e,t,r,n){for(var i=n._subplots[a]||[],o=0;o<i.length;o++){var s=i[o],l=n[s]._subplot;!t[s]&&l&&(l.framework.remove(),l.clipDef.remove())}}}}}),bg=p({"src/traces/scattergeo/index.js"(e,t){t.exports={attributes:Wm(),supplyDefaults:$m(),colorbar:pi(),formatLabels:Zm(),calc:Xm(),calcGeoJSON:lg().calcGeoJSON,plot:lg().plot,style:sg(),styleOnSelect:fi().styleOnSelect,hoverPoints:cg(),eventData:ug(),selectPoints:hg(),moduleType:"trace",name:"scattergeo",basePlotModule:xg(),categories:["geo","symbols","showLegend","scatter-like"],meta:{}}}}),_g=p({"lib/scattergeo.js"(e,t){t.exports=bg()}}),wg=p({"src/traces/choropleth/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Wm(),i=Lt(),a=N(),o=V().defaultLine,s=R().extendFlat,l=n.marker.line;t.exports=s({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},geojson:s({},n.geojson,{}),featureidkey:n.featureidkey,text:s({},n.text,{}),hovertext:s({},n.hovertext,{}),marker:{line:{color:s({},l.color,{dflt:o}),width:s({},l.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:s({},a.hoverinfo,{editType:"calc",flags:["location","z","text","name"]}),hovertemplate:r(),showlegend:s({},a.showlegend,{dflt:!1})},i("",{cLetter:"z",editTypeOverride:"calc"}))}}),kg=p({"src/traces/choropleth/defaults.js"(e,t){var r=st(),n=Vt(),i=wg();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("locations"),c=s("z");if(l&&l.length&&r.isArrayOrTypedArray(c)&&c.length){t._length=Math.min(l.length,c.length);var u,h=s("geojson");("string"===typeof h&&""!==h||r.isPlainObject(h))&&(u="geojson-id"),"geojson-id"===s("locationmode",u)&&s("featureidkey"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(e,t,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,s)}else t.visible=!1}}}),Tg=p({"src/traces/choropleth/calc.js"(e,t){var r=k(),n=T().BADNUM,i=Gt(),a=ni(),o=ii();function s(e){return e&&"string"===typeof e}t.exports=function(e,t){var l,c=t._length,u=new Array(c);l=t.geojson?function(e){return s(e)||r(e)}:s;for(var h=0;h<c;h++){var p=u[h]={},d=t.locations[h],f=t.z[h];l(d)&&r(f)?(p.loc=d,p.z=f):(p.loc=null,p.z=n),p.index=h}return a(u,t),i(e,t,{vals:t.z,containerStr:"",cLetter:"z"}),o(u,t),u}}}),Sg=p({"src/traces/choropleth/style.js"(e,t){var r=v(),n=q(),i=Jt(),a=Wt();function o(e,t){var o=t[0].trace,s=t[0].node3.selectAll(".choroplethlocation"),l=o.marker||{},c=l.line||{},u=a.makeColorScaleFuncFromTrace(o);s.each((function(e){r.select(this).attr("fill",u(e.z)).call(n.stroke,e.mlc||c.color).call(i.dashLine,"",e.mlw||c.width||0).style("opacity",l.opacity)})),i.selectedPointStyle(s,o)}t.exports={style:function(e,t){t&&o(0,t)},styleOnSelect:function(e,t){var r=t[0].node3,n=t[0].trace;n.selectedpoints?i.selectedPointStyle(r.selectAll(".choroplethlocation"),n):o(0,t)}}}}),Ag=p({"src/traces/choropleth/plot.js"(e,t){var r=v(),n=st(),i=og(),a=Jm().getTopojsonFeatures,o=rr().findExtremes,s=Sg().style;t.exports={calcGeoJSON:function(e,t){for(var r=e[0].trace,n=t[r.geo],s=n._subplot,l=r.locationmode,c=r._length,u="geojson-id"===l?i.extractTraceFeature(e):a(r,s.topojson),h=[],p=[],d=0;d<c;d++){var f=e[d],m="geojson-id"===l?f.fOut:i.locationToFeature(l,f.loc,u);if(m){f.geojson=m,f.ct=m.properties.ct,f._polygons=i.feature2polygons(m);var g=i.computeBbox(m);h.push(g[0],g[2]),p.push(g[1],g[3])}else f.geojson=null}if("geojson"===n.fitbounds&&"geojson-id"===l){var y=i.computeBbox(i.getTraceGeojson(r));h=[y[0],y[2]],p=[y[1],y[3]]}var v={padded:!0};r._extremes.lon=o(n.lonaxis._ax,h,v),r._extremes.lat=o(n.lataxis._ax,p,v)},plot:function(e,t,i){var a=t.layers.backplot.select(".choroplethlayer");n.makeTraceGroups(a,i,"trace choropleth").each((function(t){var i=r.select(this).selectAll("path.choroplethlocation").data(n.identity);i.enter().append("path").classed("choroplethlocation",!0),i.exit().remove(),s(e,t)}))}}}}),Mg=p({"src/traces/choropleth/hover.js"(e,t){var r=nr(),n=wg(),i=st().fillText;t.exports=function(e,t,a){var o,s,l,c,u=e.cd,h=u[0].trace,p=e.subplot,d=[t,a],f=[t+360,a];for(s=0;s<u.length;s++)if(c=!1,(o=u[s])._polygons){for(l=0;l<o._polygons.length;l++)o._polygons[l].contains(d)&&(c=!c),o._polygons[l].contains(f)&&(c=!c);if(c)break}if(c&&o)return e.x0=e.x1=e.xa.c2p(o.ct),e.y0=e.y1=e.ya.c2p(o.ct),e.index=o.index,e.location=o.loc,e.z=o.z,e.zLabel=r.tickText(p.mockAxis,p.mockAxis.c2l(o.z),"hover").text,e.hovertemplate=o.hovertemplate,function(e,t,r){if(!t.hovertemplate){var a=r.hi||t.hoverinfo,o=String(r.loc),s="all"===a?n.hoverinfo.flags:a.split("+"),l=-1!==s.indexOf("name"),c=-1!==s.indexOf("location"),u=-1!==s.indexOf("z"),h=-1!==s.indexOf("text"),p=[];!l&&c?e.nameOverride=o:(l&&(e.nameOverride=t.name),c&&p.push(o)),u&&p.push(e.zLabel),h&&i(r,t,p),e.extraText=p.join("<br>")}}(e,h,o),[e]}}}),Eg=p({"src/traces/choropleth/event_data.js"(e,t){t.exports=function(e,t,r,n,i){e.location=t.location,e.z=t.z;var a=n[i];return a.fIn&&a.fIn.properties&&(e.properties=a.fIn.properties),e.ct=a.ct,e}}}),Cg=p({"src/traces/choropleth/select.js"(e,t){t.exports=function(e,t){var r,n,i,a,o,s=e.cd,l=e.xaxis,c=e.yaxis,u=[];if(!1===t)for(r=0;r<s.length;r++)s[r].selected=0;else for(r=0;r<s.length;r++)(i=(n=s[r]).ct)&&(a=l.c2p(i),o=c.c2p(i),t.contains([a,o],null,r,e)?(u.push({pointNumber:r,lon:i[0],lat:i[1]}),n.selected=1):n.selected=0);return u}}}),Pg=p({"src/traces/choropleth/index.js"(e,t){t.exports={attributes:wg(),supplyDefaults:kg(),colorbar:No(),calc:Tg(),calcGeoJSON:Ag().calcGeoJSON,plot:Ag().plot,style:Sg().style,styleOnSelect:Sg().styleOnSelect,hoverPoints:Mg(),eventData:Eg(),selectPoints:Cg(),moduleType:"trace",name:"choropleth",basePlotModule:xg(),categories:["geo","noOpacity","showLegend"],meta:{}}}}),Lg=p({"lib/choropleth.js"(e,t){t.exports=Pg()}}),Ig=p({"src/traces/scattergl/hover.js"(e,t){var r=Ve(),n=st(),i=mi();function a(e,t,a,o){var s=e.xa,l=e.ya,c=e.distance,u=e.dxy,h=e.index,p={pointNumber:h,x:t[h],y:a[h]};p.tx=n.isArrayOrTypedArray(o.text)?o.text[h]:o.text,p.htx=Array.isArray(o.hovertext)?o.hovertext[h]:o.hovertext,p.data=Array.isArray(o.customdata)?o.customdata[h]:o.customdata,p.tp=Array.isArray(o.textposition)?o.textposition[h]:o.textposition;var d=o.textfont;d&&(p.ts=n.isArrayOrTypedArray(d.size)?d.size[h]:d.size,p.tc=n.isArrayOrTypedArray(d.color)?d.color[h]:d.color,p.tf=Array.isArray(d.family)?d.family[h]:d.family,p.tw=Array.isArray(d.weight)?d.weight[h]:d.weight,p.ty=Array.isArray(d.style)?d.style[h]:d.style,p.tv=Array.isArray(d.variant)?d.variant[h]:d.variant);var f=o.marker;f&&(p.ms=n.isArrayOrTypedArray(f.size)?f.size[h]:f.size,p.mo=n.isArrayOrTypedArray(f.opacity)?f.opacity[h]:f.opacity,p.mx=n.isArrayOrTypedArray(f.symbol)?f.symbol[h]:f.symbol,p.ma=n.isArrayOrTypedArray(f.angle)?f.angle[h]:f.angle,p.mc=n.isArrayOrTypedArray(f.color)?f.color[h]:f.color);var m=f&&f.line;m&&(p.mlc=Array.isArray(m.color)?m.color[h]:m.color,p.mlw=n.isArrayOrTypedArray(m.width)?m.width[h]:m.width);var g=f&&f.gradient;g&&"none"!==g.type&&(p.mgt=Array.isArray(g.type)?g.type[h]:g.type,p.mgc=Array.isArray(g.color)?g.color[h]:g.color);var y=s.c2p(p.x,!0),v=l.c2p(p.y,!0),x=p.mrc||1,b=o.hoverlabel;b&&(p.hbg=Array.isArray(b.bgcolor)?b.bgcolor[h]:b.bgcolor,p.hbc=Array.isArray(b.bordercolor)?b.bordercolor[h]:b.bordercolor,p.hts=n.isArrayOrTypedArray(b.font.size)?b.font.size[h]:b.font.size,p.htc=Array.isArray(b.font.color)?b.font.color[h]:b.font.color,p.htf=Array.isArray(b.font.family)?b.font.family[h]:b.font.family,p.hnl=n.isArrayOrTypedArray(b.namelength)?b.namelength[h]:b.namelength);var _=o.hoverinfo;_&&(p.hi=Array.isArray(_)?_[h]:_);var w=o.hovertemplate;w&&(p.ht=Array.isArray(w)?w[h]:w);var k={};k[e.index]=p;var T=o._origX,S=o._origY,A=n.extendFlat({},e,{color:i(o,p),x0:y-x,x1:y+x,xLabelVal:T?T[h]:p.x,y0:v-x,y1:v+x,yLabelVal:S?S[h]:p.y,cd:k,distance:c,spikeDistance:u,hovertemplate:p.ht});return p.htx?A.text=p.htx:p.tx?A.text=p.tx:o.text&&(A.text=o.text),n.fillText(p,o,A),r.getComponentMethod("errorbars","hoverInfo")(p,o,A),A}t.exports={hoverPoints:function(e,t,r,n){var i,o,s,l,c,u,h,p,d,f,m=e.cd,g=m[0].t,y=m[0].trace,v=e.xa,x=e.ya,b=g.x,_=g.y,w=v.c2p(t),k=x.c2p(r),T=e.distance;if(g.tree){var S=v.p2c(w-T),A=v.p2c(w+T),M=x.p2c(k-T),E=x.p2c(k+T);i="x"===n?g.tree.range(Math.min(S,A),Math.min(x._rl[0],x._rl[1]),Math.max(S,A),Math.max(x._rl[0],x._rl[1])):g.tree.range(Math.min(S,A),Math.min(M,E),Math.max(S,A),Math.max(M,E))}else i=g.ids;var C=T;if("x"===n){var P=!!y.xperiodalignment,L=!!y.yperiodalignment;for(u=0;u<i.length;u++){if(l=b[o=i[u]],h=Math.abs(v.c2p(l)-w),P){var I=v.c2p(y._xStarts[o]),z=v.c2p(y._xEnds[o]);h=w>=Math.min(I,z)&&w<=Math.max(I,z)?0:1/0}if(h<C){if(C=h,c=_[o],p=x.c2p(c)-k,L){var O=x.c2p(y._yStarts[o]),R=x.c2p(y._yEnds[o]);p=k>=Math.min(O,R)&&k<=Math.max(O,R)?0:1/0}f=Math.sqrt(h*h+p*p),s=i[u]}}}else for(u=i.length-1;u>-1;u--)l=b[o=i[u]],c=_[o],h=v.c2p(l)-w,p=x.c2p(c)-k,(d=Math.sqrt(h*h+p*p))<C&&(C=f=d,s=o);return e.index=s,e.distance=C,e.dxy=f,void 0===s?[e]:[a(e,b,_,y)]},calcHover:a}}}),zg=p({"src/traces/scattergl/constants.js"(e,t){t.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]}}}}),Og=p({"src/traces/scattergl/attributes.js"(e,t){var r=N(),n=D(),i=_n(),a=wn(),o=Et().axisHoverFormat,s=Lt(),l=We(),c=R().extendFlat,u=Le().overrideAll,h=zg().DASHES,p=a.line,d=a.marker,f=d.line,m=t.exports=u({x:a.x,x0:a.x0,dx:a.dx,y:a.y,y0:a.y0,dy:a.dy,xperiod:a.xperiod,yperiod:a.yperiod,xperiod0:a.xperiod0,yperiod0:a.yperiod0,xperiodalignment:a.xperiodalignment,yperiodalignment:a.yperiodalignment,xhoverformat:o("x"),yhoverformat:o("y"),text:a.text,hovertext:a.hovertext,textposition:a.textposition,textfont:n({noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,editType:"calc",colorEditType:"style",arrayOk:!0,noNumericWeightValues:!0,variantValues:["normal","small-caps"]}),mode:{valType:"flaglist",flags:["lines","markers","text"],extras:["none"]},line:{color:p.color,width:p.width,shape:{valType:"enumerated",values:["linear","hv","vh","hvh","vhv"],dflt:"linear",editType:"plot"},dash:{valType:"enumerated",values:l(h),dflt:"solid"}},marker:c({},s("marker"),{symbol:d.symbol,angle:d.angle,size:d.size,sizeref:d.sizeref,sizemin:d.sizemin,sizemode:d.sizemode,opacity:d.opacity,colorbar:d.colorbar,line:c({},s("marker.line"),{width:f.width})}),connectgaps:a.connectgaps,fill:c({},a.fill,{dflt:"none"}),fillcolor:i(),selected:{marker:a.selected.marker,textfont:a.selected.textfont},unselected:{marker:a.unselected.marker,textfont:a.unselected.textfont},opacity:r.opacity},"calc","nested");m.x.editType=m.y.editType=m.x0.editType=m.y0.editType="calc+clearAxisTypes",m.hovertemplate=a.hovertemplate,m.texttemplate=a.texttemplate}}),Rg=p({"src/traces/scattergl/helpers.js"(e){var t=zg();e.isOpenSymbol=function(e){return"string"===typeof e?t.OPEN_RE.test(e):e%200>100},e.isDotSymbol=function(e){return"string"===typeof e?t.DOT_RE.test(e):e>200}}}),Dg=p({"src/traces/scattergl/defaults.js"(e,t){var r=st(),n=Ve(),i=Rg(),a=Og(),o=bn(),s=$t(),l=qn(),c=Hn(),u=Wn(),h=$n(),p=Yn(),d=Xn();t.exports=function(e,t,f,m){function g(n,i){return r.coerce(e,t,a,n,i)}var y=!!e.marker&&i.isOpenSymbol(e.marker.symbol),v=s.isBubble(e),x=l(e,t,m,g);if(x){c(e,t,m,g),g("xhoverformat"),g("yhoverformat");var b=x<o.PTS_LINESONLY?"lines+markers":"lines";g("text"),g("hovertext"),g("hovertemplate"),g("mode",b),s.hasMarkers(t)&&(u(e,t,f,m,g,{noAngleRef:!0,noStandOff:!0}),g("marker.line.width",y||v?1:0)),s.hasLines(t)&&(g("connectgaps"),h(e,t,f,m,g),g("line.shape")),s.hasText(t)&&(g("texttemplate"),d(e,t,m,g,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}));var _=(t.line||{}).color,w=(t.marker||{}).color;g("fill"),"none"!==t.fill&&p(e,t,f,g);var k=n.getComponentMethod("errorbars","supplyDefaults");k(e,t,_||w||f,{axis:"y"}),k(e,t,_||w||f,{axis:"x",inherit:"y"}),r.coerceSelectionMarkerOpacity(t,g)}else t.visible=!1}}}),jg=p({"src/traces/scattergl/format_labels.js"(e,t){var r=di();t.exports=function(e,t,n){var i=e.i;return"x"in e||(e.x=t._x[i]),"y"in e||(e.y=t._y[i]),r(e,t,n)}}}),Fg=p({"node_modules/binary-search-bounds/search-bounds.js"(e,t){function r(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>=0?(a=o,i=o-1):n=o+1}return a}function n(e,t,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)>0?(a=o,i=o-1):n=o+1}return a}function i(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<0?(a=o,n=o+1):i=o-1}return a}function a(e,t,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=e[o];(void 0!==r?r(s,t):s-t)<=0?(a=o,n=o+1):i=o-1}return a}function o(e,t,r,n,i){for(;n<=i;){var a=n+i>>>1,o=e[a],s=void 0!==r?r(o,t):o-t;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function s(e,t,r,n,i,a){return"function"===typeof r?a(e,t,r,void 0===n?0:0|n,void 0===i?e.length-1:0|i):a(e,t,void 0,void 0===r?0:0|r,void 0===n?e.length-1:0|n)}t.exports={ge:function(e,t,n,i,a){return s(e,t,n,i,a,r)},gt:function(e,t,r,i,a){return s(e,t,r,i,a,n)},lt:function(e,t,r,n,a){return s(e,t,r,n,a,i)},le:function(e,t,r,n,i){return s(e,t,r,n,i,a)},eq:function(e,t,r,n,i){return s(e,t,r,n,i,o)}}}}),Bg=p({"node_modules/pick-by-alias/index.js"(e,t){t.exports=function(e,t,r){var i,a,o={};if("string"===typeof t&&(t=n(t)),Array.isArray(t)){var s={};for(a=0;a<t.length;a++)s[t[a]]=!0;t=s}for(i in t)t[i]=n(t[i]);var l={};for(i in t){var c=t[i];if(Array.isArray(c))for(a=0;a<c.length;a++){var u=c[a];if(r&&(l[u]=!0),u in e){if(o[i]=e[u],r)for(var h=a;h<c.length;h++)l[c[h]]=!0;break}}else i in e&&(t[i]&&(o[i]=e[i]),r&&(l[i]=!0))}if(r)for(i in e)l[i]||(o[i]=e[i]);return o};var r={};function n(e){return r[e]?r[e]:("string"===typeof e&&(e=r[e]=e.split(/\s*,\s*|\s+/)),e)}}}),Ng=p({"node_modules/parse-rect/index.js"(e,t){var r=Bg();t.exports=function(e){var t;return arguments.length>1&&(e=arguments),"string"===typeof e?e=e.split(/\s/).map(parseFloat):"number"===typeof e&&(e=[e]),e.length&&"number"===typeof e[0]?t=1===e.length?{width:e[0],height:e[0],x:0,y:0}:2===e.length?{width:e[0],height:e[1],x:0,y:0}:{x:e[0],y:e[1],width:e[2]-e[0]||0,height:e[3]-e[1]||0}:e&&(t={x:(e=r(e,{left:"x l left Left",top:"y t top Top",width:"w width W Width",height:"h height W Width",bottom:"b bottom Bottom",right:"r right Right"})).left||0,y:e.top||0},null==e.width?e.right?t.width=e.right-t.x:t.width=0:t.width=e.width,null==e.height?e.bottom?t.height=e.bottom-t.y:t.height=0:t.height=e.height),t}}}),Ug=p({"node_modules/array-bounds/index.js"(e,t){t.exports=function(e,t){if(!e||null==e.length)throw Error("Argument should be an array");t=null==t?1:Math.floor(t);for(var r=Array(2*t),n=0;n<t;n++){for(var i=-1/0,a=1/0,o=n,s=e.length;o<s;o+=t)e[o]>i&&(i=e[o]),e[o]<a&&(a=e[o]);r[n]=a,r[t+n]=i}return r}}}),Vg=p({"node_modules/defined/index.js"(e,t){t.exports=function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]}}}),qg=p({"node_modules/flatten-vertex-data/index.js"(e,t){var r=Ff();t.exports=function(e,t,n){if(!e)throw new TypeError("must specify data as first parameter");if(n=0|+(n||0),Array.isArray(e)&&e[0]&&"number"===typeof e[0][0]){var i,a,o,s,l=e[0].length,c=e.length*l;t&&"string"!==typeof t||(t=new(r(t||"float32"))(c+n));var u=t.length-n;if(c!==u)throw new Error("source length "+c+" ("+l+"x"+e.length+") does not match destination length "+u);for(i=0,o=n;i<e.length;i++)for(a=0;a<l;a++)t[o++]=null===e[i][a]?NaN:e[i][a]}else if(t&&"string"!==typeof t)t.set(e,n);else{var h=r(t||"float32");if(Array.isArray(e)||"array"===t)for(i=0,o=n,s=(t=new h(e.length+n)).length;o<s;o++,i++)t[o]=null===e[i]?NaN:e[i];else 0===n?t=new h(e):(t=new h(e.length+n)).set(e,n)}return t}}}),Hg=p({"node_modules/is-obj/index.js"(e,t){t.exports=function(e){var t=typeof e;return null!==e&&("object"===t||"function"===t)}}}),Gg=p({"node_modules/math-log2/index.js"(e,t){t.exports=Math.log2||function(e){return Math.log(e)*Math.LOG2E}}}),Wg=p({"node_modules/@plotly/point-cluster/quad.js"(e,t){var r=Fg(),n=jf(),i=Ng(),a=Ug(),o=Bg(),s=Vg(),l=qg(),c=Hg(),u=Ff(),h=Gg();function p(e,t){let[r,i,a,o]=t,s=1/(a-r),l=1/(o-i),c=new Array(e.length);for(let u=0,h=e.length/2;u<h;u++)c[2*u]=n((e[2*u]-r)*s,0,1),c[2*u+1]=n((e[2*u+1]-i)*l,0,1);return c}t.exports=function(e,t){t||(t={}),e=l(e,"float64"),t=o(t,{bounds:"range bounds dataBox databox",maxDepth:"depth maxDepth maxdepth level maxLevel maxlevel levels",dtype:"type dtype format out dst output destination"});let n=s(t.maxDepth,255),d=s(t.bounds,a(e,2));d[0]===d[2]&&d[2]++,d[1]===d[3]&&d[3]++;let f,m=p(e,d),g=e.length>>>1;t.dtype||(t.dtype="array"),"string"===typeof t.dtype?f=new(u(t.dtype))(g):t.dtype&&(f=t.dtype,Array.isArray(f)&&(f.length=g));for(let r=0;r<g;++r)f[r]=r;let y=[],v=[],x=[],b=[];!function e(t,r,i,a,o,s){if(!a.length)return null;let l=y[o]||(y[o]=[]),c=x[o]||(x[o]=[]),u=v[o]||(v[o]=[]),h=l.length;if(++o>n||s>1073741824){for(let e=0;e<a.length;e++)l.push(a[e]),c.push(s),u.push(null,null,null,null);return h}if(l.push(a[0]),c.push(s),a.length<=1)return u.push(null,null,null,null),h;let p=.5*i,d=t+p,f=r+p,g=[],b=[],_=[],w=[];for(let n=1,y=a.length;n<y;n++){let e=a[n],t=m[2*e],r=m[2*e+1];t<d?r<f?g.push(e):b.push(e):r<f?_.push(e):w.push(e)}return s<<=2,u.push(e(t,r,p,g,o,s),e(t,f,p,b,o,s+1),e(d,r,p,_,o,s+2),e(d,f,p,w,o,s+3)),h}(0,0,1,f,0,1);let _=0;for(let r=0;r<y.length;r++){let e=y[r];if(f.set)f.set(e,_);else for(let r=0,n=e.length;r<n;r++)f[r+_]=e[r];let t=_+y[r].length;b[r]=[_,t],_=t}return f.range=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];let l;if(c(n[n.length-1])){let e=n.pop();n.length||null==e.x&&null==e.l&&null==e.left||(n=[e],l={}),l=o(e,{level:"level maxLevel",d:"d diam diameter r radius px pxSize pixel pixelSize maxD size minSize",lod:"lod details ranges offsets"})}else l={};n.length||(n=d);let u=i(...n),[f,m,g,_]=[Math.min(u.x,u.x+u.width),Math.min(u.y,u.y+u.height),Math.max(u.x,u.x+u.width),Math.max(u.y,u.y+u.height)],[k,T,S,A]=p([f,m,g,_],d),M=s(l.level,y.length);if(null!=l.d){let e;"number"===typeof l.d?e=[l.d,l.d]:l.d.length&&(e=l.d),M=Math.min(Math.max(Math.ceil(-h(Math.abs(e[0])/(d[2]-d[0]))),Math.ceil(-h(Math.abs(e[1])/(d[3]-d[1])))),M)}if(M=Math.min(M,y.length),l.lod)return function(e,t,n,i,a){let o=[];for(let s=0;s<a;s++){let a=x[s],l=b[s][0],c=w(e,t,s),u=w(n,i,s),h=r.ge(a,c),p=r.gt(a,u,h,a.length-1);o[s]=[h+l,p+l]}return o}(k,T,S,A,M);let E=[];return function t(r,n,i,a,o,s){if(null===o||null===s)return;let l=n+i;if(k>r+i||T>l||S<r||A<n)return;if(a>=M)return;if(o===s)return;let c=y[a];void 0===s&&(s=c.length);for(let y=o;y<s;y++){let t=c[y],r=e[2*t],n=e[2*t+1];r>=f&&r<=g&&n>=m&&n<=_&&E.push(t)}let u=v[a],h=u[4*o+0],p=u[4*o+1],d=u[4*o+2],x=u[4*o+3],b=function(e,t){let r=null,n=0;for(;null===r;)if(r=e[4*t+n],n++,n>e.length)return null;return r}(u,o+1),w=.5*i,C=a+1;t(r,n,w,C,h,p||d||x||b),t(r,n+w,w,C,p,d||x||b),t(r+w,n,w,C,d,x||b),t(r+w,n+w,w,C,x,b)}(0,0,1,0,0,1),E},f;function w(e,t,r){let n=1,i=.5,a=.5,o=.5;for(let s=0;s<r;s++)n<<=2,n+=e<i?t<a?0:1:t<a?2:3,o*=.5,i+=e<i?-o:o,a+=t<a?-o:o;return n}}}}),$g=p({"node_modules/@plotly/point-cluster/index.js"(e,t){t.exports=Wg()}}),Zg=p({"node_modules/abs-svg-path/index.js"(e,t){t.exports=function(e){var t=0,r=0,n=0,i=0;return e.map((function(e){var a=(e=e.slice())[0],o=a.toUpperCase();if(a!=o)switch(e[0]=o,a){case"a":e[6]+=n,e[7]+=i;break;case"v":e[1]+=i;break;case"h":e[1]+=n;break;default:for(var s=1;s<e.length;)e[s++]+=n,e[s++]+=i}switch(o){case"Z":n=t,i=r;break;case"H":n=e[1];break;case"V":i=e[1];break;case"M":n=t=e[1],i=r=e[2];break;default:n=e[e.length-2],i=e[e.length-1]}return e}))}}}),Xg=p({"node_modules/svg-arc-to-cubic-bezier/cjs/index.js"(e,t){Object.defineProperty(e,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(l){i=!0,a=l}finally{try{!n&&s.return&&s.return()}finally{if(i)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),n=2*Math.PI,i=function(e,t,r,n,i,a,o){var s=e.x,l=e.y;return{x:n*(s*=t)-i*(l*=r)+a,y:i*s+n*l+o}},a=function(e,t){var r=1.5707963267948966===t?.551915024494:-1.5707963267948966===t?-.551915024494:4/3*Math.tan(t/4),n=Math.cos(e),i=Math.sin(e),a=Math.cos(e+t),o=Math.sin(e+t);return[{x:n-i*r,y:i+n*r},{x:a+o*r,y:o-a*r},{x:a,y:o}]},o=function(e,t,r,n){var i=e*r+t*n;return i>1&&(i=1),i<-1&&(i=-1),(e*n-t*r<0?-1:1)*Math.acos(i)};e.default=function(e){var t=e.px,s=e.py,l=e.cx,c=e.cy,u=e.rx,h=e.ry,p=e.xAxisRotation,d=void 0===p?0:p,f=e.largeArcFlag,m=void 0===f?0:f,g=e.sweepFlag,y=void 0===g?0:g,v=[];if(0===u||0===h)return[];var x=Math.sin(d*n/360),b=Math.cos(d*n/360),_=b*(t-l)/2+x*(s-c)/2,w=-x*(t-l)/2+b*(s-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),h=Math.abs(h);var k=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(h,2);k>1&&(u*=Math.sqrt(k),h*=Math.sqrt(k));var T=function(e,t,r,i,a,s,l,c,u,h,p,d){var f=Math.pow(a,2),m=Math.pow(s,2),g=Math.pow(p,2),y=Math.pow(d,2),v=f*m-f*y-m*g;v<0&&(v=0),v/=f*y+m*g;var x=(v=Math.sqrt(v)*(l===c?-1:1))*a/s*d,b=v*-s/a*p,_=h*x-u*b+(e+r)/2,w=u*x+h*b+(t+i)/2,k=(p-x)/a,T=(d-b)/s,S=(-p-x)/a,A=(-d-b)/s,M=o(1,0,k,T),E=o(k,T,S,A);return 0===c&&E>0&&(E-=n),1===c&&E<0&&(E+=n),[_,w,M,E]}(t,s,l,c,u,h,m,y,x,b,_,w),S=r(T,4),A=S[0],M=S[1],E=S[2],C=S[3],P=Math.abs(C)/(n/4);Math.abs(1-P)<1e-7&&(P=1);var L=Math.max(Math.ceil(P),1);C/=L;for(var I=0;I<L;I++)v.push(a(E,C)),E+=C;return v.map((function(e){var t=i(e[0],u,h,b,x,A,M),r=t.x,n=t.y,a=i(e[1],u,h,b,x,A,M),o=a.x,s=a.y,l=i(e[2],u,h,b,x,A,M);return{x1:r,y1:n,x2:o,y2:s,x:l.x,y:l.y}}))},t.exports=e.default}}),Yg=p({"node_modules/svg-path-bounds/node_modules/normalize-svg-path/index.js"(e,t){t.exports=function(e){for(var t,a=[],o=0,s=0,l=0,c=0,u=null,h=null,p=0,d=0,f=0,m=e.length;f<m;f++){var g=e[f],y=g[0];switch(y){case"M":l=g[1],c=g[2];break;case"A":var v=r({px:p,py:d,cx:g[6],cy:g[7],rx:g[1],ry:g[2],xAxisRotation:g[3],largeArcFlag:g[4],sweepFlag:g[5]});if(!v.length)continue;for(var x,b=0;b<v.length;b++)g=["C",(x=v[b]).x1,x.y1,x.x2,x.y2,x.x,x.y],b<v.length-1&&a.push(g);break;case"S":var _=p,w=d;"C"!=t&&"S"!=t||(_+=_-o,w+=w-s),g=["C",_,w,g[1],g[2],g[3],g[4]];break;case"T":"Q"==t||"T"==t?(u=2*p-u,h=2*d-h):(u=p,h=d),g=i(p,d,u,h,g[1],g[2]);break;case"Q":u=g[1],h=g[2],g=i(p,d,g[1],g[2],g[3],g[4]);break;case"L":g=n(p,d,g[1],g[2]);break;case"H":g=n(p,d,g[1],d);break;case"V":g=n(p,d,p,g[1]);break;case"Z":g=n(p,d,l,c)}t=y,p=g[g.length-2],d=g[g.length-1],g.length>4?(o=g[g.length-4],s=g[g.length-3]):(o=p,s=d),a.push(g)}return a};var r=Xg();function n(e,t,r,n){return["C",e,t,r,n,r,n]}function i(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}}}),Kg=p({"node_modules/is-svg-path/index.js"(e,t){t.exports=function(e){return"string"===typeof e&&(e=e.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(e)&&/[\dz]$/i.test(e)&&e.length>4))}}}),Jg=p({"node_modules/svg-path-bounds/index.js"(e,t){var r=Yt(),n=Zg(),i=Yg(),a=Kg(),o=ru();t.exports=function(e){if(Array.isArray(e)&&1===e.length&&"string"===typeof e[0]&&(e=e[0]),"string"===typeof e&&(o(a(e),"String is not an SVG path."),e=r(e)),o(Array.isArray(e),"Argument should be a string or an array of path segments."),e=n(e),!(e=i(e)).length)return[0,0,0,0];for(var t=[1/0,1/0,-1/0,-1/0],s=0,l=e.length;s<l;s++)for(var c=e[s].slice(1),u=0;u<c.length;u+=2)c[u+0]<t[0]&&(t[0]=c[u+0]),c[u+1]<t[1]&&(t[1]=c[u+1]),c[u+0]>t[2]&&(t[2]=c[u+0]),c[u+1]>t[3]&&(t[3]=c[u+1]);return t}}}),Qg=p({"node_modules/normalize-svg-path/index.js"(e,t){var r=Math.PI,n=l(120);function i(e,t,r,n){return["C",e,t,r,n,r,n]}function a(e,t,r,n,i,a){return["C",e/3+2/3*r,t/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function o(e,t,i,a,l,c,u,h,p,d){if(d)k=d[0],T=d[1],_=d[2],w=d[3];else{var f=s(e,t,-l);e=f.x,t=f.y;var m=(e-(h=(f=s(h,p,-l)).x))/2,g=(t-(p=f.y))/2,y=m*m/(i*i)+g*g/(a*a);y>1&&(i*=y=Math.sqrt(y),a*=y);var v=i*i,x=a*a,b=(c==u?-1:1)*Math.sqrt(Math.abs((v*x-v*g*g-x*m*m)/(v*g*g+x*m*m)));b==1/0&&(b=1);var _=b*i*g/a+(e+h)/2,w=b*-a*m/i+(t+p)/2,k=Math.asin(((t-w)/a).toFixed(9)),T=Math.asin(((p-w)/a).toFixed(9));(k=e<_?r-k:k)<0&&(k=2*r+k),(T=h<_?r-T:T)<0&&(T=2*r+T),u&&k>T&&(k-=2*r),!u&&T>k&&(T-=2*r)}if(Math.abs(T-k)>n){var S=T,A=h,M=p;T=k+n*(u&&T>k?1:-1);var E=o(h=_+i*Math.cos(T),p=w+a*Math.sin(T),i,a,l,0,u,A,M,[T,S,_,w])}var C=Math.tan((T-k)/4),P=4/3*i*C,L=4/3*a*C,I=[2*e-(e+P*Math.sin(k)),2*t-(t-L*Math.cos(k)),h+P*Math.sin(T),p-L*Math.cos(T),h,p];if(d)return I;E&&(I=I.concat(E));for(var z=0;z<I.length;){var O=s(I[z],I[z+1],l);I[z++]=O.x,I[z++]=O.y}return I}function s(e,t,r){return{x:e*Math.cos(r)-t*Math.sin(r),y:e*Math.sin(r)+t*Math.cos(r)}}function l(e){return e*(r/180)}t.exports=function(e){for(var t,r=[],n=0,s=0,c=0,u=0,h=null,p=null,d=0,f=0,m=0,g=e.length;m<g;m++){var y=e[m],v=y[0];switch(v){case"M":c=y[1],u=y[2];break;case"A":(y=o(d,f,y[1],y[2],l(y[3]),y[4],y[5],y[6],y[7])).unshift("C"),y.length>7&&(r.push(y.splice(0,7)),y.unshift("C"));break;case"S":var x=d,b=f;"C"!=t&&"S"!=t||(x+=x-n,b+=b-s),y=["C",x,b,y[1],y[2],y[3],y[4]];break;case"T":"Q"==t||"T"==t?(h=2*d-h,p=2*f-p):(h=d,p=f),y=a(d,f,h,p,y[1],y[2]);break;case"Q":h=y[1],p=y[2],y=a(d,f,y[1],y[2],y[3],y[4]);break;case"L":y=i(d,f,y[1],y[2]);break;case"H":y=i(d,f,y[1],f);break;case"V":y=i(d,f,d,y[1]);break;case"Z":y=i(d,f,c,u)}t=v,d=y[y.length-2],f=y[y.length-1],y.length>4?(n=y[y.length-4],s=y[y.length-3]):(n=d,s=f),r.push(y)}return r}}}),ey=p({"node_modules/draw-svg-path/index.js"(e,t){var r=Zg(),n=Qg(),i={M:"moveTo",C:"bezierCurveTo"};t.exports=function(e,t){e.beginPath(),n(r(t)).forEach((function(t){var r=t[0],n=t.slice(1);e[i[r]].apply(e,n)})),e.closePath()}}}),ty=p({"node_modules/bitmap-sdf/index.js"(e,t){var r=jf();t.exports=function(e,t){t||(t={});var a,o,s,l,c,u,h,p,d,f,m,g=null==t.cutoff?.25:t.cutoff,y=null==t.radius?8:t.radius,v=t.channel||0;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");a=t.width,o=t.height,l=e,u=t.stride?t.stride:Math.floor(e.length/a/o)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(h=(p=e).getContext("2d"),a=p.width,o=p.height,l=(d=h.getImageData(0,0,a,o)).data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(h=e,a=(p=e.canvas).width,o=p.height,l=(d=h.getImageData(0,0,a,o)).data,u=4):window.ImageData&&e instanceof window.ImageData&&(d=e,a=e.width,o=e.height,l=d.data,u=4);if(s=Math.max(a,o),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(c=l,l=Array(a*o),f=0,m=c.length;f<m;f++)l[f]=c[f*u+v]/255;else if(1!==u)throw Error("Raw data can have only 1 value per pixel");var x=Array(a*o),b=Array(a*o),_=Array(s),w=Array(s),k=Array(s+1),T=Array(s);for(f=0,m=a*o;f<m;f++){var S=l[f];x[f]=1===S?0:0===S?n:Math.pow(Math.max(0,.5-S),2),b[f]=1===S?n:0===S?0:Math.pow(Math.max(0,S-.5),2)}i(x,a,o,_,w,T,k),i(b,a,o,_,w,T,k);var A=window.Float32Array?new Float32Array(a*o):new Array(a*o);for(f=0,m=a*o;f<m;f++)A[f]=r(1-((x[f]-b[f])/y+g),0,1);return A};var n=1e20;function i(e,t,r,n,i,o,s){for(var l=0;l<t;l++){for(var c=0;c<r;c++)n[c]=e[c*t+l];for(a(n,i,o,s,r),c=0;c<r;c++)e[c*t+l]=i[c]}for(c=0;c<r;c++){for(l=0;l<t;l++)n[l]=e[c*t+l];for(a(n,i,o,s,t),l=0;l<t;l++)e[c*t+l]=Math.sqrt(i[l])}}function a(e,t,r,i,a){r[0]=0,i[0]=-n,i[1]=+n;for(var o=1,s=0;o<a;o++){for(var l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);l<=i[s];)s--,l=(e[o]+o*o-(e[r[s]]+r[s]*r[s]))/(2*o-2*r[s]);r[++s]=o,i[s]=l,i[s+1]=+n}for(o=0,s=0;o<a;o++){for(;i[s+1]<o;)s++;t[o]=(o-r[s])*(o-r[s])+e[r[s]]}}}}),ry=p({"node_modules/svg-path-sdf/index.js"(e,t){var r,n=Jg(),i=Yt(),a=ey(),o=Kg(),s=ty(),l=document.createElement("canvas"),c=l.getContext("2d");t.exports=function(e,t){if(!o(e))throw Error("Argument should be valid svg path string");var u,h;t||(t={}),t.shape?(u=t.shape[0],h=t.shape[1]):(u=l.width=t.w||t.width||200,h=l.height=t.h||t.height||200);var p=Math.min(u,h),d=t.stroke||0,f=t.viewbox||t.viewBox||n(e),m=[u/(f[2]-f[0]),h/(f[3]-f[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,h),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*h),c.scale(g,g),function(){if(null!=r)return r;var e=document.createElement("canvas").getContext("2d");if(e.canvas.width=e.canvas.height=1,!window.Path2D)return r=!1;var t=new Path2D("M0,0h1v1h-1v-1Z");e.fillStyle="black",e.fill(t);var n=e.getImageData(0,0,1,1);return r=n&&n.data&&255===n.data[3]}()){var y=new Path2D(e);c.fill(y),d&&c.stroke(y)}else{var v=i(e);a(c,v),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=t.cutoff?t.cutoff:.5,radius:null!=t.radius?t.radius:.5*p})}}}),ny=p({"src/traces/scattergl/convert.js"(e,t){var r=k(),n=ry(),i=Bf(),a=Ve(),o=st(),s=o.isArrayOrTypedArray,l=Jt(),c=vt(),u=Uf().formatColor,h=$t(),p=Zt(),d=Rg(),f=zg(),m=H().DESELECTDIM,g={start:1,left:1,end:-1,right:-1,middle:0,center:0,bottom:1,top:-1},y=Xt().appendArrayPointValue;function v(e,t){var n,i=e._fullLayout,a=t._length,l=t.textfont,c=t.textposition,u=s(c)?c:[c],h=l.color,p=l.size,d=l.family,f=l.weight,m=l.style,g=l.variant,v={},b=e._context.plotGlPixelRatio,_=t.texttemplate;if(_){v.text=[];var w=i._d3locale,k=Array.isArray(_),T=k?Math.min(_.length,a):a,S=k?function(e){return _[e]}:function(){return _};for(n=0;n<T;n++){var A={i:n},M=t._module.formatLabels(A,t,i),E={};y(E,t,n);var C=t._meta||{};v.text.push(o.texttemplateString(S(n),M,w,E,A,C))}}else s(t.text)&&t.text.length<a?v.text=t.text.slice():v.text=t.text;if(s(v.text))for(n=v.text.length;n<a;n++)v.text[n]="";for(v.opacity=t.opacity,v.font={},v.align=[],v.baseline=[],n=0;n<u.length;n++){var P=u[n].split(/\s+/);switch(P[1]){case"left":v.align.push("right");break;case"right":v.align.push("left");break;default:v.align.push(P[1])}switch(P[0]){case"top":v.baseline.push("bottom");break;case"bottom":v.baseline.push("top");break;default:v.baseline.push(P[0])}}if(s(h))for(v.color=new Array(a),n=0;n<a;n++)v.color[n]=h[n];else v.color=h;if(s(p)||Array.isArray(d)||s(f)||Array.isArray(m)||Array.isArray(g))for(v.font=new Array(a),n=0;n<a;n++){var L=v.font[n]={};L.size=(o.isTypedArray(p)?p[n]:s(p)?r(p[n])?p[n]:0:p)*b,L.family=Array.isArray(d)?d[n]:d,L.weight=x(s(f)?f[n]:f),L.style=Array.isArray(m)?m[n]:m,L.variant=Array.isArray(g)?g[n]:g}else v.font={size:p*b,family:d,weight:x(f),style:m,variant:g};return v}function x(e){return e<=1e3?e>500?"bold":"normal":e}function b(e,t){var r,n,a=t._length,o=t.marker,l={},c=s(o.symbol),h=s(o.angle),f=s(o.color),m=s(o.line.color),g=s(o.opacity),y=s(o.size),v=s(o.line.width);if(c||(n=d.isOpenSymbol(o.symbol)),c||f||m||g||h){l.symbols=new Array(a),l.angles=new Array(a),l.colors=new Array(a),l.borderColors=new Array(a);var x=o.symbol,b=o.angle,_=u(o,o.opacity,a),w=u(o.line,o.opacity,a);if(!s(w[0])){var k=w;for(w=Array(a),r=0;r<a;r++)w[r]=k}if(!s(_[0])){var T=_;for(_=Array(a),r=0;r<a;r++)_[r]=T}if(!s(x)){var S=x;for(x=Array(a),r=0;r<a;r++)x[r]=S}if(!s(b)){var A=b;for(b=Array(a),r=0;r<a;r++)b[r]=A}for(l.symbols=x,l.angles=b,l.colors=_,l.borderColors=w,r=0;r<a;r++)c&&(n=d.isOpenSymbol(o.symbol[r])),n&&(w[r]=_[r].slice(),_[r]=_[r].slice(),_[r][3]=0);for(l.opacity=t.opacity,l.markers=new Array(a),r=0;r<a;r++)l.markers[r]=P({mx:l.symbols[r],ma:l.angles[r]},t)}else n?(l.color=i(o.color,"uint8"),l.color[3]=0,l.borderColor=i(o.color,"uint8")):(l.color=i(o.color,"uint8"),l.borderColor=i(o.line.color,"uint8")),l.opacity=t.opacity*o.opacity,l.marker=P({mx:o.symbol,ma:o.angle},t);var M,E=p(t,1);if(y||v){var C,L=l.sizes=new Array(a),I=l.borderSizes=new Array(a),z=0;if(y){for(r=0;r<a;r++)L[r]=E(o.size[r]),z+=L[r];C=z/a}else for(M=E(o.size),r=0;r<a;r++)L[r]=M;if(v)for(r=0;r<a;r++)I[r]=o.line.width[r];else for(M=o.line.width,r=0;r<a;r++)I[r]=M;l.sizeAvg=C}else l.size=E(o&&o.size||10),l.borderSizes=E(o.line.width);return l}function _(e,t,r){var n=t.marker,i={};return r?(r.marker&&r.marker.symbol?i=b(0,o.extendFlat({},n,r.marker)):r.marker&&(r.marker.size&&(i.size=r.marker.size),r.marker.color&&(i.colors=r.marker.color),void 0!==r.marker.opacity&&(i.opacity=r.marker.opacity)),i):i}function w(e,t,r){var n={};if(!r)return n;if(r.textfont){var i={opacity:1,text:t.text,texttemplate:t.texttemplate,textposition:t.textposition,textfont:o.extendFlat({},t.textfont)};r.textfont&&o.extendFlat(i.textfont,r.textfont),n=v(e,i)}return n}function T(e,t,r){var n={capSize:2*t.width*r,lineWidth:t.thickness*r,color:t.color};return t.copy_ystyle&&(n=e.error_y),n}var S=f.SYMBOL_SDF_SIZE,A=f.SYMBOL_SIZE,M=f.SYMBOL_STROKE,E={},C=l.symbolFuncs[0](.05*A);function P(e,t){var r,i,a=e.mx;if("circle"===a)return null;var o=l.symbolNumber(a),s=l.symbolFuncs[o%100],c=!!l.symbolNoDot[o%100],u=!!l.symbolNoFill[o%100],h=d.isDotSymbol(a);if(e.ma&&(a+="_"+e.ma),E[a])return E[a];var p=l.getMarkerAngle(e,t);return r=h&&!c?s(1.1*A,p)+C:s(A,p),i=n(r,{w:S,h:S,viewBox:[-A,-A,A,A],stroke:u?M:-M}),E[a]=i,i||null}t.exports={style:function(e,t){var r,n={marker:void 0,markerSel:void 0,markerUnsel:void 0,line:void 0,fill:void 0,errorX:void 0,errorY:void 0,text:void 0,textSel:void 0,textUnsel:void 0},i=e._context.plotGlPixelRatio;if(!0!==t.visible)return n;if(h.hasText(t)&&(n.text=v(e,t),n.textSel=w(e,t,t.selected),n.textUnsel=w(e,t,t.unselected)),h.hasMarkers(t)&&(n.marker=b(0,t),n.markerSel=_(0,t,t.selected),n.markerUnsel=_(0,t,t.unselected),!t.unselected&&s(t.marker.opacity))){var a=t.marker.opacity;for(n.markerUnsel.opacity=new Array(a.length),r=0;r<a.length;r++)n.markerUnsel.opacity[r]=m*a[r]}if(h.hasLines(t)){n.line={overlay:!0,thickness:t.line.width*i,color:t.line.color,opacity:t.opacity};var o=(f.DASHES[t.line.dash]||[1]).slice();for(r=0;r<o.length;++r)o[r]*=t.line.width*i;n.line.dashes=o}return t.error_x&&t.error_x.visible&&(n.errorX=T(t,t.error_x,i)),t.error_y&&t.error_y.visible&&(n.errorY=T(t,t.error_y,i)),t.fill&&"none"!==t.fill&&(n.fill={closed:!0,fill:t.fillcolor,thickness:0}),n},markerStyle:b,markerSelection:_,linePositions:function(e,t,r){var n,i,a=r.length,o=a/2;if(h.hasLines(t)&&o)if("hv"===t.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i+2],r[2*i+1]));n.push(r[a-2],r[a-1])}else if("hvh"===t.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var s=(r[2*i]+r[2*i+2])/2;n.push(r[2*i],r[2*i+1],s,r[2*i+1],s,r[2*i+3])}n.push(r[a-2],r[a-1])}else if("vhv"===t.line.shape){for(n=[],i=0;i<o-1;i++)if(isNaN(r[2*i])||isNaN(r[2*i+1])||isNaN(r[2*i+2])||isNaN(r[2*i+3]))isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+1]),n.push(NaN,NaN);else{var l=(r[2*i+1]+r[2*i+3])/2;n.push(r[2*i],r[2*i+1],r[2*i],l,r[2*i+2],l)}n.push(r[a-2],r[a-1])}else if("vh"===t.line.shape){for(n=[],i=0;i<o-1;i++)isNaN(r[2*i])||isNaN(r[2*i+1])?n.push(NaN,NaN,NaN,NaN):(n.push(r[2*i],r[2*i+1]),isNaN(r[2*i+2])||isNaN(r[2*i+3])?n.push(NaN,NaN):n.push(r[2*i],r[2*i+3]));n.push(r[a-2],r[a-1])}else n=r;var c=!1;for(i=0;i<n.length;i++)if(isNaN(n[i])){c=!0;break}var u=c||n.length>f.TOO_MANY_POINTS||h.hasMarkers(t)?"rect":"round";if(c&&t.connectgaps){var p=n[0],d=n[1];for(i=0;i<n.length;i+=2)isNaN(n[i])||isNaN(n[i+1])?(n[i]=p,n[i+1]=d):(p=n[i],d=n[i+1])}return{join:u,positions:n}},errorBarPositions:function(e,t,n,i,o){var s=a.getComponentMethod("errorbars","makeComputeError"),l=c.getFromId(e,t.xaxis,"x"),u=c.getFromId(e,t.yaxis,"y"),h=n.length/2,p={};function d(e,i){var a=i._id.charAt(0),o=t["error_"+a];if(o&&o.visible&&("linear"===i.type||"log"===i.type)){for(var l=s(o),c={x:0,y:1}[a],u={x:[0,1,2,3],y:[2,3,0,1]}[a],d=new Float64Array(4*h),f=1/0,m=-1/0,g=0,y=0;g<h;g++,y+=4){var v=e[g];if(r(v)){var x=n[2*g+c],b=l(v,g),_=b[0],w=b[1];if(r(_)&&r(w)){var k=v-_,T=v+w;d[y+u[0]]=x-i.c2l(k),d[y+u[1]]=i.c2l(T)-x,d[y+u[2]]=0,d[y+u[3]]=0,f=Math.min(f,v-_),m=Math.max(m,v+w)}}}p[a]={positions:n,errors:d,_bnds:[f,m]}}}return d(i,l),d(o,u),p},textPosition:function(e,t,r,n){var i,a=t._length,o={};if(h.hasMarkers(t)){var l=r.font,c=r.align,u=r.baseline;for(o.offset=new Array(a),i=0;i<a;i++){var p=n.sizes?n.sizes[i]:n.size,d=s(l)?l[i].size:l.size,f=s(c)?c.length>1?c[i]:c[0]:c,m=s(u)?u.length>1?u[i]:u[0]:u,y=g[f],v=g[m],x=p?p/.8+1:0,b=-v*x-.5*v;o.offset[i]=[y*x/d,b/d]}}return o}}}}),iy=p({"src/traces/scattergl/scene_update.js"(e,t){var r=st();t.exports=function(e,t){var n=t._scene,i={count:0,dirty:!0,lineOptions:[],fillOptions:[],markerOptions:[],markerSelectedOptions:[],markerUnselectedOptions:[],errorXOptions:[],errorYOptions:[],textOptions:[],textSelectedOptions:[],textUnselectedOptions:[],selectBatch:[],unselectBatch:[]},a={fill2d:!1,scatter2d:!1,error2d:!1,line2d:!1,glText:!1,select2d:!1};return t._scene||((n=t._scene={}).init=function(){r.extendFlat(n,a,i)},n.init(),n.update=function(e){var t=r.repeat(e,n.count);if(n.fill2d&&n.fill2d.update(t),n.scatter2d&&n.scatter2d.update(t),n.line2d&&n.line2d.update(t),n.error2d&&n.error2d.update(t.concat(t)),n.select2d&&n.select2d.update(t),n.glText)for(var i=0;i<n.count;i++)n.glText[i].update(e)},n.draw=function(){for(var e=n.count,t=n.fill2d,i=n.error2d,a=n.line2d,o=n.scatter2d,s=n.glText,l=n.select2d,c=n.selectBatch,u=n.unselectBatch,h=0;h<e;h++){if(t&&n.fillOrder[h]&&t.draw(n.fillOrder[h]),a&&n.lineOptions[h]&&a.draw(h),i&&(n.errorXOptions[h]&&i.draw(h),n.errorYOptions[h]&&i.draw(h+e)),o&&n.markerOptions[h])if(u[h].length){var p=r.repeat([],n.count);p[h]=u[h],o.draw(p)}else c[h].length||o.draw(h);s[h]&&n.textOptions[h]&&s[h].render()}l&&l.draw(c),n.dirty=!1},n.destroy=function(){n.fill2d&&n.fill2d.destroy&&n.fill2d.destroy(),n.scatter2d&&n.scatter2d.destroy&&n.scatter2d.destroy(),n.error2d&&n.error2d.destroy&&n.error2d.destroy(),n.line2d&&n.line2d.destroy&&n.line2d.destroy(),n.select2d&&n.select2d.destroy&&n.select2d.destroy(),n.glText&&n.glText.forEach((function(e){e.destroy&&e.destroy()})),n.lineOptions=null,n.fillOptions=null,n.markerOptions=null,n.markerSelectedOptions=null,n.markerUnselectedOptions=null,n.errorXOptions=null,n.errorYOptions=null,n.textOptions=null,n.textSelectedOptions=null,n.textUnselectedOptions=null,n.selectBatch=null,n.unselectBatch=null,t._scene=null}),n.dirty||r.extendFlat(n,i),n}}}),ay=p({"src/traces/scattergl/calc.js"(e,t){var r=$g(),n=st(),i=vt(),a=rr().findExtremes,o=ti(),s=ai(),l=s.calcMarkerSize,c=s.calcAxisExpansion,u=s.setFirstScatter,h=ri(),p=ny(),d=iy(),f=T().BADNUM,m=zg().TOO_MANY_POINTS;function g(e,t,r){var n=e._extremes[t._id],i=a(t,r._bnds,{padded:!0});n.min=n.min.concat(i.min),n.max=n.max.concat(i.max)}t.exports=function(e,t){var a,s=e._fullLayout,y=t._xA=i.getFromId(e,t.xaxis,"x"),v=t._yA=i.getFromId(e,t.yaxis,"y"),x=s._plots[t.xaxis+t.yaxis],b=t._length,_=b>=m,w=2*b,k={},T=y.makeCalcdata(t,"x"),S=v.makeCalcdata(t,"y"),A=o(t,y,"x",T),M=o(t,v,"y",S),E=A.vals,C=M.vals;t._x=E,t._y=C,t.xperiodalignment&&(t._origX=T,t._xStarts=A.starts,t._xEnds=A.ends),t.yperiodalignment&&(t._origY=S,t._yStarts=M.starts,t._yEnds=M.ends);var P=new Array(w),L=new Array(b);for(a=0;a<b;a++)P[2*a]=E[a]===f?NaN:E[a],P[2*a+1]=C[a]===f?NaN:C[a],L[a]=a;if("log"===y.type)for(a=0;a<w;a+=2)P[a]=y.c2l(P[a]);if("log"===v.type)for(a=1;a<w;a+=2)P[a]=v.c2l(P[a]);_&&"log"!==y.type&&"log"!==v.type?k.tree=r(P):k.ids=L,h(e,t);var I,z=function(e,t,r,i,a,o){var s=p.style(e,r);if(s.marker&&(s.marker.positions=i),s.line&&i.length>1&&n.extendFlat(s.line,p.linePositions(e,r,i)),s.errorX||s.errorY){var l=p.errorBarPositions(e,r,i,a,o);s.errorX&&n.extendFlat(s.errorX,l.x),s.errorY&&n.extendFlat(s.errorY,l.y)}return s.text&&(n.extendFlat(s.text,{positions:i},p.textPosition(e,r,s.text,s.marker)),n.extendFlat(s.textSel,{positions:i},p.textPosition(e,r,s.text,s.markerSel)),n.extendFlat(s.textUnsel,{positions:i},p.textPosition(e,r,s.text,s.markerUnsel))),s}(e,0,t,P,E,C),O=d(e,x);return u(s,t),_?z.marker&&(I=z.marker.sizeAvg||Math.max(z.marker.size,3)):I=l(t,b),c(e,t,y,v,E,C,I),z.errorX&&g(t,y,z.errorX),z.errorY&&g(t,v,z.errorY),z.fill&&!O.fill2d&&(O.fill2d=!0),z.marker&&!O.scatter2d&&(O.scatter2d=!0),z.line&&!O.line2d&&(O.line2d=!0),!z.errorX&&!z.errorY||O.error2d||(O.error2d=!0),z.text&&!O.glText&&(O.glText=!0),z.marker&&(z.marker.snap=b),O.lineOptions.push(z.line),O.errorXOptions.push(z.errorX),O.errorYOptions.push(z.errorY),O.fillOptions.push(z.fill),O.markerOptions.push(z.marker),O.markerSelectedOptions.push(z.markerSel),O.markerUnselectedOptions.push(z.markerUnsel),O.textOptions.push(z.text),O.textSelectedOptions.push(z.textSel),O.textUnselectedOptions.push(z.textUnsel),O.selectBatch.push([]),O.unselectBatch.push([]),k._scene=O,k.index=O.count,k.x=E,k.y=C,k.positions=P,O.count++,[{x:!1,y:!1,t:k,trace:t}]}}}),oy=p({"src/traces/scattergl/edit_style.js"(e,t){var r=st(),n=q(),i=H().DESELECTDIM;t.exports={styleTextSelection:function(e){var t,a,o=e[0],s=o.trace,l=o.t,c=l._scene,u=l.index,h=c.selectBatch[u],p=c.unselectBatch[u],d=c.textOptions[u],f=c.textSelectedOptions[u]||{},m=c.textUnselectedOptions[u]||{},g=r.extendFlat({},d);if(h.length||p.length){var y=f.color,v=m.color,x=d.color,b=r.isArrayOrTypedArray(x);for(g.color=new Array(s._length),t=0;t<h.length;t++)a=h[t],g.color[a]=y||(b?x[a]:x);for(t=0;t<p.length;t++){a=p[t];var _=b?x[a]:x;g.color[a]=v||(y?_:n.addOpacity(_,i))}}c.glText[u].update(g)}}}}),sy=p({"src/traces/scattergl/select.js"(e,t){var r=$t(),n=oy().styleTextSelection;t.exports=function(e,t){var i=e.cd,a=e.xaxis,o=e.yaxis,s=[],l=i[0].trace,c=i[0].t,u=l._length,h=c.x,p=c.y,d=c._scene,f=c.index;if(!d)return s;var m=r.hasText(l),g=r.hasMarkers(l),y=!g&&!m;if(!0!==l.visible||y)return s;var v=[],x=[];if(!1!==t&&!t.degenerate)for(var b=0;b<u;b++)t.contains([c.xpx[b],c.ypx[b]],!1,b,e)?(v.push(b),s.push({pointNumber:b,x:a.c2d(h[b]),y:o.c2d(p[b])})):x.push(b);if(g){var _=d.scatter2d;if(v.length||x.length){if(!d.selectBatch[f].length&&!d.unselectBatch[f].length){var w=new Array(d.count);w[f]=d.markerUnselectedOptions[f],_.update.apply(_,w)}}else{var k=new Array(d.count);k[f]=d.markerOptions[f],_.update.apply(_,k)}}return d.selectBatch[f]=v,d.unselectBatch[f]=x,m&&n(i),s}}}),ly=p({"src/traces/scattergl/base_index.js"(e,t){var r=Ig();t.exports={moduleType:"trace",name:"scattergl",basePlotModule:Ai(),categories:["gl","regl","cartesian","symbols","errorBarsOK","showLegend","scatter-like"],attributes:Og(),supplyDefaults:Dg(),crossTraceDefaults:Qn(),colorbar:pi(),formatLabels:jg(),calc:ay(),hoverPoints:r.hoverPoints,selectPoints:sy(),meta:{}}}}),cy=p({"node_modules/color-id/index.js"(e,t){var r=jf();function n(e,t){null==t&&(t=!0);var n=e[0],i=e[1],a=e[2],o=e[3];return null==o&&(o=t?1:255),t&&(n*=255,i*=255,a*=255,o*=255),16777216*(n=255&r(n,0,255))+((i=255&r(i,0,255))<<16)+((a=255&r(a,0,255))<<8)+(o=255&r(o,0,255))}t.exports=n,t.exports.to=n,t.exports.from=function(e,t){var r=(e=+e)>>>24,n=(16711680&e)>>>16,i=(65280&e)>>>8,a=255&e;return!1===t?[r,n,i,a]:[r/255,n/255,i/255,a/255]}}}),uy=p({"node_modules/object-assign/index.js"(e,t){var r=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(i){return!1}}()?Object.assign:function(e,t){for(var a,o,s=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l<arguments.length;l++){for(var c in a=Object(arguments[l]))n.call(a,c)&&(s[c]=a[c]);if(r){o=r(a);for(var u=0;u<o.length;u++)i.call(a,o[u])&&(s[o[u]]=a[o[u]])}}return s}}}),hy=p({"node_modules/glslify/browser.js"(e,t){t.exports=function(e){"string"===typeof e&&(e=[e]);for(var t=[].slice.call(arguments,1),r=[],n=0;n<e.length-1;n++)r.push(e[n],t[n]||"");return r.push(e[n]),r.join("")}}}),py=p({"node_modules/update-diff/index.js"(e,t){t.exports=function(e,t,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n<i;n++){var a=r[n];for(var o in a)if((void 0===t[o]||Array.isArray(t[o])||e[o]!==t[o])&&o in t){var s;if(!0===a[o])s=t[o];else{if(!1===a[o])continue;if("function"===typeof a[o]&&void 0===(s=a[o](t[o],e,t)))continue}e[o]=s}}return e}}}),dy=p({"node_modules/is-iexplorer/index.js"(e,t){t.exports="undefined"!==typeof navigator&&(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion))}}),fy=p({"node_modules/to-float32/index.js"(e,t){t.exports=n,t.exports.float32=t.exports.float=n,t.exports.fract32=t.exports.fract=function(e,t){if(e.length){if(e instanceof Float32Array)return new Float32Array(e.length);t instanceof Float32Array||(t=n(e));for(var r=0,i=t.length;r<i;r++)t[r]=e[r]-t[r];return t}return n(e-n(e))};var r=new Float32Array(1);function n(e){return e.length?e instanceof Float32Array?e:new Float32Array(e):(r[0]=e,r[0])}}}),my=p({"node_modules/regl-scatter2d/bundle.js"(e,t){function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"===typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var o=Bf(),s=Ug(),l=cy(),c=$g(),u=uy(),h=hy(),p=Bg(),d=py(),f=qg(),m=dy(),g=fy(),y=Ng(),v=x;function x(e,t){var r=this;if(!(this instanceof x))return new x(e,t);"function"===typeof e?(t||(t={}),t.regl=e):(t=e,e=null),t&&t.length&&(t.positions=t);var n,i=(e=t.regl)._gl,a=[],o=255;this.tooManyColors=m,n=e.texture({data:new Uint8Array(1020),width:o,height:1,type:"uint8",format:"rgba",wrapS:"clamp",wrapT:"clamp",mag:"nearest",min:"nearest"}),u(this,{regl:e,gl:i,groups:[],markerCache:[null],markerTextures:[null],palette:a,paletteIds:{},paletteTexture:n,maxColors:o,maxSize:100,canvas:i.canvas}),this.update(t);var s={uniforms:{constPointSize:!!t.constPointSize,opacity:e.prop("opacity"),paletteSize:function(e,t){return[r.tooManyColors?0:o,n.height]},pixelRatio:e.context("pixelRatio"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translate:e.prop("translate"),translateFract:e.prop("translateFract"),markerTexture:e.prop("markerTexture"),paletteTexture:n},attributes:{x:function(e,t){return t.xAttr||{buffer:t.positionBuffer,stride:8,offset:0}},y:function(e,t){return t.yAttr||{buffer:t.positionBuffer,stride:8,offset:4}},xFract:function(e,t){return t.xAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:0}},yFract:function(e,t){return t.yAttr?{constant:[0,0]}:{buffer:t.positionFractBuffer,stride:8,offset:4}},size:function(e,t){return t.size.length?{buffer:t.sizeBuffer,stride:2,offset:0}:{constant:[Math.round(255*t.size/r.maxSize)]}},borderSize:function(e,t){return t.borderSize.length?{buffer:t.sizeBuffer,stride:2,offset:1}:{constant:[Math.round(255*t.borderSize/r.maxSize)]}},colorId:function(e,t){return t.color.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:0}:{constant:r.tooManyColors?a.slice(4*t.color,4*t.color+4):[t.color]}},borderColorId:function(e,t){return t.borderColor.length?{buffer:t.colorBuffer,stride:r.tooManyColors?8:4,offset:r.tooManyColors?4:2}:{constant:r.tooManyColors?a.slice(4*t.borderColor,4*t.borderColor+4):[t.borderColor]}},isActive:function(e,t){return!0===t.activation?{constant:[1]}:t.activation?t.activation:{constant:[0]}}},blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:{enable:!1},depth:{enable:!1},elements:e.prop("elements"),count:e.prop("count"),offset:e.prop("offset"),primitive:"points"},l=u({},s);l.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\nuniform sampler2D markerTexture;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(markerTexture, gl_PointCoord).r, delta = fragWidth;\n\n // max-distance alpha\n if (dist < 0.003) discard;\n\n // null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a * opacity);\n }\n else {\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n }\n\n}\n"]),l.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 scale, scaleFract, translate, translateFract, paletteSize;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius, fragWidth, fragBorderColorLevel, fragColorLevel;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pointSizeScale;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),this.drawMarker=e(l);var c=u({},s);c.frag=h(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nuniform float opacity;\n\nfloat smoothStep(float edge0, float edge1, float x) {\n\tfloat t;\n\tt = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\n\treturn t * t * (3.0 - 2.0 * t);\n}\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif (radius > 1.0 + delta) {\n\t\tdiscard;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),c.vert=h(["precision highp float;\n#define GLSLIFY 1\n\nattribute float x, y, xFract, yFract;\nattribute float size, borderSize;\nattribute vec4 colorId, borderColorId;\nattribute float isActive;\n\n// `invariant` effectively turns off optimizations for the position.\n// We need this because -fast-math on M1 Macs is re-ordering\n// floating point operations in a way that causes floating point\n// precision limits to put points in the wrong locations.\ninvariant gl_Position;\n\nuniform bool constPointSize;\nuniform float pixelRatio;\nuniform vec2 paletteSize, scale, scaleFract, translate, translateFract;\nuniform sampler2D paletteTexture;\n\nconst float maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nfloat pointSizeScale = (constPointSize) ? 2. : pixelRatio;\n\nbool isDirect = (paletteSize.x < 1.);\n\nvec4 getColor(vec4 id) {\n return isDirect ? id / 255. : texture2D(paletteTexture,\n vec2(\n (id.x + .5) / paletteSize.x,\n (id.y + .5) / paletteSize.y\n )\n );\n}\n\nvoid main() {\n // ignore inactive points\n if (isActive == 0.) return;\n\n vec2 position = vec2(x, y);\n vec2 positionFract = vec2(xFract, yFract);\n\n vec4 color = getColor(colorId);\n vec4 borderColor = getColor(borderColorId);\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pointSizeScale;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0., 1.);\n\n fragBorderRadius = 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor.a == 0. || borderSize == 0. ? vec4(color.rgb, 0.) : borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),m&&(c.frag=c.frag.replace("smoothstep","smoothStep"),l.frag=l.frag.replace("smoothstep","smoothStep")),this.drawCircle=e(c)}x.defaults={color:"black",borderColor:"transparent",borderSize:0,size:12,opacity:1,marker:void 0,viewport:null,range:null,pixelSize:null,count:0,offset:0,bounds:null,positions:[],snap:1e4},x.prototype.render=function(){return arguments.length&&this.update.apply(this,arguments),this.draw(),this},x.prototype.draw=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=this.groups;if(1===r.length&&Array.isArray(r[0])&&(null===r[0][0]||Array.isArray(r[0][0]))&&(r=r[0]),this.regl._refresh(),r.length)for(var a=0;a<r.length;a++)this.drawItem(a,r[a]);else i.forEach((function(t,r){e.drawItem(r)}));return this},x.prototype.drawItem=function(e,t){var r=this.groups,i=r[e];if("number"===typeof t&&(e=t,i=r[t],t=null),i&&i.count&&i.opacity){i.activation[0]&&this.drawCircle(this.getMarkerDrawOptions(0,i,t));for(var a=[],o=1;o<i.activation.length;o++)i.activation[o]&&(!0===i.activation[o]||i.activation[o].data.length)&&a.push.apply(a,n(this.getMarkerDrawOptions(o,i,t)));a.length&&this.drawMarker(a)}},x.prototype.getMarkerDrawOptions=function(e,t,n){var i=t.range,a=t.tree,o=t.viewport,s=t.activation,l=t.selectionBuffer,c=t.count;if(this.regl,!a)return n?[u({},t,{markerTexture:this.markerTextures[e],activation:s[e],count:n.length,elements:n,offset:0})]:[u({},t,{markerTexture:this.markerTextures[e],activation:s[e],offset:0})];var h=[],p=a.range(i,{lod:!0,px:[(i[2]-i[0])/o.width,(i[3]-i[1])/o.height]});if(n){for(var d=s[e].data,f=new Uint8Array(c),m=0;m<n.length;m++){var g=n[m];f[g]=d?d[g]:1}l.subdata(f)}for(var y=p.length;y--;){var v=r(p[y],2),x=v[0],b=v[1];h.push(u({},t,{markerTexture:this.markerTextures[e],activation:n?l:s[e],offset:x,count:b-x}))}return h},x.prototype.update=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length){1===r.length&&Array.isArray(r[0])&&(r=r[0]);var i=this.groups,a=this.gl,o=this.regl,l=this.maxSize,h=this.maxColors,m=this.palette;this.groups=i=r.map((function(t,r){var n=i[r];if(void 0===t)return n;null===t?t={positions:null}:"function"===typeof t?t={ondraw:t}:"number"===typeof t[0]&&(t={positions:t}),null===(t=p(t,{positions:"positions data points",snap:"snap cluster lod tree",size:"sizes size radius",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range dataBox databox",viewport:"viewport viewPort viewBox viewbox",opacity:"opacity alpha transparency",bounds:"bound bounds boundaries limits",tooManyColors:"tooManyColors palette paletteMode optimizePalette enablePalette"})).positions&&(t.positions=[]),null!=t.tooManyColors&&(e.tooManyColors=t.tooManyColors),n||(i[r]=n={id:r,scale:null,translate:null,scaleFract:null,translateFract:null,activation:[],selectionBuffer:o.buffer({data:new Uint8Array(0),usage:"stream",type:"uint8"}),sizeBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),colorBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"uint8"}),positionBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"}),positionFractBuffer:o.buffer({data:new Uint8Array(0),usage:"dynamic",type:"float"})},t=u({},x.defaults,t)),t.positions&&!("marker"in t)&&(t.marker=n.marker,delete n.marker),t.marker&&!("positions"in t)&&(t.positions=n.positions,delete n.positions);var v=0,b=0;if(d(n,t,[{snap:!0,size:function(e,t){return null==e&&(e=x.defaults.size),v+=e&&e.length?1:0,e},borderSize:function(e,t){return null==e&&(e=x.defaults.borderSize),v+=e&&e.length?1:0,e},opacity:parseFloat,color:function(t,r){return null==t&&(t=x.defaults.color),t=e.updateColor(t),b++,t},borderColor:function(t,r){return null==t&&(t=x.defaults.borderColor),t=e.updateColor(t),b++,t},bounds:function(e,t,r){return"range"in r||(r.range=null),e},positions:function(e,t,r){var n=t.snap,i=t.positionBuffer,a=t.positionFractBuffer,l=t.selectionBuffer;if(e.x||e.y)return e.x.length?t.xAttr={buffer:o.buffer(e.x),offset:0,stride:4,count:e.x.length}:t.xAttr={buffer:e.x.buffer,offset:4*e.x.offset||0,stride:4*(e.x.stride||1),count:e.x.count},e.y.length?t.yAttr={buffer:o.buffer(e.y),offset:0,stride:4,count:e.y.length}:t.yAttr={buffer:e.y.buffer,offset:4*e.y.offset||0,stride:4*(e.y.stride||1),count:e.y.count},t.count=Math.max(t.xAttr.count,t.yAttr.count),e;e=f(e,"float64");var u=t.count=Math.floor(e.length/2),h=t.bounds=u?s(e,2):null;if(r.range||t.range||(delete t.range,r.range=h),r.marker||t.marker||(delete t.marker,r.marker=null),n&&(!0===n||u>n)?t.tree=c(e,{bounds:h}):n&&n.length&&(t.tree=n),t.tree){var p={primitive:"points",usage:"static",data:t.tree,type:"uint32"};t.elements?t.elements(p):t.elements=o.elements(p)}var d=g.float32(e);return i({data:d,usage:"dynamic"}),a({data:g.fract32(e,d),usage:"dynamic"}),l({data:new Uint8Array(u),type:"uint8",usage:"stream"}),e}},{marker:function(t,r,n){var i=r.activation;if(i.forEach((function(e){return e&&e.destroy&&e.destroy()})),i.length=0,t&&"number"!==typeof t[0]){for(var a=[],s=0,l=Math.min(t.length,r.count);s<l;s++){var c=e.addMarker(t[s]);a[c]||(a[c]=new Uint8Array(r.count)),a[c][s]=1}for(var u=0;u<a.length;u++)if(a[u]){var h={data:a[u],type:"uint8",usage:"static"};i[u]?i[u](h):i[u]=o.buffer(h),i[u].data=a[u]}}else i[e.addMarker(t)]=!0;return t},range:function(e,t,r){var n=t.bounds;if(n)return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=g.fract(t.scale),t.translateFract=g.fract(t.translate),e},viewport:function(e){return y(e||[a.drawingBufferWidth,a.drawingBufferHeight])}}]),v){var _=n,w=_.count,k=_.size,T=_.borderSize,S=_.sizeBuffer,A=new Uint8Array(2*w);if(k.length||T.length)for(var M=0;M<w;M++)A[2*M]=Math.round(255*(null==k[M]?k:k[M])/l),A[2*M+1]=Math.round(255*(null==T[M]?T:T[M])/l);S({data:A,usage:"dynamic"})}if(b){var E,C=n,P=C.count,L=C.color,I=C.borderColor,z=C.colorBuffer;if(e.tooManyColors){if(L.length||I.length){E=new Uint8Array(8*P);for(var O=0;O<P;O++){var R=L[O];E[8*O]=m[4*R],E[8*O+1]=m[4*R+1],E[8*O+2]=m[4*R+2],E[8*O+3]=m[4*R+3];var D=I[O];E[8*O+4]=m[4*D],E[8*O+5]=m[4*D+1],E[8*O+6]=m[4*D+2],E[8*O+7]=m[4*D+3]}}}else if(L.length||I.length){E=new Uint8Array(4*P+2);for(var j=0;j<P;j++)null!=L[j]&&(E[4*j]=L[j]%h,E[4*j+1]=Math.floor(L[j]/h)),null!=I[j]&&(E[4*j+2]=I[j]%h,E[4*j+3]=Math.floor(I[j]/h))}z({data:E||new Uint8Array(0),type:"uint8",usage:"dynamic"})}return n}))}},x.prototype.addMarker=function(e){var t,r=this.markerTextures,n=this.regl,i=this.markerCache,a=null==e?0:i.indexOf(e);if(a>=0)return a;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)t=e;else{t=new Uint8Array(e.length);for(var o=0,s=e.length;o<s;o++)t[o]=255*e[o]}var l=Math.floor(Math.sqrt(t.length));return a=r.length,i.push(e),r.push(n.texture({channels:1,data:t,radius:l,mag:"linear",min:"linear"})),a},x.prototype.updateColor=function(e){var t=this.paletteIds,r=this.palette,n=this.maxColors;Array.isArray(e)||(e=[e]);var i=[];if("number"===typeof e[0]){var a=[];if(Array.isArray(e))for(var s=0;s<e.length;s+=4)a.push(e.slice(s,s+4));else for(var c=0;c<e.length;c+=4)a.push(e.subarray(c,c+4));e=a}for(var u=0;u<e.length;u++){var h=e[u];h=o(h,"uint8");var p=l(h,!1);if(null==t[p]){var d=r.length;t[p]=Math.floor(d/4),r[d]=h[0],r[d+1]=h[1],r[d+2]=h[2],r[d+3]=h[3]}i[u]=t[p]}return!this.tooManyColors&&r.length>4*n&&(this.tooManyColors=!0),this.updatePalette(r),1===i.length?i[0]:i},x.prototype.updatePalette=function(e){if(!this.tooManyColors){var t=this.maxColors,r=this.paletteTexture,n=Math.ceil(.25*e.length/t);if(n>1)for(var i=.25*(e=e.slice()).length%t;i<n*t;i++)e.push(0,0,0,0);r.height<n&&r.resize(t,n),r.subimage({width:Math.min(.25*e.length,t),height:n,data:e},0,0)}},x.prototype.destroy=function(){return this.groups.forEach((function(e){e.sizeBuffer.destroy(),e.positionBuffer.destroy(),e.positionFractBuffer.destroy(),e.colorBuffer.destroy(),e.activation.forEach((function(e){return e&&e.destroy&&e.destroy()})),e.selectionBuffer.destroy(),e.elements&&e.elements.destroy()})),this.groups.length=0,this.paletteTexture.destroy(),this.markerTextures.forEach((function(e){return e&&e.destroy&&e.destroy()})),this};var b=uy();t.exports=function(e,t){var r=new v(e,t),n=r.render.bind(r);return b(n,{render:n,update:r.update.bind(r),draw:r.draw.bind(r),destroy:r.destroy.bind(r),regl:r.regl,gl:r.gl,canvas:r.gl.canvas,groups:r.groups,markers:r.markerCache,palette:r.palette}),n}}}),gy=p({"node_modules/earcut/src/earcut.js"(e,t){function r(e,t,r){r=r||2;var i,o,s,l,c,p,d,m=t&&t.length,g=m?t[0]*r:e.length,y=n(e,0,g,r,!0),v=[];if(!y||y.next===y.prev)return v;if(m&&(y=function(e,t,r,i){var a,o,s,l=[];for(a=0,o=t.length;a<o;a++)(s=n(e,t[a]*i,a<o-1?t[a+1]*i:e.length,i,!1))===s.next&&(s.steiner=!0),l.push(f(s));for(l.sort(u),a=0;a<l.length;a++)r=h(l[a],r);return r}(e,t,y,r)),e.length>80*r){i=s=e[0],o=l=e[1];for(var x=r;x<g;x+=r)(c=e[x])<i&&(i=c),(p=e[x+1])<o&&(o=p),c>s&&(s=c),p>l&&(l=p);d=0!==(d=Math.max(s-i,l-o))?32767/d:0}return a(y,v,r,i,o,d,0),v}function n(e,t,r,n,i){var a,o;if(i===M(e,t,r,n)>0)for(a=t;a<r;a+=n)o=T(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=T(a,e[a],e[a+1],o);return o&&v(o,o.next)&&(S(o),o=o.next),o}function i(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!v(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(S(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function a(e,t,r,n,u,h,p){if(e){!p&&h&&function(e,t,r,n){var i=e;do{0===i.z&&(i.z=d(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,u,h);for(var f,m,g=e;e.prev!==e.next;)if(f=e.prev,m=e.next,h?s(e,n,u,h):o(e))t.push(f.i/r|0),t.push(e.i/r|0),t.push(m.i/r|0),S(e),e=m.next,g=m.next;else if((e=m)===g){p?1===p?a(e=l(i(e),t,r),t,r,n,u,h,2):2===p&&c(e,t,r,n,u,h):a(i(e),t,r,n,u,h,1);break}}}function o(e){var t=e.prev,r=e,n=e.next;if(y(t,r,n)>=0)return!1;for(var i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,p=i>a?i>o?i:o:a>o?a:o,d=s>l?s>c?s:c:l>c?l:c,f=n.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&m(i,s,a,l,o,c,f.x,f.y)&&y(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function s(e,t,r,n){var i=e.prev,a=e,o=e.next;if(y(i,a,o)>=0)return!1;for(var s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,f=s<l?s<c?s:c:l<c?l:c,g=u<h?u<p?u:p:h<p?h:p,v=s>l?s>c?s:c:l>c?l:c,x=u>h?u>p?u:p:h>p?h:p,b=d(f,g,t,r,n),_=d(v,x,t,r,n),w=e.prevZ,k=e.nextZ;w&&w.z>=b&&k&&k.z<=_;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,p,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}for(;w&&w.z>=b;){if(w.x>=f&&w.x<=v&&w.y>=g&&w.y<=x&&w!==i&&w!==o&&m(s,u,l,h,c,p,w.x,w.y)&&y(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;k&&k.z<=_;){if(k.x>=f&&k.x<=v&&k.y>=g&&k.y<=x&&k!==i&&k!==o&&m(s,u,l,h,c,p,k.x,k.y)&&y(k.prev,k,k.next)>=0)return!1;k=k.nextZ}return!0}function l(e,t,r){var n=e;do{var a=n.prev,o=n.next.next;!v(a,o)&&x(a,n,n.next,o)&&w(a,o)&&w(o,a)&&(t.push(a.i/r|0),t.push(n.i/r|0),t.push(o.i/r|0),S(n),S(n.next),n=e=o),n=n.next}while(n!==e);return i(n)}function c(e,t,r,n,o,s){var l=e;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&g(l,c)){var u=k(l,c);return l=i(l,l.next),u=i(u,u.next),a(l,t,r,n,o,s,0),void a(u,t,r,n,o,s,0)}c=c.next}l=l.next}while(l!==e)}function u(e,t){return e.x-t.x}function h(e,t){var r=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o&&(o=s,r=n.x<n.next.x?n:n.next,s===i))return r}n=n.next}while(n!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,d=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&m(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),w(n,e)&&(l<d||l===d&&(n.x>r.x||n.x===r.x&&p(r,n)))&&(r=n,d=l)),n=n.next}while(n!==c);return r}(e,t);if(!r)return t;var n=k(r,e);return i(n,n.next),i(r,r.next)}function p(e,t){return y(e.prev,e,t.prev)<0&&y(t.next,e,e.next)<0}function d(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function f(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function m(e,t,r,n,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function g(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&x(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(w(e,t)&&w(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(y(e.prev,e,t.prev)||y(e,t.prev,t))||v(e,t)&&y(e.prev,e,e.next)>0&&y(t.prev,t,t.next)>0)}function y(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function v(e,t){return e.x===t.x&&e.y===t.y}function x(e,t,r,n){var i=_(y(e,t,r)),a=_(y(e,t,n)),o=_(y(r,n,e)),s=_(y(r,n,t));return i!==a&&o!==s||!(0!==i||!b(e,r,t))||!(0!==a||!b(e,n,t))||!(0!==o||!b(r,e,n))||!(0!==s||!b(r,t,n))}function b(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function _(e){return e>0?1:e<0?-1:0}function w(e,t){return y(e.prev,e,e.next)<0?y(e,t,e.next)>=0&&y(e,e.prev,t)>=0:y(e,t,e.prev)<0||y(e,e.next,t)<0}function k(e,t){var r=new A(e.i,e.x,e.y),n=new A(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function T(e,t,r,n){var i=new A(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function S(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function A(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function M(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}t.exports=r,t.exports.default=r,r.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(M(e,0,a,r));if(i)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(M(e,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,d=n[s+1]*r,f=n[s+2]*r;h+=Math.abs((e[p]-e[f])*(e[d+1]-e[p+1])-(e[p]-e[d])*(e[f+1]-e[p+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},r.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r}}}),yy=p({"node_modules/array-normalize/index.js"(e,t){var r=Ug();t.exports=function(e,t,n){if(!e||null==e.length)throw Error("Argument should be an array");null==t&&(t=1),null==n&&(n=r(e,t));for(var i=0;i<t;i++){var a=n[t+i],o=n[i],s=i,l=e.length;if(a===1/0&&o===-1/0)for(s=i;s<l;s+=t)e[s]=e[s]===a?1:e[s]===o?0:.5;else if(a===1/0)for(s=i;s<l;s+=t)e[s]=e[s]===a?1:0;else if(o===-1/0)for(s=i;s<l;s+=t)e[s]=e[s]===o?0:1;else{var c=a-o;for(s=i;s<l;s+=t)isNaN(e[s])||(e[s]=0===c?.5:(e[s]-o)/c)}}return e}}}),vy=p({"node_modules/es6-weak-map/is-implemented.js"(e,t){t.exports=function(){var e,t;if("function"!==typeof WeakMap)return!1;try{e=new WeakMap([[t={},"one"],[{},"two"],[{},"three"]])}catch(r){return!1}return"[object WeakMap]"===String(e)&&"function"===typeof e.set&&e.set({},1)===e&&"function"===typeof e.delete&&"function"===typeof e.has&&"one"===e.get(t)}}}),xy=p({"node_modules/es5-ext/function/noop.js"(e,t){t.exports=function(){}}}),by=p({"node_modules/es5-ext/object/is-value.js"(e,t){var r=xy()();t.exports=function(e){return e!==r&&null!==e}}}),_y=p({"node_modules/es5-ext/object/set-prototype-of/is-implemented.js"(e,t){var r=Object.create,n=Object.getPrototypeOf,i={};t.exports=function(){var e=Object.setPrototypeOf;return"function"===typeof e&&n(e((arguments[0]||r)(null),i))===i}}}),wy=p({"node_modules/es5-ext/object/is-object.js"(e,t){var r=by(),n={function:!0,object:!0};t.exports=function(e){return r(e)&&n[typeof e]||!1}}}),ky=p({"node_modules/es5-ext/object/valid-value.js"(e,t){var r=by();t.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}}}),Ty=p({"node_modules/es5-ext/object/create.js"(e,t){var r,n=Object.create;_y()()||(r=Sy()),t.exports=function(){var e,t,i;return r?1!==r.level?n:(e={},t={},i={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(e){t[e]="__proto__"!==e?i:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(e,t),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:e}),function(t,r){return n(null===t?e:t,r)}):n}()}}),Sy=p({"node_modules/es5-ext/object/set-prototype-of/shim.js"(e,t){var r,n=wy(),i=ky(),a=Object.prototype.isPrototypeOf,o=Object.defineProperty,s={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(e,t){if(i(e),null===t||n(t))return e;throw new TypeError("Prototype must be null or an object")},t.exports=function(e){var t,n;return e?(2===e.level?e.set?(n=e.set,t=function(e,t){return n.call(r(e,t),t),e}):t=function(e,t){return r(e,t).__proto__=t,e}:t=function e(t,n){var i;return r(t,n),(i=a.call(e.nullPolyfill,t))&&delete e.nullPolyfill.__proto__,null===n&&(n=e.nullPolyfill),t.__proto__=n,i&&o(e.nullPolyfill,"__proto__",s),t},Object.defineProperty(t,"level",{configurable:!1,enumerable:!1,writable:!1,value:e.level})):null}(function(){var e,t=Object.create(null),r={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(e=n.set).call(t,r)}catch(i){}if(Object.getPrototypeOf(t)===r)return{set:e,level:2}}return t.__proto__=r,Object.getPrototypeOf(t)===r?{level:2}:((t={}).__proto__=r,Object.getPrototypeOf(t)===r&&{level:1})}()),Ty()}}),Ay=p({"node_modules/es5-ext/object/set-prototype-of/index.js"(e,t){t.exports=_y()()?Object.setPrototypeOf:Sy()}}),My=p({"node_modules/es5-ext/object/valid-object.js"(e,t){var r=wy();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not an Object");return e}}}),Ey=p({"node_modules/es5-ext/string/random-uniq.js"(e,t){var r=Object.create(null),n=Math.random;t.exports=function(){var e;do{e=n().toString(36).slice(2)}while(r[e]);return e}}}),Cy=p({"node_modules/type/value/is.js"(e,t){t.exports=function(e){return void 0!==e&&null!==e}}}),Py=p({"node_modules/type/object/is.js"(e,t){var r=Cy(),n={object:!0,function:!0,undefined:!0};t.exports=function(e){return!!r(e)&&hasOwnProperty.call(n,typeof e)}}}),Ly=p({"node_modules/type/prototype/is.js"(e,t){var r=Py();t.exports=function(e){if(!r(e))return!1;try{return!!e.constructor&&e.constructor.prototype===e}catch(t){return!1}}}}),Iy=p({"node_modules/type/function/is.js"(e,t){var r=Ly();t.exports=function(e){if("function"!==typeof e)return!1;if(!hasOwnProperty.call(e,"length"))return!1;try{if("number"!==typeof e.length)return!1;if("function"!==typeof e.call)return!1;if("function"!==typeof e.apply)return!1}catch(t){return!1}return!r(e)}}}),zy=p({"node_modules/type/plain-function/is.js"(e,t){var r=Iy(),n=/^\s*class[\s{/}]/,i=Function.prototype.toString;t.exports=function(e){return!!r(e)&&!n.test(i.call(e))}}}),Oy=p({"node_modules/es5-ext/object/assign/is-implemented.js"(e,t){t.exports=function(){var e,t=Object.assign;return"function"===typeof t&&(t(e={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}}}),Ry=p({"node_modules/es5-ext/object/keys/is-implemented.js"(e,t){t.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}}}),Dy=p({"node_modules/es5-ext/object/keys/shim.js"(e,t){var r=by(),n=Object.keys;t.exports=function(e){return n(r(e)?Object(e):e)}}}),jy=p({"node_modules/es5-ext/object/keys/index.js"(e,t){t.exports=Ry()()?Object.keys:Dy()}}),Fy=p({"node_modules/es5-ext/object/assign/shim.js"(e,t){var r=jy(),n=ky(),i=Math.max;t.exports=function(e,t){var a,o,s,l=i(arguments.length,2);for(e=Object(n(e)),s=function(r){try{e[r]=t[r]}catch(n){a||(a=n)}},o=1;o<l;++o)r(t=arguments[o]).forEach(s);if(void 0!==a)throw a;return e}}}),By=p({"node_modules/es5-ext/object/assign/index.js"(e,t){t.exports=Oy()()?Object.assign:Fy()}}),Ny=p({"node_modules/es5-ext/object/normalize-options.js"(e,t){var r=by(),n=Array.prototype.forEach,i=Object.create;t.exports=function(e){var t=i(null);return n.call(arguments,(function(e){r(e)&&function(e,t){var r;for(r in e)t[r]=e[r]}(Object(e),t)})),t}}}),Uy=p({"node_modules/es5-ext/string/#/contains/is-implemented.js"(e,t){var r="razdwatrzy";t.exports=function(){return"function"===typeof r.contains&&!0===r.contains("dwa")&&!1===r.contains("foo")}}}),Vy=p({"node_modules/es5-ext/string/#/contains/shim.js"(e,t){var r=String.prototype.indexOf;t.exports=function(e){return r.call(this,e,arguments[1])>-1}}}),qy=p({"node_modules/es5-ext/string/#/contains/index.js"(e,t){t.exports=Uy()()?String.prototype.contains:Vy()}}),Hy=p({"node_modules/d/index.js"(e,t){var r=Cy(),n=zy(),i=By(),a=Ny(),o=qy(),s=t.exports=function(e,t){var n,s,l,c,u;return arguments.length<2||"string"!==typeof e?(c=t,t=e,e=null):c=arguments[2],r(e)?(n=o.call(e,"c"),s=o.call(e,"e"),l=o.call(e,"w")):(n=l=!0,s=!1),u={value:t,configurable:n,enumerable:s,writable:l},c?i(a(c),u):u};s.gs=function(e,t,s){var l,c,u,h;return"string"!==typeof e?(u=s,s=t,t=e,e=null):u=arguments[3],r(t)?n(t)?r(s)?n(s)||(u=s,s=void 0):s=void 0:(u=t,t=s=void 0):t=void 0,r(e)?(l=o.call(e,"c"),c=o.call(e,"e")):(l=!0,c=!1),h={get:t,set:s,configurable:l,enumerable:c},u?i(a(u),h):h}}}),Gy=p({"node_modules/es5-ext/function/is-arguments.js"(e,t){var r=Object.prototype.toString,n=r.call(function(){return arguments}());t.exports=function(e){return r.call(e)===n}}}),Wy=p({"node_modules/es5-ext/string/is-string.js"(e,t){var r=Object.prototype.toString,n=r.call("");t.exports=function(e){return"string"===typeof e||e&&"object"===typeof e&&(e instanceof String||r.call(e)===n)||!1}}}),$y=p({"node_modules/ext/global-this/is-implemented.js"(e,t){t.exports=function(){return"object"===typeof globalThis&&!!globalThis&&globalThis.Array===Array}}}),Zy=p({"node_modules/ext/global-this/implementation.js"(e,t){var r=function(){if("object"===typeof self&&self)return self;if("object"===typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};t.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()}}),Xy=p({"node_modules/ext/global-this/index.js"(e,t){t.exports=$y()()?globalThis:Zy()}}),Yy=p({"node_modules/es6-symbol/is-implemented.js"(e,t){var r=Xy(),n={object:!0,symbol:!0};t.exports=function(){var e,t=r.Symbol;if("function"!==typeof t)return!1;e=t("test symbol");try{String(e)}catch(i){return!1}return!!n[typeof t.iterator]&&!!n[typeof t.toPrimitive]&&!!n[typeof t.toStringTag]}}}),Ky=p({"node_modules/es6-symbol/is-symbol.js"(e,t){t.exports=function(e){return!!e&&("symbol"===typeof e||!!e.constructor&&"Symbol"===e.constructor.name&&"Symbol"===e[e.constructor.toStringTag])}}}),Jy=p({"node_modules/es6-symbol/validate-symbol.js"(e,t){var r=Ky();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not a symbol");return e}}}),Qy=p({"node_modules/es6-symbol/lib/private/generate-name.js"(e,t){var r=Hy(),n=Object.create,i=Object.defineProperty,a=Object.prototype,o=n(null);t.exports=function(e){for(var t,n,s=0;o[e+(s||"")];)++s;return o[e+=s||""]=!0,i(a,t="@@"+e,r.gs(null,(function(e){n||(n=!0,i(this,t,r(e)),n=!1)}))),t}}}),ev=p({"node_modules/es6-symbol/lib/private/setup/standard-symbols.js"(e,t){var r=Hy(),n=Xy().Symbol;t.exports=function(e){return Object.defineProperties(e,{hasInstance:r("",n&&n.hasInstance||e("hasInstance")),isConcatSpreadable:r("",n&&n.isConcatSpreadable||e("isConcatSpreadable")),iterator:r("",n&&n.iterator||e("iterator")),match:r("",n&&n.match||e("match")),replace:r("",n&&n.replace||e("replace")),search:r("",n&&n.search||e("search")),species:r("",n&&n.species||e("species")),split:r("",n&&n.split||e("split")),toPrimitive:r("",n&&n.toPrimitive||e("toPrimitive")),toStringTag:r("",n&&n.toStringTag||e("toStringTag")),unscopables:r("",n&&n.unscopables||e("unscopables"))})}}}),tv=p({"node_modules/es6-symbol/lib/private/setup/symbol-registry.js"(e,t){var r=Hy(),n=Jy(),i=Object.create(null);t.exports=function(e){return Object.defineProperties(e,{for:r((function(t){return i[t]?i[t]:i[t]=e(String(t))})),keyFor:r((function(e){var t;for(t in n(e),i)if(i[t]===e)return t}))})}}}),rv=p({"node_modules/es6-symbol/polyfill.js"(e,t){var r,n,i,a=Hy(),o=Jy(),s=Xy().Symbol,l=Qy(),c=ev(),u=tv(),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"===typeof s)try{String(s()),i=!0}catch(f){}else s=null;n=function(e){if(this instanceof n)throw new TypeError("Symbol is not a constructor");return r(e)},t.exports=r=function e(t){var r;if(this instanceof e)throw new TypeError("Symbol is not a constructor");return i?s(t):(r=h(n.prototype),t=void 0===t?"":String(t),p(r,{__description__:a("",t),__name__:a("",l(t))}))},c(r),u(r),p(n.prototype,{constructor:a(r),toString:a("",(function(){return this.__name__}))}),p(r.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),d(r.prototype,r.toPrimitive,a("",(function(){var e=o(this);return"symbol"===typeof e?e:e.toString()}))),d(r.prototype,r.toStringTag,a("c","Symbol")),d(n.prototype,r.toStringTag,a("c",r.prototype[r.toStringTag])),d(n.prototype,r.toPrimitive,a("c",r.prototype[r.toPrimitive]))}}),nv=p({"node_modules/es6-symbol/index.js"(e,t){t.exports=Yy()()?Xy().Symbol:rv()}}),iv=p({"node_modules/es5-ext/array/#/clear.js"(e,t){var r=ky();t.exports=function(){return r(this).length=0,this}}}),av=p({"node_modules/es5-ext/object/valid-callable.js"(e,t){t.exports=function(e){if("function"!==typeof e)throw new TypeError(e+" is not a function");return e}}}),ov=p({"node_modules/type/string/coerce.js"(e,t){var r=Cy(),n=Py(),i=Object.prototype.toString;t.exports=function(e){if(!r(e))return null;if(n(e)){var t=e.toString;if("function"!==typeof t)return null;if(t===i)return null}try{return""+e}catch(a){return null}}}}),sv=p({"node_modules/type/lib/safe-to-string.js"(e,t){t.exports=function(e){try{return e.toString()}catch(t){try{return String(e)}catch(r){return null}}}}}),lv=p({"node_modules/type/lib/to-short-string.js"(e,t){var r=sv(),n=/[\n\r\u2028\u2029]/g;t.exports=function(e){var t=r(e);return null===t?"<Non-coercible to string value>":(t.length>100&&(t=t.slice(0,99)+"\u2026"),t=t.replace(n,(function(e){switch(e){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}}}),cv=p({"node_modules/type/lib/resolve-exception.js"(e,t){var r=Cy(),n=Py(),i=ov(),a=lv(),o=function(e,t){return e.replace("%v",a(t))};t.exports=function(e,t,a){if(!n(a))throw new TypeError(o(t,e));if(!r(e)){if("default"in a)return a.default;if(a.isOptional)return null}var s=i(a.errorMessage);throw r(s)||(s=t),new TypeError(o(s,e))}}}),uv=p({"node_modules/type/value/ensure.js"(e,t){var r=cv(),n=Cy();t.exports=function(e){return n(e)?e:r(e,"Cannot use %v",arguments[1])}}}),hv=p({"node_modules/type/plain-function/ensure.js"(e,t){var r=cv(),n=zy();t.exports=function(e){return n(e)?e:r(e,"%v is not a plain function",arguments[1])}}}),pv=p({"node_modules/es5-ext/array/from/is-implemented.js"(e,t){t.exports=function(){var e,t,r=Array.from;return"function"===typeof r&&(t=r(e=["raz","dwa"]),Boolean(t&&t!==e&&"dwa"===t[1]))}}}),dv=p({"node_modules/es5-ext/function/is-function.js"(e,t){var r=Object.prototype.toString,n=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(e){return"function"===typeof e&&n(r.call(e))}}}),fv=p({"node_modules/es5-ext/math/sign/is-implemented.js"(e,t){t.exports=function(){var e=Math.sign;return"function"===typeof e&&1===e(10)&&-1===e(-20)}}}),mv=p({"node_modules/es5-ext/math/sign/shim.js"(e,t){t.exports=function(e){return e=Number(e),isNaN(e)||0===e?e:e>0?1:-1}}}),gv=p({"node_modules/es5-ext/math/sign/index.js"(e,t){t.exports=fv()()?Math.sign:mv()}}),yv=p({"node_modules/es5-ext/number/to-integer.js"(e,t){var r=gv(),n=Math.abs,i=Math.floor;t.exports=function(e){return isNaN(e)?0:0!==(e=Number(e))&&isFinite(e)?r(e)*i(n(e)):e}}}),vv=p({"node_modules/es5-ext/number/to-pos-integer.js"(e,t){var r=yv(),n=Math.max;t.exports=function(e){return n(0,r(e))}}}),xv=p({"node_modules/es5-ext/array/from/shim.js"(e,t){var r=nv().iterator,n=Gy(),i=dv(),a=vv(),o=av(),s=ky(),l=by(),c=Wy(),u=Array.isArray,h=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},d=Object.defineProperty;t.exports=function(e){var t,f,m,g,y,v,x,b,_,w,k=arguments[1],T=arguments[2];if(e=Object(s(e)),l(k)&&o(k),this&&this!==Array&&i(this))t=this;else{if(!k){if(n(e))return 1!==(y=e.length)?Array.apply(null,e):((g=new Array(1))[0]=e[0],g);if(u(e)){for(g=new Array(y=e.length),f=0;f<y;++f)g[f]=e[f];return g}}g=[]}if(!u(e))if(void 0!==(_=e[r])){for(x=o(_).call(e),t&&(g=new t),b=x.next(),f=0;!b.done;)w=k?h.call(k,T,b.value,f):b.value,t?(p.value=w,d(g,f,p)):g[f]=w,b=x.next(),++f;y=f}else if(c(e)){for(y=e.length,t&&(g=new t),f=0,m=0;f<y;++f)w=e[f],f+1<y&&(v=w.charCodeAt(0))>=55296&&v<=56319&&(w+=e[++f]),w=k?h.call(k,T,w,m):w,t?(p.value=w,d(g,m,p)):g[m]=w,++m;y=m}if(void 0===y)for(y=a(e.length),t&&(g=new t(y)),f=0;f<y;++f)w=k?h.call(k,T,e[f],f):e[f],t?(p.value=w,d(g,f,p)):g[f]=w;return t&&(p.value=null,g.length=y),g}}}),bv=p({"node_modules/es5-ext/array/from/index.js"(e,t){t.exports=pv()()?Array.from:xv()}}),_v=p({"node_modules/es5-ext/object/copy.js"(e,t){var r=bv(),n=By(),i=ky();t.exports=function(e){var t=Object(i(e)),a=arguments[1],o=Object(arguments[2]);if(t!==e&&!a)return t;var s={};return a?r(a,(function(t){(o.ensure||t in e)&&(s[t]=e[t])})):n(s,e),s}}}),wv=p({"node_modules/es5-ext/object/_iterate.js"(e,t){var r=av(),n=ky(),i=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,s=Object.prototype.propertyIsEnumerable;t.exports=function(e,t){return function(l,c){var u,h=arguments[2],p=arguments[3];return l=Object(n(l)),r(c),u=o(l),p&&u.sort("function"===typeof p?i.call(p,l):void 0),"function"!==typeof e&&(e=u[e]),a.call(e,u,(function(e,r){return s.call(l,e)?a.call(c,h,l[e],e,l,r):t}))}}}}),kv=p({"node_modules/es5-ext/object/for-each.js"(e,t){t.exports=wv()("forEach")}}),Tv=p({"node_modules/es5-ext/object/map.js"(e,t){var r=av(),n=kv(),i=Function.prototype.call;t.exports=function(e,t){var a={},o=arguments[2];return r(t),n(e,(function(e,r,n,s){a[r]=i.call(t,o,e,r,n,s)})),a}}}),Sv=p({"node_modules/d/auto-bind.js"(e,t){var r,n=Cy(),i=uv(),a=hv(),o=_v(),s=Ny(),l=Tv(),c=Function.prototype.bind,u=Object.defineProperty,h=Object.prototype.hasOwnProperty;r=function(e,t,r){var n,s=i(t)&&a(t.value);return delete(n=o(t)).writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,e)?s:(t.value=c.call(s,r.resolveContext?r.resolveContext(this):this),u(this,e,t),this[e])},n},t.exports=function(e){var t=s(arguments[1]);return n(t.resolveContext)&&a(t.resolveContext),l(e,(function(e,n){return r(n,e,t)}))}}}),Av=p({"node_modules/es6-iterator/index.js"(e,t){var r,n=iv(),i=By(),a=av(),o=ky(),s=Hy(),l=Sv(),c=nv(),u=Object.defineProperty,h=Object.defineProperties;t.exports=r=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");h(this,{__list__:s("w",o(e)),__context__:s("w",t),__nextIndex__:s("w",0)}),t&&(a(t.on),t.on("_add",this._onAdd),t.on("_delete",this._onDelete),t.on("_clear",this._onClear))},delete r.prototype.constructor,h(r.prototype,i({_next:s((function(){var e;if(this.__list__)return this.__redo__&&void 0!==(e=this.__redo__.shift())?e:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:s((function(){return this._createResult(this._next())})),_createResult:s((function(e){return void 0===e?{done:!0,value:void 0}:{done:!1,value:this._resolve(e)}})),_resolve:s((function(e){return this.__list__[e]})),_unBind:s((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:s((function(){return"[object "+(this[c.toStringTag]||"Object")+"]"}))},l({_onAdd:s((function(e){e>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(t,r){t>=e&&(this.__redo__[r]=++t)}),this),this.__redo__.push(e)):u(this,"__redo__",s("c",[e])))})),_onDelete:s((function(e){var t;e>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(t=this.__redo__.indexOf(e))&&this.__redo__.splice(t,1),this.__redo__.forEach((function(t,r){t>e&&(this.__redo__[r]=--t)}),this)))})),_onClear:s((function(){this.__redo__&&n.call(this.__redo__),this.__nextIndex__=0}))}))),u(r.prototype,c.iterator,s((function(){return this})))}}),Mv=p({"node_modules/es6-iterator/array.js"(e,t){var r,n=Ay(),i=qy(),a=Hy(),o=nv(),s=Av(),l=Object.defineProperty;r=t.exports=function(e,t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");s.call(this,e),t=t?i.call(t,"key+value")?"key+value":i.call(t,"key")?"key":"value":"value",l(this,"__kind__",a("",t))},n&&n(r,s),delete r.prototype.constructor,r.prototype=Object.create(s.prototype,{_resolve:a((function(e){return"value"===this.__kind__?this.__list__[e]:"key+value"===this.__kind__?[e,this.__list__[e]]:e}))}),l(r.prototype,o.toStringTag,a("c","Array Iterator"))}}),Ev=p({"node_modules/es6-iterator/string.js"(e,t){var r,n=Ay(),i=Hy(),a=nv(),o=Av(),s=Object.defineProperty;r=t.exports=function(e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");e=String(e),o.call(this,e),s(this,"__length__",i("",e.length))},n&&n(r,o),delete r.prototype.constructor,r.prototype=Object.create(o.prototype,{_next:i((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:i((function(e){var t,r=this.__list__[e];return this.__nextIndex__===this.__length__?r:(t=r.charCodeAt(0))>=55296&&t<=56319?r+this.__list__[this.__nextIndex__++]:r}))}),s(r.prototype,a.toStringTag,i("c","String Iterator"))}}),Cv=p({"node_modules/es6-iterator/is-iterable.js"(e,t){var r=Gy(),n=by(),i=Wy(),a=nv().iterator,o=Array.isArray;t.exports=function(e){return!!n(e)&&(!!o(e)||!!i(e)||!!r(e)||"function"===typeof e[a])}}}),Pv=p({"node_modules/es6-iterator/valid-iterable.js"(e,t){var r=Cv();t.exports=function(e){if(!r(e))throw new TypeError(e+" is not iterable");return e}}}),Lv=p({"node_modules/es6-iterator/get.js"(e,t){var r=Gy(),n=Wy(),i=Mv(),a=Ev(),o=Pv(),s=nv().iterator;t.exports=function(e){return"function"===typeof o(e)[s]?e[s]():r(e)?new i(e):n(e)?new a(e):new i(e)}}}),Iv=p({"node_modules/es6-iterator/for-of.js"(e,t){var r=Gy(),n=av(),i=Wy(),a=Lv(),o=Array.isArray,s=Function.prototype.call,l=Array.prototype.some;t.exports=function(e,t){var c,u,h,p,d,f,m,g,y=arguments[2];if(o(e)||r(e)?c="array":i(e)?c="string":e=a(e),n(t),h=function(){p=!0},"array"!==c)if("string"!==c)for(u=e.next();!u.done;){if(s.call(t,y,u.value,h),p)return;u=e.next()}else for(f=e.length,d=0;d<f&&(m=e[d],d+1<f&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=e[++d]),s.call(t,y,m,h),!p);++d);else l.call(e,(function(e){return s.call(t,y,e,h),p}))}}}),zv=p({"node_modules/es6-weak-map/is-native-implemented.js"(e,t){t.exports="function"===typeof WeakMap&&"[object WeakMap]"===Object.prototype.toString.call(new WeakMap)}}),Ov=p({"node_modules/es6-weak-map/polyfill.js"(e,t){var r,n=by(),i=Ay(),a=My(),o=ky(),s=Ey(),l=Hy(),c=Lv(),u=Iv(),h=nv().toStringTag,p=zv(),d=Array.isArray,f=Object.defineProperty,m=Object.prototype.hasOwnProperty,g=Object.getPrototypeOf;t.exports=r=function(){var e,t=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return e=p&&i&&WeakMap!==r?i(new WeakMap,g(this)):this,n(t)&&(d(t)||(t=c(t))),f(e,"__weakMapData__",l("c","$weakMap$"+s())),t?(u(t,(function(t){o(t),e.set(t[0],t[1])})),e):e},p&&(i&&i(r,WeakMap),r.prototype=Object.create(WeakMap.prototype,{constructor:l(r)})),Object.defineProperties(r.prototype,{delete:l((function(e){return!!m.call(a(e),this.__weakMapData__)&&(delete e[this.__weakMapData__],!0)})),get:l((function(e){if(m.call(a(e),this.__weakMapData__))return e[this.__weakMapData__]})),has:l((function(e){return m.call(a(e),this.__weakMapData__)})),set:l((function(e,t){return f(a(e),this.__weakMapData__,l("c",t)),this})),toString:l((function(){return"[object WeakMap]"}))}),f(r.prototype,h,l("c","WeakMap"))}}),Rv=p({"node_modules/es6-weak-map/index.js"(e,t){t.exports=vy()()?WeakMap:Ov()}}),Dv=p({"node_modules/array-find-index/index.js"(e,t){t.exports=function(e,t,r){if("function"===typeof Array.prototype.findIndex)return e.findIndex(t,r);if("function"!==typeof t)throw new TypeError("predicate must be a function");var n=Object(e),i=n.length;if(0===i)return-1;for(var a=0;a<i;a++)if(t.call(r,n[a],a,n))return a;return-1}}}),jv=p({"node_modules/regl-line2d/index.js"(e,t){var r=Bf(),n=Ug(),i=uy(),a=Bg(),o=qg(),s=gy(),l=yy(),{float32:c,fract32:u}=fy(),h=Rv(),p=Ng(),d=Dv();function f(e,t){if(!(this instanceof f))return new f(e,t);if("function"===typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");this.gl=e._gl,this.regl=e,this.passes=[],this.shaders=f.shaders.has(e)?f.shaders.get(e):f.shaders.set(e,f.createShaders(e)).get(e),this.update(t)}t.exports=f,f.dashMult=2,f.maxPatternLength=256,f.precisionThreshold=3e6,f.maxPoints=1e4,f.maxLines=2048,f.shaders=new h,f.createShaders=function(e){let t,r=e.buffer({usage:"static",type:"float",data:[0,1,0,0,1,1,1,0]}),n={primitive:"triangle strip",instances:e.prop("count"),count:4,offset:0,uniforms:{miterMode:(e,t)=>"round"===t.join?2:1,miterLimit:e.prop("miterLimit"),scale:e.prop("scale"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),thickness:e.prop("thickness"),dashTexture:e.prop("dashTexture"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),dashLength:e.prop("dashLength"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight],depth:e.prop("depth")},blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:(e,t)=>!t.overlay},stencil:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport")},a=e(i({vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n\t// the order is important\n\treturn position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n}\n\nvoid main() {\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scale * viewport.zw);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},aCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8,divisor:1},bCoordFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:16,divisor:1},color:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1}}},n));try{t=e(i({cull:{enable:!0,face:"back"},vert:"\nprecision highp float;\n\nattribute vec2 aCoord, bCoord, nextCoord, prevCoord;\nattribute vec4 aColor, bColor;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, translate;\nuniform float thickness, pixelRatio, id, depth;\nuniform vec4 viewport;\nuniform float miterLimit, miterMode;\n\nvarying vec4 fragColor;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 tangent;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nconst float REVERSE_THRESHOLD = -.875;\nconst float MIN_DIFF = 1e-6;\n\n// TODO: possible optimizations: avoid overcalculating all for vertices and calc just one instead\n// TODO: precalculate dot products, normalize things beforehead etc.\n// TODO: refactor to rectangular algorithm\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nbool isNaN( float val ){\n return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;\n}\n\nvoid main() {\n\tvec2 aCoord = aCoord, bCoord = bCoord, prevCoord = prevCoord, nextCoord = nextCoord;\n\n vec2 adjustedScale;\n adjustedScale.x = (abs(scale.x) < MIN_DIFF) ? MIN_DIFF : scale.x;\n adjustedScale.y = (abs(scale.y) < MIN_DIFF) ? MIN_DIFF : scale.y;\n\n vec2 scaleRatio = adjustedScale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineBot = 1. - lineTop;\n\n\tfragColor = (lineStart * aColor + lineEnd * bColor) / 255.;\n\n\tif (isNaN(aCoord.x) || isNaN(aCoord.y) || isNaN(bCoord.x) || isNaN(bCoord.y)) return;\n\n\tif (aCoord == prevCoord) prevCoord = aCoord + normalize(bCoord - aCoord);\n\tif (bCoord == nextCoord) nextCoord = bCoord - normalize(bCoord - aCoord);\n\n\n\tvec2 prevDiff = aCoord - prevCoord;\n\tvec2 currDiff = bCoord - aCoord;\n\tvec2 nextDiff = nextCoord - bCoord;\n\n\tvec2 prevTangent = normalize(prevDiff * scaleRatio);\n\tvec2 currTangent = normalize(currDiff * scaleRatio);\n\tvec2 nextTangent = normalize(nextDiff * scaleRatio);\n\n\tvec2 prevNormal = vec2(-prevTangent.y, prevTangent.x);\n\tvec2 currNormal = vec2(-currTangent.y, currTangent.x);\n\tvec2 nextNormal = vec2(-nextTangent.y, nextTangent.x);\n\n\tvec2 startJoinDirection = normalize(prevTangent - currTangent);\n\tvec2 endJoinDirection = normalize(currTangent - nextTangent);\n\n\t// collapsed/unidirectional segment cases\n\t// FIXME: there should be more elegant solution\n\tvec2 prevTanDiff = abs(prevTangent - currTangent);\n\tvec2 nextTanDiff = abs(nextTangent - currTangent);\n\tif (max(prevTanDiff.x, prevTanDiff.y) < MIN_DIFF) {\n\t\tstartJoinDirection = currNormal;\n\t}\n\tif (max(nextTanDiff.x, nextTanDiff.y) < MIN_DIFF) {\n\t\tendJoinDirection = currNormal;\n\t}\n\tif (aCoord == bCoord) {\n\t\tendJoinDirection = startJoinDirection;\n\t\tcurrNormal = prevNormal;\n\t\tcurrTangent = prevTangent;\n\t}\n\n\ttangent = currTangent;\n\n\t//calculate join shifts relative to normals\n\tfloat startJoinShift = dot(currNormal, startJoinDirection);\n\tfloat endJoinShift = dot(currNormal, endJoinDirection);\n\n\tfloat startMiterRatio = abs(1. / startJoinShift);\n\tfloat endMiterRatio = abs(1. / endJoinShift);\n\n\tvec2 startJoin = startJoinDirection * startMiterRatio;\n\tvec2 endJoin = endJoinDirection * endMiterRatio;\n\n\tvec2 startTopJoin, startBotJoin, endTopJoin, endBotJoin;\n\tstartTopJoin = sign(startJoinShift) * startJoin * .5;\n\tstartBotJoin = -startTopJoin;\n\n\tendTopJoin = sign(endJoinShift) * endJoin * .5;\n\tendBotJoin = -endTopJoin;\n\n\tvec2 aTopCoord = aCoord + normalWidth * startTopJoin;\n\tvec2 bTopCoord = bCoord + normalWidth * endTopJoin;\n\tvec2 aBotCoord = aCoord + normalWidth * startBotJoin;\n\tvec2 bBotCoord = bCoord + normalWidth * endBotJoin;\n\n\t//miter anti-clipping\n\tfloat baClipping = distToLine(bCoord, aCoord, aBotCoord) / dot(normalize(normalWidth * endBotJoin), normalize(normalWidth.yx * vec2(-startBotJoin.y, startBotJoin.x)));\n\tfloat abClipping = distToLine(aCoord, bCoord, bTopCoord) / dot(normalize(normalWidth * startBotJoin), normalize(normalWidth.yx * vec2(-endBotJoin.y, endBotJoin.x)));\n\n\t//prevent close to reverse direction switch\n\tbool prevReverse = dot(currTangent, prevTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, prevNormal)) * min(length(prevDiff), length(currDiff)) < length(normalWidth * currNormal);\n\tbool nextReverse = dot(currTangent, nextTangent) <= REVERSE_THRESHOLD && abs(dot(currTangent, nextNormal)) * min(length(nextDiff), length(currDiff)) < length(normalWidth * currNormal);\n\n\tif (prevReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * startJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / startMiterRatio, 1.);\n\t\taBotCoord = aCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\taTopCoord = aCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!nextReverse && baClipping > 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord) * adjustedScale + translate;\n\tvec2 aBotPosition = (aBotCoord) * adjustedScale + translate;\n\n\tvec2 bTopPosition = (bTopCoord) * adjustedScale + translate;\n\tvec2 bBotPosition = (bBotCoord) * adjustedScale + translate;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = aCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\tendCoord = bCoord * scaleRatio + translate * viewport.zw + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = startCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = endCutoff * scaleRatio.xyxy + translate.xyxy * viewport.zwzw;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n",frag:"\nprecision highp float;\n\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\nuniform sampler2D dashTexture;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashTexture, vec2(t, .5)).r;\n\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n",attributes:{lineEnd:{buffer:r,divisor:0,stride:8,offset:0},lineTop:{buffer:r,divisor:0,stride:8,offset:4},aColor:{buffer:e.prop("colorBuffer"),stride:4,offset:0,divisor:1},bColor:{buffer:e.prop("colorBuffer"),stride:4,offset:4,divisor:1},prevCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:0,divisor:1},aCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:8,divisor:1},bCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:16,divisor:1},nextCoord:{buffer:e.prop("positionBuffer"),stride:8,offset:24,divisor:1}}},n))}catch(o){t=a}return{fill:e({primitive:"triangle",elements:(e,t)=>t.triangles,offset:0,vert:"\nprecision highp float;\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = position * scale + translate\n + positionFract * scale + translateFract\n + position * scaleFract\n + positionFract * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n\tfragColor.a *= opacity;\n}\n",frag:"\nprecision highp float;\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n}\n",uniforms:{scale:e.prop("scale"),color:e.prop("fill"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),translate:e.prop("translate"),opacity:e.prop("opacity"),pixelRatio:e.context("pixelRatio"),id:e.prop("id"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{position:{buffer:e.prop("positionBuffer"),stride:8,offset:8},positionFract:{buffer:e.prop("positionFractBuffer"),stride:8,offset:8}},blend:n.blend,depth:{enable:!1},scissor:n.scissor,stencil:n.stencil,viewport:n.viewport}),rect:a,miter:t}},f.defaults={dashes:null,join:"miter",miterLimit:1,thickness:10,cap:"square",color:"black",opacity:1,overlay:!1,viewport:null,range:null,close:!1,fill:null},f.prototype.render=function(){arguments.length&&this.update(...arguments),this.draw()},f.prototype.draw=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(t.length?t:this.passes).forEach(((e,t)=>{if(e&&Array.isArray(e))return this.draw(...e);"number"===typeof e&&(e=this.passes[e]),e&&e.count>1&&e.opacity&&(this.regl._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&this.shaders.fill(e),e.thickness&&(e.scale[0]*e.viewport.width>f.precisionThreshold||e.scale[1]*e.viewport.height>f.precisionThreshold||"rect"===e.join||!e.join&&(e.thickness<=2||e.count>=f.maxPoints)?this.shaders.rect(e):this.shaders.miter(e)))})),this},f.prototype.update=function(e){if(!e)return;null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let{regl:t,gl:h}=this;if(e.forEach(((e,m)=>{let g=this.passes[m];if(void 0!==e)if(null!==e){if("number"===typeof e[0]&&(e={positions:e}),e=a(e,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color colour stroke colors colours stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",splitNull:"splitNull"}),g||(this.passes[m]=g={id:m,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,hole:[],depth:0,dashLength:1,dashTexture:t.texture({channels:1,data:new Uint8Array([255]),width:1,height:1,mag:"linear",min:"linear"}),colorBuffer:t.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array}),positionBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),positionFractBuffer:t.buffer({usage:"dynamic",type:"float",data:new Uint8Array})},e=i({},f.defaults,e)),null!=e.thickness&&(g.thickness=parseFloat(e.thickness)),null!=e.opacity&&(g.opacity=parseFloat(e.opacity)),null!=e.miterLimit&&(g.miterLimit=parseFloat(e.miterLimit)),null!=e.overlay&&(g.overlay=!!e.overlay,m<f.maxLines&&(g.depth=2*(f.maxLines-1-m%f.maxLines)/f.maxLines-1)),null!=e.join&&(g.join=e.join),null!=e.hole&&(g.hole=e.hole),null!=e.fill&&(g.fill=e.fill?r(e.fill,"uint8"):null),null!=e.viewport&&(g.viewport=p(e.viewport)),g.viewport||(g.viewport=p([h.drawingBufferWidth,h.drawingBufferHeight])),null!=e.close&&(g.close=e.close),null===e.positions&&(e.positions=[]),e.positions){let t,r;if(e.positions.x&&e.positions.y){let n=e.positions.x,i=e.positions.y;r=g.count=Math.max(n.length,i.length),t=new Float64Array(2*r);for(let e=0;e<r;e++)t[2*e]=n[e],t[2*e+1]=i[e]}else t=o(e.positions,"float64"),r=g.count=Math.floor(t.length/2);let i=g.bounds=n(t,2);if(g.fill){let r=[],n={},i=0;for(let e=0,a=0,o=g.count;e<o;e++){let o=t[2*e],s=t[2*e+1];isNaN(o)||isNaN(s)||null==o||null==s?(o=t[2*i],s=t[2*i+1],n[e]=i):i=e,r[a++]=o,r[a++]=s}if(e.splitNull){g.count-1 in n||(n[g.count]=g.count-1);let e=Object.keys(n).map(Number).sort(((e,t)=>e-t)),t=[],i=0,a=null!=g.hole?g.hole[0]:null;if(null!=a){let t=d(e,(e=>e>=a));e=e.slice(0,t),e.push(a)}for(let n=0;n<e.length;n++){let o=r.slice(2*i,2*e[n]).concat(a?r.slice(2*a):[]),l=(g.hole||[]).map((t=>t-a+(e[n]-i))),c=s(o,l);c=c.map((t=>t+i+(t+i<e[n]?0:a-e[n]))),t.push(...c),i=e[n]+1}for(let r=0,o=t.length;r<o;r++)null!=n[t[r]]&&(t[r]=n[t[r]]);g.triangles=t}else{let e=s(r,g.hole||[]);for(let t=0,r=e.length;t<r;t++)null!=n[e[t]]&&(e[t]=n[e[t]]);g.triangles=e}}let a=new Float64Array(t);l(a,2,i);let h=new Float64Array(2*r+6);g.close?t[0]===t[2*r-2]&&t[1]===t[2*r-1]?(h[0]=a[2*r-4],h[1]=a[2*r-3]):(h[0]=a[2*r-2],h[1]=a[2*r-1]):(h[0]=a[0],h[1]=a[1]),h.set(a,2),g.close?t[0]===t[2*r-2]&&t[1]===t[2*r-1]?(h[2*r+2]=a[2],h[2*r+3]=a[3],g.count-=1):(h[2*r+2]=a[0],h[2*r+3]=a[1],h[2*r+4]=a[2],h[2*r+5]=a[3]):(h[2*r+2]=a[2*r-2],h[2*r+3]=a[2*r-1],h[2*r+4]=a[2*r-2],h[2*r+5]=a[2*r-1]);var y=c(h);g.positionBuffer(y);var v=u(h,y);g.positionFractBuffer(v)}if(e.range?g.range=e.range:g.range||(g.range=g.bounds),(e.range||e.positions)&&g.count){let e=g.bounds,t=e[2]-e[0],r=e[3]-e[1],n=g.range[2]-g.range[0],i=g.range[3]-g.range[1];g.scale=[t/n,r/i],g.translate=[-g.range[0]/n+e[0]/n||0,-g.range[1]/i+e[1]/i||0],g.scaleFract=u(g.scale),g.translateFract=u(g.translate)}if(e.dashes){let t,r=0;if(!e.dashes||e.dashes.length<2)r=1,t=new Uint8Array([255,255,255,255,255,255,255,255]);else{r=0;for(let t=0;t<e.dashes.length;++t)r+=e.dashes[t];t=new Uint8Array(r*f.dashMult);let n=0,i=255;for(let r=0;r<2;r++)for(let a=0;a<e.dashes.length;++a){for(let r=0,o=e.dashes[a]*f.dashMult*.5;r<o;++r)t[n++]=i;i^=255}}g.dashLength=r,g.dashTexture({channels:1,data:t,width:t.length,height:1,mag:"linear",min:"linear"},0,0)}if(e.color){let t=g.count,n=e.color;n||(n="transparent");let i=new Uint8Array(4*t+4);if(Array.isArray(n)&&"number"!==typeof n[0]){for(let e=0;e<t;e++){let t=r(n[e],"uint8");i.set(t,4*e)}i.set(r(n[0],"uint8"),4*t)}else{let e=r(n,"uint8");for(let r=0;r<t+1;r++)i.set(e,4*r)}g.colorBuffer({usage:"dynamic",type:"uint8",data:i})}}else this.passes[m]=null})),e.length<this.passes.length){for(let t=e.length;t<this.passes.length;t++){let e=this.passes[t];e&&(e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy())}this.passes.length=e.length}let m=[];for(let r=0;r<this.passes.length;r++)null!==this.passes[r]&&m.push(this.passes[r]);return this.passes=m,this},f.prototype.destroy=function(){return this.passes.forEach((e=>{e.colorBuffer.destroy(),e.positionBuffer.destroy(),e.dashTexture.destroy()})),this.passes.length=0,this}}}),Fv=p({"node_modules/regl-error2d/index.js"(e,t){var r=Ug(),n=Bf(),i=py(),a=Bg(),o=uy(),s=qg(),{float32:l,fract32:c}=fy();t.exports=function(e,t){if("function"===typeof e?(t||(t={}),t.regl=e):t=e,t.length&&(t.positions=t),!(e=t.regl).hasExtension("ANGLE_instanced_arrays"))throw Error("regl-error2d: `ANGLE_instanced_arrays` extension should be enabled");let h,p,d,f,m,g,y=e._gl,v={color:"black",capSize:5,lineWidth:1,opacity:1,viewport:null,range:null,offset:0,count:0,bounds:null,positions:[],errors:[]},x=[];return f=e.buffer({usage:"dynamic",type:"uint8",data:new Uint8Array(0)}),p=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),d=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),m=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)}),g=e.buffer({usage:"static",type:"float",data:u}),k(t),h=e({vert:"\n\t\tprecision highp float;\n\n\t\tattribute vec2 position, positionFract;\n\t\tattribute vec4 error;\n\t\tattribute vec4 color;\n\n\t\tattribute vec2 direction, lineOffset, capOffset;\n\n\t\tuniform vec4 viewport;\n\t\tuniform float lineWidth, capSize;\n\t\tuniform vec2 scale, scaleFract, translate, translateFract;\n\n\t\tvarying vec4 fragColor;\n\n\t\tvoid main() {\n\t\t\tfragColor = color / 255.;\n\n\t\t\tvec2 pixelOffset = lineWidth * lineOffset + (capSize + lineWidth) * capOffset;\n\n\t\t\tvec2 dxy = -step(.5, direction.xy) * error.xz + step(direction.xy, vec2(-.5)) * error.yw;\n\n\t\t\tvec2 position = position + dxy;\n\n\t\t\tvec2 pos = (position + translate) * scale\n\t\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t\t+ (position + translate) * scaleFract\n\t\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n\t\t\tpos += pixelOffset / viewport.zw;\n\n\t\t\tgl_Position = vec4(pos * 2. - 1., 0, 1);\n\t\t}\n\t\t",frag:"\n\t\tprecision highp float;\n\n\t\tvarying vec4 fragColor;\n\n\t\tuniform float opacity;\n\n\t\tvoid main() {\n\t\t\tgl_FragColor = fragColor;\n\t\t\tgl_FragColor.a *= opacity;\n\t\t}\n\t\t",uniforms:{range:e.prop("range"),lineWidth:e.prop("lineWidth"),capSize:e.prop("capSize"),opacity:e.prop("opacity"),scale:e.prop("scale"),translate:e.prop("translate"),scaleFract:e.prop("scaleFract"),translateFract:e.prop("translateFract"),viewport:(e,t)=>[t.viewport.x,t.viewport.y,e.viewportWidth,e.viewportHeight]},attributes:{color:{buffer:f,offset:(e,t)=>4*t.offset,divisor:1},position:{buffer:p,offset:(e,t)=>8*t.offset,divisor:1},positionFract:{buffer:d,offset:(e,t)=>8*t.offset,divisor:1},error:{buffer:m,offset:(e,t)=>16*t.offset,divisor:1},direction:{buffer:g,stride:24,offset:0},lineOffset:{buffer:g,stride:24,offset:8},capOffset:{buffer:g,stride:24,offset:16}},primitive:"triangles",blend:{enable:!0,color:[0,0,0,0],equation:{rgb:"add",alpha:"add"},func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},depth:{enable:!1},scissor:{enable:!0,box:e.prop("viewport")},viewport:e.prop("viewport"),stencil:!1,instances:e.prop("count"),count:u.length}),o(b,{update:k,draw:_,destroy:T,regl:e,gl:y,canvas:y.canvas,groups:x}),b;function b(e){e?k(e):null===e&&T(),_()}function _(t){if("number"===typeof t)return w(t);t&&!Array.isArray(t)&&(t=[t]),e._refresh(),x.forEach(((e,r)=>{e&&(t&&(t[r]?e.draw=!0:e.draw=!1),e.draw?w(r):e.draw=!0)}))}function w(e){"number"===typeof e&&(e=x[e]),null!=e&&e&&e.count&&e.color&&e.opacity&&e.positions&&e.positions.length>1&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],h(e),e.after&&e.after(e))}function k(e){if(!e)return;null!=e.length?"number"===typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);let t=0,u=0;if(b.groups=x=e.map(((e,l)=>{let h=x[l];return e?("function"===typeof e?e={after:e}:"number"===typeof e[0]&&(e={positions:e}),e=a(e,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),h||(x[l]=h={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},e=o({},v,e)),i(h,e,[{lineWidth:e=>.5*+e,capSize:e=>.5*+e,opacity:parseFloat,errors:e=>(e=s(e),u+=e.length,e),positions:(e,n)=>(e=s(e,"float64"),n.count=Math.floor(e.length/2),n.bounds=r(e,2),n.offset=t,t+=n.count,e)},{color:(e,t)=>{let r=t.count;if(e||(e="transparent"),!Array.isArray(e)||"number"===typeof e[0]){let t=e;e=Array(r);for(let n=0;n<r;n++)e[n]=t}if(e.length<r)throw Error("Not enough colors");let i=new Uint8Array(4*r);for(let a=0;a<r;a++){let t=n(e[a],"uint8");i.set(t,4*a)}return i},range:(e,t,r)=>{let n=t.bounds;return e||(e=n),t.scale=[1/(e[2]-e[0]),1/(e[3]-e[1])],t.translate=[-e[0],-e[1]],t.scaleFract=c(t.scale),t.translateFract=c(t.translate),e},viewport:e=>{let t;return Array.isArray(e)?t={x:e[0],y:e[1],width:e[2]-e[0],height:e[3]-e[1]}:e?(t={x:e.x||e.left||0,y:e.y||e.top||0},e.right?t.width=e.right-t.x:t.width=e.w||e.width||0,e.bottom?t.height=e.bottom-t.y:t.height=e.h||e.height||0):t={x:0,y:0,width:y.drawingBufferWidth,height:y.drawingBufferHeight},t}}]),h):h})),t||u){let e=x.reduce(((e,t,r)=>e+(t?t.count:0)),0),t=new Float64Array(2*e),r=new Uint8Array(4*e),n=new Float32Array(4*e);x.forEach(((e,i)=>{if(!e)return;let{positions:a,count:o,offset:s,color:l,errors:c}=e;o&&(r.set(l,4*s),n.set(c,4*s),t.set(a,2*s))}));var h=l(t);p(h);var g=c(t,h);d(g),f(r),m(n)}}function T(){p.destroy(),d.destroy(),f.destroy(),m.destroy(),g.destroy()}};var u=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]]}}),Bv=p({"node_modules/unquote/index.js"(e,t){var r=/[\'\"]/;t.exports=function(e){return e?(r.test(e.charAt(0))&&(e=e.substr(1)),r.test(e.charAt(e.length-1))&&(e=e.substr(0,e.length-1)),e):""}}}),Nv=p({"node_modules/css-global-keywords/index.json"(){}}),Uv=p({"node_modules/css-system-font-keywords/index.json"(){}}),Vv=p({"node_modules/css-font-weight-keywords/index.json"(){}}),qv=p({"node_modules/css-font-style-keywords/index.json"(){}}),Hv=p({"node_modules/css-font-stretch-keywords/index.json"(){}}),Gv=p({"node_modules/parenthesis/index.js"(e,t){function r(e,t){if("string"!==typeof e)return[e];var r=[e];"string"===typeof t||Array.isArray(t)?t={brackets:t}:t||(t={});var n=t.brackets?Array.isArray(t.brackets)?t.brackets:[t.brackets]:["{}","[]","()"],i=t.escape||"___",a=!!t.flat;n.forEach((function(e){var t=new RegExp(["\\",e[0],"[^\\",e[0],"\\",e[1],"]*\\",e[1]].join("")),n=[];function a(t,a,o){var s=r.push(t.slice(e[0].length,-e[1].length))-1;return n.push(s),i+s+i}r.forEach((function(e,n){for(var i,o=0;e!=i;)if(i=e,e=e.replace(t,a),o++>1e4)throw Error("References have circular dependency. Please, check them.");r[n]=e})),n=n.reverse(),r=r.map((function(t){return n.forEach((function(r){t=t.replace(new RegExp("(\\"+i+r+"\\"+i+")","g"),e[0]+"$1"+e[1])})),t}))}));var o=new RegExp("\\"+i+"([0-9]+)\\"+i);return a?r:function e(t,r,n){for(var i,a=[],s=0;i=o.exec(t);){if(s++>1e4)throw Error("Circular references in parenthesis");a.push(t.slice(0,i.index)),a.push(e(r[i[1]],r)),t=t.slice(i.index+i[0].length)}return a.push(t),a}(r[0],r)}function n(e,t){if(t&&t.flat){var r,n=t&&t.escape||"___",i=e[0];if(!i)return"";for(var a=new RegExp("\\"+n+"([0-9]+)\\"+n),o=0;i!=r;){if(o++>1e4)throw Error("Circular references in "+e);r=i,i=i.replace(a,s)}return i}return e.reduce((function e(t,r){return Array.isArray(r)&&(r=r.reduce(e,"")),t+r}),"");function s(t,r){if(null==e[r])throw Error("Reference "+r+"is undefined");return e[r]}}function i(e,t){return Array.isArray(e)?n(e,t):r(e,t)}i.parse=r,i.stringify=n,t.exports=i}}),Wv=p({"node_modules/string-split-by/index.js"(e,t){var r=Gv();t.exports=function(e,t,n){if(null==e)throw Error("First argument should be a string");if(null==t)throw Error("Separator should be a string or a RegExp");n?("string"===typeof n||Array.isArray(n))&&(n={ignore:n}):n={},null==n.escape&&(n.escape=!0),null==n.ignore?n.ignore=["[]","()","{}","<>",'""',"''","``","\u201c\u201d","\xab\xbb"]:("string"===typeof n.ignore&&(n.ignore=[n.ignore]),n.ignore=n.ignore.map((function(e){return 1===e.length&&(e+=e),e})));var i=r.parse(e,{flat:!0,brackets:n.ignore}),a=i[0].split(t);if(n.escape){for(var o=[],s=0;s<a.length;s++){var l=a[s],c=a[s+1];"\\"===l[l.length-1]&&"\\"!==l[l.length-2]?(o.push(l+t+c),s++):o.push(l)}a=o}for(s=0;s<a.length;s++)i[0]=a[s],a[s]=r.stringify(i,{flat:!0});return a}}}),$v=p({"node_modules/css-font-size-keywords/index.json"(){}}),Zv=p({"node_modules/css-font/lib/util.js"(e,t){var r=$v();t.exports={isSize:function(e){return/^[\d\.]/.test(e)||-1!==e.indexOf("/")||-1!==r.indexOf(e)}}}}),Xv=p({"node_modules/css-font/parse.js"(e,t){var r=Bv(),n=Nv(),i=Uv(),a=Vv(),o=qv(),s=Hv(),l=Wv(),c=Zv().isSize;t.exports=h;var u=h.cache={};function h(e){if("string"!==typeof e)throw new Error("Font argument must be a string.");if(u[e])return u[e];if(""===e)throw new Error("Cannot parse an empty string.");if(-1!==i.indexOf(e))return u[e]={system:e};for(var t,h={style:"normal",variant:"normal",weight:"normal",stretch:"normal",lineHeight:"normal",size:"1rem",family:["serif"]},d=l(e,/\s+/);t=d.shift();){if(-1!==n.indexOf(t))return["style","variant","weight","stretch"].forEach((function(e){h[e]=t})),u[e]=h;if(-1===o.indexOf(t))if("normal"!==t&&"small-caps"!==t)if(-1===s.indexOf(t)){if(-1===a.indexOf(t)){if(c(t)){var f=l(t,"/");if(h.size=f[0],null!=f[1]?h.lineHeight=p(f[1]):"/"===d[0]&&(d.shift(),h.lineHeight=p(d.shift())),!d.length)throw new Error("Missing required font-family.");return h.family=l(d.join(" "),/\s*,\s*/).map(r),u[e]=h}throw new Error("Unknown or unsupported font token: "+t)}h.weight=t}else h.stretch=t;else h.variant=t;else h.style=t}throw new Error("Missing required font-size.")}function p(e){var t=parseFloat(e);return t.toString()===e?t:e}}}),Yv=p({"node_modules/css-font/stringify.js"(e,t){var r=Bg(),n=Zv().isSize,i=f(Nv()),a=f(Uv()),o=f(Vv()),s=f(qv()),l=f(Hv()),c={normal:1,"small-caps":1},u={serif:1,"sans-serif":1,monospace:1,cursive:1,fantasy:1,"system-ui":1},h="1rem",p="serif";function d(e,t){if(e&&!t[e]&&!i[e])throw Error("Unknown keyword `"+e+"`");return e}function f(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=1;return t}t.exports=function(e){if((e=r(e,{style:"style fontstyle fontStyle font-style slope distinction",variant:"variant font-variant fontVariant fontvariant var capitalization",weight:"weight w font-weight fontWeight fontweight",stretch:"stretch font-stretch fontStretch fontstretch width",size:"size s font-size fontSize fontsize height em emSize",lineHeight:"lh line-height lineHeight lineheight leading",family:"font family fontFamily font-family fontfamily type typeface face",system:"system reserved default global"})).system)return e.system&&d(e.system,a),e.system;if(d(e.style,s),d(e.variant,c),d(e.weight,o),d(e.stretch,l),null==e.size&&(e.size=h),"number"===typeof e.size&&(e.size+="px"),!n)throw Error("Bad size value `"+e.size+"`");e.family||(e.family=p),Array.isArray(e.family)&&(e.family.length||(e.family=[p]),e.family=e.family.map((function(e){return u[e]?e:'"'+e+'"'})).join(", "));var t=[];return t.push(e.style),e.variant!==e.style&&t.push(e.variant),e.weight!==e.variant&&e.weight!==e.style&&t.push(e.weight),e.stretch!==e.weight&&e.stretch!==e.variant&&e.stretch!==e.style&&t.push(e.stretch),t.push(e.size+(null==e.lineHeight||"normal"===e.lineHeight||e.lineHeight+""==="1"?"":"/"+e.lineHeight)),t.push(e.family),t.filter(Boolean).join(" ")}}}),Kv=p({"node_modules/css-font/index.js"(e,t){t.exports={parse:Xv(),stringify:Yv()}}}),Jv=p({"node_modules/regl/dist/regl.unchecked.js"(e,t){var r,n;r=e,n=function(){var e=function(e,t){for(var r=Object.keys(t),n=0;n<r.length;++n)e[r[n]]=t[r[n]];return e},t=0;function r(e,r){this.id=t++,this.type=e,this.data=r}function n(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function i(e){if(0===e.length)return[];var t=e.charAt(0),r=e.charAt(e.length-1);if(e.length>1&&t===r&&('"'===t||"'"===t))return['"'+n(e.substr(1,e.length-2))+'"'];var a=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(a)return i(e.substr(0,a.index)).concat(i(a[1])).concat(i(e.substr(a.index+a[0].length)));var o=e.split(".");if(1===o.length)return['"'+n(e)+'"'];for(var s=[],l=0;l<o.length;++l)s=s.concat(i(o[l]));return s}function a(e){return"["+i(e).join("][")+"]"}var o={DynamicVariable:r,define:function(e,t){return new r(e,a(t+""))},isDynamic:function(e){return"function"===typeof e&&!e._reglType||e instanceof r},unbox:function e(t,n){return"function"===typeof t?new r(0,t):"number"===typeof t||"boolean"===typeof t?new r(5,t):Array.isArray(t)?new r(6,t.map((function(t,r){return e(t,n+"["+r+"]")}))):t instanceof r?t:void 0},accessor:a},s={next:"function"===typeof requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,16)},cancel:"function"===typeof cancelAnimationFrame?function(e){return cancelAnimationFrame(e)}:clearTimeout},l="undefined"!==typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function c(e){return"string"===typeof e?e.split():e}function u(e){return"string"===typeof e?document.querySelector(e):e}function h(t){var r,n,i,a,o,s=t||{},l={},h=[],p=[],d="undefined"===typeof window?1:window.devicePixelRatio,f=!1,m={},g=function(e){},y=function(){};if("string"===typeof s?r=document.querySelector(s):"object"===typeof s&&("string"===typeof(o=s).nodeName&&"function"===typeof o.appendChild&&"function"===typeof o.getBoundingClientRect?r=s:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(s)?i=(a=s).canvas:("gl"in s?a=s.gl:"canvas"in s?i=u(s.canvas):"container"in s&&(n=u(s.container)),"attributes"in s&&(l=s.attributes),"extensions"in s&&(h=c(s.extensions)),"optionalExtensions"in s&&(p=c(s.optionalExtensions)),"onDone"in s&&(g=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(d=+s.pixelRatio),"cachedCode"in s&&(m=s.cachedCode))),r&&("canvas"===r.nodeName.toLowerCase()?i=r:n=r),!a){if(!i){var v=function(t,r,n){var i,a=document.createElement("canvas");function o(){var e=window.innerWidth,r=window.innerHeight;if(t!==document.body){var i=a.getBoundingClientRect();e=i.right-i.left,r=i.bottom-i.top}a.width=n*e,a.height=n*r}return e(a.style,{border:0,margin:0,padding:0,top:0,left:0,width:"100%",height:"100%"}),t.appendChild(a),t===document.body&&(a.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"===typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(o)}))).observe(t):window.addEventListener("resize",o,!1),o(),{canvas:a,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",o),t.removeChild(a)}}}(n||document.body,0,d);if(!v)return null;i=v.canvas,y=v.onDestroy}void 0===l.premultipliedAlpha&&(l.premultipliedAlpha=!0),a=function(e,t){function r(r){try{return e.getContext(r,t)}catch(n){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(i,l)}return a?{gl:a,canvas:i,container:n,extensions:h,optionalExtensions:p,pixelRatio:d,profile:f,cachedCode:m,onDone:g,onDestroy:y}:(y(),g("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function p(e,t){for(var r=Array(e),n=0;n<e;++n)r[n]=t(n);return r}function d(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1}function f(){var e=p(8,(function(){return[]}));function t(t){var r=function(e){for(var t=16;t<=1<<28;t*=16)if(e<=t)return t;return 0}(t),n=e[d(r)>>2];return n.length>0?n.pop():new ArrayBuffer(r)}function r(t){e[d(t.byteLength)>>2].push(t)}return{alloc:t,free:r,allocType:function(e,r){var n=null;switch(e){case 5120:n=new Int8Array(t(r),0,r);break;case 5121:n=new Uint8Array(t(r),0,r);break;case 5122:n=new Int16Array(t(2*r),0,r);break;case 5123:n=new Uint16Array(t(2*r),0,r);break;case 5124:n=new Int32Array(t(4*r),0,r);break;case 5125:n=new Uint32Array(t(4*r),0,r);break;case 5126:n=new Float32Array(t(4*r),0,r);break;default:return null}return n.length!==r?n.subarray(0,r):n},freeType:function(e){r(e.buffer)}}}var m=f();m.zero=f();var g=3553,y=6408,v=5126,x=36160,b=function(e){return e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Float32Array||e instanceof Float64Array||e instanceof Uint8ClampedArray};function _(e){return!!e&&"object"===typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"===typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||b(e.data))}var w=function(e){return Object.keys(e).map((function(t){return e[t]}))},k={shape:function(e){for(var t=[],r=e;r.length;r=r[0])t.push(r.length);return t},flatten:function(e,t,r,n){var i=1;if(t.length)for(var a=0;a<t.length;++a)i*=t[a];else i=0;var o=n||m.allocType(r,i);switch(t.length){case 0:break;case 1:!function(e,t,r){for(var n=0;n<t;++n)r[n]=e[n]}(e,t[0],o);break;case 2:!function(e,t,r,n){for(var i=0,a=0;a<t;++a)for(var o=e[a],s=0;s<r;++s)n[i++]=o[s]}(e,t[0],t[1],o);break;case 3:T(e,t[0],t[1],t[2],o,0);break;default:S(e,t,0,o,0)}return o}};function T(e,t,r,n,i,a){for(var o=a,s=0;s<t;++s)for(var l=e[s],c=0;c<r;++c)for(var u=l[c],h=0;h<n;++h)i[o++]=u[h]}function S(e,t,r,n,i){for(var a=1,o=r+1;o<t.length;++o)a*=t[o];var s=t[r];if(t.length-r===4){var l=t[r+1],c=t[r+2],u=t[r+3];for(o=0;o<s;++o)T(e[o],l,c,u,n,i),i+=a}else for(o=0;o<s;++o)S(e[o],t,r+1,n,i),i+=a}var A={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},M={int8:5120,int16:5122,int32:5124,uint8:5121,uint16:5123,uint32:5125,float:5126,float32:5126},E={dynamic:35048,stream:35040,static:35044},C=k.flatten,P=k.shape,L=5121,I=5126,z=[];function O(e){return 0|A[Object.prototype.toString.call(e)]}function R(e,t){for(var r=0;r<t.length;++r)e[r]=t[r]}function D(e,t,r,n,i,a,o){for(var s=0,l=0;l<r;++l)for(var c=0;c<n;++c)e[s++]=t[i*l+a*c+o]}z[5120]=1,z[5122]=2,z[5124]=4,z[5121]=1,z[5123]=2,z[5125]=4,z[5126]=4;var j={points:0,point:0,lines:1,line:1,triangles:4,triangle:4,"line loop":2,"line strip":3,"triangle strip":5,"triangle fan":6},F=5121,B=5123,N=5125,U=34963,V=new Float32Array(1),q=new Uint32Array(V.buffer);function H(e){for(var t=m.allocType(5123,e.length),r=0;r<e.length;++r)if(isNaN(e[r]))t[r]=65535;else if(e[r]===1/0)t[r]=31744;else if(e[r]===-1/0)t[r]=64512;else{V[0]=e[r];var n=q[0],i=n>>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)t[r]=i;else if(a<-14){var s=-14-a;t[r]=i+(o+1024>>s)}else t[r]=a>15?i+31744:i+(a+15<<10)+o}return t}function G(e){return Array.isArray(e)||b(e)}var W=3553,$=34067,Z=34069,X=6408,Y=6406,K=6407,J=6409,Q=6410,ee=32855,te=6402,re=34041,ne=35904,ie=35906,ae=36193,oe=33776,se=33777,le=33778,ce=33779,ue=5121,he=5123,pe=5125,de=5126,fe=33071,me=9728,ge=9984,ye=9987,ve=4352,xe=33984,be=[ge,9986,9985,ye],_e=[0,J,Q,K,X],we={};function ke(e){return"[object "+e+"]"}we[6409]=we[6406]=we[6402]=1,we[34041]=we[6410]=2,we[6407]=we[35904]=3,we[6408]=we[35906]=4;var Te=ke("HTMLCanvasElement"),Se=ke("OffscreenCanvas"),Ae=ke("CanvasRenderingContext2D"),Me=ke("ImageBitmap"),Ee=ke("HTMLImageElement"),Ce=ke("HTMLVideoElement"),Pe=Object.keys(A).concat([Te,Se,Ae,Me,Ee,Ce]),Le=[];Le[5121]=1,Le[5126]=4,Le[36193]=2,Le[5123]=2,Le[5125]=4;var Ie=[];function ze(e){return Array.isArray(e)&&(0===e.length||"number"===typeof e[0])}function Oe(e){return!!Array.isArray(e)&&!(0===e.length||!G(e[0]))}function Re(e){return Object.prototype.toString.call(e)}function De(e){return Re(e)===Te}function je(e){return Re(e)===Se}function Fe(e){if(!e)return!1;var t=Re(e);return Pe.indexOf(t)>=0||ze(e)||Oe(e)||_(e)}function Be(e){return 0|A[Object.prototype.toString.call(e)]}function Ne(e,t){return m.allocType(e.type===ae?de:e.type,t)}function Ue(e,t){e.type===ae?(e.data=H(t),m.freeType(t)):e.data=t}function Ve(e,t,r,n,i,a){var o;if(o="undefined"!==typeof Ie[e]?Ie[e]:we[e]*Le[t],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function qe(t,r,n,i,a,o,s){var l={"don't care":ve,"dont care":ve,nice:4354,fast:4353},c={repeat:10497,clamp:fe,mirror:33648},u={nearest:me,linear:9729},h=e({mipmap:ye,"nearest mipmap nearest":ge,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":ye},u),p={none:0,browser:37444},d={uint8:ue,rgba4:32819,rgb565:33635,"rgb5 a1":32820},f={alpha:Y,luminance:J,"luminance alpha":Q,rgb:K,rgba:X,rgba4:32854,"rgb5 a1":ee,rgb565:36194},g={};r.ext_srgb&&(f.srgb=ne,f.srgba=ie),r.oes_texture_float&&(d.float32=d.float=de),r.oes_texture_half_float&&(d.float16=d["half float"]=ae),r.webgl_depth_texture&&(e(f,{depth:te,"depth stencil":re}),e(d,{uint16:he,uint32:pe,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(g,{"rgb s3tc dxt1":oe,"rgba s3tc dxt1":se,"rgba s3tc dxt3":le,"rgba s3tc dxt5":ce}),r.webgl_compressed_texture_atc&&e(g,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(g,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(g["rgb etc1"]=36196);var y=Array.prototype.slice.call(t.getParameter(34467));Object.keys(g).forEach((function(e){var t=g[e];y.indexOf(t)>=0&&(f[e]=t)}));var v=Object.keys(f);n.textureFormats=v;var x=[];Object.keys(f).forEach((function(e){var t=f[e];x[t]=e}));var T=[];Object.keys(d).forEach((function(e){var t=d[e];T[t]=e}));var S=[];Object.keys(u).forEach((function(e){S[u[e]]=e}));var A=[];Object.keys(h).forEach((function(e){var t=h[e];A[t]=e}));var M=[];Object.keys(c).forEach((function(e){M[c[e]]=e}));var E=v.reduce((function(e,t){var n=f[t];return n===J||n===Y||n===J||n===Q||n===te||n===re||r.ext_srgb&&(n===ne||n===ie)?e[n]=n:n===ee||t.indexOf("rgba")>=0?e[n]=X:e[n]=K,e}),{});function C(){this.internalformat=X,this.format=X,this.type=ue,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function P(e,t){e.internalformat=t.internalformat,e.format=t.format,e.type=t.type,e.compressed=t.compressed,e.premultiplyAlpha=t.premultiplyAlpha,e.flipY=t.flipY,e.unpackAlignment=t.unpackAlignment,e.colorSpace=t.colorSpace,e.width=t.width,e.height=t.height,e.channels=t.channels}function L(e,t){if("object"===typeof t&&t){if("premultiplyAlpha"in t&&(e.premultiplyAlpha=t.premultiplyAlpha),"flipY"in t&&(e.flipY=t.flipY),"alignment"in t&&(e.unpackAlignment=t.alignment),"colorSpace"in t&&(e.colorSpace=p[t.colorSpace]),"type"in t){var r=t.type;e.type=d[r]}var n=e.width,i=e.height,a=e.channels,o=!1;"shape"in t?(n=t.shape[0],i=t.shape[1],3===t.shape.length&&(a=t.shape[2],o=!0)):("radius"in t&&(n=i=t.radius),"width"in t&&(n=t.width),"height"in t&&(i=t.height),"channels"in t&&(a=t.channels,o=!0)),e.width=0|n,e.height=0|i,e.channels=0|a;var s=!1;if("format"in t){var l=t.format,c=e.internalformat=f[l];e.format=E[c],l in d&&("type"in t||(e.type=d[l])),l in g&&(e.compressed=!0),s=!0}!o&&s?e.channels=we[e.format]:o&&!s&&e.channels!==_e[e.format]&&(e.format=e.internalformat=_e[e.channels])}}function I(e){t.pixelStorei(37440,e.flipY),t.pixelStorei(37441,e.premultiplyAlpha),t.pixelStorei(37443,e.colorSpace),t.pixelStorei(3317,e.unpackAlignment)}function z(){C.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function O(e,t){var r=null;if(Fe(t)?r=t:t&&(L(e,t),"x"in t&&(e.xOffset=0|t.x),"y"in t&&(e.yOffset=0|t.y),Fe(t.data)&&(r=t.data)),t.copy){var n=a.viewportWidth,i=a.viewportHeight;e.width=e.width||n-e.xOffset,e.height=e.height||i-e.yOffset,e.needsCopy=!0}else if(r){if(b(r))e.channels=e.channels||4,e.data=r,"type"in t||e.type!==ue||(e.type=Be(r));else if(ze(r))e.channels=e.channels||4,function(e,t){var r=t.length;switch(e.type){case ue:case he:case pe:case de:var n=m.allocType(e.type,r);n.set(t),e.data=n;break;case ae:e.data=H(t)}}(e,r),e.alignment=1,e.needsFree=!0;else if(_(r)){var o=r.data;Array.isArray(o)||e.type!==ue||(e.type=Be(o));var s,l,c,u,h,p,d=r.shape,f=r.stride;3===d.length?(c=d[2],p=f[2]):(c=1,p=1),s=d[0],l=d[1],u=f[0],h=f[1],e.alignment=1,e.width=s,e.height=l,e.channels=c,e.format=e.internalformat=_e[c],e.needsFree=!0,function(e,t,r,n,i,a){for(var o=e.width,s=e.height,l=e.channels,c=Ne(e,o*s*l),u=0,h=0;h<s;++h)for(var p=0;p<o;++p)for(var d=0;d<l;++d)c[u++]=t[r*p+n*h+i*d+a];Ue(e,c)}(e,o,u,h,p,r.offset)}else if(De(r)||je(r)||Re(r)===Ae)De(r)||je(r)?e.element=r:e.element=r.canvas,e.width=e.element.width,e.height=e.element.height,e.channels=4;else if(function(e){return Re(e)===Me}(r))e.element=r,e.width=r.width,e.height=r.height,e.channels=4;else if(function(e){return Re(e)===Ee}(r))e.element=r,e.width=r.naturalWidth,e.height=r.naturalHeight,e.channels=4;else if(function(e){return Re(e)===Ce}(r))e.element=r,e.width=r.videoWidth,e.height=r.videoHeight,e.channels=4;else if(Oe(r)){var g=e.width||r[0].length,y=e.height||r.length,v=e.channels;v=G(r[0][0])?v||r[0][0].length:v||1;for(var x=k.shape(r),w=1,T=0;T<x.length;++T)w*=x[T];var S=Ne(e,w);k.flatten(r,x,"",S),Ue(e,S),e.alignment=1,e.width=g,e.height=y,e.channels=v,e.format=e.internalformat=_e[v],e.needsFree=!0}}else e.width=e.width||1,e.height=e.height||1,e.channels=e.channels||4;e.type===de||e.type}function R(e,r,n){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,u=e.width,h=e.height;I(e),a?t.texImage2D(r,n,l,l,c,a):e.compressed?t.compressedTexImage2D(r,n,s,u,h,0,o):e.needsCopy?(i(),t.copyTexImage2D(r,n,l,e.xOffset,e.yOffset,u,h,0)):t.texImage2D(r,n,l,u,h,0,l,c,o||null)}function D(e,r,n,a,o){var s=e.element,l=e.data,c=e.internalformat,u=e.format,h=e.type,p=e.width,d=e.height;I(e),s?t.texSubImage2D(r,o,n,a,u,h,s):e.compressed?t.compressedTexSubImage2D(r,o,n,a,c,p,d,l):e.needsCopy?(i(),t.copyTexSubImage2D(r,o,n,a,e.xOffset,e.yOffset,p,d)):t.texSubImage2D(r,o,n,a,p,d,u,h,l)}var j=[];function F(){return j.pop()||new z}function B(e){e.needsFree&&m.freeType(e.data),z.call(e),j.push(e)}function N(){C.call(this),this.genMipmaps=!1,this.mipmapHint=ve,this.mipmask=0,this.images=Array(16)}function U(e,t,r){var n=e.images[0]=F();e.mipmask=1,n.width=e.width=t,n.height=e.height=r,n.channels=e.channels=4}function V(e,t){var r=null;if(Fe(t))P(r=e.images[0]=F(),e),O(r,t),e.mipmask=1;else if(L(e,t),Array.isArray(t.mipmap))for(var n=t.mipmap,i=0;i<n.length;++i)P(r=e.images[i]=F(),e),r.width>>=i,r.height>>=i,O(r,n[i]),e.mipmask|=1<<i;else P(r=e.images[0]=F(),e),O(r,t),e.mipmask=1;P(e,e.images[0]),e.compressed&&(e.internalformat===oe||e.internalformat===se||e.internalformat===le||e.internalformat)}function q(e,t){for(var r=e.images,n=0;n<r.length;++n){if(!r[n])return;R(r[n],t,n)}}var ke=[];function Te(){var e=ke.pop()||new N;C.call(e),e.mipmask=0;for(var t=0;t<16;++t)e.images[t]=null;return e}function Se(e){for(var t=e.images,r=0;r<t.length;++r)t[r]&&B(t[r]),t[r]=null;ke.push(e)}function Pe(){this.minFilter=me,this.magFilter=me,this.wrapS=fe,this.wrapT=fe,this.anisotropic=1,this.genMipmaps=!1,this.mipmapHint=ve}function Le(e,t){if("min"in t){var r=t.min;e.minFilter=h[r],be.indexOf(e.minFilter)>=0&&!("faces"in t)&&(e.genMipmaps=!0)}if("mag"in t){var n=t.mag;e.magFilter=u[n]}var i=e.wrapS,a=e.wrapT;if("wrap"in t){var o=t.wrap;"string"===typeof o?i=a=c[o]:Array.isArray(o)&&(i=c[o[0]],a=c[o[1]])}else{if("wrapS"in t){var s=t.wrapS;i=c[s]}if("wrapT"in t){var p=t.wrapT;a=c[p]}}if(e.wrapS=i,e.wrapT=a,"anisotropic"in t&&(t.anisotropic,e.anisotropic=t.anisotropic),"mipmap"in t){var d=!1;switch(typeof t.mipmap){case"string":e.mipmapHint=l[t.mipmap],e.genMipmaps=!0,d=!0;break;case"boolean":d=e.genMipmaps=t.mipmap;break;case"object":e.genMipmaps=!1,d=!0}d&&!("min"in t)&&(e.minFilter=ge)}}function Ie(e,n){t.texParameteri(n,10241,e.minFilter),t.texParameteri(n,10240,e.magFilter),t.texParameteri(n,10242,e.wrapS),t.texParameteri(n,10243,e.wrapT),r.ext_texture_filter_anisotropic&&t.texParameteri(n,34046,e.anisotropic),e.genMipmaps&&(t.hint(33170,e.mipmapHint),t.generateMipmap(n))}var qe=0,He={},Ge=n.maxTextureUnits,We=Array(Ge).map((function(){return null}));function $e(e){C.call(this),this.mipmask=0,this.internalformat=X,this.id=qe++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new Pe,s.profile&&(this.stats={size:0})}function Ze(e){t.activeTexture(xe),t.bindTexture(e.target,e.texture)}function Xe(){var e=We[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(W,null)}function Ye(e){var r=e.texture,n=e.unit,i=e.target;n>=0&&(t.activeTexture(xe+n),t.bindTexture(i,null),We[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete He[e.id],o.textureCount--}return e($e.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n<Ge;++n){var i=We[n];if(i){if(i.bindCount>0)continue;i.unit=-1}We[n]=e,r=n;break}s.profile&&o.maxTextureUnits<r+1&&(o.maxTextureUnits=r+1),e.unit=r,t.activeTexture(xe+r),t.bindTexture(e.target,e.texture)}return r},unbind:function(){this.bindCount-=1},decRef:function(){--this.refCount<=0&&Ye(this)}}),s.profile&&(o.getTotalTextureSize=function(){var e=0;return Object.keys(He).forEach((function(t){e+=He[t].stats.size})),e}),{create2D:function(e,r){var n=new $e(W);function i(e,t){var r=n.texInfo;Pe.call(r);var a=Te();return"number"===typeof e?U(a,0|e,"number"===typeof t?0|t:0|e):e?(Le(r,e),V(a,e)):U(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),n.mipmask=a.mipmask,P(n,a),n.internalformat=a.internalformat,i.width=a.width,i.height=a.height,Ze(n),q(a,W),Ie(r,W),Xe(),Se(a),s.profile&&(n.stats.size=Ve(n.internalformat,n.type,a.width,a.height,r.genMipmaps,!1)),i.format=x[n.internalformat],i.type=T[n.type],i.mag=S[r.magFilter],i.min=A[r.minFilter],i.wrapS=M[r.wrapS],i.wrapT=M[r.wrapT],i}return He[n.id]=n,o.textureCount++,i(e,r),i.subimage=function(e,t,r,a){var o=0|t,s=0|r,l=0|a,c=F();return P(c,n),c.width=0,c.height=0,O(c,e),c.width=c.width||(n.width>>l)-o,c.height=c.height||(n.height>>l)-s,Ze(n),D(c,W,o,s,l),Xe(),B(c),i},i.resize=function(e,r){var a=0|e,o=0|r||a;if(a===n.width&&o===n.height)return i;i.width=n.width=a,i.height=n.height=o,Ze(n);for(var l=0;n.mipmask>>l;++l){var c=a>>l,u=o>>l;if(!c||!u)break;t.texImage2D(W,l,n.format,c,u,0,n.format,n.type,null)}return Xe(),s.profile&&(n.stats.size=Ve(n.internalformat,n.type,a,o,!1,!1)),i},i._reglType="texture2d",i._texture=n,s.profile&&(i.stats=n.stats),i.destroy=function(){n.decRef()},i},createCube:function(e,r,n,i,a,l){var c=new $e($);He[c.id]=c,o.cubeCount++;var u=new Array(6);function h(e,t,r,n,i,a){var o,l=c.texInfo;for(Pe.call(l),o=0;o<6;++o)u[o]=Te();if("number"!==typeof e&&e){if("object"===typeof e)if(t)V(u[0],e),V(u[1],t),V(u[2],r),V(u[3],n),V(u[4],i),V(u[5],a);else if(Le(l,e),L(c,e),"faces"in e){var p=e.faces;for(o=0;o<6;++o)P(u[o],c),V(u[o],p[o])}else for(o=0;o<6;++o)V(u[o],e)}else{var d=0|e||1;for(o=0;o<6;++o)U(u[o],d,d)}for(P(c,u[0]),l.genMipmaps?c.mipmask=(u[0].width<<1)-1:c.mipmask=u[0].mipmask,c.internalformat=u[0].internalformat,h.width=u[0].width,h.height=u[0].height,Ze(c),o=0;o<6;++o)q(u[o],Z+o);for(Ie(l,$),Xe(),s.profile&&(c.stats.size=Ve(c.internalformat,c.type,h.width,h.height,l.genMipmaps,!0)),h.format=x[c.internalformat],h.type=T[c.type],h.mag=S[l.magFilter],h.min=A[l.minFilter],h.wrapS=M[l.wrapS],h.wrapT=M[l.wrapT],o=0;o<6;++o)Se(u[o]);return h}return h(e,r,n,i,a,l),h.subimage=function(e,t,r,n,i){var a=0|r,o=0|n,s=0|i,l=F();return P(l,c),l.width=0,l.height=0,O(l,t),l.width=l.width||(c.width>>s)-a,l.height=l.height||(c.height>>s)-o,Ze(c),D(l,Z+e,a,o,s),Xe(),B(l),h},h.resize=function(e){var r=0|e;if(r!==c.width){h.width=c.width=r,h.height=c.height=r,Ze(c);for(var n=0;n<6;++n)for(var i=0;c.mipmask>>i;++i)t.texImage2D(Z+n,i,c.format,r>>i,r>>i,0,c.format,c.type,null);return Xe(),s.profile&&(c.stats.size=Ve(c.internalformat,c.type,h.width,h.height,!1,!0)),h}},h._reglType="textureCube",h._texture=c,s.profile&&(h.stats=c.stats),h.destroy=function(){c.decRef()},h},clear:function(){for(var e=0;e<Ge;++e)t.activeTexture(xe+e),t.bindTexture(W,null),We[e]=null;w(He).forEach(Ye),o.cubeCount=0,o.textureCount=0},getTexture:function(e){return null},restore:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null)}w(He).forEach((function(e){e.texture=t.createTexture(),t.bindTexture(e.target,e.texture);for(var r=0;r<32;++r)if(0!==(e.mipmask&1<<r))if(e.target===W)t.texImage2D(W,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(Z+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);Ie(e.texInfo,e.target)}))},refresh:function(){for(var e=0;e<Ge;++e){var r=We[e];r&&(r.bindCount=0,r.unit=-1,We[e]=null),t.activeTexture(xe+e),t.bindTexture(W,null),t.bindTexture($,null)}}}}Ie[32854]=2,Ie[32855]=2,Ie[36194]=2,Ie[34041]=4,Ie[33776]=.5,Ie[33777]=.5,Ie[33778]=1,Ie[33779]=1,Ie[35986]=.5,Ie[35987]=1,Ie[34798]=1,Ie[35840]=.5,Ie[35841]=.25,Ie[35842]=.5,Ie[35843]=.25,Ie[36196]=.5;var He=36161,Ge=32854,We=[];function $e(e,t,r){return We[e]*t*r}We[32854]=2,We[32855]=2,We[36194]=2,We[33189]=2,We[36168]=1,We[34041]=4,We[35907]=4,We[34836]=16,We[34842]=8,We[34843]=6;var Ze=36160,Xe=36161,Ye=3553,Ke=[];Ke[6408]=4,Ke[6407]=3;var Je=[];Je[5121]=1,Je[5126]=4,Je[36193]=2;var Qe=34963;function et(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.offset=0,this.stride=0,this.divisor=0}var tt=5121;function rt(e,t,r,n,i,a,o){function s(i){var a;a=null===t.next?tt:t.next.colorAttachments[0].texture._texture.type;var o=0,s=0,l=n.framebufferWidth,c=n.framebufferHeight,u=null;b(i)?u=i:i&&(o=0|i.x,s=0|i.y,l=0|(i.width||n.framebufferWidth-o),c=0|(i.height||n.framebufferHeight-s),u=i.data||null),r();var h=l*c*4;return u||(a===tt?u=new Uint8Array(h):5126===a&&(u=u||new Float32Array(h))),e.pixelStorei(3333,4),e.readPixels(o,s,l,c,6408,a,u),u}return function(e){return e&&"framebuffer"in e?function(e){var r;return t.setFBO({framebuffer:e.framebuffer},(function(){r=s(e)})),r}(e):s(e)}}function nt(e){return function(e){for(var t,r="0123456789abcdef",n="",i=0;i<e.length;i++)t=e.charCodeAt(i),n+=r.charAt(t>>>4&15)+r.charAt(15&t);return n}(function(e){return at(ft(it(e),8*e.length))}(function(e){for(var t,r,n="",i=-1;++i<e.length;)t=e.charCodeAt(i),r=i+1<e.length?e.charCodeAt(i+1):0,55296<=t&&t<=56319&&56320<=r&&r<=57343&&(t=65536+((1023&t)<<10)+(1023&r),i++),t<=127?n+=String.fromCharCode(t):t<=2047?n+=String.fromCharCode(192|t>>>6&31,128|63&t):t<=65535?n+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(n+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return n}(e)))}function it(e){for(var t=Array(e.length>>2),r=0;r<t.length;r++)t[r]=0;for(r=0;r<8*e.length;r+=8)t[r>>5]|=(255&e.charCodeAt(r/8))<<24-r%32;return t}function at(e){for(var t="",r=0;r<32*e.length;r+=8)t+=String.fromCharCode(e[r>>5]>>>24-r%32&255);return t}function ot(e,t){return e>>>t|e<<32-t}function st(e,t){return e>>>t}function lt(e,t,r){return e&t^~e&r}function ct(e,t,r){return e&t^e&r^t&r}function ut(e){return ot(e,2)^ot(e,13)^ot(e,22)}function ht(e){return ot(e,6)^ot(e,11)^ot(e,25)}function pt(e){return ot(e,7)^ot(e,18)^st(e,3)}var dt=new Array(1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998);function ft(e,t){var r,n,i,a,o,s,l,c,u,h,p,d,f,m=new Array(1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225),g=new Array(64);for(e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t,u=0;u<e.length;u+=16){for(r=m[0],n=m[1],i=m[2],a=m[3],o=m[4],s=m[5],l=m[6],c=m[7],h=0;h<64;h++)g[h]=h<16?e[h+u]:mt(mt(mt(ot(f=g[h-2],17)^ot(f,19)^st(f,10),g[h-7]),pt(g[h-15])),g[h-16]),p=mt(mt(mt(mt(c,ht(o)),lt(o,s,l)),dt[h]),g[h]),d=mt(ut(r),ct(r,n,i)),c=l,l=s,s=o,o=mt(a,p),a=i,i=n,n=r,r=mt(p,d);m[0]=mt(r,m[0]),m[1]=mt(n,m[1]),m[2]=mt(i,m[2]),m[3]=mt(a,m[3]),m[4]=mt(o,m[4]),m[5]=mt(s,m[5]),m[6]=mt(l,m[6]),m[7]=mt(c,m[7])}return m}function mt(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function gt(e){return Array.prototype.slice.call(e)}function yt(e){return gt(e).join("")}var vt="xyzw".split(""),xt="dither",bt="blend.enable",_t="blend.color",wt="blend.equation",kt="blend.func",Tt="depth.enable",St="depth.func",At="depth.range",Mt="depth.mask",Et="colorMask",Ct="cull.enable",Pt="cull.face",Lt="frontFace",It="lineWidth",zt="polygonOffset.enable",Ot="polygonOffset.offset",Rt="sample.alpha",Dt="sample.enable",jt="sample.coverage",Ft="stencil.enable",Bt="stencil.mask",Nt="stencil.func",Ut="stencil.opFront",Vt="stencil.opBack",qt="scissor.enable",Ht="scissor.box",Gt="viewport",Wt="profile",$t="framebuffer",Zt="vert",Xt="frag",Yt="elements",Kt="primitive",Jt="count",Qt="offset",er="instances",tr="vao",rr="Width",nr="Height",ir=$t+rr,ar=$t+nr,or=Gt+rr,sr=Gt+nr,lr="drawingBuffer",cr=lr+rr,ur=lr+nr,hr=[kt,wt,Nt,Ut,Vt,jt,Gt,Ht,Ot],pr=34962,dr=34963,fr=35664,mr=35665,gr=35666,yr=35667,vr=35668,xr=35669,br=35671,_r=35672,wr=35673,kr=35674,Tr=35675,Sr=35676,Ar=35678,Mr=35680,Er=1028,Cr=1029,Pr=2305,Lr=7680,Ir={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},zr={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Or={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},Rr={cw:2304,ccw:Pr};function Dr(e){return Array.isArray(e)||b(e)||_(e)}function jr(e){return e.sort((function(e,t){return e===Gt?-1:t===Gt?1:e<t?-1:1}))}function Fr(e,t,r,n){this.thisDep=e,this.contextDep=t,this.propDep=r,this.append=n}function Br(e){return e&&!(e.thisDep||e.contextDep||e.propDep)}function Nr(e){return new Fr(!1,!1,!1,e)}function Ur(e,t){var r=e.type;if(0===r){var n=e.data.length;return new Fr(!0,n>=1,n>=2,t)}if(4===r){var i=e.data;return new Fr(i.thisDep,i.contextDep,i.propDep,t)}if(5===r)return new Fr(!1,!1,!1,t);if(6===r){for(var a=!1,o=!1,s=!1,l=0;l<e.data.length;++l){var c=e.data[l];if(1===c.type)s=!0;else if(2===c.type)o=!0;else if(3===c.type)a=!0;else if(0===c.type){a=!0;var u=c.data;u>=1&&(o=!0),u>=2&&(s=!0)}else 4===c.type&&(a=a||c.data.thisDep,o=o||c.data.contextDep,s=s||c.data.propDep)}return new Fr(a,o,s,t)}return new Fr(3===r,2===r,1===r,t)}var Vr=new Fr(!1,!1,!1,(function(){}));function qr(t,r,n,i,a,s,l,c,u,h,d,f,m,g,y,v){var x=h.Record,b={add:32774,subtract:32778,"reverse subtract":32779};n.ext_blend_minmax&&(b.min=32775,b.max=32776);var _=n.angle_instanced_arrays,w=n.webgl_draw_buffers,k=n.oes_vertex_array_object,T={dirty:!0,profile:v.profile},S={},A=[],E={},C={};function P(e){return e.replace(".","_")}function L(e,t,r){var n=P(e);A.push(e),S[n]=T[n]=!!r,E[n]=t}function I(e,t,r){var n=P(e);A.push(e),Array.isArray(r)?(T[n]=r.slice(),S[n]=r.slice()):T[n]=S[n]=r,C[n]=t}function z(e){return!!isNaN(e)}L(xt,3024),L(bt,3042),I(_t,"blendColor",[0,0,0,0]),I(wt,"blendEquationSeparate",[32774,32774]),I(kt,"blendFuncSeparate",[1,0,1,0]),L(Tt,2929,!0),I(St,"depthFunc",513),I(At,"depthRange",[0,1]),I(Mt,"depthMask",!0),I(Et,Et,[!0,!0,!0,!0]),L(Ct,2884),I(Pt,"cullFace",Cr),I(Lt,Lt,Pr),I(It,It,1),L(zt,32823),I(Ot,"polygonOffset",[0,0]),L(Rt,32926),L(Dt,32928),I(jt,"sampleCoverage",[1,!1]),L(Ft,2960),I(Bt,"stencilMask",-1),I(Nt,"stencilFunc",[519,0,-1]),I(Ut,"stencilOpSeparate",[Er,Lr,Lr,Lr]),I(Vt,"stencilOpSeparate",[Cr,Lr,Lr,Lr]),L(qt,3089),I(Ht,"scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),I(Gt,Gt,[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var O={gl:t,context:m,strings:r,next:S,current:T,draw:f,elements:s,buffer:a,shader:d,attributes:h.state,vao:h,uniforms:u,framebuffer:c,extensions:n,timer:g,isBufferArgs:Dr},R={primTypes:j,compareFuncs:zr,blendFuncs:Ir,blendEquations:b,stencilOps:Or,glTypes:M,orientationType:Rr};w&&(R.backBuffer=[Cr],R.drawBuffer=p(i.maxDrawbuffers,(function(e){return 0===e?[0]:p(e,(function(e){return 36064+e}))})));var D=0;function F(){var t=function(t){var r=t&&t.cache,n=0,i=[],a=[],o=[];function s(){var t=[],r=[];return e((function(){t.push.apply(t,gt(arguments))}),{def:function(){var e="v"+n++;return r.push(e),arguments.length>0&&(t.push(e,"="),t.push.apply(t,gt(arguments)),t.push(";")),e},toString:function(){return yt([r.length>0?"var "+r.join(",")+";":"",yt(t)])}})}function l(){var t=s(),r=s(),n=t.toString,i=r.toString;function a(e,n){r(e,n,"=",t.def(e,n),";")}return e((function(){t.apply(t,gt(arguments))}),{def:t.def,entry:t,exit:r,save:a,set:function(e,r,n){a(e,r),t(e,r,"=",n,";")},toString:function(){return n()+i()}})}var c=s(),u={};return{global:c,link:function(e,t){var r=t&&t.stable;if(!r)for(var s=0;s<a.length;++s)if(a[s]===e&&!o[s])return i[s];var l="g"+n++;return i.push(l),a.push(e),o.push(r),l},block:s,proc:function(t,r){var n=[];function i(){var e="a"+n.length;return n.push(e),e}r=r||0;for(var a=0;a<r;++a)i();var o=l(),s=o.toString;return u[t]=e(o,{arg:i,toString:function(){return yt(["function(",n.join(),"){",s(),"}"])}})},scope:l,cond:function(){var t=yt(arguments),r=l(),n=l(),i=r.toString,a=n.toString;return e(r,{then:function(){return r.apply(r,gt(arguments)),this},else:function(){return n.apply(n,gt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),yt(["if(",t,"){",i(),"}",e])}})},compile:function(){var e=['"use strict";',c,"return {"];Object.keys(u).forEach((function(t){e.push('"',t,'":',u[t].toString(),",")})),e.push("}");var t,n=yt(e).replace(/;/g,";\n").replace(/}/g,"}\n").replace(/{/g,"{\n");if(r&&(t=nt(n),r[t]))return r[t].apply(null,a);var o=Function.apply(null,i.concat(n));return r&&(r[t]=o),o.apply(null,a)}}}({cache:y}),n=t.link,i=t.global;t.id=D++,t.batchId="0";var a=n(O),o=t.shared={props:"a0"};Object.keys(O).forEach((function(e){o[e]=i.def(a,".",e)}));var s=t.next={},l=t.current={};Object.keys(C).forEach((function(e){Array.isArray(T[e])&&(s[e]=i.def(o.next,".",e),l[e]=i.def(o.current,".",e))}));var c=t.constants={};Object.keys(R).forEach((function(e){c[e]=i.def(JSON.stringify(R[e]))})),t.invoke=function(e,r){switch(r.type){case 0:var i=["this",o.context,o.props,t.batchId];return e.def(n(r.data),".call(",i.slice(0,Math.max(r.data.length+1,4)),")");case 1:return e.def(o.props,r.data);case 2:return e.def(o.context,r.data);case 3:return e.def("this",r.data);case 4:return r.data.append(t,e),r.data.ref;case 5:return r.data.toString();case 6:return r.data.map((function(r){return t.invoke(e,r)}))}},t.attribCache={};var u={};return t.scopeAttrib=function(e){var t=r.id(e);if(t in u)return u[t];var i=h.scope[t];return i||(i=h.scope[t]=new x),u[t]=n(i)},t}function B(e,t,i,o,l){e.static,e.dynamic;var u=function(e,t){var r=e.static;if("string"===typeof r[Xt]&&"string"===typeof r[Zt]){if(Object.keys(t.dynamic).length>0)return null;var n=t.static,i=Object.keys(n);if(i.length>0&&"number"===typeof n[i[0]]){for(var a=[],o=0;o<i.length;++o)a.push([0|n[i[o]],i[o]]);return a}}return null}(e,t),f=function(e){var t=e.static,r=e.dynamic;if($t in t){var n=t[$t];return n?(n=c.getFramebuffer(n),Nr((function(e,t){var r=e.link(n),i=e.shared;t.set(i.framebuffer,".next",r);var a=i.context;return t.set(a,"."+ir,r+".width"),t.set(a,"."+ar,r+".height"),r}))):Nr((function(e,t){var r=e.shared;t.set(r.framebuffer,".next","null");var n=r.context;return t.set(n,"."+ir,n+"."+cr),t.set(n,"."+ar,n+"."+ur),"null"}))}if($t in r){var i=r[$t];return Ur(i,(function(e,t){var r=e.invoke(t,i),n=e.shared,a=n.framebuffer,o=t.def(a,".getFramebuffer(",r,")");t.set(a,".next",o);var s=n.context;return t.set(s,"."+ir,o+"?"+o+".width:"+s+"."+cr),t.set(s,"."+ar,o+"?"+o+".height:"+s+"."+ur),o}))}return null}(e),m=function(e,t){var r=e.static,n=e.dynamic;function i(e){if(e in r){var i,a,o=r[e],s=!0,l=0|o.x,c=0|o.y;return"width"in o?i=0|o.width:s=!1,"height"in o?a=0|o.height:s=!1,new Fr(!s&&t&&t.thisDep,!s&&t&&t.contextDep,!s&&t&&t.propDep,(function(e,t){var r=e.shared.context,n=i;"width"in o||(n=t.def(r,".",ir,"-",l));var s=a;return"height"in o||(s=t.def(r,".",ar,"-",c)),[l,c,n,s]}))}if(e in n){var u=n[e],h=Ur(u,(function(e,t){var r=e.invoke(t,u),n=e.shared.context,i=t.def(r,".x|0"),a=t.def(r,".y|0");return[i,a,t.def('"width" in ',r,"?",r,".width|0:","(",n,".",ir,"-",i,")"),t.def('"height" in ',r,"?",r,".height|0:","(",n,".",ar,"-",a,")")]}));return t&&(h.thisDep=h.thisDep||t.thisDep,h.contextDep=h.contextDep||t.contextDep,h.propDep=h.propDep||t.propDep),h}return t?new Fr(t.thisDep,t.contextDep,t.propDep,(function(e,t){var r=e.shared.context;return[0,0,t.def(r,".",ir),t.def(r,".",ar)]})):null}var a=i(Gt);if(a){var o=a;a=new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){var r=o.append(e,t),n=e.shared.context;return t.set(n,"."+or,r[2]),t.set(n,"."+sr,r[3]),r}))}return{viewport:a,scissor_box:i(Ht)}}(e,f),g=function(e){var t=e.static,r=e.dynamic,n={},i=!1,a=function(){if(tr in t){var e=t[tr];return null!==e&&null===h.getVAO(e)&&(e=h.createVAO(e)),i=!0,n.vao=e,Nr((function(t){var r=h.getVAO(e);return r?t.link(r):"null"}))}if(tr in r){i=!0;var a=r[tr];return Ur(a,(function(e,t){var r=e.invoke(t,a);return t.def(e.shared.vao+".getVAO("+r+")")}))}return null}(),o=!1,l=function(){if(Yt in t){var e=t[Yt];if(n.elements=e,Dr(e)){var l=n.elements=s.create(e,!0);e=s.getElements(l),o=!0}else e&&(e=s.getElements(e),o=!0);var c=Nr((function(t,r){if(e){var n=t.link(e);return t.ELEMENTS=n,n}return t.ELEMENTS=null,null}));return c.value=e,c}if(Yt in r){o=!0;var u=r[Yt];return Ur(u,(function(e,t){var r=e.shared,n=r.isBufferArgs,i=r.elements,a=e.invoke(t,u),o=t.def("null"),s=t.def(n,"(",a,")"),l=e.cond(s).then(o,"=",i,".createStream(",a,");").else(o,"=",i,".getElements(",a,");");return t.entry(l),t.exit(e.cond(s).then(i,".destroyStream(",o,");")),e.ELEMENTS=o,o}))}return i?new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.elements+".getElements("+e.shared.vao+".currentVAO.elements):null")})):null}();function c(e,s){if(e in t){var l=0|t[e];return s?n.offset=l:n.instances=l,Nr((function(e,t){return s&&(e.OFFSET=l),l}))}if(e in r){var c=r[e];return Ur(c,(function(e,t){var r=e.invoke(t,c);return s&&(e.OFFSET=r),r}))}if(s){if(o)return Nr((function(e,t){return e.OFFSET=0,0}));if(i)return new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.offset:0")}))}else if(i)return new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.instances:-1")}));return null}var u=c(Qt,!0),p=function(){if(Kt in t){var e=t[Kt];return n.primitive=e,Nr((function(t,r){return j[e]}))}if(Kt in r){var s=r[Kt];return Ur(s,(function(e,t){var r=e.constants.primTypes,n=e.invoke(t,s);return t.def(r,"[",n,"]")}))}return o?Br(l)?l.value?Nr((function(e,t){return t.def(e.ELEMENTS,".primType")})):Nr((function(){return 4})):new Fr(l.thisDep,l.contextDep,l.propDep,(function(e,t){var r=e.ELEMENTS;return t.def(r,"?",r,".primType:",4)})):i?new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao+".currentVAO?"+e.shared.vao+".currentVAO.primitive:4")})):null}(),d=function(){if(Jt in t){var e=0|t[Jt];return n.count=e,Nr((function(){return e}))}if(Jt in r){var s=r[Jt];return Ur(s,(function(e,t){return e.invoke(t,s)}))}return o?Br(l)?l?u?new Fr(u.thisDep,u.contextDep,u.propDep,(function(e,t){return t.def(e.ELEMENTS,".vertCount-",e.OFFSET)})):Nr((function(e,t){return t.def(e.ELEMENTS,".vertCount")})):Nr((function(){return-1})):new Fr(l.thisDep||u.thisDep,l.contextDep||u.contextDep,l.propDep||u.propDep,(function(e,t){var r=e.ELEMENTS;return e.OFFSET?t.def(r,"?",r,".vertCount-",e.OFFSET,":-1"):t.def(r,"?",r,".vertCount:-1")})):i?new Fr(a.thisDep,a.contextDep,a.propDep,(function(e,t){return t.def(e.shared.vao,".currentVAO?",e.shared.vao,".currentVAO.count:-1")})):null}(),f=c(er,!1);return{elements:l,primitive:p,count:d,instances:f,offset:u,vao:a,vaoActive:i,elementsActive:o,static:n}}(e),y=function(e){var t=e.static,r=e.dynamic,n={};return A.forEach((function(e){var i=P(e);function a(a,o){if(e in t){var s=a(t[e]);n[i]=Nr((function(){return s}))}else if(e in r){var l=r[e];n[i]=Ur(l,(function(e,t){return o(e,t,e.invoke(t,l))}))}}switch(e){case Ct:case bt:case xt:case Ft:case Tt:case qt:case zt:case Rt:case Dt:case Mt:return a((function(e){return e}),(function(e,t,r){return r}));case St:return a((function(e){return zr[e]}),(function(e,t,r){var n=e.constants.compareFuncs;return t.def(n,"[",r,"]")}));case At:return a((function(e){return e}),(function(e,t,r){return[t.def("+",r,"[0]"),t.def("+",r,"[1]")]}));case kt:return a((function(e){var t="srcRGB"in e?e.srcRGB:e.src,r="srcAlpha"in e?e.srcAlpha:e.src,n="dstRGB"in e?e.dstRGB:e.dst,i="dstAlpha"in e?e.dstAlpha:e.dst;return[Ir[t],Ir[n],Ir[r],Ir[i]]}),(function(e,t,r){var n=e.constants.blendFuncs;function i(e,n){return t.def('"',e,n,'" in ',r,"?",r,".",e,n,":",r,".",e)}var a=i("src","RGB"),o=i("dst","RGB"),s=t.def(n,"[",a,"]"),l=t.def(n,"[",i("src","Alpha"),"]");return[s,t.def(n,"[",o,"]"),l,t.def(n,"[",i("dst","Alpha"),"]")]}));case wt:return a((function(e){return"string"===typeof e?[b[e],b[e]]:"object"===typeof e?[b[e.rgb],b[e.alpha]]:void 0}),(function(e,t,r){var n=e.constants.blendEquations,i=t.def(),a=t.def(),o=e.cond("typeof ",r,'==="string"');return o.then(i,"=",a,"=",n,"[",r,"];"),o.else(i,"=",n,"[",r,".rgb];",a,"=",n,"[",r,".alpha];"),t(o),[i,a]}));case _t:return a((function(e){return p(4,(function(t){return+e[t]}))}),(function(e,t,r){return p(4,(function(e){return t.def("+",r,"[",e,"]")}))}));case Bt:return a((function(e){return 0|e}),(function(e,t,r){return t.def(r,"|0")}));case Nt:return a((function(e){var t=e.cmp||"keep",r=e.ref||0,n="mask"in e?e.mask:-1;return[zr[t],r,n]}),(function(e,t,r){var n=e.constants.compareFuncs;return[t.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Lr),t.def(r,".ref|0"),t.def('"mask" in ',r,"?",r,".mask|0:-1")]}));case Ut:case Vt:return a((function(t){var r=t.fail||"keep",n=t.zfail||"keep",i=t.zpass||"keep";return[e===Vt?Cr:Er,Or[r],Or[n],Or[i]]}),(function(t,r,n){var i=t.constants.stencilOps;function a(e){return r.def('"',e,'" in ',n,"?",i,"[",n,".",e,"]:",Lr)}return[e===Vt?Cr:Er,a("fail"),a("zfail"),a("zpass")]}));case Ot:return a((function(e){return[0|e.factor,0|e.units]}),(function(e,t,r){return[t.def(r,".factor|0"),t.def(r,".units|0")]}));case Pt:return a((function(e){var t=0;return"front"===e?t=Er:"back"===e&&(t=Cr),t}),(function(e,t,r){return t.def(r,'==="front"?',Er,":",Cr)}));case It:return a((function(e){return e}),(function(e,t,r){return r}));case Lt:return a((function(e){return Rr[e]}),(function(e,t,r){return t.def(r+'==="cw"?2304:'+Pr)}));case Et:return a((function(e){return e.map((function(e){return!!e}))}),(function(e,t,r){return p(4,(function(e){return"!!"+r+"["+e+"]"}))}));case jt:return a((function(e){return["value"in e?e.value:1,!!e.invert]}),(function(e,t,r){return[t.def('"value" in ',r,"?+",r,".value:1"),t.def("!!",r,".invert")]}))}})),n}(e),v=function(e,t,n){var i=e.static,a=e.dynamic;function o(e){if(e in i){var t=r.id(i[e]),n=Nr((function(){return t}));return n.id=t,n}if(e in a){var o=a[e];return Ur(o,(function(e,t){var r=e.invoke(t,o);return t.def(e.shared.strings,".id(",r,")")}))}return null}var s,l=o(Xt),c=o(Zt),u=null;return Br(l)&&Br(c)?(u=d.program(c.id,l.id,null,n),s=Nr((function(e,t){return e.link(u)}))):s=new Fr(l&&l.thisDep||c&&c.thisDep,l&&l.contextDep||c&&c.contextDep,l&&l.propDep||c&&c.propDep,(function(e,t){var r,n=e.shared.shader;r=l?l.append(e,t):t.def(n,".",Xt);var i=n+".program("+(c?c.append(e,t):t.def(n,".",Zt))+","+r;return t.def(i+")")})),{frag:l,vert:c,progVar:s,program:u}}(e,0,u);function _(e){var t=m[e];t&&(y[e]=t)}_(Gt),_(P(Ht));var w=Object.keys(y).length>0,k={framebuffer:f,draw:g,shader:v,state:y,dirty:w,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(k.profile=function(e){var t,r=e.static,n=e.dynamic;if(Wt in r){var i=!!r[Wt];(t=Nr((function(e,t){return i}))).enable=i}else if(Wt in n){var a=n[Wt];t=Ur(a,(function(e,t){return e.invoke(t,a)}))}return t}(e),k.uniforms=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r,i=t[e];if("number"===typeof i||"boolean"===typeof i)r=Nr((function(){return i}));else if("function"===typeof i){var a=i._reglType;"texture2d"===a||"textureCube"===a?r=Nr((function(e){return e.link(i)})):"framebuffer"!==a&&"framebufferCube"!==a||(r=Nr((function(e){return e.link(i.color[0])})))}else G(i)&&(r=Nr((function(e){return e.global.def("[",p(i.length,(function(e){return i[e]})),"]")})));r.value=i,n[e]=r})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Ur(t,(function(e,r){return e.invoke(r,t)}))})),n}(i),k.drawVAO=k.scopeVAO=g.vao,!k.drawVAO&&v.program&&!u&&n.angle_instanced_arrays&&g.static.elements){var T=!0,S=v.program.attributes.map((function(e){var r=t.static[e];return T=T&&!!r,r}));if(T&&S.length>0){var E=h.getVAO(h.createVAO({attributes:S,elements:g.static.elements}));k.drawVAO=new Fr(null,null,null,(function(e,t){return e.link(E)})),k.useVAO=!0}}return u?k.useVAO=!0:k.attributes=function(e){var t=e.static,n=e.dynamic,i={};return Object.keys(t).forEach((function(e){var n=t[e],o=r.id(e),s=new x;if(Dr(n))s.state=1,s.buffer=a.getBuffer(a.create(n,pr,!1,!0)),s.type=0;else{var l=a.getBuffer(n);if(l)s.state=1,s.buffer=l,s.type=0;else if("constant"in n){var c=n.constant;s.buffer="null",s.state=2,"number"===typeof c?s.x=c:vt.forEach((function(e,t){t<c.length&&(s[e]=c[t])}))}else{l=Dr(n.buffer)?a.getBuffer(a.create(n.buffer,pr,!1,!0)):a.getBuffer(n.buffer);var u=0|n.offset,h=0|n.stride,p=0|n.size,d=!!n.normalized,f=0;"type"in n&&(f=M[n.type]);var m=0|n.divisor;s.buffer=l,s.state=1,s.size=p,s.normalized=d,s.type=f||l.dtype,s.offset=u,s.stride=h,s.divisor=m}}i[e]=Nr((function(e,t){var r=e.attribCache;if(o in r)return r[o];var n={isStream:!1};return Object.keys(s).forEach((function(e){n[e]=s[e]})),s.buffer&&(n.buffer=e.link(s.buffer),n.type=n.type||n.buffer+".dtype"),r[o]=n,n}))})),Object.keys(n).forEach((function(e){var t=n[e];i[e]=Ur(t,(function(e,r){var n=e.invoke(r,t),i=e.shared,a=e.constants,o=i.isBufferArgs,s=i.buffer,l={isStream:r.def(!1)},c=new x;c.state=1,Object.keys(c).forEach((function(e){l[e]=r.def(""+c[e])}));var u=l.buffer,h=l.type;function p(e){r(l[e],"=",n,".",e,"|0;")}return r("if(",o,"(",n,")){",l.isStream,"=true;",u,"=",s,".createStream(",pr,",",n,");",h,"=",u,".dtype;","}else{",u,"=",s,".getBuffer(",n,");","if(",u,"){",h,"=",u,".dtype;",'}else if("constant" in ',n,"){",l.state,"=",2,";","if(typeof "+n+'.constant === "number"){',l[vt[0]],"=",n,".constant;",vt.slice(1).map((function(e){return l[e]})).join("="),"=0;","}else{",vt.map((function(e,t){return l[e]+"="+n+".constant.length>"+t+"?"+n+".constant["+t+"]:0;"})).join(""),"}}else{","if(",o,"(",n,".buffer)){",u,"=",s,".createStream(",pr,",",n,".buffer);","}else{",u,"=",s,".getBuffer(",n,".buffer);","}",h,'="type" in ',n,"?",a.glTypes,"[",n,".type]:",u,".dtype;",l.normalized,"=!!",n,".normalized;"),p("size"),p("offset"),p("stride"),p("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l}))})),i}(t),k.context=function(e){var t=e.static,r=e.dynamic,n={};return Object.keys(t).forEach((function(e){var r=t[e];n[e]=Nr((function(e,t){return"number"===typeof r||"boolean"===typeof r?""+r:e.link(r)}))})),Object.keys(r).forEach((function(e){var t=r[e];n[e]=Ur(t,(function(e,r){return e.invoke(r,t)}))})),n}(o),k}function N(e,t,r){var n=e.shared.context,i=e.scope();Object.keys(r).forEach((function(a){t.save(n,"."+a);var o=r[a].append(e,t);Array.isArray(o)?i(n,".",a,"=[",o.join(),"];"):i(n,".",a,"=",o,";")})),t(i)}function U(e,t,r,n){var i,a=e.shared,o=a.gl,s=a.framebuffer;w&&(i=t.def(a.extensions,".webgl_draw_buffers"));var l,c=e.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(e,t):t.def(s,".next"),n||t("if(",l,"!==",s,".cur){"),t("if(",l,"){",o,".bindFramebuffer(",36160,",",l,".framebuffer);"),w&&t(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),t("}else{",o,".bindFramebuffer(",36160,",null);"),w&&t(i,".drawBuffersWEBGL(",h,");"),t("}",s,".cur=",l,";"),n||t("}")}function V(e,t,r){var n=e.shared,i=n.gl,a=e.current,o=e.next,s=n.current,l=n.next,c=e.cond(s,".dirty");A.forEach((function(t){var n,u,h=P(t);if(!(h in r.state))if(h in o){n=o[h],u=a[h];var d=p(T[h].length,(function(e){return c.def(n,"[",e,"]")}));c(e.cond(d.map((function(e,t){return e+"!=="+u+"["+t+"]"})).join("||")).then(i,".",C[h],"(",d,");",d.map((function(e,t){return u+"["+t+"]="+e})).join(";"),";"))}else{n=c.def(l,".",h);var f=e.cond(n,"!==",s,".",h);c(f),h in E?f(e.cond(n).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",n,";"):f(i,".",C[h],"(",n,");",s,".",h,"=",n,";")}})),0===Object.keys(r.state).length&&c(s,".dirty=false;"),t(c)}function q(e,t,r,n){var i,a=e.shared,o=e.current,s=a.current,l=a.gl;jr(Object.keys(r)).forEach((function(a){var c=r[a];if(!n||n(c)){var u=c.append(e,t);if(E[a]){var h=E[a];Br(c)?(i=e.link(u,{stable:!0}),t(e.cond(i).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",i,";")):(t(e.cond(u).then(l,".enable(",h,");").else(l,".disable(",h,");")),t(s,".",a,"=",u,";"))}else if(G(u)){var p=o[a];t(l,".",C[a],"(",u,");",u.map((function(e,t){return p+"["+t+"]="+e})).join(";"),";")}else Br(c)?(i=e.link(u,{stable:!0}),t(l,".",C[a],"(",i,");",s,".",a,"=",i,";")):t(l,".",C[a],"(",u,");",s,".",a,"=",u,";")}}))}function H(e,t){_&&(e.instancing=t.def(e.shared.extensions,".angle_instanced_arrays"))}function W(e,t,r,n,i){var a,o,s,l=e.shared,c=e.stats,u=l.current,h=l.timer,p=r.profile;function d(){return"undefined"===typeof performance?"Date.now()":"performance.now()"}function f(e){e(a=t.def(),"=",d(),";"),"string"===typeof i?e(c,".count+=",i,";"):e(c,".count++;"),g&&(n?e(o=t.def(),"=",h,".getNumPendingQueries();"):e(h,".beginQuery(",c,");"))}function m(e){e(c,".cpuTime+=",d(),"-",a,";"),g&&(n?e(h,".pushScopeStats(",o,",",h,".getNumPendingQueries(),",c,");"):e(h,".endQuery();"))}function y(e){var r=t.def(u,".profile");t(u,".profile=",e,";"),t.exit(u,".profile=",r,";")}if(p){if(Br(p))return void(p.enable?(f(t),m(t.exit),y("true")):y("false"));y(s=p.append(e,t))}else s=t.def(u,".profile");var v=e.block();f(v),t("if(",s,"){",v,"}");var x=e.block();m(x),t.exit("if(",s,"){",x,"}")}function $(e,t,r,n,i){var a=e.shared;n.forEach((function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(e,t)}else{if(!i(Vr))return;var c=e.scopeAttrib(s);o={},Object.keys(new x).forEach((function(e){o[e]=t.def(c,".",e)}))}!function(r,n,i){var o=a.gl,s=t.def(r,".location"),l=t.def(a.attributes,"[",s,"]"),c=i.state,u=i.buffer,h=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];function d(){t("if(!",l,".buffer){",o,".enableVertexAttribArray(",s,");}");var r,a=i.type;if(r=i.size?t.def(i.size,"||",n):n,t("if(",l,".type!==",a,"||",l,".size!==",r,"||",p.map((function(e){return l+"."+e+"!=="+i[e]})).join("||"),"){",o,".bindBuffer(",pr,",",u,".buffer);",o,".vertexAttribPointer(",[s,r,a,i.normalized,i.stride,i.offset],");",l,".type=",a,";",l,".size=",r,";",p.map((function(e){return l+"."+e+"="+i[e]+";"})).join(""),"}"),_){var c=i.divisor;t("if(",l,".divisor!==",c,"){",e.instancing,".vertexAttribDivisorANGLE(",[s,c],");",l,".divisor=",c,";}")}}function f(){t("if(",l,".buffer){",o,".disableVertexAttribArray(",s,");",l,".buffer=null;","}if(",vt.map((function(e,t){return l+"."+e+"!=="+h[t]})).join("||"),"){",o,".vertexAttrib4f(",s,",",h,");",vt.map((function(e,t){return l+"."+e+"="+h[t]+";"})).join(""),"}")}1===c?d():2===c?f():(t("if(",c,"===",1,"){"),d(),t("}else{"),f(),t("}"))}(e.link(n),function(e){switch(e){case fr:case yr:case br:return 2;case mr:case vr:case _r:return 3;case gr:case xr:case wr:return 4;default:return 1}}(n.info.type),o)}))}function Z(e,t,n,i,a,o){for(var s,l=e.shared,c=l.gl,u=0;u<i.length;++u){var h,d=i[u],f=d.name,m=d.info.type,g=n.uniforms[f],y=e.link(d)+".location";if(g){if(!a(g))continue;if(Br(g)){var v=g.value;if(m===Ar||m===Mr){var x=e.link(v._texture||v.color[0]._texture);t(c,".uniform1i(",y,",",x+".bind());"),t.exit(x,".unbind();")}else if(m===kr||m===Tr||m===Sr){var b=e.global.def("new Float32Array(["+Array.prototype.slice.call(v)+"])"),_=2;m===Tr?_=3:m===Sr&&(_=4),t(c,".uniformMatrix",_,"fv(",y,",false,",b,");")}else{switch(m){case 5126:s="1f";break;case fr:s="2f";break;case mr:s="3f";break;case gr:s="4f";break;case 35670:case 5124:s="1i";break;case br:case yr:s="2i";break;case _r:case vr:s="3i";break;case wr:case xr:s="4i"}t(c,".uniform",s,"(",y,",",G(v)?Array.prototype.slice.call(v):v,");")}continue}h=g.append(e,t)}else{if(!a(Vr))continue;h=t.def(l.uniforms,"[",r.id(f),"]")}m===Ar?t("if(",h,"&&",h,'._reglType==="framebuffer"){',h,"=",h,".color[0];","}"):m===Mr&&t("if(",h,"&&",h,'._reglType==="framebufferCube"){',h,"=",h,".color[0];","}");var w=1;switch(m){case Ar:case Mr:var k=t.def(h,"._texture");t(c,".uniform1i(",y,",",k,".bind());"),t.exit(k,".unbind();");continue;case 5124:case 35670:s="1i";break;case yr:case br:s="2i",w=2;break;case vr:case _r:s="3i",w=3;break;case xr:case wr:s="4i",w=4;break;case 5126:s="1f";break;case fr:s="2f",w=2;break;case mr:s="3f",w=3;break;case gr:s="4f",w=4;break;case kr:s="Matrix2fv";break;case Tr:s="Matrix3fv";break;case Sr:s="Matrix4fv"}if("M"===s.charAt(0)){t(c,".uniform",s,"(",y,",");var T=Math.pow(m-kr+2,2),S=e.global.def("new Float32Array(",T,")");Array.isArray(h)?t("false,(",p(T,(function(e){return S+"["+e+"]="+h[e]})),",",S,")"):t("false,(Array.isArray(",h,")||",h," instanceof Float32Array)?",h,":(",p(T,(function(e){return S+"["+e+"]="+h+"["+e+"]"})),",",S,")"),t(");")}else if(w>1){for(var A=[],M=[],E=0;E<w;++E)Array.isArray(h)?M.push(h[E]):M.push(t.def(h+"["+E+"]")),o&&A.push(t.def());o&&t("if(!",e.batchId,"||",A.map((function(e,t){return e+"!=="+M[t]})).join("||"),"){",A.map((function(e,t){return e+"="+M[t]+";"})).join("")),t(c,".uniform",s,"(",y,",",M.join(","),");"),o&&t("}")}else{if(o){var C=t.def();t("if(!",e.batchId,"||",C,"!==",h,"){",C,"=",h,";")}t(c,".uniform",s,"(",y,",",h,");"),o&&t("}")}}}function X(e,t,r,n){var i=e.shared,a=i.gl,o=i.draw,s=n.draw,l=function(){var l,c=s.elements,u=t;return c?((c.contextDep&&n.contextDynamic||c.propDep)&&(u=r),l=c.append(e,u),s.elementsActive&&u("if("+l+")"+a+".bindBuffer("+dr+","+l+".buffer.buffer);")):(l=u.def(),u(l,"=",o,".",Yt,";","if(",l,"){",a,".bindBuffer(",dr,",",l,".buffer.buffer);}","else if(",i.vao,".currentVAO){",l,"=",e.shared.elements+".getElements("+i.vao,".currentVAO.elements);",k?"":"if("+l+")"+a+".bindBuffer("+dr+","+l+".buffer.buffer);","}")),l}();function c(i){var a=s[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(e,r):a.append(e,t):t.def(o,".",i)}var u,h,p=c(Kt),d=c(Qt),f=function(){var i,a=s.count,l=t;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(l=r),i=a.append(e,l)):i=l.def(o,".",Jt),i}();if("number"===typeof f){if(0===f)return}else r("if(",f,"){"),r.exit("}");_&&(u=c(er),h=e.instancing);var m=l+".type",g=s.elements&&Br(s.elements)&&!s.vaoActive;function y(){function e(){r(h,".drawElementsInstancedANGLE(",[p,f,m,d+"<<(("+m+"-5121)>>1)",u],");")}function t(){r(h,".drawArraysInstancedANGLE(",[p,d,f,u],");")}l&&"null"!==l?g?e():(r("if(",l,"){"),e(),r("}else{"),t(),r("}")):t()}function v(){function e(){r(a+".drawElements("+[p,f,m,d+"<<(("+m+"-5121)>>1)"]+");")}function t(){r(a+".drawArrays("+[p,d,f]+");")}l&&"null"!==l?g?e():(r("if(",l,"){"),e(),r("}else{"),t(),r("}")):t()}_&&("number"!==typeof u||u>=0)?"string"===typeof u?(r("if(",u,">0){"),y(),r("}else if(",u,"<0){"),v(),r("}")):y():v()}function Y(e,t,r,n,i){var a=F(),o=a.proc("body",i);return _&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),e(a,o,r,n),a.compile().body}function K(e,t,r,n){H(e,t),r.useVAO?r.drawVAO?t(e.shared.vao,".setVAO(",r.drawVAO.append(e,t),");"):t(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(t(e.shared.vao,".setVAO(null);"),$(e,t,r,n.attributes,(function(){return!0}))),Z(e,t,r,n.uniforms,(function(){return!0}),!1),X(e,t,t,r)}function J(e,t,r,n){function i(){return!0}e.batchId="a1",H(e,t),$(e,t,r,n.attributes,i),Z(e,t,r,n.uniforms,i,!1),X(e,t,t,r)}function Q(e,t,r,n){H(e,t);var i=r.contextDep,a=t.def(),o=t.def();e.shared.props=o,e.batchId=a;var s=e.scope(),l=e.scope();function c(e){return e.contextDep&&i||e.propDep}function u(e){return!c(e)}if(t(s.entry,"for(",a,"=0;",a,"<","a1",";++",a,"){",o,"=","a0","[",a,"];",l,"}",s.exit),r.needsContext&&N(e,l,r.context),r.needsFramebuffer&&U(e,l,r.framebuffer),q(e,l,r.state,c),r.profile&&c(r.profile)&&W(e,l,r,!1,!0),n)r.useVAO?r.drawVAO?c(r.drawVAO)?l(e.shared.vao,".setVAO(",r.drawVAO.append(e,l),");"):s(e.shared.vao,".setVAO(",r.drawVAO.append(e,s),");"):s(e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"):(s(e.shared.vao,".setVAO(null);"),$(e,s,r,n.attributes,u),$(e,l,r,n.attributes,c)),Z(e,s,r,n.uniforms,u,!1),Z(e,l,r,n.uniforms,c,!0),X(e,s,l,r);else{var h=e.global.def("{}"),p=r.shader.progVar.append(e,l),d=l.def(p,".id"),f=l.def(h,"[",d,"]");l(e.shared.gl,".useProgram(",p,".program);","if(!",f,"){",f,"=",h,"[",d,"]=",e.link((function(e){return Y(J,0,r,e,2)})),"(",p,");}",f,".call(this,a0[",a,"],",a,");")}}function ee(e,t,r){var n=t.static[r];if(n&&function(e){if("object"===typeof e&&!G(e)){for(var t=Object.keys(e),r=0;r<t.length;++r)if(o.isDynamic(e[t[r]]))return!0;return!1}}(n)){var i=e.global,a=Object.keys(n),s=!1,l=!1,c=!1,u=e.global.def("{}");a.forEach((function(t){var r=n[t];if(o.isDynamic(r)){"function"===typeof r&&(r=n[t]=o.unbox(r));var a=Ur(r,null);s=s||a.thisDep,c=c||a.propDep,l=l||a.contextDep}else{switch(i(u,".",t,"="),typeof r){case"number":i(r);break;case"string":i('"',r,'"');break;case"object":Array.isArray(r)&&i("[",r.join(),"]");break;default:i(e.link(r))}i(";")}})),t.dynamic[r]=new o.DynamicVariable(4,{thisDep:s,contextDep:l,propDep:c,ref:u,append:function(e,t){a.forEach((function(r){var i=n[r];if(o.isDynamic(i)){var a=e.invoke(t,i);t(u,".",r,"=",a,";")}}))}}),delete t.static[r]}}return{next:S,current:T,procs:function(){var e=F(),t=e.proc("poll"),r=e.proc("refresh"),a=e.block();t(a),r(a);var o,s=e.shared,l=s.gl,c=s.next,u=s.current;a(u,".dirty=false;"),U(e,t),U(e,r,null,!0),_&&(o=e.link(_)),n.oes_vertex_array_object&&r(e.link(n.oes_vertex_array_object),".bindVertexArrayOES(null);");var h=r.def(s.attributes),d=r.def(0),f=e.cond(d,".buffer");f.then(l,".enableVertexAttribArray(i);",l,".bindBuffer(",pr,",",d,".buffer.buffer);",l,".vertexAttribPointer(i,",d,".size,",d,".type,",d,".normalized,",d,".stride,",d,".offset);").else(l,".disableVertexAttribArray(i);",l,".vertexAttrib4f(i,",d,".x,",d,".y,",d,".z,",d,".w);",d,".buffer=null;");var m=e.link(i.maxAttributes,{stable:!0});return r("for(var i=0;i<",m,";++i){",d,"=",h,"[i];",f,"}"),_&&r("for(var i=0;i<",m,";++i){",o,".vertexAttribDivisorANGLE(i,",h,"[i].divisor);","}"),r(e.shared.vao,".currentVAO=null;",e.shared.vao,".setVAO(",e.shared.vao,".targetVAO);"),Object.keys(E).forEach((function(n){var i=E[n],o=a.def(c,".",n),s=e.block();s("if(",o,"){",l,".enable(",i,")}else{",l,".disable(",i,")}",u,".",n,"=",o,";"),r(s),t("if(",o,"!==",u,".",n,"){",s,"}")})),Object.keys(C).forEach((function(n){var i,o,s=C[n],h=T[n],d=e.block();if(d(l,".",s,"("),G(h)){var f=h.length;i=e.global.def(c,".",n),o=e.global.def(u,".",n),d(p(f,(function(e){return i+"["+e+"]"})),");",p(f,(function(e){return o+"["+e+"]="+i+"["+e+"];"})).join("")),t("if(",p(f,(function(e){return i+"["+e+"]!=="+o+"["+e+"]"})).join("||"),"){",d,"}")}else i=a.def(c,".",n),o=a.def(u,".",n),d(i,");",u,".",n,"=",i,";"),t("if(",i,"!==",o,"){",d,"}");r(d)})),e.compile()}(),compile:function(t,n,i,a,o){var s=F();s.stats=s.link(o),Object.keys(n.static).forEach((function(e){ee(s,n,e)})),hr.forEach((function(e){ee(s,t,e)}));var l=B(t,n,i,a);return l.shader.program&&(l.shader.program.attributes.sort((function(e,t){return e.name<t.name?-1:1})),l.shader.program.uniforms.sort((function(e,t){return e.name<t.name?-1:1}))),function(e,t){var r=e.proc("draw",1);H(e,r),N(e,r,t.context),U(e,r,t.framebuffer),V(e,r,t),q(e,r,t.state),W(e,r,t,!1,!0);var n=t.shader.progVar.append(e,r);if(r(e.shared.gl,".useProgram(",n,".program);"),t.shader.program)K(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var i=e.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(e.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",e.link((function(e){return Y(K,0,t,e,1)})),"(",n,");",o,".call(this,a0);"))}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(s,l),function(e,t){var n=e.proc("scope",3);e.batchId="a2";var i=e.shared,a=i.current;if(N(e,n,t.context),t.framebuffer&&t.framebuffer.append(e,n),jr(Object.keys(t.state)).forEach((function(r){var a=t.state[r],o=a.append(e,n);G(o)?o.forEach((function(t,i){z(t)?n.set(e.next[r],"["+i+"]",t):n.set(e.next[r],"["+i+"]",e.link(t,{stable:!0}))})):Br(a)?n.set(i.next,"."+r,e.link(o,{stable:!0})):n.set(i.next,"."+r,o)})),W(e,n,t,!0,!0),[Yt,Qt,Jt,er,Kt].forEach((function(r){var a=t.draw[r];if(a){var o=a.append(e,n);z(o)?n.set(i.draw,"."+r,o):n.set(i.draw,"."+r,e.link(o),{stable:!0})}})),Object.keys(t.uniforms).forEach((function(a){var o=t.uniforms[a].append(e,n);Array.isArray(o)&&(o="["+o.map((function(t){return z(t)?t:e.link(t,{stable:!0})}))+"]"),n.set(i.uniforms,"["+e.link(r.id(a),{stable:!0})+"]",o)})),Object.keys(t.attributes).forEach((function(r){var i=t.attributes[r].append(e,n),a=e.scopeAttrib(r);Object.keys(new x).forEach((function(e){n.set(a,"."+e,i[e])}))})),t.scopeVAO){var o=t.scopeVAO.append(e,n);z(o)?n.set(i.vao,".targetVAO",o):n.set(i.vao,".targetVAO",e.link(o,{stable:!0}))}function s(r){var a=t.shader[r];if(a){var o=a.append(e,n);z(o)?n.set(i.shader,"."+r,o):n.set(i.shader,"."+r,e.link(o,{stable:!0}))}}s(Zt),s(Xt),Object.keys(t.state).length>0&&(n(a,".dirty=true;"),n.exit(a,".dirty=true;")),n("a1(",e.shared.context,",a0,",e.batchId,");")}(s,l),function(e,t){var r=e.proc("batch",2);e.batchId="0",H(e,r);var n=!1,i=!0;Object.keys(t.context).forEach((function(e){n=n||t.context[e].propDep})),n||(N(e,r,t.context),i=!1);var a=t.framebuffer,o=!1;function s(e){return e.contextDep&&n||e.propDep}a?(a.propDep?n=o=!0:a.contextDep&&n&&(o=!0),o||U(e,r,a)):U(e,r,null),t.state.viewport&&t.state.viewport.propDep&&(n=!0),V(e,r,t),q(e,r,t.state,(function(e){return!s(e)})),t.profile&&s(t.profile)||W(e,r,t,!1,"a1"),t.contextDep=n,t.needsContext=i,t.needsFramebuffer=o;var l=t.shader.progVar;if(l.contextDep&&n||l.propDep)Q(e,r,t,null);else{var c=l.append(e,r);if(r(e.shared.gl,".useProgram(",c,".program);"),t.shader.program)Q(e,r,t,t.shader.program);else{r(e.shared.vao,".setVAO(null);");var u=e.global.def("{}"),h=r.def(c,".id"),p=r.def(u,"[",h,"]");r(e.cond(p).then(p,".call(this,a0,a1);").else(p,"=",u,"[",h,"]=",e.link((function(e){return Y(Q,0,t,e,2)})),"(",c,");",p,".call(this,a0,a1);"))}}Object.keys(t.state).length>0&&r(e.shared.current,".dirty=true;"),e.shared.vao&&r(e.shared.vao,".setVAO(null);")}(s,l),e(s.compile(),{destroy:function(){l.shader.program.destroy()}})}}}var Hr=function(e,t){if(!t.ext_disjoint_timer_query)return null;var r=[];function n(e){r.push(e)}var i=[];function a(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var o=[],s=[];function l(e,t,r){var n=o.pop()||new a;n.startQueryIndex=e,n.endQueryIndex=t,n.sum=0,n.stats=r,s.push(n)}var c=[],u=[];return{beginQuery:function(e){var n=r.pop()||t.ext_disjoint_timer_query.createQueryEXT();t.ext_disjoint_timer_query.beginQueryEXT(35007,n),i.push(n),l(i.length-1,i.length,e)},endQuery:function(){t.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:l,update:function(){var e,r,a=i.length;if(0!==a){u.length=Math.max(u.length,a+1),c.length=Math.max(c.length,a+1),c[0]=0,u[0]=0;var l,h=0;for(e=0,r=0;r<i.length;++r){var p=i[r];t.ext_disjoint_timer_query.getQueryObjectEXT(p,34919)?(h+=t.ext_disjoint_timer_query.getQueryObjectEXT(p,34918),n(p)):i[e++]=p,c[r+1]=h,u[r+1]=e}for(i.length=e,e=0,r=0;r<s.length;++r){var d=s[r],f=d.startQueryIndex,m=d.endQueryIndex;d.sum+=c[m]-c[f];var g=u[f],y=u[m];y===g?(d.stats.gpuTime+=d.sum/1e6,l=d,o.push(l)):(d.startQueryIndex=g,d.endQueryIndex=y,s[e++]=d)}s.length=e}},getNumPendingQueries:function(){return i.length},clear:function(){r.push.apply(r,i);for(var e=0;e<r.length;e++)t.ext_disjoint_timer_query.deleteQueryEXT(r[e]);i.length=0,r.length=0},restore:function(){i.length=0,r.length=0}}},Gr="webglcontextlost",Wr="webglcontextrestored";function $r(e,t){for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}return function(t){var r=h(t);if(!r)return null;var n=r.gl,i=n.getContextAttributes(),a=(n.isContextLost(),function(e,t){var r={};function n(t){var n,i=t.toLowerCase();try{n=r[i]=e.getExtension(i)}catch(a){}return!!n}for(var i=0;i<t.extensions.length;++i){var a=t.extensions[i];if(!n(a))return t.onDestroy(),t.onDone('"'+a+'" extension is not supported by the current WebGL context, try upgrading your system or a different browser'),null}return t.optionalExtensions.forEach(n),{extensions:r,restore:function(){Object.keys(r).forEach((function(e){if(r[e]&&!n(e))throw new Error("(regl): error restoring extension "+e)}))}}}(n,r));if(!a)return null;var c=function(){var e={"":0},t=[""];return{id:function(r){var n=e[r];return n||(n=e[r]=t.length,t.push(r),n)},str:function(e){return t[e]}}}(),u={vaoCount:0,bufferCount:0,elementsCount:0,framebufferCount:0,shaderCount:0,textureCount:0,cubeCount:0,renderbufferCount:0,maxTextureUnits:0},p=r.cachedCode||{},d=a.extensions,f=Hr(0,d),k=l(),T=n.drawingBufferWidth,S=n.drawingBufferHeight,A={tick:0,time:0,viewportWidth:T,viewportHeight:S,framebufferWidth:T,framebufferHeight:S,drawingBufferWidth:T,drawingBufferHeight:S,pixelRatio:r.pixelRatio},V={elements:null,primitive:4,count:-1,offset:0,instances:-1},q=function(e,t){var r=1;t.ext_texture_filter_anisotropic&&(r=e.getParameter(34047));var n=1,i=1;t.webgl_draw_buffers&&(n=e.getParameter(34852),i=e.getParameter(36063));var a=!!t.oes_texture_float;if(a){var o=e.createTexture();e.bindTexture(g,o),e.texImage2D(g,0,y,1,1,0,y,v,null);var s=e.createFramebuffer();if(e.bindFramebuffer(x,s),e.framebufferTexture2D(x,36064,g,o,0),e.bindTexture(g,null),36053!==e.checkFramebufferStatus(x))a=!1;else{e.viewport(0,0,1,1),e.clearColor(1,0,0,1),e.clear(16384);var l=m.allocType(v,4);e.readPixels(0,0,1,1,y,v,l),e.getError()?a=!1:(e.deleteFramebuffer(s),e.deleteTexture(o),a=1===l[0]),m.freeType(l)}}var c=!0;if("undefined"===typeof navigator||!(/MSIE/.test(navigator.userAgent)||/Trident\//.test(navigator.appVersion)||/Edge/.test(navigator.userAgent))){var u=e.createTexture(),h=m.allocType(5121,36);e.activeTexture(33984),e.bindTexture(34067,u),e.texImage2D(34069,0,y,3,3,0,y,5121,h),m.freeType(h),e.bindTexture(34067,null),e.deleteTexture(u),c=!e.getError()}return{colorBits:[e.getParameter(3410),e.getParameter(3411),e.getParameter(3412),e.getParameter(3413)],depthBits:e.getParameter(3414),stencilBits:e.getParameter(3415),subpixelBits:e.getParameter(3408),extensions:Object.keys(t).filter((function(e){return!!t[e]})),maxAnisotropic:r,maxDrawbuffers:n,maxColorAttachments:i,pointSizeDims:e.getParameter(33901),lineWidthDims:e.getParameter(33902),maxViewportDims:e.getParameter(3386),maxCombinedTextureUnits:e.getParameter(35661),maxCubeMapSize:e.getParameter(34076),maxRenderbufferSize:e.getParameter(34024),maxTextureUnits:e.getParameter(34930),maxTextureSize:e.getParameter(3379),maxAttributes:e.getParameter(34921),maxVertexUniforms:e.getParameter(36347),maxVertexTextureUnits:e.getParameter(35660),maxVaryingVectors:e.getParameter(36348),maxFragmentUniforms:e.getParameter(36349),glsl:e.getParameter(35724),renderer:e.getParameter(7937),vendor:e.getParameter(7936),version:e.getParameter(7938),readFloat:a,npotTextureCube:c}}(n,d),H=function(e,t,r,n){var i=0,a={};function o(t){this.id=i++,this.buffer=e.createBuffer(),this.type=t,this.usage=35044,this.byteLength=0,this.dimension=1,this.dtype=L,this.persistentData=null,r.profile&&(this.stats={size:0})}o.prototype.bind=function(){e.bindBuffer(this.type,this.buffer)},o.prototype.destroy=function(){u(this)};var s=[];function l(t,r,n){t.byteLength=r.byteLength,e.bufferData(t.type,r,n)}function c(e,t,r,n,i,a){var o,s;if(e.usage=r,Array.isArray(t)){if(e.dtype=n||I,t.length>0)if(Array.isArray(t[0])){o=P(t);for(var c=1,u=1;u<o.length;++u)c*=o[u];e.dimension=c,l(e,s=C(t,o,e.dtype),r),a?e.persistentData=s:m.freeType(s)}else if("number"===typeof t[0]){e.dimension=i;var h=m.allocType(e.dtype,t.length);R(h,t),l(e,h,r),a?e.persistentData=h:m.freeType(h)}else b(t[0])&&(e.dimension=t[0].length,e.dtype=n||O(t[0])||I,l(e,s=C(t,[t.length,t[0].length],e.dtype),r),a?e.persistentData=s:m.freeType(s))}else if(b(t))e.dtype=n||O(t),e.dimension=i,l(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t.buffer)));else if(_(t)){o=t.shape;var p=t.stride,d=t.offset,f=0,g=0,y=0,v=0;1===o.length?(f=o[0],g=1,y=p[0],v=0):2===o.length&&(f=o[0],g=o[1],y=p[0],v=p[1]),e.dtype=n||O(t.data)||I,e.dimension=g;var x=m.allocType(e.dtype,f*g);D(x,t.data,f,g,y,v,d),l(e,x,r),a?e.persistentData=x:m.freeType(x)}else t instanceof ArrayBuffer&&(e.dtype=L,e.dimension=i,l(e,t,r),a&&(e.persistentData=new Uint8Array(new Uint8Array(t))))}function u(r){t.bufferCount--,n(r);var i=r.buffer;e.deleteBuffer(i),r.buffer=null,delete a[r.id]}return r.profile&&(t.getTotalBufferSize=function(){var e=0;return Object.keys(a).forEach((function(t){e+=a[t].stats.size})),e}),{create:function(n,i,s,l){t.bufferCount++;var h=new o(i);function p(t){var n=35044,i=null,a=0,o=0,s=1;return Array.isArray(t)||b(t)||_(t)||t instanceof ArrayBuffer?i=t:"number"===typeof t?a=0|t:t&&("data"in t&&(i=t.data),"usage"in t&&(n=E[t.usage]),"type"in t&&(o=M[t.type]),"dimension"in t&&(s=0|t.dimension),"length"in t&&(a=0|t.length)),h.bind(),i?c(h,i,n,o,s,l):(a&&e.bufferData(h.type,a,n),h.dtype=o||L,h.usage=n,h.dimension=s,h.byteLength=a),r.profile&&(h.stats.size=h.byteLength*z[h.dtype]),p}function d(t,r){e.bufferSubData(h.type,r,t)}return a[h.id]=h,s||p(n),p._reglType="buffer",p._buffer=h,p.subdata=function(e,t){var r,n=0|(t||0);if(h.bind(),b(e)||e instanceof ArrayBuffer)d(e,n);else if(Array.isArray(e)){if(e.length>0)if("number"===typeof e[0]){var i=m.allocType(h.dtype,e.length);R(i,e),d(i,n),m.freeType(i)}else if(Array.isArray(e[0])||b(e[0])){r=P(e);var a=C(e,r,h.dtype);d(a,n),m.freeType(a)}}else if(_(e)){r=e.shape;var o=e.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length&&(s=r[0],l=r[1],c=o[0],u=o[1]);var f=Array.isArray(e.data)?h.dtype:O(e.data),g=m.allocType(f,s*l);D(g,e.data,s,l,c,u,e.offset),d(g,n),m.freeType(g)}return p},r.profile&&(p.stats=h.stats),p.destroy=function(){u(h)},p},createStream:function(e,t){var r=s.pop();return r||(r=new o(e)),r.bind(),c(r,t,35040,0,1,!1),r},destroyStream:function(e){s.push(e)},clear:function(){w(a).forEach(u),s.forEach(u)},getBuffer:function(e){return e&&e._buffer instanceof o?e._buffer:null},restore:function(){w(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:c}}(n,u,r,(function(e){return W.destroyBuffer(e)})),G=function(e,t,r,n){var i={},a=0,o={uint8:F,uint16:B};function s(e){this.id=a++,i[this.id]=this,this.buffer=e,this.primType=4,this.vertCount=0,this.type=0}t.oes_element_index_uint&&(o.uint32=N),s.prototype.bind=function(){this.buffer.bind()};var l=[];function c(n,i,a,o,s,l,c){var u;if(n.buffer.bind(),i){var h=c;c||b(i)&&(!_(i)||b(i.data))||(h=t.oes_element_index_uint?N:B),r._initBuffer(n.buffer,i,a,h,3)}else e.bufferData(U,l,a),n.buffer.dtype=u||F,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;if(u=c,!c){switch(n.buffer.dtype){case F:case 5120:u=F;break;case B:case 5122:u=B;break;case N:case 5124:u=N}n.buffer.dtype=u}n.type=u;var p=s;p<0&&(p=n.buffer.byteLength,u===B?p>>=1:u===N&&(p>>=2)),n.vertCount=p;var d=o;if(o<0){d=4;var f=n.buffer.dimension;1===f&&(d=0),2===f&&(d=1),3===f&&(d=4)}n.primType=d}function u(e){n.elementsCount--,delete i[e.id],e.buffer.destroy(),e.buffer=null}return{create:function(e,t){var i=r.create(null,U,!0),a=new s(i._buffer);function l(e){if(e)if("number"===typeof e)i(e),a.primType=4,a.vertCount=0|e,a.type=F;else{var t=null,r=35044,n=-1,s=-1,u=0,h=0;Array.isArray(e)||b(e)||_(e)?t=e:("data"in e&&(t=e.data),"usage"in e&&(r=E[e.usage]),"primitive"in e&&(n=j[e.primitive]),"count"in e&&(s=0|e.count),"type"in e&&(h=o[e.type]),"length"in e?u=0|e.length:(u=s,h===B||5122===h?u*=2:h!==N&&5124!==h||(u*=4))),c(a,t,r,n,s,u,h)}else i(),a.primType=4,a.vertCount=0,a.type=F;return l}return n.elementsCount++,l(e),l._reglType="elements",l._elements=a,l.subdata=function(e,t){return i.subdata(e,t),l},l.destroy=function(){u(a)},l},createStream:function(e){var t=l.pop();return t||(t=new s(r.create(null,U,!0,!1)._buffer)),c(t,e,35040,-1,-1,0,0),t},destroyStream:function(e){l.push(e)},getElements:function(e){return"function"===typeof e&&e._elements instanceof s?e._elements:null},clear:function(){w(i).forEach(u)}}}(n,d,H,u),W=function(e,t,r,n,i,a,o){for(var s=r.maxAttributes,l=new Array(s),c=0;c<s;++c)l[c]=new et;var u=0,h={},p={Record:et,scope:{},state:l,currentVAO:null,targetVAO:null,restore:d()?function(){d()&&w(h).forEach((function(e){e.refresh()}))}:function(){},createVAO:function(e){var t=new m;function r(e){var n;if(Array.isArray(e))n=e,t.elements&&t.ownsElements&&t.elements.destroy(),t.elements=null,t.ownsElements=!1,t.offset=0,t.count=0,t.instances=-1,t.primitive=4;else{if(e.elements){var o=e.elements;t.ownsElements?"function"===typeof o&&"elements"===o._reglType?(t.elements.destroy(),t.ownsElements=!1):(t.elements(o),t.ownsElements=!1):a.getElements(e.elements)?(t.elements=e.elements,t.ownsElements=!1):(t.elements=a.create(e.elements),t.ownsElements=!0)}else t.elements=null,t.ownsElements=!1;n=e.attributes,t.offset=0,t.count=-1,t.instances=-1,t.primitive=4,t.elements&&(t.count=t.elements._elements.vertCount,t.primitive=t.elements._elements.primType),"offset"in e&&(t.offset=0|e.offset),"count"in e&&(t.count=0|e.count),"instances"in e&&(t.instances=0|e.instances),"primitive"in e&&(t.primitive=j[e.primitive])}var s={},l=t.attributes;l.length=n.length;for(var c=0;c<n.length;++c){var u,h=n[c],p=l[c]=new et,d=h.data||h;Array.isArray(d)||b(d)||_(d)?(t.buffers[c]&&(u=t.buffers[c],b(d)&&u._buffer.byteLength>=d.byteLength?u.subdata(d):(u.destroy(),t.buffers[c]=null)),t.buffers[c]||(u=t.buffers[c]=i.create(h,34962,!1,!0)),p.buffer=i.getBuffer(u),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1,s[c]=1):i.getBuffer(h)?(p.buffer=i.getBuffer(h),p.size=0|p.buffer.dimension,p.normalized=!1,p.type=p.buffer.dtype,p.offset=0,p.stride=0,p.divisor=0,p.state=1):i.getBuffer(h.buffer)?(p.buffer=i.getBuffer(h.buffer),p.size=0|(+h.size||p.buffer.dimension),p.normalized=!!h.normalized||!1,p.type="type"in h?M[h.type]:p.buffer.dtype,p.offset=0|(h.offset||0),p.stride=0|(h.stride||0),p.divisor=0|(h.divisor||0),p.state=1):"x"in h&&(p.x=+h.x||0,p.y=+h.y||0,p.z=+h.z||0,p.w=+h.w||0,p.state=2)}for(var f=0;f<t.buffers.length;++f)!s[f]&&t.buffers[f]&&(t.buffers[f].destroy(),t.buffers[f]=null);return t.refresh(),r}return n.vaoCount+=1,r.destroy=function(){for(var e=0;e<t.buffers.length;++e)t.buffers[e]&&t.buffers[e].destroy();t.buffers.length=0,t.ownsElements&&(t.elements.destroy(),t.elements=null,t.ownsElements=!1),t.destroy()},r._vao=t,r._reglType="vao",r(e)},getVAO:function(e){return"function"===typeof e&&e._vao?e._vao:null},destroyBuffer:function(t){for(var r=0;r<l.length;++r){var n=l[r];n.buffer===t&&(e.disableVertexAttribArray(r),n.buffer=null)}},setVAO:d()?function(e){if(e!==p.currentVAO){var t=d();e?t.bindVertexArrayOES(e.vao):t.bindVertexArrayOES(null),p.currentVAO=e}}:function(t){if(t!==p.currentVAO){if(t)t.bindAttrs();else{for(var r=f(),n=0;n<l.length;++n){var i=l[n];i.buffer?(e.enableVertexAttribArray(n),i.buffer.bind(),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offfset),r&&i.divisor&&r.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}o.elements?e.bindBuffer(Qe,o.elements.buffer.buffer):e.bindBuffer(Qe,null)}p.currentVAO=t}},clear:d()?function(){w(h).forEach((function(e){e.destroy()}))}:function(){}};function d(){return t.oes_vertex_array_object}function f(){return t.angle_instanced_arrays}function m(){this.id=++u,this.attributes=[],this.elements=null,this.ownsElements=!1,this.count=0,this.offset=0,this.instances=-1,this.primitive=4;var e=d();this.vao=e?e.createVertexArrayOES():null,h[this.id]=this,this.buffers=[]}return m.prototype.bindAttrs=function(){for(var t=f(),r=this.attributes,n=0;n<r.length;++n){var i=r[n];i.buffer?(e.enableVertexAttribArray(n),e.bindBuffer(34962,i.buffer.buffer),e.vertexAttribPointer(n,i.size,i.type,i.normalized,i.stride,i.offset),t&&i.divisor&&t.vertexAttribDivisorANGLE(n,i.divisor)):(e.disableVertexAttribArray(n),e.vertexAttrib4f(n,i.x,i.y,i.z,i.w))}for(var o=r.length;o<s;++o)e.disableVertexAttribArray(o);var l=a.getElements(this.elements);l?e.bindBuffer(Qe,l.buffer.buffer):e.bindBuffer(Qe,null)},m.prototype.refresh=function(){var e=d();e&&(e.bindVertexArrayOES(this.vao),this.bindAttrs(),p.currentVAO=null,e.bindVertexArrayOES(null))},m.prototype.destroy=function(){if(this.vao){var e=d();this===p.currentVAO&&(p.currentVAO=null,e.bindVertexArrayOES(null)),e.deleteVertexArrayOES(this.vao),this.vao=null}this.ownsElements&&(this.elements.destroy(),this.elements=null,this.ownsElements=!1),h[this.id]&&(delete h[this.id],n.vaoCount-=1)},p}(n,d,q,u,H,G,V),$=function(t,r,n,i){var a={},o={};function s(e,t,r,n){this.name=e,this.id=t,this.location=r,this.info=n}function l(e,t){for(var r=0;r<e.length;++r)if(e[r].id===t.id)return void(e[r].location=t.location);e.push(t)}function c(e,n,i){var s=35632===e?a:o,l=s[n];if(!l){var c=r.str(n);l=t.createShader(e),t.shaderSource(l,c),t.compileShader(l),s[n]=l}return l}var u={},h=[],p=0;function d(e,t){this.id=p++,this.fragId=e,this.vertId=t,this.program=null,this.uniforms=[],this.attributes=[],this.refCount=1,i.profile&&(this.stats={uniformsCount:0,attributesCount:0})}function f(e,n,a){var o,u,h=c(35632,e.fragId),p=c(35633,e.vertId),d=e.program=t.createProgram();if(t.attachShader(d,h),t.attachShader(d,p),a)for(o=0;o<a.length;++o){var f=a[o];t.bindAttribLocation(d,f[0],f[1])}t.linkProgram(d);var m=t.getProgramParameter(d,35718);i.profile&&(e.stats.uniformsCount=m);var g=e.uniforms;for(o=0;o<m;++o)if(u=t.getActiveUniform(d,o))if(u.size>1)for(var y=0;y<u.size;++y){var v=u.name.replace("[0]","["+y+"]");l(g,new s(v,r.id(v),t.getUniformLocation(d,v),u))}else l(g,new s(u.name,r.id(u.name),t.getUniformLocation(d,u.name),u));var x=t.getProgramParameter(d,35721);i.profile&&(e.stats.attributesCount=x);var b=e.attributes;for(o=0;o<x;++o)(u=t.getActiveAttrib(d,o))&&l(b,new s(u.name,r.id(u.name),t.getAttribLocation(d,u.name),u))}return i.profile&&(n.getMaxUniformsCount=function(){var e=0;return h.forEach((function(t){t.stats.uniformsCount>e&&(e=t.stats.uniformsCount)})),e},n.getMaxAttributesCount=function(){var e=0;return h.forEach((function(t){t.stats.attributesCount>e&&(e=t.stats.attributesCount)})),e}),{clear:function(){var e=t.deleteShader.bind(t);w(a).forEach(e),a={},w(o).forEach(e),o={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,u={},n.shaderCount=0},program:function(r,i,s,l){var c=u[i];c||(c=u[i]={});var p=c[r];if(p&&(p.refCount++,!l))return p;var m=new d(i,r);return n.shaderCount++,f(m,0,l),p||(c[r]=m),h.push(m),e(m,{destroy:function(){if(m.refCount--,m.refCount<=0){t.deleteProgram(m.program);var e=h.indexOf(m);h.splice(e,1),n.shaderCount--}c[m.vertId].refCount<=0&&(t.deleteShader(o[m.vertId]),delete o[m.vertId],delete u[m.fragId][m.vertId]),Object.keys(u[m.fragId]).length||(t.deleteShader(a[m.fragId]),delete a[m.fragId],delete u[m.fragId])}})},restore:function(){a={},o={};for(var e=0;e<h.length;++e)f(h[e],0,h[e].attributes.map((function(e){return[e.location,e.name]})))},shader:c,frag:-1,vert:-1}}(n,c,u,r),Z=qe(n,d,q,(function(){K.procs.poll()}),A,u,r),X=function(e,t,r,n,i){var a={rgba4:Ge,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};t.ext_srgb&&(a.srgba=35907),t.ext_color_buffer_half_float&&(a.rgba16f=34842,a.rgb16f=34843),t.webgl_color_buffer_float&&(a.rgba32f=34836);var o=[];Object.keys(a).forEach((function(e){var t=a[e];o[t]=e}));var s=0,l={};function c(e){this.id=s++,this.refCount=1,this.renderbuffer=e,this.format=Ge,this.width=0,this.height=0,i.profile&&(this.stats={size:0})}function u(t){var r=t.renderbuffer;e.bindRenderbuffer(He,null),e.deleteRenderbuffer(r),t.renderbuffer=null,t.refCount=0,delete l[t.id],n.renderbufferCount--}return c.prototype.decRef=function(){--this.refCount<=0&&u(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var e=0;return Object.keys(l).forEach((function(t){e+=l[t].stats.size})),e}),{create:function(t,r){var s=new c(e.createRenderbuffer());function u(t,r){var n=0,l=0,c=Ge;if("object"===typeof t&&t){var h=t;if("shape"in h){var p=h.shape;n=0|p[0],l=0|p[1]}else"radius"in h&&(n=l=0|h.radius),"width"in h&&(n=0|h.width),"height"in h&&(l=0|h.height);"format"in h&&(c=a[h.format])}else"number"===typeof t?(n=0|t,l="number"===typeof r?0|r:n):t||(n=l=1);if(n!==s.width||l!==s.height||c!==s.format)return u.width=s.width=n,u.height=s.height=l,s.format=c,e.bindRenderbuffer(He,s.renderbuffer),e.renderbufferStorage(He,c,n,l),i.profile&&(s.stats.size=$e(s.format,s.width,s.height)),u.format=o[s.format],u}return l[s.id]=s,n.renderbufferCount++,u(t,r),u.resize=function(t,r){var n=0|t,a=0|r||n;return n===s.width&&a===s.height||(u.width=s.width=n,u.height=s.height=a,e.bindRenderbuffer(He,s.renderbuffer),e.renderbufferStorage(He,s.format,n,a),i.profile&&(s.stats.size=$e(s.format,s.width,s.height))),u},u._reglType="renderbuffer",u._renderbuffer=s,i.profile&&(u.stats=s.stats),u.destroy=function(){s.decRef()},u},clear:function(){w(l).forEach(u)},restore:function(){w(l).forEach((function(t){t.renderbuffer=e.createRenderbuffer(),e.bindRenderbuffer(He,t.renderbuffer),e.renderbufferStorage(He,t.format,t.width,t.height)})),e.bindRenderbuffer(He,null)}}}(n,d,0,u,r),Y=function(t,r,n,i,a,o){var s={cur:null,next:null,dirty:!1,setFBO:null},l=["rgba"],c=["rgba4","rgb565","rgb5 a1"];r.ext_srgb&&c.push("srgba"),r.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),r.webgl_color_buffer_float&&c.push("rgba32f");var u=["uint8"];function h(e,t,r){this.target=e,this.texture=t,this.renderbuffer=r;var n=0,i=0;t?(n=t.width,i=t.height):r&&(n=r.width,i=r.height),this.width=n,this.height=i}function p(e){e&&(e.texture&&e.texture._texture.decRef(),e.renderbuffer&&e.renderbuffer._renderbuffer.decRef())}function d(e,t,r){if(e)if(e.texture){var n=e.texture._texture;Math.max(1,n.width),Math.max(1,n.height),n.refCount+=1}else e.renderbuffer._renderbuffer.refCount+=1}function f(e,r){r&&(r.texture?t.framebufferTexture2D(Ze,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(Ze,e,Xe,r.renderbuffer._renderbuffer.renderbuffer))}function m(e){var t=Ye,r=null,n=null,i=e;"object"===typeof e&&(i=e.data,"target"in e&&(t=0|e.target));var a=i._reglType;return"texture2d"===a||"textureCube"===a?r=i:"renderbuffer"===a&&(n=i,t=Xe),new h(t,r,n)}function g(e,t,r,n,o){if(r){var s=i.create2D({width:e,height:t,format:n,type:o});return s._texture.refCount=0,new h(Ye,s,null)}var l=a.create({width:e,height:t,format:n});return l._renderbuffer.refCount=0,new h(Xe,null,l)}function y(e){return e&&(e.texture||e.renderbuffer)}function v(e,t,r){e&&(e.texture?e.texture.resize(t,r):e.renderbuffer&&e.renderbuffer.resize(t,r),e.width=t,e.height=r)}r.oes_texture_half_float&&u.push("half float","float16"),r.oes_texture_float&&u.push("float","float32");var x=0,b={};function _(){this.id=x++,b[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function k(e){e.colorAttachments.forEach(p),p(e.depthAttachment),p(e.stencilAttachment),p(e.depthStencilAttachment)}function T(e){var r=e.framebuffer;t.deleteFramebuffer(r),e.framebuffer=null,o.framebufferCount--,delete b[e.id]}function S(e){var r;t.bindFramebuffer(Ze,e.framebuffer);var i=e.colorAttachments;for(r=0;r<i.length;++r)f(36064+r,i[r]);for(r=i.length;r<n.maxColorAttachments;++r)t.framebufferTexture2D(Ze,36064+r,Ye,null,0);t.framebufferTexture2D(Ze,33306,Ye,null,0),t.framebufferTexture2D(Ze,36096,Ye,null,0),t.framebufferTexture2D(Ze,36128,Ye,null,0),f(36096,e.depthAttachment),f(36128,e.stencilAttachment),f(33306,e.depthStencilAttachment),t.checkFramebufferStatus(Ze),t.isContextLost(),t.bindFramebuffer(Ze,s.next?s.next.framebuffer:null),s.cur=s.next,t.getError()}function A(t,r){var n=new _;function i(e,t){var r,a=0,o=0,s=!0,u=!0,h=null,p=!0,f="rgba",v="uint8",x=1,b=null,_=null,w=null,T=!1;if("number"===typeof e)a=0|e,o=0|t||a;else if(e){var A=e;if("shape"in A){var M=A.shape;a=M[0],o=M[1]}else"radius"in A&&(a=o=A.radius),"width"in A&&(a=A.width),"height"in A&&(o=A.height);("color"in A||"colors"in A)&&(h=A.color||A.colors,Array.isArray(h)),h||("colorCount"in A&&(x=0|A.colorCount),"colorTexture"in A&&(p=!!A.colorTexture,f="rgba4"),"colorType"in A&&(v=A.colorType,p||("half float"===v||"float16"===v?f="rgba16f":"float"!==v&&"float32"!==v||(f="rgba32f"))),"colorFormat"in A&&(f=A.colorFormat,l.indexOf(f)>=0?p=!0:c.indexOf(f)>=0&&(p=!1))),("depthTexture"in A||"depthStencilTexture"in A)&&(T=!(!A.depthTexture&&!A.depthStencilTexture)),"depth"in A&&("boolean"===typeof A.depth?s=A.depth:(b=A.depth,u=!1)),"stencil"in A&&("boolean"===typeof A.stencil?u=A.stencil:(_=A.stencil,s=!1)),"depthStencil"in A&&("boolean"===typeof A.depthStencil?s=u=A.depthStencil:(w=A.depthStencil,s=!1,u=!1))}else a=o=1;var E=null,C=null,P=null,L=null;if(Array.isArray(h))E=h.map(m);else if(h)E=[m(h)];else for(E=new Array(x),r=0;r<x;++r)E[r]=g(a,o,p,f,v);a=a||E[0].width,o=o||E[0].height,b?C=m(b):s&&!u&&(C=g(a,o,T,"depth","uint32")),_?P=m(_):u&&!s&&(P=g(a,o,!1,"stencil","uint8")),w?L=m(w):!b&&!_&&u&&s&&(L=g(a,o,T,"depth stencil","depth stencil"));var I=null;for(r=0;r<E.length;++r)if(d(E[r]),E[r]&&E[r].texture){var z=Ke[E[r].texture._texture.format]*Je[E[r].texture._texture.type];null===I&&(I=z)}return d(C),d(P),d(L),k(n),n.width=a,n.height=o,n.colorAttachments=E,n.depthAttachment=C,n.stencilAttachment=P,n.depthStencilAttachment=L,i.color=E.map(y),i.depth=y(C),i.stencil=y(P),i.depthStencil=y(L),i.width=n.width,i.height=n.height,S(n),i}return o.framebufferCount++,i(t,r),e(i,{resize:function(e,t){var r=Math.max(0|e,1),a=Math.max(0|t||r,1);if(r===n.width&&a===n.height)return i;for(var o=n.colorAttachments,s=0;s<o.length;++s)v(o[s],r,a);return v(n.depthAttachment,r,a),v(n.stencilAttachment,r,a),v(n.depthStencilAttachment,r,a),n.width=i.width=r,n.height=i.height=a,S(n),i},_reglType:"framebuffer",_framebuffer:n,destroy:function(){T(n),k(n)},use:function(e){s.setFBO({framebuffer:i},e)}})}return e(s,{getFramebuffer:function(e){if("function"===typeof e&&"framebuffer"===e._reglType){var t=e._framebuffer;if(t instanceof _)return t}return null},create:A,createCube:function(t){var r=Array(6);function n(t){var a,o,s={color:null},l=0,c=null,u="rgba",h="uint8",p=1;if("number"===typeof t)l=0|t;else if(t){var d=t;"shape"in d?l=d.shape[0]:("radius"in d&&(l=0|d.radius),"width"in d?l=0|d.width:"height"in d&&(l=0|d.height)),("color"in d||"colors"in d)&&(c=d.color||d.colors,Array.isArray(c)),c||("colorCount"in d&&(p=0|d.colorCount),"colorType"in d&&(h=d.colorType),"colorFormat"in d&&(u=d.colorFormat)),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;if(c)if(Array.isArray(c))for(o=[],a=0;a<c.length;++a)o[a]=c[a];else o=[c];else{o=Array(p);var f={radius:l,format:u,type:h};for(a=0;a<p;++a)o[a]=i.createCube(f)}for(s.color=Array(o.length),a=0;a<o.length;++a){var m=o[a];l=l||m.width,s.color[a]={target:34069,data:o[a]}}for(a=0;a<6;++a){for(var g=0;g<o.length;++g)s.color[g].target=34069+a;a>0&&(s.depth=r[0].depth,s.stencil=r[0].stencil,s.depthStencil=r[0].depthStencil),r[a]?r[a](s):r[a]=A(s)}return e(n,{width:l,height:l,color:o})}return n(t),e(n,{faces:r,resize:function(e){var t,i=0|e;if(i===n.width)return n;var a=n.color;for(t=0;t<a.length;++t)a[t].resize(i);for(t=0;t<6;++t)r[t].resize(i);return n.width=n.height=i,n},_reglType:"framebufferCube",destroy:function(){r.forEach((function(e){e.destroy()}))}})},clear:function(){w(b).forEach(T)},restore:function(){s.cur=null,s.next=null,s.dirty=!0,w(b).forEach((function(e){e.framebuffer=t.createFramebuffer(),S(e)}))}})}(n,d,q,Z,X,u),K=qr(n,c,d,q,H,G,0,Y,{},W,$,V,A,f,p,r),J=rt(n,Y,K.procs.poll,A),Q=K.next,ee=n.canvas,te=[],re=[],ne=[],ie=[r.onDestroy],ae=null;function oe(){if(0===te.length)return f&&f.update(),void(ae=null);ae=s.next(oe),ge();for(var e=te.length-1;e>=0;--e){var t=te[e];t&&t(A,null,0)}n.flush(),f&&f.update()}function se(){!ae&&te.length>0&&(ae=s.next(oe))}function le(){ae&&(s.cancel(oe),ae=null)}function ce(e){e.preventDefault(),le(),re.forEach((function(e){e()}))}function ue(e){n.getError(),a.restore(),$.restore(),H.restore(),Z.restore(),X.restore(),Y.restore(),W.restore(),f&&f.restore(),K.procs.refresh(),se(),ne.forEach((function(e){e()}))}function he(t){function r(e,t){var r={},n={};return Object.keys(e).forEach((function(i){var a=e[i];if(o.isDynamic(a))n[i]=o.unbox(a,i);else{if(t&&Array.isArray(a))for(var s=0;s<a.length;++s)if(o.isDynamic(a[s]))return void(n[i]=o.unbox(a,i));r[i]=a}})),{dynamic:n,static:r}}var n=r(t.context||{},!0),i=r(t.uniforms||{},!0),a=r(t.attributes||{},!1),s=r(function(t){var r=e({},t);function n(e){if(e in r){var t=r[e];delete r[e],Object.keys(t).forEach((function(n){r[e+"."+n]=t[n]}))}}return delete r.uniforms,delete r.attributes,delete r.context,delete r.vao,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),n("blend"),n("depth"),n("cull"),n("stencil"),n("polygonOffset"),n("scissor"),n("sample"),"vao"in t&&(r.vao=t.vao),r}(t),!1),l={gpuTime:0,cpuTime:0,count:0},c=K.compile(s,a,i,n,l),u=c.draw,h=c.batch,p=c.scope,d=[];return e((function(e,t){var r;if("function"===typeof e)return p.call(this,null,e,0);if("function"===typeof t)if("number"===typeof e)for(r=0;r<e;++r)p.call(this,null,t,r);else{if(!Array.isArray(e))return p.call(this,e,t,0);for(r=0;r<e.length;++r)p.call(this,e[r],t,r)}else if("number"===typeof e){if(e>0)return h.call(this,function(e){for(;d.length<e;)d.push(null);return d}(0|e),0|e)}else{if(!Array.isArray(e))return u.call(this,e);if(e.length)return h.call(this,e,e.length)}}),{stats:l,destroy:function(){c.destroy()}})}ee&&(ee.addEventListener(Gr,ce,!1),ee.addEventListener(Wr,ue,!1));var pe=Y.setFBO=he({framebuffer:o.define.call(null,1,"framebuffer")});function de(e,t){var r=0;K.procs.poll();var i=t.color;i&&(n.clearColor(+i[0]||0,+i[1]||0,+i[2]||0,+i[3]||0),r|=16384),"depth"in t&&(n.clearDepth(+t.depth),r|=256),"stencil"in t&&(n.clearStencil(0|t.stencil),r|=1024),n.clear(r)}function fe(e){return te.push(e),se(),{cancel:function(){var t=$r(te,e);te[t]=function e(){var t=$r(te,e);te[t]=te[te.length-1],te.length-=1,te.length<=0&&le()}}}}function me(){var e=Q.viewport,t=Q.scissor_box;e[0]=e[1]=t[0]=t[1]=0,A.viewportWidth=A.framebufferWidth=A.drawingBufferWidth=e[2]=t[2]=n.drawingBufferWidth,A.viewportHeight=A.framebufferHeight=A.drawingBufferHeight=e[3]=t[3]=n.drawingBufferHeight}function ge(){A.tick+=1,A.time=ve(),me(),K.procs.poll()}function ye(){Z.refresh(),me(),K.procs.refresh(),f&&f.update()}function ve(){return(l()-k)/1e3}ye();var xe=e(he,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var r=0;r<6;++r)pe(e({framebuffer:t.framebuffer.faces[r]},t),de);else pe(t,de);else de(0,t)},prop:o.define.bind(null,1),context:o.define.bind(null,2),this:o.define.bind(null,3),draw:he({}),buffer:function(e){return H.create(e,34962,!1,!1)},elements:function(e){return G.create(e,!1)},texture:Z.create2D,cube:Z.createCube,renderbuffer:X.create,framebuffer:Y.create,framebufferCube:Y.createCube,vao:W.createVAO,attributes:i,frame:fe,on:function(e,t){var r;switch(e){case"frame":return fe(t);case"lost":r=re;break;case"restore":r=ne;break;case"destroy":r=ie}return r.push(t),{cancel:function(){for(var e=0;e<r.length;++e)if(r[e]===t)return r[e]=r[r.length-1],void r.pop()}}},limits:q,hasExtension:function(e){return q.extensions.indexOf(e.toLowerCase())>=0},read:J,destroy:function(){te.length=0,le(),ee&&(ee.removeEventListener(Gr,ce),ee.removeEventListener(Wr,ue)),$.clear(),Y.clear(),X.clear(),W.clear(),Z.clear(),G.clear(),H.clear(),f&&f.clear(),ie.forEach((function(e){e()}))},_gl:n,_refresh:ye,poll:function(){ge(),f&&f.update()},now:ve,stats:u,getCachedCode:function(){return p},preloadCachedCode:function(e){Object.entries(e).forEach((function(e){p[e[0]]=e[1]}))}});return r.onDone(null,xe),xe}},"object"===typeof e&&"undefined"!==typeof t?t.exports=n():r.createREGL=n()}}),Qv=p({"node_modules/gl-util/context.js"(e,t){var r=Bg();function n(e){if(e.container)if(e.container==document.body)document.body.style.width||(e.canvas.width=e.width||e.pixelRatio*window.innerWidth),document.body.style.height||(e.canvas.height=e.height||e.pixelRatio*window.innerHeight);else{var t=e.container.getBoundingClientRect();e.canvas.width=e.width||t.right-t.left,e.canvas.height=e.height||t.bottom-t.top}}function i(e){return"function"===typeof e.getContext&&"width"in e&&"height"in e}function a(){var e=document.createElement("canvas");return e.style.position="absolute",e.style.top=0,e.style.left=0,e}t.exports=function(e){var t;if(e?"string"===typeof e&&(e={container:e}):e={},(e=i(e)||"string"===typeof(t=e).nodeName&&"function"===typeof t.appendChild&&"function"===typeof t.getBoundingClientRect?{container:e}:function(e){return"function"===typeof e.drawArrays||"function"===typeof e.drawElements}(e)?{gl:e}:r(e,{container:"container target element el canvas holder parent parentNode wrapper use ref root node",gl:"gl context webgl glContext",attrs:"attributes attrs contextAttributes",pixelRatio:"pixelRatio pxRatio px ratio pxratio pixelratio",width:"w width",height:"h height"},!0)).pixelRatio||(e.pixelRatio=window.pixelRatio||1),e.gl)return e.gl;if(e.canvas&&(e.container=e.canvas.parentNode),e.container){if("string"===typeof e.container){var o=document.querySelector(e.container);if(!o)throw Error("Element "+e.container+" is not found");e.container=o}i(e.container)?(e.canvas=e.container,e.container=e.canvas.parentNode):e.canvas||(e.canvas=a(),e.container.appendChild(e.canvas),n(e))}else if(!e.canvas){if("undefined"===typeof document)throw Error("Not DOM environment. Use headless-gl.");e.container=document.body||document.documentElement,e.canvas=a(),e.container.appendChild(e.canvas),n(e)}return e.gl||["webgl","experimental-webgl","webgl-experimental"].some((function(r){try{e.gl=e.canvas.getContext(r,e.attrs)}catch(t){}return e.gl})),e.gl}}}),ex=p({"node_modules/font-atlas/index.js"(e,t){var r=Yv(),n=[32,126];t.exports=function(e){var t=(e=e||{}).shape?e.shape:e.canvas?[e.canvas.width,e.canvas.height]:[512,512],i=e.canvas||document.createElement("canvas"),a=e.font,o="number"===typeof e.step?[e.step,e.step]:e.step||[32,32],s=e.chars||n;if(a&&"string"!==typeof a&&(a=r(a)),Array.isArray(s)){if(2===s.length&&"number"===typeof s[0]&&"number"===typeof s[1]){for(var l=[],c=s[0],u=0;c<=s[1];c++)l[u++]=String.fromCharCode(c);s=l}}else s=String(s).split("");t=t.slice(),i.width=t[0],i.height=t[1];var h=i.getContext("2d");h.fillStyle="#000",h.fillRect(0,0,i.width,i.height),h.font=a,h.textAlign="center",h.textBaseline="middle",h.fillStyle="#fff";var p=o[0]/2,d=o[1]/2;for(c=0;c<s.length;c++)h.fillText(s[c],p,d),(p+=o[0])>t[0]-o[0]/2&&(p=o[0]/2,d+=o[1]);return i}}}),tx=p({"node_modules/bit-twiddle/twiddle.js"(e){function t(e){var t=32;return(e&=-e)&&t--,65535&e&&(t-=16),16711935&e&&(t-=8),252645135&e&&(t-=4),858993459&e&&(t-=2),1431655765&e&&(t-=1),t}e.INT_BITS=32,e.INT_MAX=2147483647,e.INT_MIN=-1<<31,e.sign=function(e){return(e>0)-(e<0)},e.abs=function(e){var t=e>>31;return(e^t)-t},e.min=function(e,t){return t^(e^t)&-(e<t)},e.max=function(e,t){return e^(e^t)&-(e<t)},e.isPow2=function(e){return!(e&e-1)&&!!e},e.log2=function(e){var t,r;return t=(e>65535)<<4,t|=r=((e>>>=t)>255)<<3,t|=r=((e>>>=r)>15)<<2,(t|=r=((e>>>=r)>3)<<1)|(e>>>=r)>>1},e.log10=function(e){return e>=1e9?9:e>=1e8?8:e>=1e7?7:e>=1e6?6:e>=1e5?5:e>=1e4?4:e>=1e3?3:e>=100?2:e>=10?1:0},e.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},e.countTrailingZeros=t,e.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},e.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},e.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var r=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,n=t,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;e[t]=n<<i&255}}(r),e.reverse=function(e){return r[255&e]<<24|r[e>>>8&255]<<16|r[e>>>16&255]<<8|r[e>>>24&255]},e.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},e.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},e.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},e.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},e.nextCombination=function(e){var r=e|e-1;return r+1|(~r&-~r)-1>>>t(e)+1}}}),rx=p({"node_modules/dup/dup.js"(e,t){function r(e,t,n){var i=0|e[n];if(i<=0)return[];var a,o=new Array(i);if(n===e.length-1)for(a=0;a<i;++a)o[a]=t;else for(a=0;a<i;++a)o[a]=r(e,t,n+1);return o}t.exports=function(e,t){switch("undefined"===typeof t&&(t=0),typeof e){case"number":if(e>0)return function(e,t){var r,n;for(r=new Array(e),n=0;n<e;++n)r[n]=t;return r}(0|e,t);break;case"object":if("number"===typeof e.length)return r(e,t,0)}return[]}}}),nx=p({"node_modules/typedarray-pool/pool.js"(e){var t=tx(),r=rx(),n=Vl().Buffer;window.__TYPEDARRAY_POOL||(window.__TYPEDARRAY_POOL={UINT8:r([32,0]),UINT16:r([32,0]),UINT32:r([32,0]),BIGUINT64:r([32,0]),INT8:r([32,0]),INT16:r([32,0]),INT32:r([32,0]),BIGINT64:r([32,0]),FLOAT:r([32,0]),DOUBLE:r([32,0]),DATA:r([32,0]),UINT8C:r([32,0]),BUFFER:r([32,0])});var i="undefined"!==typeof Uint8ClampedArray,a="undefined"!==typeof BigUint64Array,o="undefined"!==typeof BigInt64Array,s=window.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=r([32,0])),s.BIGUINT64||(s.BIGUINT64=r([32,0])),s.BIGINT64||(s.BIGINT64=r([32,0])),s.BUFFER||(s.BUFFER=r([32,0]));var l=s.DATA,c=s.BUFFER;function u(e){if(e){var r=e.length||e.byteLength,n=t.log2(r);l[n].push(e)}}function h(e){e=t.nextPow2(e);var r=t.log2(e),n=l[r];return n.length>0?n.pop():new ArrayBuffer(e)}function p(e){return new Uint8Array(h(e),0,e)}function d(e){return new Uint16Array(h(2*e),0,e)}function f(e){return new Uint32Array(h(4*e),0,e)}function m(e){return new Int8Array(h(e),0,e)}function g(e){return new Int16Array(h(2*e),0,e)}function y(e){return new Int32Array(h(4*e),0,e)}function v(e){return new Float32Array(h(4*e),0,e)}function x(e){return new Float64Array(h(8*e),0,e)}function b(e){return i?new Uint8ClampedArray(h(e),0,e):p(e)}function _(e){return a?new BigUint64Array(h(8*e),0,e):null}function w(e){return o?new BigInt64Array(h(8*e),0,e):null}function k(e){return new DataView(h(e),0,e)}function T(e){e=t.nextPow2(e);var r=t.log2(e),i=c[r];return i.length>0?i.pop():new n(e)}e.free=function(e){if(n.isBuffer(e))c[t.log2(e.length)].push(e);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(e)&&(e=e.buffer),!e)return;var r=e.length||e.byteLength,i=0|t.log2(r);l[i].push(e)}},e.freeUint8=e.freeUint16=e.freeUint32=e.freeBigUint64=e.freeInt8=e.freeInt16=e.freeInt32=e.freeBigInt64=e.freeFloat32=e.freeFloat=e.freeFloat64=e.freeDouble=e.freeUint8Clamped=e.freeDataView=function(e){u(e.buffer)},e.freeArrayBuffer=u,e.freeBuffer=function(e){c[t.log2(e.length)].push(e)},e.malloc=function(e,t){if(void 0===t||"arraybuffer"===t)return h(e);switch(t){case"uint8":return p(e);case"uint16":return d(e);case"uint32":return f(e);case"int8":return m(e);case"int16":return g(e);case"int32":return y(e);case"float":case"float32":return v(e);case"double":case"float64":return x(e);case"uint8_clamped":return b(e);case"bigint64":return w(e);case"biguint64":return _(e);case"buffer":return T(e);case"data":case"dataview":return k(e);default:return null}return null},e.mallocArrayBuffer=h,e.mallocUint8=p,e.mallocUint16=d,e.mallocUint32=f,e.mallocInt8=m,e.mallocInt16=g,e.mallocInt32=y,e.mallocFloat32=e.mallocFloat=v,e.mallocFloat64=e.mallocDouble=x,e.mallocUint8Clamped=b,e.mallocBigUint64=_,e.mallocBigInt64=w,e.mallocDataView=k,e.mallocBuffer=T,e.clearCache=function(){for(var e=0;e<32;++e)s.UINT8[e].length=0,s.UINT16[e].length=0,s.UINT32[e].length=0,s.INT8[e].length=0,s.INT16[e].length=0,s.INT32[e].length=0,s.FLOAT[e].length=0,s.DOUBLE[e].length=0,s.BIGUINT64[e].length=0,s.BIGINT64[e].length=0,s.UINT8C[e].length=0,l[e].length=0,c[e].length=0}}}),ix=p({"node_modules/is-plain-obj/index.js"(e,t){var r=Object.prototype.toString;t.exports=function(e){var t;return"[object Object]"===r.call(e)&&(null===(t=Object.getPrototypeOf(e))||t===Object.getPrototypeOf({}))}}}),ax=p({"node_modules/parse-unit/index.js"(e,t){t.exports=function(e,t){t||(t=[0,""]),e=String(e);var r=parseFloat(e,10);return t[0]=r,t[1]=e.match(/[\d.\-\+]*\s*(.*)/)[1]||"",t}}}),ox=p({"node_modules/to-px/topx.js"(e,t){var r=ax();function n(e,t){var n=r(getComputedStyle(e).getPropertyValue(t));return n[0]*i(n[1],e)}function i(e,t){switch(t=t||document.body,e=(e||"px").trim().toLowerCase(),t!==window&&t!==document||(t=document.body),e){case"%":return t.clientHeight/100;case"ch":case"ex":return function(e,t){var r=document.createElement("div");r.style["font-size"]="128"+e,t.appendChild(r);var i=n(r,"font-size")/128;return t.removeChild(r),i}(e,t);case"em":return n(t,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return 96;case"cm":return 96/2.54;case"mm":return 96/25.4;case"pt":return 96/72;case"pc":return 16}return 1}t.exports=i}}),sx=p({"node_modules/detect-kerning/index.js"(e,t){t.exports=i;var r=(i.canvas=document.createElement("canvas")).getContext("2d"),n=a([32,126]);function i(e,t){Array.isArray(e)&&(e=e.join(", "));var i,o={},s=16,l=.05;t&&(2===t.length&&"number"===typeof t[0]?i=a(t):Array.isArray(t)?i=t:(t.o?i=a(t.o):t.pairs&&(i=t.pairs),t.fontSize&&(s=t.fontSize),null!=t.threshold&&(l=t.threshold))),i||(i=n),r.font=s+"px "+e;for(var c=0;c<i.length;c++){var u=i[c],h=r.measureText(u[0]).width+r.measureText(u[1]).width,p=r.measureText(u).width;if(Math.abs(h-p)>s*l){var d=(p-h)/s;o[u]=1e3*d}}return o}function a(e){for(var t=[],r=e[0];r<=e[1];r++)for(var n=String.fromCharCode(r),i=e[0];i<e[1];i++){var a=n+String.fromCharCode(i);t.push(a)}return t}i.createPairs=a,i.ascii=n}}),lx=p({"node_modules/font-measure/index.js"(e,t){function r(e,t){t||(t={}),("string"===typeof e||Array.isArray(e))&&(t.family=e);var o=Array.isArray(t.family)?t.family.join(", "):t.family;if(!o)throw Error("`family` must be defined");var s=t.size||t.fontSize||t.em||48,l=t.weight||t.fontWeight||"",c=(e=[t.style||t.fontStyle||"",l,s].join(" ")+"px "+o,t.origin||"top");if(r.cache[o]&&s<=r.cache[o].em)return n(r.cache[o],c);var u=t.canvas||r.canvas,h=u.getContext("2d"),p={upper:void 0!==t.upper?t.upper:"H",lower:void 0!==t.lower?t.lower:"x",descent:void 0!==t.descent?t.descent:"p",ascent:void 0!==t.ascent?t.ascent:"h",tittle:void 0!==t.tittle?t.tittle:"i",overshoot:void 0!==t.overshoot?t.overshoot:"O"},d=Math.ceil(1.5*s);u.height=d,u.width=.5*d,h.font=e;var f="H",m={top:0};h.clearRect(0,0,d,d),h.textBaseline="top",h.fillStyle="black",h.fillText(f,0,0);var g=i(h.getImageData(0,0,d,d));h.clearRect(0,0,d,d),h.textBaseline="bottom",h.fillText(f,0,d);var y=i(h.getImageData(0,0,d,d));m.lineHeight=m.bottom=d-y+g,h.clearRect(0,0,d,d),h.textBaseline="alphabetic",h.fillText(f,0,d);var v=d-i(h.getImageData(0,0,d,d))-1+g;m.baseline=m.alphabetic=v,h.clearRect(0,0,d,d),h.textBaseline="middle",h.fillText(f,0,.5*d);var x=i(h.getImageData(0,0,d,d));m.median=m.middle=d-x-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="hanging",h.fillText(f,0,.5*d);var b=i(h.getImageData(0,0,d,d));m.hanging=d-b-1+g-.5*d,h.clearRect(0,0,d,d),h.textBaseline="ideographic",h.fillText(f,0,d);var _=i(h.getImageData(0,0,d,d));if(m.ideographic=d-_-1+g,p.upper&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.upper,0,0),m.upper=i(h.getImageData(0,0,d,d)),m.capHeight=m.baseline-m.upper),p.lower&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.lower,0,0),m.lower=i(h.getImageData(0,0,d,d)),m.xHeight=m.baseline-m.lower),p.tittle&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.tittle,0,0),m.tittle=i(h.getImageData(0,0,d,d))),p.ascent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.ascent,0,0),m.ascent=i(h.getImageData(0,0,d,d))),p.descent&&(h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.descent,0,0),m.descent=a(h.getImageData(0,0,d,d))),p.overshoot){h.clearRect(0,0,d,d),h.textBaseline="top",h.fillText(p.overshoot,0,0);var w=a(h.getImageData(0,0,d,d));m.overshoot=w-v}for(var k in m)m[k]/=s;return m.em=s,r.cache[o]=m,n(m,c)}function n(e,t){var r={};for(var n in"string"===typeof t&&(t=e[t]),e)"em"!==n&&(r[n]=e[n]-t);return r}function i(e){for(var t=e.height,r=e.data,n=3;n<r.length;n+=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}function a(e){for(var t=e.height,r=e.data,n=r.length-1;n>0;n-=4)if(0!==r[n])return Math.floor(.25*(n-3)/t)}t.exports=r,r.canvas=document.createElement("canvas"),r.cache={}}}),cx=p({"node_modules/gl-text/dist.js"(e,t){var r,n=Kv(),i=Bg(),a=Jv(),o=Qv(),s=Rv(),l=Bf(),c=ex(),u=nx(),h=Ng(),p=ix(),d=ax(),f=ox(),m=sx(),g=uy(),y=lx(),v=qg(),x=tx().nextPow2,b=new s,_=!1;document.body&&((r=document.body.appendChild(document.createElement("div"))).style.font="italic small-caps bold condensed 16px/2 cursive",getComputedStyle(r).fontStretch&&(_=!0),document.body.removeChild(r));var w=function(e){!function(e){return"function"===typeof e&&e._gl&&e.prop&&e.texture&&e.buffer}(e)?this.gl=o(e):(e={regl:e},this.gl=e.regl._gl),this.shader=b.get(this.gl),this.shader?this.regl=this.shader.regl:this.regl=e.regl||a({gl:this.gl}),this.charBuffer=this.regl.buffer({type:"uint8",usage:"stream"}),this.sizeBuffer=this.regl.buffer({type:"float",usage:"stream"}),this.shader||(this.shader=this.createShader(),b.set(this.gl,this.shader)),this.batch=[],this.fontSize=[],this.font=[],this.fontAtlas=[],this.draw=this.shader.draw.bind(this),this.render=function(){this.regl._refresh(),this.draw(this.batch)},this.canvas=this.gl.canvas,this.update(p(e)?e:{})};w.prototype.createShader=function(){var e=this.regl,t=e({blend:{enable:!0,color:[0,0,0,1],func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:"one minus dst alpha",dstAlpha:"one"}},stencil:{enable:!1},depth:{enable:!1},count:e.prop("count"),offset:e.prop("offset"),attributes:{charOffset:{offset:4,stride:8,buffer:e.this("sizeBuffer")},width:{offset:0,stride:8,buffer:e.this("sizeBuffer")},char:e.this("charBuffer"),position:e.this("position")},uniforms:{atlasSize:function(e,t){return[t.atlas.width,t.atlas.height]},atlasDim:function(e,t){return[t.atlas.cols,t.atlas.rows]},atlas:function(e,t){return t.atlas.texture},charStep:function(e,t){return t.atlas.step},em:function(e,t){return t.atlas.em},color:e.prop("color"),opacity:e.prop("opacity"),viewport:e.this("viewportArray"),scale:e.this("scale"),align:e.prop("align"),baseline:e.prop("baseline"),translate:e.this("translate"),positionOffset:e.prop("positionOffset")},primitive:"points",viewport:e.this("viewport"),vert:"\n\t\t\tprecision highp float;\n\t\t\tattribute float width, charOffset, char;\n\t\t\tattribute vec2 position;\n\t\t\tuniform float fontSize, charStep, em, align, baseline;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform vec4 color;\n\t\t\tuniform vec2 atlasSize, atlasDim, scale, translate, positionOffset;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvoid main () {\n\t\t\t\tvec2 offset = floor(em * (vec2(align + charOffset, baseline)\n\t\t\t\t\t+ vec2(positionOffset.x, -positionOffset.y)))\n\t\t\t\t\t/ (viewport.zw * scale.xy);\n\n\t\t\t\tvec2 position = (position + translate) * scale;\n\t\t\t\tposition += offset * scale;\n\n\t\t\t\tcharCoord = position * viewport.zw + viewport.xy;\n\n\t\t\t\tgl_Position = vec4(position * 2. - 1., 0, 1);\n\n\t\t\t\tgl_PointSize = charStep;\n\n\t\t\t\tcharId.x = mod(char, atlasDim.x);\n\t\t\t\tcharId.y = floor(char / atlasDim.x);\n\n\t\t\t\tcharWidth = width * em;\n\n\t\t\t\tfontColor = color / 255.;\n\t\t\t}",frag:"\n\t\t\tprecision highp float;\n\t\t\tuniform float fontSize, charStep, opacity;\n\t\t\tuniform vec2 atlasSize;\n\t\t\tuniform vec4 viewport;\n\t\t\tuniform sampler2D atlas;\n\t\t\tvarying vec4 fontColor;\n\t\t\tvarying vec2 charCoord, charId;\n\t\t\tvarying float charWidth;\n\n\t\t\tfloat lightness(vec4 color) {\n\t\t\t\treturn color.r * 0.299 + color.g * 0.587 + color.b * 0.114;\n\t\t\t}\n\n\t\t\tvoid main () {\n\t\t\t\tvec2 uv = gl_FragCoord.xy - charCoord + charStep * .5;\n\t\t\t\tfloat halfCharStep = floor(charStep * .5 + .5);\n\n\t\t\t\t// invert y and shift by 1px (FF expecially needs that)\n\t\t\t\tuv.y = charStep - uv.y;\n\n\t\t\t\t// ignore points outside of character bounding box\n\t\t\t\tfloat halfCharWidth = ceil(charWidth * .5);\n\t\t\t\tif (floor(uv.x) > halfCharStep + halfCharWidth ||\n\t\t\t\t\tfloor(uv.x) < halfCharStep - halfCharWidth) return;\n\n\t\t\t\tuv += charId * charStep;\n\t\t\t\tuv = uv / atlasSize;\n\n\t\t\t\tvec4 color = fontColor;\n\t\t\t\tvec4 mask = texture2D(atlas, uv);\n\n\t\t\t\tfloat maskY = lightness(mask);\n\t\t\t\t// float colorY = lightness(color);\n\t\t\t\tcolor.a *= maskY;\n\t\t\t\tcolor.a *= opacity;\n\n\t\t\t\t// color.a += .1;\n\n\t\t\t\t// antialiasing, see yiq color space y-channel formula\n\t\t\t\t// color.rgb += (1. - color.rgb) * (1. - mask.rgb);\n\n\t\t\t\tgl_FragColor = color;\n\t\t\t}"});return{regl:e,draw:t,atlas:{}}},w.prototype.update=function(e){var t=this;if("string"===typeof e)e={text:e};else if(!e)return;null!=(e=i(e,{position:"position positions coord coords coordinates",font:"font fontFace fontface typeface cssFont css-font family fontFamily",fontSize:"fontSize fontsize size font-size",text:"text texts chars characters value values symbols",align:"align alignment textAlign textbaseline",baseline:"baseline textBaseline textbaseline",direction:"dir direction textDirection",color:"color colour fill fill-color fillColor textColor textcolor",kerning:"kerning kern",range:"range dataBox",viewport:"vp viewport viewBox viewbox viewPort",opacity:"opacity alpha transparency visible visibility opaque",offset:"offset positionOffset padding shift indent indentation"},!0)).opacity&&(Array.isArray(e.opacity)?this.opacity=e.opacity.map((function(e){return parseFloat(e)})):this.opacity=parseFloat(e.opacity)),null!=e.viewport&&(this.viewport=h(e.viewport),this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null==this.viewport&&(this.viewport={x:0,y:0,width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight},this.viewportArray=[this.viewport.x,this.viewport.y,this.viewport.width,this.viewport.height]),null!=e.kerning&&(this.kerning=e.kerning),null!=e.offset&&("number"===typeof e.offset&&(e.offset=[e.offset,0]),this.positionOffset=v(e.offset)),e.direction&&(this.direction=e.direction),e.range&&(this.range=e.range,this.scale=[1/(e.range[2]-e.range[0]),1/(e.range[3]-e.range[1])],this.translate=[-e.range[0],-e.range[1]]),e.scale&&(this.scale=e.scale),e.translate&&(this.translate=e.translate),this.scale||(this.scale=[1/this.viewport.width,1/this.viewport.height]),this.translate||(this.translate=[0,0]),this.font.length||e.font||(e.font=w.baseFontSize+"px sans-serif");var r,a=!1,o=!1;if(e.font&&(Array.isArray(e.font)?e.font:[e.font]).forEach((function(e,r){if("string"===typeof e)try{e=n.parse(e)}catch(v){e=n.parse(w.baseFontSize+"px "+e)}else{var i=e.style,s=e.weight,l=e.stretch,c=e.variant;e=n.parse(n.stringify(e)),i&&(e.style=i),s&&(e.weight=s),l&&(e.stretch=l),c&&(e.variant=c)}var u=n.stringify({size:w.baseFontSize,family:e.family,stretch:_?e.stretch:void 0,variant:e.variant,weight:e.weight,style:e.style}),h=d(e.size),p=Math.round(h[0]*f(h[1]));if(p!==t.fontSize[r]&&(o=!0,t.fontSize[r]=p),(!t.font[r]||u!=t.font[r].baseString)&&(a=!0,t.font[r]=w.fonts[u],!t.font[r])){var m=e.family.join(", "),g=[e.style];e.style!=e.variant&&g.push(e.variant),e.variant!=e.weight&&g.push(e.weight),_&&e.weight!=e.stretch&&g.push(e.stretch),t.font[r]={baseString:u,family:m,weight:e.weight,stretch:e.stretch,style:e.style,variant:e.variant,width:{},kerning:{},metrics:y(m,{origin:"top",fontSize:w.baseFontSize,fontStyle:g.join(" ")})},w.fonts[u]=t.font[r]}})),(a||o)&&this.font.forEach((function(r,i){var a=n.stringify({size:t.fontSize[i],family:r.family,stretch:_?r.stretch:void 0,variant:r.variant,weight:r.weight,style:r.style});if(t.fontAtlas[i]=t.shader.atlas[a],!t.fontAtlas[i]){var o=r.metrics;t.shader.atlas[a]=t.fontAtlas[i]={fontString:a,step:2*Math.ceil(t.fontSize[i]*o.bottom*.5),em:t.fontSize[i],cols:0,rows:0,height:0,width:0,chars:[],ids:{},texture:t.regl.texture()}}null==e.text&&(e.text=t.text)})),"string"===typeof e.text&&e.position&&e.position.length>2){for(var s=Array(.5*e.position.length),p=0;p<s.length;p++)s[p]=e.text;e.text=s}if(null!=e.text||a){if(this.textOffsets=[0],Array.isArray(e.text)){this.count=e.text[0].length,this.counts=[this.count];for(var b=1;b<e.text.length;b++)this.textOffsets[b]=this.textOffsets[b-1]+e.text[b-1].length,this.count+=e.text[b].length,this.counts.push(e.text[b].length);this.text=e.text.join("")}else this.text=e.text,this.count=this.text.length,this.counts=[this.count];r=[],this.font.forEach((function(e,n){w.atlasContext.font=e.baseString;for(var i=t.fontAtlas[n],a=0;a<t.text.length;a++){var o=t.text.charAt(a);if(null==i.ids[o]&&(i.ids[o]=i.chars.length,i.chars.push(o),r.push(o)),null==e.width[o]&&(e.width[o]=w.atlasContext.measureText(o).width/w.baseFontSize,t.kerning)){var s=[];for(var l in e.width)s.push(l+o,o+l);g(e.kerning,m(e.family,{pairs:s}))}}}))}if(e.position)if(e.position.length>2){for(var k=!e.position[0].length,T=u.mallocFloat(2*this.count),S=0,A=0;S<this.counts.length;S++){var M=this.counts[S];if(k)for(var E=0;E<M;E++)T[A++]=e.position[2*S],T[A++]=e.position[2*S+1];else for(var C=0;C<M;C++)T[A++]=e.position[S][0],T[A++]=e.position[S][1]}this.position.call?this.position({type:"float",data:T}):this.position=this.regl.buffer({type:"float",data:T}),u.freeFloat(T)}else this.position.destroy&&this.position.destroy(),this.position={constant:e.position};if(e.text||a){var P=u.mallocUint8(this.count),L=u.mallocFloat(2*this.count);this.textWidth=[];for(var I=0,z=0;I<this.counts.length;I++){for(var O=this.counts[I],R=this.font[I]||this.font[0],D=this.fontAtlas[I]||this.fontAtlas[0],j=0;j<O;j++){var F=this.text.charAt(z),B=this.text.charAt(z-1);if(P[z]=D.ids[F],L[2*z]=R.width[F],j){var N=L[2*z-2],U=L[2*z],V=L[2*z-1]+.5*N+.5*U;if(this.kerning){var q=R.kerning[B+F];q&&(V+=.001*q)}L[2*z+1]=V}else L[2*z+1]=.5*L[2*z];z++}this.textWidth.push(L.length?.5*L[2*z-2]+L[2*z-1]:0)}e.align||(e.align=this.align),this.charBuffer({data:P,type:"uint8",usage:"stream"}),this.sizeBuffer({data:L,type:"float",usage:"stream"}),u.freeUint8(P),u.freeFloat(L),r.length&&this.font.forEach((function(e,r){var n=t.fontAtlas[r],i=n.step,a=Math.floor(w.maxAtlasSize/i),o=Math.min(a,n.chars.length),s=Math.ceil(n.chars.length/o),l=x(o*i),u=x(s*i);n.width=l,n.height=u,n.rows=s,n.cols=o,n.em&&n.texture({data:c({canvas:w.atlasCanvas,font:n.fontString,chars:n.chars,shape:[l,u],step:[i,i]})})}))}if(e.align&&(this.align=e.align,this.alignOffset=this.textWidth.map((function(e,r){var n=Array.isArray(t.align)?t.align.length>1?t.align[r]:t.align[0]:t.align;if("number"===typeof n)return n;switch(n){case"right":case"end":return-e;case"center":case"centre":case"middle":return.5*-e}return 0}))),null==this.baseline&&null==e.baseline&&(e.baseline=0),null!=e.baseline&&(this.baseline=e.baseline,Array.isArray(this.baseline)||(this.baseline=[this.baseline]),this.baselineOffset=this.baseline.map((function(e,r){var n=(t.font[r]||t.font[0]).metrics,i=0;return i+=.5*n.bottom,i+="number"===typeof e?e-n.baseline:-n[e],i*=-1}))),null!=e.color)if(e.color||(e.color="transparent"),"string"!==typeof e.color&&isNaN(e.color)){var H;if("number"===typeof e.color[0]&&e.color.length>this.counts.length){var G=e.color.length;H=u.mallocUint8(G);for(var W=(e.color.subarray||e.color.slice).bind(e.color),$=0;$<G;$+=4)H.set(l(W($,$+4),"uint8"),$)}else{var Z=e.color.length;H=u.mallocUint8(4*Z);for(var X=0;X<Z;X++)H.set(l(e.color[X]||0,"uint8"),4*X)}this.color=H}else this.color=l(e.color,"uint8");if(e.position||e.text||e.color||e.baseline||e.align||e.font||e.offset||e.opacity)if(this.color.length>4||this.baselineOffset.length>1||this.align&&this.align.length>1||this.fontAtlas.length>1||this.positionOffset.length>2){var Y=Math.max(.5*this.position.length||0,.25*this.color.length||0,this.baselineOffset.length||0,this.alignOffset.length||0,this.font.length||0,this.opacity.length||0,.5*this.positionOffset.length||0);this.batch=Array(Y);for(var K=0;K<this.batch.length;K++)this.batch[K]={count:this.counts.length>1?this.counts[K]:this.counts[0],offset:this.textOffsets.length>1?this.textOffsets[K]:this.textOffsets[0],color:this.color?this.color.length<=4?this.color:this.color.subarray(4*K,4*K+4):[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[K]:this.opacity,baseline:null!=this.baselineOffset[K]?this.baselineOffset[K]:this.baselineOffset[0],align:this.align?null!=this.alignOffset[K]?this.alignOffset[K]:this.alignOffset[0]:0,atlas:this.fontAtlas[K]||this.fontAtlas[0],positionOffset:this.positionOffset.length>2?this.positionOffset.subarray(2*K,2*K+2):this.positionOffset}}else this.count?this.batch=[{count:this.count,offset:0,color:this.color||[0,0,0,255],opacity:Array.isArray(this.opacity)?this.opacity[0]:this.opacity,baseline:this.baselineOffset[0],align:this.alignOffset?this.alignOffset[0]:0,atlas:this.fontAtlas[0],positionOffset:this.positionOffset}]:this.batch=[]},w.prototype.destroy=function(){},w.prototype.kerning=!0,w.prototype.position={constant:new Float32Array(2)},w.prototype.translate=null,w.prototype.scale=null,w.prototype.font=null,w.prototype.text="",w.prototype.positionOffset=[0,0],w.prototype.opacity=1,w.prototype.color=new Uint8Array([0,0,0,255]),w.prototype.alignOffset=[0,0],w.maxAtlasSize=1024,w.atlasCanvas=document.createElement("canvas"),w.atlasContext=w.atlasCanvas.getContext("2d",{alpha:!1}),w.baseFontSize=64,w.fonts={},t.exports=w}}),ux=p({"src/lib/prepare_regl.js"(e,t){var r=Kf(),n=Jv();t.exports=function(e,t,i){var a=e._fullLayout,o=!0;return a._glcanvas.each((function(r){if(r.regl)r.regl.preloadCachedCode(i);else if(!r.pick||a._has("parcoords")){try{r.regl=n({canvas:this,attributes:{antialias:!r.pick,preserveDrawingBuffer:!0},pixelRatio:e._context.plotGlPixelRatio||window.devicePixelRatio,extensions:t||[],cachedCode:i||{}})}catch(s){o=!1}r.regl||(o=!1),o&&this.addEventListener("webglcontextlost",(function(t){e&&e.emit&&e.emit("plotly_webglcontextlost",{event:t,layer:r.key})}),!1)}})),o||r({container:a._glcontainer.node()}),o}}}),hx=p({"src/traces/scattergl/plot.js"(e,t){var r=my(),n=jv(),i=Fv(),a=cx(),o=st(),s=Or().selectMode,l=ux(),c=$t(),u=ui(),h=oy().styleTextSelection,p={};function d(e,t,r,n){var i=e._size,a=e.width*n,o=e.height*n,s=i.l*n,l=i.b*n,c=i.r*n,u=i.t*n,h=i.w*n,p=i.h*n;return[s+t.domain[0]*h,l+r.domain[0]*p,a-c-(1-t.domain[1])*h,o-u-(1-r.domain[1])*p]}(t.exports=function(e,t,f){if(f.length){var m,g,y=e._fullLayout,v=t._scene,x=t.xaxis,b=t.yaxis;if(v)if(l(e,["ANGLE_instanced_arrays","OES_element_index_uint"],p)){var _=v.count,w=y._glcanvas.data()[0].regl;if(u(e,t,f),v.dirty){if(!v.line2d&&!v.error2d||v.scatter2d||v.fill2d||v.glText||w.clear({}),!0===v.error2d&&(v.error2d=i(w)),!0===v.line2d&&(v.line2d=n(w)),!0===v.scatter2d&&(v.scatter2d=r(w)),!0===v.fill2d&&(v.fill2d=n(w)),!0===v.glText)for(v.glText=new Array(_),m=0;m<_;m++)v.glText[m]=new a(w);if(v.glText){if(_>v.glText.length){var k=_-v.glText.length;for(m=0;m<k;m++)v.glText.push(new a(w))}else if(_<v.glText.length){var T=v.glText.length-_;v.glText.splice(_,T).forEach((function(e){e.destroy()}))}for(m=0;m<_;m++)v.glText[m].update(v.textOptions[m])}if(v.line2d&&(v.line2d.update(v.lineOptions),v.lineOptions=v.lineOptions.map((function(e){if(e&&e.positions){for(var t=e.positions,r=0;r<t.length&&(isNaN(t[r])||isNaN(t[r+1]));)r+=2;for(var n=t.length-2;n>r&&(isNaN(t[n])||isNaN(t[n+1]));)n-=2;e.positions=t.slice(r,n+2)}return e})),v.line2d.update(v.lineOptions)),v.error2d){var S=(v.errorXOptions||[]).concat(v.errorYOptions||[]);v.error2d.update(S)}v.scatter2d&&v.scatter2d.update(v.markerOptions),v.fillOrder=o.repeat(null,_),v.fill2d&&(v.fillOptions=v.fillOptions.map((function(e,t){var r=f[t];if(e&&r&&r[0]&&r[0].trace){var n,i,a=r[0],o=a.trace,s=a.t,l=v.lineOptions[t],c=[];o._ownfill&&c.push(t),o._nexttrace&&c.push(t+1),c.length&&(v.fillOrder[t]=c);var u,h,p=[],d=l&&l.positions||s.positions;if("tozeroy"===o.fill){for(u=0;u<d.length&&isNaN(d[u+1]);)u+=2;for(h=d.length-2;h>u&&isNaN(d[h+1]);)h-=2;0!==d[u+1]&&(p=[d[u],0]),p=p.concat(d.slice(u,h+2)),0!==d[h+1]&&(p=p.concat([d[h],0]))}else if("tozerox"===o.fill){for(u=0;u<d.length&&isNaN(d[u]);)u+=2;for(h=d.length-2;h>u&&isNaN(d[h]);)h-=2;0!==d[u]&&(p=[0,d[u+1]]),p=p.concat(d.slice(u,h+2)),0!==d[h]&&(p=p.concat([0,d[h+1]]))}else if("toself"===o.fill||"tonext"===o.fill){for(p=[],n=0,e.splitNull=!0,i=0;i<d.length;i+=2)(isNaN(d[i])||isNaN(d[i+1]))&&((p=p.concat(d.slice(n,i))).push(d[n],d[n+1]),p.push(null,null),n=i+2);p=p.concat(d.slice(n)),n&&p.push(d[n],d[n+1])}else{var m=o._nexttrace;if(m){var g=v.lineOptions[t+1];if(g){var y=g.positions;if("tonexty"===o.fill){for(p=d.slice(),t=Math.floor(y.length/2);t--;){var x=y[2*t],b=y[2*t+1];isNaN(x)||isNaN(b)||p.push(x,b)}e.fill=m.fillcolor}}}}if(o._prevtrace&&"tonext"===o._prevtrace.fill){var _=v.lineOptions[t-1].positions,w=p.length/2,k=[n=w];for(i=0;i<_.length;i+=2)(isNaN(_[i])||isNaN(_[i+1]))&&(k.push(i/2+w+1),n=i+2);p=p.concat(_),e.hole=k}return e.fillmode=o.fill,e.opacity=o.opacity,e.positions=p,e}})),v.fill2d.update(v.fillOptions))}var A=y.dragmode,M=s(A),E=y.clickmode.indexOf("select")>-1;for(m=0;m<_;m++){var C=f[m][0],P=C.trace,L=C.t,I=L.index,z=P._length,O=L.x,R=L.y;if(P.selectedpoints||M||E){if(M||(M=!0),P.selectedpoints){var D=v.selectBatch[I]=o.selIndices2selPoints(P),j={};for(g=0;g<D.length;g++)j[D[g]]=1;var F=[];for(g=0;g<z;g++)j[g]||F.push(g);v.unselectBatch[I]=F}var B=L.xpx=new Array(z),N=L.ypx=new Array(z);for(g=0;g<z;g++)B[g]=x.c2p(O[g]),N[g]=b.c2p(R[g])}else L.xpx=L.ypx=null}if(M){if(v.select2d||(v.select2d=r(y._glcanvas.data()[1].regl)),v.scatter2d){var U=new Array(_);for(m=0;m<_;m++)U[m]=v.selectBatch[m].length||v.unselectBatch[m].length?v.markerUnselectedOptions[m]:{};v.scatter2d.update(U)}v.select2d&&(v.select2d.update(v.markerOptions),v.select2d.update(v.markerSelectedOptions)),v.glText&&f.forEach((function(e){var t=((e||[])[0]||{}).trace||{};c.hasText(t)&&h(e)}))}else v.scatter2d&&v.scatter2d.update(v.markerOptions);var V={viewport:d(y,x,b,e._context.plotGlPixelRatio),range:[(x._rl||x.range)[0],(b._rl||b.range)[0],(x._rl||x.range)[1],(b._rl||b.range)[1]]},q=o.repeat(V,v.count);v.fill2d&&v.fill2d.update(q),v.line2d&&v.line2d.update(q),v.error2d&&v.error2d.update(q.concat(q)),v.scatter2d&&v.scatter2d.update(q),v.select2d&&v.select2d.update(q),v.glText&&v.glText.forEach((function(e){e.update(V)}))}else v.init()}}).reglPrecompiled=p}}),px=p({"src/traces/scattergl/index.js"(e,t){var r=ly();r.plot=hx(),t.exports=r}}),dx=p({"lib/scattergl.js"(e,t){t.exports=px()}}),fx=p({"src/traces/splom/attributes.js"(e,t){var r=wn(),n=Lt(),i=Et().axisHoverFormat,a=Oe().hovertemplateAttrs,o=Og(),s=yt().idRegex,l=gt().templatedArray,c=R().extendFlat,u=r.marker,h=u.line,p=c(n("marker.line",{editTypeOverride:"calc"}),{width:c({},h.width,{editType:"calc"}),editType:"calc"}),d=c(n("marker"),{symbol:u.symbol,angle:u.angle,size:c({},u.size,{editType:"markerSize"}),sizeref:u.sizeref,sizemin:u.sizemin,sizemode:u.sizemode,opacity:u.opacity,colorbar:u.colorbar,line:p,editType:"calc"});function f(e){return{valType:"info_array",freeLength:!0,editType:"calc",items:{valType:"subplotid",regex:s[e],editType:"plot"}}}d.color.editType=d.cmin.editType=d.cmax.editType="style",t.exports={dimensions:l("dimension",{visible:{valType:"boolean",dflt:!0,editType:"calc"},label:{valType:"string",editType:"calc"},values:{valType:"data_array",editType:"calc+clearAxisTypes"},axis:{type:{valType:"enumerated",values:["linear","log","date","category"],editType:"calc+clearAxisTypes"},matches:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc+clearAxisTypes"},editType:"calc+clearAxisTypes"}),text:c({},o.text,{}),hovertext:c({},o.hovertext,{}),hovertemplate:a(),xhoverformat:i("x"),yhoverformat:i("y"),marker:d,xaxes:f("x"),yaxes:f("y"),diagonal:{visible:{valType:"boolean",dflt:!0,editType:"calc"},editType:"calc"},showupperhalf:{valType:"boolean",dflt:!0,editType:"calc"},showlowerhalf:{valType:"boolean",dflt:!0,editType:"calc"},selected:{marker:o.selected.marker,editType:"calc"},unselected:{marker:o.unselected.marker,editType:"calc"},opacity:o.opacity}}}),mx=p({"src/traces/parcoords/merge_length.js"(e,t){t.exports=function(e,t,r,n){var i,a;for(n||(n=1/0),i=0;i<t.length;i++)(a=t[i]).visible&&(n=Math.min(n,a[r].length));for(n===1/0&&(n=0),e._length=n,i=0;i<t.length;i++)(a=t[i]).visible&&(a._length=n);return n}}}),gx=p({"src/traces/splom/defaults.js"(e,t){var r=st(),n=Ft(),i=fx(),a=$t(),o=Wn(),s=mx(),l=Rg().isOpenSymbol;function c(e,t){function n(n,a){return r.coerce(e,t,i.dimensions,n,a)}n("label");var a=n("values");a&&a.length?n("visible"):t.visible=!1,n("axis.type"),n("axis.matches")}t.exports=function(e,t,u,h){function p(n,a){return r.coerce(e,t,i,n,a)}var d=n(e,t,{name:"dimensions",handleItemDefaults:c}),f=p("diagonal.visible"),m=p("showupperhalf"),g=p("showlowerhalf");if(s(t,d,"values")&&(f||m||g)){p("text"),p("hovertext"),p("hovertemplate"),p("xhoverformat"),p("yhoverformat"),o(e,t,u,h,p,{noAngleRef:!0,noStandOff:!0});var y=l(t.marker.symbol),v=a.isBubble(t);p("marker.line.width",y||v?1:0),function(e,t,r,n){var i,a,o=t.dimensions,s=o.length,l=t.showupperhalf,c=t.showlowerhalf,u=t.diagonal.visible,h=new Array(s),p=new Array(s);for(i=0;i<s;i++){var d=i?i+1:"";h[i]="x"+d,p[i]="y"+d}var f=n("xaxes",h),m=n("yaxes",p),g=t._diag=new Array(s);t._xaxes={},t._yaxes={};var y=[],v=[];function x(e,n,i,a){if(e){var o=e.charAt(0),s=r._splomAxes[o];if(t["_"+o+"axes"][e]=1,a.push(e),!(e in s)){var l=s[e]={};i&&(l.label=i.label||"",i.visible&&i.axis&&(i.axis.type&&(l.type=i.axis.type),i.axis.matches&&(l.matches=n)))}}}var b=!u&&!c,_=!u&&!l;for(t._axesDim={},i=0;i<s;i++){var w=o[i],k=0===i,T=i===s-1,S=k&&b||T&&_?void 0:f[i],A=k&&_||T&&b?void 0:m[i];x(S,A,w,y),x(A,S,w,v),g[i]=[S,A],t._axesDim[S]=i,t._axesDim[A]=i}for(i=0;i<y.length;i++)for(a=0;a<v.length;a++){var M=y[i]+v[a];i>a&&l||i<a&&c?r._splomSubplots[M]=1:i!==a||!u&&c&&l||(r._splomSubplots[M]=1)}(!c||!u&&l&&c)&&(r._splomGridDflt.xside="bottom",r._splomGridDflt.yside="left")}(0,t,h,p),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),yx=p({"src/traces/splom/scene_update.js"(e,t){var r=st();t.exports=function(e,t){var n=e._fullLayout,i=t.uid,a=n._splomScenes;a||(a=n._splomScenes={});var o={dirty:!0,selectBatch:[],unselectBatch:[]},s=a[t.uid];return s||((s=a[i]=r.extendFlat({},o,{matrix:!1,selectBatch:[],unselectBatch:[]})).draw=function(){s.matrix&&s.matrix.draw&&(s.selectBatch.length||s.unselectBatch.length?s.matrix.draw(s.unselectBatch,s.selectBatch):s.matrix.draw()),s.dirty=!1},s.destroy=function(){s.matrix&&s.matrix.destroy&&s.matrix.destroy(),s.matrixOptions=null,s.selectBatch=null,s.unselectBatch=null,s=null}),s.dirty||r.extendFlat(s,o),s}}}),vx=p({"src/traces/splom/calc.js"(e,t){var r=st(),n=vt(),i=ai().calcMarkerSize,a=ai().calcAxisExpansion,o=ri(),s=ny().markerSelection,l=ny().markerStyle,c=yx(),u=T().BADNUM,h=zg().TOO_MANY_POINTS;t.exports=function(e,t){var p,d,f,m,g,y,v=t.dimensions,x=t._length,b={},_=b.cdata=[],w=b.data=[],k=t._visibleDims=[];function T(e,n){for(var i=e.makeCalcdata({v:n.values,vcalendar:t.calendar},"v"),a=0;a<i.length;a++)i[a]=i[a]===u?NaN:i[a];_.push(i),w.push("log"===e.type?r.simpleMap(i,e.c2l):i)}for(p=0;p<v.length;p++)if((f=v[p]).visible){if(m=n.getFromId(e,t._diag[p][0]),g=n.getFromId(e,t._diag[p][1]),m&&g&&m.type!==g.type){r.log("Skipping splom dimension "+p+" with conflicting axis types");continue}m?(T(m,f),g&&"category"===g.type&&(g._categories=m._categories.slice())):T(g,f),k.push(p)}for(o(e,t),r.extendFlat(b,l(e,t)),y=_.length*x>h?b.sizeAvg||Math.max(b.size,3):i(t,x),d=0;d<k.length;d++)f=v[p=k[d]],m=n.getFromId(e,t._diag[p][0])||{},g=n.getFromId(e,t._diag[p][1])||{},a(e,t,m,g,_[d],_[d],y);var S=c(e,t);return S.matrix||(S.matrix=!0),S.matrixOptions=b,S.selectedOptions=s(e,t,t.selected),S.unselectedOptions=s(e,t,t.unselected),[{x:!1,y:!1,t:{},trace:t}]}}}),xx=p({"node_modules/performance-now/lib/performance-now.js"(e,t){(function(){var e,r,n,i,a,o;"undefined"!==typeof performance&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:"undefined"!==typeof process&&null!==process&&process.hrtime?(t.exports=function(){return(e()-a)/1e6},r=process.hrtime,i=(e=function(){var e;return 1e9*(e=r())[0]+e[1]})(),o=1e9*process.uptime(),a=i-o):Date.now?(t.exports=function(){return Date.now()-n},n=Date.now()):(t.exports=function(){return(new Date).getTime()-n},n=(new Date).getTime())}).call(e)}}),bx=p({"node_modules/raf/index.js"(e,t){var r,n,i,a,o,s=xx(),l=window,c=["moz","webkit"],u="AnimationFrame",h=l["request"+u],p=l["cancel"+u]||l["cancelRequest"+u];for(r=0;!h&&r<c.length;r++)h=l[c[r]+"Request"+u],p=l[c[r]+"Cancel"+u]||l[c[r]+"CancelRequest"+u];h&&p||(n=0,i=0,a=[],o=1e3/60,h=function(e){if(0===a.length){var t=s(),r=Math.max(0,o-(t-n));n=r+t,setTimeout((function(){var e=a.slice(0);a.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(n)}catch(r){setTimeout((function(){throw r}),0)}}),Math.round(r))}return a.push({handle:++i,callback:e,cancelled:!1}),i},p=function(e){for(var t=0;t<a.length;t++)a[t].handle===e&&(a[t].cancelled=!0)}),t.exports=function(e){return h.call(l,e)},t.exports.cancel=function(){p.apply(l,arguments)},t.exports.polyfill=function(e){e||(e=l),e.requestAnimationFrame=h,e.cancelAnimationFrame=p}}}),_x=p({"node_modules/array-range/index.js"(e,t){t.exports=function(e,t){var r="number"===typeof e,n="number"===typeof t;r&&!n?(t=e,e=0):r||n||(e=0,t=0);var i=(t|=0)-(e|=0);if(i<0)throw new Error("array length must be positive");for(var a=new Array(i),o=0,s=e;o<i;o++,s++)a[o]=s;return a}}}),wx=p({"node_modules/regl-splom/index.js"(e,t){var r=my(),n=Bg(),i=Ug(),a=bx(),o=_x(),s=Ng(),l=qg();function c(e,t){if(!(this instanceof c))return new c(e,t);this.traces=[],this.passes={},this.regl=e,this.scatter=r(e),this.canvas=this.scatter.canvas}function u(e,t,r){return(null!=e.id?e.id:e)<<16|(255&t)<<8|255&r}function h(e,t,r){let n,i,a,o,s,l,c,u,h=e[t],p=e[r];return h.length>2?(n=h[0],a=h[2],i=h[1],o=h[3]):h.length?(n=i=h[0],a=o=h[1]):(n=h.x,i=h.y,a=h.x+h.width,o=h.y+h.height),p.length>2?(s=p[0],c=p[2],l=p[1],u=p[3]):p.length?(s=l=p[0],c=u=p[1]):(s=p.x,l=p.y,c=p.x+p.width,u=p.y+p.height),[s,i,c,o]}function p(e){if("number"===typeof e)return[e,e,e,e];if(2===e.length)return[e[0],e[1],e[0],e[1]];{let t=s(e);return[t.x,t.y,t.x+t.width,t.y+t.height]}}t.exports=c,c.prototype.render=function(){return arguments.length&&this.update(...arguments),this.regl.attributes.preserveDrawingBuffer?this.draw():(this.dirty?null==this.planned&&(this.planned=a((()=>{this.draw(),this.dirty=!0,this.planned=null}))):(this.draw(),this.dirty=!0,a((()=>{this.dirty=!1}))),this)},c.prototype.update=function(){if(!arguments.length)return;for(let r=0;r<arguments.length;r++)this.updateItem(r,r<0||arguments.length<=r?void 0:arguments[r]);this.traces=this.traces.filter(Boolean);let e=[],t=0;for(let r=0;r<this.traces.length;r++){let n=this.traces[r],i=this.traces[r].passes;for(let t=0;t<i.length;t++)e.push(this.passes[i[t]]);n.passOffset=t,t+=n.passes.length}return this.scatter.update(...e),this},c.prototype.updateItem=function(e,t){let{regl:r}=this;if(null===t)return this.traces[e]=null,this;if(!t)return this;let a,o=n(t,{data:"data items columns rows values dimensions samples x",snap:"snap cluster",size:"sizes size radius",color:"colors color fill fill-color fillColor",opacity:"opacity alpha transparency opaque",borderSize:"borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline",borderColor:"borderColors borderColor bordercolor stroke stroke-color strokeColor",marker:"markers marker shape",range:"range ranges databox dataBox",viewport:"viewport viewBox viewbox",domain:"domain domains area areas",padding:"pad padding paddings pads margin margins",transpose:"transpose transposed",diagonal:"diagonal diag showDiagonal",upper:"upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf",lower:"lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower"}),c=this.traces[e]||(this.traces[e]={id:e,buffer:r.buffer({usage:"dynamic",type:"float",data:new Uint8Array}),color:"black",marker:null,size:12,borderColor:"transparent",borderSize:1,viewport:s([r._gl.drawingBufferWidth,r._gl.drawingBufferHeight]),padding:[0,0,0,0],opacity:1,diagonal:!0,upper:!0,lower:!0});if(null!=o.color&&(c.color=o.color),null!=o.size&&(c.size=o.size),null!=o.marker&&(c.marker=o.marker),null!=o.borderColor&&(c.borderColor=o.borderColor),null!=o.borderSize&&(c.borderSize=o.borderSize),null!=o.opacity&&(c.opacity=o.opacity),o.viewport&&(c.viewport=s(o.viewport)),null!=o.diagonal&&(c.diagonal=o.diagonal),null!=o.upper&&(c.upper=o.upper),null!=o.lower&&(c.lower=o.lower),o.data){c.buffer(l(o.data)),c.columns=o.data.length,c.count=o.data[0].length,c.bounds=[];for(let e=0;e<c.columns;e++)c.bounds[e]=i(o.data[e],1)}o.range&&(c.range=o.range,a=c.range&&"number"!==typeof c.range[0]),o.domain&&(c.domain=o.domain);let d=!1;null!=o.padding&&(Array.isArray(o.padding)&&o.padding.length===c.columns&&"number"===typeof o.padding[o.padding.length-1]?(c.padding=o.padding.map(p),d=!0):c.padding=p(o.padding));let f=c.columns,m=c.count,g=c.viewport.width,y=c.viewport.height,v=c.viewport.x,x=c.viewport.y,b=g/f,_=y/f;c.passes=[];for(let n=0;n<f;n++)for(let e=0;e<f;e++){if(!c.diagonal&&e===n)continue;if(!c.upper&&n>e)continue;if(!c.lower&&n<e)continue;let t=u(c.id,n,e),r=this.passes[t]||(this.passes[t]={});if(o.data&&(o.transpose?r.positions={x:{buffer:c.buffer,offset:e,count:m,stride:f},y:{buffer:c.buffer,offset:n,count:m,stride:f}}:r.positions={x:{buffer:c.buffer,offset:e*m,count:m},y:{buffer:c.buffer,offset:n*m,count:m}},r.bounds=h(c.bounds,n,e)),o.domain||o.viewport||o.data){let t=d?h(c.padding,n,e):c.padding;if(c.domain){let[i,a,o,s]=h(c.domain,n,e);r.viewport=[v+i*g+t[0],x+a*y+t[1],v+o*g-t[2],x+s*y-t[3]]}else r.viewport=[v+e*b+b*t[0],x+n*_+_*t[1],v+(e+1)*b-b*t[2],x+(n+1)*_-_*t[3]]}o.color&&(r.color=c.color),o.size&&(r.size=c.size),o.marker&&(r.marker=c.marker),o.borderSize&&(r.borderSize=c.borderSize),o.borderColor&&(r.borderColor=c.borderColor),o.opacity&&(r.opacity=c.opacity),o.range&&(r.range=a?h(c.range,n,e):c.range||r.bounds),c.passes.push(t)}return this},c.prototype.draw=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length){let e=[];for(let r=0;r<t.length;r++)if("number"===typeof t[r]){let{passes:n,passOffset:i}=this.traces[t[r]];e.push(...o(i,i+n.length))}else if(t[r].length){let n=t[r],{passes:i,passOffset:a}=this.traces[r];i=i.map(((t,r)=>{e[a+r]=n}))}this.scatter.draw(...e)}else this.scatter.draw();return this},c.prototype.destroy=function(){return this.traces.forEach((e=>{e.buffer&&e.buffer.destroy&&e.buffer.destroy()})),this.traces=null,this.passes=null,this.scatter.destroy(),this}}}),kx=p({"src/traces/splom/plot.js"(e,t){var r=wx(),n=st(),i=vt(),a=Or().selectMode;function o(e,t){var o,s,l,c,u,h=e._fullLayout,p=h._size,d=t.trace,f=t.t,m=h._splomScenes[d.uid],g=m.matrixOptions,y=g.cdata,v=h._glcanvas.data()[0].regl,x=h.dragmode;if(0!==y.length){g.lower=d.showupperhalf,g.upper=d.showlowerhalf,g.diagonal=d.diagonal.visible;var b=d._visibleDims,_=y.length,w=m.viewOpts={};for(w.ranges=new Array(_),w.domains=new Array(_),u=0;u<b.length;u++){l=b[u];var k=w.ranges[u]=new Array(4),T=w.domains[u]=new Array(4);(o=i.getFromId(e,d._diag[l][0]))&&(k[0]=o._rl[0],k[2]=o._rl[1],T[0]=o.domain[0],T[2]=o.domain[1]),(s=i.getFromId(e,d._diag[l][1]))&&(k[1]=s._rl[0],k[3]=s._rl[1],T[1]=s.domain[0],T[3]=s.domain[1])}var S=e._context.plotGlPixelRatio,A=p.l*S,M=p.b*S,E=p.w*S,C=p.h*S;w.viewport=[A,M,E+A,C+M],!0===m.matrix&&(m.matrix=r(v));var P=h.clickmode.indexOf("select")>-1,L=!0;if(a(x)||d.selectedpoints||P){var I=d._length;if(d.selectedpoints){m.selectBatch=d.selectedpoints;var z=d.selectedpoints,O={};for(l=0;l<z.length;l++)O[z[l]]=!0;var R=[];for(l=0;l<I;l++)O[l]||R.push(l);m.unselectBatch=R}var D=f.xpx=new Array(_),j=f.ypx=new Array(_);for(u=0;u<b.length;u++){if(l=b[u],o=i.getFromId(e,d._diag[l][0]))for(D[u]=new Array(I),c=0;c<I;c++)D[u][c]=o.c2p(y[u][c]);if(s=i.getFromId(e,d._diag[l][1]))for(j[u]=new Array(I),c=0;c<I;c++)j[u][c]=s.c2p(y[u][c])}if(m.selectBatch.length||m.unselectBatch.length){var F=n.extendFlat({},g,m.unselectedOptions,w),B=n.extendFlat({},g,m.selectedOptions,w);m.matrix.update(F,B),L=!1}}else f.xpx=f.ypx=null;if(L){var N=n.extendFlat({},g,w);m.matrix.update(N,null)}}}t.exports=function(e,t,r){if(r.length)for(var n=0;n<r.length;n++)o(e,r[n][0])}}}),Tx=p({"src/traces/splom/helpers.js"(e){e.getDimIndex=function(e,t){for(var r=t._id,n={x:0,y:1}[r.charAt(0)],i=e._visibleDims,a=0;a<i.length;a++){var o=i[a];if(e._diag[o][n]===r)return a}return!1}}}),Sx=p({"src/traces/splom/hover.js"(e,t){var r=Tx(),n=Ig().calcHover,i=nr().getFromId,a=R().extendFlat;function o(e,t,i,a){var o=e.cd[0].trace,s=e.scene.matrixOptions.cdata,l=e.xa,c=e.ya,u=l.c2p(t),h=c.c2p(i),p=e.distance,d=r.getDimIndex(o,l),f=r.getDimIndex(o,c);if(!1===d||!1===f)return[e];for(var m,g,y=s[d],v=s[f],x=p,b=0;b<y.length;b++)if(!a||b===e.index){var _=y[b],w=v[b],k=l.c2p(_)-u,T=c.c2p(w)-h,S=Math.sqrt(k*k+T*T);(a||S<x)&&(x=g=S,m=b)}return e.index=m,e.distance=x,e.dxy=g,void 0===m?[e]:[n(e,y,v,o)]}t.exports={hoverPoints:function(e,t,r,n,s){s||(s={});var l="x"===(n||"").charAt(0),c="y"===(n||"").charAt(0),u=o(e,t,r);if((l||c)&&"axis"===s.hoversubplots&&u[0])for(var h=(l?e.xa:e.ya)._subplotsWith,p=s.gd,d=a({},e),f=0;f<h.length;f++){var m=h[f];if(m!==e.xa._id+e.ya._id){c?d.xa=i(p,m,"x"):d.ya=i(p,m,"y");var g=o(d,t,r,l||c);u=u.concat(g)}}return u}}}}),Ax=p({"src/traces/splom/select.js"(e,t){var r=st(),n=r.pushUnique,i=$t(),a=Tx();t.exports=function(e,t){var o=e.cd,s=o[0].trace,l=o[0].t,c=e.scene,u=c.matrixOptions.cdata,h=e.xaxis,p=e.yaxis,d=[];if(!c)return d;var f=!i.hasMarkers(s)&&!i.hasText(s);if(!0!==s.visible||f)return d;var m=a.getDimIndex(s,h),g=a.getDimIndex(s,p);if(!1===m||!1===g)return d;var y=l.xpx[m],v=l.ypx[g],x=u[m],b=u[g],_=(e.scene.selectBatch||[]).slice(),w=[];if(!1!==t&&!t.degenerate)for(var k=0;k<x.length;k++)t.contains([y[k],v[k]],null,k,e)?(d.push({pointNumber:k,x:x[k],y:b[k]}),n(_,k)):-1!==_.indexOf(k)?n(_,k):w.push(k);var T=c.matrixOptions;return _.length||w.length?c.selectBatch.length||c.unselectBatch.length||c.matrix.update(c.unselectedOptions,r.extendFlat({},T,c.selectedOptions,c.viewOpts)):c.matrix.update(T,null),c.selectBatch=_,c.unselectBatch=w,d}}}),Mx=p({"src/traces/splom/edit_style.js"(e,t){var r=st(),n=ri(),i=ny().markerStyle;t.exports=function(e,t){var a=t.trace,o=e._fullLayout._splomScenes[a.uid];if(o){n(e,a),r.extendFlat(o.matrixOptions,i(e,a));var s=r.extendFlat({},o.matrixOptions,o.viewOpts);o.matrix.update(s,null)}}}}),Ex=p({"src/traces/splom/base_index.js"(e,t){var r=Ve(),n=Ta();t.exports={moduleType:"trace",name:"splom",categories:["gl","regl","cartesian","symbols","showLegend","scatter-like"],attributes:fx(),supplyDefaults:gx(),colorbar:pi(),calc:vx(),plot:kx(),hoverPoints:Sx().hoverPoints,selectPoints:Ax(),editStyle:Mx(),meta:{}},r.register(n)}}),Cx=p({"src/traces/splom/base_plot.js"(e,t){var r=jv(),n=Ve(),i=ux(),a=_t().getModuleCalcData,o=Ai(),s=vt().getFromId,l=nr().shouldShowZeroLine,c="splom",u={};function h(e,t,r){for(var n=r.matrixOptions.data.length,i=t._visibleDims,a=r.viewOpts.ranges=new Array(n),o=0;o<i.length;o++){var l=i[o],c=a[o]=new Array(4),u=s(e,t._diag[l][0]);u&&(c[0]=u.r2l(u.range[0]),c[2]=u.r2l(u.range[1]));var h=s(e,t._diag[l][1]);h&&(c[1]=h.r2l(h.range[0]),c[3]=h.r2l(h.range[1]))}r.selectBatch.length||r.unselectBatch.length?r.matrix.update({ranges:a},{ranges:a}):r.matrix.update({ranges:a})}function p(e){var t=e._fullLayout,n=t._glcanvas.data()[0].regl,i=t._splomGrid;i||(i=t._splomGrid=r(n)),i.update(function(e){var t,r=e._context.plotGlPixelRatio,n=e._fullLayout,i=n._size,a=[0,0,n.width*r,n.height*r],o={};function s(e,t,n,i,s,l){n*=r,i*=r,s*=r,l*=r;var c=t[e+"color"],u=t[e+"width"],h=String(c+u);h in o?o[h].data.push(NaN,NaN,n,i,s,l):o[h]={data:[n,i,s,l],join:"rect",thickness:u*r,color:c,viewport:a,range:a,overlay:!1}}for(t in n._splomSubplots){var c,u,h=n._plots[t],p=h.xaxis,d=h.yaxis,f=p._gridVals,m=d._gridVals,g=p._offset,y=p._length,v=d._length,x=i.b+d.domain[0]*i.h,b=-d._m,_=-b*d.r2l(d.range[0],d.calendar);if(p.showgrid)for(t=0;t<f.length;t++)c=g+p.l2p(f[t].x),s("grid",p,c,x,c,x+v);if(d.showgrid)for(t=0;t<m.length;t++)s("grid",d,g,u=x+_+b*m[t].x,g+y,u);l(e,p,d)&&(c=g+p.l2p(0),s("zeroline",p,c,x,c,x+v)),l(e,d,p)&&s("zeroline",d,g,u=x+_+0,g+y,u)}var w=[];for(t in o)w.push(o[t]);return w}(e))}t.exports={name:c,attr:o.attr,attrRegex:o.attrRegex,layoutAttributes:o.layoutAttributes,supplyLayoutDefaults:o.supplyLayoutDefaults,drawFramework:o.drawFramework,plot:function(e){var t=e._fullLayout,r=n.getModule(c),o=a(e.calcdata,r)[0];i(e,["ANGLE_instanced_arrays","OES_element_index_uint"],u)&&(t._hasOnlyLargeSploms&&p(e),r.plot(e,{},o))},drag:function(e){var t=e.calcdata,r=e._fullLayout;r._hasOnlyLargeSploms&&p(e);for(var n=0;n<t.length;n++){var i=t[n][0].trace,a=r._splomScenes[i.uid];"splom"===i.type&&a&&a.matrix&&h(e,i,a)}},updateGrid:p,clean:function(e,t,r,n){var i,a={};if(n._splomScenes){for(i=0;i<e.length;i++){var s=e[i];"splom"===s.type&&(a[s.uid]=1)}for(i=0;i<r.length;i++){var l=r[i];if(!a[l.uid]){var c=n._splomScenes[l.uid];c&&c.destroy&&c.destroy(),n._splomScenes[l.uid]=null,delete n._splomScenes[l.uid]}}}0===Object.keys(n._splomScenes||{}).length&&delete n._splomScenes,n._splomGrid&&!t._hasOnlyLargeSploms&&n._hasOnlyLargeSploms&&(n._splomGrid.destroy(),n._splomGrid=null,delete n._splomGrid),o.clean(e,t,r,n)},updateFx:o.updateFx,toSVG:o.toSVG,reglPrecompiled:u}}}),Px=p({"src/traces/splom/index.js"(e,t){var r=Ex();r.basePlotModule=Cx(),t.exports=r}}),Lx=p({"lib/splom.js"(e,t){t.exports=Px()}}),Ix=p({"src/traces/parcoords/attributes.js"(e,t){var r=Lt(),n=Ct(),i=D(),a=ka().attributes,o=R().extendFlat,s=gt().templatedArray;t.exports={domain:a({name:"parcoords",trace:!0,editType:"plot"}),labelangle:{valType:"angle",dflt:0,editType:"plot"},labelside:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},labelfont:i({editType:"plot"}),tickfont:i({autoShadowDflt:!0,editType:"plot"}),rangefont:i({editType:"plot"}),dimensions:s("dimension",{label:{valType:"string",editType:"plot"},tickvals:o({},n.tickvals,{editType:"plot"}),ticktext:o({},n.ticktext,{editType:"plot"}),tickformat:o({},n.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:o({editType:"calc"},r("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"}}}}),zx=p({"src/traces/parcoords/constants.js"(e,t){t.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,captureWidth:10,fillColor:"magenta",fillOpacity:1,snapDuration:150,snapRatio:.25,snapClose:.01,strokeOpacity:1,strokeWidth:1,handleHeight:8,handleOpacity:1,handleOverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}}}),Ox=p({"src/lib/gup.js"(e,t){var r=He();function n(e){return[e]}t.exports={keyFun:function(e){return e.key},repeat:n,descend:r,wrap:n,unwrap:function(e){return e[0]}}}}),Rx=p({"src/traces/parcoords/axisbrush.js"(e,t){var r=zx(),n=v(),i=Ox().keyFun,a=Ox().repeat,o=st().sorterAsc,s=st().strTranslate,l=r.bar.snapRatio;function c(e,t){return e*(1-l)+t*l}var u=r.bar.snapClose;function h(e,t){return e*(1-u)+t*u}function p(e,t,r,n){if(function(e,t){for(var r=0;r<t.length;r++)if(e>=t[r][0]&&e<=t[r][1])return!0;return!1}(r,n))return r;var i=e?-1:1,a=0,o=t.length-1;if(i<0){var s=a;a=o,o=s}for(var l=t[a],u=l,p=a;i*p<i*o;p+=i){var d=p+i,f=t[d];if(i*r<i*h(l,f))return c(l,u);if(i*r<i*f||d===o)return c(f,l);u=l,l=f}}function d(e){e.attr("x",-r.bar.captureWidth/2).attr("width",r.bar.captureWidth)}function f(e){e.attr("visibility","visible").style("visibility","visible").attr("fill","yellow").attr("opacity",0)}function m(e){if(!e.brush.filterSpecified)return"0,"+e.height;for(var t,r,n,i=g(e.brush.filter.getConsolidated(),e.height),a=[0],o=i.length?i[0][0]:null,s=0;s<i.length;s++)r=(t=i[s])[1]-t[0],a.push(o),a.push(r),(n=s+1)<i.length&&(o=i[n][0]-t[1]);return a.push(e.height),a}function g(e,t){return e.map((function(e){return e.map((function(e){return Math.max(0,e*t)})).sort(o)}))}function y(){n.select(document.body).style("cursor",null)}function x(e){e.attr("stroke-dasharray",m)}function b(e,t){var i=n.select(e).selectAll(".highlight, .highlight-shadow");x(t?i.transition().duration(r.bar.snapDuration).each("end",t):i)}function _(e,t){var n,i=e.brush,a=NaN,o={};if(i.filterSpecified){var s=e.height,l=i.filter.getConsolidated(),c=g(l,s),u=NaN,h=NaN,p=NaN;for(n=0;n<=c.length;n++){var d=c[n];if(d&&d[0]<=t&&t<=d[1]){u=n;break}if(h=n?n-1:NaN,d&&d[0]>t){p=n;break}}if(a=u,isNaN(a)&&(a=isNaN(h)||isNaN(p)?isNaN(h)?p:h:t-c[h][1]<c[p][0]-t?h:p),!isNaN(a)){var f=c[a],m=function(e,t){var n=r.bar.handleHeight;if(!(t>e[1]+n||t<e[0]-n))return t>=.9*e[1]+.1*e[0]?"n":t<=.9*e[0]+.1*e[1]?"s":"ns"}(f,t);m&&(o.interval=l[a],o.intervalPix=f,o.region=m)}}if(e.ordinal&&!o.region){var y=e.unitTickvals,v=e.unitToPaddedPx.invert(t);for(n=0;n<y.length;n++){var x=[.25*y[Math.max(n-1,0)]+.75*y[n],.25*y[Math.min(n+1,y.length-1)]+.75*y[n]];if(v>=x[0]&&v<=x[1]){o.clickableOrdinalRange=x;break}}}return o}function w(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.verticalPadding,a=t.brush.svgBrush;a.wasDragged=!0,a._dragging=!0,a.grabbingBar?a.newExtent=[i-a.grabPoint,i+a.barLength-a.grabPoint].map(t.unitToPaddedPx.invert):a.newExtent=[a.startExtent,t.unitToPaddedPx.invert(i)].sort(o),t.brush.filterSpecified=!0,a.extent=a.stayingIntervals.concat([a.newExtent]),a.brushCallback(t),b(e.parentNode)}function k(e,t){var i=_(t,t.height-n.mouse(e)[1]-2*r.verticalPadding),a="crosshair";i.clickableOrdinalRange?a="pointer":i.region&&(a=i.region+"-resize"),n.select(document.body).style("cursor",a)}function T(e){e.on("mousemove",(function(e){n.event.preventDefault(),e.parent.inBrushDrag||k(this,e)})).on("mouseleave",(function(e){e.parent.inBrushDrag||y()})).call(n.behavior.drag().on("dragstart",(function(e){!function(e,t){n.event.sourceEvent.stopPropagation();var i=t.height-n.mouse(e)[1]-2*r.verticalPadding,a=t.unitToPaddedPx.invert(i),o=t.brush,s=_(t,i),l=s.interval,c=o.svgBrush;if(c.wasDragged=!1,c.grabbingBar="ns"===s.region,c.grabbingBar){var u=l.map(t.unitToPaddedPx);c.grabPoint=i-u[0]-r.verticalPadding,c.barLength=u[1]-u[0]}c.clickableOrdinalRange=s.clickableOrdinalRange,c.stayingIntervals=t.multiselect&&o.filterSpecified?o.filter.getConsolidated():[],l&&(c.stayingIntervals=c.stayingIntervals.filter((function(e){return e[0]!==l[0]&&e[1]!==l[1]}))),c.startExtent=s.region?l["s"===s.region?1:0]:a,t.parent.inBrushDrag=!0,c.brushStartCallback()}(this,e)})).on("drag",(function(e){w(this,e)})).on("dragend",(function(e){!function(e,t){var r=t.brush,i=r.filter,a=r.svgBrush;a._dragging||(k(e,t),w(e,t),t.brush.svgBrush.wasDragged=!1),a._dragging=!1,n.event.sourceEvent.stopPropagation();var o=a.grabbingBar;if(a.grabbingBar=!1,a.grabLocation=void 0,t.parent.inBrushDrag=!1,y(),!a.wasDragged)return a.wasDragged=void 0,a.clickableOrdinalRange?r.filterSpecified&&t.multiselect?a.extent.push(a.clickableOrdinalRange):(a.extent=[a.clickableOrdinalRange],r.filterSpecified=!0):o?(a.extent=a.stayingIntervals,0===a.extent.length&&A(r)):A(r),a.brushCallback(t),b(e.parentNode),void a.brushEndCallback(r.filterSpecified?i.getConsolidated():[]);var s=function(){i.set(i.getConsolidated())};if(t.ordinal){var l=t.unitTickvals;l[l.length-1]<l[0]&&l.reverse(),a.newExtent=[p(0,l,a.newExtent[0],a.stayingIntervals),p(1,l,a.newExtent[1],a.stayingIntervals)];var c=a.newExtent[1]>a.newExtent[0];a.extent=a.stayingIntervals.concat(c?[a.newExtent]:[]),a.extent.length||A(r),a.brushCallback(t),c?b(e.parentNode,s):(s(),b(e.parentNode))}else s();a.brushEndCallback(r.filterSpecified?i.getConsolidated():[])}(this,e)})))}function S(e,t){return e[0]-t[0]}function A(e){e.filterSpecified=!1,e.svgBrush.extent=[[-1/0,1/0]]}function M(e){for(var t,r=e.slice(),n=[],i=r.shift();i;){for(t=i.slice();(i=r.shift())&&i[0]<=t[1];)t[1]=Math.max(t[1],i[1]);n.push(t)}return 1===n.length&&n[0][0]>n[0][1]&&(n=[]),n}t.exports={makeBrush:function(e,t,r,n,i,a){var s,l=function(){var e,t,r=[];return{set:function(n){1===(r=n.map((function(e){return e.slice().sort(o)})).sort(S)).length&&r[0][0]===-1/0&&r[0][1]===1/0&&(r=[[0,-1]]),e=M(r),t=r.reduce((function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}),[1/0,-1/0])},get:function(){return r.slice()},getConsolidated:function(){return e},getBounds:function(){return t}}}();return l.set(r),{filter:l,filterSpecified:t,svgBrush:{extent:[],brushStartCallback:n,brushCallback:(s=i,function(e){var t=e.brush,r=function(e){return e.svgBrush.extent.map((function(e){return e.slice()}))}(t),n=r.slice();t.filter.set(n),s()}),brushEndCallback:a}}},ensureAxisBrush:function(e,t,n){var o=e.selectAll("."+r.cn.axisBrush).data(a,i);o.enter().append("g").classed(r.cn.axisBrush,!0),function(e,t,n){var i=n._context.staticPlot,o=e.selectAll(".background").data(a);o.enter().append("rect").classed("background",!0).call(d).call(f).style("pointer-events",i?"none":"auto").attr("transform",s(0,r.verticalPadding)),o.call(T).attr("height",(function(e){return e.height-r.verticalPadding}));var l=e.selectAll(".highlight-shadow").data(a);l.enter().append("line").classed("highlight-shadow",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width+r.bar.strokeWidth).attr("stroke",t).attr("opacity",r.bar.strokeOpacity).attr("stroke-linecap","butt"),l.attr("y1",(function(e){return e.height})).call(x);var c=e.selectAll(".highlight").data(a);c.enter().append("line").classed("highlight",!0).attr("x",-r.bar.width/2).attr("stroke-width",r.bar.width-r.bar.strokeWidth).attr("stroke",r.bar.fillColor).attr("opacity",r.bar.fillOpacity).attr("stroke-linecap","butt"),c.attr("y1",(function(e){return e.height})).call(x)}(o,t,n)},cleanRanges:function(e,t){if(Array.isArray(e[0])?(e=e.map((function(e){return e.sort(o)})),e=t.multiselect?M(e.sort(S)):[e[0]]):e=[e.sort(o)],t.tickvals){var r=t.tickvals.slice().sort(o);if(!(e=e.map((function(e){var t=[p(0,r,e[0],[]),p(1,r,e[1],[])];if(t[1]>t[0])return t})).filter((function(e){return e}))).length)return}return e.length>1?e:e[0]}}}}),Dx=p({"src/traces/parcoords/defaults.js"(e,t){var r=st(),n=Mt().hasColorscale,i=Vt(),a=ka().defaults,o=Ft(),s=nr(),l=Ix(),c=Rx(),u=zx().maxDimensionCount,h=mx();function p(e,t,n,i){function a(n,i){return r.coerce(e,t,l.dimensions,n,i)}var o=a("values"),u=a("visible");if(o&&o.length||(u=t.visible=!1),u){a("label"),a("tickvals"),a("ticktext"),a("tickformat");var h=a("range");t._ax={_id:"y",type:"linear",showexponent:"all",exponentformat:"B",range:h},s.setConvert(t._ax,i.layout),a("multiselect");var p=a("constraintrange");p&&(t.constraintrange=c.cleanRanges(p,t))}}t.exports=function(e,t,s,c){function d(n,i){return r.coerce(e,t,l,n,i)}var f=e.dimensions;Array.isArray(f)&&f.length>u&&(r.log("parcoords traces support up to "+u+" dimensions at the moment"),f.splice(u));var m=o(e,t,{name:"dimensions",layout:c,handleItemDefaults:p}),g=function(e,t,a,o,s){var l=s("line.color",a);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,s,c,d);a(t,c,d),Array.isArray(m)&&m.length||(t.visible=!1),h(t,m,"values",g);var y=r.extendFlat({},c.font,{size:Math.round(c.font.size/1.2)});r.coerceFont(d,"labelfont",y),r.coerceFont(d,"tickfont",y,{autoShadowDflt:!0}),r.coerceFont(d,"rangefont",y),d("labelangle"),d("labelside"),d("unselected.line.color"),d("unselected.line.opacity")}}}),jx=p({"src/traces/parcoords/calc.js"(e,t){var r=st().isArrayOrTypedArray,n=Wt(),i=Ox().wrap;t.exports=function(e,t){var a,o;return n.hasColorscale(t,"line")&&r(t.line.color)?(a=t.line.color,o=n.extractOpts(t.line).colorscale,n.calc(e,t,{vals:a,containerStr:"line",cLetter:"c"})):(a=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=.5;return t}(t._length),o=[[0,t.line.color],[1,t.line.color]]),i({lineColor:a,cscale:o})}}});function Fx(e){var t,r,n,i,a=[],o=1;if("number"===typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if("number"===typeof e)return{space:"rgb",values:[e>>>16,(65280&e)>>>8,255&e],alpha:1};if(e=String(e).toLowerCase(),Dd.default[e])a=Dd.default[e].slice(),i="rgb";else if("transparent"===e)o=0,i="rgb",a=[0,0,0];else if("#"===e[0]){var s=e.slice(1),l=s.length;o=1,l<=4?(a=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===l&&(o=parseInt(s[3]+s[3],16)/255)):(a=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===l&&(o=parseInt(s[6]+s[7],16)/255)),a[0]||(a[0]=0),a[1]||(a[1]=0),a[2]||(a[2]=0),i="rgb"}else if(n=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(e)){var c=n[1],u="cmyk"===(i=c.replace(/a$/,""))?4:"gray"===i?1:3;a=n[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=a.shift()),o=(a=a.map((function(e,t){if("%"===e[e.length-1])return e=parseFloat(e)/100,3===t?e:"rgb"===i?255*e:"h"===i[0]?100*e:"l"!==i[0]||t?"lab"===i?125*e:"lch"===i?t<2?150*e:360*e:"o"!==i[0]||t?"oklab"===i?.4*e:"oklch"===i?t<2?.4*e:360*e:e:e:100*e;if("h"===i[t]||2===t&&"h"===i[i.length-1]){if(void 0!==Fd[e])return Fd[e];if(e.endsWith("deg"))return parseFloat(e);if(e.endsWith("turn"))return 360*parseFloat(e);if(e.endsWith("grad"))return 360*parseFloat(e)/400;if(e.endsWith("rad"))return 180*parseFloat(e)/Math.PI}return"none"===e?0:parseFloat(e)}))).length>u?a.pop():1}else/[0-9](?:\s|\/|,)/.test(e)&&(a=e.match(/([0-9]+)/g).map((function(e){return parseFloat(e)})),i=(null==(r=null==(t=e.match(/([a-z])/gi))?void 0:t.join(""))?void 0:r.toLowerCase())||"rgb");return{space:i,values:a,alpha:o}}var Bx,Nx,Ux=h({"node_modules/color-parse/index.js"(){var r,n,i;r=Of(),n=1,i=null!=r?e(s(r)):{},Dd=f(!n&&r&&r.__esModule?i:t(i,"default",{value:r,enumerable:!0}),r),jd=Fx,Fd={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}}),Vx=h({"node_modules/color-space/rgb.js"(){Bx={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}}}),qx=h({"node_modules/color-space/hsl.js"(){Vx(),Nx={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(e){var t,r,n,i,a,o=e[0]/360,s=e[1]/100,l=e[2]/100,c=0;if(0===s)return[a=255*l,a,a];for(t=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];c<3;)(n=o+1/3*-(c-1))<0?n++:n>1&&n--,a=6*n<1?t+6*(r-t)*n:2*n<1?r:3*n<2?t+(r-t)*(2/3-n)*6:t,i[c++]=255*a;return i}},Bx.hsl=function(e){var t,r,n=e[0]/255,i=e[1]/255,a=e[2]/255,o=Math.min(n,i,a),s=Math.max(n,i,a),l=s-o;return s===o?t=0:n===s?t=(i-a)/l:i===s?t=2+(a-n)/l:a===s&&(t=4+(n-i)/l),(t=Math.min(60*t,360))<0&&(t+=360),r=(o+s)/2,[t,100*(s===o?0:r<=.5?l/(s+o):l/(2-s-o)),100*r]}}}),Hx={};function Gx(e){var t;Array.isArray(e)&&e.raw&&(e=String.raw(...arguments)),e instanceof Number&&(e=+e);var r=jd(e);if(!r.space)return[];const n="h"===r.space[0]?Nx.min:Bx.min,i="h"===r.space[0]?Nx.max:Bx.max;return(t=Array(3))[0]=Math.min(Math.max(r.values[0],n[0]),i[0]),t[1]=Math.min(Math.max(r.values[1],n[1]),i[1]),t[2]=Math.min(Math.max(r.values[2],n[2]),i[2]),"h"===r.space[0]&&(t=Nx.rgb(t)),t.push(Math.min(Math.max(r.alpha,0),1)),t}d(Hx,{default:()=>Gx});var Wx=h({"node_modules/color-rgba/index.js"(){Ux(),Vx(),qx()}}),$x=p({"src/traces/parcoords/helpers.js"(e){var t=st().isTypedArray;e.convertTypedArray=function(e){return t(e)?Array.prototype.slice.call(e):e},e.isOrdinal=function(e){return!!e.tickvals},e.isVisible=function(e){return e.visible||!("visible"in e)}}}),Zx=p({"src/traces/parcoords/lines.js"(e,t){var r=["precision highp float;","","varying vec4 fragColor;","","attribute vec4 p01_04, p05_08, p09_12, p13_16,"," p17_20, p21_24, p25_28, p29_32,"," p33_36, p37_40, p41_44, p45_48,"," p49_52, p53_56, p57_60, colors;","","uniform mat4 dim0A, dim1A, dim0B, dim1B, dim0C, dim1C, dim0D, dim1D,"," loA, hiA, loB, hiB, loC, hiC, loD, hiD;","","uniform vec2 resolution, viewBoxPos, viewBoxSize;","uniform float maskHeight;","uniform float drwLayer; // 0: context, 1: focus, 2: pick","uniform vec4 contextColor;","uniform sampler2D maskTexture, palette;","","bool isPick = (drwLayer > 1.5);","bool isContext = (drwLayer < 0.5);","","const vec4 ZEROS = vec4(0.0, 0.0, 0.0, 0.0);","const vec4 UNITS = vec4(1.0, 1.0, 1.0, 1.0);","","float val(mat4 p, mat4 v) {"," return dot(matrixCompMult(p, v) * UNITS, UNITS);","}","","float axisY(float ratio, mat4 A, mat4 B, mat4 C, mat4 D) {"," float y1 = val(A, dim0A) + val(B, dim0B) + val(C, dim0C) + val(D, dim0D);"," float y2 = val(A, dim1A) + val(B, dim1B) + val(C, dim1C) + val(D, dim1D);"," return y1 * (1.0 - ratio) + y2 * ratio;","}","","int iMod(int a, int b) {"," return a - b * (a / b);","}","","bool fOutside(float p, float lo, float hi) {"," return (lo < hi) && (lo > p || p > hi);","}","","bool vOutside(vec4 p, vec4 lo, vec4 hi) {"," return ("," fOutside(p[0], lo[0], hi[0]) ||"," fOutside(p[1], lo[1], hi[1]) ||"," fOutside(p[2], lo[2], hi[2]) ||"," fOutside(p[3], lo[3], hi[3])"," );","}","","bool mOutside(mat4 p, mat4 lo, mat4 hi) {"," return ("," vOutside(p[0], lo[0], hi[0]) ||"," vOutside(p[1], lo[1], hi[1]) ||"," vOutside(p[2], lo[2], hi[2]) ||"," vOutside(p[3], lo[3], hi[3])"," );","}","","bool outsideBoundingBox(mat4 A, mat4 B, mat4 C, mat4 D) {"," return mOutside(A, loA, hiA) ||"," mOutside(B, loB, hiB) ||"," mOutside(C, loC, hiC) ||"," mOutside(D, loD, hiD);","}","","bool outsideRasterMask(mat4 A, mat4 B, mat4 C, mat4 D) {"," mat4 pnts[4];"," pnts[0] = A;"," pnts[1] = B;"," pnts[2] = C;"," pnts[3] = D;",""," for(int i = 0; i < 4; ++i) {"," for(int j = 0; j < 4; ++j) {"," for(int k = 0; k < 4; ++k) {"," if(0 == iMod("," int(255.0 * texture2D(maskTexture,"," vec2("," (float(i * 2 + j / 2) + 0.5) / 8.0,"," (pnts[i][j][k] * (maskHeight - 1.0) + 1.0) / maskHeight"," ))[3]"," ) / int(pow(2.0, float(iMod(j * 4 + k, 8)))),"," 2"," )) return true;"," }"," }"," }"," return false;","}","","vec4 position(bool isContext, float v, mat4 A, mat4 B, mat4 C, mat4 D) {"," float x = 0.5 * sign(v) + 0.5;"," float y = axisY(x, A, B, C, D);"," float z = 1.0 - abs(v);",""," z += isContext ? 0.0 : 2.0 * float("," outsideBoundingBox(A, B, C, D) ||"," outsideRasterMask(A, B, C, D)"," );",""," return vec4("," 2.0 * (vec2(x, y) * viewBoxSize + viewBoxPos) / resolution - 1.0,"," z,"," 1.0"," );","}","","void main() {"," mat4 A = mat4(p01_04, p05_08, p09_12, p13_16);"," mat4 B = mat4(p17_20, p21_24, p25_28, p29_32);"," mat4 C = mat4(p33_36, p37_40, p41_44, p45_48);"," mat4 D = mat4(p49_52, p53_56, p57_60, ZEROS);",""," float v = colors[3];",""," gl_Position = position(isContext, v, A, B, C, D);",""," fragColor ="," isContext ? vec4(contextColor) :"," isPick ? vec4(colors.rgb, 1.0) : texture2D(palette, vec2(abs(v), 0.5));","}"].join("\n"),n=["precision highp float;","","varying vec4 fragColor;","","void main() {"," gl_FragColor = fragColor;","}"].join("\n"),i=zx().maxDimensionCount,a=st(),o=1e-6,s=2048,l=new Uint8Array(4),c=new Uint8Array(4),u={shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest"};function h(e,t,r,n,i){var a=e._gl;a.enable(a.SCISSOR_TEST),a.scissor(t,r,n,i),e.clear({color:[0,0,0,0],depth:1})}function p(e,t,r,n,i,a){var o=a.key;r.drawCompleted||(function(e){e.read({x:0,y:0,width:1,height:1,data:l})}(e),r.drawCompleted=!0),function s(l){var c=Math.min(n,i-l*n);0===l&&(window.cancelAnimationFrame(r.currentRafs[o]),delete r.currentRafs[o],h(e,a.scissorX,a.scissorY,a.scissorWidth,a.viewBoxSize[1])),r.clearOnly||(a.count=2*c,a.offset=2*l*n,t(a),l*n+c<i&&(r.currentRafs[o]=window.requestAnimationFrame((function(){s(l+1)}))),r.drawCompleted=!1)}(0)}function d(e,t){for(var r=new Array(256),n=0;n<256;n++)r[n]=e(n/255).concat(t);return r}function f(e,t){return(e>>>8*t)%256/255}function m(e,t,r){for(var n=new Array(8*t),i=0,a=0;a<t;a++)for(var o=0;o<2;o++)for(var s=0;s<4;s++){var l=4*e+s,c=r[64*a+l];63===l&&0===o&&(c*=-1),n[i++]=c}return n}function g(e){var t="0"+e;return t.substr(t.length-2)}function y(e){return e<i?"p"+g(e+1)+"_"+g(e+4):"colors"}function v(e,t,r,n,i,o,s,l,c,u,h,p,d,f){for(var m=[[],[]],g=0;g<64;g++)m[0][g]=g===i?1:0,m[1][g]=g===o?1:0;s*=f,l*=f,c*=f,u*=f;var y=e.lines.canvasOverdrag*f,v=e.domain,x=e.canvasWidth*f,b=e.canvasHeight*f,_=e.pad.l*f,w=e.pad.b*f,k=e.layoutHeight*f,T=e.layoutWidth*f,S=e.deselectedLines.color,A=e.deselectedLines.opacity;return a.extendFlat({key:h,resolution:[x,b],viewBoxPos:[s+y,l],viewBoxSize:[c,u],i0:i,i1:o,dim0A:m[0].slice(0,16),dim0B:m[0].slice(16,32),dim0C:m[0].slice(32,48),dim0D:m[0].slice(48,64),dim1A:m[1].slice(0,16),dim1B:m[1].slice(16,32),dim1C:m[1].slice(32,48),dim1D:m[1].slice(48,64),drwLayer:p,contextColor:[S[0]/255,S[1]/255,S[2]/255,"auto"!==A?S[3]*A:Math.max(1/255,Math.pow(1/e.lines.color.length,1/3))],scissorX:(n===t?0:s+y)+(_-y)+T*v.x[0],scissorWidth:(n===r?x-s+y:c+.5)+(n===t?s+y:0),scissorY:l+w+k*v.y[0],scissorHeight:u,viewportX:_-y+T*v.x[0],viewportY:w+k*v.y[0],viewportWidth:x,viewportHeight:b},d)}function x(e){var t=2047,r=Math.max(0,Math.floor(e[0]*t),0),n=Math.min(t,Math.ceil(e[1]*t),t);return[Math.min(r,n),Math.max(r,n)]}t.exports=function(e,t){var l,g,b,_,w,k=t.context,T=t.pick,S=t.regl,A=S._gl,M=A.getParameter(A.ALIASED_LINE_WIDTH_RANGE),E=Math.max(M[0],Math.min(M[1],t.viewModel.plotGlPixelRatio)),C={currentRafs:{},drawCompleted:!0,clearOnly:!1},P=function(e){for(var t={},r=0;r<=i;r+=4)t[y(r)]=e.buffer({usage:"dynamic",type:"float",data:new Uint8Array(0)});return t}(S),L=S.texture(u),I=[];O(t);var z=S({profile:!1,blend:{enable:k,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!k,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:S.prop("scissorX"),y:S.prop("scissorY"),width:S.prop("scissorWidth"),height:S.prop("scissorHeight")}},viewport:{x:S.prop("viewportX"),y:S.prop("viewportY"),width:S.prop("viewportWidth"),height:S.prop("viewportHeight")},dither:!1,vert:r,frag:n,primitive:"lines",lineWidth:E,attributes:P,uniforms:{resolution:S.prop("resolution"),viewBoxPos:S.prop("viewBoxPos"),viewBoxSize:S.prop("viewBoxSize"),dim0A:S.prop("dim0A"),dim1A:S.prop("dim1A"),dim0B:S.prop("dim0B"),dim1B:S.prop("dim1B"),dim0C:S.prop("dim0C"),dim1C:S.prop("dim1C"),dim0D:S.prop("dim0D"),dim1D:S.prop("dim1D"),loA:S.prop("loA"),hiA:S.prop("hiA"),loB:S.prop("loB"),hiB:S.prop("hiB"),loC:S.prop("loC"),hiC:S.prop("hiC"),loD:S.prop("loD"),hiD:S.prop("hiD"),palette:L,contextColor:S.prop("contextColor"),maskTexture:S.prop("maskTexture"),drwLayer:S.prop("drwLayer"),maskHeight:S.prop("maskHeight")},offset:S.prop("offset"),count:S.prop("count")});function O(e){l=e.model,g=e.viewModel,b=g.dimensions.slice(),_=b[0]?b[0].values.length:0;var t=l.lines,r=T?t.color.map((function(e,r){return r/t.color.length})):t.color,n=function(e,t,r){for(var n,a=new Array(e*(i+4)),s=0,l=0;l<e;l++){for(var c=0;c<i;c++)a[s++]=c<t.length?t[c].paddedUnitValues[l]:.5;a[s++]=f(l,2),a[s++]=f(l,1),a[s++]=f(l,0),a[s++]=(n=r[l],Math.max(o,Math.min(.999999,n)))}return a}(_,b,r);!function(e,t,r){for(var n=0;n<=i;n+=4)e[y(n)](m(n/4,t,r))}(P,_,n),k||T||(L=S.texture(a.extendFlat({data:d(l.unitToColor,255)},u)))}return{render:function(e,t,r){var n,i,a,o=e.length,c=1/0,u=-1/0;for(n=0;n<o;n++)e[n].dim0.canvasX<c&&(c=e[n].dim0.canvasX,i=n),e[n].dim1.canvasX>u&&(u=e[n].dim1.canvasX,a=n);0===o&&h(S,0,0,l.canvasWidth,l.canvasHeight);var d=function(e){var t,r,n,i=[[],[]];for(n=0;n<64;n++){var a=!e&&n<b.length?b[n].brush.filter.getBounds():[-1/0,1/0];i[0][n]=a[0],i[1][n]=a[1]}var o=new Array(16384);for(t=0;t<16384;t++)o[t]=255;if(!e)for(t=0;t<b.length;t++){var l=t%8,c=(t-l)/8,u=Math.pow(2,l),h=b[t].brush.filter.get();if(!(h.length<2)){var p=x(h[0])[1];for(r=1;r<h.length;r++){var d=x(h[r]);for(n=p+1;n<d[0];n++)o[8*n+c]&=~u;p=Math.max(p,d[1])}}}var f={shape:[8,s],format:"alpha",type:"uint8",mag:"nearest",min:"nearest",data:o};return w?w(f):w=S.texture(f),{maskTexture:w,maskHeight:s,loA:i[0].slice(0,16),loB:i[0].slice(16,32),loC:i[0].slice(32,48),loD:i[0].slice(48,64),hiA:i[1].slice(0,16),hiB:i[1].slice(16,32),hiC:i[1].slice(32,48),hiD:i[1].slice(48,64)}}(k);for(n=0;n<o;n++){var f=e[n],m=f.dim0.crossfilterDimensionIndex,g=f.dim1.crossfilterDimensionIndex,y=f.canvasX,A=f.canvasY,M=y+f.panelSizeX,E=f.plotGlPixelRatio;if(t||!I[m]||I[m][0]!==y||I[m][1]!==M){I[m]=[y,M];var P=v(l,i,a,n,m,g,y,A,f.panelSizeX,f.panelSizeY,f.dim0.crossfilterDimensionIndex,k?0:T?2:1,d,E);C.clearOnly=r;var L=t?l.lines.blockLineCount:_;p(S,z,C,L,_,P)}}},readPixel:function(e,t){return S.read({x:e,y:t,width:1,height:1,data:c}),c},readPixels:function(e,t,r,n){var i=new Uint8Array(4*r*n);return S.read({x:e,y:t,width:r,height:n,data:i}),i},destroy:function(){for(var t in e.style["pointer-events"]="none",L.destroy(),w&&w.destroy(),P)P[t].destroy()},update:O}}}}),Xx=p({"src/traces/parcoords/parcoords.js"(e,t){var r=v(),n=st(),i=n.isArrayOrTypedArray,a=n.numberFormat,o=(Wx(),m(Hx)).default,s=nr(),l=n.strRotate,c=n.strTranslate,u=At(),h=Jt(),p=Wt(),d=Ox(),f=d.keyFun,g=d.repeat,y=d.unwrap,x=$x(),b=zx(),_=Rx(),w=Zx();function k(e,t,r){return n.aggNums(e,null,t,r)}function T(e,t){return A(k(Math.min,e,t),k(Math.max,e,t))}function S(e){var t=e.range;return t?A(t[0],t[1]):T(e.values,e._length)}function A(e,t){return!isNaN(e)&&isFinite(e)||(e=0),!isNaN(t)&&isFinite(t)||(t=0),e===t&&(0===e?(e-=1,t+=1):(e*=.9,t*=1.1)),[e,t]}function M(e,t,n,i,o){var s,l,c=S(n);return i?r.scale.ordinal().domain(i.map((s=a(n.tickformat),l=o,l?function(e,t){var r=l[t];return null===r||void 0===r?s(e):r}:s))).range(i.map((function(r){var n=(r-c[0])/(c[1]-c[0]);return e-t+n*(2*t-e)}))):r.scale.linear().domain(c).range([e-t,t])}function E(e){if(e.tickvals){var t=S(e);return r.scale.ordinal().domain(e.tickvals).range(e.tickvals.map((function(e){return(e-t[0])/(t[1]-t[0])})))}}function C(e){var t=e.map((function(e){return e[0]})),n=e.map((function(e){var t=o(e[1]);return r.rgb("rgb("+t[0]+","+t[1]+","+t[2]+")")})),i="rgb".split("").map((function(e){return r.scale.linear().clamp(!0).domain(t).range(n.map((i=e,function(e){return e[i]})));var i}));return function(e){return i.map((function(t){return t(e)}))}}function P(e){return e.dimensions.some((function(e){return e.brush.filterSpecified}))}function L(e,t,i){var a=y(t),s=a.trace,l=x.convertTypedArray(a.lineColor),c=s.line,u={color:o(s.unselected.line.color),opacity:s.unselected.line.opacity},h=p.extractOpts(c),d=h.reversescale?p.flipScale(a.cscale):a.cscale,f=s.domain,m=s.dimensions,g=e.width,v=s.labelangle,_=s.labelside,w=s.labelfont,k=s.tickfont,T=s.rangefont,A=n.extendDeepNoArrays({},c,{color:l.map(r.scale.linear().domain(S({values:l,range:[h.min,h.max],_length:s._length}))),blockLineCount:b.blockLineCount,canvasOverdrag:b.overdrag*b.canvasPixelRatio}),M=Math.floor(g*(f.x[1]-f.x[0])),E=Math.floor(e.height*(f.y[1]-f.y[0])),P=e.margin||{l:80,r:80,t:100,b:80},L=M,I=E;return{key:i,colCount:m.filter(x.isVisible).length,dimensions:m,tickDistance:b.tickDistance,unitToColor:C(d),lines:A,deselectedLines:u,labelAngle:v,labelSide:_,labelFont:w,tickFont:k,rangeFont:T,layoutWidth:g,layoutHeight:e.height,domain:f,translateX:f.x[0]*g,translateY:e.height-f.y[1]*e.height,pad:P,canvasWidth:L*b.canvasPixelRatio+2*A.canvasOverdrag,canvasHeight:I*b.canvasPixelRatio,width:L,height:I,canvasPixelRatio:b.canvasPixelRatio}}function I(e,t,o){var s=o.width,l=o.height,c=o.dimensions,u=o.canvasPixelRatio,h=function(e){return s*e/Math.max(1,o.colCount-1)},p=b.verticalPadding/l,d=function(e,t){return r.scale.linear().range([t,e-t])}(l,b.verticalPadding),f={key:o.key,xScale:h,model:o,inBrushDrag:!1},m={};return f.dimensions=c.filter(x.isVisible).map((function(s,c){var g=function(e,t){return r.scale.linear().domain(S(e)).range([t,1-t])}(s,p),y=m[s.label];m[s.label]=(y||0)+1;var v=s.label+(y?"__"+y:""),w=s.constraintrange,k=w&&w.length;k&&!i(w[0])&&(w=[w]);var T=k?w.map((function(e){return e.map(g)})):[[-1/0,1/0]],A=s.values;A.length>s._length&&(A=A.slice(0,s._length));var C,L=s.tickvals;function I(e,t){return{val:e,text:C[t]}}function z(e,t){return e.val-t.val}if(i(L)&&L.length){n.isTypedArray(L)&&(L=Array.from(L)),C=s.ticktext,i(C)&&C.length?C.length>L.length?C=C.slice(0,L.length):L.length>C.length&&(L=L.slice(0,C.length)):C=L.map(a(s.tickformat));for(var O=1;O<L.length;O++)if(L[O]<L[O-1]){for(var R=L.map(I).sort(z),D=0;D<L.length;D++)L[D]=R[D].val,C[D]=R[D].text;break}}else L=void 0;return A=x.convertTypedArray(A),{key:v,label:s.label,tickFormat:s.tickformat,tickvals:L,ticktext:C,ordinal:x.isOrdinal(s),multiselect:s.multiselect,xIndex:c,crossfilterDimensionIndex:c,visibleIndex:s._index,height:l,values:A,paddedUnitValues:A.map(g),unitTickvals:L&&L.map(g),xScale:h,x:h(c),canvasX:h(c)*u,unitToPaddedPx:d,domainScale:M(l,b.verticalPadding,s,L,C),ordinalScale:E(s),parent:f,model:o,brush:_.makeBrush(e,k,T,(function(){e.linePickActive(!1)}),(function(){var t=f;t.focusLayer&&t.focusLayer.render(t.panels,!0);var r=P(t);!e.contextShown()&&r?(t.contextLayer&&t.contextLayer.render(t.panels,!0),e.contextShown(!0)):e.contextShown()&&!r&&(t.contextLayer&&t.contextLayer.render(t.panels,!0,!0),e.contextShown(!1))}),(function(r){if(f.focusLayer.render(f.panels,!0),f.pickLayer&&f.pickLayer.render(f.panels,!0),e.linePickActive(!0),t&&t.filterChanged){var i=g.invert,a=r.map((function(e){return e.map(i).sort(n.sorterAsc)})).sort((function(e,t){return e[0]-t[0]}));t.filterChanged(f.key,s._index,a)}}))}})),f}function z(e){e.classed(b.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default")}function O(e,t){var r="top"===t?1:-1,n=e*Math.PI/180;return{dir:r,dx:Math.sin(n),dy:Math.cos(n),degrees:e}}function R(e,t,r){for(var n=t.panels||(t.panels=[]),i=e.data(),a=0;a<i.length-1;a++){var o=n[a]||(n[a]={}),s=i[a],l=i[a+1];o.dim0=s,o.dim1=l,o.canvasX=s.canvasX,o.panelSizeX=l.canvasX-s.canvasX,o.panelSizeY=t.model.canvasHeight,o.y=0,o.canvasY=0,o.plotGlPixelRatio=r}}function D(e,t){return s.tickText(e._ax,t,!1).text}function j(e,t){if(e.ordinal)return"";var r=e.domainScale.domain(),n=r[t?r.length-1:0];return D(e.model.dimensions[e.visibleIndex],n)}t.exports=function(e,t,i,a){var o=e._context.staticPlot,p=e._fullLayout,d=p._toppaper,m=p._glcontainer,v=e._context.plotGlPixelRatio,k=e._fullLayout.paper_bgcolor;!function(e){for(var t=0;t<e.length;t++)for(var r=0;r<e[t].length;r++)for(var n=e[t][r].trace,i=n.dimensions,a=0;a<i.length;a++){var o=i[a].values,l=i[a]._ax;l&&(l.range?l.range=A(l.range[0],l.range[1]):l.range=T(o,n._length),l.dtick||(l.dtick=.01*(Math.abs(l.range[1]-l.range[0])||1)),l.tickformat=i[a].tickformat,s.calcTicks(l),l.cleanRange())}}(t);var S=function(){var e=!0,t=!1;return{linePickActive:function(t){return arguments.length?e=!!t:e},contextShown:function(e){return arguments.length?t=!!e:t}}}(),M=t.filter((function(e){return y(e).trace.visible})).map(L.bind(0,i)).map(I.bind(0,S,a));m.each((function(e,t){return n.extendFlat(e,M[t])}));var E=m.selectAll(".gl-canvas").each((function(e){e.viewModel=M[0],e.viewModel.plotGlPixelRatio=v,e.viewModel.paperColor=k,e.model=e.viewModel?e.viewModel.model:null})),C=null;E.filter((function(e){return e.pick})).style("pointer-events",o?"none":"auto").on("mousemove",(function(e){if(S.linePickActive()&&e.lineLayer&&a&&a.hover){var t=r.event,n=this.width,i=this.height,o=r.mouse(this),s=o[0],l=o[1];if(s<0||l<0||s>=n||l>=i)return;var c=e.lineLayer.readPixel(s,i-1-l),u=0!==c[3],h=u?c[2]+256*(c[1]+256*c[0]):null,p={x:s,y:l,clientX:t.clientX,clientY:t.clientY,dataIndex:e.model.key,curveNumber:h};h!==C&&(u?a.hover(p):a.unhover&&a.unhover(p),C=h)}})),E.style("opacity",(function(e){return e.pick?0:1})),d.style("background","rgba(255, 255, 255, 0)");var F=d.selectAll("."+b.cn.parcoords).data(M,f);F.exit().remove(),F.enter().append("g").classed(b.cn.parcoords,!0).style("shape-rendering","crispEdges").style("pointer-events","none"),F.attr("transform",(function(e){return c(e.model.translateX,e.model.translateY)}));var B=F.selectAll("."+b.cn.parcoordsControlView).data(g,f);B.enter().append("g").classed(b.cn.parcoordsControlView,!0),B.attr("transform",(function(e){return c(e.model.pad.l,e.model.pad.t)}));var N=B.selectAll("."+b.cn.yAxis).data((function(e){return e.dimensions}),f);N.enter().append("g").classed(b.cn.yAxis,!0),B.each((function(e){R(N,e,v)})),E.each((function(e){if(e.viewModel){!e.lineLayer||a?e.lineLayer=w(this,e):e.lineLayer.update(e),(e.key||0===e.key)&&(e.viewModel[e.key]=e.lineLayer);var t=!e.context||a;e.lineLayer.render(e.viewModel.panels,t)}})),N.attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),N.call(r.behavior.drag().origin((function(e){return e})).on("drag",(function(e){var t=e.parent;S.linePickActive(!1),e.x=Math.max(-b.overdrag,Math.min(e.model.width+b.overdrag,r.event.x)),e.canvasX=e.x*e.model.canvasPixelRatio,N.sort((function(e,t){return e.x-t.x})).each((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio})),R(N,t,v),N.filter((function(t){return 0!==Math.abs(e.xIndex-t.xIndex)})).attr("transform",(function(e){return c(e.xScale(e.xIndex),0)})),r.select(this).attr("transform",c(e.x,0)),N.each((function(r,n,i){i===e.parent.key&&(t.dimensions[n]=r)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!P(t)),t.focusLayer.render&&t.focusLayer.render(t.panels)})).on("dragend",(function(e){var t=e.parent;e.x=e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio,R(N,t,v),r.select(this).attr("transform",(function(e){return c(e.x,0)})),t.contextLayer&&t.contextLayer.render(t.panels,!1,!P(t)),t.focusLayer&&t.focusLayer.render(t.panels),t.pickLayer&&t.pickLayer.render(t.panels,!0),S.linePickActive(!0),a&&a.axesMoved&&a.axesMoved(t.key,t.dimensions.map((function(e){return e.crossfilterDimensionIndex})))}))),N.exit().remove();var U=N.selectAll("."+b.cn.axisOverlays).data(g,f);U.enter().append("g").classed(b.cn.axisOverlays,!0),U.selectAll("."+b.cn.axis).remove();var V=U.selectAll("."+b.cn.axis).data(g,f);V.enter().append("g").classed(b.cn.axis,!0),V.each((function(e){var t=e.model.height/e.model.tickDistance,n=e.domainScale,i=n.domain();r.select(this).call(r.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(t,e.tickFormat).tickValues(e.ordinal?i:null).tickFormat((function(t){return x.isOrdinal(e)?t:D(e.model.dimensions[e.visibleIndex],t)})).scale(n)),h.font(V.selectAll("text"),e.model.tickFont)})),V.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),V.selectAll("text").style("cursor","default");var q=U.selectAll("."+b.cn.axisHeading).data(g,f);q.enter().append("g").classed(b.cn.axisHeading,!0);var H=q.selectAll("."+b.cn.axisTitle).data(g,f);H.enter().append("text").classed(b.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("pointer-events",o?"none":"auto"),H.text((function(e){return e.label})).each((function(t){var n=r.select(this);h.font(n,t.model.labelFont),u.convertToTspans(n,e)})).attr("transform",(function(e){var t=O(e.model.labelAngle,e.model.labelSide),r=b.axisTitleOffset;return(t.dir>0?"":c(0,2*r+e.model.height))+l(t.degrees)+c(-r*t.dx,-r*t.dy)})).attr("text-anchor",(function(e){var t=O(e.model.labelAngle,e.model.labelSide);return 2*Math.abs(t.dx)>Math.abs(t.dy)?t.dir*t.dx<0?"start":"end":"middle"}));var G=U.selectAll("."+b.cn.axisExtent).data(g,f);G.enter().append("g").classed(b.cn.axisExtent,!0);var W=G.selectAll("."+b.cn.axisExtentTop).data(g,f);W.enter().append("g").classed(b.cn.axisExtentTop,!0),W.attr("transform",c(0,-b.axisExtentOffset));var $=W.selectAll("."+b.cn.axisExtentTopText).data(g,f);$.enter().append("text").classed(b.cn.axisExtentTopText,!0).call(z),$.text((function(e){return j(e,!0)})).each((function(e){h.font(r.select(this),e.model.rangeFont)}));var Z=G.selectAll("."+b.cn.axisExtentBottom).data(g,f);Z.enter().append("g").classed(b.cn.axisExtentBottom,!0),Z.attr("transform",(function(e){return c(0,e.model.height+b.axisExtentOffset)}));var X=Z.selectAll("."+b.cn.axisExtentBottomText).data(g,f);X.enter().append("text").classed(b.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(z),X.text((function(e){return j(e,!1)})).each((function(e){h.font(r.select(this),e.model.rangeFont)})),_.ensureAxisBrush(U,k,e)}}}),Yx=p({"src/traces/parcoords/plot.js"(e,t){var r=Xx(),n=ux(),i=$x().isVisible,a={};function o(e,t,r){var n=t.indexOf(r),i=e.indexOf(n);return-1===i&&(i+=t.length),i}(t.exports=function(e,t){var s=e._fullLayout;if(n(e,[],a)){var l={},c={},u={},h={},p=s._size;t.forEach((function(t,r){var n=t[0].trace;u[r]=n.index;var i=h[r]=n.index;l[r]=e.data[i].dimensions,c[r]=e.data[i].dimensions.slice()})),r(e,t,{width:p.w,height:p.h,margin:{t:p.t,r:p.r,b:p.b,l:p.l}},{filterChanged:function(t,r,n){var i=c[t][r],a=n.map((function(e){return e.slice()})),o="dimensions["+r+"].constraintrange",l=s._tracePreGUI[e._fullData[u[t]]._fullInput.uid];if(void 0===l[o]){var p=i.constraintrange;l[o]=p||null}var d=e._fullData[u[t]].dimensions[r];a.length?(1===a.length&&(a=a[0]),i.constraintrange=a,d.constraintrange=a.slice(),a=[a]):(delete i.constraintrange,delete d.constraintrange,a=null);var f={};f[o]=a,e.emit("plotly_restyle",[f,[h[t]]])},hover:function(t){e.emit("plotly_hover",t)},unhover:function(t){e.emit("plotly_unhover",t)},axesMoved:function(t,r){var n=function(e,t){return function(r,n){return o(e,t,r)-o(e,t,n)}}(r,c[t].filter(i));l[t].sort(n),c[t].filter((function(e){return!i(e)})).sort((function(e){return c[t].indexOf(e)})).forEach((function(e){l[t].splice(l[t].indexOf(e),1),l[t].splice(c[t].indexOf(e),0,e)})),e.emit("plotly_restyle",[{dimensions:[l[t]]},[h[t]]])}})}}).reglPrecompiled=a}}),Kx=p({"src/traces/parcoords/base_plot.js"(e){var t=v(),r=_t().getModuleCalcData,n=Yx(),i=Tt();e.name="parcoords",e.plot=function(e){var t=r(e.calcdata,"parcoords")[0];t.length&&n(e,t)},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcoords"),a=t._has&&t._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},e.toSVG=function(e){var r=e._fullLayout._glimages,n=t.select(e).selectAll(".svg-container");n.filter((function(e,t){return t===n.size()-1})).selectAll(".gl-canvas-context, .gl-canvas-focus").each((function(){var e=this,t=e.toDataURL("image/png");r.append("svg:image").attr({xmlns:i.svg,"xlink:href":t,preserveAspectRatio:"none",x:0,y:0,width:e.style.width,height:e.style.height})})),window.setTimeout((function(){t.selectAll("#filterBarPattern").attr("id","filterBarPattern")}),60)}}}),Jx=p({"src/traces/parcoords/base_index.js"(e,t){t.exports={attributes:Ix(),supplyDefaults:Dx(),calc:jx(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcoords",basePlotModule:Kx(),categories:["gl","regl","noOpacity","noHover"],meta:{}}}}),Qx=p({"src/traces/parcoords/index.js"(e,t){var r=Jx();r.plot=Yx(),t.exports=r}}),eb=p({"lib/parcoords.js"(e,t){t.exports=Qx()}}),tb=p({"src/traces/parcats/attributes.js"(e,t){var r=R().extendFlat,n=N(),i=D(),a=Lt(),o=Oe().hovertemplateAttrs,s=ka().attributes,l=r({editType:"calc"},a("line",{editTypeOverride:"calc"}),{shape:{valType:"enumerated",values:["linear","hspline"],dflt:"linear",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability"]})});t.exports={domain:s({name:"parcats",trace:!0,editType:"calc"}),hoverinfo:r({},n.hoverinfo,{flags:["count","probability"],editType:"plot",arrayOk:!1}),hoveron:{valType:"enumerated",values:["category","color","dimension"],dflt:"category",editType:"plot"},hovertemplate:o({editType:"plot",arrayOk:!1},{keys:["count","probability","category","categorycount","colorcount","bandcolorcount"]}),arrangement:{valType:"enumerated",values:["perpendicular","freeform","fixed"],dflt:"perpendicular",editType:"plot"},bundlecolors:{valType:"boolean",dflt:!0,editType:"plot"},sortpaths:{valType:"enumerated",values:["forward","backward"],dflt:"forward",editType:"plot"},labelfont:i({editType:"calc"}),tickfont:i({autoShadowDflt:!0,editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},displayindex:{valType:"integer",editType:"calc"},editType:"calc",visible:{valType:"boolean",dflt:!0,editType:"calc"}},line:l,counts:{valType:"number",min:0,dflt:1,arrayOk:!0,editType:"calc"},customdata:void 0,hoverlabel:void 0,ids:void 0,legend:void 0,legendgroup:void 0,legendrank:void 0,opacity:void 0,selectedpoints:void 0,showlegend:void 0}}}),rb=p({"src/traces/parcats/defaults.js"(e,t){var r=st(),n=Mt().hasColorscale,i=Vt(),a=ka().defaults,o=Ft(),s=tb(),l=mx(),c=M().isTypedArraySpec;function u(e,t){function n(n,i){return r.coerce(e,t,s.dimensions,n,i)}var i=n("values"),a=n("visible");if(i&&i.length||(a=t.visible=!1),a){n("label"),n("displayindex",t._index);var o,l=e.categoryarray,u=r.isArrayOrTypedArray(l)&&l.length>0||c(l);u&&(o="array");var h=n("categoryorder",o);"array"===h?(n("categoryarray"),n("ticktext")):(delete e.categoryarray,delete e.ticktext),u||"array"!==h||(t.categoryorder="trace")}}t.exports=function(e,t,c,h){function p(n,i){return r.coerce(e,t,s,n,i)}var d=o(e,t,{name:"dimensions",handleItemDefaults:u}),f=function(e,t,a,o,s){s("line.shape"),s("line.hovertemplate");var l=s("line.color",o.colorway[0]);if(n(e,"line")&&r.isArrayOrTypedArray(l)){if(l.length)return s("line.colorscale"),i(e,t,o,s,{prefix:"line.",cLetter:"c"}),l.length;t.line.color=a}return 1/0}(e,t,c,h,p);a(t,h,p),Array.isArray(d)&&d.length||(t.visible=!1),l(t,d,"values",f),p("hoveron"),p("hovertemplate"),p("arrangement"),p("bundlecolors"),p("sortpaths"),p("counts");var m=h.font;r.coerceFont(p,"labelfont",m,{overrideDflt:{size:Math.round(m.size)}}),r.coerceFont(p,"tickfont",m,{autoShadowDflt:!0,overrideDflt:{size:Math.round(m.size/1.2)}})}}}),nb=p({"src/traces/parcats/calc.js"(e,t){var r=Ox().wrap,n=Mt().hasColorscale,i=Gt(),a=nt(),o=Jt(),s=st(),l=k();function c(e,t,r){e.valueInds.push(t),e.count+=r}function u(e,t,r){e.valueInds.push(t),e.count+=r}t.exports=function(e,t){var h=s.filterVisible(t.dimensions);if(0===h.length)return[];var p,d,f,m=h.map((function(e){var t;if("trace"===e.categoryorder)t=null;else if("array"===e.categoryorder)t=e.categoryarray;else{t=a(e.values);for(var r=!0,n=0;n<t.length;n++)if(!l(t[n])){r=!1;break}t.sort(r?s.sorterAsc:void 0),"category descending"===e.categoryorder&&(t=t.reverse())}return function(e,t){t=void 0===t||null===t?[]:t.map((function(e){return e}));var r={},n={},i=[];t.forEach((function(e,t){r[e]=0,n[e]=t}));for(var a=0;a<e.length;a++){var o,s=e[a];void 0===r[s]?(r[s]=1,o=t.push(s)-1,n[s]=o):(r[s]++,o=n[s]),i.push(o)}var l=t.map((function(e){return r[e]}));return{uniqueValues:t,uniqueCounts:l,inds:i}}(e.values,t)}));p=s.isArrayOrTypedArray(t.counts)?t.counts:[t.counts],function(e){var t,r=e.map((function(e){return e.displayindex}));if(function(e){for(var t=new Array(e.length),r=0;r<e.length;r++){if(e[r]<0||e[r]>=e.length)return!1;if(void 0!==t[e[r]])return!1;t[e[r]]=!0}return!0}(r))for(t=0;t<e.length;t++)e[t]._displayindex=e[t].displayindex;else for(t=0;t<e.length;t++)e[t]._displayindex=t}(h),h.forEach((function(e,t){!function(e,t){e._categoryarray=t.uniqueValues,null===e.ticktext||void 0===e.ticktext?e._ticktext=[]:e._ticktext=e.ticktext.slice();for(var r=e._ticktext.length;r<t.uniqueValues.length;r++)e._ticktext.push(t.uniqueValues[r])}(e,m[t])}));var g,y=t.line;function v(e){var t,r;return s.isArrayOrTypedArray(y.color)?r=t=y.color[e%y.color.length]:t=y.color,{color:g(t),rawColor:r}}y?(n(t,"line")&&i(e,t,{vals:t.line.color,containerStr:"line",cLetter:"c"}),g=o.tryColorscale(y)):g=s.identity;var x,b,_,w,k,T=h[0].values.length,S={},A=m.map((function(e){return e.inds}));for(f=0,x=0;x<T;x++){var M=[];for(b=0;b<A.length;b++)M.push(A[b][x]);d=p[x%p.length],f+=d;var E=v(x),C=M+"-"+E.rawColor;void 0===S[C]&&(S[C]=(_=M,w=E.color,k=E.rawColor,{categoryInds:_,color:w,rawColor:k,valueInds:[],count:0})),u(S[C],x,d)}var P,L=h.map((function(e,t){return function(e,t,r,n,i){return{dimensionInd:e,containerInd:t,displayInd:r,dimensionLabel:n,count:i,categories:[],dragX:null}}(t,e._index,e._displayindex,e.label,f)}));for(x=0;x<T;x++)for(d=p[x%p.length],b=0;b<L.length;b++){var I=L[b].containerInd,z=m[b].inds[x],O=L[b].categories;if(void 0===O[z]){var R=t.dimensions[I]._categoryarray[z],D=t.dimensions[I]._ticktext[z];O[z]={dimensionInd:b,categoryInd:P=z,categoryValue:R,displayInd:P,categoryLabel:D,valueInds:[],count:0,dragY:null}}c(O[z],x,d)}return r(function(e,t,r){var n=e.map((function(e){return e.categories.length})).reduce((function(e,t){return Math.max(e,t)}));return{dimensions:e,paths:t,trace:void 0,maxCats:n,count:r}}(L,S,f))}}}),ib=p({"src/traces/parcats/parcats.js"(e,t){var r=v(),n=(Bd(),m(Rd)).interpolateNumber,i=zn(),a=zr(),o=st(),s=o.strTranslate,l=Jt(),c=O(),u=At();function h(e,t,n,i){var a=t._context.staticPlot,c=e.map(B.bind(0,t,n)),h=i.selectAll("g.parcatslayer").data([null]);h.enter().append("g").attr("class","parcatslayer").style("pointer-events",a?"none":"all");var m=h.selectAll("g.trace.parcats").data(c,p),v=m.enter().append("g").attr("class","trace parcats");m.attr("transform",(function(e){return s(e.x,e.y)})),v.append("g").attr("class","paths");var x=m.select("g.paths").selectAll("path.path").data((function(e){return e.paths}),p);x.attr("fill",(function(e){return e.model.color}));var b=x.enter().append("path").attr("class","path").attr("stroke-opacity",0).attr("fill",(function(e){return e.model.color})).attr("fill-opacity",0);w(b),x.attr("d",(function(e){return e.svgD})),b.empty()||x.sort(f),x.exit().remove(),x.on("mouseover",g).on("mouseout",y).on("click",_),v.append("g").attr("class","dimensions");var k=m.select("g.dimensions").selectAll("g.dimension").data((function(e){return e.dimensions}),p);k.enter().append("g").attr("class","dimension"),k.attr("transform",(function(e){return s(e.x,0)})),k.exit().remove();var A=k.selectAll("g.category").data((function(e){return e.categories}),p),M=A.enter().append("g").attr("class","category");A.attr("transform",(function(e){return s(0,e.y)})),M.append("rect").attr("class","catrect").attr("pointer-events","none"),A.select("rect.catrect").attr("fill","none").attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),T(M);var E=A.selectAll("rect.bandrect").data((function(e){return e.bands}),p);E.each((function(){o.raiseToTop(this)})),E.attr("fill",(function(e){return e.color}));var C=E.enter().append("rect").attr("class","bandrect").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);E.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})).attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"perpendicular"===e.parcatsViewModel.arrangement?"ns-resize":"move"})),S(C),E.exit().remove(),M.append("text").attr("class","catlabel").attr("pointer-events","none"),A.select("text.catlabel").attr("text-anchor",(function(e){return d(e)?"start":"end"})).attr("alignment-baseline","middle").style("fill","rgb(0, 0, 0)").attr("x",(function(e){return d(e)?e.width+5:-5})).attr("y",(function(e){return e.height/2})).text((function(e){return e.model.categoryLabel})).each((function(e){l.font(r.select(this),e.parcatsViewModel.categorylabelfont),u.convertToTspans(r.select(this),t)})),M.append("text").attr("class","dimlabel"),A.select("text.dimlabel").attr("text-anchor","middle").attr("alignment-baseline","baseline").attr("cursor",(function(e){return"fixed"===e.parcatsViewModel.arrangement?"default":"ew-resize"})).attr("x",(function(e){return e.width/2})).attr("y",-5).text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})).each((function(e){l.font(r.select(this),e.parcatsViewModel.labelfont)})),A.selectAll("rect.bandrect").on("mouseover",P).on("mouseout",L),A.exit().remove(),k.call(r.behavior.drag().origin((function(e){return{x:e.x,y:0}})).on("dragstart",I).on("drag",z).on("dragend",R)),m.each((function(e){e.traceSelection=r.select(this),e.pathSelection=r.select(this).selectAll("g.paths").selectAll("path.path"),e.dimensionSelection=r.select(this).selectAll("g.dimensions").selectAll("g.dimension")})),m.exit().remove()}function p(e){return e.key}function d(e){var t=e.parcatsViewModel.dimensions.length,r=e.parcatsViewModel.dimensions[t-1].model.dimensionInd;return e.model.dimensionInd===r}function f(e,t){return e.model.rawColor>t.model.rawColor?1:e.model.rawColor<t.model.rawColor?-1:0}function g(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){o.raiseToTop(this),k(r.select(this));var t=x(e),n=b(e);if(e.parcatsViewModel.graphDiv.emit("plotly_hover",{points:t,event:r.event,constraints:n}),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")){var i,s,l,u=r.mouse(this)[0],h=e.parcatsViewModel.graphDiv,p=e.parcatsViewModel.trace,d=h._fullLayout,f=d._paperdiv.node().getBoundingClientRect(),m=e.parcatsViewModel.graphDiv.getBoundingClientRect();for(l=0;l<e.leftXs.length-1;l++)if(e.leftXs[l]+e.dimWidths[l]-2<=u&&u<=e.leftXs[l+1]+2){var g=e.parcatsViewModel.dimensions[l],y=e.parcatsViewModel.dimensions[l+1];i=(g.x+g.width+y.x)/2,s=(e.topYs[l]+e.topYs[l+1]+e.height)/2;break}var v=e.parcatsViewModel.x+i,_=e.parcatsViewModel.y+s,w=c.mostReadable(e.model.color,["black","white"]),T=e.model.count,S=T/e.parcatsViewModel.model.count,A={countLabel:T,probabilityLabel:S.toFixed(3)},M=[];-1!==e.parcatsViewModel.hoverinfoItems.indexOf("count")&&M.push(["Count:",A.countLabel].join(" ")),-1!==e.parcatsViewModel.hoverinfoItems.indexOf("probability")&&M.push(["P:",A.probabilityLabel].join(" "));var E=M.join("<br>"),C=r.mouse(h)[0];a.loneHover({trace:p,x:v-f.left+m.left,y:_-f.top+m.top,text:E,color:e.model.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:10,fontColor:w,idealAlign:C<v?"right":"left",hovertemplate:(p.line||{}).hovertemplate,hovertemplateLabels:A,eventData:[{data:p._input,fullData:p,count:T,probability:S}]},{container:d._hoverlayer.node(),outerContainer:d._paper.node(),gd:h})}}}function y(e){if(!e.parcatsViewModel.dragDimension&&(w(r.select(this)),a.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()),e.parcatsViewModel.pathSelection.sort(f),-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip"))){var t=x(e),n=b(e);e.parcatsViewModel.graphDiv.emit("plotly_unhover",{points:t,event:r.event,constraints:n})}}function x(e){for(var t=[],r=D(e.parcatsViewModel),n=0;n<e.model.valueInds.length;n++){var i=e.model.valueInds[n];t.push({curveNumber:r,pointNumber:i})}return t}function b(e){for(var t={},r=e.parcatsViewModel.model.dimensions,n=0;n<r.length;n++){var i=r[n],a=i.categories[e.model.categoryInds[n]];t[i.containerInd]=a.categoryValue}return void 0!==e.model.rawColor&&(t.color=e.model.rawColor),t}function _(e){if(-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){var t=x(e),n=b(e);e.parcatsViewModel.graphDiv.emit("plotly_click",{points:t,event:r.event,constraints:n})}}function w(e){e.attr("fill",(function(e){return e.model.color})).attr("fill-opacity",.6).attr("stroke","lightgray").attr("stroke-width",.2).attr("stroke-opacity",1)}function k(e){e.attr("fill-opacity",.8).attr("stroke",(function(e){return c.mostReadable(e.model.color,["black","white"])})).attr("stroke-width",.3)}function T(e){e.select("rect.catrect").attr("stroke","black").attr("stroke-width",1).attr("stroke-opacity",1)}function S(e){e.attr("stroke","black").attr("stroke-width",.2).attr("stroke-opacity",1).attr("fill-opacity",1)}function A(e){var t=e.parcatsViewModel.pathSelection,r=e.categoryViewModel.model.dimensionInd,n=e.categoryViewModel.model.categoryInd;return t.filter((function(t){return t.model.categoryInds[r]===n&&t.model.color===e.color}))}function M(e,t,n){var i=r.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=r.select(e.parentNode).selectAll("rect.bandrect"),l=[];s.each((function(e){A(e).each((function(e){Array.prototype.push.apply(l,x(e))}))}));var c={};c[a.dimensionInd]=a.categoryValue,o.emit(t,{points:l,event:n,constraints:c})}function E(e,t,n){var i=r.select(e).datum(),a=i.categoryViewModel.model,o=i.parcatsViewModel.graphDiv,s=A(i),l=[];s.each((function(e){Array.prototype.push.apply(l,x(e))}));var c={};c[a.dimensionInd]=a.categoryValue,void 0!==i.rawColor&&(c.color=i.rawColor),o.emit(t,{points:l,event:n,constraints:c})}function C(e,t,n){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=r.select(n.parentNode).select("rect.catrect"),c=l.node().getBoundingClientRect(),u=l.datum(),h=u.parcatsViewModel,p=h.model.dimensions[u.model.dimensionInd],d=h.trace,f=c.top+c.height/2;h.dimensions.length>1&&p.displayInd===h.dimensions.length-1?(i=c.left,a="left"):(i=c.left+c.width,a="right");var m=u.model.count,g=u.model.categoryLabel,y=m/u.parcatsViewModel.model.count,v={countLabel:m,categoryLabel:g,probabilityLabel:y.toFixed(3)},x=[];-1!==u.parcatsViewModel.hoverinfoItems.indexOf("count")&&x.push(["Count:",v.countLabel].join(" ")),-1!==u.parcatsViewModel.hoverinfoItems.indexOf("probability")&&x.push(["P("+v.categoryLabel+"):",v.probabilityLabel].join(" "));var b=x.join("<br>");return{trace:d,x:o*(i-t.left),y:s*(f-t.top),text:b,color:"lightgray",borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontSize:12,fontColor:"black",idealAlign:a,hovertemplate:d.hovertemplate,hovertemplateLabels:v,eventData:[{data:d._input,fullData:d,count:m,category:g,probability:y}]}}function P(e){if(!e.parcatsViewModel.dragDimension&&-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")){if(r.mouse(this)[1]<-1)return;var t,n=e.parcatsViewModel.graphDiv,i=n._fullLayout,s=i._paperdiv.node().getBoundingClientRect(),l=e.parcatsViewModel.hoveron,u=this;"color"===l?(function(e){var t=r.select(e).datum(),n=A(t);k(n),n.each((function(){o.raiseToTop(this)})),r.select(e.parentNode).selectAll("rect.bandrect").filter((function(e){return e.color===t.color})).each((function(){o.raiseToTop(this),r.select(this).attr("stroke","black").attr("stroke-width",1.5)}))}(u),E(u,"plotly_hover",r.event)):(function(e){r.select(e.parentNode).selectAll("rect.bandrect").each((function(e){var t=A(e);k(t),t.each((function(){o.raiseToTop(this)}))})),r.select(e.parentNode).select("rect.catrect").attr("stroke","black").attr("stroke-width",2.5)}(u),M(u,"plotly_hover",r.event)),-1===e.parcatsViewModel.hoverinfoItems.indexOf("none")&&("category"===l?t=C(n,s,u):"color"===l?t=function(e,t,n){e._fullLayout._calcInverseTransform(e);var i,a,o=e._fullLayout._invScaleX,s=e._fullLayout._invScaleY,l=n.getBoundingClientRect(),u=r.select(n).datum(),h=u.categoryViewModel,p=h.parcatsViewModel,d=p.model.dimensions[h.model.dimensionInd],f=p.trace,m=l.y+l.height/2;p.dimensions.length>1&&d.displayInd===p.dimensions.length-1?(i=l.left,a="left"):(i=l.left+l.width,a="right");var g=h.model.categoryLabel,y=u.parcatsViewModel.model.count,v=0;u.categoryViewModel.bands.forEach((function(e){e.color===u.color&&(v+=e.count)}));var x=h.model.count,b=0;p.pathSelection.each((function(e){e.model.color===u.color&&(b+=e.model.count)}));var _=v/y,w=v/b,k=v/x,T={countLabel:v,categoryLabel:g,probabilityLabel:_.toFixed(3)},S=[];-1!==h.parcatsViewModel.hoverinfoItems.indexOf("count")&&S.push(["Count:",T.countLabel].join(" ")),-1!==h.parcatsViewModel.hoverinfoItems.indexOf("probability")&&(S.push("P(color \u2229 "+g+"): "+T.probabilityLabel),S.push("P("+g+" | color): "+w.toFixed(3)),S.push("P(color | "+g+"): "+k.toFixed(3)));var A=S.join("<br>"),M=c.mostReadable(u.color,["black","white"]);return{trace:f,x:o*(i-t.left),y:s*(m-t.top),text:A,color:u.color,borderColor:"black",fontFamily:'Monaco, "Courier New", monospace',fontColor:M,fontSize:10,idealAlign:a,hovertemplate:f.hovertemplate,hovertemplateLabels:T,eventData:[{data:f._input,fullData:f,category:g,count:y,probability:_,categorycount:x,colorcount:b,bandcolorcount:v}]}}(n,s,u):"dimension"===l&&(t=function(e,t,n){var i=[];return r.select(n.parentNode.parentNode).selectAll("g.category").select("rect.catrect").each((function(){i.push(C(e,t,this))})),i}(n,s,u)),t&&a.loneHover(t,{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:n}))}}function L(e){var t=e.parcatsViewModel;t.dragDimension||(w(t.pathSelection),T(t.dimensionSelection.selectAll("g.category")),S(t.dimensionSelection.selectAll("g.category").selectAll("rect.bandrect")),a.loneUnhover(t.graphDiv._fullLayout._hoverlayer.node()),t.pathSelection.sort(f),-1!==t.hoverinfoItems.indexOf("skip"))||("color"===e.parcatsViewModel.hoveron?E(this,"plotly_unhover",r.event):M(this,"plotly_unhover",r.event))}function I(e){"fixed"!==e.parcatsViewModel.arrangement&&(e.dragDimensionDisplayInd=e.model.displayInd,e.initialDragDimensionDisplayInds=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),e.dragHasMoved=!1,e.dragCategoryDisplayInd=null,r.select(this).selectAll("g.category").select("rect.catrect").each((function(t){var n=r.mouse(this)[0],i=r.mouse(this)[1];-2<=n&&n<=t.width+2&&-2<=i&&i<=t.height+2&&(e.dragCategoryDisplayInd=t.model.displayInd,e.initialDragCategoryDisplayInds=e.model.categories.map((function(e){return e.displayInd})),t.model.dragY=t.y,o.raiseToTop(this.parentNode),r.select(this.parentNode).selectAll("rect.bandrect").each((function(t){t.y<i&&i<=t.y+t.height&&(e.potentialClickBand=this)})))})),e.parcatsViewModel.dragDimension=e,a.loneUnhover(e.parcatsViewModel.graphDiv._fullLayout._hoverlayer.node()))}function z(e){if("fixed"!==e.parcatsViewModel.arrangement&&(e.dragHasMoved=!0,null!==e.dragDimensionDisplayInd)){var t=e.dragDimensionDisplayInd,n=t-1,i=t+1,a=e.parcatsViewModel.dimensions[t];if(null!==e.dragCategoryDisplayInd){var o=a.categories[e.dragCategoryDisplayInd];o.model.dragY+=r.event.dy;var s=o.model.dragY,l=o.model.displayInd,c=a.categories,u=c[l-1],h=c[l+1];void 0!==u&&s<u.y+u.height/2&&(o.model.displayInd=u.model.displayInd,u.model.displayInd=l),void 0!==h&&s+o.height>h.y+h.height/2&&(o.model.displayInd=h.model.displayInd,h.model.displayInd=l),e.dragCategoryDisplayInd=o.model.displayInd}if(null===e.dragCategoryDisplayInd||"freeform"===e.parcatsViewModel.arrangement){a.model.dragX=r.event.x;var p=e.parcatsViewModel.dimensions[n],d=e.parcatsViewModel.dimensions[i];void 0!==p&&a.model.dragX<p.x+p.width&&(a.model.displayInd=p.model.displayInd,p.model.displayInd=t),void 0!==d&&a.model.dragX+a.width>d.x&&(a.model.displayInd=d.model.displayInd,d.model.displayInd=e.dragDimensionDisplayInd),e.dragDimensionDisplayInd=a.model.displayInd}V(e.parcatsViewModel),U(e.parcatsViewModel),F(e.parcatsViewModel),j(e.parcatsViewModel)}}function R(e){if("fixed"!==e.parcatsViewModel.arrangement&&null!==e.dragDimensionDisplayInd){r.select(this).selectAll("text").attr("font-weight","normal");var t={},n=D(e.parcatsViewModel),a=e.parcatsViewModel.model.dimensions.map((function(e){return e.displayInd})),o=e.initialDragDimensionDisplayInds.some((function(e,t){return e!==a[t]}));o&&a.forEach((function(r,n){var i=e.parcatsViewModel.model.dimensions[n].containerInd;t["dimensions["+i+"].displayindex"]=r}));var s=!1;if(null!==e.dragCategoryDisplayInd){var l=e.model.categories.map((function(e){return e.displayInd}));if(s=e.initialDragCategoryDisplayInds.some((function(e,t){return e!==l[t]}))){var c=e.model.categories.slice().sort((function(e,t){return e.displayInd-t.displayInd})),u=c.map((function(e){return e.categoryValue})),h=c.map((function(e){return e.categoryLabel}));t["dimensions["+e.model.containerInd+"].categoryarray"]=[u],t["dimensions["+e.model.containerInd+"].ticktext"]=[h],t["dimensions["+e.model.containerInd+"].categoryorder"]="array"}}-1===e.parcatsViewModel.hoverinfoItems.indexOf("skip")&&!e.dragHasMoved&&e.potentialClickBand&&("color"===e.parcatsViewModel.hoveron?E(e.potentialClickBand,"plotly_click",r.event.sourceEvent):M(e.potentialClickBand,"plotly_click",r.event.sourceEvent)),e.model.dragX=null,null!==e.dragCategoryDisplayInd&&(e.parcatsViewModel.dimensions[e.dragDimensionDisplayInd].categories[e.dragCategoryDisplayInd].model.dragY=null,e.dragCategoryDisplayInd=null),e.dragDimensionDisplayInd=null,e.parcatsViewModel.dragDimension=null,e.dragHasMoved=null,e.potentialClickBand=null,V(e.parcatsViewModel),U(e.parcatsViewModel),r.transition().duration(300).ease("cubic-in-out").each((function(){F(e.parcatsViewModel,!0),j(e.parcatsViewModel,!0)})).each("end",(function(){(o||s)&&i.restyle(e.parcatsViewModel.graphDiv,t,[n])}))}}function D(e){for(var t,r=e.graphDiv._fullData,n=0;n<r.length;n++)if(e.key===r[n].uid){t=n;break}return t}function j(e,t){var r;void 0===t&&(t=!1),e.pathSelection.data((function(e){return e.paths}),p),(r=e.pathSelection,t?r.transition():r).attr("d",(function(e){return e.svgD}))}function F(e,t){function n(e){return t?e.transition():e}void 0===t&&(t=!1),e.dimensionSelection.data((function(e){return e.dimensions}),p);var i=e.dimensionSelection.selectAll("g.category").data((function(e){return e.categories}),p);n(e.dimensionSelection).attr("transform",(function(e){return s(e.x,0)})),n(i).attr("transform",(function(e){return s(0,e.y)})),i.select(".dimlabel").text((function(e,t){return 0===t?e.parcatsViewModel.model.dimensions[e.model.dimensionInd].dimensionLabel:null})),i.select(".catlabel").attr("text-anchor",(function(e){return d(e)?"start":"end"})).attr("x",(function(e){return d(e)?e.width+5:-5})).each((function(e){var t,n;d(e)?(t=e.width+5,n="start"):(t=-5,n="end"),r.select(this).selectAll("tspan").attr("x",t).attr("text-anchor",n)}));var a=i.selectAll("rect.bandrect").data((function(e){return e.bands}),p),l=a.enter().append("rect").attr("class","bandrect").attr("cursor","move").attr("stroke-opacity",0).attr("fill",(function(e){return e.color})).attr("fill-opacity",0);a.attr("fill",(function(e){return e.color})).attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})).attr("y",(function(e){return e.y})),S(l),a.each((function(){o.raiseToTop(this)})),a.exit().remove()}function B(e,t,r){var n,i=r[0],a=t.margin||{l:80,r:80,t:100,b:80},o=i.trace,s=o.domain,l=t.width,c=t.height,u=Math.floor(l*(s.x[1]-s.x[0])),h=Math.floor(c*(s.y[1]-s.y[0])),p=s.x[0]*l+a.l,d=t.height-s.y[1]*t.height+a.t,f=o.line.shape;n="all"===o.hoverinfo?["count","probability"]:(o.hoverinfo||"").split("+");var m={trace:o,key:o.uid,model:i,x:p,y:d,width:u,height:h,hoveron:o.hoveron,hoverinfoItems:n,arrangement:o.arrangement,bundlecolors:o.bundlecolors,sortpaths:o.sortpaths,labelfont:o.labelfont,categorylabelfont:o.tickfont,pathShape:f,dragDimension:null,margin:a,paths:[],dimensions:[],graphDiv:e,traceSelection:null,pathSelection:null,dimensionSelection:null};return i.dimensions&&(V(m),U(m)),m}function N(e,t,r,i,a){var o,s,l=[],c=[];for(s=0;s<r.length-1;s++)o=n(r[s]+e[s],e[s+1]),l.push(o(a)),c.push(o(1-a));var u="M "+e[0]+","+t[0];for(u+="l"+r[0]+",0 ",s=1;s<r.length;s++)u+="C"+l[s-1]+","+t[s-1]+" "+c[s-1]+","+t[s]+" "+e[s]+","+t[s],u+="l"+r[s]+",0 ";for(u+="l0,"+i+" ",u+="l -"+r[r.length-1]+",0 ",s=r.length-2;s>=0;s--)u+="C"+c[s]+","+(t[s+1]+i)+" "+l[s]+","+(t[s]+i)+" "+(e[s]+r[s])+","+(t[s]+i),u+="l-"+r[s]+",0 ";return u+="Z"}function U(e){var t=e.dimensions,r=e.model,n=t.map((function(e){return e.categories.map((function(e){return e.y}))})),i=e.model.dimensions.map((function(e){return e.categories.map((function(e){return e.displayInd}))})),a=e.model.dimensions.map((function(e){return e.displayInd})),o=e.dimensions.map((function(e){return e.model.dimensionInd})),s=t.map((function(e){return e.x})),l=t.map((function(e){return e.width})),c=[];for(var u in r.paths)r.paths.hasOwnProperty(u)&&c.push(r.paths[u]);function h(e){var t=e.categoryInds.map((function(e,t){return i[t][e]}));return o.map((function(e){return t[e]}))}c.sort((function(t,r){var n=h(t),i=h(r);return"backward"===e.sortpaths&&(n.reverse(),i.reverse()),n.push(t.valueInds[0]),i.push(r.valueInds[0]),e.bundlecolors&&(n.unshift(t.rawColor),i.unshift(r.rawColor)),n<i?-1:n>i?1:0}));for(var p=new Array(c.length),d=t[0].model.count,f=t[0].categories.map((function(e){return e.height})).reduce((function(e,t){return e+t})),m=0;m<c.length;m++){var g,y=c[m];g=d>0?f*(y.count/d):0;for(var v,x=new Array(n.length),b=0;b<y.categoryInds.length;b++){var _=y.categoryInds[b],w=i[b][_],k=a[b];x[k]=n[k][w],n[k][w]+=g;var T=e.dimensions[k].categories[w],S=T.bands.length,A=T.bands[S-1];if(void 0===A||y.rawColor!==A.rawColor){var M=void 0===A?0:A.y+A.height;T.bands.push({key:M,color:y.color,rawColor:y.rawColor,height:g,width:T.width,count:y.count,y:M,categoryViewModel:T,parcatsViewModel:e})}else{var E=T.bands[S-1];E.height+=g,E.count+=y.count}}v="hspline"===e.pathShape?N(s,x,l,g,.5):N(s,x,l,g,0),p[m]={key:y.valueInds[0],model:y,height:g,leftXs:s,topYs:x,dimWidths:l,svgD:v,parcatsViewModel:e}}e.paths=p}function V(e){var t=e.model.dimensions.map((function(e){return{displayInd:e.displayInd,dimensionInd:e.dimensionInd}}));t.sort((function(e,t){return e.displayInd-t.displayInd}));var r=[];for(var n in t){var i=t[n].dimensionInd,a=e.model.dimensions[i];r.push(q(e,a))}e.dimensions=r}function q(e,t){var r,n=e.model.dimensions.length,i=t.displayInd;r=40+(n>1?(e.width-80-16)/(n-1):0)*i;var a,o,s,l,c,u=[],h=e.model.maxCats,p=t.categories.length,d=t.count,f=e.height-8*(h-1),m=8*(h-p)/2,g=t.categories.map((function(e){return{displayInd:e.displayInd,categoryInd:e.categoryInd}}));for(g.sort((function(e,t){return e.displayInd-t.displayInd})),c=0;c<p;c++)l=g[c].categoryInd,o=t.categories[l],a=d>0?o.count/d*f:0,s={key:o.valueInds[0],model:o,width:16,height:a,y:null!==o.dragY?o.dragY:m,bands:[],parcatsViewModel:e},m=m+a+8,u.push(s);return{key:t.dimensionInd,x:null!==t.dragX?t.dragX:r,y:0,width:16,model:t,categories:u,parcatsViewModel:e,dragCategoryDisplayInd:null,dragDimensionDisplayInd:null,initialDragDimensionDisplayInds:null,initialDragCategoryDisplayInds:null,dragHasMoved:null,potentialClickBand:null}}t.exports=function(e,t,r,n){h(r,e,n,t)}}}),ab=p({"src/traces/parcats/plot.js"(e,t){var r=ib();t.exports=function(e,t,n,i){var a=e._fullLayout,o=a._paper,s=a._size;r(e,o,t,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},n,i)}}}),ob=p({"src/traces/parcats/base_plot.js"(e){var t=_t().getModuleCalcData,r=ab(),n="parcats";e.name=n,e.plot=function(e,i,a,o){var s=t(e.calcdata,n);if(s.length){var l=s[0];r(e,l,a,o)}},e.clean=function(e,t,r,n){var i=n._has&&n._has("parcats"),a=t._has&&t._has("parcats");i&&!a&&n._paperdiv.selectAll(".parcats").remove()}}}),sb=p({"src/traces/parcats/index.js"(e,t){t.exports={attributes:tb(),supplyDefaults:rb(),calc:nb(),plot:ab(),colorbar:{container:"line",min:"cmin",max:"cmax"},moduleType:"trace",name:"parcats",basePlotModule:ob(),categories:["noOpacity"],meta:{}}}}),lb=p({"lib/parcats.js"(e,t){t.exports=sb()}}),cb=p({"src/plots/mapbox/constants.js"(e,t){var r=We(),n="1.13.4",i='\xa9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',a=['\xa9 <a target="_blank" href="https://carto.com/">Carto</a>',i].join(" "),o=['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://www.openstreetmap.org/copyright">ODbL</a>'].join(" "),s={"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:i,tiles:["https://a.tile.openstreetmap.org/{z}/{x}/{y}.png","https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":{id:"carto-positron",version:8,sources:{"plotly-carto-positron":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/light_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-positron",type:"raster",source:"plotly-carto-positron",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-darkmatter":{id:"carto-darkmatter",version:8,sources:{"plotly-carto-darkmatter":{type:"raster",attribution:a,tiles:["https://cartodb-basemaps-c.global.ssl.fastly.net/dark_all/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-carto-darkmatter",type:"raster",source:"plotly-carto-darkmatter",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-terrain":{id:"stamen-terrain",version:8,sources:{"plotly-stamen-terrain":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-terrain",type:"raster",source:"plotly-stamen-terrain",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-toner":{id:"stamen-toner",version:8,sources:{"plotly-stamen-toner":{type:"raster",attribution:o,tiles:["https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}.png?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-toner",type:"raster",source:"plotly-stamen-toner",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"stamen-watercolor":{id:"stamen-watercolor",version:8,sources:{"plotly-stamen-watercolor":{type:"raster",attribution:['Map tiles by <a target="_blank" href="https://stamen.com">Stamen Design</a>','under <a target="_blank" href="https://creativecommons.org/licenses/by/3.0">CC BY 3.0</a>',"|",'Data by <a target="_blank" href="https://openstreetmap.org">OpenStreetMap</a> contributors','under <a target="_blank" href="https://creativecommons.org/licenses/by-sa/3.0">CC BY SA</a>'].join(" "),tiles:["https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg?api_key="],tileSize:256}},layers:[{id:"plotly-stamen-watercolor",type:"raster",source:"plotly-stamen-watercolor",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"}},l=r(s);t.exports={requiredVersion:n,styleUrlPrefix:"mapbox://styles/mapbox/",styleUrlSuffix:"v9",styleValuesMapbox:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],styleValueDflt:"basic",stylesNonMapbox:s,styleValuesNonMapbox:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",wrongVersionErrorMsg:["Your custom plotly.js bundle is not using the correct mapbox-gl version","Please install @plotly/mapbox-gl@"+n+"."].join("\n"),noAccessTokenErrorMsg:["Missing Mapbox access token.","Mapbox trace type require a Mapbox access token to be registered.","For example:"," Plotly.newPlot(gd, data, layout, { mapboxAccessToken: 'my-access-token' });","More info here: https://www.mapbox.com/help/define-access-token/"].join("\n"),missingStyleErrorMsg:["No valid mapbox style found, please set `mapbox.style` to one of:",l.join(", "),"or register a Mapbox access token to use a Mapbox-served style."].join("\n"),multipleTokensErrorMsg:["Set multiple mapbox access token across different mapbox subplot,","using first token found as mapbox-gl does not allow multipleaccess tokens on the same page."].join("\n"),mapOnErrorMsg:"Mapbox error.",mapboxLogo:{path0:"m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z",path1:"M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z",path2:"M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z",polygon:"11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34"},styleRules:{map:"overflow:hidden;position:relative;","missing-css":"display:none;",canary:"background-color:salmon;","ctrl-bottom-left":"position: absolute; pointer-events: none; z-index: 2; bottom: 0; left: 0;","ctrl-bottom-right":"position: absolute; pointer-events: none; z-index: 2; right: 0; bottom: 0;",ctrl:"clear: both; pointer-events: auto; transform: translate(0, 0);","ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner":"display: none;","ctrl-attrib.mapboxgl-compact:hover .mapboxgl-ctrl-attrib-inner":"display: block; margin-top:2px","ctrl-attrib.mapboxgl-compact:hover":"padding: 2px 24px 2px 4px; visibility: visible; margin-top: 6px;","ctrl-attrib.mapboxgl-compact::after":'content: ""; cursor: pointer; position: absolute; background-image: url(\'data:image/svg+xml;charset=utf-8,%3Csvg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"%3E %3Cpath fill="%23333333" fill-rule="evenodd" d="M4,10a6,6 0 1,0 12,0a6,6 0 1,0 -12,0 M9,7a1,1 0 1,0 2,0a1,1 0 1,0 -2,0 M9,10a1,1 0 1,1 2,0l0,3a1,1 0 1,1 -2,0"/%3E %3C/svg%3E\'); background-color: rgba(255, 255, 255, 0.5); width: 24px; height: 24px; box-sizing: border-box; border-radius: 12px;',"ctrl-attrib.mapboxgl-compact":"min-height: 20px; padding: 0; margin: 10px; position: relative; background-color: #fff; border-radius: 3px 12px 12px 3px;","ctrl-bottom-right > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; right: 0","ctrl-bottom-left > .mapboxgl-ctrl-attrib.mapboxgl-compact::after":"bottom: 0; left: 0","ctrl-bottom-left .mapboxgl-ctrl":"margin: 0 0 10px 10px; float: left;","ctrl-bottom-right .mapboxgl-ctrl":"margin: 0 10px 10px 0; float: right;","ctrl-attrib":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a":"color: rgba(0, 0, 0, 0.75); text-decoration: none; font-size: 12px","ctrl-attrib a:hover":"color: inherit; text-decoration: underline;","ctrl-attrib .mapbox-improve-map":"font-weight: bold; margin-left: 2px;","attrib-empty":"display: none;","ctrl-logo":'display:block; width: 21px; height: 21px; background-image: url(\'data:image/svg+xml;charset=utf-8,%3C?xml version="1.0" encoding="utf-8"?%3E %3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 21 21" style="enable-background:new 0 0 21 21;" xml:space="preserve"%3E%3Cg transform="translate(0,0.01)"%3E%3Cpath d="m 10.5,1.24 c -5.11,0 -9.25,4.15 -9.25,9.25 0,5.1 4.15,9.25 9.25,9.25 5.1,0 9.25,-4.15 9.25,-9.25 0,-5.11 -4.14,-9.25 -9.25,-9.25 z m 4.39,11.53 c -1.93,1.93 -4.78,2.31 -6.7,2.31 -0.7,0 -1.41,-0.05 -2.1,-0.16 0,0 -1.02,-5.64 2.14,-8.81 0.83,-0.83 1.95,-1.28 3.13,-1.28 1.27,0 2.49,0.51 3.39,1.42 1.84,1.84 1.89,4.75 0.14,6.52 z" style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3Cpath d="M 10.5,-0.01 C 4.7,-0.01 0,4.7 0,10.49 c 0,5.79 4.7,10.5 10.5,10.5 5.8,0 10.5,-4.7 10.5,-10.5 C 20.99,4.7 16.3,-0.01 10.5,-0.01 Z m 0,19.75 c -5.11,0 -9.25,-4.15 -9.25,-9.25 0,-5.1 4.14,-9.26 9.25,-9.26 5.11,0 9.25,4.15 9.25,9.25 0,5.13 -4.14,9.26 -9.25,9.26 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpath d="M 14.74,6.25 C 12.9,4.41 9.98,4.35 8.23,6.1 5.07,9.27 6.09,14.91 6.09,14.91 c 0,0 5.64,1.02 8.81,-2.14 C 16.64,11 16.59,8.09 14.74,6.25 Z m -2.27,4.09 -0.91,1.87 -0.9,-1.87 -1.86,-0.91 1.86,-0.9 0.9,-1.87 0.91,1.87 1.86,0.9 z" style="opacity:0.35;enable-background:new" class="st1"/%3E%3Cpolygon points="11.56,12.21 10.66,10.34 8.8,9.43 10.66,8.53 11.56,6.66 12.47,8.53 14.33,9.43 12.47,10.34 " style="opacity:0.9;fill:%23ffffff;enable-background:new" class="st0"/%3E%3C/g%3E%3C/svg%3E\')'}}}}),ub=p({"src/plots/mapbox/layout_attributes.js"(e,t){var r=st(),n=q().defaultLine,i=ka().attributes,a=D(),o=wn().textposition,s=Le().overrideAll,l=gt().templatedArray,c=cb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("mapbox",".layers",!0)],domain:i({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:c.styleValuesMapbox.concat(c.styleValuesNonMapbox),dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),hb=p({"src/traces/scattermapbox/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=ub(),l=N(),c=Lt(),u=R().extendFlat,h=Le().overrideAll,p=ub(),d=a.line,f=a.marker;t.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),pb=p({"src/traces/scattermapbox/constants.js"(e,t){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),db=p({"src/traces/scattermapbox/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Xn(),s=Yn(),l=hb(),c=pb().isSupportedFont;t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,l,n,i)}function d(n,i){return r.coerce2(e,t,l,n,i)}var f=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,p);if(f){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(t)){i(e,t,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),y=d("cluster.step"),v=d("cluster.color",t.marker&&t.marker.color||u),x=d("cluster.size"),b=d("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(t)){var _=h.font.family;o(e,t,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==t.fill&&s(e,t,u,p),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),fb=p({"src/traces/scattermapbox/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),mb=p({"src/plots/mapbox/convert_text_opts.js"(e,t){var r=st();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),gb=p({"src/traces/scattermapbox/convert.js"(e,t){var r=k(),n=st(),i=T().BADNUM,a=Qm(),o=Wt(),s=Jt(),l=Zt(),c=$t(),u=pb().isSupportedFont,h=mb(),p=Xt().appendArrayPointValue,d=At().NEWLINES,f=At().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i<e.length;i++)r.push(t[i-1],e[i])}else r=e;return r}function b(e){var t=e.textfont,r=t.family,n=t.style,i=t.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),P=m("line"),L=m("circle"),I=m("symbol"),z={fill:C,line:P,circle:L,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),k&&(P.geojson=a.makeLine(i),P.layout.visibility="visible",n.extendFlat(P.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,p=u.selectedpoints,d=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}function y(e){return e/2}d&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var x,b=[];for(t=0;t<e.length;t++){var _=e[t],w=_.lonlat;if(!v(w)){var k={};i&&(k.mcc=_.mcc=i(_.mc)),a&&(k.mrc=_.mrc=a(_.ms)),c&&(k.mo=c(_.mo)),p&&(k.selected=_.selected||0),b.push({type:"Feature",id:t+1,geometry:{type:"Point",coordinates:w},properties:k})}}if(p)for(x=s.makeSelectedPointStyleFns(u),t=0;t<b.length;t++){var T=b[t].properties;x.selectedOpacityFn&&(T.mo=g(x.selectedOpacityFn(T))),x.selectedColorFn&&(T.mcc=x.selectedColorFn(T)),x.selectedSizeFn&&(T.mrc=x.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:b},mcc:d||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:f||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(t);L.geojson=O.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":b(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(A&&E&&(L.filter=["!",["has","point_count"]]),(M||S)&&(I.geojson=function(e,t){for(var r=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<e.length;x++){var b=e[x];if(!v(b.lonlat)){var _,w=i.texttemplate;if(w){var k=Array.isArray(w)?w[x]||"":w,T=i._module.formatLabels(b,i,r),S={};p(S,i,b.i);var A=i._meta||{};_=n.texttemplateString(k,T,r._d3locale,S,b,A)}else _=h(x);_&&(_=_.replace(d,"").replace(f,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:b.lonlat},properties:{symbol:l(x),angle:u(x),text:_}})}}return{type:"FeatureCollection",features:m}}(t,e),n.extendFlat(I.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),M&&(n.extendFlat(I.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(I.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),I.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(I.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),S)){var R=(u.marker||{}).size,D=h(u.textposition,R);n.extendFlat(I.layout,{"text-size":u.textfont.size,"text-anchor":D.anchor,"text-offset":D.offset,"text-font":b(u)}),n.extendFlat(I.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),yb=p({"src/traces/scattermapbox/plot.js"(e,t){var r=st(),n=gb(),i=cb().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(e,t,r,n){this.type="scattermapbox",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:i+t+"-fill",line:i+t+"-line",circle:i+t+"-circle",symbol:i+t+"-symbol",cluster:i+t+"-cluster",clusterCount:i+t+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(e,t,n){var i={type:"geojson",data:t.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},s.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},s.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(e){var t=e[0].trace,r=this.subplot,i=r.map,o=n(r.gd,e),s=r.belowLookup["trace-"+this.uid],l=!(!t.cluster||!t.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(e){c?function(e){for(var t=a.cluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function p(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(e):function(e){for(var t=a.nonCluster,r=0;r<t.length;r++){var n=t[r],i=o[n];e||u.addSource(n,i),u.addLayer(n,i,s)}}(e)}function d(){for(var e=l?a.cluster:a.nonCluster,t=0;t<e.length;t++){var n=e[t],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}var f=this.isHidden,m=!0!==t.visible;m?f||h():f?m||p():c!==l?(h(),p()):this.below!==s?(h(!0),p(!0),d()):d(),this.clusterEnabled=l,this.isHidden=m,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),p=n(e.gd,t),d=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r<a.cluster.length;r++)s=p[i=a.cluster[r]],h.addLayer(i,s,d);else for(r=0;r<a.nonCluster.length;r++)s=p[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,d);return t[0].trace._glTrace=h,h}}}),vb=p({"src/traces/scattermapbox/hover.js"(e,t){var r=zr(),n=st(),i=mi(),a=n.fillText,o=T().BADNUM,s=cb().traceLayerPrefix;function l(e,t,r){if(!e.hovertemplate){var n=(t.hi||e.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=t.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(t,e,c),c.join("<br>")}function u(e){return e+"\xb0"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,p=e.ya,d=e.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=d.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o)return 1/0;if(g&&-1===f.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=d.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var b=c[e.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=p.c2p(w),S=b.mrc||1;e.x0=k-S,e.x1=k+S,e.y0=T-S,e.y1=T+S;var A={};A[u.subplot]={_subplot:d};var M=u._module.formatLabels(b,u,A);return e.lonLabel=M.lonLabel,e.latLabel=M.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),xb=p({"src/traces/scattermapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),bb=p({"src/traces/scattermapbox/select.js"(e,t){var r=st(),n=$t(),i=T().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],p=h.lonlat;if(p[0]!==i){var d=[r.modHalf(p[0],360),p[1]],f=[s.c2p(d),l.c2p(d)];t.contains(f,null,a,e)?(c.push({pointNumber:a,lon:p[0],lat:p[1]}),h.selected=1):h.selected=0}}return c}}}),_b=p({"node_modules/@plotly/mapbox-gl/dist/mapbox-gl-unminified.js"(e,t){var r,n;r=e,n=function(){var e,t,r;function n(n,i){if(e)if(t){var a="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",o={};e(o),r=i(o),"undefined"!==typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else t=i;else e=i}return n(0,(function(e){function t(e,t){return e(t={exports:{}},t.exports),t.exports}var r="1.13.4",n=i;function i(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=n,this.p2x=r,this.p2y=n}i.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},i.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},i.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},i.prototype.solveCurveX=function(e,t){var r,n,i,a,o;for("undefined"===typeof t&&(t=1e-6),i=e,o=0;o<8;o++){if(a=this.sampleCurveX(i)-e,Math.abs(a)<t)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=a/s}if((i=e)<(r=0))return r;if(i>(n=1))return n;for(;r<n;){if(a=this.sampleCurveX(i),Math.abs(a-e)<t)return i;e>a?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var a=o;function o(e,t){this.x=e,this.y=t}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),a=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=a,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(e){return e instanceof o?e:Array.isArray(e)?new o(e[0],e[1]):e};var s="undefined"!==typeof self?self:{},l=Math.pow(2,53)-1;function c(e,t,r,i){var a=new n(e,t,r,i);return function(e){return a.solve(e)}}var u=c(.25,.1,.25,1);function h(e,t,r){return Math.min(r,Math.max(t,e))}function p(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function d(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n<i.length;n+=1){var a=i[n];for(var o in a)e[o]=a[o]}return e}var f=1;function m(){return f++}function g(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function y(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function v(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function x(e,t){return-1!==e.indexOf(t,e.length-t.length)}function b(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function _(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function w(e){return Array.isArray(e)?e.map(w):"object"===typeof e&&e?b(e,w):e}var k={};function T(e){k[e]||("undefined"!==typeof console&&console.warn(e),k[e]=!0)}function S(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function A(e){for(var t=0,r=0,n=e.length,i=n-1,a=void 0,o=void 0;r<n;i=r++)a=e[r],t+=((o=e[i]).x-a.x)*(a.y+o.y);return t}function M(){return"undefined"!==typeof WorkerGlobalScope&&"undefined"!==typeof self&&self instanceof WorkerGlobalScope}function E(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(e,r,n,i){var a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var C=null;function P(e){if(null==C){var t=e.navigator?e.navigator.userAgent:null;C=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return C}function L(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}var I,z,O,R,D=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),j=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,F=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,B={now:D,frame:function(e){var t=j(e);return{cancel:function(){return F(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return I||(I=s.document.createElement("a")),I.href=e,I.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==z&&(z=s.matchMedia("(prefers-reduced-motion: reduce)")),z.matches)}},N={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},U={supported:!1,testSupport:function(e){!V&&R&&(q?H(e):O=e)}},V=!1,q=!1;function H(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,R),e.isContextLost())return;U.supported=!0}catch(r){}e.deleteTexture(t),V=!0}s.document&&((R=s.document.createElement("img")).onload=function(){O&&H(O),O=null,q=!0},R.onerror=function(){V=!0,O=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var G="01",W=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function $(e){return 0===e.indexOf("mapbox:")}W.prototype._createSkuToken=function(){var e=function(){for(var e="",t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",G,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},W.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},W.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},W.prototype.normalizeStyleURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeGlyphsURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSourceURL=function(e,t){if(!$(e))return e;var r=K(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},W.prototype.normalizeSpriteURL=function(e,t,r,n){var i=K(e);return $(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,J(i))},W.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!$(e))return e;var r=K(e),n=B.devicePixelRatio>=2||512===t?"@2x":"",i=U.supported?".webp":"$1";r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,""+n+i),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(r.params)||N.ACCESS_TOKEN;return N.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},W.prototype.canonicalizeTileURL=function(e,t){var r=K(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var n="mapbox://tiles/";n+=r.path.replace("/v4/","");var i=r.params;return t&&(i=i.filter((function(e){return!e.match(/^access_token=/)}))),i.length&&(n+="?"+i.join("&")),n},W.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&$(t),n=[],i=0,a=e.tiles||[];i<a.length;i+=1){var o=a[i];X(o)?n.push(this.canonicalizeTileURL(o,r)):n.push(o)}return n},W.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(N.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){var i=e.params.indexOf("secure");i>=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!N.REQUIRE_ACCESS_TOKEN)return J(e);if(!(t=t||N.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),J(e)};var Z=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function X(e){return Z.test(e)}var Y=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(e){var t=e.match(Y);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function J(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}var Q="mapbox.eventData";function ee(e){if(!e)return null;var t,r=e.split(".");if(!r||3!==r.length)return null;try{return JSON.parse((t=r[1],decodeURIComponent(s.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))))}catch(n){return null}}var te=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};te.prototype.getStorageKey=function(e){var t,r=ee(N.ACCESS_TOKEN),n="";return r&&r.u?(t=r.u,n=s.btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))):n=N.ACCESS_TOKEN||"",e?Q+"."+e+":"+n:Q+":"+n},te.prototype.fetchEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var n=s.localStorage.getItem(t);n&&(this.eventData=JSON.parse(n));var i=s.localStorage.getItem(r);i&&(this.anonId=i)}catch(a){T("Unable to read from LocalStorage")}},te.prototype.saveEventData=function(){var e=L("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{s.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){T("Unable to write to LocalStorage")}},te.prototype.processRequests=function(e){},te.prototype.postEvent=function(e,t,n,i){var a=this;if(N.EVENTS_URL){var o=K(N.EVENTS_URL);o.params.push("access_token="+(i||N.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:G,userId:this.anonId},l=t?d(s,t):s,c={url:J(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Se(c,(function(e){a.pendingRequest=null,n(e),a.saveEventData(),a.processRequests(i)}))}},te.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var re,ne,ie=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(N.EVENTS_URL&&n||N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return $(e)||X(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),y(this.anonId)||(this.anonId=g()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(te),ae=new(function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){N.EVENTS_URL&&N.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return $(e)||X(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=ee(N.ACCESS_TOKEN),n=r?r.u:N.ACCESS_TOKEN,i=n!==this.eventData.tokenU;y(this.anonId)||(this.anonId=g(),i=!0);var a=this.queue.shift();if(this.eventData.lastSuccess){var o=new Date(this.eventData.lastSuccess),s=new Date(a),l=(a-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||o.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(a,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=a,t.eventData.tokenU=n)}),e)}},t}(te)),oe=ae.postTurnstileEvent.bind(ae),se=new ie,le=se.postMapLoadEvent.bind(se),ce="mapbox-tiles",ue=500,he=50;function pe(){s.caches&&!re&&(re=s.caches.open(ce))}function de(e,t,r){if(pe(),re){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=E(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===ne)try{new Response(new ReadableStream),ne=!0}catch(r){ne=!1}ne?t(e.body):e.blob().then(t)}(t,(function(t){var r=new s.Response(t,n);pe(),re&&re.then((function(t){return t.put(fe(e.url),r)})).catch((function(e){return T(e.message)}))})))}}function fe(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function me(e,t){if(pe(),!re)return t(null);var r=fe(e.url);re.then((function(e){e.match(r).then((function(n){var i=function(e){if(!e)return!1;var t=new Date(e.headers.get("Expires")||0),r=E(e.headers.get("Cache-Control")||"");return t>Date.now()&&!r["no-cache"]}(n);e.delete(r),i&&e.put(r,n.clone()),t(null,n,i)})).catch(t)})).catch(t)}var ge,ye=1/0;function ve(){return null==ge&&(ge=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"===typeof s.createImageBitmap),ge}var xe={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(xe);var be=function(e){function t(t,r,n){401===r&&X(n)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,t),this.status=r,this.url=n,this.name=this.constructor.name,this.message=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),_e=M()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href};function we(e,t){var r,n=new s.AbortController,i=new s.Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:_e(),signal:n.signal}),a=!1,o=!1,l=(r=i.url).indexOf("sku=")>0&&X(r);"json"===e.type&&i.headers.set("Accept","application/json");var c=function(r,n,a){if(!o){if(r&&"SecurityError"!==r.message&&T(r),n&&a)return u(n);var c=Date.now();s.fetch(i).then((function(r){if(r.ok){var n=l?r.clone():null;return u(r,n,c)}return t(new be(r.statusText,r.status,e.url))})).catch((function(e){20!==e.code&&t(new Error(e.message))}))}},u=function(r,n,s){("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((function(e){o||(n&&s&&de(i,n,s),a=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(e){o||t(new Error(e.message))}))};return l?me(i,c):c(null,null),{cancel:function(){o=!0,a||n.abort()}}}var ke=function(e,t){if(r=e.url,!(/^file:/.test(r)||/^file:/.test(_e())&&!/^\w+:/.test(r))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return we(e,t);if(M()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){var r=new s.XMLHttpRequest;for(var n in r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer"),e.headers)r.setRequestHeader(n,e.headers[n]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=function(){t(new Error(r.statusText))},r.onload=function(){if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new be(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}(e,t)},Te=function(e,t){return ke(d(e,{type:"arrayBuffer"}),t)},Se=function(e,t){return ke(d(e,{method:"POST"}),t)};function Ae(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var Me,Ee,Ce="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Me=[],Ee=0;var Pe=function(e,t){if(U.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Ee>=N.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return Me.push(r),r}Ee++;var n=!1,i=function(){if(!n)for(n=!0,Ee--;Me.length&&Ee<N.MAX_PARALLEL_IMAGE_REQUESTS;){var e=Me.shift(),t=e.requestParameters,r=e.callback;e.cancelled||(e.cancel=Pe(t,r).cancel)}},a=Te(e,(function(e,r,n,a){i(),e?t(e):r&&(ve()?function(e,t){var r=new s.Blob([new Uint8Array(e)],{type:"image/png"});s.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(e){t(new Error("Could not load image because of "+e.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(r,t):function(e,t,r,n){var i=new s.Image,a=s.URL;i.onload=function(){t(null,i),a.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((function(){i.src=Ce}))},i.onerror=function(){return t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var o=new s.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?a.createObjectURL(o):Ce}(r,t,n,a))}));return{cancel:function(){a.cancel(),i()}}};function Le(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Ie(e,t,r){if(r&&r[e]){var n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}var ze=function(e,t){void 0===t&&(t={}),d(this,t),this.type=e},Oe=function(e){function t(t,r){void 0===r&&(r={}),e.call(this,"error",d({error:t},r))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(ze),Re=function(){};Re.prototype.on=function(e,t){return this._listeners=this._listeners||{},Le(e,t,this._listeners),this},Re.prototype.off=function(e,t){return Ie(e,t,this._listeners),Ie(e,t,this._oneTimeListeners),this},Re.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},Le(e,t,this._oneTimeListeners),this},Re.prototype.fire=function(e,t){"string"===typeof e&&(e=new ze(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var n=0,i=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];n<i.length;n+=1)i[n].call(this,e);for(var a=0,o=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];a<o.length;a+=1){var s=o[a];Ie(r,s,this._oneTimeListeners),s.call(this,e)}var l=this._eventedParent;l&&(d(e,"function"===typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(e))}else e instanceof Oe&&console.error(e.error);return this},Re.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},Re.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var De={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},je=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function Fe(e){var t=e.key,r=e.value;return r?[new je(t,r,"constants have been deprecated as of v8")]:[]}function Be(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n<i.length;n+=1){var a=i[n];for(var o in a)e[o]=a[o]}return e}function Ne(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Ue(e){if(Array.isArray(e))return e.map(Ue);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=Ue(e[r]);return t}return Ne(e)}var Ve=function(e){function t(t,r){e.call(this,r),this.message=r,this.key=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),qe=function(e,t){void 0===t&&(t=[]),this.parent=e,this.bindings={};for(var r=0,n=t;r<n.length;r+=1){var i=n[r],a=i[0],o=i[1];this.bindings[a]=o}};qe.prototype.concat=function(e){return new qe(this,e)},qe.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},qe.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var He={kind:"null"},Ge={kind:"number"},We={kind:"string"},$e={kind:"boolean"},Ze={kind:"color"},Xe={kind:"object"},Ye={kind:"value"},Ke={kind:"collator"},Je={kind:"formatted"},Qe={kind:"resolvedImage"};function et(e,t){return{kind:"array",itemType:e,N:t}}function tt(e){if("array"===e.kind){var t=tt(e.itemType);return"number"===typeof e.N?"array<"+t+", "+e.N+">":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var rt=[He,Ge,We,$e,Ze,Je,Xe,et(Ye),Qe];function nt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!nt(e.itemType,t.itemType))&&("number"!==typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(var r=0,n=rt;r<n.length;r+=1)if(!nt(n[r],t))return null}return"Expected "+tt(e)+" but found "+tt(t)+" instead."}function it(e,t){return t.some((function(t){return t.kind===e.kind}))}function at(e,t){return t.some((function(t){return"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"===typeof e:t===typeof e}))}var ot=t((function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(e){return(e=Math.round(e))<0?0:e>255?255:e}function i(e){return e<0?0:e>1?1:e}function a(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function o(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{t.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),h=i.substr(l+1,c-(l+1)).split(","),p=1;switch(u){case"rgba":if(4!==h.length)return null;p=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),p];case"hsla":if(4!==h.length)return null;p=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,f=o(h[1]),m=o(h[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[n(255*s(y,g,d+1/3)),n(255*s(y,g,d)),n(255*s(y,g,d-1/3)),p];default:return null}}return null}}catch(l){}})).parseCSSColor,st=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};st.parse=function(e){if(e){if(e instanceof st)return e;if("string"===typeof e){var t=ot(e);if(t)return new st(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},st.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},st.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},st.black=new st(0,0,0,1),st.white=new st(1,1,1,1),st.transparent=new st(0,0,0,0),st.red=new st(1,0,0,1);var lt=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};lt.prototype.compare=function(e,t){return this.collator.compare(e,t)},lt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ct=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},ut=function(e){this.sections=e};ut.fromString=function(e){return new ut([new ct(e,null,null,null,null)])},ut.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},ut.factory=function(e){return e instanceof ut?e:ut.fromString(e)},ut.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},ut.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];if(n.image)e.push(["image",n.image.name]);else{e.push(n.text);var i={};n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),e.push(i)}}return e};var ht=function(e){this.name=e.name,this.available=e.available};function pt(e,t,r,n){return"number"===typeof e&&e>=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function dt(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof st)return!0;if(e instanceof lt)return!0;if(e instanceof ut)return!0;if(e instanceof ht)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!dt(r[t]))return!1;return!0}if("object"===typeof e){for(var n in e)if(!dt(e[n]))return!1;return!0}return!1}function ft(e){if(null===e)return He;if("string"===typeof e)return We;if("boolean"===typeof e)return $e;if("number"===typeof e)return Ge;if(e instanceof st)return Ze;if(e instanceof lt)return Ke;if(e instanceof ut)return Je;if(e instanceof ht)return Qe;if(Array.isArray(e)){for(var t,r=e.length,n=0,i=e;n<i.length;n+=1){var a=ft(i[n]);if(t){if(t===a)continue;t=Ye;break}t=a}return et(t||Ye,r)}return Xe}function mt(e){var t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof st||e instanceof ut||e instanceof ht?e.toString():JSON.stringify(e)}ht.prototype.toString=function(){return this.name},ht.fromString=function(e){return e?new ht({name:e,available:!1}):null},ht.prototype.serialize=function(){return["image",this.name]};var gt=function(e,t){this.type=e,this.value=t};gt.parse=function(e,t){if(2!==e.length)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!dt(e[1]))return t.error("invalid value");var r=e[1],n=ft(r),i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"===typeof i.N&&0!==i.N||(n=i),new gt(n,r)},gt.prototype.evaluate=function(){return this.value},gt.prototype.eachChild=function(){},gt.prototype.outputDefined=function(){return!0},gt.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof st?["rgba"].concat(this.value.toArray()):this.value instanceof ut?this.value.serialize():this.value};var yt=function(e){this.name="ExpressionEvaluationError",this.message=e};yt.prototype.toJSON=function(){return this.message};var vt={string:We,number:Ge,boolean:$e,object:Xe},xt=function(e,t){this.type=e,this.args=t};xt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,n=1,i=e[0];if("array"===i){var a,o;if(e.length>2){var s=e[1];if("string"!==typeof s||!(s in vt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);a=vt[s],n++}else a=Ye;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],n++}r=et(a,o)}else r=vt[i];for(var l=[];n<e.length;n++){var c=t.parse(e[n],n,Ye);if(!c)return null;l.push(c)}return new xt(r,l)},xt.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!nt(this.type,ft(r)))return r;if(t===this.args.length-1)throw new yt("Expected value to be of type "+tt(this.type)+", but found "+tt(ft(r))+" instead.")}return null},xt.prototype.eachChild=function(e){this.args.forEach(e)},xt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},xt.prototype.serialize=function(){var e=this.type,t=[e.kind];if("array"===e.kind){var r=e.itemType;if("string"===r.kind||"number"===r.kind||"boolean"===r.kind){t.push(r.kind);var n=e.N;("number"===typeof n||this.args.length>1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var bt=function(e){this.type=Je,this.sections=e};bt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,a=1;a<=e.length-1;++a){var o=e[a];if(i&&"object"===typeof o&&!Array.isArray(o)){i=!1;var s=null;if(o["font-scale"]&&!(s=t.parse(o["font-scale"],1,Ge)))return null;var l=null;if(o["text-font"]&&!(l=t.parse(o["text-font"],1,et(We))))return null;var c=null;if(o["text-color"]&&!(c=t.parse(o["text-color"],1,Ze)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var h=t.parse(e[a],1,Ye);if(!h)return null;var p=h.type.kind;if("string"!==p&&"value"!==p&&"null"!==p&&"resolvedImage"!==p)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new bt(n)},bt.prototype.evaluate=function(e){return new ut(this.sections.map((function(t){var r=t.content.evaluate(e);return ft(r)===Qe?new ct("",r,null,null,null):new ct(mt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))},bt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e(n.content),n.scale&&e(n.scale),n.font&&e(n.font),n.textColor&&e(n.textColor)}},bt.prototype.outputDefined=function(){return!1},bt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var n=r[t];e.push(n.content.serialize());var i={};n.scale&&(i["font-scale"]=n.scale.serialize()),n.font&&(i["text-font"]=n.font.serialize()),n.textColor&&(i["text-color"]=n.textColor.serialize()),e.push(i)}return e};var _t=function(e){this.type=Qe,this.input=e};_t.parse=function(e,t){if(2!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,We);return r?new _t(r):t.error("No image name provided.")},_t.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=ht.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},_t.prototype.eachChild=function(e){e(this.input)},_t.prototype.outputDefined=function(){return!1},_t.prototype.serialize=function(){return["image",this.input.serialize()]};var wt={"to-boolean":$e,"to-color":Ze,"to-number":Ge,"to-string":We},kt=function(e,t){this.type=e,this.args=t};kt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=wt[r],i=[],a=1;a<e.length;a++){var o=t.parse(e[a],a,Ye);if(!o)return null;i.push(o)}return new kt(n,i)},kt.prototype.evaluate=function(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){for(var t,r,n=0,i=this.args;n<i.length;n+=1){if(r=null,(t=i[n].evaluate(e))instanceof st)return t;if("string"===typeof t){var a=e.parseColor(t);if(a)return a}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":pt(t[0],t[1],t[2],t[3])))return new st(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new yt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var o=null,s=0,l=this.args;s<l.length;s+=1){if(null===(o=l[s].evaluate(e)))return 0;var c=Number(o);if(!isNaN(c))return c}throw new yt("Could not convert "+JSON.stringify(o)+" to number.")}return"formatted"===this.type.kind?ut.fromString(mt(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?ht.fromString(mt(this.args[0].evaluate(e))):mt(this.args[0].evaluate(e))},kt.prototype.eachChild=function(e){this.args.forEach(e)},kt.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},kt.prototype.serialize=function(){if("formatted"===this.type.kind)return new bt([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new _t(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild((function(t){e.push(t.serialize())})),e};var Tt=["Unknown","Point","LineString","Polygon"],St=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};St.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},St.prototype.geometryType=function(){return this.feature?"number"===typeof this.feature.type?Tt[this.feature.type]:this.feature.type:null},St.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},St.prototype.canonicalID=function(){return this.canonical},St.prototype.properties=function(){return this.feature&&this.feature.properties||{}},St.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=st.parse(e)),t};var At=function(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n};At.prototype.evaluate=function(e){return this._evaluate(e,this.args)},At.prototype.eachChild=function(e){this.args.forEach(e)},At.prototype.outputDefined=function(){return!1},At.prototype.serialize=function(){return[this.name].concat(this.args.map((function(e){return e.serialize()})))},At.parse=function(e,t){var r,n=e[0],i=At.definitions[n];if(!i)return t.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var a=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=o.filter((function(t){var r=t[0];return!Array.isArray(r)||r.length===e.length-1})),l=null,c=0,u=s;c<u.length;c+=1){var h=u[c],p=h[0],d=h[1];l=new Yt(t.registry,t.path,null,t.scope);for(var f=[],m=!1,g=1;g<e.length;g++){var y=e[g],v=Array.isArray(p)?p[g-1]:p.type,x=l.parse(y,1+f.length,v);if(!x){m=!0;break}f.push(x)}if(!m)if(Array.isArray(p)&&p.length!==f.length)l.error("Expected "+p.length+" arguments, but found "+f.length+" instead.");else{for(var b=0;b<f.length;b++){var _=Array.isArray(p)?p[b]:p.type,w=f[b];l.concat(b+1).checkSubtype(_,w.type)}if(0===l.errors.length)return new At(n,a,d,f)}}if(1===s.length)(r=t.errors).push.apply(r,l.errors);else{for(var k=(s.length?s:o).map((function(e){var t,r=e[0];return t=r,Array.isArray(t)?"("+t.map(tt).join(", ")+")":"("+tt(t.type)+"...)"})).join(" | "),T=[],S=1;S<e.length;S++){var A=t.parse(e[S],1+T.length);if(!A)return null;T.push(tt(A.type))}t.error("Expected arguments of type "+k+", but found ("+T.join(", ")+") instead.")}return null},At.register=function(e,t){for(var r in At.definitions=t,t)e[r]=At};var Mt=function(e,t,r){this.type=Ke,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};Mt.parse=function(e,t){if(2!==e.length)return t.error("Expected one argument.");var r=e[1];if("object"!==typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");var n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,$e);if(!n)return null;var i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,$e);if(!i)return null;var a=null;return r.locale&&!(a=t.parse(r.locale,1,We))?null:new Mt(n,i,a)},Mt.prototype.evaluate=function(e){return new lt(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Mt.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Mt.prototype.outputDefined=function(){return!1},Mt.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var Et=8192;function Ct(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Pt(e,t){return!(e[0]<=t[0])&&!(e[2]>=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function Lt(e,t){var r,n=(180+e[0])/360,i=(r=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360),a=Math.pow(2,t.z);return[Math.round(n*a*Et),Math.round(i*a*Et)]}function It(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i===0&&n*a<=0&&i*o<=0}function zt(e,t){for(var r,n,i,a=!1,o=0,s=t.length;o<s;o++)for(var l=t[o],c=0,u=l.length;c<u-1;c++){if(It(e,l[c],l[c+1]))return!1;r=e,n=l[c],i=l[c+1],n[1]>r[1]!==i[1]>r[1]&&r[0]<(i[0]-n[0])*(r[1]-n[1])/(i[1]-n[1])+n[0]&&(a=!a)}return a}function Ot(e,t){for(var r=0;r<t.length;r++)if(zt(e,t[r]))return!0;return!1}function Rt(e,t,r,n){var i=e[0]-r[0],a=e[1]-r[1],o=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],c=n[1]-r[1],u=i*c-l*a,h=o*c-l*s;return u>0&&h<0||u<0&&h>0}function Dt(e,t,r,n){var i,a,o=[t[0]-e[0],t[1]-e[1]],s=[n[0]-r[0],n[1]-r[1]];return 0!==(i=s)[0]*(a=o)[1]-i[1]*a[0]&&!(!Rt(e,t,r,n)||!Rt(r,n,e,t))}function jt(e,t,r){for(var n=0,i=r;n<i.length;n+=1)for(var a=i[n],o=0;o<a.length-1;++o)if(Dt(e,t,a[o],a[o+1]))return!0;return!1}function Ft(e,t){for(var r=0;r<e.length;++r)if(!zt(e[r],t))return!1;for(var n=0;n<e.length-1;++n)if(jt(e[n],e[n+1],t))return!1;return!0}function Bt(e,t){for(var r=0;r<t.length;r++)if(Ft(e,t[r]))return!0;return!1}function Nt(e,t,r){for(var n=[],i=0;i<e.length;i++){for(var a=[],o=0;o<e[i].length;o++){var s=Lt(e[i][o],r);Ct(t,s),a.push(s)}n.push(a)}return n}function Ut(e,t,r){for(var n=[],i=0;i<e.length;i++){var a=Nt(e[i],t,r);n.push(a)}return n}function Vt(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){var i=.5*n,a=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===a&&(a=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=a}Ct(t,e)}function qt(e,t,r,n){for(var i=Math.pow(2,n.z)*Et,a=[n.x*Et,n.y*Et],o=[],s=0,l=e;s<l.length;s+=1)for(var c=0,u=l[s];c<u.length;c+=1){var h=u[c],p=[h.x+a[0],h.y+a[1]];Vt(p,t,r,i),o.push(p)}return o}function Ht(e,t,r,n){for(var i,a=Math.pow(2,n.z)*Et,o=[n.x*Et,n.y*Et],s=[],l=0,c=e;l<c.length;l+=1){for(var u=[],h=0,p=c[l];h<p.length;h+=1){var d=p[h],f=[d.x+o[0],d.y+o[1]];Ct(t,f),u.push(f)}s.push(u)}if(t[2]-t[0]<=a/2){(i=t)[0]=i[1]=1/0,i[2]=i[3]=-1/0;for(var m=0,g=s;m<g.length;m+=1)for(var y=0,v=g[m];y<v.length;y+=1)Vt(v[y],t,r,a)}return s}var Gt=function(e,t){this.type=$e,this.geojson=e,this.geometries=t};function Wt(e){if(e instanceof At){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof Gt)return!1;var t=!0;return e.eachChild((function(e){t&&!Wt(e)&&(t=!1)})),t}function $t(e){if(e instanceof At&&"feature-state"===e.name)return!1;var t=!0;return e.eachChild((function(e){t&&!$t(e)&&(t=!1)})),t}function Zt(e,t){if(e instanceof At&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Zt(e,t)&&(r=!1)})),r}Gt.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(dt(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;n<r.features.length;++n){var i=r.features[n].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new Gt(r,r.features[n].geometry)}else if("Feature"===r.type){var a=r.geometry.type;if("Polygon"===a||"MultiPolygon"===a)return new Gt(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Gt(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Gt.prototype.evaluate=function(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){var a=Nt(t.coordinates,n,i),o=qt(e.geometry(),r,n,i);if(!Pt(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!zt(l[s],a))return!1}if("MultiPolygon"===t.type){var c=Ut(t.coordinates,n,i),u=qt(e.geometry(),r,n,i);if(!Pt(r,n))return!1;for(var h=0,p=u;h<p.length;h+=1)if(!Ot(p[h],c))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){var r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){var a=Nt(t.coordinates,n,i),o=Ht(e.geometry(),r,n,i);if(!Pt(r,n))return!1;for(var s=0,l=o;s<l.length;s+=1)if(!Ft(l[s],a))return!1}if("MultiPolygon"===t.type){var c=Ut(t.coordinates,n,i),u=Ht(e.geometry(),r,n,i);if(!Pt(r,n))return!1;for(var h=0,p=u;h<p.length;h+=1)if(!Bt(p[h],c))return!1}return!0}(e,this.geometries)}return!1},Gt.prototype.eachChild=function(){},Gt.prototype.outputDefined=function(){return!0},Gt.prototype.serialize=function(){return["within",this.geojson]};var Xt=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};Xt.parse=function(e,t){if(2!==e.length||"string"!==typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new Xt(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},Xt.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},Xt.prototype.eachChild=function(){},Xt.prototype.outputDefined=function(){return!1},Xt.prototype.serialize=function(){return["var",this.name]};var Yt=function(e,t,r,n,i){void 0===t&&(t=[]),void 0===n&&(n=new qe),void 0===i&&(i=[]),this.registry=e,this.path=t,this.key=t.map((function(e){return"["+e+"]"})).join(""),this.scope=n,this.errors=i,this.expectedType=r};function Kt(e){if(e instanceof Xt)return Kt(e.boundExpression);if(e instanceof At&&"error"===e.name)return!1;if(e instanceof Mt)return!1;if(e instanceof Gt)return!1;var t=e instanceof kt||e instanceof xt,r=!0;return e.eachChild((function(e){r=t?r&&Kt(e):r&&e instanceof gt})),!!r&&Wt(e)&&Zt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Jt(e,t){for(var r,n,i=e.length-1,a=0,o=i,s=0;a<=o;)if(r=e[s=Math.floor((a+o)/2)],n=e[s+1],r<=t){if(s===i||t<n)return s;a=s+1}else{if(!(r>t))throw new yt("Input is not a number.");o=s-1}return 0}Yt.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Yt.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new xt(t,[e]):"coerce"===r?new kt(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var a=i.parse(e,this);if(!a)return null;if(this.expectedType){var o=this.expectedType,s=a.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==s.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(o,s))return null}else a=r(a,o,t.typeAnnotation||"coerce");else a=r(a,o,t.typeAnnotation||"assert")}if(!(a instanceof gt)&&"resolvedImage"!==a.type.kind&&Kt(a)){var l=new St;try{a=new gt(a.type,a.evaluate(l))}catch(c){return this.error(c.message),null}}return a}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?this.error("'undefined' value invalid. Use null instead."):"object"===typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found "+typeof e+" instead.")},Yt.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Yt(this.registry,n,t||null,i,this.errors)},Yt.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new Ve(n,e))},Yt.prototype.checkSubtype=function(e,t){var r=nt(e,t);return r&&this.error(r),r};var Qt=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n<i.length;n+=1){var a=i[n],o=a[0],s=a[1];this.labels.push(o),this.outputs.push(s)}};function er(e,t,r){return e*(1-r)+t*r}Qt.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,Ge);if(!r)return null;var n=[],i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(var a=1;a<e.length;a+=2){var o=1===a?-1/0:e[a],s=e[a+1],l=a,c=a+1;if("number"!==typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=t.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([o,u])}return new Qt(i,r,n)},Qt.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Jt(t,n)].evaluate(e)},Qt.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Qt.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},Qt.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var tr=Object.freeze({__proto__:null,number:er,color:function(e,t,r){return new st(er(e.r,t.r,r),er(e.g,t.g,r),er(e.b,t.b,r),er(e.a,t.a,r))},array:function(e,t,r){return e.map((function(e,n){return er(e,t[n],r)}))}}),rr=.95047,nr=1.08883,ir=4/29,ar=6/29,or=3*ar*ar,sr=ar*ar*ar,lr=Math.PI/180,cr=180/Math.PI;function ur(e){return e>sr?Math.pow(e,1/3):e/or+ir}function hr(e){return e>ar?e*e*e:or*(e-ir)}function pr(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function dr(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fr(e){var t=dr(e.r),r=dr(e.g),n=dr(e.b),i=ur((.4124564*t+.3575761*r+.1804375*n)/rr),a=ur((.2126729*t+.7151522*r+.072175*n)/1);return{l:116*a-16,a:500*(i-a),b:200*(a-ur((.0193339*t+.119192*r+.9503041*n)/nr)),alpha:e.a}}function mr(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=1*hr(t),r=rr*hr(r),n=nr*hr(n),new st(pr(3.2404542*r-1.5371385*t-.4985314*n),pr(-.969266*r+1.8760108*t+.041556*n),pr(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function gr(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}var yr={forward:fr,reverse:mr,interpolate:function(e,t,r){return{l:er(e.l,t.l,r),a:er(e.a,t.a,r),b:er(e.b,t.b,r),alpha:er(e.alpha,t.alpha,r)}}},vr={forward:function(e){var t=fr(e),r=t.l,n=t.a,i=t.b,a=Math.atan2(i,n)*cr;return{h:a<0?a+360:a,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}},reverse:function(e){var t=e.h*lr,r=e.c;return mr({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:gr(e.h,t.h,r),c:er(e.c,t.c,r),l:er(e.l,t.l,r),alpha:er(e.alpha,t.alpha,r)}}},xr=Object.freeze({__proto__:null,lab:yr,hcl:vr}),br=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var a=0,o=i;a<o.length;a+=1){var s=o[a],l=s[0],c=s[1];this.labels.push(l),this.outputs.push(c)}};function _r(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}br.interpolationFactor=function(e,t,r,i){var a=0;if("exponential"===e.name)a=_r(t,e.base,r,i);else if("linear"===e.name)a=_r(t,1,r,i);else if("cubic-bezier"===e.name){var o=e.controlPoints;a=new n(o[0],o[1],o[2],o[3]).solve(_r(t,1,r,i))}return a},br.parse=function(e,t){var r=e[0],n=e[1],i=e[2],a=e.slice(3);if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var o=n[1];if("number"!==typeof o)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:o}}else{if("cubic-bezier"!==n[0])return t.error("Unknown interpolation type "+String(n[0]),1,0);var s=n.slice(1);if(4!==s.length||s.some((function(e){return"number"!==typeof e||e<0||e>1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,Ge)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=Ze:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u<a.length;u+=2){var h=a[u],p=a[u+1],d=u+3,f=u+4;if("number"!==typeof h)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',d);if(l.length&&l[l.length-1][0]>=h)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',d);var m=t.parse(p,f,c);if(!m)return null;c=c||m.type,l.push([h,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"===typeof c.N?new br(c,r,n,i,l):t.error("Type "+tt(c)+" is not interpolatable.")},br.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var a=Jt(t,n),o=t[a],s=t[a+1],l=br.interpolationFactor(this.interpolation,n,o,s),c=r[a].evaluate(e),u=r[a+1].evaluate(e);return"interpolate"===this.operator?tr[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?vr.reverse(vr.interpolate(vr.forward(c),vr.forward(u),l)):yr.reverse(yr.interpolate(yr.forward(c),yr.forward(u),l))},br.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},br.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))},br.prototype.serialize=function(){var e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var wr=function(e,t){this.type=e,this.args=t};wr.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,n=t.expectedType;n&&"value"!==n.kind&&(r=n);for(var i=[],a=0,o=e.slice(1);a<o.length;a+=1){var s=o[a],l=t.parse(s,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!l)return null;r=r||l.type,i.push(l)}var c=n&&i.some((function(e){return nt(n,e.type)}));return new wr(c?Ye:r,i)},wr.prototype.evaluate=function(e){for(var t,r=null,n=0,i=0,a=this.args;i<a.length&&(n++,(r=a[i].evaluate(e))&&r instanceof ht&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null===r);i+=1);return r},wr.prototype.eachChild=function(e){this.args.forEach(e)},wr.prototype.outputDefined=function(){return this.args.every((function(e){return e.outputDefined()}))},wr.prototype.serialize=function(){var e=["coalesce"];return this.eachChild((function(t){e.push(t.serialize())})),e};var kr=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};kr.prototype.evaluate=function(e){return this.result.evaluate(e)},kr.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},kr.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],n=1;n<e.length-1;n+=2){var i=e[n];if("string"!==typeof i)return t.error("Expected string, but found "+typeof i+" instead.",n);if(/[^a-zA-Z0-9_]/.test(i))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);var a=t.parse(e[n+1],n+1);if(!a)return null;r.push([i,a])}var o=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return o?new kr(r,o):null},kr.prototype.outputDefined=function(){return this.result.outputDefined()},kr.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];e.push(i,a.serialize())}return e.push(this.result.serialize()),e};var Tr=function(e,t,r){this.type=e,this.index=t,this.input=r};Tr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ge),n=t.parse(e[2],2,et(t.expectedType||Ye));if(!r||!n)return null;var i=n.type;return new Tr(i.itemType,r,n)},Tr.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new yt("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new yt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new yt("Array index must be an integer, but found "+t+" instead.");return r[t]},Tr.prototype.eachChild=function(e){e(this.index),e(this.input)},Tr.prototype.outputDefined=function(){return!1},Tr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var Sr=function(e,t){this.type=$e,this.needle=e,this.haystack=t};Sr.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ye);return r&&n?it(r.type,[$e,We,Ge,He,Ye])?new Sr(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead"):null},Sr.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!at(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found "+tt(ft(t))+" instead.");if(!at(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found "+tt(ft(r))+" instead.");return r.indexOf(t)>=0},Sr.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},Sr.prototype.outputDefined=function(){return!0},Sr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Ar=function(e,t,r){this.type=Ge,this.needle=e,this.haystack=t,this.fromIndex=r};Ar.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ye);if(!r||!n)return null;if(!it(r.type,[$e,We,Ge,He,Ye]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+tt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,Ge);return i?new Ar(r,n,i):null}return new Ar(r,n)},Ar.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!at(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found "+tt(ft(t))+" instead.");if(!at(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found "+tt(ft(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},Ar.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Ar.prototype.outputDefined=function(){return!1},Ar.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Mr=function(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a};Mr.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},a=[],o=2;o<e.length-1;o+=2){var s=e[o],l=e[o+1];Array.isArray(s)||(s=[s]);var c=t.concat(o);if(0===s.length)return c.error("Expected at least one branch label.");for(var u=0,h=s;u<h.length;u+=1){var p=h[u];if("number"!==typeof p&&"string"!==typeof p)return c.error("Branch labels must be numbers or strings.");if("number"===typeof p&&Math.abs(p)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof p&&Math.floor(p)!==p)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ft(p)))return null}else r=ft(p);if("undefined"!==typeof i[String(p)])return c.error("Branch labels must be unique.");i[String(p)]=a.length}var d=t.parse(l,o,n);if(!d)return null;n=n||d.type,a.push(d)}var f=t.parse(e[1],1,Ye);if(!f)return null;var m=t.parse(e[e.length-1],e.length-1,n);return m?"value"!==f.type.kind&&t.concat(1).checkSubtype(r,f.type)?null:new Mr(r,n,f,i,a,m):null},Mr.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(ft(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},Mr.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},Mr.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},Mr.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,a=Object.keys(this.cases).sort();i<a.length;i+=1){var o=a[i];void 0===(h=n[this.cases[o]])?(n[this.cases[o]]=r.length,r.push([this.cases[o],[o]])):r[h][1].push(o)}for(var s=function(t){return"number"===e.inputType.kind?Number(t):t},l=0,c=r;l<c.length;l+=1){var u=c[l],h=u[0],p=u[1];1===p.length?t.push(s(p[0])):t.push(p.map(s)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var Er=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};Er.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!==0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);for(var n=[],i=1;i<e.length-1;i+=2){var a=t.parse(e[i],i,$e);if(!a)return null;var o=t.parse(e[i+1],i+1,r);if(!o)return null;n.push([a,o]),r=r||o.type}var s=t.parse(e[e.length-1],e.length-1,r);return s?new Er(r,n,s):null},Er.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];if(i.evaluate(e))return a.evaluate(e)}return this.otherwise.evaluate(e)},Er.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var n=r[t],i=n[0],a=n[1];e(i),e(a)}e(this.otherwise)},Er.prototype.outputDefined=function(){return this.branches.every((function(e){return e[0],e[1].outputDefined()}))&&this.otherwise.outputDefined()},Er.prototype.serialize=function(){var e=["case"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Cr=function(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n};function Pr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Lr(e,t,r,n){return 0===n.compare(t,r)}function Ir(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=$e,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],a=t.parse(e[1],1,Ye);if(!a)return null;if(!Pr(r,a.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+tt(a.type)+"'.");var o=t.parse(e[2],2,Ye);if(!o)return null;if(!Pr(r,o.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+tt(o.type)+"'.");if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot compare types '"+tt(a.type)+"' and '"+tt(o.type)+"'.");n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new xt(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new xt(a.type,[o])));var s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Ke)))return null}return new i(a,o,s)},i.prototype.evaluate=function(i){var a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=ft(a),l=ft(o);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new yt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=ft(a),u=ft(o);if("string"!==c.kind||"string"!==u.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}Cr.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,Ye),n=t.parse(e[2],2,Ge);if(!r||!n)return null;if(!it(r.type,[et(Ye),We,Ye]))return t.error("Expected first argument to be of type array or string, but found "+tt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,Ge);return i?new Cr(r.type,r,n,i):null}return new Cr(r.type,r,n)},Cr.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!at(t,["string","array"]))throw new yt("Expected first argument to be of type array or string, but found "+tt(ft(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},Cr.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},Cr.prototype.outputDefined=function(){return!1},Cr.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var zr=Ir("==",(function(e,t,r){return t===r}),Lr),Or=Ir("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Lr(0,t,r,n)})),Rr=Ir("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Dr=Ir(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),jr=Ir("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Fr=Ir(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0})),Br=function(e,t,r,n,i){this.type=We,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Br.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,Ge);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,We)))return null;var a=null;if(n.currency&&!(a=t.parse(n.currency,1,We)))return null;var o=null;if(n["min-fraction-digits"]&&!(o=t.parse(n["min-fraction-digits"],1,Ge)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,Ge))?null:new Br(r,i,a,o,s)},Br.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},Br.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Br.prototype.outputDefined=function(){return!1},Br.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Nr=function(e){this.type=Ge,this.input=e};Nr.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+tt(r.type)+" instead."):new Nr(r):null},Nr.prototype.evaluate=function(e){var t=this.input.evaluate(e);if("string"===typeof t)return t.length;if(Array.isArray(t))return t.length;throw new yt("Expected value to be of type string or array, but found "+tt(ft(t))+" instead.")},Nr.prototype.eachChild=function(e){e(this.input)},Nr.prototype.outputDefined=function(){return!1},Nr.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Ur={"==":zr,"!=":Or,">":Dr,"<":Rr,">=":Fr,"<=":jr,array:xt,at:Tr,boolean:xt,case:Er,coalesce:wr,collator:Mt,format:bt,image:_t,in:Sr,"index-of":Ar,interpolate:br,"interpolate-hcl":br,"interpolate-lab":br,length:Nr,let:kr,literal:gt,match:Mr,number:xt,"number-format":Br,object:xt,slice:Cr,step:Qt,string:xt,"to-boolean":kt,"to-color":kt,"to-number":kt,"to-string":kt,var:Xt,within:Gt};function Vr(e,t){var r=t[0],n=t[1],i=t[2],a=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var o=a?a.evaluate(e):1,s=pt(r,n,i,o);if(s)throw new yt(s);return new st(r/255*o,n/255*o,i/255*o,o)}function qr(e,t){return e in t}function Hr(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Gr(e){return{type:e}}function Wr(e){return{result:"success",value:e}}function $r(e){return{result:"error",value:e}}function Zr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Xr(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Yr(e){return!!e.expression&&e.expression.interpolated}function Kr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Jr(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function Qr(e){return e}function en(e,t){var r,n,i,a="color"===t.type,o=e.stops&&"object"===typeof e.stops[0][0],s=o||void 0!==e.property,l=o||!s,c=e.type||(Yr(t)?"exponential":"interval");if(a&&((e=Be({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],st.parse(e[1])]}))),e.default?e.default=st.parse(e.default):e.default=st.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)r=an;else if("interval"===c)r=nn;else if("categorical"===c){r=rn,n=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var p=h[u];n[p[0]]=p[1]}i=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');r=on}if(o){for(var d={},f=[],m=0;m<e.stops.length;m++){var g=e.stops[m],y=g[0].zoom;void 0===d[y]&&(d[y]={zoom:y,type:e.type,property:e.property,default:e.default,stops:[]},f.push(y)),d[y].stops.push([g[0].value,g[1]])}for(var v=[],x=0,b=f;x<b.length;x+=1){var _=b[x];v.push([d[_].zoom,en(d[_],t)])}var w={name:"linear"};return{kind:"composite",interpolationType:w,interpolationFactor:br.interpolationFactor.bind(void 0,w),zoomStops:v.map((function(e){return e[0]})),evaluate:function(r,n){var i=r.zoom;return an({stops:v,base:e.base},t,i).evaluate(i,n)}}}if(l){var k="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:k,interpolationFactor:br.interpolationFactor.bind(void 0,k),zoomStops:e.stops.map((function(e){return e[0]})),evaluate:function(a){var o=a.zoom;return r(e,t,o,n,i)}}}return{kind:"source",evaluate:function(a,o){var s=o&&o.properties?o.properties[e.property]:void 0;return void 0===s?tn(e.default,t.default):r(e,t,s,n,i)}}}function tn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function rn(e,t,r,n,i){return tn(typeof r===i?n[r]:void 0,e.default,t.default)}function nn(e,t,r){if("number"!==Kr(r))return tn(e.default,t.default);var n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];var i=Jt(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function an(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==Kr(r))return tn(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var a=Jt(e.stops.map((function(e){return e[0]})),r),o=function(e,t,r,n){var i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=tr[t.type]||Qr;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=xr[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),o))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,o)}}:c(s,l,o)}function on(e,t,r){return"color"===t.type?r=st.parse(r):"formatted"===t.type?r=ut.fromString(r.toString()):"resolvedImage"===t.type?r=ht.fromString(r.toString()):Kr(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),tn(r,e.default,t.default)}At.register(Ur,{error:[{kind:"error"},[We],function(e,t){var r=t[0];throw new yt(r.evaluate(e))}],typeof:[We,[Ye],function(e,t){return tt(ft(t[0].evaluate(e)))}],"to-rgba":[et(Ge,4),[Ze],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ze,[Ge,Ge,Ge],Vr],rgba:[Ze,[Ge,Ge,Ge,Ge],Vr],has:{type:$e,overloads:[[[We],function(e,t){return qr(t[0].evaluate(e),e.properties())}],[[We,Xe],function(e,t){var r=t[0],n=t[1];return qr(r.evaluate(e),n.evaluate(e))}]]},get:{type:Ye,overloads:[[[We],function(e,t){return Hr(t[0].evaluate(e),e.properties())}],[[We,Xe],function(e,t){var r=t[0],n=t[1];return Hr(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[Ye,[We],function(e,t){return Hr(t[0].evaluate(e),e.featureState||{})}],properties:[Xe,[],function(e){return e.properties()}],"geometry-type":[We,[],function(e){return e.geometryType()}],id:[Ye,[],function(e){return e.id()}],zoom:[Ge,[],function(e){return e.globals.zoom}],"heatmap-density":[Ge,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[Ge,[],function(e){return e.globals.lineProgress||0}],accumulated:[Ye,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[Ge,Gr(Ge),function(e,t){for(var r=0,n=0,i=t;n<i.length;n+=1)r+=i[n].evaluate(e);return r}],"*":[Ge,Gr(Ge),function(e,t){for(var r=1,n=0,i=t;n<i.length;n+=1)r*=i[n].evaluate(e);return r}],"-":{type:Ge,overloads:[[[Ge,Ge],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)-n.evaluate(e)}],[[Ge],function(e,t){return-t[0].evaluate(e)}]]},"/":[Ge,[Ge,Ge],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)/n.evaluate(e)}],"%":[Ge,[Ge,Ge],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)%n.evaluate(e)}],ln2:[Ge,[],function(){return Math.LN2}],pi:[Ge,[],function(){return Math.PI}],e:[Ge,[],function(){return Math.E}],"^":[Ge,[Ge,Ge],function(e,t){var r=t[0],n=t[1];return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[Ge,[Ge],function(e,t){var r=t[0];return Math.sqrt(r.evaluate(e))}],log10:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN10}],ln:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))}],log2:[Ge,[Ge],function(e,t){var r=t[0];return Math.log(r.evaluate(e))/Math.LN2}],sin:[Ge,[Ge],function(e,t){var r=t[0];return Math.sin(r.evaluate(e))}],cos:[Ge,[Ge],function(e,t){var r=t[0];return Math.cos(r.evaluate(e))}],tan:[Ge,[Ge],function(e,t){var r=t[0];return Math.tan(r.evaluate(e))}],asin:[Ge,[Ge],function(e,t){var r=t[0];return Math.asin(r.evaluate(e))}],acos:[Ge,[Ge],function(e,t){var r=t[0];return Math.acos(r.evaluate(e))}],atan:[Ge,[Ge],function(e,t){var r=t[0];return Math.atan(r.evaluate(e))}],min:[Ge,Gr(Ge),function(e,t){return Math.min.apply(Math,t.map((function(t){return t.evaluate(e)})))}],max:[Ge,Gr(Ge),function(e,t){return Math.max.apply(Math,t.map((function(t){return t.evaluate(e)})))}],abs:[Ge,[Ge],function(e,t){var r=t[0];return Math.abs(r.evaluate(e))}],round:[Ge,[Ge],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ge,[Ge],function(e,t){var r=t[0];return Math.floor(r.evaluate(e))}],ceil:[Ge,[Ge],function(e,t){var r=t[0];return Math.ceil(r.evaluate(e))}],"filter-==":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1];return e.properties()[r.value]===n.value}],"filter-id-==":[$e,[Ye],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[$e,[We],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<a}],"filter-id-<":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<i}],"filter->":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>a}],"filter-id->":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i<=a}],"filter-id-<=":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[$e,[We,Ye],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],a=n.value;return typeof i===typeof a&&i>=a}],"filter-id->=":[$e,[Ye],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[$e,[Ye],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[$e,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[$e,[et(We)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[$e,[et(Ye)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[$e,[We,et(Ye)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[$e,[We,et(Ye)],function(e,t){var r=t[0],n=t[1];return function(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:$e,overloads:[[[$e,$e],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Gr($e),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(!n[r].evaluate(e))return!1;return!0}]]},any:{type:$e,overloads:[[[$e,$e],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)||n.evaluate(e)}],[Gr($e),function(e,t){for(var r=0,n=t;r<n.length;r+=1)if(n[r].evaluate(e))return!0;return!1}]]},"!":[$e,[$e],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[$e,[We],function(e,t){var r=t[0],n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[We,[We],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[We,[We],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[We,Gr(Ye),function(e,t){return t.map((function(t){return mt(t.evaluate(e))})).join("")}],"resolved-locale":[We,[Ke],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var sn=function(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new St,this._defaultValue=t?"color"===(r=t).type&&Jr(r.default)?new st(0,0,0,0):"color"===r.type?st.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null};function ln(e){return Array.isArray(e)&&e.length>0&&"string"===typeof e[0]&&e[0]in Ur}function cn(e,t){var r=new Yt(Ur,[],t?function(e){var t={color:Ze,string:We,number:Ge,enum:We,boolean:$e,formatted:Je,resolvedImage:Qe};return"array"===e.type?et(t[e.value]||Ye,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Wr(new sn(n,t)):$r(r.errors)}sn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)},sn.prototype.evaluate=function(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{var o=this.expression.evaluate(this._evaluator);if(null===o||void 0===o||"number"===typeof o&&o!==o)return this._defaultValue;if(this._enumValues&&!(o in this._enumValues))throw new yt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(o)+" instead.");return o}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var un=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!$t(t.expression)};un.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},un.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)};var hn=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!$t(t.expression),this.interpolationType=n};function pn(e,t){if("error"===(e=cn(e,t)).result)return e;var r=e.value.expression,n=Wt(r);if(!n&&!Zr(t))return $r([new Ve("","data expressions not supported")]);var i=Zt(r,["zoom"]);if(!i&&!Xr(t))return $r([new Ve("","zoom expressions not supported")]);var a=fn(r);if(!a&&!i)return $r([new Ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof Ve)return $r([a]);if(a instanceof br&&!Yr(t))return $r([new Ve("",'"interpolate" expressions cannot be used with this property')]);if(!a)return Wr(new un(n?"constant":"source",e.value));var o=a instanceof br?a.interpolation:void 0;return Wr(new hn(n?"camera":"composite",e.value,a.labels,o))}hn.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)},hn.prototype.evaluate=function(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)},hn.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?br.interpolationFactor(this.interpolationType,e,t,r):0};var dn=function(e,t){this._parameters=e,this._specification=t,Be(this,en(this._parameters,this._specification))};function fn(e){var t=null;if(e instanceof kr)t=fn(e.result);else if(e instanceof wr)for(var r=0,n=e.args;r<n.length;r+=1){var i=n[r];if(t=fn(i))break}else(e instanceof Qt||e instanceof br)&&e.input instanceof At&&"zoom"===e.input.name&&(t=e);return t instanceof Ve||e.eachChild((function(e){var r=fn(e);r instanceof Ve?t=r:!t&&r?t=new Ve("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new Ve("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function mn(e){var t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=[],l=Kr(r);if("object"!==l)return[new je(t,r,"object expected, "+l+" found")];for(var c in r){var u=c.split(".")[0],h=n[u]||n["*"],p=void 0;if(i[u])p=i[u];else if(n[u])p=Vn;else if(i["*"])p=i["*"];else{if(!n["*"]){s.push(new je(t,r[c],'unknown property "'+c+'"'));continue}p=Vn}s=s.concat(p({key:(t?t+".":t)+c,value:r[c],valueSpec:h,style:a,styleSpec:o,object:r,objectKey:c},r))}for(var d in n)i[d]||n[d].required&&void 0===n[d].default&&void 0===r[d]&&s.push(new je(t,r,'missing required property "'+d+'"'));return s}function gn(e){var t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||Vn;if("array"!==Kr(t))return[new je(a,t,"array expected, "+Kr(t)+" found")];if(r.length&&t.length!==r.length)return[new je(a,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new je(a,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===Kr(r.value)&&(s=r.value);for(var l=[],c=0;c<t.length;c++)l=l.concat(o({array:t,arrayIndex:c,value:t[c],valueSpec:s,style:n,styleSpec:i,key:a+"["+c+"]"}));return l}function yn(e){var t=e.key,r=e.value,n=e.valueSpec,i=Kr(r);return"number"===i&&r!==r&&(i="NaN"),"number"!==i?[new je(t,r,"number expected, "+i+" found")]:"minimum"in n&&r<n.minimum?[new je(t,r,r+" is less than the minimum value "+n.minimum)]:"maximum"in n&&r>n.maximum?[new je(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function vn(e){var t,r,n,i=e.valueSpec,a=Ne(e.value.type),o={},s="categorical"!==a&&void 0===e.value.property,l=!s,c="array"===Kr(e.value.stops)&&"array"===Kr(e.value.stops[0])&&"object"===Kr(e.value.stops[0][0]),u=mn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new je(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(gn({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Kr(r)&&0===r.length&&t.push(new je(e.key,r,"array must have at least one stop")),t},default:function(e){return Vn({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&s&&u.push(new je(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||u.push(new je(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Yr(e.valueSpec)&&u.push(new je(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Zr(e.valueSpec)?u.push(new je(e.key,e.value,"property functions not supported")):s&&!Xr(e.valueSpec)&&u.push(new je(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!c||void 0!==e.value.property||u.push(new je(e.key,e.value,'"property" property is required')),u;function h(e){var t=[],a=e.value,s=e.key;if("array"!==Kr(a))return[new je(s,a,"array expected, "+Kr(a)+" found")];if(2!==a.length)return[new je(s,a,"array length 2 expected, length "+a.length+" found")];if(c){if("object"!==Kr(a[0]))return[new je(s,a,"object expected, "+Kr(a[0])+" found")];if(void 0===a[0].zoom)return[new je(s,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new je(s,a,"object stop key must have value")];if(n&&n>Ne(a[0].zoom))return[new je(s,a[0].zoom,"stop zoom values must appear in ascending order")];Ne(a[0].zoom)!==n&&(n=Ne(a[0].zoom),r=void 0,o={}),t=t.concat(mn({key:s+"[0]",value:a[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:yn,value:p}}))}else t=t.concat(p({key:s+"[0]",value:a[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},a));return ln(Ue(a[1]))?t.concat([new je(s+"[1]",a[1],"expressions are not allowed in function stops.")]):t.concat(Vn({key:s+"[1]",value:a[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=Kr(e.value),l=Ne(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new je(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new je(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==a){var u="number expected, "+s+" found";return Zr(i)&&void 0===a&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new je(e.key,c,u)]}return"categorical"!==a||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===s&&void 0!==r&&l<r?[new je(e.key,c,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in o?[new je(e.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new je(e.key,c,"integer expected, found "+l)]}}function xn(e){var t=("property"===e.expressionContext?pn:cn)(Ue(e.value),e.valueSpec);if("error"===t.result)return t.value.map((function(t){return new je(""+e.key+t.key,e.value,t.message)}));var r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new je(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===e.expressionContext&&"layout"===e.propertyType&&!$t(r))return[new je(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!$t(r))return[new je(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Zt(r,["zoom","feature-state"]))return[new je(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Wt(r))return[new je(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function bn(e){var t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Ne(r))&&i.push(new je(t,r,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(n.values).indexOf(Ne(r))&&i.push(new je(t,r,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(r)+" found")),i}function _n(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!==typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var n=r[t];if(!_n(n)&&"boolean"!==typeof n)return!1}return!0;default:return!0}}dn.deserialize=function(e){return new dn(e._parameters,e._specification)},dn.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var wn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function kn(e){if(null===e||void 0===e)return{filter:function(){return!0},needGeometry:!1};_n(e)||(e=An(e));var t=cn(e,wn);if("error"===t.result)throw new Error(t.value.map((function(e){return e.key+": "+e.message})).join(", "));return{filter:function(e,r,n){return t.value.evaluate(e,r,{},n)},needGeometry:Sn(e)}}function Tn(e,t){return e<t?-1:e>t?1:0}function Sn(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t<e.length;t++)if(Sn(e[t]))return!0;return!1}function An(e){if(!e)return!0;var t,r=e[0];return e.length<=1?"any"!==r:"=="===r?Mn(e[1],e[2],"=="):"!="===r?Pn(Mn(e[1],e[2],"==")):"<"===r||">"===r||"<="===r||">="===r?Mn(e[1],e[2],r):"any"===r?(t=e.slice(1),["any"].concat(t.map(An))):"all"===r?["all"].concat(e.slice(1).map(An)):"none"===r?["all"].concat(e.slice(1).map(An).map(Pn)):"in"===r?En(e[1],e.slice(2)):"!in"===r?Pn(En(e[1],e.slice(2))):"has"===r?Cn(e[1]):"!has"===r?Pn(Cn(e[1])):"within"!==r||e}function Mn(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function En(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Tn)]]:["filter-in-small",e,["literal",t]]}}function Cn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Pn(e){return["!",e]}function Ln(e){return _n(Ue(e.value))?xn(Be({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):In(e)}function In(e){var t=e.value,r=e.key;if("array"!==Kr(t))return[new je(r,t,"array expected, "+Kr(t)+" found")];var n,i=e.styleSpec,a=[];if(t.length<1)return[new je(r,t,"filter array must have at least 1 element")];switch(a=a.concat(bn({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ne(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Ne(t[1])&&a.push(new je(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&a.push(new je(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=Kr(t[1]))&&a.push(new je(r+"[1]",t[1],"string expected, "+n+" found"));for(var o=2;o<t.length;o++)n=Kr(t[o]),"$type"===Ne(t[1])?a=a.concat(bn({key:r+"["+o+"]",value:t[o],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new je(r+"["+o+"]",t[o],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var s=1;s<t.length;s++)a=a.concat(In({key:r+"["+s+"]",value:t[s],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Kr(t[1]),2!==t.length?a.push(new je(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new je(r+"[1]",t[1],"string expected, "+n+" found"));break;case"within":n=Kr(t[1]),2!==t.length?a.push(new je(r,t,'filter array for "'+t[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new je(r+"[1]",t[1],"object expected, "+n+" found"))}return a}function zn(e,t){var r=e.key,n=e.style,i=e.styleSpec,a=e.value,o=e.objectKey,s=i[t+"_"+e.layerType];if(!s)return[];var l=o.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return Vn({key:r,value:a,valueSpec:i.transition,style:n,styleSpec:i});var c,u=e.valueSpec||s[o];if(!u)return[new je(r,a,'unknown property "'+o+'"')];if("string"===Kr(a)&&Zr(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(a)))return[new je(r,a,'"'+o+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&h.push(new je(r,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Jr(Ue(a))&&"identity"===Ne(a.type)&&h.push(new je(r,a,'"text-font" does not support identity functions'))),h.concat(Vn({key:e.key,value:a,valueSpec:u,style:n,styleSpec:i,expressionContext:"property",propertyType:t,propertyKey:o}))}function On(e){return zn(e,"paint")}function Rn(e){return zn(e,"layout")}function Dn(e){var t=[],r=e.value,n=e.key,i=e.style,a=e.styleSpec;r.type||r.ref||t.push(new je(n,r,'either "type" or "ref" is required'));var o,s=Ne(r.type),l=Ne(r.ref);if(r.id)for(var c=Ne(r.id),u=0;u<e.arrayIndex;u++){var h=i.layers[u];Ne(h.id)===c&&t.push(new je(n,r.id,'duplicate layer id "'+r.id+'", previously used at line '+h.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach((function(e){e in r&&t.push(new je(n,r[e],'"'+e+'" is prohibited for ref layers'))})),i.layers.forEach((function(e){Ne(e.id)===l&&(o=e)})),o?o.ref?t.push(new je(n,r.ref,"ref cannot reference another ref layer")):s=Ne(o.type):t.push(new je(n,r.ref,'ref layer "'+l+'" not found'));else if("background"!==s)if(r.source){var p=i.sources&&i.sources[r.source],d=p&&Ne(p.type);p?"vector"===d&&"raster"===s?t.push(new je(n,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===d&&"raster"!==s?t.push(new je(n,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==d||r["source-layer"]?"raster-dem"===d&&"hillshade"!==s?t.push(new je(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===d&&p.lineMetrics||t.push(new je(n,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new je(n,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new je(n,r.source,'source "'+r.source+'" not found'))}else t.push(new je(n,r,'missing required property "source"'));return t=t.concat(mn({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Vn({key:n+".type",value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:Ln,layout:function(e){return mn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return Rn(Be({layerType:s},e))}}})},paint:function(e){return mn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(e){return On(Be({layerType:s},e))}}})}}}))}function jn(e){var t=e.value,r=e.key,n=Kr(t);return"string"!==n?[new je(r,t,"string expected, "+n+" found")]:[]}var Fn={promoteId:function(e){var t=e.key,r=e.value;if("string"===Kr(r))return jn({key:t,value:r});var n=[];for(var i in r)n.push.apply(n,jn({key:t+"."+i,value:r[i]}));return n}};function Bn(e){var t=e.value,r=e.key,n=e.styleSpec,i=e.style;if(!t.type)return[new je(r,t,'"type" is required')];var a,o=Ne(t.type);switch(o){case"vector":case"raster":case"raster-dem":return a=mn({key:r,value:t,valueSpec:n["source_"+o.replace("-","_")],style:e.style,styleSpec:n,objectElementValidators:Fn});case"geojson":if(a=mn({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,objectElementValidators:Fn}),t.cluster)for(var s in t.clusterProperties){var l=t.clusterProperties[s],c=l[0],u=l[1],h="string"===typeof c?[c,["accumulated"],["get",s]]:c;a.push.apply(a,xn({key:r+"."+s+".map",value:u,expressionContext:"cluster-map"})),a.push.apply(a,xn({key:r+"."+s+".reduce",value:h,expressionContext:"cluster-reduce"}))}return a;case"video":return mn({key:r,value:t,valueSpec:n.source_video,style:i,styleSpec:n});case"image":return mn({key:r,value:t,valueSpec:n.source_image,style:i,styleSpec:n});case"canvas":return[new je(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return bn({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,styleSpec:n})}}function Nn(e){var t=e.value,r=e.styleSpec,n=r.light,i=e.style,a=[],o=Kr(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new je("light",t,"object expected, "+o+" found")]);for(var s in t){var l=s.match(/^(.*)-transition$/);a=l&&n[l[1]]&&n[l[1]].transition?a.concat(Vn({key:s,value:t[s],valueSpec:r.transition,style:i,styleSpec:r})):n[s]?a.concat(Vn({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r})):a.concat([new je(s,t[s],'unknown property "'+s+'"')])}return a}var Un={"*":function(){return[]},array:gn,boolean:function(e){var t=e.value,r=e.key,n=Kr(t);return"boolean"!==n?[new je(r,t,"boolean expected, "+n+" found")]:[]},number:yn,color:function(e){var t=e.key,r=e.value,n=Kr(r);return"string"!==n?[new je(t,r,"color expected, "+n+" found")]:null===ot(r)?[new je(t,r,'color expected, "'+r+'" found')]:[]},constants:Fe,enum:bn,filter:Ln,function:vn,layer:Dn,object:mn,source:Bn,light:Nn,string:jn,formatted:function(e){return 0===jn(e).length?[]:xn(e)},resolvedImage:function(e){return 0===jn(e).length?[]:xn(e)}};function Vn(e){var t=e.value,r=e.valueSpec,n=e.styleSpec;return r.expression&&Jr(Ne(t))?vn(e):r.expression&&ln(Ue(t))?xn(e):r.type&&Un[r.type]?Un[r.type](e):mn(Be({},e,{valueSpec:r.type?n[r.type]:r}))}function qn(e){var t=e.value,r=e.key,n=jn(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new je(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new je(r,t,'"glyphs" url must include a "{range}" token'))),n}function Hn(e,t){void 0===t&&(t=De);var r=[];return r=r.concat(Vn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:qn,"*":function(){return[]}}})),e.constants&&(r=r.concat(Fe({key:"constants",value:e.constants,style:e,styleSpec:t}))),Gn(r)}function Gn(e){return[].concat(e).sort((function(e,t){return e.line-t.line}))}function Wn(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Gn(e.apply(this,t))}}Hn.source=Wn(Bn),Hn.light=Wn(Nn),Hn.layer=Wn(Dn),Hn.filter=Wn(Ln),Hn.paintProperty=Wn(On),Hn.layoutProperty=Wn(Rn);var $n=Hn,Zn=$n.light,Xn=$n.paintProperty,Yn=$n.layoutProperty;function Kn(e,t){var r=!1;if(t&&t.length)for(var n=0,i=t;n<i.length;n+=1){var a=i[n];e.fire(new Oe(new Error(a.message))),r=!0}return r}var Jn=ei,Qn=3;function ei(e,t,r){var n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var i=new Int32Array(this.arrayBuffer);e=i[0],t=i[1],r=i[2],this.d=t+2*r;for(var a=0;a<this.d*this.d;a++){var o=i[Qn+a],s=i[Qn+a+1];n.push(o===s?null:i.subarray(o,s))}var l=i[Qn+n.length],c=i[Qn+n.length+1];this.keys=i.subarray(l,c),this.bboxes=i.subarray(c),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var u=0;u<this.d*this.d;u++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var h=r/t*e;this.min=-h,this.max=e+h}ei.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},ei.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},ei.prototype._insertCell=function(e,t,r,n,i,a){this.cells[i].push(a)},ei.prototype.query=function(e,t,r,n,i){var a=this.min,o=this.max;if(e<=a&&t<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);var s=[];return this._forEachCell(e,t,r,n,this._queryCell,s,{},i),s},ei.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=this.cells[i];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var p=l[h];if(void 0===o[p]){var d=4*p;(s?s(u[d+0],u[d+1],u[d+2],u[d+3]):e<=u[d+2]&&t<=u[d+3]&&r>=u[d+0]&&n>=u[d+1])?(o[p]=!0,a.push(c[p])):o[p]=!1}}},ei.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n),p=l;p<=u;p++)for(var d=c;d<=h;d++){var f=this.d*d+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(d),this._convertFromCellCoord(p+1),this._convertFromCellCoord(d+1)))&&i.call(this,e,t,r,n,f,a,o,s))return}},ei.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},ei.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},ei.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=Qn+this.cells.length+1+1,r=0,n=0;n<this.cells.length;n++)r+=this.cells[n].length;var i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;for(var a=t,o=0;o<e.length;o++){var s=e[o];i[Qn+o]=a,i.set(s,a),a+=s.length}return i[Qn+e.length]=a,i.set(this.keys,a),a+=this.keys.length,i[Qn+e.length+1]=a,i.set(this.bboxes,a),a+=this.bboxes.length,i.buffer};var ti=s.ImageData,ri=s.ImageBitmap,ni={};function ii(e,t,r){void 0===r&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ni[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var ai in ii("Object",Object),Jn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},Jn.deserialize=function(e){return new Jn(e.buffer)},ii("Grid",Jn),ii("Color",st),ii("Error",Error),ii("ResolvedImage",ht),ii("StylePropertyFunction",dn),ii("StyleExpression",sn,{omit:["_evaluator"]}),ii("ZoomDependentExpression",hn),ii("ZoomConstantExpression",un),ii("CompoundExpression",At,{omit:["_evaluate"]}),Ur)Ur[ai]._classRegistryKey||ii("Expression_"+ai,Ur[ai]);function oi(e){return e&&"undefined"!==typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function si(e){return ri&&e instanceof ri}function li(e,t){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(oi(e)||si(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof ti)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var n=[],i=0,a=e;i<a.length;i+=1){var o=a[i];n.push(li(o,t))}return n}if("object"===typeof e){var s=e.constructor,l=s._classRegistryKey;if(!l)throw new Error("can't serialize object of unregistered class");var c=s.serialize?s.serialize(e,t):{};if(!s.serialize){for(var u in e)if(e.hasOwnProperty(u)&&!(ni[l].omit.indexOf(u)>=0)){var h=e[u];c[u]=ni[l].shallow.indexOf(u)>=0?h:li(h,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function ci(e){if(null===e||void 0===e||"boolean"===typeof e||"number"===typeof e||"string"===typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||oi(e)||si(e)||ArrayBuffer.isView(e)||e instanceof ti)return e;if(Array.isArray(e))return e.map(ci);if("object"===typeof e){var t=e.$name||"Object",r=ni[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,a=Object.keys(e);i<a.length;i+=1){var o=a[i];if("$name"!==o){var s=e[o];n[o]=ni[t].shallow.indexOf(o)>=0?s:ci(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var ui=function(){this.first=!0};ui.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var hi={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function pi(e){for(var t=0,r=e;t<r.length;t+=1)if(fi(r[t].charCodeAt(0)))return!0;return!1}function di(e){return!hi.Arabic(e)&&!hi["Arabic Supplement"](e)&&!hi["Arabic Extended-A"](e)&&!hi["Arabic Presentation Forms-A"](e)&&!hi["Arabic Presentation Forms-B"](e)}function fi(e){return 746===e||747===e||!(e<4352)&&(!!hi["Bopomofo Extended"](e)||!!hi.Bopomofo(e)||!(!hi["CJK Compatibility Forms"](e)||e>=65097&&e<=65103)||!!hi["CJK Compatibility Ideographs"](e)||!!hi["CJK Compatibility"](e)||!!hi["CJK Radicals Supplement"](e)||!!hi["CJK Strokes"](e)||!(!hi["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!hi["CJK Unified Ideographs Extension A"](e)||!!hi["CJK Unified Ideographs"](e)||!!hi["Enclosed CJK Letters and Months"](e)||!!hi["Hangul Compatibility Jamo"](e)||!!hi["Hangul Jamo Extended-A"](e)||!!hi["Hangul Jamo Extended-B"](e)||!!hi["Hangul Jamo"](e)||!!hi["Hangul Syllables"](e)||!!hi.Hiragana(e)||!!hi["Ideographic Description Characters"](e)||!!hi.Kanbun(e)||!!hi["Kangxi Radicals"](e)||!!hi["Katakana Phonetic Extensions"](e)||!(!hi.Katakana(e)||12540===e)||!(!hi["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!hi["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!hi["Unified Canadian Aboriginal Syllabics"](e)||!!hi["Unified Canadian Aboriginal Syllabics Extended"](e)||!!hi["Vertical Forms"](e)||!!hi["Yijing Hexagram Symbols"](e)||!!hi["Yi Syllables"](e)||!!hi["Yi Radicals"](e))}function mi(e){return!(fi(e)||function(e){return!(!hi["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!hi["General Punctuation"](e)||8214!==e&&8224!==e&&8225!==e&&8240!==e&&8241!==e&&8251!==e&&8252!==e&&8258!==e&&8263!==e&&8264!==e&&8265!==e&&8273!==e)||!!hi["Letterlike Symbols"](e)||!!hi["Number Forms"](e)||!(!hi["Miscellaneous Technical"](e)||!(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215))||!(!hi["Control Pictures"](e)||9251===e)||!!hi["Optical Character Recognition"](e)||!!hi["Enclosed Alphanumerics"](e)||!!hi["Geometric Shapes"](e)||!(!hi["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!hi["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!hi["CJK Symbols and Punctuation"](e)||!!hi.Katakana(e)||!!hi["Private Use Area"](e)||!!hi["CJK Compatibility Forms"](e)||!!hi["Small Form Variants"](e)||!!hi["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}(e))}function gi(e){return hi.Arabic(e)||hi["Arabic Supplement"](e)||hi["Arabic Extended-A"](e)||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function yi(e){return e>=1424&&e<=2303||hi["Arabic Presentation Forms-A"](e)||hi["Arabic Presentation Forms-B"](e)}function vi(e,t){return!(!t&&yi(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||hi.Khmer(e))}function xi(e){for(var t=0,r=e;t<r.length;t+=1)if(yi(r[t].charCodeAt(0)))return!0;return!1}var bi="deferred",_i="loading",wi="loaded",ki="error",Ti=null,Si="unavailable",Ai=null,Mi=function(e){e&&"string"===typeof e&&e.indexOf("NetworkError")>-1&&(Si=ki),Ti&&Ti(e)};function Ei(){Ci.fire(new ze("pluginStateChange",{pluginStatus:Si,pluginURL:Ai}))}var Ci=new Re,Pi=function(){return Si},Li=function(){if(Si!==bi||!Ai)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Si=_i,Ei(),Ai&&Te({url:Ai},(function(e){e?Mi(e):(Si=wi,Ei())}))},Ii={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Si===wi||null!=Ii.applyArabicShaping},isLoading:function(){return Si===_i},setState:function(e){Si=e.pluginStatus,Ai=e.pluginURL},isParsed:function(){return null!=Ii.applyArabicShaping&&null!=Ii.processBidirectionalText&&null!=Ii.processStyledBidirectionalText},getPluginURL:function(){return Ai}},zi=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new ui,this.transition={})};zi.prototype.isSupportedScript=function(e){return function(e,t){for(var r=0,n=e;r<n.length;r+=1)if(!vi(n[r].charCodeAt(0),t))return!1;return!0}(e,Ii.isLoaded())},zi.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},zi.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Oi=function(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Jr(e))return new dn(e,t);if(ln(e)){var r=pn(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=st.parse(e)),{kind:"constant",evaluate:function(){return n}}}(void 0===t?e.specification.default:t,e.specification)};Oi.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Oi.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var Ri=function(e){this.property=e,this.value=new Oi(e,void 0)};Ri.prototype.transitioned=function(e,t){return new ji(this.property,this.value,t,d({},e.transition,this.transition),e.now)},Ri.prototype.untransitioned=function(){return new ji(this.property,this.value,null,{},0)};var Di=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Di.prototype.getValue=function(e){return w(this._values[e].value.value)},Di.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ri(this._values[e].property)),this._values[e].value=new Oi(this._values[e].property,null===t?void 0:w(t))},Di.prototype.getTransition=function(e){return w(this._values[e].transition)},Di.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ri(this._values[e].property)),this._values[e].transition=w(t)||void 0},Di.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],i=this.getValue(n);void 0!==i&&(e[n]=i);var a=this.getTransition(n);void 0!==a&&(e[n+"-transition"]=a)}return e},Di.prototype.transitioned=function(e,t){for(var r=new Fi(this._properties),n=0,i=Object.keys(this._values);n<i.length;n+=1){var a=i[n];r._values[a]=this._values[a].transitioned(e,t._values[a])}return r},Di.prototype.untransitioned=function(){for(var e=new Fi(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t];e._values[n]=this._values[n].untransitioned()}return e};var ji=function(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)};ji.prototype.possiblyEvaluate=function(e,t,r){var n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);var o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}return i};var Fi=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Fi.prototype.possiblyEvaluate=function(e,t,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n},Fi.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1){var r=t[e];if(this._values[r].prior)return!0}return!1};var Bi=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Bi.prototype.getValue=function(e){return w(this._values[e].value)},Bi.prototype.setValue=function(e,t){this._values[e]=new Oi(this._values[e].property,null===t?void 0:w(t))},Bi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var n=r[t],i=this.getValue(n);void 0!==i&&(e[n]=i)}return e},Bi.prototype.possiblyEvaluate=function(e,t,r){for(var n=new Ui(this._properties),i=0,a=Object.keys(this._values);i<a.length;i+=1){var o=a[i];n._values[o]=this._values[o].possiblyEvaluate(e,t,r)}return n};var Ni=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Ni.prototype.isConstant=function(){return"constant"===this.value.kind},Ni.prototype.constantOr=function(e){return"constant"===this.value.kind?this.value.value:e},Ni.prototype.evaluate=function(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)};var Ui=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};Ui.prototype.get=function(e){return this._values[e]};var Vi=function(e){this.specification=e};Vi.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},Vi.prototype.interpolate=function(e,t,r){var n=tr[this.specification.type];return n?n(e,t,r):e};var qi=function(e,t){this.specification=e,this.overrides=t};qi.prototype.possiblyEvaluate=function(e,t,r,n){return"constant"===e.expression.kind||"camera"===e.expression.kind?new Ni(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)},t):new Ni(this,e.expression,t)},qi.prototype.interpolate=function(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Ni(this,{kind:"constant",value:void 0},e.parameters);var n=tr[this.specification.type];return n?new Ni(this,{kind:"constant",value:n(e.value.value,t.value.value,r)},e.parameters):e},qi.prototype.evaluate=function(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)};var Hi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0===e.value)return new Ni(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!==typeof i?i.name:i,o=this._calculate(a,a,a,t);return new Ni(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){var s=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Ni(this,{kind:"constant",value:s},t)}return new Ni(this,e.expression,t)},t.prototype.evaluate=function(e,t,r,n,i,a){if("source"===e.kind){var o=e.evaluate(t,r,n,i,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value},t.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(qi),Gi=function(e){this.specification=e};Gi.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new zi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new zi(Math.floor(t.zoom),t)),e.expression.evaluate(new zi(Math.floor(t.zoom+1),t)),t)}},Gi.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Gi.prototype.interpolate=function(e){return e};var Wi=function(e){this.specification=e};Wi.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},Wi.prototype.interpolate=function(){return!1};var $i=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Oi(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new Ri(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};ii("DataDrivenProperty",qi),ii("DataConstantProperty",Vi),ii("CrossFadedDataDrivenProperty",Hi),ii("CrossFadedProperty",Gi),ii("ColorRampProperty",Wi);var Zi="-transition",Xi=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new Bi(r.layout)),r.paint)){for(var n in this._transitionablePaint=new Di(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ui(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(Yn,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return x(e,Zi)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(Xn,n,e,t,r))return!1}if(x(e,Zi))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;var i=this._transitionablePaint._values[e],a="cross-faded-data-driven"===i.property.specification["property-type"],o=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||o||a||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)},t.prototype.serialize=function(){var e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),_(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&Kn(this,e.call($n,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:De,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof Ni&&Zr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(Re),Yi={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ki=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Ji=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Qi(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i,a=(i=e.type,Yi[i].BYTES_PER_ELEMENT),o=r=ea(r,Math.max(t,a)),s=e.components||1;return n=Math.max(n,a),r+=a*s,{name:e.name,type:e.type,components:s,offset:o}})),size:ea(r,Math.max(n,t)),alignment:t}}function ea(e,t){return Math.ceil(e/t)*t}Ji.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Ji.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Ji.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Ji.prototype.clear=function(){this.length=0},Ji.prototype.resize=function(e){this.reserve(e),this.length=e},Ji.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Ji.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(Ji);ta.prototype.bytesPerElement=4,ii("StructArrayLayout2i4",ta);var ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e},t}(Ji);ra.prototype.bytesPerElement=8,ii("StructArrayLayout4i8",ra);var na=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);na.prototype.bytesPerElement=12,ii("StructArrayLayout2i4i12",na);var ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e},t}(Ji);ia.prototype.bytesPerElement=8,ii("StructArrayLayout2i4ub8",ia);var aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(Ji);aa.prototype.bytesPerElement=8,ii("StructArrayLayout2f8",aa);var oa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u){var h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e},t}(Ji);oa.prototype.bytesPerElement=20,ii("StructArrayLayout10ui20",oa);var sa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h){var p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,a,o,s,l,c,u,h)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p){var d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,e},t}(Ji);sa.prototype.bytesPerElement=24,ii("StructArrayLayout4i4ui4i24",sa);var la=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(Ji);la.prototype.bytesPerElement=12,ii("StructArrayLayout3f12",la);var ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(Ji);ca.prototype.bytesPerElement=4,ii("StructArrayLayout1ul4",ca);var ua=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c){var u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e},t}(Ji);ua.prototype.bytesPerElement=20,ii("StructArrayLayout6i1ul2ui20",ua);var ha=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)},t.prototype.emplace=function(e,t,r,n,i,a,o){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e},t}(Ji);ha.prototype.bytesPerElement=12,ii("StructArrayLayout2i2i2i12",ha);var pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,a){var o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e},t}(Ji);pa.prototype.bytesPerElement=16,ii("StructArrayLayout2f1f2i16",pa);var da=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=12*e,o=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[o+1]=n,this.float32[o+2]=i,e},t}(Ji);da.prototype.bytesPerElement=12,ii("StructArrayLayout2ub2f12",da);var fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(Ji);fa.prototype.bytesPerElement=6,ii("StructArrayLayout3ui6",fa);var ma=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y){var v=24*e,x=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e},t}(Ji);ma.prototype.bytesPerElement=48,ii("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ma);var ga=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M){var E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M)},t.prototype.emplace=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E){var C=34*e,P=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=k,this.uint32[P+12]=T,this.float32[P+13]=S,this.float32[P+14]=A,this.float32[P+15]=M,this.float32[P+16]=E,e},t}(Ji);ga.prototype.bytesPerElement=68,ii("StructArrayLayout8i15ui1ul4f68",ga);var ya=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(Ji);ya.prototype.bytesPerElement=4,ii("StructArrayLayout1f4",ya);var va=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(Ji);va.prototype.bytesPerElement=6,ii("StructArrayLayout3i6",va);var xa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,a=4*e;return this.uint32[i+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=n,e},t}(Ji);xa.prototype.bytesPerElement=8,ii("StructArrayLayout1ul2ui8",xa);var ba=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(Ji);ba.prototype.bytesPerElement=4,ii("StructArrayLayout2ui4",ba);var _a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(Ji);_a.prototype.bytesPerElement=2,ii("StructArrayLayout1ui2",_a);var wa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e},t}(Ji);wa.prototype.bytesPerElement=16,ii("StructArrayLayout4f16",wa);var ka=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new a(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(Ki);ka.prototype.size=20;var Ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new ka(this,e)},t}(ua);ii("CollisionBoxArray",Ta);var Sa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(Ki);Sa.prototype.size=48;var Aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Sa(this,e)},t}(ma);ii("PlacedSymbolArray",Aa);var Ma=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(Ki);Ma.prototype.size=68;var Ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ma(this,e)},t}(ga);ii("SymbolInstanceArray",Ea);var Ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(ya);ii("GlyphOffsetArray",Ca);var Pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(va);ii("SymbolLineVertexArray",Pa);var La=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(Ki);La.prototype.size=8;var Ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new La(this,e)},t}(xa);ii("FeatureIndexArray",Ia);var za=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,Oa=function(e){void 0===e&&(e=[]),this.segments=e};function Ra(e,t){return 256*(e=h(Math.floor(e),0,255))+(t=h(Math.floor(t),0,255))}Oa.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>Oa.MAX_VERTEX_ARRAY_LENGTH&&T("Max vertices per segment is "+Oa.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>Oa.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},Oa.prototype.get=function(){return this.segments},Oa.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var n in r.vaos)r.vaos[n].destroy()}},Oa.simpleSegment=function(e,t,r,n){return new Oa([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])},Oa.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ii("SegmentVector",Oa);var Da=Qi([{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"}]),ja=t((function(e){e.exports=function(e,t){var r,n,i,a,o,s,l,c;for(r=3&e.length,n=e.length-r,i=t,o=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}})),Fa=t((function(e){e.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}})),Ba=ja,Na=ja,Ua=Fa;Ba.murmur3=Na,Ba.murmur2=Ua;var Va=function(){this.ids=[],this.positions=[],this.indexed=!1};Va.prototype.add=function(e,t,r,n){this.ids.push(Ha(e)),this.positions.push(t,r,n)},Va.prototype.getPositions=function(e){for(var t=Ha(e),r=0,n=this.ids.length-1;r<n;){var i=r+n>>1;this.ids[i]>=t?n=i:r=i+1}for(var a=[];this.ids[r]===t;){var o=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];a.push({index:o,start:s,end:l}),r++}return a},Va.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Ga(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},Va.deserialize=function(e){var t=new Va;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var qa=Math.pow(2,53)-1;function Ha(e){var t=+e;return!isNaN(t)&&t<=qa?t:Ba(String(e))}function Ga(e,t,r,n){for(;r<n;){for(var i=e[r+n>>1],a=r-1,o=n+1;;){do{a++}while(e[a]<i);do{o--}while(e[o]>i);if(a>=o)break;Wa(e,a,o),Wa(t,3*a,3*o),Wa(t,3*a+1,3*o+1),Wa(t,3*a+2,3*o+2)}o-r<n-o?(Ga(e,t,r,o),r=o+1):(Ga(e,t,o+1,n),n=o)}}function Wa(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}ii("FeaturePositionMap",Va);var $a=function(e,t){this.gl=e.gl,this.location=t},Za=function(e){function t(t,r){e.call(this,t,r),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))},t}($a),Xa=function(e){function t(t,r){e.call(this,t,r),this.current=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))},t}($a),Ya=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))},t}($a),Ka=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))},t}($a),Ja=function(e){function t(t,r){e.call(this,t,r),this.current=[0,0,0,0]}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))},t}($a),Qa=function(e){function t(t,r){e.call(this,t,r),this.current=st.transparent}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))},t}($a),eo=new Float32Array(16),to=function(e){function t(t,r){e.call(this,t,r),this.current=eo}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(var t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}},t}($a);function ro(e){return[Ra(255*e.r,255*e.g),Ra(255*e.b,255*e.a)]}var no=function(e,t,r){this.value=e,this.uniformNames=t.map((function(e){return"u_"+e})),this.type=r};no.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},no.prototype.getBinding=function(e,t,r){return"color"===this.type?new Qa(e,t):new Xa(e,t)};var io=function(e,t){this.uniformNames=t.map((function(e){return"u_"+e})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};io.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},io.prototype.setUniform=function(e,t,r,n){var i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)},io.prototype.getBinding=function(e,t,r){return"u_pattern"===r.substr(0,9)?new Ja(e,t):new Xa(e,t)};var ao=function(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new n};ao.prototype.populatePaintArray=function(e,t,r,n,i){var a=this.paintVertexArray.length,o=this.expression.evaluate(new zi(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)},ao.prototype.updatePaintArray=function(e,t,r,n){var i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)},ao.prototype._setPaintValue=function(e,t,r){if("color"===this.type)for(var n=ro(r),i=e;i<t;i++)this.paintVertexArray.emplace(i,n[0],n[1]);else{for(var a=e;a<t;a++)this.paintVertexArray.emplace(a,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},ao.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},ao.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var oo=function(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map((function(e){return"u_"+e+"_t"})),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((function(e){return{name:"a_"+e,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new a};oo.prototype.populatePaintArray=function(e,t,r,n,i){var a=this.expression.evaluate(new zi(this.zoom),t,{},n,[],i),o=this.expression.evaluate(new zi(this.zoom+1),t,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)},oo.prototype.updatePaintArray=function(e,t,r,n){var i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)},oo.prototype._setPaintValue=function(e,t,r,n){if("color"===this.type)for(var i=ro(r),a=ro(n),o=e;o<t;o++)this.paintVertexArray.emplace(o,i[0],i[1],a[0],a[1]);else{for(var s=e;s<t;s++)this.paintVertexArray.emplace(s,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}},oo.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},oo.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},oo.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=h(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)},oo.prototype.getBinding=function(e,t,r){return new Xa(e,t)};var so=function(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i};so.prototype.populatePaintArray=function(e,t,r){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)},so.prototype.updatePaintArray=function(e,t,r,n,i){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],i)},so.prototype._setPaintValues=function(e,t,r,n){if(n&&r){var i=r.min,a=r.mid,o=r.max,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(var u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}},so.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Da.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Da.members,this.expression.isStateDependent))},so.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var lo=function(e,t,r){this.binders={},this._buffers=[];var n=[];for(var i in e.paint._values)if(r(i)){var a=e.paint.get(i);if(a instanceof Ni&&Zr(a.property.specification)){var o=uo(i,e.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new io(s.value,o):new no(s.value,o,l),n.push("/u_"+i);else if("source"===s.kind||h){var p=ho(i,l,"source");this.binders[i]=h?new so(s,l,c,t,p,e.id):new ao(s,o,l,p),n.push("/a_"+i)}else{var d=ho(i,l,"composite");this.binders[i]=new oo(s,o,l,c,t,d),n.push("/z_"+i)}}}this.cacheKey=n.sort().join("")};lo.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof ao||t instanceof oo?t.maxValue:0},lo.prototype.populatePaintArrays=function(e,t,r,n,i){for(var a in this.binders){var o=this.binders[a];(o instanceof ao||o instanceof oo||o instanceof so)&&o.populatePaintArray(e,t,r,n,i)}},lo.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var n=this.binders[r];n instanceof io&&n.setConstantPatternPositions(e,t)}},lo.prototype.updatePaintArrays=function(e,t,r,n,i){var a=!1;for(var o in e)for(var s=0,l=t.getPositions(o);s<l.length;s+=1){var c=l[s],u=r.feature(c.index);for(var h in this.binders){var p=this.binders[h];if((p instanceof ao||p instanceof oo||p instanceof so)&&!0===p.expression.isStateDependent){var d=n.paint.get(h);p.expression=d.value,p.updatePaintArray(c.start,c.end,u,e[o],i),a=!0}}}return a},lo.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof no||r instanceof io)&&e.push.apply(e,r.uniformNames.map((function(e){return"#define HAS_UNIFORM_"+e})))}return e},lo.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof ao||r instanceof oo)for(var n=0;n<r.paintVertexAttributes.length;n++)e.push(r.paintVertexAttributes[n].name);else if(r instanceof so)for(var i=0;i<Da.members.length;i++)e.push(Da.members[i].name)}return e},lo.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof no||r instanceof io||r instanceof oo)for(var n=0,i=r.uniformNames;n<i.length;n+=1){var a=i[n];e.push(a)}}return e},lo.prototype.getPaintVertexBuffers=function(){return this._buffers},lo.prototype.getUniforms=function(e,t){var r=[];for(var n in this.binders){var i=this.binders[n];if(i instanceof no||i instanceof io||i instanceof oo)for(var a=0,o=i.uniformNames;a<o.length;a+=1){var s=o[a];if(t[s]){var l=i.getBinding(e,t[s],s);r.push({name:s,property:n,binding:l})}}}return r},lo.prototype.setUniforms=function(e,t,r,n){for(var i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.name,l=o.property,c=o.binding;this.binders[l].setUniform(c,n,r.get(l),s)}},lo.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof so){var n=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(r instanceof ao||r instanceof oo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},lo.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof ao||r instanceof oo||r instanceof so)&&r.upload(e)}this.updatePaintBuffers()},lo.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof ao||t instanceof oo||t instanceof so)&&t.destroy()}};var co=function(e,t,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var n=0,i=e;n<i.length;n+=1){var a=i[n];this.programConfigurations[a.id]=new lo(a,t,r)}this.needsUpload=!1,this._featureMap=new Va,this._bufferOffset=0};function uo(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function ho(e,t,r){var n={color:{source:aa,composite:wa},number:{source:ya,composite:aa}},i=function(e){return{"line-pattern":{source:oa,composite:oa},"fill-pattern":{source:oa,composite:oa},"fill-extrusion-pattern":{source:oa,composite:oa}}[e]}(e);return i&&i[r]||n[t][r]}co.prototype.populatePaintArrays=function(e,t,r,n,i,a){for(var o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},co.prototype.updatePaintArrays=function(e,t,r,n){for(var i=0,a=r;i<a.length;i+=1){var o=a[i];this.needsUpload=this.programConfigurations[o.id].updatePaintArrays(e,this._featureMap,t,o,n)||this.needsUpload}},co.prototype.get=function(e){return this.programConfigurations[e]},co.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},co.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},ii("ConstantBinder",no),ii("CrossFadedConstantBinder",io),ii("SourceExpressionBinder",ao),ii("CrossFadedCompositeBinder",so),ii("CompositeExpressionBinder",oo),ii("ProgramConfiguration",lo,{omit:["_buffers"]}),ii("ProgramConfigurationSet",co);var po=8192,fo=Math.pow(2,14)-1,mo=-fo-1;function go(e){for(var t=po/e.extent,r=e.loadGeometry(),n=0;n<r.length;n++)for(var i=r[n],a=0;a<i.length;a++){var o=i[a],s=Math.round(o.x*t),l=Math.round(o.y*t);o.x=h(s,mo,fo),o.y=h(l,mo,fo),(s<o.x||s>o.x+1||l<o.y||l>o.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function yo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?go(e):[]}}function vo(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var xo=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ta,this.indexArray=new fa,this.segments=new Oa,this.programConfigurations=new co(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function bo(e,t){for(var r=0;r<e.length;r++)if(Co(t,e[r]))return!0;for(var n=0;n<t.length;n++)if(Co(e,t[n]))return!0;return!!To(e,t)}function _o(e,t,r){return!!Co(e,t)||!!Ao(t,e,r)}function wo(e,t){if(1===e.length)return Eo(t,e[0]);for(var r=0;r<t.length;r++)for(var n=t[r],i=0;i<n.length;i++)if(Co(e,n[i]))return!0;for(var a=0;a<e.length;a++)if(Eo(t,e[a]))return!0;for(var o=0;o<t.length;o++)if(To(e,t[o]))return!0;return!1}function ko(e,t,r){if(e.length>1){if(To(e,t))return!0;for(var n=0;n<t.length;n++)if(Ao(t[n],e,r))return!0}for(var i=0;i<e.length;i++)if(Ao(e[i],t,r))return!0;return!1}function To(e,t){if(0===e.length||0===t.length)return!1;for(var r=0;r<e.length-1;r++)for(var n=e[r],i=e[r+1],a=0;a<t.length-1;a++)if(So(n,i,t[a],t[a+1]))return!0;return!1}function So(e,t,r,n){return S(e,r,n)!==S(t,r,n)&&S(e,t,r)!==S(e,t,n)}function Ao(e,t,r){var n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(var i=1;i<t.length;i++)if(Mo(e,t[i-1],t[i])<n)return!0;return!1}function Mo(e,t,r){var n=t.distSqr(r);if(0===n)return e.distSqr(t);var i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return i<0?e.distSqr(t):i>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Eo(e,t){for(var r,n,i,a=!1,o=0;o<e.length;o++)for(var s=0,l=(r=e[o]).length-1;s<r.length;l=s++)n=r[s],i=r[l],n.y>t.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function Co(e,t){for(var r=!1,n=0,i=e.length-1;n<e.length;i=n++){var a=e[n],o=e[i];a.y>t.y!==o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Po(e,t,r){var n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;var a=S(e,t,r[0]);return a!==S(e,t,r[1])||a!==S(e,t,r[2])||a!==S(e,t,r[3])}function Lo(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Io(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zo(e,t,r,n,i){if(!t[0]&&!t[1])return e;var o=a.convert(t)._mult(i);"viewport"===r&&o._rotate(-n);for(var s=[],l=0;l<e.length;l++){var c=e[l];s.push(c.sub(o))}return s}xo.prototype.populate=function(e,t,r){var n=this.layers[0],i=[],a=null;"circle"===n.type&&(a=n.layout.get("circle-sort-key"));for(var o=0,s=e;o<s.length;o+=1){var l=s[o],c=l.feature,u=l.id,h=l.index,p=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,f=yo(c,d);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),f,r)){var m=a?a.evaluate(f,{},r):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:p,index:h,geometry:d?f.geometry:go(c),patterns:{},sortKey:m};i.push(g)}}a&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var y=0,v=i;y<v.length;y+=1){var x=v[y],b=x,_=b.geometry,w=b.index,k=b.sourceLayerIndex,T=e[w].feature;this.addFeature(x,_,w,r),t.featureIndex.insert(T,_,w,k,this.index)}},xo.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},xo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},xo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},xo.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,za),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},xo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},xo.prototype.addFeature=function(e,t,r,n){for(var i=0,a=t;i<a.length;i+=1)for(var o=0,s=a[i];o<s.length;o+=1){var l=s[o],c=l.x,u=l.y;if(!(c<0||c>=po||u<0||u>=po)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),p=h.vertexLength;vo(this.layoutVertexArray,c,u,-1,-1),vo(this.layoutVertexArray,c,u,1,-1),vo(this.layoutVertexArray,c,u,1,1),vo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(p,p+1,p+2),this.indexArray.emplaceBack(p,p+3,p+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},ii("CircleBucket",xo,{omit:["layers"]});var Oo=new $i({"circle-sort-key":new qi(De.layout_circle["circle-sort-key"])}),Ro={paint:new $i({"circle-radius":new qi(De.paint_circle["circle-radius"]),"circle-color":new qi(De.paint_circle["circle-color"]),"circle-blur":new qi(De.paint_circle["circle-blur"]),"circle-opacity":new qi(De.paint_circle["circle-opacity"]),"circle-translate":new Vi(De.paint_circle["circle-translate"]),"circle-translate-anchor":new Vi(De.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Vi(De.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Vi(De.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new qi(De.paint_circle["circle-stroke-width"]),"circle-stroke-color":new qi(De.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new qi(De.paint_circle["circle-stroke-opacity"])}),layout:Oo},Do="undefined"!==typeof Float32Array?Float32Array:Array;function jo(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Fo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*h+w*m,e[1]=x*i+b*l+_*p+w*g,e[2]=x*a+b*c+_*d+w*y,e[3]=x*o+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*h+w*m,e[5]=x*i+b*l+_*p+w*g,e[6]=x*a+b*c+_*d+w*y,e[7]=x*o+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*h+w*m,e[9]=x*i+b*l+_*p+w*g,e[10]=x*a+b*c+_*d+w*y,e[11]=x*o+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*h+w*m,e[13]=x*i+b*l+_*p+w*g,e[14]=x*a+b*c+_*d+w*y,e[15]=x*o+b*u+_*f+w*v,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var Bo=Fo,No=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};function Uo(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}!function(){var e=new Do(3);Do!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0)}(),function(){var e=new Do(4);Do!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Vo=function(e){var t=e[0],r=e[1];return t*t+r*r},qo=(function(){var e=new Do(2);Do!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(t){e.call(this,t,Ro)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new xo(e)},t.prototype.queryRadius=function(e){var t=e;return Lo("circle-radius",this,t)+Lo("circle-stroke-width",this,t)+Io(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o,s){for(var l=zo(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(e,t){return e.map((function(e){return Ho(e,t)}))}(l,s),p=u?c*o:c,d=0,f=n;d<f.length;d+=1)for(var m=0,g=f[d];m<g.length;m+=1){var y=g[m],v=u?y:Ho(y,s),x=p,b=Uo([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?x*=b[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(x*=a.cameraToCenterDistance/b[3]),_o(h,v,x))return!0}return!1},t}(Xi));function Ho(e,t){var r=Uo([],[e.x,e.y,0,1],t);return new a(r[0]/r[3],r[1]/r[3])}var Go=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(xo);function Wo(e,t,r,n){var i=t.width,a=t.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError("mismatched image size")}else n=new Uint8Array(i*a*r);return e.width=i,e.height=a,e.data=n,e}function $o(e,t,r){var n=t.width,i=t.height;if(n!==e.width||i!==e.height){var a=Wo({},{width:n,height:i},r);Zo(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=a.data}}function Zo(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var o=e.data,s=t.data,l=0;l<i.height;l++)for(var c=((r.y+l)*e.width+r.x)*a,u=((n.y+l)*t.width+n.x)*a,h=0;h<i.width*a;h++)s[u+h]=o[c+h];return t}ii("HeatmapBucket",Go,{omit:["layers"]});var Xo=function(e,t){Wo(this,e,1,t)};Xo.prototype.resize=function(e){$o(this,e,1)},Xo.prototype.clone=function(){return new Xo({width:this.width,height:this.height},new Uint8Array(this.data))},Xo.copy=function(e,t,r,n,i){Zo(e,t,r,n,i,1)};var Yo=function(e,t){Wo(this,e,4,t)};Yo.prototype.resize=function(e){$o(this,e,4)},Yo.prototype.replace=function(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e},Yo.prototype.clone=function(){return new Yo({width:this.width,height:this.height},new Uint8Array(this.data))},Yo.copy=function(e,t,r,n,i){Zo(e,t,r,n,i,4)},ii("AlphaImage",Xo),ii("RGBAImage",Yo);var Ko={paint:new $i({"heatmap-radius":new qi(De.paint_heatmap["heatmap-radius"]),"heatmap-weight":new qi(De.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Vi(De.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(De.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Vi(De.paint_heatmap["heatmap-opacity"])})};function Jo(e){var t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Yo({width:r,height:n}),a=function(r,n,a){t[e.evaluationKey]=a;var o=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(e.clips)for(var o=0,s=0;o<n;++o,s+=4*r)for(var l=0,c=0;l<r;l++,c+=4){var u=l/(r-1),h=e.clips[o];a(s,c,h.start*(1-u)+h.end*u)}else for(var p=0,d=0;p<r;p++,d+=4)a(0,d,p/(r-1));return i}var Qo=function(e){function t(t){e.call(this,t,Ko),this._updateColorRamp()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Go(e)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){"heatmap-color"===e&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){var e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Jo({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},t}(Xi),es={paint:new $i({"hillshade-illumination-direction":new Vi(De.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Vi(De.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Vi(De.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Vi(De.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Vi(De.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Vi(De.paint_hillshade["hillshade-accent-color"])})},ts=function(e){function t(t){e.call(this,t,es)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},t}(Xi),rs=Qi([{name:"a_pos",components:2,type:"Int16"}],4).members,ns=as,is=as;function as(e,t,r){r=r||2;var n,i,a,o,s,l,c,u=t&&t.length,h=u?t[0]*r:e.length,p=os(e,0,h,r,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,r,n){var i,a,o,s=[];for(i=0,a=t.length;i<a;i++)(o=os(e,t[i]*n,i<a-1?t[i+1]*n:e.length,n,!1))===o.next&&(o.steiner=!0),s.push(ys(o));for(s.sort(ds),i=0;i<s.length;i++)fs(s[i],r),r=ss(r,r.next);return r}(e,t,p,r)),e.length>80*r){n=a=e[0],i=o=e[1];for(var f=r;f<h;f+=r)(s=e[f])<n&&(n=s),(l=e[f+1])<i&&(i=l),s>a&&(a=s),l>o&&(o=l);c=0!==(c=Math.max(a-n,o-i))?1/c:0}return ls(p,d,r,n,i,c),d}function os(e,t,r,n,i){var a,o;if(i===Ps(e,t,r,n)>0)for(a=t;a<r;a+=n)o=Ms(a,e[a],e[a+1],o);else for(a=r-n;a>=t;a-=n)o=Ms(a,e[a],e[a+1],o);return o&&_s(o,o.next)&&(Es(o),o=o.next),o}function ss(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!_s(n,n.next)&&0!==bs(n.prev,n,n.next))n=n.next;else{if(Es(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function ls(e,t,r,n,i,a,o){if(e){!o&&a&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=gs(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,a,o,s,l,c=1;do{for(r=e,e=null,a=null,o=0;r;){for(o++,n=r,s=0,t=0;t<c&&(s++,n=n.nextZ);t++);for(l=c;s>0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(e,n,i,a);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,a?us(e,n,i,a):cs(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Es(e),e=l.next,c=l.next;else if((e=l)===c){o?1===o?ls(e=hs(ss(e),t,r),t,r,n,i,a,2):2===o&&ps(e,t,r,n,i,a):ls(ss(e),t,r,n,i,a,1);break}}}function cs(e){var t=e.prev,r=e,n=e.next;if(bs(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(vs(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&bs(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function us(e,t,r,n){var i=e.prev,a=e,o=e.next;if(bs(i,a,o)>=0)return!1;for(var s=i.x<a.x?i.x<o.x?i.x:o.x:a.x<o.x?a.x:o.x,l=i.y<a.y?i.y<o.y?i.y:o.y:a.y<o.y?a.y:o.y,c=i.x>a.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,h=gs(s,l,t,r,n),p=gs(c,u,t,r,n),d=e.prevZ,f=e.nextZ;d&&d.z>=h&&f&&f.z<=p;){if(d!==e.prev&&d!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&bs(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==e.prev&&f!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=h;){if(d!==e.prev&&d!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&bs(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==e.prev&&f!==e.next&&vs(i.x,i.y,a.x,a.y,o.x,o.y,f.x,f.y)&&bs(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function hs(e,t,r){var n=e;do{var i=n.prev,a=n.next.next;!_s(i,a)&&ws(i,n,n.next,a)&&Ss(i,a)&&Ss(a,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(a.i/r),Es(n),Es(n.next),n=e=a),n=n.next}while(n!==e);return ss(n)}function ps(e,t,r,n,i,a){var o=e;do{for(var s=o.next.next;s!==o.prev;){if(o.i!==s.i&&xs(o,s)){var l=As(o,s);return o=ss(o,o.next),l=ss(l,l.next),ls(o,t,r,n,i,a),void ls(l,t,r,n,i,a)}s=s.next}o=o.next}while(o!==e)}function ds(e,t){return e.x-t.x}function fs(e,t){if(t=function(e,t){var r,n=t,i=e.x,a=e.y,o=-1/0;do{if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x<n.next.x?n:n.next}}n=n.next}while(n!==t);if(!r)return null;if(i===o)return r;var l,c=r,u=r.x,h=r.y,p=1/0;n=r;do{i>=n.x&&n.x>=u&&i!==n.x&&vs(a<h?i:o,a,u,h,a<h?o:i,a,n.x,n.y)&&(l=Math.abs(a-n.y)/(i-n.x),Ss(n,e)&&(l<p||l===p&&(n.x>r.x||n.x===r.x&&ms(r,n)))&&(r=n,p=l)),n=n.next}while(n!==c);return r}(e,t),t){var r=As(t,e);ss(t,t.next),ss(r,r.next)}}function ms(e,t){return bs(e.prev,e,t.prev)<0&&bs(t.next,e,e.next)<0}function gs(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function ys(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function vs(e,t,r,n,i,a,o,s){return(i-o)*(t-s)-(e-o)*(a-s)>=0&&(e-o)*(n-s)-(r-o)*(t-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function xs(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&ws(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Ss(e,t)&&Ss(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!==r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(bs(e.prev,e,t.prev)||bs(e,t.prev,t))||_s(e,t)&&bs(e.prev,e,e.next)>0&&bs(t.prev,t,t.next)>0)}function bs(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function _s(e,t){return e.x===t.x&&e.y===t.y}function ws(e,t,r,n){var i=Ts(bs(e,t,r)),a=Ts(bs(e,t,n)),o=Ts(bs(r,n,e)),s=Ts(bs(r,n,t));return i!==a&&o!==s||!(0!==i||!ks(e,r,t))||!(0!==a||!ks(e,n,t))||!(0!==o||!ks(r,e,n))||!(0!==s||!ks(r,t,n))}function ks(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ts(e){return e>0?1:e<0?-1:0}function Ss(e,t){return bs(e.prev,e,e.next)<0?bs(e,t,e.next)>=0&&bs(e,e.prev,t)>=0:bs(e,t,e.prev)<0||bs(e,e.next,t)<0}function As(e,t){var r=new Cs(e.i,e.x,e.y),n=new Cs(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Ms(e,t,r,n){var i=new Cs(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Es(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Cs(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ps(e,t,r,n){for(var i=0,a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}function Ls(e,t,r,n,i){Is(e,t,r||0,n||e.length-1,i||Os)}function Is(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);Is(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,p=n;for(zs(e,r,t),i(e[n],u)>0&&zs(e,r,n);h<p;){for(zs(e,h,p),h++,p--;i(e[h],u)<0;)h++;for(;i(e[p],u)>0;)p--}0===i(e[r],u)?zs(e,r,p):zs(e,++p,n),p<=t&&(r=p+1),t<=p&&(n=p-1)}}function zs(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Os(e,t){return e<t?-1:e>t?1:0}function Rs(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,a=[],o=0;o<r;o++){var s=A(e[o]);0!==s&&(e[o].area=Math.abs(s),void 0===i&&(i=s<0),i===s<0?(n&&a.push(n),n=[e[o]]):n.push(e[o]))}if(n&&a.push(n),t>1)for(var l=0;l<a.length;l++)a[l].length<=t||(Ls(a[l],t,1,a[l].length-1,Ds),a[l]=a[l].slice(0,t));return a}function Ds(e,t){return t.area-e.area}function js(e,t,r){for(var n=r.patternDependencies,i=!1,a=0,o=t;a<o.length;a+=1){var s=o[a].paint.get(e+"-pattern");s.isConstant()||(i=!0);var l=s.constantOr(null);l&&(i=!0,n[l.to]=!0,n[l.from]=!0)}return i}function Fs(e,t,r,n,i){for(var a=i.patternDependencies,o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.paint.get(e+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},r,{},i.availableImages),h=c.evaluate({zoom:n},r,{},i.availableImages),p=c.evaluate({zoom:n+1},r,{},i.availableImages);u=u&&u.name?u.name:u,h=h&&h.name?h.name:h,p=p&&p.name?p.name:p,a[u]=!0,a[h]=!0,a[p]=!0,r.patterns[l.id]={min:u,mid:h,max:p}}}return r}as.deviation=function(e,t,r,n){var i=t&&t.length,a=i?t[0]*r:e.length,o=Math.abs(Ps(e,0,a,r));if(i)for(var s=0,l=t.length;s<l;s++){var c=t[s]*r,u=s<l-1?t[s+1]*r:e.length;o-=Math.abs(Ps(e,c,u,r))}var h=0;for(s=0;s<n.length;s+=3){var p=n[s]*r,d=n[s+1]*r,f=n[s+2]*r;h+=Math.abs((e[p]-e[f])*(e[d+1]-e[p+1])-(e[p]-e[d])*(e[f+1]-e[p+1]))}return 0===o&&0===h?0:Math.abs((h-o)/o)},as.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},n=0,i=0;i<e.length;i++){for(var a=0;a<e[i].length;a++)for(var o=0;o<t;o++)r.vertices.push(e[i][a][o]);i>0&&(n+=e[i-1].length,r.holes.push(n))}return r},ns.default=is;var Bs=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ta,this.indexArray=new fa,this.indexArray2=new ba,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Oa,this.segments2=new Oa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Bs.prototype.populate=function(e,t,r){this.hasPattern=js("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=yo(l,p);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),d,r)){var f=n?n.evaluate(d,{},r,t.availableImages):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:p?d.geometry:go(l),patterns:{},sortKey:f};i.push(m)}}n&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,b=x.geometry,_=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var k=Fs("fill",this.layers,v,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(v,b,_,r,{});var T=e[_].feature;t.featureIndex.insert(T,b,_,w,this.index)}},Bs.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Bs.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,t,r)}},Bs.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Bs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Bs.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rs),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},Bs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Bs.prototype.addFeature=function(e,t,r,n,i){for(var a=0,o=Rs(t,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),p=h.vertexLength,d=[],f=[],m=0,g=s;m<g.length;m+=1){var y=g[m];if(0!==y.length){y!==s[0]&&f.push(d.length/2);var v=this.segments2.prepareSegment(y.length,this.layoutVertexArray,this.indexArray2),x=v.vertexLength;this.layoutVertexArray.emplaceBack(y[0].x,y[0].y),this.indexArray2.emplaceBack(x+y.length-1,x),d.push(y[0].x),d.push(y[0].y);for(var b=1;b<y.length;b++)this.layoutVertexArray.emplaceBack(y[b].x,y[b].y),this.indexArray2.emplaceBack(x+b-1,x+b),d.push(y[b].x),d.push(y[b].y);v.vertexLength+=y.length,v.primitiveLength+=y.length}}for(var _=ns(d,f),w=0;w<_.length;w+=3)this.indexArray.emplaceBack(p+_[w],p+_[w+1],p+_[w+2]);h.vertexLength+=l,h.primitiveLength+=_.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},ii("FillBucket",Bs,{omit:["layers","patternFeatures"]});var Ns=new $i({"fill-sort-key":new qi(De.layout_fill["fill-sort-key"])}),Us={paint:new $i({"fill-antialias":new Vi(De.paint_fill["fill-antialias"]),"fill-opacity":new qi(De.paint_fill["fill-opacity"]),"fill-color":new qi(De.paint_fill["fill-color"]),"fill-outline-color":new qi(De.paint_fill["fill-outline-color"]),"fill-translate":new Vi(De.paint_fill["fill-translate"]),"fill-translate-anchor":new Vi(De.paint_fill["fill-translate-anchor"]),"fill-pattern":new Hi(De.paint_fill["fill-pattern"])}),layout:Ns},Vs=function(e){function t(t){e.call(this,t,Us)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(e){return new Bs(e)},t.prototype.queryRadius=function(){return Io(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,a,o){return wo(zo(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)},t.prototype.isTileClipped=function(){return!0},t}(Xi),qs=Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Hs=Gs;function Gs(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields(Ws,this,t)}function Ws(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function $s(e){for(var t,r,n=0,i=0,a=e.length,o=a-1;i<a;o=i++)t=e[i],n+=((r=e[o]).x-t.x)*(t.y+r.y);return n}Gs.types=["Unknown","Point","LineString","Polygon"],Gs.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,o=0,s=0,l=[];e.pos<r;){if(i<=0){var c=e.readVarint();n=7&c,i=c>>3}if(i--,1===n||2===n)o+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Gs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Gs.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Gs.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t],n=180-360*(r.y+s)/a;e[t]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=$s(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Zs=Xs;function Xs(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Ys,this,t),this.length=this._features.length}function Ys(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}function Ks(e,t,r){if(3===e){var n=new Zs(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}Xs.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Hs(this._pbf,t,this.extent,this._keys,this._values)};var Js={VectorTile:function(e,t){this.layers=e.readFields(Ks,{},t)},VectorTileFeature:Hs,VectorTileLayer:Zs},Qs=Js.VectorTileFeature.types,el=Math.pow(2,13);function tl(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*el)+o,i*el*2,a*el*2,Math.round(s))}var rl=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new na,this.indexArray=new fa,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Oa,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function nl(e,t){return e.x===t.x&&(e.x<0||e.x>po)||e.y===t.y&&(e.y<0||e.y>po)}function il(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>po}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>po}))}rl.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=js("fill-extrusion",this.layers,t);for(var n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.feature,s=a.id,l=a.index,c=a.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=yo(o,u);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),h,r)){var p={id:s,sourceLayerIndex:c,index:l,geometry:u?h.geometry:go(o),properties:o.properties,type:o.type,patterns:{}};this.hasPattern?this.features.push(Fs("fill-extrusion",this.layers,p,this.zoom,t)):this.addFeature(p,p.geometry,l,r,{}),t.featureIndex.insert(o,p.geometry,l,c,this.index,!0)}}},rl.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.features;n<i.length;n+=1){var a=i[n],o=a.geometry;this.addFeature(a,o,a.index,t,r)}},rl.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},rl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},rl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},rl.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qs),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},rl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},rl.prototype.addFeature=function(e,t,r,n,i){for(var a=0,o=Rs(t,500);a<o.length;a+=1){for(var s=o[a],l=0,c=0,u=s;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),p=0,d=s;p<d.length;p+=1){var f=d[p];if(0!==f.length&&!il(f))for(var m=0,g=0;g<f.length;g++){var y=f[g];if(g>=1){var v=f[g-1];if(!nl(y,v)){h.vertexLength+4>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=b,tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),tl(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var _=h.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>Oa.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===Qs[e.type]){for(var w=[],k=[],T=h.vertexLength,S=0,A=s;S<A.length;S+=1){var M=A[S];if(0!==M.length){M!==s[0]&&k.push(w.length/2);for(var E=0;E<M.length;E++){var C=M[E];tl(this.layoutVertexArray,C.x,C.y,0,0,1,1,0),w.push(C.x),w.push(C.y)}}}for(var P=ns(w,k),L=0;L<P.length;L+=3)this.indexArray.emplaceBack(T+P[L],T+P[L+2],T+P[L+1]);h.primitiveLength+=P.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},ii("FillExtrusionBucket",rl,{omit:["layers","features"]});var al={paint:new $i({"fill-extrusion-opacity":new Vi(De["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new qi(De["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Vi(De["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Vi(De["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Hi(De["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new qi(De["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new qi(De["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Vi(De["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ol=function(e){function t(t){e.call(this,t,al)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new rl(e)},t.prototype.queryRadius=function(){return Io(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s,l){var c=zo(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(t,r),h=this.paint.get("fill-extrusion-base").evaluate(t,r),p=function(e,t,r,n){for(var i=[],o=0,s=e;o<s.length;o+=1){var l=s[o],c=[l.x,l.y,n,1];Uo(c,c,t),i.push(new a(c[0]/c[3],c[1]/c[3]))}return i}(c,l,0,0),d=function(e,t,r,n){for(var i=[],o=[],s=n[8]*t,l=n[9]*t,c=n[10]*t,u=n[11]*t,h=n[8]*r,p=n[9]*r,d=n[10]*r,f=n[11]*r,m=0,g=e;m<g.length;m+=1){for(var y=[],v=[],x=0,b=g[m];x<b.length;x+=1){var _=b[x],w=_.x,k=_.y,T=n[0]*w+n[4]*k+n[12],S=n[1]*w+n[5]*k+n[13],A=n[2]*w+n[6]*k+n[14],M=n[3]*w+n[7]*k+n[15],E=A+c,C=M+u,P=T+h,L=S+p,I=A+d,z=M+f,O=new a((T+s)/C,(S+l)/C);O.z=E/C,y.push(O);var R=new a(P/z,L/z);R.z=I/z,v.push(R)}i.push(y),o.push(v)}return[i,o]}(n,h,u,l);return function(e,t,r){var n=1/0;wo(r,t)&&(n=ll(r,t[0]));for(var i=0;i<t.length;i++)for(var a=t[i],o=e[i],s=0;s<a.length-1;s++){var l=a[s],c=a[s+1],u=o[s],h=[l,c,o[s+1],u,l];bo(r,h)&&(n=Math.min(n,ll(r,h)))}return n!==1/0&&n}(d[0],d[1],p)},t}(Xi);function sl(e,t){return e.x*t.x+e.y*t.y}function ll(e,t){if(1===e.length){for(var r,n=0,i=t[n++];!r||i.equals(r);)if(!(r=t[n++]))return 1/0;for(;n<t.length;n++){var a=t[n],o=e[0],s=r.sub(i),l=a.sub(i),c=o.sub(i),u=sl(s,s),h=sl(s,l),p=sl(l,l),d=sl(c,s),f=sl(c,l),m=u*p-h*h,g=(p*d-h*f)/m,y=(u*f-h*d)/m,v=1-g-y,x=i.z*v+r.z*g+a.z*y;if(isFinite(x))return x}return 1/0}for(var b=1/0,_=0,w=t;_<w.length;_+=1){var k=w[_];b=Math.min(b,k.z)}return b}var cl=Qi([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,ul=Qi([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,hl=Js.VectorTileFeature.types,pl=Math.cos(Math.PI/180*37.5),dl=Math.pow(2,14)/.5,fl=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(e){t.gradients[e.id]={}})),this.layoutVertexArray=new ia,this.layoutVertexArray2=new aa,this.indexArray=new fa,this.programConfigurations=new co(e.layers,e.zoom),this.segments=new Oa,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};fl.prototype.populate=function(e,t,r){this.hasPattern=js("line",this.layers,t);for(var n=this.layers[0].layout.get("line-sort-key"),i=[],a=0,o=e;a<o.length;a+=1){var s=o[a],l=s.feature,c=s.id,u=s.index,h=s.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,d=yo(l,p);if(this.layers[0]._featureFilter.filter(new zi(this.zoom),d,r)){var f=n?n.evaluate(d,{},r):void 0,m={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:p?d.geometry:go(l),patterns:{},sortKey:f};i.push(m)}}n&&i.sort((function(e,t){return e.sortKey-t.sortKey}));for(var g=0,y=i;g<y.length;g+=1){var v=y[g],x=v,b=x.geometry,_=x.index,w=x.sourceLayerIndex;if(this.hasPattern){var k=Fs("line",this.layers,v,this.zoom,t);this.patternFeatures.push(k)}else this.addFeature(v,b,_,r,{});var T=e[_].feature;t.featureIndex.insert(T,b,_,w,this.index)}},fl.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},fl.prototype.addFeatures=function(e,t,r){for(var n=0,i=this.patternFeatures;n<i.length;n+=1){var a=i[n];this.addFeature(a,a.geometry,a.index,t,r)}},fl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},fl.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fl.prototype.upload=function(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,ul)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cl),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},fl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},fl.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},fl.prototype.addFeature=function(e,t,r,n,i){var a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var u=0,h=t;u<h.length;u+=1){var p=h[u];this.addLine(p,e,o,s,l,c)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)},fl.prototype.addLine=function(e,t,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var o=0;o<e.length-1;o++)this.totalDistance+=e[o].dist(e[o+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===hl[t.type],l=e.length;l>=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c<l-1&&e[c].equals(e[c+1]);)c++;if(!(l<(s?3:2))){"bevel"===r&&(i=1.05);var u,h=this.overscaling<=16?122880/(512*this.overscaling):0,p=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),d=void 0,f=void 0,m=void 0,g=void 0;this.e1=this.e2=-1,s&&(u=e[l-2],g=e[c].sub(u)._unit()._perp());for(var y=c;y<l;y++)if(!(f=y===l-1?s?e[c+1]:void 0:e[y+1])||!e[y].equals(f)){g&&(m=g),u&&(d=u),u=e[y],g=f?f.sub(u)._unit()._perp():m;var v=(m=m||g).add(g);0===v.x&&0===v.y||v._unit();var x=m.x*g.x+m.y*g.y,b=v.x*g.x+v.y*g.y,_=0!==b?1/b:1/0,w=2*Math.sqrt(2-2*b),k=b<pl&&d&&f,T=m.x*g.y-m.y*g.x>0;if(k&&y>c){var S=u.dist(d);if(S>2*h){var A=u.sub(u.sub(d)._mult(h/S)._round());this.updateDistance(d,A),this.addCurrentVertex(A,m,0,0,p),d=A}}var M=d&&f,E=M?r:s?"butt":n;if(M&&"round"===E&&(_<a?E="miter":_<=2&&(E="fakeround")),"miter"===E&&_>i&&(E="bevel"),"bevel"===E&&(_>2&&(E="flipbevel"),_<i&&(E="miter")),d&&this.updateDistance(d,u),"miter"===E)v._mult(_),this.addCurrentVertex(u,v,0,0,p);else if("flipbevel"===E){if(_>100)v=g.mult(-1);else{var C=_*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(C*(T?-1:1))}this.addCurrentVertex(u,v,0,0,p),this.addCurrentVertex(u,v.mult(-1),0,0,p)}else if("bevel"===E||"fakeround"===E){var P=-Math.sqrt(_*_-1),L=T?P:0,I=T?0:P;if(d&&this.addCurrentVertex(u,m,L,I,p),"fakeround"===E)for(var z=Math.round(180*w/Math.PI/20),O=1;O<z;O++){var R=O/z;if(.5!==R){var D=R-.5;R+=R*D*(R-1)*((1.0904+x*(x*(3.55645-1.43519*x)-3.2452))*D*D+(.848013+x*(.215638*x-1.06021)))}var j=g.sub(m)._mult(R)._add(m)._unit()._mult(T?-1:1);this.addHalfVertex(u,j.x,j.y,!1,T,0,p)}f&&this.addCurrentVertex(u,g,-L,-I,p)}else if("butt"===E)this.addCurrentVertex(u,v,0,0,p);else if("square"===E){var F=d?1:-1;this.addCurrentVertex(u,v,F,F,p)}else"round"===E&&(d&&(this.addCurrentVertex(u,m,0,0,p),this.addCurrentVertex(u,m,1,1,p,!0)),f&&(this.addCurrentVertex(u,g,-1,-1,p,!0),this.addCurrentVertex(u,g,0,0,p)));if(k&&y<l-1){var B=u.dist(f);if(B>2*h){var N=u.add(f.sub(u)._mult(h/B)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,p),u=N}}}}},fl.prototype.addCurrentVertex=function(e,t,r,n,i,a){void 0===a&&(a=!1);var o=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,c=-t.y-t.x*n;this.addHalfVertex(e,o,s,a,!1,r,i),this.addHalfVertex(e,l,c,a,!0,-n,i),this.distance>dl/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,a))},fl.prototype.addHalfVertex=function(e,t,r,n,i,a,o){var s=e.x,l=e.y,c=.5*(this.lineClips?this.scaledDistance*(dl-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,h),o.primitiveLength++),i?this.e2=h:this.e1=h},fl.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},fl.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},ii("LineBucket",fl,{omit:["layers","patternFeatures"]});var ml=new $i({"line-cap":new Vi(De.layout_line["line-cap"]),"line-join":new qi(De.layout_line["line-join"]),"line-miter-limit":new Vi(De.layout_line["line-miter-limit"]),"line-round-limit":new Vi(De.layout_line["line-round-limit"]),"line-sort-key":new qi(De.layout_line["line-sort-key"])}),gl={paint:new $i({"line-opacity":new qi(De.paint_line["line-opacity"]),"line-color":new qi(De.paint_line["line-color"]),"line-translate":new Vi(De.paint_line["line-translate"]),"line-translate-anchor":new Vi(De.paint_line["line-translate-anchor"]),"line-width":new qi(De.paint_line["line-width"]),"line-gap-width":new qi(De.paint_line["line-gap-width"]),"line-offset":new qi(De.paint_line["line-offset"]),"line-blur":new qi(De.paint_line["line-blur"]),"line-dasharray":new Gi(De.paint_line["line-dasharray"]),"line-pattern":new Hi(De.paint_line["line-pattern"]),"line-gradient":new Wi(De.paint_line["line-gradient"])}),layout:ml},yl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new zi(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=d({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(qi),vl=new yl(gl.paint.properties["line-width"].specification);vl.useIntegerZoom=!0;var xl=function(e){function t(t){e.call(this,t,gl),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Qt,this.gradientVersion=(this.gradientVersion+1)%l}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=vl.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new fl(e)},t.prototype.queryRadius=function(e){var t=e,r=bl(Lo("line-width",this,t),Lo("line-gap-width",this,t)),n=Lo("line-offset",this,t);return r/2+Math.abs(n)+Io(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,s){var l=zo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,s),c=s/2*bl(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(n=function(e,t){for(var r=[],n=new a(0,0),i=0;i<e.length;i++){for(var o=e[i],s=[],l=0;l<o.length;l++){var c=o[l-1],u=o[l],h=o[l+1],p=0===l?n:u.sub(c)._unit()._perp(),d=l===o.length-1?n:h.sub(u)._unit()._perp(),f=p._add(d)._unit(),m=f.x*d.x+f.y*d.y;f._mult(1/m),s.push(f._mult(t)._add(u))}r.push(s)}return r}(n,u*s)),function(e,t,r){for(var n=0;n<t.length;n++){var i=t[n];if(e.length>=3)for(var a=0;a<i.length;a++)if(Co(e,i[a]))return!0;if(ko(e,i,r))return!0}return!1}(l,n,c)},t.prototype.isTileClipped=function(){return!0},t}(Xi);function bl(e,t){return t>0?t+2*e:e}var _l=Qi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),wl=Qi([{name:"a_projected_pos",components:3,type:"Float32"}],4),kl=(Qi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Qi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Tl=(Qi([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Qi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Sl=Qi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Al(e,t,r){return e.sections.forEach((function(e){e.text=function(e,t,r){var n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),Ii.applyArabicShaping&&(e=Ii.applyArabicShaping(e)),e}(e.text,t,r)})),e}Qi([{name:"triangle",components:3,type:"Uint16"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Qi([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Qi([{type:"Float32",name:"offsetX"}]),Qi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Ml={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},El=24,Cl=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},Pl=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m},Ll=Il;function Il(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Il.Varint=0,Il.Fixed64=1,Il.Bytes=2,Il.Fixed32=5;var zl=4294967296,Ol=1/zl,Rl="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function Dl(e){return e.type===Il.Bytes?e.readVarint()+e.pos:e.pos+1}function jl(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Fl(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Bl(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Nl(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Ul(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Vl(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function ql(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Hl(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Gl(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Wl(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function $l(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Xl(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function Yl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Kl(e,t,r){1===e&&r.readMessage(Jl,t)}function Jl(e,t,r){if(3===e){var n=r.readMessage(Ql,{}),i=n.id,a=n.bitmap,o=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;t.push({id:i,bitmap:new Xo({width:o+6,height:s+6},a),metrics:{width:o,height:s,left:l,top:c,advance:u}})}}function Ql(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function ec(e){for(var t=0,r=0,n=0,i=e;n<i.length;n+=1){var a=i[n];t+=a.w*a.h,r=Math.max(r,a.w)}e.sort((function(e,t){return t.h-e.h}));for(var o=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],s=0,l=0,c=0,u=e;c<u.length;c+=1)for(var h=u[c],p=o.length-1;p>=0;p--){var d=o[p];if(!(h.w>d.w||h.h>d.h)){if(h.x=d.x,h.y=d.y,l=Math.max(l,h.y+h.h),s=Math.max(s,h.x+h.w),h.w===d.w&&h.h===d.h){var f=o.pop();p<o.length&&(o[p]=f)}else h.h===d.h?(d.x+=h.w,d.w-=h.w):h.w===d.w?(d.y+=h.h,d.h-=h.h):(o.push({x:d.x+h.w,y:d.y,w:d.w-h.w,h:h.h}),d.y+=h.h,d.h-=h.h);break}}return{w:s,h:l,fill:t/(s*l)||0}}Il.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Zl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=Yl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Zl(this.buf,this.pos)+Zl(this.buf,this.pos+4)*zl;return this.pos+=8,e},readSFixed64:function(){var e=Zl(this.buf,this.pos)+Yl(this.buf,this.pos+4)*zl;return this.pos+=8,e},readFloat:function(){var e=Cl(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Cl(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(i=a[r.pos++],n=(112&i)>>4,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<3,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<10,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<17,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(127&i)<<24,i<128)return jl(e,n,t);if(i=a[r.pos++],n|=(1&i)<<31,i<128)return jl(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&Rl?function(e,t,r){return Rl.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var n="",i=t;i<r;){var a,o,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128===(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(a=e[i+1],o=e[i+2],128===(192&a)&&128===(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[i+1],o=e[i+2],s=e[i+3],128===(192&a)&&128===(192&o)&&128===(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Il.Bytes)return e.push(this.readVarint(t));var r=Dl(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Il.Bytes)return e.push(this.readSVarint());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Il.Bytes)return e.push(this.readBoolean());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Il.Bytes)return e.push(this.readFloat());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Il.Bytes)return e.push(this.readDouble());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Il.Bytes)return e.push(this.readFixed32());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Il.Bytes)return e.push(this.readSFixed32());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Il.Bytes)return e.push(this.readFixed64());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Il.Bytes)return e.push(this.readSFixed64());var t=Dl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Il.Varint)for(;this.buf[this.pos++]>127;);else if(t===Il.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Il.Fixed32)this.pos+=4;else{if(t!==Il.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Xl(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Xl(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Xl(this.buf,-1&e,this.pos),Xl(this.buf,Math.floor(e*Ol),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Xl(this.buf,-1&e,this.pos),Xl(this.buf,Math.floor(e*Ol),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Fl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Pl(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Pl(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Fl(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Il.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Bl,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Nl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,ql,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Ul,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Vl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Hl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Gl,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Wl,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,$l,t)},writeBytesField:function(e,t){this.writeTag(e,Il.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Il.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Il.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Il.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Il.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Il.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Il.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Il.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Il.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Il.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var tc=function(e,t){var r=t.pixelRatio,n=t.version,i=t.stretchX,a=t.stretchY,o=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n},rc={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};rc.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},rc.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},rc.tlbr.get=function(){return this.tl.concat(this.br)},rc.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(tc.prototype,rc);var nc=function(e,t){var r={},n={};this.haveRenderCallbacks=[];var i=[];this.addImages(e,r,i),this.addImages(t,n,i);var a=ec(i),o=a.w,s=a.h,l=new Yo({width:o||1,height:s||1});for(var c in e){var u=e[c],h=r[c].paddedRect;Yo.copy(u.data,l,{x:0,y:0},{x:h.x+1,y:h.y+1},u.data)}for(var p in t){var d=t[p],f=n[p].paddedRect,m=f.x+1,g=f.y+1,y=d.data.width,v=d.data.height;Yo.copy(d.data,l,{x:0,y:0},{x:m,y:g},d.data),Yo.copy(d.data,l,{x:0,y:v-1},{x:m,y:g-1},{width:y,height:1}),Yo.copy(d.data,l,{x:0,y:0},{x:m,y:g+v},{width:y,height:1}),Yo.copy(d.data,l,{x:y-1,y:0},{x:m-1,y:g},{width:1,height:v}),Yo.copy(d.data,l,{x:0,y:0},{x:m+y,y:g},{width:1,height:v})}this.image=l,this.iconPositions=r,this.patternPositions=n};nc.prototype.addImages=function(e,t,r){for(var n in e){var i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new tc(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},nc.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},nc.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var n=e.tl,i=n[0],a=n[1];r.update(t.data,void 0,{x:i,y:a})}},ii("ImagePosition",tc),ii("ImageAtlas",nc);var ic={horizontal:1,vertical:2,horizontalOnly:3},ac=-17,oc=function(){this.scale=1,this.fontStack="",this.imageName=null};oc.forText=function(e,t){var r=new oc;return r.scale=e||1,r.fontStack=t,r},oc.forImage=function(e){var t=new oc;return t.imageName=e,t};var sc=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function lc(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){var g,y=sc.fromFeature(e,i);h===ic.vertical&&y.verticalizePunctuation();var v=Ii.processBidirectionalText,x=Ii.processStyledBidirectionalText;if(v&&1===y.sections.length){g=[];for(var b=0,_=v(y.toString(),gc(y,c,a,t,n,d,f));b<_.length;b+=1){var w=_[b],k=new sc;k.text=w,k.sections=y.sections;for(var T=0;T<w.length;T++)k.sectionIndex.push(0);g.push(k)}}else if(x){g=[];for(var S=0,A=x(y.text,y.sectionIndex,gc(y,c,a,t,n,d,f));S<A.length;S+=1){var M=A[S],E=new sc;E.text=M[0],E.sectionIndex=M[1],E.sections=y.sections,g.push(E)}}else g=function(e,t){for(var r=[],n=e.text,i=0,a=0,o=t;a<o.length;a+=1){var s=o[a];r.push(e.substring(i,s)),i=s}return i<n.length&&r.push(e.substring(i,n.length)),r}(y,gc(y,c,a,t,n,d,f));var C=[],P={positionedLines:C,text:y.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(e,t,r,n,i,a,o,s,l,c,u,h){for(var p=0,d=ac,f=0,m=0,g="right"===s?1:"left"===s?0:.5,y=0,v=0,x=i;v<x.length;v+=1){var b=x[v];b.trim();var _=b.getMaxScale(),w=(_-1)*El,k={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=k;var T=k.positionedGlyphs,S=0;if(b.length()){for(var A=0;A<b.length();A++){var M=b.getSection(A),E=b.getSectionIndex(A),C=b.getCharCode(A),P=0,L=null,I=null,z=null,O=El,R=!(l===ic.horizontal||!u&&!fi(C)||u&&(cc[C]||gi(C)));if(M.imageName){var D=n[M.imageName];if(!D)continue;z=M.imageName,e.iconsInText=e.iconsInText||!0,I=D.paddedRect;var j=D.displaySize;M.scale=M.scale*El/h,L={width:j[0],height:j[1],left:1,top:-3,advance:R?j[1]:j[0]},P=w+(El-j[1]*M.scale),O=L.advance;var F=R?j[0]*M.scale-El*_:j[1]*M.scale-El*_;F>0&&F>S&&(S=F)}else{var B=r[M.fontStack],N=B&&B[C];if(N&&N.rect)I=N.rect,L=N.metrics;else{var U=t[M.fontStack],V=U&&U[C];if(!V)continue;L=V.metrics}P=(_-M.scale)*El}R?(e.verticalizable=!0,T.push({glyph:C,imageName:z,x:p,y:d+P,vertical:R,scale:M.scale,fontStack:M.fontStack,sectionIndex:E,metrics:L,rect:I}),p+=O*M.scale+c):(T.push({glyph:C,imageName:z,x:p,y:d+P,vertical:R,scale:M.scale,fontStack:M.fontStack,sectionIndex:E,metrics:L,rect:I}),p+=L.advance*M.scale+c)}if(0!==T.length){var q=p-c;f=Math.max(q,f),vc(T,0,T.length-1,g,S)}p=0;var H=a*_+S;k.lineOffset=Math.max(S,w),d+=H,m=Math.max(H,m),++y}else d+=a,++y}var G=d-ac,W=yc(o),$=W.horizontalAlign,Z=W.verticalAlign;(function(e,t,r,n,i,a,o,s,l){var c=(t-r)*i,u=0;u=a!==o?-s*n-ac:(-n*l+.5)*o;for(var h=0,p=e;h<p.length;h+=1)for(var d=0,f=p[h].positionedGlyphs;d<f.length;d+=1){var m=f[d];m.x+=c,m.y+=u}})(e.positionedLines,g,$,Z,f,m,a,G,i.length),e.top+=-Z*G,e.bottom=e.top+G,e.left+=-$*f,e.right=e.left+f}(P,t,r,n,g,o,s,l,h,c,p,m),!function(e){for(var t=0,r=e;t<r.length;t+=1)if(0!==r[t].positionedGlyphs.length)return!1;return!0}(C)&&P}sc.fromFeature=function(e,t){for(var r=new sc,n=0;n<e.sections.length;n++){var i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r},sc.prototype.length=function(){return this.text.length},sc.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},sc.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},sc.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},sc.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;n&&mi(n)&&!Ml[e[r+1]]||i&&mi(i)&&!Ml[e[r-1]]||!Ml[e[r]]?t+=e[r]:t+=Ml[e[r]]}return t}(this.text)},sc.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&cc[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,n=this.text.length-1;n>=0&&n>=e&&cc[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},sc.prototype.substring=function(e,t){var r=new sc;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},sc.prototype.toString=function(){return this.text},sc.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},sc.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(oc.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n<e.text.length;++n)this.sectionIndex.push(r)},sc.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(0!==t.length){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(oc.forImage(t)),this.sectionIndex.push(this.sections.length-1)):T("Reached maximum number of images 6401")}else T("Can't add FormattedSection with an empty image.")},sc.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var cc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},uc={};function hc(e,t,r,n,i,a){if(t.imageName){var o=n[t.imageName];return o?o.displaySize[0]*t.scale*El/a+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function pc(e,t,r,n){var i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function dc(e,t,r){var n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function fc(e,t,r,n,i,a){for(var o=null,s=pc(t,r,i,a),l=0,c=n;l<c.length;l+=1){var u=c[l],h=pc(t-u.x,r,i,a)+u.badness;h<=s&&(o=u,s=h)}return{index:e,x:t,priorBreak:o,badness:s}}function mc(e){return e?mc(e.priorBreak).concat(e.index):[]}function gc(e,t,r,n,i,a,o){if("point"!==a)return[];if(!e)return[];for(var s,l=[],c=function(e,t,r,n,i,a){for(var o=0,s=0;s<e.length();s++){var l=e.getSection(s);o+=hc(e.getCharCode(s),l,n,i,t,a)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,n,i,o),u=e.text.indexOf("\u200b")>=0,h=0,p=0;p<e.length();p++){var d=e.getSection(p),f=e.getCharCode(p);if(cc[f]||(h+=hc(f,d,n,i,t,o)),p<e.length()-1){var m=!((s=f)<11904)&&(!!hi["Bopomofo Extended"](s)||!!hi.Bopomofo(s)||!!hi["CJK Compatibility Forms"](s)||!!hi["CJK Compatibility Ideographs"](s)||!!hi["CJK Compatibility"](s)||!!hi["CJK Radicals Supplement"](s)||!!hi["CJK Strokes"](s)||!!hi["CJK Symbols and Punctuation"](s)||!!hi["CJK Unified Ideographs Extension A"](s)||!!hi["CJK Unified Ideographs"](s)||!!hi["Enclosed CJK Letters and Months"](s)||!!hi["Halfwidth and Fullwidth Forms"](s)||!!hi.Hiragana(s)||!!hi["Ideographic Description Characters"](s)||!!hi["Kangxi Radicals"](s)||!!hi["Katakana Phonetic Extensions"](s)||!!hi.Katakana(s)||!!hi["Vertical Forms"](s)||!!hi["Yi Radicals"](s)||!!hi["Yi Syllables"](s));(uc[f]||m||d.imageName)&&l.push(fc(p+1,h,c,l,dc(f,e.getCharCode(p+1),m&&u),!1))}}return mc(fc(e.length(),h,c,l,0,!0))}function yc(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function vc(e,t,r,n,i){if(n||i)for(var a=e[r],o=a.metrics.advance*a.scale,s=(e[r].x+o)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function xc(e,t,r,n,i,a){var o,s=e.image;if(s.content){var l=s.content,c=s.pixelRatio||1;o=[l[0]/c,l[1]/c,s.displaySize[0]-l[2]/c,s.displaySize[1]-l[3]/c]}var u,h,p,d,f=t.left*a,m=t.right*a;"width"===r||"both"===r?(d=i[0]+f-n[3],h=i[0]+m+n[1]):h=(d=i[0]+(f+m-s.displaySize[0])/2)+s.displaySize[0];var g=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(u=i[1]+g-n[0],p=i[1]+y+n[2]):p=(u=i[1]+(g+y-s.displaySize[1])/2)+s.displaySize[1],{image:s,top:u,right:h,bottom:p,left:d,collisionPadding:o}}uc[10]=!0,uc[32]=!0,uc[38]=!0,uc[40]=!0,uc[41]=!0,uc[43]=!0,uc[45]=!0,uc[47]=!0,uc[173]=!0,uc[183]=!0,uc[8203]=!0,uc[8208]=!0,uc[8211]=!0,uc[8231]=!0;var bc=function(e){function t(t,r,n,i){e.call(this,t,r),this.angle=n,void 0!==i&&(this.segment=i)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(a);ii("Anchor",bc);var _c=128;function wc(e,t){var r=t.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new zi(e+1))};if("source"===r.kind)return{kind:"source"};for(var n=r.zoomStops,i=r.interpolationType,a=0;a<n.length&&n[a]<=e;)a++;for(var o=a=Math.max(0,a-1);o<n.length&&n[o]<e+1;)o++;o=Math.min(n.length-1,o);var s=n[a],l=n[o];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:l,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:l,minSize:r.evaluate(new zi(s)),maxSize:r.evaluate(new zi(l)),interpolationType:i}}function kc(e,t,r){var n=t.uSize,i=t.uSizeT,a=r.lowerSize,o=r.upperSize;return"source"===e.kind?a/_c:"composite"===e.kind?er(a/_c,o/_c,i):n}function Tc(e,t){var r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){var i=e.interpolationType,a=e.minZoom,o=e.maxZoom,s=i?h(br.interpolationFactor(i,t,a,o),0,1):0;"camera"===e.kind?n=er(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}}var Sc=Object.freeze({__proto__:null,getSizeData:wc,evaluateSizeForFeature:kc,evaluateSizeForZoom:Tc,SIZE_PACK_FACTOR:_c});function Ac(e,t,r,n,i){if(void 0===t.segment)return!0;for(var a=t,o=t.segment+1,s=0;s>-r/2;){if(--o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;for(var l=[],c=0;s<r/2;){var u=e[o-1],h=e[o],p=e[o+1];if(!p)return!1;var d=u.angleTo(h)-h.angleTo(p);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:d}),c+=d;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(p)}return!0}function Mc(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Ec(e,t,r){return e?.6*t*r:0}function Cc(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Pc(e,t,r,n,i,a){for(var o=Ec(r,i,a),s=Cc(r,n)*a,l=0,c=Mc(e)/2,u=0;u<e.length-1;u++){var h=e[u],p=e[u+1],d=h.dist(p);if(l+d>c){var f=(c-l)/d,m=er(h.x,p.x,f),g=er(h.y,p.y,f),y=new bc(m,g,p.angleTo(h),u);return y._round(),!o||Ac(e,y,s,o,t)?y:void 0}l+=d}}function Lc(e,t,r,n,i,a,o,s,l){var c=Ec(n,a,o),u=Cc(n,i),h=u*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Ic(e,p?t/2*s%t:(u/2+2*a)*o*s%t,t,c,r,h,p,!1,l)}function Ic(e,t,r,n,i,a,o,s,l){for(var c=a/2,u=Mc(e),h=0,p=t-r,d=[],f=0;f<e.length-1;f++){for(var m=e[f],g=e[f+1],y=m.dist(g),v=g.angleTo(m);p+r<h+y;){var x=((p+=r)-h)/y,b=er(m.x,g.x,x),_=er(m.y,g.y,x);if(b>=0&&b<l&&_>=0&&_<l&&p-c>=0&&p+c<=u){var w=new bc(b,_,v,f);w._round(),n&&!Ac(e,w,a,n,i)||d.push(w)}}h+=y}return s||d.length||o||(d=Ic(e,h/2,r,n,i,a,o,!0,l)),d}function zc(e,t,r,n,i){for(var o=[],s=0;s<e.length;s++)for(var l=e[s],c=void 0,u=0;u<l.length-1;u++){var h=l[u],p=l[u+1];h.x<t&&p.x<t||(h.x<t?h=new a(t,h.y+(p.y-h.y)*((t-h.x)/(p.x-h.x)))._round():p.x<t&&(p=new a(t,h.y+(p.y-h.y)*((t-h.x)/(p.x-h.x)))._round()),h.y<r&&p.y<r||(h.y<r?h=new a(h.x+(p.x-h.x)*((r-h.y)/(p.y-h.y)),r)._round():p.y<r&&(p=new a(h.x+(p.x-h.x)*((r-h.y)/(p.y-h.y)),r)._round()),h.x>=n&&p.x>=n||(h.x>=n?h=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round():p.x>=n&&(p=new a(n,h.y+(p.y-h.y)*((n-h.x)/(p.x-h.x)))._round()),h.y>=i&&p.y>=i||(h.y>=i?h=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round():p.y>=i&&(p=new a(h.x+(p.x-h.x)*((i-h.y)/(p.y-h.y)),i)._round()),c&&h.equals(c[c.length-1])||(c=[h],o.push(c)),c.push(p)))))}return o}function Oc(e,t,r,n){var i=[],o=e.image,s=o.pixelRatio,l=o.paddedRect.w-2,c=o.paddedRect.h-2,u=e.right-e.left,h=e.bottom-e.top,p=o.stretchX||[[0,l]],d=o.stretchY||[[0,c]],f=function(e,t){return e+t[1]-t[0]},m=p.reduce(f,0),g=d.reduce(f,0),y=l-m,v=c-g,x=0,b=m,_=0,w=g,k=0,T=y,S=0,A=v;if(o.content&&n){var M=o.content;x=Rc(p,0,M[0]),_=Rc(d,0,M[1]),b=Rc(p,M[0],M[2]),w=Rc(d,M[1],M[3]),k=M[0]-x,S=M[1]-_,T=M[2]-M[0]-b,A=M[3]-M[1]-w}var E=function(n,i,l,c){var p=jc(n.stretch-x,b,u,e.left),d=Fc(n.fixed-k,T,n.stretch,m),f=jc(i.stretch-_,w,h,e.top),y=Fc(i.fixed-S,A,i.stretch,g),v=jc(l.stretch-x,b,u,e.left),M=Fc(l.fixed-k,T,l.stretch,m),E=jc(c.stretch-_,w,h,e.top),C=Fc(c.fixed-S,A,c.stretch,g),P=new a(p,f),L=new a(v,f),I=new a(v,E),z=new a(p,E),O=new a(d/s,y/s),R=new a(M/s,C/s),D=t*Math.PI/180;if(D){var j=Math.sin(D),F=Math.cos(D),B=[F,-j,j,F];P._matMult(B),L._matMult(B),z._matMult(B),I._matMult(B)}var N=n.stretch+n.fixed,U=l.stretch+l.fixed,V=i.stretch+i.fixed,q=c.stretch+c.fixed;return{tl:P,tr:L,bl:z,br:I,tex:{x:o.paddedRect.x+1+N,y:o.paddedRect.y+1+V,w:U-N,h:q-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:R,minFontScaleX:T/s/u,minFontScaleY:A/s/h,isSDF:r}};if(n&&(o.stretchX||o.stretchY))for(var C=Dc(p,y,m),P=Dc(d,v,g),L=0;L<C.length-1;L++)for(var I=C[L],z=C[L+1],O=0;O<P.length-1;O++){var R=P[O],D=P[O+1];i.push(E(I,R,z,D))}else i.push(E({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return i}function Rc(e,t,r){for(var n=0,i=0,a=e;i<a.length;i+=1){var o=a[i];n+=Math.max(t,Math.min(r,o[1]))-Math.max(t,Math.min(r,o[0]))}return n}function Dc(e,t,r){for(var n=[{fixed:-1,stretch:0}],i=0,a=e;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=n[n.length-1];n.push({fixed:s-c.stretch,stretch:c.stretch}),n.push({fixed:s-c.stretch,stretch:c.stretch+(l-s)})}return n.push({fixed:t+1,stretch:r}),n}function jc(e,t,r,n){return e/t*r+n}function Fc(e,t,r,n){return e-t*r/n}var Bc=function(e,t,r,n,i,o,s,l,c,u){if(this.boxStartIndex=e.length,c){var h=o.top,p=o.bottom,d=o.collisionPadding;d&&(h-=d[1],p+=d[3]);var f=p-h;f>0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=o.top*s-l,g=o.bottom*s+l,y=o.left*s-l,v=o.right*s+l,x=o.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var b=new a(y,m),_=new a(v,m),w=new a(y,g),k=new a(v,g),T=u*Math.PI/180;b._rotate(T),_._rotate(T),w._rotate(T),k._rotate(T),y=Math.min(b.x,_.x,w.x,k.x),v=Math.max(b.x,_.x,w.x,k.x),m=Math.min(b.y,_.y,w.y,k.y),g=Math.max(b.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,y,m,v,g,r,n,i)}this.boxEndIndex=e.length},Nc=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Uc),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Uc(e,t){return e<t?-1:e>t?1:0}function Vc(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,o=-1/0,s=-1/0,l=e[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<i)&&(i=u.y),(!c||u.x>o)&&(o=u.x),(!c||u.y>s)&&(s=u.y)}var h=o-n,p=s-i,d=Math.min(h,p),f=d/2,m=new Nc([],qc);if(0===d)return new a(n,i);for(var g=n;g<o;g+=d)for(var y=i;y<s;y+=d)m.push(new Hc(g+f,y+f,f,e));for(var v=function(e){for(var t=0,r=0,n=0,i=e[0],a=0,o=i.length,s=o-1;a<o;s=a++){var l=i[a],c=i[s],u=l.x*c.y-c.x*l.y;r+=(l.x+c.x)*u,n+=(l.y+c.y)*u,t+=3*u}return new Hc(r/t,n/t,0,e)}(e),x=m.length;m.length;){var b=m.pop();(b.d>v.d||!v.d)&&(v=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-v.d<=t||(f=b.h/2,m.push(new Hc(b.p.x-f,b.p.y-f,f,e)),m.push(new Hc(b.p.x+f,b.p.y-f,f,e)),m.push(new Hc(b.p.x-f,b.p.y+f,f,e)),m.push(new Hc(b.p.x+f,b.p.y+f,f,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function qc(e,t){return t.max-e.max}function Hc(e,t,r,n){this.p=new a(e,t),this.h=r,this.d=function(e,t){for(var r=!1,n=1/0,i=0;i<t.length;i++)for(var a=t[i],o=0,s=a.length,l=s-1;o<s;l=o++){var c=a[o],u=a[l];c.y>e.y!==u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Mo(e,c,u))}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}Nc.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Nc.prototype.pop=function(){if(0!==this.length){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Nc.prototype.peek=function(){return this.data[0]},Nc.prototype._up=function(e){for(var t=this.data,r=this.compare,n=t[e];e>0;){var i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n},Nc.prototype._down=function(e){for(var t=this.data,r=this.compare,n=this.length>>1,i=t[e];e<n;){var a=1+(e<<1),o=t[a],s=a+1;if(s<this.length&&r(t[s],o)<0&&(a=s,o=t[s]),r(o,i)>=0)break;t[e]=o,e=a}t[e]=i};var Gc=Number.POSITIVE_INFINITY;function Wc(e,t){return t[1]!==Gc?function(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function $c(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}var Zc=255,Xc=Zc*_c;function Yc(e,t,r,n,i,o,s,l,c,u,h,p,d,f,m){var g=function(e,t,r,n,i,o,s,l){for(var c=n.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,u=[],h=0,p=t.positionedLines;h<p.length;h+=1)for(var d=p[h],f=0,m=d.positionedGlyphs;f<m.length;f+=1){var g=m[f];if(g.rect){var y=g.rect||{},v=4,x=!0,b=1,_=0,w=(i||l)&&g.vertical,k=g.metrics.advance*g.scale/2;if(l&&t.verticalizable){var T=(g.scale-1)*El,S=(El-g.metrics.width*g.scale)/2;_=d.lineOffset/2-(g.imageName?-S:T)}if(g.imageName){var A=s[g.imageName];x=A.sdf,v=1/(b=A.pixelRatio)}var M=i?[g.x+k,g.y]:[0,0],E=i?[0,0]:[g.x+k+r[0],g.y+r[1]-_],C=[0,0];w&&(C=E,E=[0,0]);var P=(g.metrics.left-v)*g.scale-k+E[0],L=(-g.metrics.top-v)*g.scale+E[1],I=P+y.w*g.scale/b,z=L+y.h*g.scale/b,O=new a(P,L),R=new a(I,L),D=new a(P,z),j=new a(I,z);if(w){var F=new a(-k,k-ac),B=-Math.PI/2,N=12-k,U=g.imageName?N:0,V=new a(22-N,-U),q=new(Function.prototype.bind.apply(a,[null].concat(C)));O._rotateAround(B,F)._add(V)._add(q),R._rotateAround(B,F)._add(V)._add(q),D._rotateAround(B,F)._add(V)._add(q),j._rotateAround(B,F)._add(V)._add(q)}if(c){var H=Math.sin(c),G=Math.cos(c),W=[G,-H,H,G];O._matMult(W),R._matMult(W),D._matMult(W),j._matMult(W)}var $=new a(0,0),Z=new a(0,0);u.push({tl:O,tr:R,bl:D,br:j,tex:y,writingMode:t.writingMode,glyphOffset:M,sectionIndex:g.sectionIndex,isSDF:x,pixelOffsetTL:$,pixelOffsetBR:Z,minFontScaleX:0,minFontScaleY:0})}}return u}(0,r,l,i,o,s,n,e.allowVerticalPlacement),y=e.textSizeData,v=null;"source"===y.kind?(v=[_c*i.layout.get("text-size").evaluate(s,{})])[0]>Xc&&T(e.layerIds[0]+': Value for "text-size" is >= '+Zc+'. Reduce your "text-size".'):"composite"===y.kind&&((v=[_c*f.compositeTextSizes[0].evaluate(s,{},m),_c*f.compositeTextSizes[1].evaluate(s,{},m)])[0]>Xc||v[1]>Xc)&&T(e.layerIds[0]+': Value for "text-size" is >= '+Zc+'. Reduce your "text-size".'),e.addSymbols(e.text,g,v,l,o,s,u,t,c.lineStartIndex,c.lineLength,d,m);for(var x=0,b=h;x<b.length;x+=1)p[b[x]]=e.text.placedSymbolArray.length-1;return 4*g.length}function Kc(e){for(var t in e)return e[t];return null}function Jc(e,t,r,n){var i=e.compareText;if(t in i){for(var a=i[t],o=a.length-1;o>=0;o--)if(n.dist(a[o])<r)return!0}else i[t]=[];return i[t].push(n),!1}var Qc=Js.VectorTileFeature.types,eu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function tu(e,t,r,n,i,a,o,s,l,c,u,h,p){var d=s?Math.min(Xc,Math.round(s[0])):0,f=s?Math.min(Xc,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,o,(d<<1)+(l?1:0),f,16*c,16*u,256*h,256*p)}function ru(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function nu(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(xi(r[t].text))return!0;return!1}var iu=function(e){this.layoutVertexArray=new sa,this.indexArray=new fa,this.programConfigurations=e,this.segments=new Oa,this.dynamicLayoutVertexArray=new la,this.opacityVertexArray=new ca,this.placedSymbolArray=new Aa};iu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},iu.prototype.upload=function(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_l.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,wl.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,eu,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))},iu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},ii("SymbolBuffers",iu);var au=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new Oa,this.collisionVertexArray=new da};au.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,kl.members,!0)},au.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},ii("CollisionBuffers",au);var ou=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=jo([]),this.placementViewportMatrix=jo([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=wc(this.zoom,t["text-size"]),this.iconSizeData=wc(this.zoom,t["icon-size"]);var r=this.layers[0].layout,n=r.get("symbol-sort-key"),i=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==i&&void 0!==n.constantOr(1);var a="viewport-y"===i||"auto"===i&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(e){return ic[e]}))),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id})),this.sourceID=e.sourceID};ou.prototype.createArrays=function(){this.text=new iu(new co(this.layers,this.zoom,(function(e){return/^text/.test(e)}))),this.icon=new iu(new co(this.layers,this.zoom,(function(e){return/^icon/.test(e)}))),this.glyphOffsetArray=new Ca,this.lineVertexArray=new Pa,this.symbolInstances=new Ea},ou.prototype.calculateGlyphDependencies=function(e,t,r,n,i){for(var a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||n)&&i){var o=Ml[e.charAt(a)];o&&(t[o.charCodeAt(0)]=!0)}},ou.prototype.populate=function(e,t,r){var n=this.layers[0],i=n.layout,a=i.get("text-font"),o=i.get("text-field"),s=i.get("icon-image"),l=("constant"!==o.value.kind||o.value.value instanceof ut&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var h=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new zi(this.zoom),m=0,g=e;m<g.length;m+=1){var y=g[m],v=y.feature,x=y.id,b=y.index,_=y.sourceLayerIndex,w=n._featureFilter.needGeometry,k=yo(v,w);if(n._featureFilter.filter(f,k,r)){w||(k.geometry=go(v));var T=void 0;if(l){var S=n.getValueAndResolveTokens("text-field",k,r,d),A=ut.factory(S);nu(A)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Pi()||this.hasRTLText&&Ii.isParsed())&&(T=Al(A,n,k))}var M=void 0;if(c){var E=n.getValueAndResolveTokens("icon-image",k,r,d);M=E instanceof ht?E:ht.fromString(E)}if(T||M){var C=this.sortFeaturesByKey?u.evaluate(k,{},r):void 0,P={id:x,text:T,icon:M,index:b,sourceLayerIndex:_,geometry:k.geometry,properties:v.properties,type:Qc[v.type],sortKey:C};if(this.features.push(P),M&&(h[M.name]=!0),T){var L=a.evaluate(k,{},r).join(","),I="map"===i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ic.vertical)>=0;for(var z=0,O=T.sections;z<O.length;z+=1){var R=O[z];if(R.image)h[R.image.name]=!0;else{var D=pi(T.toString()),j=R.fontStack||L,F=p[j]=p[j]||{};this.calculateGlyphDependencies(R.text,F,I,this.allowVerticalPlacement,D)}}}}}}"line"===i.get("symbol-placement")&&(this.features=function(e){var t={},r={},n=[],i=0;function a(t){n.push(e[t]),i++}function o(e,t,i){var a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(e,r,i){var a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){var n=r?t[0][t[0].length-1]:t[0][0];return e+":"+n.x+":"+n.y}for(var c=0;c<e.length;c++){var u=e[c],h=u.geometry,p=u.text?u.text.toString():null;if(p){var d=l(p,h),f=l(p,h,!0);if(d in r&&f in t&&r[d]!==t[f]){var m=s(d,f,h),g=o(d,f,n[m].geometry);delete t[d],delete r[f],r[l(p,n[g].geometry,!0)]=g,n[m].geometry=null}else d in r?o(d,f,h):f in t?s(d,f,h):(a(c),t[d]=i-1,r[f]=i-1)}else a(c)}return n.filter((function(e){return e.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(e,t){return e.sortKey-t.sortKey}))}},ou.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},ou.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},ou.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},ou.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},ou.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},ou.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},ou.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(void 0!==e.segment){for(var n=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),a={},o=e.segment+1;o<t.length;o++)a[o]={x:t[o].x,y:t[o].y,tileUnitDistanceFromAnchor:n},o<t.length-1&&(n+=t[o+1].dist(t[o]));for(var s=e.segment||0;s>=0;s--)a[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l<t.length;l++){var c=a[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},ou.prototype.addSymbols=function(e,t,r,n,i,a,o,s,l,c,u,h){for(var p=e.indexArray,d=e.layoutVertexArray,f=e.segments.prepareSegment(4*t.length,d,p,this.canOverlap?a.sortKey:void 0),m=this.glyphOffsetArray.length,g=f.vertexLength,y=this.allowVerticalPlacement&&o===ic.vertical?Math.PI/2:0,v=a.text&&a.text.sections,x=0;x<t.length;x++){var b=t[x],_=b.tl,w=b.tr,k=b.bl,T=b.br,S=b.tex,A=b.pixelOffsetTL,M=b.pixelOffsetBR,E=b.minFontScaleX,C=b.minFontScaleY,P=b.glyphOffset,L=b.isSDF,I=b.sectionIndex,z=f.vertexLength,O=P[1];tu(d,s.x,s.y,_.x,O+_.y,S.x,S.y,r,L,A.x,A.y,E,C),tu(d,s.x,s.y,w.x,O+w.y,S.x+S.w,S.y,r,L,M.x,A.y,E,C),tu(d,s.x,s.y,k.x,O+k.y,S.x,S.y+S.h,r,L,A.x,M.y,E,C),tu(d,s.x,s.y,T.x,O+T.y,S.x+S.w,S.y+S.h,r,L,M.x,M.y,E,C),ru(e.dynamicLayoutVertexArray,s,y),p.emplaceBack(z,z+1,z+2),p.emplaceBack(z+1,z+2,z+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),x!==t.length-1&&I===t[x+1].sectionIndex||e.programConfigurations.populatePaintArrays(d.length,a,a.index,{},h,v&&v[I])}e.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,g,l,c,s.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)},ou.prototype._addCollisionDebugVertex=function(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))},ou.prototype.addCollisionDebugVertices=function(e,t,r,n,i,o,s){var l=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),c=l.vertexLength,u=i.layoutVertexArray,h=i.collisionVertexArray,p=s.anchorX,d=s.anchorY;this._addCollisionDebugVertex(u,h,o,p,d,new a(e,t)),this._addCollisionDebugVertex(u,h,o,p,d,new a(r,t)),this._addCollisionDebugVertex(u,h,o,p,d,new a(r,n)),this._addCollisionDebugVertex(u,h,o,p,d,new a(e,n)),l.vertexLength+=4;var f=i.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4},ou.prototype.addDebugCollisionBoxes=function(e,t,r,n){for(var i=e;i<t;i++){var a=this.collisionBoxArray.get(i),o=a.x1,s=a.y1,l=a.x2,c=a.y2;this.addCollisionDebugVertices(o,s,l,c,n?this.textCollisionBox:this.iconCollisionBox,a.anchorPoint,r)}},ou.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new au(ha,Tl.members,ba),this.iconCollisionBox=new au(ha,Tl.members,ba);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},ou.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,n,i,a,o,s,l){for(var c={},u=t;u<r;u++){var h=e.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var p=n;p<i;p++){var d=e.get(p);c.verticalTextBox={x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,anchorPointX:d.anchorPointX,anchorPointY:d.anchorPointY},c.verticalTextFeatureIndex=d.featureIndex;break}for(var f=a;f<o;f++){var m=e.get(f);c.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.iconFeatureIndex=m.featureIndex;break}for(var g=s;g<l;g++){var y=e.get(g);c.verticalIconBox={x1:y.x1,y1:y.y1,x2:y.x2,y2:y.y2,anchorPointX:y.anchorPointX,anchorPointY:y.anchorPointY},c.verticalIconFeatureIndex=y.featureIndex;break}return c},ou.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},ou.prototype.hasTextData=function(){return this.text.segments.get().length>0},ou.prototype.hasIconData=function(){return this.icon.segments.get().length>0},ou.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},ou.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},ou.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},ou.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i<n;i+=4)e.indexArray.emplaceBack(i,i+1,i+2),e.indexArray.emplaceBack(i+1,i+2,i+3)},ou.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[],o=0;o<this.symbolInstances.length;++o){a.push(o);var s=this.symbolInstances.get(o);n.push(0|Math.round(t*s.anchorX+r*s.anchorY)),i.push(s.featureIndex)}return a.sort((function(e,t){return n[e]-n[t]||i[t]-i[e]})),a},ou.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},ou.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,n=this.symbolInstanceIndexes;r<n.length;r+=1){var i=n[r],a=this.symbolInstances.get(i);this.featureSortOrder.push(a.featureIndex),[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e,r,n){e>=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),a.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,a.verticalPlacedTextSymbolIndex),a.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.placedIconSymbolIndex),a.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,a.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},ii("SymbolBucket",ou,{omit:["layers","collisionBoxArray","features","compareText"]}),ou.MAX_GLYPHS=65535,ou.addDynamicAttributes=ru;var su=new $i({"symbol-placement":new Vi(De.layout_symbol["symbol-placement"]),"symbol-spacing":new Vi(De.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Vi(De.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new qi(De.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Vi(De.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Vi(De.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new Vi(De.layout_symbol["icon-ignore-placement"]),"icon-optional":new Vi(De.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Vi(De.layout_symbol["icon-rotation-alignment"]),"icon-size":new qi(De.layout_symbol["icon-size"]),"icon-text-fit":new Vi(De.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Vi(De.layout_symbol["icon-text-fit-padding"]),"icon-image":new qi(De.layout_symbol["icon-image"]),"icon-rotate":new qi(De.layout_symbol["icon-rotate"]),"icon-padding":new Vi(De.layout_symbol["icon-padding"]),"icon-keep-upright":new Vi(De.layout_symbol["icon-keep-upright"]),"icon-offset":new qi(De.layout_symbol["icon-offset"]),"icon-anchor":new qi(De.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Vi(De.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Vi(De.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Vi(De.layout_symbol["text-rotation-alignment"]),"text-field":new qi(De.layout_symbol["text-field"]),"text-font":new qi(De.layout_symbol["text-font"]),"text-size":new qi(De.layout_symbol["text-size"]),"text-max-width":new qi(De.layout_symbol["text-max-width"]),"text-line-height":new Vi(De.layout_symbol["text-line-height"]),"text-letter-spacing":new qi(De.layout_symbol["text-letter-spacing"]),"text-justify":new qi(De.layout_symbol["text-justify"]),"text-radial-offset":new qi(De.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Vi(De.layout_symbol["text-variable-anchor"]),"text-anchor":new qi(De.layout_symbol["text-anchor"]),"text-max-angle":new Vi(De.layout_symbol["text-max-angle"]),"text-writing-mode":new Vi(De.layout_symbol["text-writing-mode"]),"text-rotate":new qi(De.layout_symbol["text-rotate"]),"text-padding":new Vi(De.layout_symbol["text-padding"]),"text-keep-upright":new Vi(De.layout_symbol["text-keep-upright"]),"text-transform":new qi(De.layout_symbol["text-transform"]),"text-offset":new qi(De.layout_symbol["text-offset"]),"text-allow-overlap":new Vi(De.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new Vi(De.layout_symbol["text-ignore-placement"]),"text-optional":new Vi(De.layout_symbol["text-optional"])}),lu={paint:new $i({"icon-opacity":new qi(De.paint_symbol["icon-opacity"]),"icon-color":new qi(De.paint_symbol["icon-color"]),"icon-halo-color":new qi(De.paint_symbol["icon-halo-color"]),"icon-halo-width":new qi(De.paint_symbol["icon-halo-width"]),"icon-halo-blur":new qi(De.paint_symbol["icon-halo-blur"]),"icon-translate":new Vi(De.paint_symbol["icon-translate"]),"icon-translate-anchor":new Vi(De.paint_symbol["icon-translate-anchor"]),"text-opacity":new qi(De.paint_symbol["text-opacity"]),"text-color":new qi(De.paint_symbol["text-color"],{runtimeType:Ze,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new qi(De.paint_symbol["text-halo-color"]),"text-halo-width":new qi(De.paint_symbol["text-halo-width"]),"text-halo-blur":new qi(De.paint_symbol["text-halo-blur"]),"text-translate":new Vi(De.paint_symbol["text-translate"]),"text-translate-anchor":new Vi(De.paint_symbol["text-translate-anchor"])}),layout:su},cu=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:He,this.defaultValue=e};cu.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},cu.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},cu.prototype.outputDefined=function(){return!1},cu.prototype.serialize=function(){return null},ii("FormatSectionOverride",cu,{omit:["defaultValue"]});var uu=function(e){function t(t){e.call(this,t,lu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],a=0,o=n;a<o.length;a+=1){var s=o[a];i.indexOf(s)<0&&i.push(s)}this.layout._values["text-writing-mode"]=i}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(e,t,r,n){var i,a=this.layout.get(e).evaluate(t,{},r,n),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||ln(o.value)||!a?a:(i=t.properties,a.replace(/{([^{}]+)}/g,(function(e,t){return t in i?String(i[t]):""})))},t.prototype.createBucket=function(e){return new ou(e)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var e=0,r=lu.paint.overridableProperties;e<r.length;e+=1){var n=r[e];if(t.hasPaintOverride(this.layout,n)){var i=this.paint.get(n),a=new cu(i),o=new sn(a,i.property.specification),s=null;s="constant"===i.value.kind||"source"===i.value.kind?new un("source",o):new hn("composite",o,i.value.zoomStops,i.value._interpolationType),this.paint._values[n]=new Ni(i.property,s,i.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(e,r,n){return!(!this.layout||r.isDataDriven()||n.isDataDriven())&&t.hasPaintOverride(this.layout,e)},t.hasPaintOverride=function(e,t){var r=e.get("text-field"),n=lu.paint.properties[t],i=!1,a=function(e){for(var t=0,r=e;t<r.length;t+=1){var a=r[t];if(n.overrides&&n.overrides.hasOverride(a))return void(i=!0)}};if("constant"===r.value.kind&&r.value.value instanceof ut)a(r.value.value.sections);else if("source"===r.value.kind){var o=function(e){if(!i)if(e instanceof gt&&ft(e.value)===Je){var t=e.value;a(t.sections)}else e instanceof bt?a(e.sections):e.eachChild(o)},s=r.value;s._styleExpression&&o(s._styleExpression.expression)}return i},t}(Xi),hu={paint:new $i({"background-color":new Vi(De.paint_background["background-color"]),"background-pattern":new Gi(De.paint_background["background-pattern"]),"background-opacity":new Vi(De.paint_background["background-opacity"])})},pu=function(e){function t(t){e.call(this,t,hu)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Xi),du={paint:new $i({"raster-opacity":new Vi(De.paint_raster["raster-opacity"]),"raster-hue-rotate":new Vi(De.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Vi(De.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Vi(De.paint_raster["raster-brightness-max"]),"raster-saturation":new Vi(De.paint_raster["raster-saturation"]),"raster-contrast":new Vi(De.paint_raster["raster-contrast"]),"raster-resampling":new Vi(De.paint_raster["raster-resampling"]),"raster-fade-duration":new Vi(De.paint_raster["raster-fade-duration"])})},fu=function(e){function t(t){e.call(this,t,du)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Xi),mu=function(e){function t(t){e.call(this,t,{}),this.implementation=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},t.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(e){this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},t.prototype.onRemove=function(e){this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},t}(Xi),gu={circle:qo,heatmap:Qo,hillshade:ts,fill:Vs,"fill-extrusion":ol,line:xl,symbol:uu,background:pu,raster:fu},yu=s.HTMLImageElement,vu=s.HTMLCanvasElement,xu=s.HTMLVideoElement,bu=s.ImageData,_u=s.ImageBitmap,wu=function(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)};wu.prototype.update=function(e,t,r){var n=e.width,i=e.height,a=(!this.size||this.size[0]!==n||this.size[1]!==i)&&!r,o=this.context,s=o.gl;if(this.useMipmap=Boolean(t&&t.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),a)this.size=[n,i],e instanceof yu||e instanceof vu||e instanceof xu||e instanceof bu||_u&&e instanceof _u?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,e):s.texImage2D(s.TEXTURE_2D,0,this.format,n,i,0,this.format,s.UNSIGNED_BYTE,e.data);else{var l=r||{x:0,y:0},c=l.x,u=l.y;e instanceof yu||e instanceof vu||e instanceof xu||e instanceof bu||_u&&e instanceof _u?s.texSubImage2D(s.TEXTURE_2D,0,c,u,s.RGBA,s.UNSIGNED_BYTE,e):s.texSubImage2D(s.TEXTURE_2D,0,c,u,n,i,s.RGBA,s.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},wu.prototype.bind=function(e,t,r){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)},wu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1===0},wu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ku=function(e){var t=this;this._callback=e,this._triggered=!1,"undefined"!==typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ku.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){e._triggered=!1,e._callback()}),0))},ku.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Tu=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},v(["receive","process"],this),this.invoker=new ku(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=M()?e:s};function Su(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}Tu.prototype.send=function(e,t,r,n,i){var a=this;void 0===i&&(i=!1);var o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);var s=P(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!r,targetMapId:n,mustQueue:i,sourceMapId:this.mapId,data:li(t,s)},s),{cancel:function(){r&&delete a.callbacks[o],a.target.postMessage({id:o,type:"<cancel>",targetMapId:n,sourceMapId:a.mapId})}}},Tu.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];var n=this.cancelCallbacks[r];delete this.cancelCallbacks[r],n&&n()}else M()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},Tu.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},Tu.prototype.processTask=function(e,t){var r=this;if("<response>"===t.type){var n=this.callbacks[e];delete this.callbacks[e],n&&(t.error?n(ci(t.error)):n(null,ci(t.data)))}else{var i=!1,a=P(this.globalScope)?void 0:[],o=t.hasCallback?function(t,n){i=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:t?li(t):null,data:li(n,a)},a)}:function(e){i=!0},s=null,l=ci(t.data);if(this.parent[t.type])s=this.parent[t.type](t.sourceMapId,l,o);else if(this.parent.getWorkerSource){var c=t.type.split(".");s=this.parent.getWorkerSource(t.sourceMapId,c[0],l.source)[c[1]](l,o)}else o(new Error("Could not find function "+t.type));!i&&s&&s.cancel&&(this.cancelCallbacks[e]=s.cancel)}},Tu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Au=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};Au.prototype.setNorthEast=function(e){return this._ne=e instanceof Eu?new Eu(e.lng,e.lat):Eu.convert(e),this},Au.prototype.setSouthWest=function(e){return this._sw=e instanceof Eu?new Eu(e.lng,e.lat):Eu.convert(e),this},Au.prototype.extend=function(e){var t,r,n=this._sw,i=this._ne;if(e instanceof Eu)t=e,r=e;else{if(!(e instanceof Au)){if(Array.isArray(e)){if(4===e.length||e.every(Array.isArray)){var a=e;return this.extend(Au.convert(a))}var o=e;return this.extend(Eu.convert(o))}return this}if(t=e._sw,r=e._ne,!t||!r)return this}return n||i?(n.lng=Math.min(t.lng,n.lng),n.lat=Math.min(t.lat,n.lat),i.lng=Math.max(r.lng,i.lng),i.lat=Math.max(r.lat,i.lat)):(this._sw=new Eu(t.lng,t.lat),this._ne=new Eu(r.lng,r.lat)),this},Au.prototype.getCenter=function(){return new Eu((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Au.prototype.getSouthWest=function(){return this._sw},Au.prototype.getNorthEast=function(){return this._ne},Au.prototype.getNorthWest=function(){return new Eu(this.getWest(),this.getNorth())},Au.prototype.getSouthEast=function(){return new Eu(this.getEast(),this.getSouth())},Au.prototype.getWest=function(){return this._sw.lng},Au.prototype.getSouth=function(){return this._sw.lat},Au.prototype.getEast=function(){return this._ne.lng},Au.prototype.getNorth=function(){return this._ne.lat},Au.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Au.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Au.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Au.prototype.contains=function(e){var t=Eu.convert(e),r=t.lng,n=t.lat,i=this._sw.lat<=n&&n<=this._ne.lat,a=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(a=this._sw.lng>=r&&r>=this._ne.lng),i&&a},Au.convert=function(e){return!e||e instanceof Au?e:new Au(e)};var Mu=6371008.8,Eu=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Eu.prototype.wrap=function(){return new Eu(p(this.lng,-180,180),this.lat)},Eu.prototype.toArray=function(){return[this.lng,this.lat]},Eu.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Eu.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return Mu*Math.acos(Math.min(i,1))},Eu.prototype.toBounds=function(e){void 0===e&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Au(new Eu(this.lng-r,this.lat-t),new Eu(this.lng+r,this.lat+t))},Eu.convert=function(e){if(e instanceof Eu)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Eu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"===typeof e&&null!==e)return new Eu(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Cu=2*Math.PI*Mu;function Pu(e){return Cu*Math.cos(e*Math.PI/180)}function Lu(e){return(180+e)/360}function Iu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function zu(e,t){return e/Pu(t)}function Ou(e){var t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}var Ru=function(e,t,r){void 0===r&&(r=0),this.x=+e,this.y=+t,this.z=+r};Ru.fromLngLat=function(e,t){void 0===t&&(t=0);var r=Eu.convert(e);return new Ru(Lu(r.lng),Iu(r.lat),zu(t,r.lat))},Ru.prototype.toLngLat=function(){return new Eu(360*this.x-180,Ou(this.y))},Ru.prototype.toAltitude=function(){return e=this.z,t=this.y,e*Pu(Ou(t));var e,t},Ru.prototype.meterInMercatorCoordinateUnits=function(){return 1/Cu*(e=Ou(this.y),1/Math.cos(e*Math.PI/180));var e};var Du=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=Bu(0,e,e,t,r)};Du.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Du.prototype.url=function(e,t){var r=function(e,t,r){var n=Su(256*e,256*(t=Math.pow(2,r)-t-1),r),i=Su(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+i[0]+","+i[1]}(this.x,this.y,this.z),n=function(e,t,r){for(var n,i="",a=e;a>0;a--)i+=(t&(n=1<<a-1)?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===t?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",n).replace("{bbox-epsg-3857}",r)},Du.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new a((e.x*t-this.x)*po,(e.y*t-this.y)*po)},Du.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var ju=function(e,t){this.wrap=e,this.canonical=t,this.key=Bu(e,t.z,t.z,t.x,t.y)},Fu=function(e,t,r,n,i){this.overscaledZ=e,this.wrap=t,this.canonical=new Du(r,+n,+i),this.key=Bu(t,e,r,n,i)};function Bu(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);var a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}Fu.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},Fu.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new Fu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Fu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},Fu.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?Bu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):Bu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},Fu.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},Fu.prototype.children=function(e){if(this.overscaledZ>=e)return[new Fu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new Fu(t,this.wrap,t,r,n),new Fu(t,this.wrap,t,r+1,n),new Fu(t,this.wrap,t,r,n+1),new Fu(t,this.wrap,t,r+1,n+1)]},Fu.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},Fu.prototype.wrapped=function(){return new Fu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.unwrapTo=function(e){return new Fu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},Fu.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Fu.prototype.toUnwrapped=function(){return new ju(this.wrap,this.canonical)},Fu.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Fu.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new Ru(e.x-this.wrap,e.y))},ii("CanonicalTileID",Du),ii("OverscaledTileID",Fu,{omit:["posMatrix"]});var Nu=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return T('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var n=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var i=0;i<n;i++)this.data[this._idx(-1,i)]=this.data[this._idx(0,i)],this.data[this._idx(n,i)]=this.data[this._idx(n-1,i)],this.data[this._idx(i,-1)]=this.data[this._idx(i,0)],this.data[this._idx(i,n)]=this.data[this._idx(i,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Nu.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[n],r[n+1],r[n+2])},Nu.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Nu.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},Nu.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},Nu.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},Nu.prototype.getPixels=function(){return new Yo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Nu.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}for(var s=-t*this.dim,l=-r*this.dim,c=a;c<o;c++)for(var u=n;u<i;u++)this.data[this._idx(u,c)]=e.data[this._idx(u+s,c+l)]},ii("DEMData",Nu);var Uu=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Uu.prototype.encode=function(e){return this._stringToNumber[e]},Uu.prototype.decode=function(e){return this._numberToString[e]};var Vu=function(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i},qu={geometry:{configurable:!0}};qu.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},qu.geometry.set=function(e){this._geometry=e},Vu.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e},Object.defineProperties(Vu.prototype,qu);var Hu=function(){this.state={},this.stateChanges={},this.deletedStates={}};Hu.prototype.updateState=function(e,t,r){var n=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},d(this.stateChanges[e][n],r),null===this.deletedStates[e])for(var i in this.deletedStates[e]={},this.state[e])i!==n&&(this.deletedStates[e][i]=null);else if(this.deletedStates[e]&&null===this.deletedStates[e][n])for(var a in this.deletedStates[e][n]={},this.state[e][n])r[a]||(this.deletedStates[e][n][a]=null);else for(var o in r)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][o]&&delete this.deletedStates[e][n][o]},Hu.prototype.removeFeatureState=function(e,t,r){if(null!==this.deletedStates[e]){var n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}},Hu.prototype.getState=function(e,t){var r=String(t),n=this.state[e]||{},i=this.stateChanges[e]||{},a=d({},n[r],i[r]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){var o=this.deletedStates[e][t];if(null===o)return{};for(var s in o)delete a[s]}return a},Hu.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},Hu.prototype.coalesceChanges=function(e,t){var r={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var i={};for(var a in this.stateChanges[n])this.state[n][a]||(this.state[n][a]={}),d(this.state[n][a],this.stateChanges[n][a]),i[a]=this.state[n][a];r[n]=i}for(var o in this.deletedStates){this.state[o]=this.state[o]||{};var s={};if(null===this.deletedStates[o])for(var l in this.state[o])s[l]={},this.state[o][l]={};else for(var c in this.deletedStates[o]){if(null===this.deletedStates[o][c])this.state[o][c]={};else for(var u=0,h=Object.keys(this.deletedStates[o][c]);u<h.length;u+=1){var p=h[u];delete this.state[o][c][p]}s[c]=this.state[o][c]}r[o]=r[o]||{},d(r[o],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(var f in e)e[f].setFeatureState(r,t)};var Gu=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Jn(po,16,0),this.grid3D=new Jn(po,16,0),this.featureIndexArray=new Ia,this.promoteId=t};function Wu(e,t,r,n,i){return b(e,(function(e,a){var o=t instanceof Ui?t.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function $u(e){for(var t=1/0,r=1/0,n=-1/0,i=-1/0,a=0,o=e;a<o.length;a+=1){var s=o[a];t=Math.min(t,s.x),r=Math.min(r,s.y),n=Math.max(n,s.x),i=Math.max(i,s.y)}return{minX:t,minY:r,maxX:n,maxY:i}}function Zu(e,t){return t-e}Gu.prototype.insert=function(e,t,r,n,i,a){var o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);for(var s=a?this.grid3D:this.grid,l=0;l<t.length;l++){for(var c=t[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var p=c[h];u[0]=Math.min(u[0],p.x),u[1]=Math.min(u[1],p.y),u[2]=Math.max(u[2],p.x),u[3]=Math.max(u[3],p.y)}u[0]<po&&u[1]<po&&u[2]>=0&&u[3]>=0&&s.insert(o,u[0],u[1],u[2],u[3])}},Gu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Js.VectorTile(new Ll(this.rawTileData)).layers,this.sourceLayerCoder=new Uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Gu.prototype.query=function(e,t,r,n){var i=this;this.loadVTLayers();for(var o=e.params||{},s=po/e.tileSize/e.scale,l=kn(o.filter),c=e.queryGeometry,u=e.queryPadding*s,h=$u(c),p=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),d=$u(e.cameraQueryGeometry),f=this.grid3D.query(d.minX-u,d.minY-u,d.maxX+u,d.maxY+u,(function(t,r,n,i){return function(e,t,r,n,i){for(var o=0,s=e;o<s.length;o+=1){var l=s[o];if(t<=l.x&&r<=l.y&&n>=l.x&&i>=l.y)return!0}var c=[new a(t,r),new a(t,i),new a(n,i),new a(n,r)];if(e.length>2)for(var u=0,h=c;u<h.length;u+=1)if(Co(e,h[u]))return!0;for(var p=0;p<e.length-1;p++)if(Po(e[p],e[p+1],c))return!0;return!1}(e.cameraQueryGeometry,t-u,r-u,n+u,i+u)})),m=0,g=f;m<g.length;m+=1){var y=g[m];p.push(y)}p.sort(Zu);for(var v,x={},b=function(a){var u=p[a];if(u!==v){v=u;var h=i.featureIndexArray.get(u),d=null;i.loadMatchingFeature(x,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,o.layers,o.availableImages,t,r,n,(function(t,r,n){return d||(d=go(t)),r.queryIntersectsFeature(c,t,n,d,i.z,e.transform,s,e.pixelPosMatrix)}))}},_=0;_<p.length;_++)b(_);return x},Gu.prototype.loadMatchingFeature=function(e,t,r,n,i,a,o,s,l,c,u){var h=this.bucketLayerIDs[t];if(!a||function(e,t){for(var r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,h)){var p=this.sourceLayerCoder.decode(r),f=this.vtLayers[p].feature(n);if(i.needGeometry){var m=yo(f,!0);if(!i.filter(new zi(this.tileID.overscaledZ),m,this.tileID.canonical))return}else if(!i.filter(new zi(this.tileID.overscaledZ),f))return;for(var g=this.getId(f,p),y=0;y<h.length;y++){var v=h[y];if(!(a&&a.indexOf(v)<0)){var x=s[v];if(x){var b={};void 0!==g&&c&&(b=c.getState(x.sourceLayer||"_geojsonTileLayer",g));var _=d({},l[v]);_.paint=Wu(_.paint,x.paint,f,b,o),_.layout=Wu(_.layout,x.layout,f,b,o);var w=!u||u(f,x,b);if(w){var k=new Vu(f,this.z,this.x,this.y,g);k.layer=_;var T=e[v];void 0===T&&(T=e[v]=[]),T.push({featureIndex:n,feature:k,intersectionZ:w})}}}}}},Gu.prototype.lookupSymbolFeatures=function(e,t,r,n,i,a,o,s){var l={};this.loadVTLayers();for(var c=kn(i),u=0,h=e;u<h.length;u+=1){var p=h[u];this.loadMatchingFeature(l,r,n,p,c,a,o,s,t)}return l},Gu.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var n=0,i=r[t];n<i.length;n+=1)if(e===i[n])return!0;return!1},Gu.prototype.getId=function(e,t){var r=e.id;if(this.promoteId){var n="string"===typeof this.promoteId?this.promoteId:this.promoteId[t];"boolean"===typeof(r=e.properties[n])&&(r=Number(r))}return r},ii("FeatureIndex",Gu,{omit:["rawTileData","sourceLayerCoder"]});var Xu=function(e,t){this.tileID=e,this.uid=m(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Xu.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<B.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Xu.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},Xu.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var n in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){var r={};if(!t)return r;for(var n=function(){var e=a[i],n=e.layerIds.map((function(e){return t.getLayer(e)})).filter(Boolean);if(0!==n.length){e.layers=n,e.stateDependentLayerIds&&(e.stateDependentLayers=e.stateDependentLayerIds.map((function(e){return n.filter((function(t){return t.id===e}))[0]})));for(var o=0,s=n;o<s.length;o+=1){var l=s[o];r[l.id]=e}}},i=0,a=e;i<a.length;i+=1)n();return r}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var i=this.buckets[n];if(i instanceof ou){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var a in this.buckets){var o=this.buckets[a];if(o instanceof ou&&o.hasRTLText){this.hasRTLText=!0,Ii.isLoading()||Ii.isLoaded()||"deferred"!==Pi()||Li();break}}for(var s in this.queryPadding=0,this.buckets){var l=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(s).queryRadius(l))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new Ta},Xu.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Xu.prototype.getBucket=function(e){return this.buckets[e.id]},Xu.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var n=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new wu(e,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new wu(e,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},Xu.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Xu.prototype.queryRenderedFeatures=function(e,t,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}},Xu.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var n=r.loadVTLayers(),i=t?t.sourceLayer:"",a=n._geojsonTileLayer||n[i];if(a)for(var o=kn(t&&t.filter),s=this.tileID.canonical,l=s.z,c=s.x,u=s.y,h={z:l,x:c,y:u},p=0;p<a.length;p++){var d=a.feature(p);if(o.needGeometry){var f=yo(d,!0);if(!o.filter(new zi(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!o.filter(new zi(this.tileID.overscaledZ),d))continue;var m=r.getId(d,i),g=new Vu(d,l,c,u,m);g.tile=h,e.push(g)}}},Xu.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},Xu.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Xu.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=E(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var n=Date.now(),i=!1;if(this.expirationTime>n)i=!1;else if(t)if(this.expirationTime<t)i=!0;else{var a=this.expirationTime-t;a?this.expirationTime=n+Math.max(a,3e4):i=!0}else i=!0;i?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Xu.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},Xu.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(e).length){var r=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(t.style.hasLayer(n)){var i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=e[a];if(o&&s&&0!==Object.keys(s).length){i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}}},Xu.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},Xu.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<B.now()},Xu.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Xu.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=B.now()+e},Xu.prototype.setDependencies=function(e,t){for(var r={},n=0,i=t;n<i.length;n+=1)r[i[n]]=!0;this.dependencies[e]=r},Xu.prototype.hasDependency=function(e,t){for(var r=0,n=e;r<n.length;r+=1){var i=n[r],a=this.dependencies[i];if(a)for(var o=0,s=t;o<s.length;o+=1)if(a[s[o]])return!0}return!1};var Yu=s.performance,Ku=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},Yu.mark(this._marks.start)};Ku.prototype.finish=function(){Yu.mark(this._marks.end);var e=Yu.getEntriesByName(this._marks.measure);return 0===e.length&&(Yu.measure(this._marks.measure,this._marks.start,this._marks.end),e=Yu.getEntriesByName(this._marks.measure),Yu.clearMarks(this._marks.start),Yu.clearMarks(this._marks.end),Yu.clearMeasures(this._marks.measure)),e},e.Actor=Tu,e.AlphaImage=Xo,e.CanonicalTileID=Du,e.CollisionBoxArray=Ta,e.Color=st,e.DEMData=Nu,e.DataConstantProperty=Vi,e.DictionaryCoder=Uu,e.EXTENT=po,e.ErrorEvent=Oe,e.EvaluationParameters=zi,e.Event=ze,e.Evented=Re,e.FeatureIndex=Gu,e.FillBucket=Bs,e.FillExtrusionBucket=rl,e.ImageAtlas=nc,e.ImagePosition=tc,e.LineBucket=fl,e.LngLat=Eu,e.LngLatBounds=Au,e.MercatorCoordinate=Ru,e.ONE_EM=El,e.OverscaledTileID=Fu,e.Point=a,e.Point$1=a,e.Properties=$i,e.Protobuf=Ll,e.RGBAImage=Yo,e.RequestManager=W,e.RequestPerformance=Ku,e.ResourceType=xe,e.SegmentVector=Oa,e.SourceFeatureState=Hu,e.StructArrayLayout1ui2=_a,e.StructArrayLayout2f1f2i16=pa,e.StructArrayLayout2i4=ta,e.StructArrayLayout3ui6=fa,e.StructArrayLayout4i8=ra,e.SymbolBucket=ou,e.Texture=wu,e.Tile=Xu,e.Transitionable=Di,e.Uniform1f=Xa,e.Uniform1i=Za,e.Uniform2f=Ya,e.Uniform3f=Ka,e.Uniform4f=Ja,e.UniformColor=Qa,e.UniformMatrix4f=to,e.UnwrappedTileID=ju,e.ValidationError=je,e.WritingMode=ic,e.ZoomHistory=ui,e.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},e.addDynamicAttributes=ru,e.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),a=null;e.forEach((function(e,o){t(e,(function(e,t){e&&(a=e),i[o]=t,0===--n&&r(a,i)}))}))},e.bezier=c,e.bindAll=v,e.browser=B,e.cacheEntryPossiblyAdded=function(e){++ye>he&&(e.getActor().send("enforceCacheSizeLimit",ue),ye=0)},e.clamp=h,e.clearTileCache=function(e){var t=s.caches.delete(ce);e&&t.catch(e).then((function(){return e()}))},e.clipLine=zc,e.clone=function(e){var t=new Do(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=w,e.clone$2=function(e){var t=new Do(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=Sl,e.config=N,e.create=function(){var e=new Do(16);return Do!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=function(){var e=new Do(9);return Do!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},e.create$2=function(){var e=new Do(4);return Do!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},e.createCommonjsModule=t,e.createExpression=cn,e.createLayout=Qi,e.createStyleLayer=function(e){return"custom"===e.type?new mu(e):new gu[e.type](e)},e.cross=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e},e.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"===typeof t&&null!==t&&null!==r){if("object"!==typeof r)return!1;if(Object.keys(t).length!==Object.keys(r).length)return!1;for(var i in t)if(!e(t[i],r[i]))return!1;return!0}return t===r},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.ease=u,e.emitValidationErrors=Kn,e.endsWith=x,e.enforceCacheSizeLimit=function(e){pe(),re&&re.then((function(t){t.keys().then((function(r){for(var n=0;n<r.length-e;n++)t.delete(r[n])}))}))},e.evaluateSizeForFeature=kc,e.evaluateSizeForZoom=Tc,e.evaluateVariableOffset=Wc,e.evented=Ci,e.extend=d,e.featureFilter=kn,e.filterObject=_,e.fromRotation=function(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.getAnchorAlignment=yc,e.getAnchorJustification=$c,e.getArrayBuffer=Te,e.getImage=Pe,e.getJSON=function(e,t){return ke(d(e,{type:"json"}),t)},e.getRTLTextPluginStatus=Pi,e.getReferrer=_e,e.getVideo=function(e,t){var r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(var n=0;n<e.length;n++){var i=s.document.createElement("source");Ae(e[n])||(r.crossOrigin="Anonymous"),i.src=e[n],r.appendChild(i)}return{cancel:function(){}}},e.identity=jo,e.invert=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-p*f,A=u*y-d*f,M=h*g-p*m,E=h*y-d*m,C=p*y-d*g,P=v*C-x*E+b*M+_*A-w*S+k*T;return P?(P=1/P,e[0]=(s*C-l*E+c*M)*P,e[1]=(i*E-n*C-a*M)*P,e[2]=(m*k-g*w+y*_)*P,e[3]=(p*w-h*k-d*_)*P,e[4]=(l*A-o*C-c*S)*P,e[5]=(r*C-i*A+a*S)*P,e[6]=(g*b-f*k-y*x)*P,e[7]=(u*k-p*b+d*x)*P,e[8]=(o*E-s*A+c*T)*P,e[9]=(n*A-r*E-a*T)*P,e[10]=(f*w-m*b+y*v)*P,e[11]=(h*b-u*w-d*v)*P,e[12]=(s*S-o*M-l*T)*P,e[13]=(r*M-n*S+i*T)*P,e[14]=(m*x-f*_-g*v)*P,e[15]=(u*_-h*x+p*v)*P,e):null},e.isChar=hi,e.isMapboxURL=$,e.keysDifference=function(e,t){var r=[];for(var n in e)n in t||r.push(n);return r},e.makeRequest=ke,e.mapObject=b,e.mercatorXfromLng=Lu,e.mercatorYfromLat=Iu,e.mercatorZfromAltitude=zu,e.mul=Bo,e.multiply=Fo,e.mvt=Js,e.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.normalize=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.number=er,e.offscreenCanvasSupported=ve,e.ortho=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e},e.parseGlyphPBF=function(e){return new Ll(e).readFields(Kl,[])},e.pbf=Ll,e.performSymbolLayout=function(e,t,r,n,i,a,o){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=po/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){var h=e.textSizeData,p=h.minZoom,d=h.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new zi(p),o),c["text-size"].possiblyEvaluate(new zi(d),o)]}if("composite"===e.iconSizeData.kind){var f=e.iconSizeData,m=f.minZoom,g=f.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new zi(m),o),c["icon-size"].possiblyEvaluate(new zi(g),o)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new zi(e.zoom+1),o),u.textMaxSize=c["text-size"].possiblyEvaluate(new zi(18));for(var y=l.get("text-line-height")*El,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var a=k[w],s=l.get("text-font").evaluate(a,{},o).join(","),c=b.evaluate(a,{},o),h=u.layoutTextSize.evaluate(a,{},o),p=u.layoutIconSize.evaluate(a,{},o),d={horizontal:{},vertical:void 0},f=a.text,m=[0,0];if(f){var g=f.toString(),_=l.get("text-letter-spacing").evaluate(a,{},o)*El,S=function(e){for(var t=0,r=e;t<r.length;t+=1)if(!di(r[t].charCodeAt(0)))return!1;return!0}(g)?_:0,A=l.get("text-anchor").evaluate(a,{},o),M=l.get("text-variable-anchor");if(!M){var E=l.get("text-radial-offset").evaluate(a,{},o);m=E?Wc(A,[E*El,Gc]):l.get("text-offset").evaluate(a,{},o).map((function(e){return e*El}))}var C=v?"center":l.get("text-justify").evaluate(a,{},o),P=l.get("symbol-placement"),L="point"===P?l.get("text-max-width").evaluate(a,{},o)*El:0,I=function(){e.allowVerticalPlacement&&pi(g)&&(d.vertical=lc(f,t,r,i,s,L,y,A,"left",S,m,ic.vertical,!0,P,h,c))};if(!v&&M){for(var z="auto"===C?M.map((function(e){return $c(e)})):[C],O=!1,R=0;R<z.length;R++){var D=z[R];if(!d.horizontal[D])if(O)d.horizontal[D]=d.horizontal[0];else{var j=lc(f,t,r,i,s,L,y,"center",D,S,m,ic.horizontal,!1,P,h,c);j&&(d.horizontal[D]=j,O=1===j.positionedLines.length)}}I()}else{"auto"===C&&(C=$c(A));var F=lc(f,t,r,i,s,L,y,A,C,S,m,ic.horizontal,!1,P,h,c);F&&(d.horizontal[C]=F),I(),pi(g)&&v&&x&&(d.vertical=lc(f,t,r,i,s,L,y,A,C,S,m,ic.vertical,!1,P,h,c))}}var B=void 0,N=!1;if(a.icon&&a.icon.name){var U=n[a.icon.name];U&&(B=function(e,t,r){var n=yc(r),i=n.horizontalAlign,a=n.verticalAlign,o=t[0],s=t[1],l=o-e.displaySize[0]*i,c=l+e.displaySize[0],u=s-e.displaySize[1]*a;return{image:e,top:u,bottom:u+e.displaySize[1],left:l,right:c}}(i[a.icon.name],l.get("icon-offset").evaluate(a,{},o),l.get("icon-anchor").evaluate(a,{},o)),N=U.sdf,void 0===e.sdfIcons?e.sdfIcons=U.sdf:e.sdfIcons!==U.sdf&&T("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(U.pixelRatio!==e.pixelRatio||0!==l.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}var V=Kc(d.horizontal)||d.vertical;e.iconsInText=!!V&&V.iconsInText,(V||B)&&function(e,t,r,n,i,a,o,s,l,c,u){var h=a.textMaxSize.evaluate(t,{});void 0===h&&(h=o);var p,d=e.layers[0].layout,f=d.get("icon-offset").evaluate(t,{},u),m=Kc(r.horizontal),g=24,y=o/g,v=e.tilePixelRatio*y,x=e.tilePixelRatio*h/g,b=e.tilePixelRatio*s,_=e.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*e.tilePixelRatio,k=d.get("icon-padding")*e.tilePixelRatio,S=d.get("text-max-angle")/180*Math.PI,A="map"===d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),M="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),E=d.get("symbol-placement"),C=_/2,P=d.get("icon-text-fit");n&&"none"!==P&&(e.allowVerticalPlacement&&r.vertical&&(p=xc(n,r.vertical,P,d.get("icon-text-fit-padding"),f,y)),m&&(n=xc(n,m,P,d.get("icon-text-fit-padding"),f,y)));var L=function(s,h){h.x<0||h.x>=po||h.y<0||h.y>=po||function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,S){var A,M,E,C,P,L=e.addToLineVertexArray(t,r),I=0,z=0,O=0,R=0,D=-1,j=-1,F={},B=Ba(""),N=0,U=0;if(void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(N=(A=s.layout.get("text-offset").evaluate(b,{},k).map((function(e){return e*El})))[0],U=A[1]):(N=s.layout.get("text-radial-offset").evaluate(b,{},k)*El,U=Gc),e.allowVerticalPlacement&&n.vertical){var V=s.layout.get("text-rotate").evaluate(b,{},k)+90,q=n.vertical;C=new Bc(l,t,c,u,h,q,p,d,f,V),o&&(P=new Bc(l,t,c,u,h,o,g,y,f,V))}if(i){var H=s.layout.get("icon-rotate").evaluate(b,{}),G="none"!==s.layout.get("icon-text-fit"),W=Oc(i,H,w,G),$=o?Oc(o,H,w,G):void 0;E=new Bc(l,t,c,u,h,i,g,y,!1,H),I=4*W.length;var Z=e.iconSizeData,X=null;"source"===Z.kind?(X=[_c*s.layout.get("icon-size").evaluate(b,{})])[0]>Xc&&T(e.layerIds[0]+': Value for "icon-size" is >= '+Zc+'. Reduce your "icon-size".'):"composite"===Z.kind&&((X=[_c*_.compositeIconSizes[0].evaluate(b,{},k),_c*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>Xc||X[1]>Xc)&&T(e.layerIds[0]+': Value for "icon-size" is >= '+Zc+'. Reduce your "icon-size".'),e.addSymbols(e.icon,W,X,x,v,b,!1,t,L.lineStartIndex,L.lineLength,-1,k),D=e.icon.placedSymbolArray.length-1,$&&(z=4*$.length,e.addSymbols(e.icon,$,X,x,v,b,ic.vertical,t,L.lineStartIndex,L.lineLength,-1,k),j=e.icon.placedSymbolArray.length-1)}for(var Y in n.horizontal){var K=n.horizontal[Y];if(!M){B=Ba(K.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);M=new Bc(l,t,c,u,h,K,p,d,f,J)}var Q=1===K.positionedLines.length;if(O+=Yc(e,t,K,a,s,f,b,m,L,n.vertical?ic.horizontal:ic.horizontalOnly,Q?Object.keys(n.horizontal):[Y],F,D,_,k),Q)break}n.vertical&&(R+=Yc(e,t,n.vertical,a,s,f,b,m,L,ic.vertical,["vertical"],F,j,_,k));var ee=M?M.boxStartIndex:e.collisionBoxArray.length,te=M?M.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=E?E.boxStartIndex:e.collisionBoxArray.length,ae=E?E.boxEndIndex:e.collisionBoxArray.length,oe=P?P.boxStartIndex:e.collisionBoxArray.length,se=P?P.boxEndIndex:e.collisionBoxArray.length,le=-1,ce=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ce(M,le),le=ce(C,le),le=ce(E,le);var ue=(le=ce(P,le))>-1?1:0;ue&&(le*=S/El),e.glyphOffsetArray.length>=ou.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,D,j,B,ee,te,re,ne,ie,ae,oe,se,c,O,R,I,z,ue,0,p,N,U,le)}(e,h,s,r,n,i,p,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,v,w,A,l,b,k,M,f,t,a,c,u,o)};if("line"===E)for(var I=0,z=zc(t.geometry,0,0,po,po);I<z.length;I+=1)for(var O=z[I],R=0,D=Lc(O,_,S,r.vertical||m,n,g,x,e.overscaling,po);R<D.length;R+=1){var j=D[R];m&&Jc(e,m.text,C,j)||L(O,j)}else if("line-center"===E)for(var F=0,B=t.geometry;F<B.length;F+=1){var N=B[F];if(N.length>1){var U=Pc(N,S,r.vertical||m,n,g,x);U&&L(N,U)}}else if("Polygon"===t.type)for(var V=0,q=Rs(t.geometry,0);V<q.length;V+=1){var H=q[V],G=Vc(H,16);L(H[0],new bc(G.x,G.y,0))}else if("LineString"===t.type)for(var W=0,$=t.geometry;W<$.length;W+=1){var Z=$[W];L(Z,new bc(Z[0].x,Z[0].y,0))}else if("Point"===t.type)for(var X=0,Y=t.geometry;X<Y.length;X+=1)for(var K=0,J=Y[X];K<J.length;K+=1){var Q=J[K];L([Q],new bc(Q.x,Q.y,0))}}(e,a,d,B,n,u,h,p,m,N,o)},w=0,k=e.features;w<k.length;w+=1)_();a&&e.generateCollisionDebugBuffers()},e.perspective=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(a=1/(n-i),e[10]=(i+n)*a,e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e},e.pick=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n];i in e&&(r[i]=e[i])}return r},e.plugin=Ii,e.polygonIntersectsPolygon=bo,e.postMapLoadEvent=le,e.postTurnstileEvent=oe,e.potpack=ec,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.register=ii,e.registerForPluginStateChange=function(e){return e({pluginStatus:Si,pluginURL:Ai}),Ci.on("pluginStateChange",e),e},e.renderColorRamp=Jo,e.rotate=function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l,e},e.rotateX=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+p*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=p*i-l*n,e},e.rotateZ=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+p*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=p*i-l*n,e},e.scale=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},e.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},e.setCacheLimits=function(e,t){ue=e,he=t},e.setRTLTextPlugin=function(e,t,r){if(void 0===r&&(r=!1),Si===bi||Si===_i||Si===wi)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ai=B.resolveURL(e),Si=bi,Ti=t,Ei(),r||Li()},e.sphericalToCartesian=function(e){var t=e[0],r=e[1],n=e[2];return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.sqrLen=Vo,e.styleSpec=De,e.sub=No,e.symbolSize=Sc,e.transformMat3=function(e,t,r){var n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e},e.transformMat4=Uo,e.translate=function(e,t,r){var n,i,a,o,s,l,c,u,h,p,d,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+p*y+t[13],e[14]=a*m+c*g+d*y+t[14],e[15]=o*m+u*g+f*y+t[15]),e},e.triggerPluginCompletionEvent=Mi,e.uniqueId=m,e.validateCustomStyleLayer=function(e){var t=[],r=e.id;return void 0===r&&t.push({message:"layers."+r+': missing required property "id"'}),void 0===e.render&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},e.validateLight=Zn,e.validateStyle=$n,e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.vectorTile=Js,e.version=r,e.warnOnce=T,e.webpSupported=U,e.window=s,e.wrap=p})),n(0,(function(e){function t(e){var r=typeof e;if("number"===r||"boolean"===r||"string"===r||void 0===e||null===e)return JSON.stringify(e);if(Array.isArray(e)){for(var n="[",i=0,a=e;i<a.length;i+=1)n+=t(a[i])+",";return n+"]"}for(var o=Object.keys(e).sort(),s="{",l=0;l<o.length;l++)s+=JSON.stringify(o[l])+":"+t(e[o[l]])+",";return s+"}"}function r(r){for(var n="",i=0,a=e.refProperties;i<a.length;i+=1)n+="/"+t(r[a[i]]);return n}var n=function(e){this.keyCache={},e&&this.replace(e)};n.prototype.replace=function(e){this._layerConfigs={},this._layers={},this.update(e,[])},n.prototype.update=function(t,n){for(var i=this,a=0,o=t;a<o.length;a+=1){var s=o[a];this._layerConfigs[s.id]=s;var l=this._layers[s.id]=e.createStyleLayer(s);l._featureFilter=e.featureFilter(l.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var c=0,u=n;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var p=function(e,t){for(var n={},i=0;i<e.length;i++){var a=t&&t[e[i].id]||r(e[i]);t&&(t[e[i].id]=a);var o=n[a];o||(o=n[a]=[]),o.push(e[i])}var s=[];for(var l in n)s.push(n[l]);return s}(e.values(this._layerConfigs),this.keyCache),d=0,f=p;d<f.length;d+=1){var m=f[d].map((function(e){return i._layers[e.id]})),g=m[0];if("none"!==g.visibility){var y=g.source||"",v=this.familiesBySource[y];v||(v=this.familiesBySource[y]={});var x=g.sourceLayer||"_geojsonTileLayer",b=v[x];b||(b=v[x]=[]),b.push(m)}}};var i=function(t){var r={},n=[];for(var i in t){var a=t[i],o=r[i]={};for(var s in a){var l=a[+s];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),o[s]={rect:c,metrics:l.metrics}}}}var u=e.potpack(n),h=u.w,p=u.h,d=new e.AlphaImage({width:h||1,height:p||1});for(var f in t){var m=t[f];for(var g in m){var y=m[+g];if(y&&0!==y.bitmap.width&&0!==y.bitmap.height){var v=r[f][g].rect;e.AlphaImage.copy(y.bitmap,d,{x:0,y:0},{x:v.x+1,y:v.y+1},y.bitmap)}}}this.image=d,this.positions=r};e.register("GlyphAtlas",i);var a=function(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId};function o(t,r,n){for(var i=new e.EvaluationParameters(r),a=0,o=t;a<o.length;a+=1)o[a].recalculate(i,n)}function s(t,r){var n=e.getArrayBuffer(t.request,(function(t,n,i,a){t?r(t):n&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(n)),rawData:n,cacheControl:i,expires:a})}));return function(){n.cancel(),r()}}a.prototype.parse=function(t,r,n,a,s){var l=this;this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;var c=new e.DictionaryCoder(Object.keys(t.layers).sort()),u=new e.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h,p,d,f,m={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},y=r.familiesBySource[this.source];for(var v in y){var x=t.layers[v];if(x){1===x.version&&e.warnOnce('Vector tile source "'+this.source+'" layer "'+v+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var b=c.encode(v),_=[],w=0;w<x.length;w++){var k=x.feature(w),T=u.getId(k,v);_.push({feature:k,id:T,index:w,sourceLayerIndex:b})}for(var S=0,A=y[v];S<A.length;S+=1){var M=A[S],E=M[0];E.minzoom&&this.zoom<Math.floor(E.minzoom)||E.maxzoom&&this.zoom>=E.maxzoom||"none"!==E.visibility&&(o(M,this.zoom,n),(m[E.id]=E.createBucket({index:u.bucketLayerIDs.length,layers:M,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:b,sourceID:this.source})).populate(_,g,this.tileID.canonical),u.bucketLayerIDs.push(M.map((function(e){return e.id}))))}}}var C=e.mapObject(g.glyphDependencies,(function(e){return Object.keys(e).map(Number)}));Object.keys(C).length?a.send("getGlyphs",{uid:this.uid,stacks:C},(function(e,t){h||(h=e,p=t,I.call(l))})):p={};var P=Object.keys(g.iconDependencies);P.length?a.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"icons"},(function(e,t){h||(h=e,d=t,I.call(l))})):d={};var L=Object.keys(g.patternDependencies);function I(){if(h)return s(h);if(p&&d&&f){var t=new i(p),r=new e.ImageAtlas(d,f);for(var a in m){var l=m[a];l instanceof e.SymbolBucket?(o(l.layers,this.zoom,n),e.performSymbolLayout(l,p,t.positions,d,r.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof e.LineBucket||l instanceof e.FillBucket||l instanceof e.FillExtrusionBucket)&&(o(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:e.values(m).filter((function(e){return!e.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?t.positions:null})}}L.length?a.send("getImages",{icons:L,source:this.source,tileID:this.tileID,type:"patterns"},(function(e,t){h||(h=e,f=t,I.call(l))})):f={},I.call(this)};var l=function(e,t,r,n){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=n||s,this.loading={},this.loaded={}};l.prototype.loadTile=function(t,r){var n=this,i=t.uid;this.loading||(this.loading={});var o=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),s=this.loading[i]=new a(t);s.abort=this.loadVectorData(t,(function(t,a){if(delete n.loading[i],t||!a)return s.status="done",n.loaded[i]=s,r(t);var l=a.rawData,c={};a.expires&&(c.expires=a.expires),a.cacheControl&&(c.cacheControl=a.cacheControl);var u={};if(o){var h=o.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}s.vectorTile=a.vectorTile,s.parse(a.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(t,n){if(t||!n)return r(t);r(null,e.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[i]=s}))},l.prototype.reloadTile=function(e,t){var r=this,n=this.loaded,i=e.uid,a=this;if(n&&n[i]){var o=n[i];o.showCollisionBoxes=e.showCollisionBoxes;var s=function(e,n){var i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,a.layerIndex,r.availableImages,a.actor,i)),t(e,n)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}},l.prototype.abortTile=function(e,t){var r=this.loading,n=e.uid;r&&r[n]&&r[n].abort&&(r[n].abort(),delete r[n]),t()},l.prototype.removeTile=function(e,t){var r=this.loaded,n=e.uid;r&&r[n]&&delete r[n],t()};var c=e.window.ImageBitmap,u=function(){this.loaded={}};u.prototype.loadTile=function(t,r){var n=t.uid,i=t.encoding,a=t.rawImageData,o=c&&a instanceof c?this.getImageData(a):a,s=new e.DEMData(n,o,i);this.loaded=this.loaded||{},this.loaded[n]=s,r(null,s)},u.prototype.getImageData=function(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);var r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)},u.prototype.removeTile=function(e){var t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]};var h=function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)p(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)p(t.coordinates[n],r);return t};function p(e,t){if(0!==e.length){d(e[0],t);for(var r=1;r<e.length;r++)d(e[r],!t)}}function d(e,t){for(var r=0,n=0,i=e.length,a=i-1;n<i;a=n++)r+=(e[n][0]-e[a][0])*(e[a][1]+e[n][1]);r>=0!==!!t&&e.reverse()}var f=e.vectorTile.VectorTileFeature.prototype.toGeoJSON,m=function(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))};m.prototype.loadGeometry=function(){if(1===this._feature.type){for(var t=[],r=0,n=this._feature.geometry;r<n.length;r+=1){var i=n[r];t.push([new e.Point$1(i[0],i[1])])}return t}for(var a=[],o=0,s=this._feature.geometry;o<s.length;o+=1){for(var l=[],c=0,u=s[o];c<u.length;c+=1){var h=u[c];l.push(new e.Point$1(h[0],h[1]))}a.push(l)}return a},m.prototype.toGeoJSON=function(e,t,r){return f.call(this,e,t,r)};var g=function(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t};g.prototype.feature=function(e){return new m(this._features[e])};var y=e.vectorTile.VectorTileFeature,v=x;function x(e,t){this.options=t||{},this.features=e,this.length=e.length}function b(e,t){this.id="number"===typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}x.prototype.feature=function(e){return new b(this.features[e],this.options.extent)},b.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var r=0;r<t.length;r++){for(var n=t[r],i=[],a=0;a<n.length;a++)i.push(new e.Point$1(n[a][0],n[a][1]));this.geometry.push(i)}return this.geometry},b.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},b.prototype.toGeoJSON=y.prototype.toGeoJSON;var _=S,w=S,k=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new v(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return S({layers:r})},T=v;function S(t){var r=new e.pbf;return function(e,t){for(var r in e.layers)t.writeMessage(3,A,e.layers[r])}(t,r),r.finish()}function A(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,M,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)t.writeMessage(4,I,a[r])}function M(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,E,e),t.writeVarintField(3,r.type),t.writeMessage(4,L,r)}function E(e,t){var r=e.feature,n=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in r.properties){var l=a[s];"undefined"===typeof l&&(n.push(s),l=n.length-1,a[s]=l),t.writeVarint(l);var c=r.properties[s],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,p=o[h];"undefined"===typeof p&&(i.push(c),p=i.length-1,o[h]=p),t.writeVarint(p)}}function C(e,t){return(t<<3)+(7&e)}function P(e){return e<<1^e>>31}function L(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(C(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&t.writeVarint(C(2,u-1));var p=l[h].x-i,d=l[h].y-a;t.writeVarint(P(p)),t.writeVarint(P(d)),i+=p,a+=d}3===n&&t.writeVarint(C(7,1))}}function I(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!==0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function z(e,t,r,n,i,a){if(!(i-n<=r)){var o=n+i>>1;O(e,t,o,n,i,a%2),z(e,t,r,n,o-1,a+1),z(e,t,r,o+1,i,a+1)}}function O(e,t,r,n,i,a){for(;i>n;){if(i-n>600){var o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);O(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}var h=t[2*r+a],p=n,d=i;for(R(e,t,n,r),t[2*i+a]>h&&R(e,t,n,i);p<d;){for(R(e,t,p,d),p++,d--;t[2*p+a]<h;)p++;for(;t[2*d+a]>h;)d--}t[2*n+a]===h?R(e,t,n,d):R(e,t,++d,i),d<=r&&(n=d+1),r<=d&&(i=d-1)}}function R(e,t,r,n){D(e,r,n),D(t,2*r,2*n),D(t,2*r+1,2*n+1)}function D(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function j(e,t,r,n){var i=e-r,a=t-n;return i*i+a*a}_.fromVectorTileJs=w,_.fromGeojsonVt=k,_.GeoJSONWrapper=T;var F=function(e){return e[0]},B=function(e){return e[1]},N=function(e,t,r,n,i){void 0===t&&(t=F),void 0===r&&(r=B),void 0===n&&(n=64),void 0===i&&(i=Float64Array),this.nodeSize=n,this.points=e;for(var a=e.length<65536?Uint16Array:Uint32Array,o=this.ids=new a(e.length),s=this.coords=new i(2*e.length),l=0;l<e.length;l++)o[l]=l,s[2*l]=t(e[l]),s[2*l+1]=r(e[l]);z(o,s,n,0,o.length-1,0)};N.prototype.range=function(e,t,r,n){return function(e,t,r,n,i,a,o){for(var s,l,c=[0,e.length-1,0],u=[];c.length;){var h=c.pop(),p=c.pop(),d=c.pop();if(p-d<=o)for(var f=d;f<=p;f++)s=t[2*f],l=t[2*f+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(e[f]);else{var m=Math.floor((d+p)/2);s=t[2*m],l=t[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(e[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(p),c.push(g))}}return u}(this.ids,this.coords,e,t,r,n,this.nodeSize)},N.prototype.within=function(e,t,r){return function(e,t,r,n,i,a){for(var o=[0,e.length-1,0],s=[],l=i*i;o.length;){var c=o.pop(),u=o.pop(),h=o.pop();if(u-h<=a)for(var p=h;p<=u;p++)j(t[2*p],t[2*p+1],r,n)<=l&&s.push(e[p]);else{var d=Math.floor((h+u)/2),f=t[2*d],m=t[2*d+1];j(f,m,r,n)<=l&&s.push(e[d]);var g=(c+1)%2;(0===c?r-i<=f:n-i<=m)&&(o.push(h),o.push(d-1),o.push(g)),(0===c?r+i>=f:n+i>=m)&&(o.push(d+1),o.push(u),o.push(g))}}return s}(this.ids,this.coords,e,t,r,this.nodeSize)};var U={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(e){return e}},V=function(e){this.options=Y(Object.create(U),e),this.trees=new Array(this.options.maxZoom+1)};function q(e,t,r,n,i){return{x:e,y:t,zoom:1/0,id:r,parentId:-1,numPoints:n,properties:i}}function H(e,t){var r=e.geometry.coordinates,n=r[0],i=r[1];return{x:$(n),y:Z(i),zoom:1/0,index:t,parentId:-1}}function G(e){return{type:"Feature",id:e.id,properties:W(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),X(e.y)]}};var t}function W(e){var t=e.numPoints,r=t>=1e4?Math.round(t/1e3)+"k":t>=1e3?Math.round(t/100)/10+"k":t;return Y(Y({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function $(e){return e/360+.5}function Z(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function X(e){var t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Y(e,t){for(var r in t)e[r]=t[r];return e}function K(e){return e.x}function J(e){return e.y}function Q(e,t,r,n){for(var i,a=n,o=r-t>>1,s=r-t,l=e[t],c=e[t+1],u=e[r],h=e[r+1],p=t+3;p<r;p+=3){var d=ee(e[p],e[p+1],l,c,u,h);if(d>a)i=p,a=d;else if(d===a){var f=Math.abs(p-o);f<s&&(i=p,s=f)}}a>n&&(i-t>3&&Q(e,t,i,n),e[i+2]=a,r-i>3&&Q(e,i,r,n))}function ee(e,t,r,n,i,a){var o=i-r,s=a-n;if(0!==o||0!==s){var l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return(o=e-r)*o+(s=t-n)*s}function te(e,t,r,n){var i={id:"undefined"===typeof e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)re(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var n=0;n<t.length;n++)re(e,t[n]);else if("MultiPolygon"===r)for(n=0;n<t.length;n++)for(var i=0;i<t[n].length;i++)re(e,t[n][i])}(i),i}function re(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function ne(e,t,r,n){if(t.geometry){var i=t.geometry.coordinates,a=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)ie(i,s);else if("MultiPoint"===a)for(var c=0;c<i.length;c++)ie(i[c],s);else if("LineString"===a)ae(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(c=0;c<i.length;c++)s=[],ae(i[c],s,o,!1),e.push(te(l,"LineString",s,t.properties));return}oe(i,s,o,!1)}else if("Polygon"===a)oe(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(c=0;c<t.geometry.geometries.length;c++)ne(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<i.length;c++){var u=[];oe(i[c],u,o,!0),s.push(u)}}e.push(te(l,a,s,t.properties))}}function ie(e,t){t.push(se(e[0])),t.push(le(e[1])),t.push(0)}function ae(e,t,r,n){for(var i,a,o=0,s=0;s<e.length;s++){var l=se(e[s][0]),c=le(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(o+=n?(i*c-l*a)/2:Math.sqrt(Math.pow(l-i,2)+Math.pow(c-a,2))),i=l,a=c}var u=t.length-3;t[2]=1,Q(t,0,u,r),t[u+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function oe(e,t,r,n){for(var i=0;i<e.length;i++){var a=[];ae(e[i],a,r,n),t.push(a)}}function se(e){return e/360+.5}function le(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ce(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o<n)return e;if(o<r||a>=n)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,p=u.type,d=0===i?u.minX:u.minY,f=0===i?u.maxX:u.maxY;if(d>=r&&f<n)l.push(u);else if(!(f<r||d>=n)){var m=[];if("Point"===p||"MultiPoint"===p)ue(h,m,r,n,i);else if("LineString"===p)he(h,m,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===p)de(h,m,r,n,i,!1);else if("Polygon"===p)de(h,m,r,n,i,!0);else if("MultiPolygon"===p)for(var g=0;g<h.length;g++){var y=[];de(h[g],y,r,n,i,!0),y.length&&m.push(y)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(g=0;g<m.length;g++)l.push(te(u.id,p,m[g],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(te(u.id,p,m,u.tags))}}}return l.length?l:null}function ue(e,t,r,n,i){for(var a=0;a<e.length;a+=3){var o=e[a+i];o>=r&&o<=n&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function he(e,t,r,n,i,a,o){for(var s,l,c=pe(e),u=0===i?me:ge,h=e.start,p=0;p<e.length-3;p+=3){var d=e[p],f=e[p+1],m=e[p+2],g=e[p+3],y=e[p+4],v=0===i?d:f,x=0===i?g:y,b=!1;o&&(s=Math.sqrt(Math.pow(d-g,2)+Math.pow(f-y,2))),v<r?x>r&&(l=u(c,d,f,g,y,r),o&&(c.start=h+s*l)):v>n?x<n&&(l=u(c,d,f,g,y,n),o&&(c.start=h+s*l)):fe(c,d,f,m),x<r&&v>=r&&(l=u(c,d,f,g,y,r),b=!0),x>n&&v<=n&&(l=u(c,d,f,g,y,n),b=!0),!a&&b&&(o&&(c.end=h+s*l),t.push(c),c=pe(e)),o&&(h+=s)}var _=e.length-3;d=e[_],f=e[_+1],m=e[_+2],(v=0===i?d:f)>=r&&v<=n&&fe(c,d,f,m),_=c.length-3,a&&_>=3&&(c[_]!==c[0]||c[_+1]!==c[1])&&fe(c,c[0],c[1],c[2]),c.length&&t.push(c)}function pe(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function de(e,t,r,n,i,a){for(var o=0;o<e.length;o++)he(e[o],t,r,n,i,a,!1)}function fe(e,t,r,n){e.push(t),e.push(r),e.push(n)}function me(e,t,r,n,i,a){var o=(a-t)/(n-t);return e.push(a),e.push(r+(i-r)*o),e.push(1),o}function ge(e,t,r,n,i,a){var o=(a-r)/(i-r);return e.push(t+(n-t)*o),e.push(a),e.push(1),o}function ye(e,t){for(var r=[],n=0;n<e.length;n++){var i,a=e[n],o=a.type;if("Point"===o||"MultiPoint"===o||"LineString"===o)i=ve(a.geometry,t);else if("MultiLineString"===o||"Polygon"===o){i=[];for(var s=0;s<a.geometry.length;s++)i.push(ve(a.geometry[s],t))}else if("MultiPolygon"===o)for(i=[],s=0;s<a.geometry.length;s++){for(var l=[],c=0;c<a.geometry[s].length;c++)l.push(ve(a.geometry[s][c],t));i.push(l)}r.push(te(a.id,o,i,a.tags))}return r}function ve(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function xe(e,t){if(e.transformed)return e;var r,n,i,a=1<<e.z,o=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(be(c[n],c[n+1],t,a,o,s));else for(n=0;n<c.length;n++){var h=[];for(i=0;i<c[n].length;i+=2)h.push(be(c[n][i],c[n][i+1],t,a,o,s));l.geometry.push(h)}}return e.transformed=!0,e}function be(e,t,r,n,i,a){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-a))]}function _e(e,t,r,n,i){for(var a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){o.numFeatures++,we(o,e[s],a,i);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<o.minX&&(o.minX=l),c<o.minY&&(o.minY=c),u>o.maxX&&(o.maxX=u),h>o.maxY&&(o.maxY=h)}return o}function we(e,t,r,n){var i=t.geometry,a=t.type,o=[];if("Point"===a||"MultiPoint"===a)for(var s=0;s<i.length;s+=3)o.push(i[s]),o.push(i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)ke(o,i,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(s=0;s<i.length;s++)ke(o,i[s],e,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(var l=0;l<i.length;l++){var c=i[l];for(s=0;s<c.length;s++)ke(o,c[s],e,r,!0,0===s)}if(o.length){var u=t.tags||null;if("LineString"===a&&n.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=i.start/i.size,u.mapbox_clip_end=i.end/i.size}var p={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:u};null!==t.id&&(p.id=t.id),e.features.push(p)}}function ke(e,t,r,n,i,a){var o=n*n;if(n>0&&t.size<(i?o:n))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===n||t[l+2]>o)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;i&&function(e,t){for(var r=0,n=0,i=e.length,a=i-2;n<i;a=n,n+=2)r+=(e[n]-e[a])*(e[n+1]+e[a+1]);if(r>0===t)for(n=0,i=e.length;n<i/2;n+=2){var o=e[n],s=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=o,e[i-1-n]=s}}(s,a),e.push(s)}}function Te(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var n=0;n<e.features.length;n++)ne(r,e.features[n],t,n);else"Feature"===e.type?ne(r,e,t):ne(r,{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){var r=t.buffer/t.extent,n=e,i=ce(e,1,-1-r,r,0,-1,2,t),a=ce(e,1,1-r,2+r,0,-1,2,t);return(i||a)&&(n=ce(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=ye(i,1).concat(n)),a&&(n=n.concat(ye(a,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Se(e,t,r){return 32*((1<<e)*r+t)+e}function Ae(e,t){var r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);var n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return t(null,null);var i=new g(n.features),a=_(i);0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),t(null,{vectorTile:i,rawData:a.buffer})}V.prototype.load=function(e){var t=this.options,r=t.log,n=t.minZoom,i=t.maxZoom,a=t.nodeSize;r&&console.time("total time");var o="prepare "+e.length+" points";r&&console.time(o),this.points=e;for(var s=[],l=0;l<e.length;l++)e[l].geometry&&s.push(H(e[l],l));this.trees[i+1]=new N(s,K,J,a,Float32Array),r&&console.timeEnd(o);for(var c=i;c>=n;c--){var u=+Date.now();s=this._cluster(s,c),this.trees[c]=new N(s,K,J,a,Float32Array),r&&console.log("z%d: %d clusters in %dms",c,s.length,+Date.now()-u)}return r&&console.timeEnd("total time"),this},V.prototype.getClusters=function(e,t){var r=((e[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,e[1])),i=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){var o=this.getClusters([r,n,180,a],t),s=this.getClusters([-180,n,i,a],t);return o.concat(s)}for(var l=this.trees[this._limitZoom(t)],c=[],u=0,h=l.range($(r),Z(a),$(i),Z(n));u<h.length;u+=1){var p=h[u],d=l.points[p];c.push(d.numPoints?G(d):this.points[d.index])}return c},V.prototype.getChildren=function(e){var t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);var a=i.points[t];if(!a)throw new Error(n);for(var o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=[],l=0,c=i.within(a.x,a.y,o);l<c.length;l+=1){var u=c[l],h=i.points[u];h.parentId===e&&s.push(h.numPoints?G(h):this.points[h.index])}if(0===s.length)throw new Error(n);return s},V.prototype.getLeaves=function(e,t,r){t=t||10,r=r||0;var n=[];return this._appendLeaves(n,e,t,r,0),n},V.prototype.getTile=function(e,t,r){var n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),a=this.options,o=a.extent,s=a.radius/o,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.points,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.points,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.points,-1,r,i,u),u.features.length?u:null},V.prototype.getClusterExpansionZoom=function(e){for(var t=this._getOriginZoom(e)-1;t<=this.options.maxZoom;){var r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t},V.prototype._appendLeaves=function(e,t,r,n,i){for(var a=0,o=this.getChildren(t);a<o.length;a+=1){var s=o[a],l=s.properties;if(l&&l.cluster?i+l.point_count<=n?i+=l.point_count:i=this._appendLeaves(e,l.cluster_id,r,n,i):i<n?i++:e.push(s),e.length===r)break}return i},V.prototype._addTileFeatures=function(e,t,r,n,i,a){for(var o=0,s=e;o<s.length;o+=1){var l=t[s[o]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*i-r)),Math.round(this.options.extent*(l.y*i-n))]],tags:c?W(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),a.features.push(u)}},V.prototype._limitZoom=function(e){return Math.max(this.options.minZoom,Math.min(+e,this.options.maxZoom+1))},V.prototype._cluster=function(e,t){for(var r=[],n=this.options,i=n.radius,a=n.extent,o=n.reduce,s=n.minPoints,l=i/(a*Math.pow(2,t)),c=0;c<e.length;c++){var u=e[c];if(!(u.zoom<=t)){u.zoom=t;for(var h=this.trees[t+1],p=h.within(u.x,u.y,l),d=u.numPoints||1,f=d,m=0,g=p;m<g.length;m+=1){var y=g[m],v=h.points[y];v.zoom>t&&(f+=v.numPoints||1)}if(f>=s){for(var x=u.x*d,b=u.y*d,_=o&&d>1?this._map(u,!0):null,w=(c<<5)+(t+1)+this.points.length,k=0,T=p;k<T.length;k+=1){var S=T[k],A=h.points[S];if(!(A.zoom<=t)){A.zoom=t;var M=A.numPoints||1;x+=A.x*M,b+=A.y*M,A.parentId=w,o&&(_||(_=this._map(u,!0)),o(_,this._map(A)))}}u.parentId=w,r.push(q(x/f,b/f,w,f,_))}else if(r.push(u),f>1)for(var E=0,C=p;E<C.length;E+=1){var P=C[E],L=h.points[P];L.zoom<=t||(L.zoom=t,r.push(L))}}}return r},V.prototype._getOriginId=function(e){return e-this.points.length>>5},V.prototype._getOriginZoom=function(e){return(e-this.points.length)%32},V.prototype._map=function(e,t){if(e.numPoints)return t?Y({},e.properties):e.properties;var r=this.points[e.index].properties,n=this.options.map(r);return t&&n===r?Y({},n):n},Te.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Te.prototype.splitTile=function(e,t,r,n,i,a,o){for(var s=[e,t,r,n],l=this.options,c=l.debug;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=Se(t,r,n),p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=_e(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=e,i){if(t===l.maxZoom||t===i)continue;var f=1<<i-t;if(r!==Math.floor(a/f)||n!==Math.floor(o/f))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){c>1&&console.time("clipping");var m,g,y,v,x,b,_=.5*l.buffer/l.extent,w=.5-_,k=.5+_,T=1+_;m=g=y=v=null,x=ce(e,u,r-_,r+k,0,p.minX,p.maxX,l),b=ce(e,u,r+w,r+T,0,p.minX,p.maxX,l),e=null,x&&(m=ce(x,u,n-_,n+k,1,p.minY,p.maxY,l),g=ce(x,u,n+w,n+T,1,p.minY,p.maxY,l),x=null),b&&(y=ce(b,u,n-_,n+k,1,p.minY,p.maxY,l),v=ce(b,u,n+w,n+T,1,p.minY,p.maxY,l),b=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*n),s.push(g||[],t+1,2*r,2*n+1),s.push(y||[],t+1,2*r+1,2*n),s.push(v||[],t+1,2*r+1,2*n+1)}}},Te.prototype.getTile=function(e,t,r){var n=this.options,i=n.extent,a=n.debug;if(e<0||e>24)return null;var o=1<<e,s=Se(e,t=(t%o+o)%o,r);if(this.tiles[s])return xe(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,c=e,u=t,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[Se(c,u,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",c,u,h),a>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?xe(this.tiles[s],i):null):null};var Me=function(t){function r(e,r,n,i){t.call(this,e,r,n,Ae),i&&(this.loadGeoJSON=i)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadData=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=t,this._pendingLoadDataParams=e,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},r.prototype._loadData=function(){var t=this;if(this._pendingCallback&&this._pendingLoadDataParams){var r=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var i=!!(n&&n.request&&n.request.collectResourceTiming)&&new e.RequestPerformance(n.request);this.loadGeoJSON(n,(function(a,o){if(a||!o)return r(a);if("object"!==typeof o)return r(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));h(o,!0);try{if(n.filter){var s=e.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(e){return e.key+": "+e.message})).join(", "));var l=o.features.filter((function(e){return s.value.evaluate({zoom:0},e)}));o={type:"FeatureCollection",features:l}}t._geoJSONIndex=n.cluster?new V(function(t){var r=t.superclusterOptions,n=t.clusterProperties;if(!n||!r)return r;for(var i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n),c=0,u=l;c<u.length;c+=1){var h=u[c],p=n[h],d=p[0],f=p[1],m=e.createExpression(f),g=e.createExpression("string"===typeof d?[d,["accumulated"],["get",h]]:d);i[h]=m.value,a[h]=g.value}return r.map=function(e){s.properties=e;for(var t={},r=0,n=l;r<n.length;r+=1){var a=n[r];t[a]=i[a].evaluate(o,s)}return t},r.reduce=function(e,t){s.properties=t;for(var r=0,n=l;r<n.length;r+=1){var i=n[r];o.accumulated=e[i],e[i]=a[i].evaluate(o,s)}},r}(n)).load(o.features):function(e,t){return new Te(e,t)}(o,n.geojsonVtOptions)}catch(p){return r(p)}t.loaded={};var c={};if(i){var u=i.finish();u&&(c.resourceTiming={},c.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}r(null,c)}))}},r.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},r.prototype.reloadTile=function(e,r){var n=this.loaded,i=e.uid;return n&&n[i]?t.prototype.reloadTile.call(this,e,r):this.loadTile(e,r)},r.prototype.loadGeoJSON=function(t,r){if(t.request)e.getJSON(t.request,r);else{if("string"!==typeof t.data)return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(t.data))}catch(n){return r(new Error("Input data given to '"+t.source+"' is not a valid GeoJSON object."))}}},r.prototype.removeSource=function(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()},r.prototype.getClusterExpansionZoom=function(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterChildren=function(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(r){t(r)}},r.prototype.getClusterLeaves=function(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(r){t(r)}},r}(l),Ee=function(t){var r=this;this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Me},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(e,t){if(r.workerSourceTypes[e])throw new Error('Worker source with name "'+e+'" already registered.');r.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=function(t){if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}};return Ee.prototype.setReferrer=function(e,t){this.referrer=t},Ee.prototype.setImages=function(e,t,r){for(var n in this.availableImages[e]=t,this.workerSources[e]){var i=this.workerSources[e][n];for(var a in i)i[a].availableImages=t}r()},Ee.prototype.setLayers=function(e,t,r){this.getLayerIndex(e).replace(t),r()},Ee.prototype.updateLayers=function(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()},Ee.prototype.loadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)},Ee.prototype.loadDEMTile=function(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)},Ee.prototype.reloadTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)},Ee.prototype.abortTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)},Ee.prototype.removeTile=function(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)},Ee.prototype.removeDEMTile=function(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)},Ee.prototype.removeSource=function(e,t,r){if(this.workerSources[e]&&this.workerSources[e][t.type]&&this.workerSources[e][t.type][t.source]){var n=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==n.removeSource?n.removeSource(t,r):r()}},Ee.prototype.loadWorkerSource=function(e,t,r){try{this.self.importScripts(t.url),r()}catch(n){r(n.toString())}},Ee.prototype.syncRTLPluginState=function(t,r,n){try{e.plugin.setState(r);var i=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=i){this.self.importScripts(i);var a=e.plugin.isParsed();n(a?void 0:new Error("RTL Text Plugin failed to import scripts from "+i),a)}}catch(o){n(o.toString())}},Ee.prototype.getAvailableImages=function(e){var t=this.availableImages[e];return t||(t=[]),t},Ee.prototype.getLayerIndex=function(e){var t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new n),t},Ee.prototype.getWorkerSource=function(e,t,r){var n=this;if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){var i={send:function(t,r,i){n.actor.send(t,r,i,e)}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]},Ee.prototype.getDEMWorkerSource=function(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new u),this.demWorkerSources[e][t]},Ee.prototype.enforceCacheSizeLimit=function(t,r){e.enforceCacheSizeLimit(r)},"undefined"!==typeof WorkerGlobalScope&&"undefined"!==typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new Ee(self)),Ee})),n(0,(function(e){var t=e.createCommonjsModule((function(e){function t(e){return!r(e)}function r(e){return"undefined"===typeof window||"undefined"===typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(r);try{t=new Worker(n),e=!0}catch(i){e=!1}return t&&t.terminate(),URL.revokeObjectURL(n),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?(r=e&&e.failIfMajorPerformanceCaveat,void 0===n[r]&&(n[r]=function(e){var r=function(e){var r=document.createElement("canvas"),n=Object.create(t.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=e,r.probablySupportsContext?r.probablySupportsContext("webgl",n)||r.probablySupportsContext("experimental-webgl",n):r.supportsContext?r.supportsContext("webgl",n)||r.supportsContext("experimental-webgl",n):r.getContext("webgl",n)||r.getContext("experimental-webgl",n)}(e);if(!r)return!1;var n=r.createShader(r.VERTEX_SHADER);return!(!n||r.isContextLost())&&(r.shaderSource(n,"void main() {}"),r.compileShader(n),!0===r.getShaderParameter(n,r.COMPILE_STATUS))}(r)),n[r]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var r}e.exports?e.exports=t:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=t,window.mapboxgl.notSupportedReason=r);var n={};t.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(t,r,n){var i=e.window.document.createElement(t);return void 0!==r&&(i.className=r),n&&n.appendChild(i),i},createNS:function(t,r){return e.window.document.createElementNS(t,r)}},n=e.window.document&&e.window.document.documentElement.style;function i(e){if(!n)return e[0];for(var t=0;t<e.length;t++)if(e[t]in n)return e[t];return e[0]}var a,o=i(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){n&&o&&(a=n[o],n[o]="none")},r.enableDrag=function(){n&&o&&(n[o]=a)};var s=i(["transform","WebkitTransform"]);r.setTransform=function(e,t){e.style[s]=t};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});e.window.addEventListener("test",c,c),e.window.removeEventListener("test",c,c)}catch(oa){l=!1}r.addEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.addEventListener(t,r,n):e.addEventListener(t,r,n.capture)},r.removeEventListener=function(e,t,r,n){void 0===n&&(n={}),"passive"in n&&l?e.removeEventListener(t,r,n):e.removeEventListener(t,r,n.capture)};var u=function(t){t.preventDefault(),t.stopPropagation(),e.window.removeEventListener("click",u,!0)};function h(e){var t=e.userImage;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}r.suppressClick=function(){e.window.addEventListener("click",u,!0),e.window.setTimeout((function(){e.window.removeEventListener("click",u,!0)}),0)},r.mousePos=function(t,r){var n=t.getBoundingClientRect();return new e.Point(r.clientX-n.left-t.clientLeft,r.clientY-n.top-t.clientTop)},r.touchPos=function(t,r){for(var n=t.getBoundingClientRect(),i=[],a=0;a<r.length;a++)i.push(new e.Point(r[a].clientX-n.left-t.clientLeft,r[a].clientY-n.top-t.clientTop));return i},r.mouseButton=function(t){return"undefined"!==typeof e.window.InstallTrigger&&2===t.button&&t.ctrlKey&&e.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:t.button},r.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)};var p=function(t){function r(){t.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.isLoaded=function(){return this.loaded},r.prototype.setLoaded=function(e){if(this.loaded!==e&&(this.loaded=e,e)){for(var t=0,r=this.requestors;t<r.length;t+=1){var n=r[t],i=n.ids,a=n.callback;this._notify(i,a)}this.requestors=[]}},r.prototype.getImage=function(e){return this.images[e]},r.prototype.addImage=function(e,t){this._validate(e,t)&&(this.images[e]=t)},r.prototype._validate=function(t,r){var n=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "stretchY" value'))),n=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error('Image "'+t+'" has invalid "content" value'))),n=!1),n},r.prototype._validateStretch=function(e,t){if(!e)return!0;for(var r=0,n=0,i=e;n<i.length;n+=1){var a=i[n];if(a[0]<r||a[1]<a[0]||t<a[1])return!1;r=a[1]}return!0},r.prototype._validateContent=function(e,t){return!e||4===e.length&&!(e[0]<0||t.data.width<e[0])&&!(e[1]<0||t.data.height<e[1])&&!(e[2]<0||t.data.width<e[2])&&!(e[3]<0||t.data.height<e[3])&&!(e[2]<e[0])&&!(e[3]<e[1])},r.prototype.updateImage=function(e,t){var r=this.images[e];t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0},r.prototype.removeImage=function(e){var t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()},r.prototype.listImages=function(){return Object.keys(this.images)},r.prototype.getImages=function(e,t){var r=!0;if(!this.isLoaded())for(var n=0,i=e;n<i.length;n+=1){var a=i[n];this.images[a]||(r=!1)}this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})},r.prototype._notify=function(t,r){for(var n={},i=0,a=t;i<a.length;i+=1){var o=a[i];this.images[o]||this.fire(new e.Event("styleimagemissing",{id:o}));var s=this.images[o];s?n[o]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:e.warnOnce('Image "'+o+'" 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.')}r(null,n)},r.prototype.getPixelSize=function(){var e=this.atlasImage;return{width:e.width,height:e.height}},r.prototype.getPattern=function(t){var r=this.patterns[t],n=this.getImage(t);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{var i={w:n.data.width+2,h:n.data.height+2,x:0,y:0},a=new e.ImagePosition(i,n);this.patterns[t]={bin:i,position:a}}return this._updatePatternAtlas(),this.patterns[t].position},r.prototype.bind=function(t){var r=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new e.Texture(t,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},r.prototype._updatePatternAtlas=function(){var t=[];for(var r in this.patterns)t.push(this.patterns[r].bin);var n=e.potpack(t),i=n.w,a=n.h,o=this.atlasImage;for(var s in o.resize({width:i||1,height:a||1}),this.patterns){var l=this.patterns[s].bin,c=l.x+1,u=l.y+1,h=this.images[s].data,p=h.width,d=h.height;e.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u},{width:p,height:d}),e.RGBAImage.copy(h,o,{x:0,y:d-1},{x:c,y:u-1},{width:p,height:1}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:c,y:u+d},{width:p,height:1}),e.RGBAImage.copy(h,o,{x:p-1,y:0},{x:c-1,y:u},{width:1,height:d}),e.RGBAImage.copy(h,o,{x:0,y:0},{x:c+p,y:u},{width:1,height:d})}this.dirty=!0},r.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},r.prototype.dispatchRenderCallbacks=function(e){for(var t=0,r=e;t<r.length;t+=1){var n=r[t];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var i=this.images[n];h(i)&&this.updateImage(n,i)}}},r}(e.Evented),d=g,f=g,m=1e20;function g(e,t,r,n,i,a){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=n||.25,this.fontFamily=i||"sans-serif",this.fontWeight=a||"normal",this.radius=r||8;var o=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=o,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.d=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Int16Array(o),this.middle=Math.round(o/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function y(e,t,r,n,i,a,o){for(var s=0;s<t;s++){for(var l=0;l<r;l++)n[l]=e[l*t+s];for(v(n,i,a,o,r),l=0;l<r;l++)e[l*t+s]=i[l]}for(l=0;l<r;l++){for(s=0;s<t;s++)n[s]=e[l*t+s];for(v(n,i,a,o,t),s=0;s<t;s++)e[l*t+s]=Math.sqrt(i[s])}}function v(e,t,r,n,i){r[0]=0,n[0]=-m,n[1]=+m;for(var a=1,o=0;a<i;a++){for(var s=(e[a]+a*a-(e[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);s<=n[o];)o--,s=(e[a]+a*a-(e[r[o]]+r[o]*r[o]))/(2*a-2*r[o]);r[++o]=a,n[o]=s,n[o+1]=+m}for(a=0,o=0;a<i;a++){for(;n[o+1]<a;)o++;t[a]=(a-r[o])*(a-r[o])+e[r[o]]}}g.prototype.draw=function(e){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(e,this.buffer,this.middle);for(var t=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var i=t.data[4*n+3]/255;this.gridOuter[n]=1===i?0:0===i?m:Math.pow(Math.max(0,.5-i),2),this.gridInner[n]=1===i?m:0===i?0:Math.pow(Math.max(0,i-.5),2)}for(y(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),y(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++){var a=this.gridOuter[n]-this.gridInner[n];r[n]=Math.max(0,Math.min(255,Math.round(255-255*(a/this.radius+this.cutoff))))}return r},d.default=f;var x=function(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}};x.prototype.setURL=function(e){this.url=e},x.prototype.getGlyphs=function(t,r){var n=this,i=[];for(var a in t)for(var o=0,s=t[a];o<s.length;o+=1){var l=s[o];i.push({stack:a,id:l})}e.asyncAll(i,(function(e,t){var r=e.stack,i=e.id,a=n.entries[r];a||(a=n.entries[r]={glyphs:{},requests:{},ranges:{}});var o=a.glyphs[i];if(void 0===o){if(o=n._tinySDF(a,r,i))return a.glyphs[i]=o,void t(null,{stack:r,id:i,glyph:o});var s=Math.floor(i/256);if(256*s>65535)t(new Error("glyphs > 65535 not supported"));else if(a.ranges[s])t(null,{stack:r,id:i,glyph:o});else{var l=a.requests[s];l||(l=a.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(e,t){if(t){for(var r in t)n._doesCharSupportLocalGlyph(+r)||(a.glyphs[+r]=t[+r]);a.ranges[s]=!0}for(var i=0,o=l;i<o.length;i+=1)(0,o[i])(e,t);delete a.requests[s]}))),l.push((function(e,n){e?t(e):n&&t(null,{stack:r,id:i,glyph:n[i]||null})}))}}else t(null,{stack:r,id:i,glyph:o})}),(function(e,t){if(e)r(e);else if(t){for(var n={},i=0,a=t;i<a.length;i+=1){var o=a[i],s=o.stack,l=o.id,c=o.glyph;(n[s]||(n[s]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}r(null,n)}}))},x.prototype._doesCharSupportLocalGlyph=function(t){return!!this.localIdeographFontFamily&&(e.isChar["CJK Unified Ideographs"](t)||e.isChar["Hangul Syllables"](t)||e.isChar.Hiragana(t)||e.isChar.Katakana(t))},x.prototype._tinySDF=function(t,r,n){var i=this.localIdeographFontFamily;if(i&&this._doesCharSupportLocalGlyph(n)){var a=t.tinySDF;if(!a){var o="400";/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=t.tinySDF=new x.TinySDF(24,3,8,.25,i,o)}return{id:n,bitmap:new e.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(t,r,n,i,a){var o=256*r,s=o+255,l=i.transformRequest(i.normalizeGlyphsURL(n).replace("{fontstack}",t).replace("{range}",o+"-"+s),e.ResourceType.Glyphs);e.getArrayBuffer(l,(function(t,r){if(t)a(t);else if(r){for(var n={},i=0,o=e.parseGlyphPBF(r);i<o.length;i+=1){var s=o[i];n[s.id]=s}a(null,n)}}))},x.TinySDF=d;var b=function(){this.specification=e.styleSpec.light.position};b.prototype.possiblyEvaluate=function(t,r){return e.sphericalToCartesian(t.expression.evaluate(r))},b.prototype.interpolate=function(t,r,n){return{x:e.number(t.x,r.x,n),y:e.number(t.y,r.y,n),z:e.number(t.z,r.z,n)}};var _=new e.Properties({anchor:new e.DataConstantProperty(e.styleSpec.light.anchor),position:new b,color:new e.DataConstantProperty(e.styleSpec.light.color),intensity:new e.DataConstantProperty(e.styleSpec.light.intensity)}),w="-transition",k=function(t){function r(r){t.call(this),this._transitionable=new e.Transitionable(_),this.setLight(r),this._transitioning=this._transitionable.untransitioned()}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getLight=function(){return this._transitionable.serialize()},r.prototype.setLight=function(t,r){if(void 0===r&&(r={}),!this._validate(e.validateLight,t,r))for(var n in t){var i=t[n];e.endsWith(n,w)?this._transitionable.setTransition(n.slice(0,-11),i):this._transitionable.setValue(n,i)}},r.prototype.updateTransitions=function(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)},r.prototype.hasTransition=function(){return this._transitioning.hasTransition()},r.prototype.recalculate=function(e){this.properties=this._transitioning.possiblyEvaluate(e)},r.prototype._validate=function(t,r,n){return(!n||!1!==n.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.styleSpec})))},r}(e.Evented),T=function(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};T.prototype.getDash=function(e,t){var r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]},T.prototype.getDashRanges=function(e,t,r){var n=[],i=e.length%2===1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===e[0]});for(var s=e[0],l=1;l<e.length;l++){o=!o;var c=e[l];i=s*r,a=(s+=c)*r,n.push({left:i,right:a,isDash:o,zeroLength:0===c})}return n},T.prototype.addRoundDash=function(e,t,r){for(var n=t/2,i=-r;i<=r;i++)for(var a=this.nextRow+r+i,o=this.width*a,s=0,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),d=void 0,f=i/r*(n+1);if(l.isDash){var m=n-Math.abs(f);d=Math.sqrt(p*p+m*m)}else d=n-Math.sqrt(p*p+f*f);this.data[o+c]=Math.max(0,Math.min(255,d+128))}},T.prototype.addRegularDash=function(e){for(var t=e.length-1;t>=0;--t){var r=e[t],n=e[t+1];r.zeroLength?e.splice(t,1):n&&n.isDash===r.isDash&&(n.left=r.left,e.splice(t,1))}var i=e[0],a=e[e.length-1];i.isDash===a.isDash&&(i.left=a.left-this.width,a.right=i.right+this.width);for(var o=this.width*this.nextRow,s=0,l=e[s],c=0;c<this.width;c++){c/l.right>1&&(l=e[++s]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),p=Math.min(u,h),d=l.isDash?p:-p;this.data[o+c]=Math.max(0,Math.min(255,d+128))}},T.prototype.addDash=function(t,r){var n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return e.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o<t.length;o++)a+=t[o];if(0!==a){var s=this.width/a,l=this.getDashRanges(t,this.width,s);r?this.addRoundDash(l,s,n):this.addRegularDash(l)}var c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,c},T.prototype.bind=function(e){var t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))};var S=function t(r,n){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=e.uniqueId();for(var i=this.workerPool.acquire(this.id),a=0;a<i.length;a++){var o=i[a],s=new t.Actor(o,n,this.id);s.name="Worker "+a,this.actors.push(s)}};function A(t,r,n){var i=function(i,a){if(i)return n(i);if(a){var o=e.pick(e.extend(a,t),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);a.vector_layers&&(o.vectorLayers=a.vector_layers,o.vectorLayerIds=o.vectorLayers.map((function(e){return e.id}))),o.tiles=r.canonicalizeTileset(o,t.url),n(null,o)}};return t.url?e.getJSON(r.transformRequest(r.normalizeSourceURL(t.url),e.ResourceType.Source),i):e.browser.frame((function(){return i(null,t)}))}S.prototype.broadcast=function(t,r,n){n=n||function(){},e.asyncAll(this.actors,(function(e,n){e.send(t,r,n)}),n)},S.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},S.prototype.remove=function(){this.actors.forEach((function(e){e.remove()})),this.actors=[],this.workerPool.release(this.id)},S.Actor=e.Actor;var M=function(t,r,n){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=n||24};M.prototype.validateBounds=function(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]},M.prototype.contains=function(t){var r=Math.pow(2,t.z),n=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),i=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),a=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),o=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=n&&t.x<a&&t.y>=i&&t.y<o};var E=function(t){function r(r,n,i,a){if(t.call(this),this.id=r,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.extend(this,e.pick(n,["url","scheme","tileSize","promoteId"])),this._options=e.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(a)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new M(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles,t.map._requestManager._customAccessToken),e.postMapLoadEvent(n.tiles,t.map._getMapId(),t.map._requestManager._skuToken,t.map._requestManager._customAccessToken),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setSourceProperty=function(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},r.prototype.setTiles=function(e){var t=this;return this.setSourceProperty((function(){t._options.tiles=e})),this},r.prototype.setUrl=function(e){var t=this;return this.setSourceProperty((function(){t.url=e,t._options.url=e})),this},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),i={request:this.map._requestManager.transformRequest(n,e.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function a(n,i){return delete t.request,t.aborted?r(null):n&&404!==n.status?r(n):(i&&i.resourceTiming&&(t.resourceTiming=i.resourceTiming),this.map._refreshExpiredTiles&&i&&t.setExpiryData(i),t.loadVectorData(i,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}i.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",i,a.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",i,a.bind(this)))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)},r.prototype.unloadTile=function(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)},r.prototype.hasTransition=function(){return!1},r}(e.Evented),C=function(t){function r(r,n,i,a){t.call(this),this.id=r,this.dispatcher=i,this.setEventedParent(a),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.extend({type:"raster"},n),e.extend(this,e.pick(n,["url","scheme","tileSize"]))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,n){t._tileJSONRequest=null,t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(e.extend(t,n),n.bounds&&(t.tileBounds=new M(n.bounds,t.minzoom,t.maxzoom)),e.postTurnstileEvent(n.tiles),e.postMapLoadEvent(n.tiles,t.map._getMapId(),t.map._requestManager._skuToken),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),t.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},r.prototype.serialize=function(){return e.extend({},this._options)},r.prototype.hasTile=function(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)},r.prototype.loadTile=function(t,r){var n=this,i=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),(function(i,a){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(i)t.state="errored",r(i);else if(a){n.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=n.map.painter.context,s=o.gl;t.texture=n.map.painter.getTileTexture(a.width),t.texture?t.texture.update(a,{useMipmap:!0}):(t.texture=new e.Texture(o,a,s.RGBA,{useMipmap:!0}),t.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),o.extTextureFilterAnisotropic&&s.texParameterf(s.TEXTURE_2D,o.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,o.extTextureFilterAnisotropicMax)),t.state="loaded",e.cacheEntryPossiblyAdded(n.dispatcher),r(null)}}))},r.prototype.abortTile=function(e,t){e.request&&(e.request.cancel(),delete e.request),t()},r.prototype.unloadTile=function(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()},r.prototype.hasTransition=function(){return!1},r}(e.Evented),P=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},r.prototype.loadTile=function(t,r){var n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function i(e,n){e&&(t.state="errored",r(e)),n&&(t.dem=n,t.needsHillshadePrepare=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(n,e.ResourceType.Tile),function(n,a){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(n)t.state="errored",r(n);else if(a){this.map._refreshExpiredTiles&&t.setExpiryData(a),delete a.cacheControl,delete a.expires;var o=e.window.ImageBitmap&&a instanceof e.window.ImageBitmap&&e.offscreenCanvasSupported()?a:e.browser.getImageData(a,1),s={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:o,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",s,i.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)},r.prototype._getNeighboringTiles=function(t){var r=t.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?t.wrap-1:t.wrap,o=(r.x+1+n)%n,s=r.x+1===n?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new e.OverscaledTileID(t.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l},r.prototype.unloadTile=function(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&e.actor.send("removeDEMTile",{uid:e.uid,source:this.id})},r}(C),L=function(t){function r(r,n,i,a){t.call(this),this.id=r,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=i.getActor(),this.setEventedParent(a),this._data=n.data,this._options=e.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*o,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:e.EXTENT,radius:(n.clusterRadius||50)*o,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){if(r)t.fire(new e.ErrorEvent(r));else{var n={dataType:"source",sourceDataType:"metadata"};t._collectResourceTiming&&t._resourceTiming&&t._resourceTiming.length>0&&(n.resourceTiming=t._resourceTiming,t._resourceTiming=[]),t.fire(new e.Event("data",n))}}))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setData=function(t){var r=this;return this._data=t,this.fire(new e.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(t){if(t)r.fire(new e.ErrorEvent(t));else{var n={dataType:"source",sourceDataType:"content"};r._collectResourceTiming&&r._resourceTiming&&r._resourceTiming.length>0&&(n.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new e.Event("data",n))}})),this},r.prototype.getClusterExpansionZoom=function(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this},r.prototype.getClusterChildren=function(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this},r.prototype.getClusterLeaves=function(e,t,r,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},n),this},r.prototype._updateWorkerData=function(t){var r=this;this._loaded=!1;var n=e.extend({},this.workerOptions),i=this._data;"string"===typeof i?(n.request=this.map._requestManager.transformRequest(e.browser.resolveURL(i),e.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(i),this.actor.send(this.type+".loadData",n,(function(e,i){r._removed||i&&i.abandoned||(r._loaded=!0,i&&i.resourceTiming&&i.resourceTiming[r.id]&&(r._resourceTiming=i.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:n.source},null),t(e))}))},r.prototype.loaded=function(){return this._loaded},r.prototype.loadTile=function(t,r){var n=this,i=t.actor?"reloadTile":"loadTile";t.actor=this.actor;var a={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:e.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.request=this.actor.send(i,a,(function(e,a){return delete t.request,t.unloadVectorData(),t.aborted?r(null):e?r(e):(t.loadVectorData(a,n.map.painter,"reloadTile"===i),r(null))}))},r.prototype.abortTile=function(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0},r.prototype.unloadTile=function(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})},r.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},r.prototype.serialize=function(){return e.extend({},this._options,{type:this.type,data:this._data})},r.prototype.hasTransition=function(){return!1},r}(e.Evented),I=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),z=function(t){function r(e,r,n,i){t.call(this),this.id=e,this.dispatcher=n,this.coordinates=r.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(t,r){var n=this;this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),(function(i,a){n._loaded=!0,i?n.fire(new e.ErrorEvent(i)):a&&(n.image=a,t&&(n.coordinates=t),r&&r(),n._finishLoading())}))},r.prototype.loaded=function(){return this._loaded},r.prototype.updateImage=function(e){var t=this;return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(function(){t.texture=null})),this):this},r.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))},r.prototype.onAdd=function(e){this.map=e,this.load()},r.prototype.setCoordinates=function(t){var r=this;this.coordinates=t;var n=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){for(var r=1/0,n=1/0,i=-1/0,a=-1/0,o=0,s=t;o<s.length;o+=1){var l=s[o];r=Math.min(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.x),a=Math.max(a,l.y)}var c=i-r,u=a-n,h=Math.max(c,u),p=Math.max(0,Math.floor(-Math.log(h)/Math.LN2)),d=Math.pow(2,p);return new e.CanonicalTileID(p,Math.floor((r+i)/2*d),Math.floor((n+a)/2*d))}(n),this.minzoom=this.maxzoom=this.tileID.z;var i=n.map((function(e){return r.tileID.getTilePoint(e)._round()}));return this._boundsArray=new e.StructArrayLayout4i8,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this},r.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new e.Texture(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.loadTile=function(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))},r.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return!1},r}(e.Evented),O=function(t){function r(e,r,n,i){t.call(this,e,r,n,i),this.roundZoom=!0,this.type="video",this.options=r}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){var t=this;this._loaded=!1;var r=this.options;this.urls=[];for(var n=0,i=r.urls;n<i.length;n+=1){var a=i[n];this.urls.push(this.map._requestManager.transformRequest(a,e.ResourceType.Source).url)}e.getVideo(this.urls,(function(r,n){t._loaded=!0,r?t.fire(new e.ErrorEvent(r)):n&&(t.video=n,t.video.loop=!0,t.video.addEventListener("playing",(function(){t.map.triggerRepaint()})),t.map&&t.video.play(),t._finishLoading())}))},r.prototype.pause=function(){this.video&&this.video.pause()},r.prototype.play=function(){this.video&&this.video.play()},r.prototype.seek=function(t){if(this.video){var r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=t}},r.prototype.getVideo=function(){return this.video},r.prototype.onAdd=function(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},r.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var t=this.map.painter.context,r=t.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new e.Texture(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE)),this.tiles){var i=this.tiles[n];"loaded"!==i.state&&(i.state="loaded",i.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this.video&&!this.video.paused},r}(z),R=function(t){function r(r,n,i,a){t.call(this,r,n,i,a),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(e){return!Array.isArray(e)||2!==e.length||e.some((function(e){return"number"!==typeof e}))}))||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "coordinates"'))),n.animate&&"boolean"!==typeof n.animate&&this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"===typeof n.canvas||n.canvas instanceof e.window.HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.ErrorEvent(new e.ValidationError("sources."+r,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof e.window.HTMLCanvasElement?this.options.canvas:e.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},r.prototype.getCanvas=function(){return this.canvas},r.prototype.onAdd=function(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()},r.prototype.onRemove=function(){this.pause()},r.prototype.prepare=function(){var t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r=this.map.painter.context,n=r.gl;for(var i in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,I.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.Texture(r,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var a=this.tiles[i];"loaded"!==a.state&&(a.state="loaded",a.texture=this.texture)}}},r.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},r.prototype.hasTransition=function(){return this._playing},r.prototype._hasInvalidDimensions=function(){for(var e=0,t=[this.canvas.width,this.canvas.height];e<t.length;e+=1){var r=t[e];if(isNaN(r)||r<=0)return!0}return!1},r}(z),D={vector:E,raster:C,"raster-dem":P,geojson:L,video:O,image:z,canvas:R};function j(t,r){var n=e.identity([]);return e.translate(n,n,[1,1,0]),e.scale(n,n,[.5*t.width,.5*t.height,1]),e.multiply(n,n,t.calculatePosMatrix(r.toUnwrapped()))}function F(e,t,r,n,i,a){var o=function(e,t,r){if(e)for(var n=0,i=e;n<i.length;n+=1){var a=t[i[n]];if(a&&a.source===r&&"fill-extrusion"===a.type)return!0}else for(var o in t){var s=t[o];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(B);for(var c=[],u=0,h=l;u<h.length;u+=1){var p=h[u];c.push({wrappedTileID:p.tileID.wrapped().key,queryResults:p.tile.queryRenderedFeatures(t,r,e._state,p.queryGeometry,p.cameraQueryGeometry,p.scale,i,a,s,j(e.transform,p.tileID))})}var d=function(e){for(var t={},r={},n=0,i=e;n<i.length;n+=1){var a=i[n],o=a.queryResults,s=a.wrappedTileID,l=r[s]=r[s]||{};for(var c in o)for(var u=o[c],h=l[c]=l[c]||{},p=t[c]=t[c]||[],d=0,f=u;d<f.length;d+=1){var m=f[d];h[m.featureIndex]||(h[m.featureIndex]=!0,p.push(m))}}return t}(c);for(var f in d)d[f].forEach((function(t){var r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return d}function B(e,t){var r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}var N=function(e,t){this.max=e,this.onRemove=t,this.reset()};N.prototype.reset=function(){for(var e in this.data)for(var t=0,r=this.data[e];t<r.length;t+=1){var n=r[t];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},N.prototype.add=function(e,t,r){var n=this,i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);var a={value:t,timeout:void 0};if(void 0!==r&&(a.timeout=setTimeout((function(){n.remove(e,a)}),r)),this.data[i].push(a),this.order.push(i),this.order.length>this.max){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},N.prototype.has=function(e){return e.wrapped().key in this.data},N.prototype.getAndRemove=function(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null},N.prototype._getAndRemoveByKey=function(e){var t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value},N.prototype.getByKey=function(e){var t=this.data[e];return t?t[0].value:null},N.prototype.get=function(e){return this.has(e)?this.data[e.wrapped().key][0].value:null},N.prototype.remove=function(e,t){if(!this.has(e))return this;var r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this},N.prototype.setMaxSize=function(e){for(this.max=e;this.order.length>this.max;){var t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this},N.prototype.filter=function(e){var t=[];for(var r in this.data)for(var n=0,i=this.data[r];n<i.length;n+=1){var a=i[n];e(a.value)||t.push(a)}for(var o=0,s=t;o<s.length;o+=1){var l=s[o];this.remove(l.value.tileID,l)}};var U=function(e,t,r){this.context=e;var n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};U.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},U.prototype.updateData=function(e){var t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)},U.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var V={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},q=function(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;var i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer};q.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},q.prototype.updateData=function(e){var t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)},q.prototype.enableAttributes=function(e,t){for(var r=0;r<this.attributes.length;r++){var n=this.attributes[r],i=t.attributes[n.name];void 0!==i&&e.enableVertexAttribArray(i)}},q.prototype.setVertexAttribPointers=function(e,t,r){for(var n=0;n<this.attributes.length;n++){var i=this.attributes[n],a=t.attributes[i.name];void 0!==a&&e.vertexAttribPointer(a,i.components,e[V[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}},q.prototype.destroy=function(){var e=this.context.gl;this.buffer&&(e.deleteBuffer(this.buffer),delete this.buffer)};var H=function(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};H.prototype.get=function(){return this.current},H.prototype.set=function(e){},H.prototype.getDefault=function(){return this.default},H.prototype.setDefault=function(){this.set(this.default)};var G=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.prototype.set=function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},r}(H),W=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 1},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)},t}(H),$=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)},t}(H),Z=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[!0,!0,!0,!0]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(H),X=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)},t}(H),Y=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 255},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)},t}(H),K=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},t.prototype.set=function(e){var t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)},t}(H),J=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)},t}(H),Q=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}},t}(H),ee=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return[0,1]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)},t}(H),te=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}},t}(H),re=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.LESS},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)},t}(H),ne=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}},t}(H),ie=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[e.ONE,e.ZERO]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)},t}(H),ae=function(t){function r(){t.apply(this,arguments)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getDefault=function(){return e.Color.transparent},r.prototype.set=function(e){var t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)},r}(H),oe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.FUNC_ADD},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)},t}(H),se=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}},t}(H),le=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.BACK},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)},t}(H),ce=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.CCW},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)},t}(H),ue=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)},t}(H),he=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return this.gl.TEXTURE0},t.prototype.set=function(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)},t}(H),pe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){var e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]},t.prototype.set=function(e){var t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)},t}(H),de=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}},t}(H),fe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(H),me=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}},t}(H),ge=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}},t}(H),ye=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){var t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1},t}(H),ve=function(e){function t(t){e.call(this,t),this.vao=t.extVertexArrayObject}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t.prototype.set=function(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)},t}(H),xe=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return 4},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}},t}(H),be=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}},t}(H),_e=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return!1},t.prototype.set=function(e){if(e!==this.current||this.dirty){var t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}},t}(H),we=function(e){function t(t,r){e.call(this,t),this.context=t,this.parent=r}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getDefault=function(){return null},t}(H),ke=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setDirty=function(){this.dirty=!0},t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}},t}(we),Te=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.set=function(e){if(e!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}},t}(we),Se=function(e,t,r,n){this.context=e,this.width=t,this.height=r;var i=e.gl,a=this.framebuffer=i.createFramebuffer();this.colorAttachment=new ke(e,a),n&&(this.depthAttachment=new Te(e,a))};Se.prototype.destroy=function(){var e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){var r=this.depthAttachment.get();r&&e.deleteRenderbuffer(r)}e.deleteFramebuffer(this.framebuffer)};var Ae=function(e,t,r){this.func=e,this.mask=t,this.range=r};Ae.ReadOnly=!1,Ae.ReadWrite=!0,Ae.disabled=new Ae(519,Ae.ReadOnly,[0,1]);var Me=7680,Ee=function(e,t,r,n,i,a){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a};Ee.disabled=new Ee({func:519,mask:0},0,0,Me,Me,Me);var Ce=function(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r};Ce.disabled=new Ce(Ce.Replace=[1,0],e.Color.transparent,[!1,!1,!1,!1]),Ce.unblended=new Ce(Ce.Replace,e.Color.transparent,[!0,!0,!0,!0]),Ce.alphaBlended=new Ce([1,771],e.Color.transparent,[!0,!0,!0,!0]);var Pe=function(e,t,r){this.enable=e,this.mode=t,this.frontFace=r};Pe.disabled=new Pe(!1,1029,2305),Pe.backCCW=new Pe(!0,1029,2305);var Le=function(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new G(this),this.clearDepth=new W(this),this.clearStencil=new $(this),this.colorMask=new Z(this),this.depthMask=new X(this),this.stencilMask=new Y(this),this.stencilFunc=new K(this),this.stencilOp=new J(this),this.stencilTest=new Q(this),this.depthRange=new ee(this),this.depthTest=new te(this),this.depthFunc=new re(this),this.blend=new ne(this),this.blendFunc=new ie(this),this.blendColor=new ae(this),this.blendEquation=new oe(this),this.cullFace=new se(this),this.cullFaceSide=new le(this),this.frontFace=new ce(this),this.program=new ue(this),this.activeTexture=new he(this),this.viewport=new pe(this),this.bindFramebuffer=new de(this),this.bindRenderbuffer=new fe(this),this.bindTexture=new me(this),this.bindVertexBuffer=new ge(this),this.bindElementBuffer=new ye(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new ve(this),this.pixelStoreUnpack=new xe(this),this.pixelStoreUnpackPremultiplyAlpha=new be(this),this.pixelStoreUnpackFlipY=new _e(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(e.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)};Le.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Le.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Le.prototype.createIndexBuffer=function(e,t){return new U(this,e,t)},Le.prototype.createVertexBuffer=function(e,t,r){return new q(this,e,t,r)},Le.prototype.createRenderbuffer=function(e,t,r){var n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i},Le.prototype.createFramebuffer=function(e,t,r){return new Se(this,e,t,r)},Le.prototype.clear=function(e){var t=e.color,r=e.depth,n=this.gl,i=0;t&&(i|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),"undefined"!==typeof r&&(i|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),n.clear(i)},Le.prototype.setCullFace=function(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))},Le.prototype.setDepthMode=function(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)},Le.prototype.setStencilMode=function(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)},Le.prototype.setColorMode=function(t){e.deepEqual(t.blendFunction,Ce.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)},Le.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var Ie=function(t){function r(r,n,i){var a=this;t.call(this),this.id=r,this.dispatcher=i,this.on("data",(function(e){"source"===e.dataType&&"metadata"===e.sourceDataType&&(a._sourceLoaded=!0),a._sourceLoaded&&!a._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(a.reload(),a.transform&&a.update(a.transform))})),this.on("error",(function(){a._sourceErrored=!0})),this._source=function(t,r,n,i){var a=new D[r.type](t,r,n,i);if(a.id!==t)throw new Error("Expected Source id to be "+t+" instead of "+a.id);return e.bindAll(["load","abort","unload","serialize","prepare"],a),a}(r,n,i,this),this._tiles={},this._cache=new N(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new e.SourceFeatureState}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.onAdd=function(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)},r.prototype.onRemove=function(e){this._source&&this._source.onRemove&&this._source.onRemove(e)},r.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var e in this._tiles){var t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0},r.prototype.getSource=function(){return this._source},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){if(this._paused){var e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}},r.prototype._loadTile=function(e,t){return this._source.loadTile(e,t)},r.prototype._unloadTile=function(e){if(this._source.unloadTile)return this._source.unloadTile(e,(function(){}))},r.prototype._abortTile=function(e){if(this._source.abortTile)return this._source.abortTile(e,(function(){}))},r.prototype.serialize=function(){return this._source.serialize()},r.prototype.prepare=function(e){for(var t in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}},r.prototype.getIds=function(){return e.values(this._tiles).map((function(e){return e.tileID})).sort(ze).map((function(e){return e.key}))},r.prototype.getRenderableIds=function(t){var r=this,n=[];for(var i in this._tiles)this._isIdRenderable(i,t)&&n.push(this._tiles[i]);return t?n.sort((function(t,n){var i=t.tileID,a=n.tileID,o=new e.Point(i.canonical.x,i.canonical.y)._rotate(r.transform.angle),s=new e.Point(a.canonical.x,a.canonical.y)._rotate(r.transform.angle);return i.overscaledZ-a.overscaledZ||s.y-o.y||s.x-o.x})).map((function(e){return e.tileID.key})):n.map((function(e){return e.tileID})).sort(ze).map((function(e){return e.key}))},r.prototype.hasRenderableParent=function(e){var t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)},r.prototype._isIdRenderable=function(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())},r.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var e in this._cache.reset(),this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")},r.prototype._reloadTile=function(e,t){var r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))},r.prototype._tileLoaded=function(t,r,n,i){if(i)return t.state="errored",void(404!==i.status?this._source.fire(new e.ErrorEvent(i,{tile:t})):this.update(this.transform));t.timeAdded=e.browser.now(),"expired"===n&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),this._source.fire(new e.Event("data",{dataType:"source",tile:t,coord:t.tileID}))},r.prototype._backfillDEM=function(e){for(var t=this.getRenderableIds(),r=0;r<t.length;r++){var n=t[r];if(e.neighboringTiles&&e.neighboringTiles[n]){var i=this.getTileByID(n);a(e,i),a(i,e)}}function a(e,t){e.needsHillshadePrepare=!0;var r=t.tileID.canonical.x-e.tileID.canonical.x,n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}},r.prototype.getTile=function(e){return this.getTileByID(e.key)},r.prototype.getTileByID=function(e){return this._tiles[e]},r.prototype._retainLoadedChildren=function(e,t,r,n){for(var i in this._tiles){var a=this._tiles[i];if(!(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)){for(var o=a.tileID;a&&a.tileID.overscaledZ>t+1;){var s=a.tileID.scaledTo(a.tileID.overscaledZ-1);(a=this._tiles[s.key])&&a.hasData()&&(o=s)}for(var l=o;l.overscaledZ>t;)if(e[(l=l.scaledTo(l.overscaledZ-1)).key]){n[o.key]=o;break}}}},r.prototype.findLoadedParent=function(e,t){if(e.key in this._loadedParentTiles){var r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(var n=e.overscaledZ-1;n>=t;n--){var i=e.scaledTo(n),a=this._getLoadedTile(i);if(a)return a}},r.prototype._getLoadedTile=function(e){var t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)},r.prototype.updateCacheSize=function(e){var t=(Math.ceil(e.width/this._source.tileSize)+1)*(Math.ceil(e.height/this._source.tileSize)+1),r=Math.floor(5*t),n="number"===typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,r):r;this._cache.setMaxSize(n)},r.prototype.handleWrapJump=function(e){var t=(e-(void 0===this._prevLng?e:this._prevLng))/360,r=Math.round(t);if(this._prevLng=e,r){var n={};for(var i in this._tiles){var a=this._tiles[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+r),n[a.tileID.key]=a}for(var o in this._tiles=n,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles){var l=this._tiles[s];this._setTileReloadTimer(s,l)}}},r.prototype.update=function(t){var n=this;if(this.transform=t,this._sourceLoaded&&!this._paused){var i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(t){return new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)})):(i=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(i=i.filter((function(e){return n._source.hasTile(e)})))):i=[];var a=t.coveringZoomLevel(this._source),o=Math.max(a-r.maxOverzooming,this._source.minzoom),s=Math.max(a+r.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(i,a);if(Oe(this._source.type)){for(var c={},u={},h=0,p=Object.keys(l);h<p.length;h+=1){var d=p[h],f=l[d],m=this._tiles[d];if(m&&!(m.fadeEndTime&&m.fadeEndTime<=e.browser.now())){var g=this.findLoadedParent(f,o);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[d]=f}}for(var y in this._retainLoadedChildren(u,a,s,l),c)l[y]||(this._coveredTiles[y]=!0,l[y]=c[y])}for(var v in l)this._tiles[v].clearFadeHold();for(var x=0,b=e.keysDifference(this._tiles,l);x<b.length;x+=1){var _=b[x],w=this._tiles[_];w.hasSymbolBuckets&&!w.holdingForFade()?w.setHoldDuration(this.map._fadeDuration):w.hasSymbolBuckets&&!w.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}},r.prototype.releaseSymbolFadeTiles=function(){for(var e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)},r.prototype._updateRetainedTiles=function(e,t){for(var n={},i={},a=Math.max(t-r.maxOverzooming,this._source.minzoom),o=Math.max(t+r.maxUnderzooming,this._source.minzoom),s={},l=0,c=e;l<c.length;l+=1){var u=c[l],h=this._addTile(u);n[u.key]=u,h.hasData()||t<this._source.maxzoom&&(s[u.key]=u)}this._retainLoadedChildren(s,t,o,n);for(var p=0,d=e;p<d.length;p+=1){var f=d[p],m=this._tiles[f.key];if(!m.hasData()){if(t+1>this._source.maxzoom){var g=f.children(this._source.maxzoom)[0],y=this.getTile(g);if(y&&y.hasData()){n[g.key]=g;continue}}else{var v=f.children(this._source.maxzoom);if(n[v[0].key]&&n[v[1].key]&&n[v[2].key]&&n[v[3].key])continue}for(var x=m.wasRequested(),b=f.overscaledZ-1;b>=a;--b){var _=f.scaledTo(b);if(i[_.key])break;if(i[_.key]=!0,!(m=this.getTile(_))&&x&&(m=this._addTile(_)),m&&(n[_.key]=_,x=m.wasRequested(),m.hasData()))break}}}return n},r.prototype._updateLoadedParentTileCache=function(){for(var e in this._loadedParentTiles={},this._tiles){for(var t=[],r=void 0,n=this._tiles[e].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);var i=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(i))break;n=i}for(var a=0,o=t;a<o.length;a+=1){var s=o[a];this._loadedParentTiles[s]=r}}},r.prototype._addTile=function(t){var r=this._tiles[t.key];if(r)return r;(r=this._cache.getAndRemove(t))&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));var n=Boolean(r);return n||(r=new e.Tile(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))),r?(r.uses++,this._tiles[t.key]=r,n||this._source.fire(new e.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},r.prototype._setTileReloadTimer=function(e,t){var r=this;e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);var n=t.getExpiryTimeout();n&&(this._timers[e]=setTimeout((function(){r._reloadTile(e,"expired"),delete r._timers[e]}),n))},r.prototype._removeTile=function(e){var t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))},r.prototype.clearTiles=function(){for(var e in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(e);this._cache.reset()},r.prototype.tilesIn=function(t,r,n){var i=this,a=[],o=this.transform;if(!o)return a;for(var s=n?o.getCameraQueryGeometry(t):t,l=t.map((function(e){return o.pointCoordinate(e)})),c=s.map((function(e){return o.pointCoordinate(e)})),u=this.getIds(),h=1/0,p=1/0,d=-1/0,f=-1/0,m=0,g=c;m<g.length;m+=1){var y=g[m];h=Math.min(h,y.x),p=Math.min(p,y.y),d=Math.max(d,y.x),f=Math.max(f,y.y)}for(var v=function(t){var n=i._tiles[u[t]];if(!n.holdingForFade()){var s=n.tileID,m=Math.pow(2,o.zoom-n.tileID.overscaledZ),g=r*n.queryPadding*e.EXTENT/n.tileSize/m,y=[s.getTilePoint(new e.MercatorCoordinate(h,p)),s.getTilePoint(new e.MercatorCoordinate(d,f))];if(y[0].x-g<e.EXTENT&&y[0].y-g<e.EXTENT&&y[1].x+g>=0&&y[1].y+g>=0){var v=l.map((function(e){return s.getTilePoint(e)})),x=c.map((function(e){return s.getTilePoint(e)}));a.push({tile:n,tileID:s,queryGeometry:v,cameraQueryGeometry:x,scale:m})}}},x=0;x<u.length;x++)v(x);return a},r.prototype.getVisibleCoordinates=function(e){for(var t=this,r=this.getRenderableIds(e).map((function(e){return t._tiles[e].tileID})),n=0,i=r;n<i.length;n+=1){var a=i[n];a.posMatrix=this.transform.calculatePosMatrix(a.toUnwrapped())}return r},r.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Oe(this._source.type))for(var t in this._tiles){var r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.browser.now())return!0}return!1},r.prototype.setFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.updateState(e,t,r)},r.prototype.removeFeatureState=function(e,t,r){e=e||"_geojsonTileLayer",this._state.removeFeatureState(e,t,r)},r.prototype.getFeatureState=function(e,t){return e=e||"_geojsonTileLayer",this._state.getState(e,t)},r.prototype.setDependencies=function(e,t,r){var n=this._tiles[e];n&&n.setDependencies(t,r)},r.prototype.reloadTilesForDependencies=function(e,t){for(var r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(e,t)}))},r}(e.Evented);function ze(e,t){var r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function Oe(e){return"raster"===e||"image"===e||"video"===e}function Re(){return new e.window.Worker(aa.workerUrl)}Ie.maxOverzooming=10,Ie.maxUnderzooming=3;var De="mapboxgl_preloaded_worker_pool",je=function(){this.active={}};je.prototype.acquire=function(e){if(!this.workers)for(this.workers=[];this.workers.length<je.workerCount;)this.workers.push(new Re);return this.active[e]=!0,this.workers.slice()},je.prototype.release=function(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((function(e){e.terminate()})),this.workers=null)},je.prototype.isPreloaded=function(){return!!this.active[De]},je.prototype.numActive=function(){return Object.keys(this.active).length};var Fe,Be=Math.floor(e.browser.hardwareConcurrency/2);function Ne(){return Fe||(Fe=new je),Fe}function Ue(t,r){var n={};for(var i in t)"ref"!==i&&(n[i]=t[i]);return e.refProperties.forEach((function(e){e in r&&(n[e]=r[e])})),n}function Ve(e){e=e.slice();for(var t=Object.create(null),r=0;r<e.length;r++)t[e[r].id]=e[r];for(var n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=Ue(e[n],t[e[n].ref]));return e}je.workerCount=Math.max(Math.min(Be,6),1);var qe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function He(e,t,r){r.push({command:qe.addSource,args:[e,t[e]]})}function Ge(e,t,r){t.push({command:qe.removeSource,args:[e]}),r[e]=!0}function We(e,t,r,n){Ge(e,r,n),He(e,t,r)}function $e(t,r,n){var i;for(i in t[n])if(t[n].hasOwnProperty(i)&&"data"!==i&&!e.deepEqual(t[n][i],r[n][i]))return!1;for(i in r[n])if(r[n].hasOwnProperty(i)&&"data"!==i&&!e.deepEqual(t[n][i],r[n][i]))return!1;return!0}function Ze(t,r,n,i,a,o){var s;for(s in r=r||{},t=t||{})t.hasOwnProperty(s)&&(e.deepEqual(t[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}));for(s in r)r.hasOwnProperty(s)&&!t.hasOwnProperty(s)&&(e.deepEqual(t[s],r[s])||n.push({command:o,args:[i,s,r[s],a]}))}function Xe(e){return e.id}function Ye(e,t){return e[t.id]=t,e}function Ke(t,r){if(!t)return[{command:qe.setStyle,args:[r]}];var n=[];try{if(!e.deepEqual(t.version,r.version))return[{command:qe.setStyle,args:[r]}];e.deepEqual(t.center,r.center)||n.push({command:qe.setCenter,args:[r.center]}),e.deepEqual(t.zoom,r.zoom)||n.push({command:qe.setZoom,args:[r.zoom]}),e.deepEqual(t.bearing,r.bearing)||n.push({command:qe.setBearing,args:[r.bearing]}),e.deepEqual(t.pitch,r.pitch)||n.push({command:qe.setPitch,args:[r.pitch]}),e.deepEqual(t.sprite,r.sprite)||n.push({command:qe.setSprite,args:[r.sprite]}),e.deepEqual(t.glyphs,r.glyphs)||n.push({command:qe.setGlyphs,args:[r.glyphs]}),e.deepEqual(t.transition,r.transition)||n.push({command:qe.setTransition,args:[r.transition]}),e.deepEqual(t.light,r.light)||n.push({command:qe.setLight,args:[r.light]});var i={},a=[];!function(t,r,n,i){var a;for(a in r=r||{},t=t||{})t.hasOwnProperty(a)&&(r.hasOwnProperty(a)||Ge(a,n,i));for(a in r)r.hasOwnProperty(a)&&(t.hasOwnProperty(a)?e.deepEqual(t[a],r[a])||("geojson"===t[a].type&&"geojson"===r[a].type&&$e(t,r,a)?n.push({command:qe.setGeoJSONSourceData,args:[a,r[a].data]}):We(a,r,n,i)):He(a,r,n))}(t.sources,r.sources,a,i);var o=[];t.layers&&t.layers.forEach((function(e){i[e.source]?n.push({command:qe.removeLayer,args:[e.id]}):o.push(e)})),n=n.concat(a),function(t,r,n){r=r||[];var i,a,o,s,l,c,u,h=(t=t||[]).map(Xe),p=r.map(Xe),d=t.reduce(Ye,{}),f=r.reduce(Ye,{}),m=h.slice(),g=Object.create(null);for(i=0,a=0;i<h.length;i++)o=h[i],f.hasOwnProperty(o)?a++:(n.push({command:qe.removeLayer,args:[o]}),m.splice(m.indexOf(o,a),1));for(i=0,a=0;i<p.length;i++)o=p[p.length-1-i],m[m.length-1-i]!==o&&(d.hasOwnProperty(o)?(n.push({command:qe.removeLayer,args:[o]}),m.splice(m.lastIndexOf(o,m.length-a),1)):a++,c=m[m.length-i],n.push({command:qe.addLayer,args:[f[o],c]}),m.splice(m.length-i,0,o),g[o]=!0);for(i=0;i<p.length;i++)if(s=d[o=p[i]],l=f[o],!g[o]&&!e.deepEqual(s,l))if(e.deepEqual(s.source,l.source)&&e.deepEqual(s["source-layer"],l["source-layer"])&&e.deepEqual(s.type,l.type)){for(u in Ze(s.layout,l.layout,n,o,null,qe.setLayoutProperty),Ze(s.paint,l.paint,n,o,null,qe.setPaintProperty),e.deepEqual(s.filter,l.filter)||n.push({command:qe.setFilter,args:[o,l.filter]}),e.deepEqual(s.minzoom,l.minzoom)&&e.deepEqual(s.maxzoom,l.maxzoom)||n.push({command:qe.setLayerZoomRange,args:[o,l.minzoom,l.maxzoom]}),s)s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Ze(s[u],l[u],n,o,u.slice(6),qe.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:qe.setLayerProperty,args:[o,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!s.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Ze(s[u],l[u],n,o,u.slice(6),qe.setPaintProperty):e.deepEqual(s[u],l[u])||n.push({command:qe.setLayerProperty,args:[o,u,l[u]]}))}else n.push({command:qe.removeLayer,args:[o]}),c=m[m.lastIndexOf(o)+1],n.push({command:qe.addLayer,args:[l,c]})}(o,r.layers,n)}catch(s){console.warn("Unable to compute style diff:",s),n=[{command:qe.setStyle,args:[r]}]}return n}var Je=function(e,t){this.reset(e,t)};Je.prototype.reset=function(e,t){this.points=e||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Je.prototype.lerp=function(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);for(var r=1,n=this._distances[r],i=t*this.paddedLength+this.padding;n<i&&r<this._distances.length;)n=this._distances[++r];var a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))};var Qe=function(e,t,r){var n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(var a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0};function et(t,r,n,i,a){var o=e.create();return r?(e.scale(o,o,[1/a,1/a,1]),n||e.rotateZ(o,o,i.angle)):e.multiply(o,i.labelPlaneMatrix,t),o}function tt(t,r,n,i,a){if(r){var o=e.clone(t);return e.scale(o,o,[a,a,1]),n||e.rotateZ(o,o,-i.angle),o}return i.glCoordMatrix}function rt(t,r){var n=[t.x,t.y,0,1];dt(n,n,r);var i=n[3];return{point:new e.Point(n[0]/i,n[1]/i),signedDistanceFromCamera:i}}function nt(e,t){return.5+e/t*.5}function it(e,t){var r=e[0]/e[3],n=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&n>=-t[1]&&n<=t[1]}function at(t,r,n,i,a,o,s,l){var c=i?t.textSizeData:t.iconSizeData,u=e.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],p=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;p.clear();for(var d=t.lineVertexArray,f=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,m=n.transform.width/n.transform.height,g=!1,y=0;y<f.length;y++){var v=f.get(y);if(v.hidden||v.writingMode===e.WritingMode.vertical&&!g)pt(v.numGlyphs,p);else{g=!1;var x=[v.anchorX,v.anchorY,0,1];if(e.transformMat4(x,x,r),it(x,h)){var b=x[3],_=nt(n.transform.cameraToCenterDistance,b),w=e.evaluateSizeForFeature(c,u,v),k=s?w/_:w*_,T=new e.Point(v.anchorX,v.anchorY),S=rt(T,a).point,A={},M=lt(v,k,!1,l,r,a,o,t.glyphOffsetArray,d,p,S,T,A,m);g=M.useVertical,(M.notEnoughRoom||g||M.needsFlipping&&lt(v,k,!0,l,r,a,o,t.glyphOffsetArray,d,p,S,T,A,m).notEnoughRoom)&&pt(v.numGlyphs,p)}else pt(v.numGlyphs,p)}}i?t.text.dynamicLayoutVertexBuffer.updateData(p):t.icon.dynamicLayoutVertexBuffer.updateData(p)}function ot(e,t,r,n,i,a,o,s,l,c,u){var h=s.glyphStartIndex+s.numGlyphs,p=s.lineStartIndex,d=s.lineStartIndex+s.lineLength,f=t.getoffsetX(s.glyphStartIndex),m=t.getoffsetX(h-1),g=ut(e*f,r,n,i,a,o,s.segment,p,d,l,c,u);if(!g)return null;var y=ut(e*m,r,n,i,a,o,s.segment,p,d,l,c,u);return y?{first:g,last:y}:null}function st(t,r,n,i){return t===e.WritingMode.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(t===e.WritingMode.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function lt(t,r,n,i,a,o,s,l,c,u,h,p,d,f){var m,g=r/24,y=t.lineOffsetX*g,v=t.lineOffsetY*g;if(t.numGlyphs>1){var x=t.glyphStartIndex+t.numGlyphs,b=t.lineStartIndex,_=t.lineStartIndex+t.lineLength,w=ot(g,l,y,v,n,h,p,t,c,o,d);if(!w)return{notEnoughRoom:!0};var k=rt(w.first.point,s).point,T=rt(w.last.point,s).point;if(i&&!n){var S=st(t.writingMode,k,T,f);if(S)return S}m=[w.first];for(var A=t.glyphStartIndex+1;A<x-1;A++)m.push(ut(g*l.getoffsetX(A),y,v,n,h,p,t.segment,b,_,c,o,d));m.push(w.last)}else{if(i&&!n){var M=rt(p,a).point,E=t.lineStartIndex+t.segment+1,C=new e.Point(c.getx(E),c.gety(E)),P=rt(C,a),L=P.signedDistanceFromCamera>0?P.point:ct(p,C,M,1,a),I=st(t.writingMode,M,L,f);if(I)return I}var z=ut(g*l.getoffsetX(t.glyphStartIndex),y,v,n,h,p,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,o,d);if(!z)return{notEnoughRoom:!0};m=[z]}for(var O=0,R=m;O<R.length;O+=1){var D=R[O];e.addDynamicAttributes(u,D.point,D.angle)}return{}}function ct(e,t,r,n,i){var a=rt(e.add(e.sub(t)._unit()),i).point,o=r.sub(a);return r.add(o._mult(n/o.mag()))}function ut(t,r,n,i,a,o,s,l,c,u,h,p){var d=i?t-r:t+r,f=d>0?1:-1,m=0;i&&(f*=-1,m=Math.PI),f<0&&(m+=Math.PI);for(var g=f>0?l+s:l+s+1,y=a,v=a,x=0,b=0,_=Math.abs(d),w=[];x+b<=_;){if((g+=f)<l||g>=c)return null;if(v=y,w.push(y),void 0===(y=p[g])){var k=new e.Point(u.getx(g),u.gety(g)),T=rt(k,h);if(T.signedDistanceFromCamera>0)y=p[g]=T.point;else{var S=g-f;y=ct(0===x?o:new e.Point(u.getx(S),u.gety(S)),k,v,_-x+1,h)}}x+=b,b=v.dist(y)}var A=(_-x)/b,M=y.sub(v),E=M.mult(A)._add(v);E._add(M._unit()._perp()._mult(n*f));var C=m+Math.atan2(y.y-v.y,y.x-v.x);return w.push(E),{point:E,angle:C,path:w}}Qe.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Qe.prototype.insert=function(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)},Qe.prototype.insertCircle=function(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)},Qe.prototype._insertBoxCell=function(e,t,r,n,i,a){this.boxCells[i].push(a)},Qe.prototype._insertCircleCell=function(e,t,r,n,i,a){this.circleCells[i].push(a)},Qe.prototype._query=function(e,t,r,n,i,a){if(r<0||e>this.width||n<0||t>this.height)return!i&&[];var o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return!0;for(var s=0;s<this.boxKeys.length;s++)o.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];o.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return a?o.filter(a):o}var p={hitTest:i,seenUids:{box:{},circle:{}}};return this._forEachCell(e,t,r,n,this._queryCell,o,p,a),i?o.length>0:o},Qe.prototype._queryCircle=function(e,t,r,n,i){var a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!n&&[];var c=[],u={hitTest:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}};return this._forEachCell(a,s,o,l,this._queryCellCircle,c,u,i),n?c.length>0:c},Qe.prototype.query=function(e,t,r,n,i){return this._query(e,t,r,n,!1,i)},Qe.prototype.hitTest=function(e,t,r,n,i){return this._query(e,t,r,n,!0,i)},Qe.prototype.hitTestCircle=function(e,t,r,n){return this._queryCircle(e,t,r,!0,n)},Qe.prototype._queryCell=function(e,t,r,n,i,a,o,s){var l=o.seenUids,c=this.boxCells[i];if(null!==c)for(var u=this.bboxes,h=0,p=c;h<p.length;h+=1){var d=p[h];if(!l.box[d]){l.box[d]=!0;var f=4*d;if(e<=u[f+2]&&t<=u[f+3]&&r>=u[f+0]&&n>=u[f+1]&&(!s||s(this.boxKeys[d]))){if(o.hitTest)return a.push(!0),!0;a.push({key:this.boxKeys[d],x1:u[f],y1:u[f+1],x2:u[f+2],y2:u[f+3]})}}}var m=this.circleCells[i];if(null!==m)for(var g=this.circles,y=0,v=m;y<v.length;y+=1){var x=v[y];if(!l.circle[x]){l.circle[x]=!0;var b=3*x;if(this._circleAndRectCollide(g[b],g[b+1],g[b+2],e,t,r,n)&&(!s||s(this.circleKeys[x]))){if(o.hitTest)return a.push(!0),!0;var _=g[b],w=g[b+1],k=g[b+2];a.push({key:this.circleKeys[x],x1:_-k,y1:w-k,x2:_+k,y2:w+k})}}}},Qe.prototype._queryCellCircle=function(e,t,r,n,i,a,o,s){var l=o.circle,c=o.seenUids,u=this.boxCells[i];if(null!==u)for(var h=this.bboxes,p=0,d=u;p<d.length;p+=1){var f=d[p];if(!c.box[f]){c.box[f]=!0;var m=4*f;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[m+0],h[m+1],h[m+2],h[m+3])&&(!s||s(this.boxKeys[f])))return a.push(!0),!0}}var g=this.circleCells[i];if(null!==g)for(var y=this.circles,v=0,x=g;v<x.length;v+=1){var b=x[v];if(!c.circle[b]){c.circle[b]=!0;var _=3*b;if(this._circlesCollide(y[_],y[_+1],y[_+2],l.x,l.y,l.radius)&&(!s||s(this.circleKeys[b])))return a.push(!0),!0}}},Qe.prototype._forEachCell=function(e,t,r,n,i,a,o,s){for(var l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n),p=l;p<=u;p++)for(var d=c;d<=h;d++){var f=this.xCellCount*d+p;if(i.call(this,e,t,r,n,f,a,o,s))return}},Qe.prototype._convertToXCellCoord=function(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))},Qe.prototype._convertToYCellCoord=function(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))},Qe.prototype._circlesCollide=function(e,t,r,n,i,a){var o=n-e,s=i-t,l=r+a;return l*l>o*o+s*s},Qe.prototype._circleAndRectCollide=function(e,t,r,n,i,a,o){var s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;var c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;var h=l-s,p=u-c;return h*h+p*p<=r*r};var ht=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function pt(e,t){for(var r=0;r<e;r++){var n=t.length;t.resize(n+4),t.float32.set(ht,3*n)}}function dt(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}var ft=100,mt=function(e,t,r){void 0===t&&(t=new Qe(e.width+200,e.height+200,25)),void 0===r&&(r=new Qe(e.width+200,e.height+200,25)),this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+ft,this.screenBottomBoundary=e.height+ft,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200};function gt(t,r,n){return r*(e.EXTENT/(t.tileSize*Math.pow(2,n-t.tileID.overscaledZ)))}mt.prototype.placeCollisionBox=function(e,t,r,n,i){var a=this.projectAndGetPerspectiveRatio(n,e.anchorPointX,e.anchorPointY),o=r*a.perspectiveRatio,s=e.x1*o+a.point.x,l=e.y1*o+a.point.y,c=e.x2*o+a.point.x,u=e.y2*o+a.point.y;return!this.isInsideGrid(s,l,c,u)||!t&&this.grid.hitTest(s,l,c,u,i)?{box:[],offscreen:!1}:{box:[s,l,c,u],offscreen:this.isOffscreen(s,l,c,u)}},mt.prototype.placeCollisionCircles=function(t,r,n,i,a,o,s,l,c,u,h,p,d){var f=[],m=new e.Point(r.anchorX,r.anchorY),g=rt(m,o),y=nt(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),v=(u?a/y:a*y)/e.ONE_EM,x=rt(m,s).point,b=ot(v,i,r.lineOffsetX*v,r.lineOffsetY*v,!1,x,m,r,n,s,{}),_=!1,w=!1,k=!0;if(b){for(var T=.5*p*y+d,S=new e.Point(-100,-100),A=new e.Point(this.screenRightBoundary,this.screenBottomBoundary),M=new Je,E=b.first,C=b.last,P=[],L=E.path.length-1;L>=1;L--)P.push(E.path[L]);for(var I=1;I<C.path.length;I++)P.push(C.path[I]);var z=2.5*T;if(l){var O=P.map((function(e){return rt(e,l)}));P=O.some((function(e){return e.signedDistanceFromCamera<=0}))?[]:O.map((function(e){return e.point}))}var R=[];if(P.length>0){for(var D=P[0].clone(),j=P[0].clone(),F=1;F<P.length;F++)D.x=Math.min(D.x,P[F].x),D.y=Math.min(D.y,P[F].y),j.x=Math.max(j.x,P[F].x),j.y=Math.max(j.y,P[F].y);R=D.x>=S.x&&j.x<=A.x&&D.y>=S.y&&j.y<=A.y?[P]:j.x<S.x||D.x>A.x||j.y<S.y||D.y>A.y?[]:e.clipLine([P],S.x,S.y,A.x,A.y)}for(var B=0,N=R;B<N.length;B+=1){var U=N[B];M.reset(U,.25*T);var V=0;V=M.length<=.5*T?1:Math.ceil(M.paddedLength/z)+1;for(var q=0;q<V;q++){var H=q/Math.max(V-1,1),G=M.lerp(H),W=G.x+ft,$=G.y+ft;f.push(W,$,T,0);var Z=W-T,X=$-T,Y=W+T,K=$+T;if(k=k&&this.isOffscreen(Z,X,Y,K),w=w||this.isInsideGrid(Z,X,Y,K),!t&&this.grid.hitTestCircle(W,$,T,h)&&(_=!0,!c))return{circles:[],offscreen:!1,collisionDetected:_}}}}return{circles:!c&&_||!w?[]:f,offscreen:k,collisionDetected:_}},mt.prototype.queryRenderedSymbols=function(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],n=1/0,i=1/0,a=-1/0,o=-1/0,s=0,l=t;s<l.length;s+=1){var c=l[s],u=new e.Point(c.x+ft,c.y+ft);n=Math.min(n,u.x),i=Math.min(i,u.y),a=Math.max(a,u.x),o=Math.max(o,u.y),r.push(u)}for(var h={},p={},d=0,f=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o));d<f.length;d+=1){var m=f[d],g=m.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var y=[new e.Point(m.x1,m.y1),new e.Point(m.x2,m.y1),new e.Point(m.x2,m.y2),new e.Point(m.x1,m.y2)];e.polygonIntersectsPolygon(r,y)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===p[g.bucketInstanceId]&&(p[g.bucketInstanceId]=[]),p[g.bucketInstanceId].push(g.featureIndex))}}return p},mt.prototype.insertCollisionBox=function(e,t,r,n,i){var a={bucketInstanceId:r,featureIndex:n,collisionGroupID:i};(t?this.ignoredGrid:this.grid).insert(a,e[0],e[1],e[2],e[3])},mt.prototype.insertCollisionCircles=function(e,t,r,n,i){for(var a=t?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:i},s=0;s<e.length;s+=4)a.insertCircle(o,e[s],e[s+1],e[s+2])},mt.prototype.projectAndGetPerspectiveRatio=function(t,r,n){var i=[r,n,0,1];return dt(i,i,t),{point:new e.Point((i[0]/i[3]+1)/2*this.transform.width+ft,(-i[1]/i[3]+1)/2*this.transform.height+ft),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},mt.prototype.isOffscreen=function(e,t,r,n){return r<ft||e>=this.screenRightBoundary||n<ft||t>this.screenBottomBoundary},mt.prototype.isInsideGrid=function(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary},mt.prototype.getViewportMatrix=function(){var t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t};var yt=function(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r};yt.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var vt=function(e,t,r,n,i){this.text=new yt(e?e.text:null,t,r,i),this.icon=new yt(e?e.icon:null,t,n,i)};vt.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var xt=function(e,t,r){this.text=e,this.icon=t,this.skipFade=r},bt=function(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]},_t=function(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i},wt=function(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}};function kt(t,r,n,i,a){var o=e.getAnchorAlignment(t),s=-(o.horizontalAlign-.5)*r,l=-(o.verticalAlign-.5)*n,c=e.evaluateVariableOffset(t,i);return new e.Point(s+c[0]*a,l+c[1]*a)}function Tt(t,r,n,i,a,o){var s=t.x1,l=t.x2,c=t.y1,u=t.y2,h=t.anchorPointX,p=t.anchorPointY,d=new e.Point(r,n);return i&&d._rotate(a?o:-o),{x1:s+d.x,y1:c+d.y,x2:l+d.x,y2:u+d.y,anchorPointX:h,anchorPointY:p}}wt.prototype.get=function(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){var t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:function(e){return e.collisionGroupID===t}}}return this.collisionGroups[e]};var St=function(e,t,r,n){this.transform=e.clone(),this.collisionIndex=new mt(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new wt(r),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function At(e,t,r,n,i){e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0),e.emplaceBack(t?1:0,r?1:0,n||0,i||0)}St.prototype.getBucketParts=function(t,r,n,i){var a=n.getBucket(r),o=n.latestFeatureIndex;if(a&&o&&r.id===a.layerIds[0]){var s=n.collisionBoxArray,l=a.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/e.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),d="map"===l.get("text-rotation-alignment"),f=gt(n,1,this.transform.zoom),m=et(h,p,d,this.transform,f),g=null;if(p){var y=tt(h,p,d,this.transform,f);g=e.multiply([],this.transform.labelPlaneMatrix,y)}this.retainedQueryData[a.bucketInstanceId]=new _t(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);var v={bucket:a,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(var x=0,b=a.sortKeyRanges;x<b.length;x+=1){var _=b[x],w=_.sortKey,k=_.symbolInstanceStart,T=_.symbolInstanceEnd;t.push({sortKey:w,symbolInstanceStart:k,symbolInstanceEnd:T,parameters:v})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:v})}},St.prototype.attemptAnchorPlacement=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f){var m,g=[h.textOffset0,h.textOffset1],y=kt(e,r,n,g,i),v=this.collisionIndex.placeCollisionBox(Tt(t,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate);if(!f||0!==this.collisionIndex.placeCollisionBox(Tt(f,y.x,y.y,a,o,this.transform.angle),u,s,l,c.predicate).box.length)return v.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(m=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:r,height:n,anchor:e,textBoxScale:i,prevAnchor:m},this.markUsedJustification(p,e,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:y,placedGlyphBoxes:v}):void 0},St.prototype.placeLayerBucketPart=function(t,r,n){var i=this,a=t.parameters,o=a.bucket,s=a.layout,l=a.posMatrix,c=a.textLabelPlaneMatrix,u=a.labelToScreenMatrix,h=a.textPixelRatio,p=a.holdingForFade,d=a.collisionBoxArray,f=a.partiallyEvaluatedTextSize,m=a.collisionGroup,g=s.get("text-optional"),y=s.get("icon-optional"),v=s.get("text-allow-overlap"),x=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),_="map"===s.get("text-pitch-alignment"),w="none"!==s.get("icon-text-fit"),k="viewport-y"===s.get("symbol-z-order"),T=v&&(x||!o.hasIconData()||y),S=x&&(v||!o.hasTextData()||g);!o.collisionArrays&&d&&o.deserializeCollisionBoxes(d);var A=function(t,a){if(!r[t.crossTileID])if(p)i.placements[t.crossTileID]=new xt(!1,!1,!1);else{var d,k=!1,A=!1,M=!0,E=null,C={box:null,offscreen:null},P={box:null,offscreen:null},L=null,I=null,z=0,O=0,R=0;a.textFeatureIndex?z=a.textFeatureIndex:t.useRuntimeCollisionCircles&&(z=t.featureIndex),a.verticalTextFeatureIndex&&(O=a.verticalTextFeatureIndex);var D=a.textBox;if(D){var j=function(r){var n=e.WritingMode.horizontal;if(o.allowVerticalPlacement&&!r&&i.prevPlacement){var a=i.prevPlacement.placedOrientations[t.crossTileID];a&&(i.placedOrientations[t.crossTileID]=a,n=a,i.markUsedOrientation(o,n,t))}return n},F=function(r,n){if(o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&a.verticalTextBox)for(var i=0,s=o.writingModes;i<s.length&&(s[i]===e.WritingMode.vertical?(C=n(),P=C):C=r(),!(C&&C.box&&C.box.length));i+=1);else C=r()};if(s.get("text-variable-anchor")){var B=s.get("text-variable-anchor");if(i.prevPlacement&&i.prevPlacement.variableOffsets[t.crossTileID]){var N=i.prevPlacement.variableOffsets[t.crossTileID];B.indexOf(N.anchor)>0&&(B=B.filter((function(e){return e!==N.anchor}))).unshift(N.anchor)}var U=function(e,r,n){for(var a=e.x2-e.x1,s=e.y2-e.y1,c=t.textBoxScale,u=w&&!x?r:null,p={box:[],offscreen:!1},d=v?2*B.length:B.length,f=0;f<d;++f){var g=B[f%B.length],y=f>=B.length,T=i.attemptAnchorPlacement(g,e,a,s,c,b,_,h,l,m,y,t,o,n,u);if(T&&(p=T.placedGlyphBoxes)&&p.box&&p.box.length){k=!0,E=T.shift;break}}return p};F((function(){return U(D,a.iconBox,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox,n=C&&C.box&&C.box.length;return o.allowVerticalPlacement&&!n&&t.numVerticalGlyphVertices>0&&r?U(r,a.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),C&&(k=C.box,M=C.offscreen);var V=j(C&&C.box);if(!k&&i.prevPlacement){var q=i.prevPlacement.variableOffsets[t.crossTileID];q&&(i.variableOffsets[t.crossTileID]=q,i.markUsedJustification(o,q.anchor,t,V))}}else{var H=function(e,r){var n=i.collisionIndex.placeCollisionBox(e,v,h,l,m.predicate);return n&&n.box&&n.box.length&&(i.markUsedOrientation(o,r,t),i.placedOrientations[t.crossTileID]=r),n};F((function(){return H(D,e.WritingMode.horizontal)}),(function(){var r=a.verticalTextBox;return o.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?H(r,e.WritingMode.vertical):{box:null,offscreen:null}})),j(C&&C.box&&C.box.length)}}if(k=(d=C)&&d.box&&d.box.length>0,M=d&&d.offscreen,t.useRuntimeCollisionCircles){var G=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),W=e.evaluateSizeForFeature(o.textSizeData,f,G),$=s.get("text-padding"),Z=t.collisionCircleDiameter;L=i.collisionIndex.placeCollisionCircles(v,G,o.lineVertexArray,o.glyphOffsetArray,W,l,c,u,n,_,m.predicate,Z,$),k=v||L.circles.length>0&&!L.collisionDetected,M=M&&L.offscreen}if(a.iconFeatureIndex&&(R=a.iconFeatureIndex),a.iconBox){var X=function(e){var t=w&&E?Tt(e,E.x,E.y,b,_,i.transform.angle):e;return i.collisionIndex.placeCollisionBox(t,x,h,l,m.predicate)};A=P&&P.box&&P.box.length&&a.verticalIconBox?(I=X(a.verticalIconBox)).box.length>0:(I=X(a.iconBox)).box.length>0,M=M&&I.offscreen}var Y=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,K=y||0===t.numIconVertices;if(Y||K?K?Y||(A=A&&k):k=A&&k:A=k=A&&k,k&&d&&d.box&&(P&&P.box&&O?i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),o.bucketInstanceId,O,m.ID):i.collisionIndex.insertCollisionBox(d.box,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID)),A&&I&&i.collisionIndex.insertCollisionBox(I.box,s.get("icon-ignore-placement"),o.bucketInstanceId,R,m.ID),L&&(k&&i.collisionIndex.insertCollisionCircles(L.circles,s.get("text-ignore-placement"),o.bucketInstanceId,z,m.ID),n)){var J=o.bucketInstanceId,Q=i.collisionCircleArrays[J];void 0===Q&&(Q=i.collisionCircleArrays[J]=new bt);for(var ee=0;ee<L.circles.length;ee+=4)Q.circles.push(L.circles[ee+0]),Q.circles.push(L.circles[ee+1]),Q.circles.push(L.circles[ee+2]),Q.circles.push(L.collisionDetected?1:0)}i.placements[t.crossTileID]=new xt(k||T,A||S,M||o.justReloaded),r[t.crossTileID]=!0}};if(k)for(var M=o.getSortedSymbolIndexes(this.transform.angle),E=M.length-1;E>=0;--E){var C=M[E];A(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var P=t.symbolInstanceStart;P<t.symbolInstanceEnd;P++)A(o.symbolInstances.get(P),o.collisionArrays[P]);if(n&&o.bucketInstanceId in this.collisionCircleArrays){var L=this.collisionCircleArrays[o.bucketInstanceId];e.invert(L.invProjMatrix,l),L.viewportMatrix=this.collisionIndex.getViewportMatrix()}o.justReloaded=!1},St.prototype.markUsedJustification=function(t,r,n,i){var a,o={left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex};a=i===e.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:o[e.getAnchorJustification(r)];for(var s=0,l=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<l.length;s+=1){var c=l[s];c>=0&&(t.text.placedSymbolArray.get(c).crossTileID=a>=0&&c!==a?0:n.crossTileID)}},St.prototype.markUsedOrientation=function(t,r,n){for(var i=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,a=r===e.WritingMode.vertical?r:0,o=0,s=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];o<s.length;o+=1){var l=s[o];t.text.placedSymbolArray.get(l).placedOrientation=i}n.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)},St.prototype.commit=function(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;var t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;var n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(var s in this.placements){var l=this.placements[s],c=i[s];c?(this.opacities[s]=new vt(c,n,l.text,l.icon),r=r||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[s]=new vt(null,n,l.text,l.icon,l.skipFade),r=r||l.text||l.icon)}for(var u in i){var h=i[u];if(!this.opacities[u]){var p=new vt(h,n,!1,!1);p.isHidden()||(this.opacities[u]=p,r=r||h.text.placed||h.icon.placed)}}for(var d in a)this.variableOffsets[d]||!this.opacities[d]||this.opacities[d].isHidden()||(this.variableOffsets[d]=a[d]);for(var f in o)this.placedOrientations[f]||!this.opacities[f]||this.opacities[f].isHidden()||(this.placedOrientations[f]=o[f]);r?this.lastPlacementChangeTime=e:"number"!==typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)},St.prototype.updateLayerOpacities=function(e,t){for(var r={},n=0,i=t;n<i.length;n+=1){var a=i[n],o=a.getBucket(e);o&&a.latestFeatureIndex&&e.id===o.layerIds[0]&&this.updateBucketOpacities(o,r,a.collisionBoxArray)}},St.prototype.updateBucketOpacities=function(t,r,n){var i=this;t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();var a=t.layers[0].layout,o=new vt(null,0,!1,!1,!0),s=a.get("text-allow-overlap"),l=a.get("icon-allow-overlap"),c=a.get("text-variable-anchor"),u="map"===a.get("text-rotation-alignment"),h="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),d=new vt(null,0,s&&(l||!t.hasIconData()||a.get("icon-optional")),l&&(s||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);for(var f=function(e,t,r){for(var n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r)},m=function(n){var a=t.symbolInstances.get(n),s=a.numHorizontalGlyphVertices,l=a.numVerticalGlyphVertices,m=a.crossTileID,g=r[m],y=i.opacities[m];g?y=o:y||(y=d,i.opacities[m]=y),r[m]=!0;var v=s>0||l>0,x=a.numIconVertices>0,b=i.placedOrientations[a.crossTileID],_=b===e.WritingMode.vertical,w=b===e.WritingMode.horizontal||b===e.WritingMode.horizontalOnly;if(v){var k=Ot(y.text),T=_?Rt:k;f(t.text,s,T);var S=w?Rt:k;f(t.text,l,S);var A=y.text.isHidden();[a.rightJustifiedTextSymbolIndex,a.centerJustifiedTextSymbolIndex,a.leftJustifiedTextSymbolIndex].forEach((function(e){e>=0&&(t.text.placedSymbolArray.get(e).hidden=A||_?1:0)})),a.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(a.verticalPlacedTextSymbolIndex).hidden=A||w?1:0);var M=i.variableOffsets[a.crossTileID];M&&i.markUsedJustification(t,M.anchor,a,b);var E=i.placedOrientations[a.crossTileID];E&&(i.markUsedJustification(t,"left",a,E),i.markUsedOrientation(t,E,a))}if(x){var C=Ot(y.icon),P=!(p&&a.verticalPlacedIconSymbolIndex&&_);if(a.placedIconSymbolIndex>=0){var L=P?C:Rt;f(t.icon,a.numIconVertices,L),t.icon.placedSymbolArray.get(a.placedIconSymbolIndex).hidden=y.icon.isHidden()}if(a.verticalPlacedIconSymbolIndex>=0){var I=P?Rt:C;f(t.icon,a.numVerticalIconVertices,I),t.icon.placedSymbolArray.get(a.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden()}}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){var z=t.collisionArrays[n];if(z){var O=new e.Point(0,0);if(z.textBox||z.verticalTextBox){var R=!0;if(c){var D=i.variableOffsets[m];D?(O=kt(D.anchor,D.width,D.height,D.textOffset,D.textBoxScale),u&&O._rotate(h?i.transform.angle:-i.transform.angle)):R=!1}z.textBox&&At(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||_,O.x,O.y),z.verticalTextBox&&At(t.textCollisionBox.collisionVertexArray,y.text.placed,!R||w,O.x,O.y)}var j=Boolean(!w&&z.verticalIconBox);z.iconBox&&At(t.iconCollisionBox.collisionVertexArray,y.icon.placed,j,p?O.x:0,p?O.y:0),z.verticalIconBox&&At(t.iconCollisionBox.collisionVertexArray,y.icon.placed,!j,p?O.x:0,p?O.y:0)}}},g=0;g<t.symbolInstances.length;g++)m(g);if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){var y=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=y.invProjMatrix,t.placementViewportMatrix=y.viewportMatrix,t.collisionCircleArray=y.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}},St.prototype.symbolFadeChange=function(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},St.prototype.zoomAdjustment=function(e){return Math.max(0,(this.transform.zoom-e)/1.5)},St.prototype.hasTransitions=function(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration},St.prototype.stillRecent=function(e,t){var r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e},St.prototype.setStale=function(){this.stale=!0};var Mt=Math.pow(2,25),Et=Math.pow(2,24),Ct=Math.pow(2,17),Pt=Math.pow(2,16),Lt=Math.pow(2,9),It=Math.pow(2,8),zt=Math.pow(2,1);function Ot(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;var t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Mt+t*Et+r*Ct+t*Pt+r*Lt+t*It+r*zt+t}var Rt=0,Dt=function(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Dt.prototype.continuePlacement=function(e,t,r,n,i){for(var a=this._bucketParts;this._currentTileIndex<e.length;){var o=e[this._currentTileIndex];if(t.getBucketParts(a,n,o,this._sortAcrossTiles),this._currentTileIndex++,i())return!0}for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort((function(e,t){return e.sortKey-t.sortKey})));this._currentPartIndex<a.length;){var s=a[this._currentPartIndex];if(t.placeLayerBucketPart(s,this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0}return!1};var jt=function(e,t,r,n,i,a,o){this.placement=new St(e,i,a,o),this._currentPlacementIndex=t.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1};jt.prototype.isDone=function(){return this._done},jt.prototype.continuePlacement=function(t,r,n){for(var i=this,a=e.browser.now(),o=function(){var t=e.browser.now()-a;return!i._forceFullPlacement&&t>2};this._currentPlacementIndex>=0;){var s=r[t[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=l)&&(!s.maxzoom||s.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new Dt(s)),this._inProgressLayer.continuePlacement(n[s.source],this.placement,this._showCollisionBoxes,s,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},jt.prototype.commit=function(e){return this.placement.commit(e),this.placement};var Ft=512/e.EXTENT/2,Bt=function(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var n=0;n<t.length;n++){var i=t.get(n),a=i.key;this.indexedSymbolInstances[a]||(this.indexedSymbolInstances[a]=[]),this.indexedSymbolInstances[a].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,e)})}};Bt.prototype.getScaledCoordinates=function(t,r){var n=r.canonical.z-this.tileID.canonical.z,i=Ft/Math.pow(2,n);return{x:Math.floor((r.canonical.x*e.EXTENT+t.anchorX)*i),y:Math.floor((r.canonical.y*e.EXTENT+t.anchorY)*i)}},Bt.prototype.findMatches=function(e,t,r){for(var n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z),i=0;i<e.length;i++){var a=e.get(i);if(!a.crossTileID){var o=this.indexedSymbolInstances[a.key];if(o)for(var s=this.getScaledCoordinates(a,t),l=0,c=o;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-s.x)<=n&&Math.abs(u.coord.y-s.y)<=n&&!r[u.crossTileID]){r[u.crossTileID]=!0,a.crossTileID=u.crossTileID;break}}}}};var Nt=function(){this.maxCrossTileID=0};Nt.prototype.generate=function(){return++this.maxCrossTileID};var Ut=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Ut.prototype.handleWrapJump=function(e){var t=Math.round((e-this.lng)/360);if(0!==t)for(var r in this.indexes){var n=this.indexes[r],i={};for(var a in n){var o=n[a];o.tileID=o.tileID.unwrapTo(o.tileID.wrap+t),i[o.tileID.key]=o}this.indexes[r]=i}this.lng=e},Ut.prototype.addBucket=function(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(var n=0;n<t.symbolInstances.length;n++)t.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});var i=this.usedCrossTileIDs[e.overscaledZ];for(var a in this.indexes){var o=this.indexes[a];if(Number(a)>e.overscaledZ)for(var s in o){var l=o[s];l.tileID.isChildOf(e)&&l.findMatches(t.symbolInstances,e,i)}else{var c=o[e.scaledTo(Number(a)).key];c&&c.findMatches(t.symbolInstances,e,i)}}for(var u=0;u<t.symbolInstances.length;u++){var h=t.symbolInstances.get(u);h.crossTileID||(h.crossTileID=r.generate(),i[h.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Bt(e,t.symbolInstances,t.bucketInstanceId),!0},Ut.prototype.removeBucketCrossTileIDs=function(e,t){for(var r in t.indexedSymbolInstances)for(var n=0,i=t.indexedSymbolInstances[r];n<i.length;n+=1){var a=i[n];delete this.usedCrossTileIDs[e][a.crossTileID]}},Ut.prototype.removeStaleBuckets=function(e){var t=!1;for(var r in this.indexes){var n=this.indexes[r];for(var i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t};var Vt=function(){this.layerIndexes={},this.crossTileIDs=new Nt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Vt.prototype.addLayer=function(e,t,r){var n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new Ut);var i=!1,a={};n.handleWrapJump(r);for(var o=0,s=t;o<s.length;o+=1){var l=s[o],c=l.getBucket(e);c&&e.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(i=!0),a[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i},Vt.prototype.pruneUnusedLayers=function(e){var t={};for(var r in e.forEach((function(e){t[e]=!0})),this.layerIndexes)t[r]||delete this.layerIndexes[r]};var qt=function(t,r){return e.emitValidationErrors(t,r&&r.filter((function(e){return"source.canvas"!==e.identifier})))},Ht=e.pick(qe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Gt=e.pick(qe,["setCenter","setZoom","setBearing","setPitch"]),Wt=function(){var t={},r=e.styleSpec.$version;for(var n in e.styleSpec.$root){var i=e.styleSpec.$root[n];if(i.required){var a=null;null!=(a="version"===n?r:"array"===i.type?[]:{})&&(t[n]=a)}}return t}(),$t=function(t){function r(n,i){var a=this;void 0===i&&(i={}),t.call(this),this.map=n,this.dispatcher=new S(Ne(),this),this.imageManager=new p,this.imageManager.setEventedParent(this),this.glyphManager=new x(n._requestManager,i.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new Vt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());var o=this;this._rtlTextPluginCallback=r.registerForPluginStateChange((function(t){var r={pluginStatus:t.pluginStatus,pluginURL:t.pluginURL};o.dispatcher.broadcast("syncRTLPluginState",r,(function(t,r){if(e.triggerPluginCompletionEvent(t),r&&r.every((function(e){return e})))for(var n in o.sourceCaches)o.sourceCaches[n].reload()}))})),this.on("data",(function(e){if("source"===e.dataType&&"metadata"===e.sourceDataType){var t=a.sourceCaches[e.sourceId];if(t){var r=t.getSource();if(r&&r.vectorLayerIds)for(var n in a._layers){var i=a._layers[n];i.source===r.id&&a._validateLayer(i)}}}}))}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.loadURL=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"}));var i="boolean"===typeof r.validate?r.validate:!e.isMapboxURL(t);t=this.map._requestManager.normalizeStyleURL(t,r.accessToken);var a=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(a,(function(t,r){n._request=null,t?n.fire(new e.ErrorEvent(t)):r&&n._load(r,i)}))},r.prototype.loadJSON=function(t,r){var n=this;void 0===r&&(r={}),this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.browser.frame((function(){n._request=null,n._load(t,!1!==r.validate)}))},r.prototype.loadEmpty=function(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(Wt,!1)},r.prototype._load=function(t,r){if(!r||!qt(this,e.validateStyle(t))){for(var n in this._loaded=!0,this.stylesheet=t,t.sources)this.addSource(n,t.sources[n],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);var i=Ve(this.stylesheet.layers);this._order=i.map((function(e){return e.id})),this._layers={},this._serializedLayers={};for(var a=0,o=i;a<o.length;a+=1){var s=o[a];(s=e.createStyleLayer(s)).setEventedParent(this,{layer:{id:s.id}}),this._layers[s.id]=s,this._serializedLayers[s.id]=s.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new k(this.stylesheet.light),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}},r.prototype._loadSprite=function(t){var r=this;this._spriteRequest=function(t,r,n){var i,a,o,s=e.browser.devicePixelRatio>1?"@2x":"",l=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,s,".json"),e.ResourceType.SpriteJSON),(function(e,t){l=null,o||(o=e,i=t,u())})),c=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,s,".png"),e.ResourceType.SpriteImage),(function(e,t){c=null,o||(o=e,a=t,u())}));function u(){if(o)n(o);else if(i&&a){var t=e.browser.getImageData(a),r={};for(var s in i){var l=i[s],c=l.width,u=l.height,h=l.x,p=l.y,d=l.sdf,f=l.pixelRatio,m=l.stretchX,g=l.stretchY,y=l.content,v=new e.RGBAImage({width:c,height:u});e.RGBAImage.copy(t,v,{x:h,y:p},{x:0,y:0},{width:c,height:u}),r[s]={data:v,pixelRatio:f,sdf:d,stretchX:m,stretchY:g,content:y}}n(null,r)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(t,this.map._requestManager,(function(t,n){if(r._spriteRequest=null,t)r.fire(new e.ErrorEvent(t));else if(n)for(var i in n)r.imageManager.addImage(i,n[i]);r.imageManager.setLoaded(!0),r._availableImages=r.imageManager.listImages(),r.dispatcher.broadcast("setImages",r._availableImages),r.fire(new e.Event("data",{dataType:"style"}))}))},r.prototype._validateLayer=function(t){var r=this.sourceCaches[t.source];if(r){var n=t.sourceLayer;if(n){var i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new e.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+i.id+'" as specified by style layer "'+t.id+'"')))}}},r.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()},r.prototype._serializeLayers=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var i=n[r],a=this._layers[i];"custom"!==a.type&&t.push(a.serialize())}return t},r.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(var t in this._layers)if(this._layers[t].hasTransition())return!0;return!1},r.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},r.prototype.update=function(t){if(this._loaded){var r=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(var a in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){var o=this._updatedSources[a];"reload"===o?this._reloadSource(a):"clear"===o&&this._clearSource(a)}for(var s in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[s].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,p=this._order;h<p.length;h+=1){var d=p[h],f=this._layers[d];f.recalculate(t,this._availableImages),!f.isHidden(t.zoom)&&f.source&&(this.sourceCaches[f.source].used=!0)}for(var m in l){var g=this.sourceCaches[m];l[m]!==g.used&&g.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:m}))}this.light.recalculate(t),this.z=t.zoom,r&&this.fire(new e.Event("data",{dataType:"style"}))}},r.prototype._updateTilesForChangedImages=function(){var e=Object.keys(this._changedImages);if(e.length){for(var t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}},r.prototype._updateWorkerLayers=function(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})},r.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},r.prototype.setState=function(t){var r=this;if(this._checkLoaded(),qt(this,e.validateStyle(t)))return!1;(t=e.clone$1(t)).layers=Ve(t.layers);var n=Ke(this.serialize(),t).filter((function(e){return!(e.command in Gt)}));if(0===n.length)return!1;var i=n.filter((function(e){return!(e.command in Ht)}));if(i.length>0)throw new Error("Unimplemented: "+i.map((function(e){return e.command})).join(", ")+".");return n.forEach((function(e){"setTransition"!==e.command&&r[e.command].apply(r,e.args)})),this.stylesheet=t,!0},r.prototype.addImage=function(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(t,r),this._afterImageUpdated(t)},r.prototype.updateImage=function(e,t){this.imageManager.updateImage(e,t)},r.prototype.getImage=function(e){return this.imageManager.getImage(e)},r.prototype.removeImage=function(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(t),this._afterImageUpdated(t)},r.prototype._afterImageUpdated=function(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))},r.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},r.prototype.addSource=function(t,r,n){var i=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(r.type)>=0)||!this._validate(e.validateStyle.source,"sources."+t,r,null,n)){this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);var a=this.sourceCaches[t]=new Ie(t,r,this.dispatcher);a.style=this,a.setEventedParent(this,(function(){return{isSourceLoaded:i.loaded(),source:a.serialize(),sourceId:t}})),a.onAdd(this.map),this._changed=!0}},r.prototype.removeSource=function(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error('Source "'+t+'" cannot be removed while layer "'+r+'" is using it.')));var n=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],n.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},r.prototype.setGeoJSONSourceData=function(e,t){this._checkLoaded(),this.sourceCaches[e].getSource().setData(t),this._changed=!0},r.prototype.getSource=function(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()},r.prototype.addLayer=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=t.id;if(this.getLayer(i))this.fire(new e.ErrorEvent(new Error('Layer with id "'+i+'" already exists on this map')));else{var a;if("custom"===t.type){if(qt(this,e.validateCustomStyleLayer(t)))return;a=e.createStyleLayer(t)}else{if("object"===typeof t.source&&(this.addSource(i,t.source),t=e.clone$1(t),t=e.extend(t,{source:i})),this._validate(e.validateStyle.layer,"layers."+i,t,{arrayIndex:-1},n))return;a=e.createStyleLayer(t),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}}),this._serializedLayers[a.id]=a.serialize()}var o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.')));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){var s=this._removedLayers[i];delete this._removedLayers[i],s.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}},r.prototype.moveLayer=function(t,r){if(this._checkLoaded(),this._changed=!0,this._layers[t]){if(t!==r){var n=this._order.indexOf(t);this._order.splice(n,1);var i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new e.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,t),this._layerOrderChanged=!0)}}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be moved.")))},r.prototype.removeLayer=function(t){this._checkLoaded();var r=this._layers[t];if(r){r.setEventedParent(null);var n=this._order.indexOf(t);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be removed.")))},r.prototype.getLayer=function(e){return this._layers[e]},r.prototype.hasLayer=function(e){return e in this._layers},r.prototype.setLayerZoomRange=function(t,r,n){this._checkLoaded();var i=this.getLayer(t);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot have zoom extent.")))},r.prototype.setFilter=function(t,r,n){void 0===n&&(n={}),this._checkLoaded();var i=this.getLayer(t);if(i){if(!e.deepEqual(i.filter,r))return null===r||void 0===r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(e.validateStyle.filter,"layers."+i.id+".filter",r,null,n)||(i.filter=e.clone$1(r),this._updateLayer(i)))}else this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be filtered.")))},r.prototype.getFilter=function(t){return e.clone$1(this.getLayer(t).filter)},r.prototype.setLayoutProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getLayoutProperty=function(t,r){var n=this.getLayer(t);if(n)return n.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style.")))},r.prototype.setPaintProperty=function(t,r,n,i){void 0===i&&(i={}),this._checkLoaded();var a=this.getLayer(t);a?e.deepEqual(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error("The layer '"+t+"' does not exist in the map's style and cannot be styled.")))},r.prototype.getPaintProperty=function(e,t){return this.getLayer(e).getPaintProperty(t)},r.prototype.setFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=t.sourceLayer,a=this.sourceCaches[n];if(void 0!==a){var o=a.getSource().type;"geojson"===o&&i?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.removeFeatureState=function(t,r){this._checkLoaded();var n=t.source,i=this.sourceCaches[n];if(void 0!==i){var a=i.getSource().type,o="vector"===a?t.sourceLayer:void 0;"vector"!==a||o?r&&"string"!==typeof t.id&&"number"!==typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},r.prototype.getFeatureState=function(t){this._checkLoaded();var r=t.source,n=t.sourceLayer,i=this.sourceCaches[r];if(void 0!==i){if("vector"!==i.getSource().type||n)return void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,t.id);this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new e.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},r.prototype.getTransition=function(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},r.prototype.serialize=function(){return e.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:e.mapObject(this.sourceCaches,(function(e){return e.serialize()})),layers:this._serializeLayers(this._order)},(function(e){return void 0!==e}))},r.prototype._updateLayer=function(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0},r.prototype._flattenAndSortRenderedFeatures=function(e){for(var t=this,r=function(e){return"fill-extrusion"===t._layers[e].type},n={},i=[],a=this._order.length-1;a>=0;a--){var o=this._order[a];if(r(o)){n[o]=a;for(var s=0,l=e;s<l.length;s+=1){var c=l[s][o];if(c)for(var u=0,h=c;u<h.length;u+=1){var p=h[u];i.push(p)}}}}i.sort((function(e,t){return t.intersectionZ-e.intersectionZ}));for(var d=[],f=this._order.length-1;f>=0;f--){var m=this._order[f];if(r(m))for(var g=i.length-1;g>=0;g--){var y=i[g].feature;if(n[y.layer.id]<f)break;d.push(y),i.pop()}else for(var v=0,x=e;v<x.length;v+=1){var b=x[v][m];if(b)for(var _=0,w=b;_<w.length;_+=1){var k=w[_];d.push(k.feature)}}}return d},r.prototype.queryRenderedFeatures=function(t,r,n){r&&r.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var a=0,o=r.layers;a<o.length;a+=1){var s=o[a],l=this._layers[s];if(!l)return this.fire(new e.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];i[l.source]=!0}}var c=[];for(var u in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!i[u]||c.push(F(this.sourceCaches[u],this._layers,this._serializedLayers,t,r,n));return this.placement&&c.push(function(e,t,r,n,i,a,o){for(var s={},l=a.queryRenderedSymbols(n),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1){var p=h[u];c.push(o[p])}c.sort(B);for(var d=function(){var r=m[f],n=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(var a in n){var o=s[a]=s[a]||[],c=n[a];c.sort((function(e,t){var n=r.featureSortOrder;if(n){var i=n.indexOf(e.featureIndex);return n.indexOf(t.featureIndex)-i}return t.featureIndex-e.featureIndex}));for(var u=0,h=c;u<h.length;u+=1){var p=h[u];o.push(p)}}},f=0,m=c;f<m.length;f+=1)d();var g=function(t){s[t].forEach((function(n){var i=n.feature,a=e[t],o=r[a.source].getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=o}))};for(var y in s)g(y);return s}(this._layers,this._serializedLayers,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},r.prototype.querySourceFeatures=function(t,r){r&&r.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);var n=this.sourceCaches[t];return n?function(e,t){for(var r=e.getRenderableIds().map((function(t){return e.getTileByID(t)})),n=[],i={},a=0;a<r.length;a++){var o=r[a],s=o.tileID.canonical.key;i[s]||(i[s]=!0,o.querySourceFeatures(n,t))}return n}(n,r):[]},r.prototype.addSourceType=function(e,t,n){return r.getSourceType(e)?n(new Error('A source type called "'+e+'" already exists.')):(r.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},n):n(null,null))},r.prototype.getLight=function(){return this.light.getLight()},r.prototype.setLight=function(t,r){void 0===r&&(r={}),this._checkLoaded();var n=this.light.getLight(),i=!1;for(var a in t)if(!e.deepEqual(t[a],n[a])){i=!0;break}if(i){var o={now:e.browser.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(o)}},r.prototype._validate=function(t,r,n,i,a){return void 0===a&&(a={}),(!a||!1!==a.validate)&&qt(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:n,styleSpec:e.styleSpec},i)))},r.prototype._remove=function(){for(var t in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[t].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},r.prototype._clearSource=function(e){this.sourceCaches[e].clearTiles()},r.prototype._reloadSource=function(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()},r.prototype._updateSources=function(e){for(var t in this.sourceCaches)this.sourceCaches[t].update(e)},r.prototype._generateCollisionBoxes=function(){for(var e in this.sourceCaches)this._reloadSource(e)},r.prototype._updatePlacement=function(t,r,n,i,a){void 0===a&&(a=!1);for(var o=!1,s=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=u[c],p=this._layers[h];if("symbol"===p.type){if(!l[p.source]){var d=this.sourceCaches[p.source];l[p.source]=d.getRenderableIds(!0).map((function(e){return d.getTileByID(e)})).sort((function(e,t){return t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)}))}var f=this.crossTileSymbolIndex.addLayer(p,l[p.source],t.center.lng);o=o||f}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((a=a||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.browser.now(),t.zoom))&&(this.pauseablePlacement=new jt(t,this._order,a,r,n,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.browser.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(var m=0,g=this._order;m<g.length;m+=1){var y=g[m],v=this._layers[y];"symbol"===v.type&&this.placement.updateLayerOpacities(v,l[v.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.browser.now())},r.prototype._releaseSymbolFadeTiles=function(){for(var e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()},r.prototype.getImages=function(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();var n=this.sourceCaches[t.source];n&&n.setDependencies(t.tileID.key,t.type,t.icons)},r.prototype.getGlyphs=function(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)},r.prototype.getResource=function(t,r,n){return e.makeRequest(r,n)},r}(e.Evented);$t.getSourceType=function(e){return D[e]},$t.setSourceType=function(e,t){D[e]=t},$t.registerForPluginStateChange=e.registerForPluginStateChange;var Zt=e.createLayout([{name:"a_pos",type:"Int16",components:2}]),Xt=_r("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"),Yt=_r("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Kt=_r("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Jt=_r("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),Qt=_r("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),er=_r("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"),tr=_r("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),rr=_r("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),nr=_r("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),ir=_r("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),ar=_r("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),or=_r("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),sr=_r("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),lr=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),cr=_r("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),ur=_r("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hr=_r("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),pr=_r("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),dr=_r("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),fr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"),mr=_r("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),gr=_r("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),yr=_r("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),vr=_r("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),xr=_r("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),br=_r("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");function _r(e,t){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,(function(e,t,r,n,i){return s[i]=!0,"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),vertexSource:t=t.replace(r,(function(e,t,r,n,i){var a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\nvarying "+r+" "+n+" "+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"define"===t?"\n#ifndef HAS_UNIFORM_u_"+i+"\nuniform lowp float u_"+i+"_t;\nattribute "+r+" "+a+" a_"+i+";\n#else\nuniform "+r+" "+n+" u_"+i+";\n#endif\n":"vec4"===o?"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = a_"+i+";\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+i+"\n "+r+" "+n+" "+i+" = unpack_mix_"+o+"(a_"+i+", u_"+i+"_t);\n#else\n "+r+" "+n+" "+i+" = u_"+i+";\n#endif\n"})),staticAttributes:n,staticUniforms:o}}var wr=Object.freeze({__proto__:null,prelude:Xt,background:Yt,backgroundPattern:Kt,circle:Jt,clippingMask:Qt,heatmap:er,heatmapTexture:tr,collisionBox:rr,collisionCircle:nr,debug:ir,fill:ar,fillOutline:or,fillOutlinePattern:sr,fillPattern:lr,fillExtrusion:cr,fillExtrusionPattern:ur,hillshadePrepare:hr,hillshade:pr,line:dr,lineGradient:fr,linePattern:mr,lineSDF:gr,raster:yr,symbolIcon:vr,symbolSDF:xr,symbolTextAndIcon:br}),kr=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function Tr(e){for(var t=[],r=0;r<e.length;r++)if(null!==e[r]){var n=e[r].split(" ");t.push(n.pop())}return t}kr.prototype.bind=function(e,t,r,n,i,a,o,s){this.context=e;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);var u=!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||l||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s;!e.extVertexArrayObject||u?this.freshBind(t,r,n,i,a,o,s):(e.bindVertexArrayOES.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind())},kr.prototype.freshBind=function(e,t,r,n,i,a,o){var s,l=e.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o;else{s=c.currentNumAttributes||0;for(var h=l;h<s;h++)u.disableVertexAttribArray(h)}t.enableAttributes(u,e);for(var p=0,d=r;p<d.length;p+=1)d[p].enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(var f=0,m=r;f<m.length;f+=1){var g=m[f];g.bind(),g.setVertexAttribPointers(u,e,i)}a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),c.currentNumAttributes=l},kr.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var Sr=function(e,t,r,n,i,a){var o=e.gl;this.program=o.createProgram();for(var s=Tr(r.staticAttributes),l=n?n.getBinderAttributes():[],c=s.concat(l),u=r.staticUniforms?Tr(r.staticUniforms):[],h=n?n.getBinderUniforms():[],p=[],d=0,f=u.concat(h);d<f.length;d+=1){var m=f[d];p.indexOf(m)<0&&p.push(m)}var g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;");var y=g.concat(Xt.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(Xt.vertexSource,r.vertexSource).join("\n"),x=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(x,y),o.compileShader(x),o.attachShader(this.program,x);var b=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())this.failedToCreate=!0;else{o.shaderSource(b,v),o.compileShader(b),o.attachShader(this.program,b),this.attributes={};var _={};this.numAttributes=c.length;for(var w=0;w<this.numAttributes;w++)c[w]&&(o.bindAttribLocation(this.program,w,c[w]),this.attributes[c[w]]=w);o.linkProgram(this.program),o.deleteShader(b),o.deleteShader(x);for(var k=0;k<p.length;k++){var T=p[k];if(T&&!_[T]){var S=o.getUniformLocation(this.program,T);S&&(_[T]=S)}}this.fixedUniforms=i(e,_),this.binderUniforms=n?n.getUniforms(e,_):[]}}};function Ar(e,t,r){var n=1/gt(r,1,t.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}Sr.prototype.draw=function(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){var g,y=e.gl;if(!this.failedToCreate){for(var v in e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),this.fixedUniforms)this.fixedUniforms[v].set(o[v]);d&&d.setUniforms(e,this.binderUniforms,h,{zoom:p});for(var x=(g={},g[y.LINES]=2,g[y.TRIANGLES]=3,g[y.LINE_STRIP]=1,g)[t],b=0,_=u.get();b<_.length;b+=1){var w=_[b],k=w.vaos||(w.vaos={});(k[s]||(k[s]=new kr)).bind(e,this,l,d?d.getPaintVertexBuffers():[],c,w.vertexOffset,f,m),y.drawElements(t,w.primitiveLength*x,y.UNSIGNED_SHORT,w.primitiveOffset*x*2)}}};var Mr=function(t,r,n,i){var a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=e.create$1();"viewport"===a.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);var c=a.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},Er=function(t,r,n,i,a,o,s){return e.extend(Mr(t,r,n,i),Ar(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8})},Cr=function(e){return{u_matrix:e}},Pr=function(t,r,n,i){return e.extend(Cr(t),Ar(n,r,i))},Lr=function(e,t){return{u_matrix:e,u_world:t}},Ir=function(t,r,n,i,a){return e.extend(Pr(t,r,n,i),{u_world:a})},zr=function(t,r,n,i){var a,o,s=t.transform;if("map"===i.paint.get("circle-pitch-alignment")){var l=gt(n,1,s.zoom);a=!0,o=[l,l]}else a=!1,o=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(r.posMatrix,n,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.browser.devicePixelRatio,u_extrude_scale:o}},Or=function(e,t,r){var n=gt(r,1,t.zoom),i=Math.pow(2,t.zoom-r.tileID.overscaledZ),a=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[t.pixelsToGLUnits[0]/(n*i),t.pixelsToGLUnits[1]/(n*i)],u_overscale_factor:a}},Rr=function(e,t,r){return{u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}},Dr=function(e,t,r){return void 0===r&&(r=1),{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}},jr=function(e){return{u_matrix:e}},Fr=function(e,t,r,n){return{u_matrix:e,u_extrude_scale:gt(t,1,r),u_intensity:n}};function Br(t,r){var n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new e.MercatorCoordinate(0,i/n).toLngLat().lat,new e.MercatorCoordinate(0,(i+1)/n).toLngLat().lat]}var Nr=function(t,r,n){var i=t.transform;return{u_matrix:Gr(t,r,n),u_ratio:1/gt(r,1,i.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Ur=function(t,r,n,i){return e.extend(Nr(t,r,n),{u_image:0,u_image_height:i})},Vr=function(t,r,n,i){var a=t.transform,o=Hr(r,a);return{u_matrix:Gr(t,r,n),u_texsize:r.imageAtlasTexture.size,u_ratio:1/gt(r,1,a.zoom),u_device_pixel_ratio:e.browser.devicePixelRatio,u_image:0,u_scale:[o,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},qr=function(t,r,n,i,a){var o=t.transform,s=t.lineAtlas,l=Hr(r,o),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),p=u.width*a.fromScale,d=h.width*a.toScale;return e.extend(Nr(t,r,n),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/d,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*e.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Hr(e,t){return 1/gt(e,1,t.tileZoom)}function Gr(e,t,r){return e.translatePosMatrix(t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var Wr=function(e,t,r,n,i){return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:$r(i.paint.get("raster-hue-rotate"))};var a,o};function $r(e){e*=Math.PI/180;var t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}var Zr,Xr=function(e,t,r,n,i,a,o,s,l,c){var u=i.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.height,u_fade_change:i.options.fadeDuration?i.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Yr=function(t,r,n,i,a,o,s,l,c,u,h){var p=a.transform;return e.extend(Xr(t,r,n,i,a,o,s,l,c,u),{u_gamma_scale:i?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:e.browser.devicePixelRatio,u_is_halo:+h})},Kr=function(t,r,n,i,a,o,s,l,c,u){return e.extend(Yr(t,r,n,i,a,o,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Jr=function(e,t,r){return{u_matrix:e,u_opacity:t,u_color:r}},Qr=function(t,r,n,i,a,o){return e.extend(function(e,t,r,n){var i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),o=r.imageManager.getPixelSize(),s=o.width,l=o.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,r.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),p=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/gt(n,1,r.transform.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[65535&h,65535&p]}}(i,o,n,a),{u_matrix:t,u_opacity:r})},en={fillExtrusion:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fillExtrusionPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}},fill:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},fillPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},fillOutline:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}},fillOutlinePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},circle:function(t,r){return{u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},collisionBox:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}},collisionCircle:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}},debug:function(t,r){return{u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}},clippingMask:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmap:function(t,r){return{u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}},heatmapTexture:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}},hillshade:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}},hillshadePrepare:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}},line:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}},lineGradient:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}},linePattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}},lineSDF:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}},raster:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}},symbolIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}},symbolSDF:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},symbolTextAndIcon:function(t,r){return{u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}},background:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}},backgroundPattern:function(t,r){return{u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}}};function tn(t,r,n,i,a,o,s){for(var l=t.context,c=l.gl,u=t.useProgram("collisionBox"),h=[],p=0,d=0,f=0;f<i.length;f++){var m=i[f],g=r.getTile(m),y=g.getBucket(n);if(y){var v=m.posMatrix;0===a[0]&&0===a[1]||(v=t.translatePosMatrix(m.posMatrix,g,a,o));var x=s?y.textCollisionBox:y.iconCollisionBox,b=y.collisionCircleArray;if(b.length>0){var _=e.create(),w=v;e.mul(_,y.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(_,_,y.placementViewportMatrix),h.push({circleArray:b,circleOffset:d,transform:w,invTransform:_}),d=p+=b.length/4}x&&u.draw(l,c.LINES,Ae.disabled,Ee.disabled,t.colorModeForRenderPass(),Pe.disabled,Or(v,t.transform,g),n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,null,t.transform.zoom,null,null,x.collisionVertexBuffer)}}if(s&&h.length){var k=t.useProgram("collisionCircle"),T=new e.StructArrayLayout2f1f2i16;T.resize(4*p),T._trim();for(var S=0,A=0,M=h;A<M.length;A+=1)for(var E=M[A],C=0;C<E.circleArray.length/4;C++){var P=4*C,L=E.circleArray[P+0],I=E.circleArray[P+1],z=E.circleArray[P+2],O=E.circleArray[P+3];T.emplace(S++,L,I,z,O,0),T.emplace(S++,L,I,z,O,1),T.emplace(S++,L,I,z,O,2),T.emplace(S++,L,I,z,O,3)}(!Zr||Zr.length<2*p)&&(Zr=function(t){var r=2*t,n=new e.StructArrayLayout3ui6;n.resize(r),n._trim();for(var i=0;i<r;i++){var a=6*i;n.uint16[a+0]=4*i+0,n.uint16[a+1]=4*i+1,n.uint16[a+2]=4*i+2,n.uint16[a+3]=4*i+2,n.uint16[a+4]=4*i+3,n.uint16[a+5]=4*i+0}return n}(p));for(var R=l.createIndexBuffer(Zr,!0),D=l.createVertexBuffer(T,e.collisionCircleLayout.members,!0),j=0,F=h;j<F.length;j+=1){var B=F[j],N=Rr(B.transform,B.invTransform,t.transform);k.draw(l,c.TRIANGLES,Ae.disabled,Ee.disabled,t.colorModeForRenderPass(),Pe.disabled,N,n.id,D,R,e.SegmentVector.simpleSegment(0,2*B.circleOffset,B.circleArray.length,B.circleArray.length/2),null,t.transform.zoom,null,null,null)}D.destroy(),R.destroy()}}var rn=e.identity(new Float32Array(16));function nn(t,r,n,i,a,o){var s=e.getAnchorAlignment(t),l=-(s.horizontalAlign-.5)*r,c=-(s.verticalAlign-.5)*n,u=e.evaluateVariableOffset(t,i);return new e.Point((l/a+u[0])*o,(c/a+u[1])*o)}function an(t,r,n,i,a,o,s,l,c,u,h){var p=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,m={};d.clear();for(var g=0;g<p.length;g++){var y=p.get(g),v=t.allowVerticalPlacement&&!y.placedOrientation,x=y.hidden||!y.crossTileID||v?null:i[y.crossTileID];if(x){var b=new e.Point(y.anchorX,y.anchorY),_=rt(b,n?l:s),w=nt(o.cameraToCenterDistance,_.signedDistanceFromCamera),k=a.evaluateSizeForFeature(t.textSizeData,u,y)*w/e.ONE_EM;n&&(k*=t.tilePixelRatio/c);for(var T=x.width,S=x.height,A=nn(x.anchor,T,S,x.textOffset,x.textBoxScale,k),M=n?rt(b.add(A),s).point:_.point.add(r?A.rotate(-o.angle):A),E=t.allowVerticalPlacement&&y.placedOrientation===e.WritingMode.vertical?Math.PI/2:0,C=0;C<y.numGlyphs;C++)e.addDynamicAttributes(d,M,E);h&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:M,angle:E})}else pt(y.numGlyphs,d)}if(h){f.clear();for(var P=t.icon.placedSymbolArray,L=0;L<P.length;L++){var I=P.get(L);if(I.hidden)pt(I.numGlyphs,f);else{var z=m[L];if(z)for(var O=0;O<I.numGlyphs;O++)e.addDynamicAttributes(f,z.shiftedAnchor,z.angle);else pt(I.numGlyphs,f)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function on(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function sn(t,r,n,i,a,o,s,l,c,u,h,p){for(var d=t.context,f=d.gl,m=t.transform,g="map"===l,y="map"===c,v=g&&"point"!==n.layout.get("symbol-placement"),x=g&&!y&&!v,b=void 0!==n.layout.get("symbol-sort-key").constantOr(1),_=!1,w=t.depthModeForSublayer(0,Ae.ReadOnly),k=n.layout.get("text-variable-anchor"),T=[],S=0,A=i;S<A.length;S+=1){var M=A[S],E=r.getTile(M),C=E.getBucket(n);if(C){var P=a?C.text:C.icon;if(P&&P.segments.get().length){var L=P.programConfigurations.get(n.id),I=a||C.sdfIcons,z=a?C.textSizeData:C.iconSizeData,O=y||0!==m.pitch,R=t.useProgram(on(I,a,C),L),D=e.evaluateSizeForZoom(z,m.zoom),j=void 0,F=[0,0],B=void 0,N=void 0,U=null,V=void 0;if(a){if(B=E.glyphAtlasTexture,N=f.LINEAR,j=E.glyphAtlasTexture.size,C.iconsInText){F=E.imageAtlasTexture.size,U=E.imageAtlasTexture;var q="composite"===z.kind||"camera"===z.kind;V=O||t.options.rotating||t.options.zooming||q?f.LINEAR:f.NEAREST}}else{var H=1!==n.layout.get("icon-size").constantOr(0)||C.iconsNeedLinear;B=E.imageAtlasTexture,N=I||t.options.rotating||t.options.zooming||H||O?f.LINEAR:f.NEAREST,j=E.imageAtlasTexture.size}var G=gt(E,1,t.transform.zoom),W=et(M.posMatrix,y,g,t.transform,G),$=tt(M.posMatrix,y,g,t.transform,G),Z=k&&C.hasTextData(),X="none"!==n.layout.get("icon-text-fit")&&Z&&C.hasIconData();v&&at(C,M.posMatrix,t,a,W,$,y,u);var Y=t.translatePosMatrix(M.posMatrix,E,o,s),K=v||a&&k||X?rn:W,J=t.translatePosMatrix($,E,o,s,!0),Q=I&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),ee={program:R,buffers:P,uniformValues:I?C.iconsInText?Kr(z.kind,D,x,y,t,Y,K,J,j,F):Yr(z.kind,D,x,y,t,Y,K,J,a,j,!0):Xr(z.kind,D,x,y,t,Y,K,J,a,j),atlasTexture:B,atlasTextureIcon:U,atlasInterpolation:N,atlasInterpolationIcon:V,isSDF:I,hasHalo:Q};if(b&&C.canOverlap){_=!0;for(var te=0,re=P.segments.get();te<re.length;te+=1){var ne=re[te];T.push({segments:new e.SegmentVector([ne]),sortKey:ne.sortKey,state:ee})}}else T.push({segments:P.segments,sortKey:0,state:ee})}}}_&&T.sort((function(e,t){return e.sortKey-t.sortKey}));for(var ie=0,ae=T;ie<ae.length;ie+=1){var oe=ae[ie],se=oe.state;if(d.activeTexture.set(f.TEXTURE0),se.atlasTexture.bind(se.atlasInterpolation,f.CLAMP_TO_EDGE),se.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),se.atlasTextureIcon&&se.atlasTextureIcon.bind(se.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),se.isSDF){var le=se.uniformValues;se.hasHalo&&(le.u_is_halo=1,ln(se.buffers,oe.segments,n,t,se.program,w,h,p,le)),le.u_is_halo=0}ln(se.buffers,oe.segments,n,t,se.program,w,h,p,se.uniformValues)}}function ln(e,t,r,n,i,a,o,s,l){var c=n.context,u=c.gl;i.draw(c,u.TRIANGLES,a,o,s,Pe.disabled,l,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function cn(e,t,r,n,i,a,o){var s,l,c,u,h,p=e.context.gl,d=r.paint.get("fill-pattern"),f=d&&d.constantOr(1),m=r.getCrossfadeParameters();o?(l=f&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=p.LINES):(l=f?"fillPattern":"fill",s=p.TRIANGLES);for(var g=0,y=n;g<y.length;g+=1){var v=y[g],x=t.getTile(v);if(!f||x.patternsLoaded()){var b=x.getBucket(r);if(b){var _=b.programConfigurations.get(r.id),w=e.useProgram(l,_);f&&(e.context.activeTexture.set(p.TEXTURE0),x.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),_.updatePaintBuffers(m));var k=d.constantOr(null);if(k&&x.imageAtlas){var T=x.imageAtlas,S=T.patternPositions[k.to.toString()],A=T.patternPositions[k.from.toString()];S&&A&&_.setConstantPatternPositions(S,A)}var M=e.translatePosMatrix(v.posMatrix,x,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){u=b.indexBuffer2,h=b.segments2;var E=[p.drawingBufferWidth,p.drawingBufferHeight];c="fillOutlinePattern"===l&&f?Ir(M,e,m,x,E):Lr(M,E)}else u=b.indexBuffer,h=b.segments,c=f?Pr(M,e,m,x):Cr(M);w.draw(e.context,s,i,e.stencilModeForClipping(v),a,Pe.disabled,c,r.id,b.layoutVertexBuffer,u,h,r.paint,e.transform.zoom,_)}}}}function un(e,t,r,n,i,a,o){for(var s=e.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity"),d=0,f=n;d<f.length;d+=1){var m=f[d],g=t.getTile(m),y=g.getBucket(r);if(y){var v=y.programConfigurations.get(r.id),x=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",v);u&&(e.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),v.updatePaintBuffers(h));var b=c.constantOr(null);if(b&&g.imageAtlas){var _=g.imageAtlas,w=_.patternPositions[b.to.toString()],k=_.patternPositions[b.from.toString()];w&&k&&v.setConstantPatternPositions(w,k)}var T=e.translatePosMatrix(m.posMatrix,g,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),S=r.paint.get("fill-extrusion-vertical-gradient"),A=u?Er(T,e,S,p,m,h,g):Mr(T,e,S,p);x.draw(s,s.gl.TRIANGLES,i,a,o,Pe.backCCW,A,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,e.transform.zoom,v)}}}function hn(e,t,r,n,i,a){var o=e.context,s=o.gl,l=t.fbo;if(l){var c=e.useProgram("hillshade");o.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get());var u=function(e,t,r){var n=r.paint.get("hillshade-shadow-color"),i=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),o=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(o-=e.transform.angle);var s=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),s),u_image:0,u_latrange:Br(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:i,u_accent:a}}(e,t,r);c.draw(o,s.TRIANGLES,n,i,a,Pe.disabled,u,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function pn(t,r,n,i,a,o){var s=t.context,l=s.gl,c=r.dem;if(c&&c.data){var u=c.dim,h=c.stride,p=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(h),r.demTexture){var d=r.demTexture;d.update(p,{premultiply:!1}),d.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new e.Texture(s,p,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);var f=r.fbo;if(!f){var m=new e.Texture(s,{width:u,height:u,data:null},l.RGBA);m.bind(l.LINEAR,l.CLAMP_TO_EDGE),(f=r.fbo=s.createFramebuffer(u,u,!0)).colorAttachment.set(m.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,u,u]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Pe.disabled,function(t,r){var n=r.stride,i=e.create();return e.ortho(i,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(i,i,[0,-e.EXTENT,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}}(r.tileID,c),n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function dn(t,r,n,i,a){var o=i.paint.get("raster-fade-duration");if(o>0){var s=e.browser.now(),l=(s-t.timeAdded)/o,c=r?(s-r.timeAdded)/o:-1,u=n.getSource(),h=a.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),d=p&&t.refreshedUponExpiration?1:e.clamp(p?l:1-c,0,1);return t.refreshedUponExpiration&&l>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}var fn=new e.Color(1,0,0,1),mn=new e.Color(0,1,0,1),gn=new e.Color(0,0,1,1),yn=new e.Color(1,0,1,1),vn=new e.Color(0,1,1,1);function xn(e){var t=e.transform.padding;bn(e,e.transform.height-(t.top||0),3,fn),bn(e,t.bottom||0,3,mn),_n(e,t.left||0,3,gn),_n(e,e.transform.width-(t.right||0),3,yn);var r=e.transform.centerPoint;!function(e,t,r,n){var i=20,a=2;wn(e,t-a/2,r-i/2,a,i,n),wn(e,t-i/2,r-a/2,i,a,n)}(e,r.x,e.transform.height-r.y,vn)}function bn(e,t,r,n){wn(e,0,t+r/2,e.transform.width,r,n)}function _n(e,t,r,n){wn(e,t-r/2,0,r,e.transform.height,n)}function wn(t,r,n,i,a,o){var s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(r*e.browser.devicePixelRatio,n*e.browser.devicePixelRatio,i*e.browser.devicePixelRatio,a*e.browser.devicePixelRatio),s.clear({color:o}),l.disable(l.SCISSOR_TEST)}function kn(t,r,n){var i=t.context,a=i.gl,o=n.posMatrix,s=t.useProgram("debug"),l=Ae.disabled,c=Ee.disabled,u=t.colorModeForRenderPass(),h="$debug";i.activeTexture.set(a.TEXTURE0),t.emptyTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE),s.draw(i,a.LINE_STRIP,l,c,u,Pe.disabled,Dr(o,e.Color.red),h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments);var p=r.getTileByID(n.key).latestRawTileData,d=p&&p.byteLength||0,f=Math.floor(d/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/t.transform.zoom)*.5,y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=" => "+n.overscaledZ),function(e,t){e.initDebugOverlayCanvas();var r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,y+" "+f+"kb"),s.draw(i,a.TRIANGLES,l,c,Ce.alphaBlended,Pe.disabled,Dr(o,e.Color.transparent,g),h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments)}var Tn={symbol:function(t,r,n,i,a){if("translucent"===t.renderPass){var o=Ee.disabled,s=t.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(t,r,n,i,a,o,s){for(var l=r.transform,c="map"===a,u="map"===o,h=0,p=t;h<p.length;h+=1){var d=p[h],f=i.getTile(d),m=f.getBucket(n);if(m&&m.text&&m.text.segments.get().length){var g=m.textSizeData,y=e.evaluateSizeForZoom(g,l.zoom),v=gt(f,1,r.transform.zoom),x=et(d.posMatrix,u,c,r.transform,v),b="none"!==n.layout.get("icon-text-fit")&&m.hasIconData();if(y){var _=Math.pow(2,l.zoom-f.tileID.overscaledZ);an(m,c,u,s,e.symbolSize,l,x,d.posMatrix,_,y,b)}}}}(i,t,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&sn(t,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&sn(t,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(tn(t,r,n,i,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),tn(t,r,n,i,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(t,r,n,i){if("translucent"===t.renderPass){var a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==a.constantOr(1)||0!==o.constantOr(1)&&0!==s.constantOr(1)){for(var c=t.context,u=c.gl,h=t.depthModeForSublayer(0,Ae.ReadOnly),p=Ee.disabled,d=t.colorModeForRenderPass(),f=[],m=0;m<i.length;m++){var g=i[m],y=r.getTile(g),v=y.getBucket(n);if(v){var x=v.programConfigurations.get(n.id),b={programConfiguration:x,program:t.useProgram("circle",x),layoutVertexBuffer:v.layoutVertexBuffer,indexBuffer:v.indexBuffer,uniformValues:zr(t,g,y,n)};if(l)for(var _=0,w=v.segments.get();_<w.length;_+=1){var k=w[_];f.push({segments:new e.SegmentVector([k]),sortKey:k.sortKey,state:b})}else f.push({segments:v.segments,sortKey:0,state:b})}}l&&f.sort((function(e,t){return e.sortKey-t.sortKey}));for(var T=0,S=f;T<S.length;T+=1){var A=S[T],M=A.state,E=M.programConfiguration,C=M.program,P=M.layoutVertexBuffer,L=M.indexBuffer,I=M.uniformValues,z=A.segments;C.draw(c,u.TRIANGLES,h,p,d,Pe.disabled,I,n.id,P,L,z,n.paint,t.transform.zoom,E)}}}},heatmap:function(t,r,n,i){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){var a=t.context,o=a.gl,s=Ee.disabled,l=new Ce([o.ONE,o.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,r){var n=e.gl;e.activeTexture.set(n.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);var i=r.heatmapFbo;if(i)n.bindTexture(n.TEXTURE_2D,i.colorAttachment.get()),e.bindFramebuffer.set(i.framebuffer);else{var a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),i=r.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),function(e,t,r,n){var i=e.gl,a=e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:i.UNSIGNED_BYTE;i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t.width/4,t.height/4,0,i.RGBA,a,null),n.colorAttachment.set(r)}(e,t,a,i)}}(a,t,n),a.clear({color:e.Color.transparent});for(var c=0;c<i.length;c++){var u=i[c];if(!r.hasRenderableParent(u)){var h=r.getTile(u),p=h.getBucket(n);if(p){var d=p.programConfigurations.get(n.id),f=t.useProgram("heatmap",d),m=t.transform.zoom;f.draw(a,o.TRIANGLES,Ae.disabled,s,l,Pe.disabled,Fr(u.posMatrix,h,m,n.paint.get("heatmap-intensity")),n.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,n.paint,t.transform.zoom,d)}}}a.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){var n=t.context,i=n.gl,a=r.heatmapFbo;if(a){n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1);var o=r.colorRampTexture;o||(o=r.colorRampTexture=new e.Texture(n,r.colorRamp,i.RGBA)),o.bind(i.LINEAR,i.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Ae.disabled,Ee.disabled,t.colorModeForRenderPass(),Pe.disabled,function(t,r,n,i){var a=e.create();e.ortho(a,0,t.width,t.height,0,0,1);var o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}}(t,r,0,1),r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}}(t,n))},line:function(t,r,n,i){if("translucent"===t.renderPass){var a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0!==a.constantOr(1)&&0!==o.constantOr(1))for(var s=t.depthModeForSublayer(0,Ae.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),p=n.paint.get("line-gradient"),d=n.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":p?"lineGradient":"line",m=t.context,g=m.gl,y=!0,v=0,x=i;v<x.length;v+=1){var b=x[v],_=r.getTile(b);if(!h||_.patternsLoaded()){var w=_.getBucket(n);if(w){var k=w.programConfigurations.get(n.id),T=t.context.program.get(),S=t.useProgram(f,k),A=y||S.program!==T,M=u.constantOr(null);if(M&&_.imageAtlas){var E=_.imageAtlas,C=E.patternPositions[M.to.toString()],P=E.patternPositions[M.from.toString()];C&&P&&k.setConstantPatternPositions(C,P)}var L=h?Vr(t,_,n,d):c?qr(t,_,n,c,d):p?Ur(t,_,n,w.lineClipsArray.length):Nr(t,_,n);if(h)m.activeTexture.set(g.TEXTURE0),_.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),k.updatePaintBuffers(d);else if(c&&(A||t.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(m);else if(p){var I=w.gradients[n.id],z=I.texture;if(n.gradientVersion!==I.version){var O=256;if(n.stepInterpolant){var R=r.getSource().maxzoom,D=b.canonical.z===R?Math.ceil(1<<t.transform.maxZoom-b.canonical.z):1,j=w.maxLineLength/e.EXTENT*1024*D;O=e.clamp(e.nextPowerOfTwo(j),256,m.maxTextureSize)}I.gradient=e.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:I.gradient||void 0,clips:w.lineClipsArray}),I.texture?I.texture.update(I.gradient):I.texture=new e.Texture(m,I.gradient,g.RGBA),I.version=n.gradientVersion,z=I.texture}m.activeTexture.set(g.TEXTURE0),z.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}S.draw(m,g.TRIANGLES,s,t.stencilModeForClipping(b),l,Pe.disabled,L,n.id,w.layoutVertexBuffer,w.indexBuffer,w.segments,n.paint,t.transform.zoom,k,w.layoutVertexBuffer2),y=!1}}}}},fill:function(t,r,n,i){var a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0!==o.constantOr(1)){var s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.Color.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){var u=t.depthModeForSublayer(1,"opaque"===t.renderPass?Ae.ReadWrite:Ae.ReadOnly);cn(t,r,n,i,u,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){var h=t.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Ae.ReadOnly);cn(t,r,n,i,h,s,!0)}}},"fill-extrusion":function(e,t,r,n){var i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===e.renderPass){var a=new Ae(e.context.gl.LEQUAL,Ae.ReadWrite,e.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))un(e,t,r,n,a,Ee.disabled,Ce.disabled),un(e,t,r,n,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{var o=e.colorModeForRenderPass();un(e,t,r,n,a,Ee.disabled,o)}}},hillshade:function(e,t,r,n){if("offscreen"===e.renderPass||"translucent"===e.renderPass){for(var i=e.context,a=e.depthModeForSublayer(0,Ae.ReadOnly),o=e.colorModeForRenderPass(),s="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n],l=s[0],c=0,u=s[1];c<u.length;c+=1){var h=u[c],p=t.getTile(h);p.needsHillshadePrepare&&"offscreen"===e.renderPass?pn(e,p,r,a,Ee.disabled,o):"translucent"===e.renderPass&&hn(e,p,r,a,l[h.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])}},raster:function(e,t,r,n){if("translucent"===e.renderPass&&0!==r.paint.get("raster-opacity")&&n.length)for(var i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),c=o instanceof z?[{},n]:e.stencilConfigForOverlap(n),u=c[0],h=c[1],p=h[h.length-1].overscaledZ,d=!e.options.moving,f=0,m=h;f<m.length;f+=1){var g=m[f],y=e.depthModeForSublayer(g.overscaledZ-p,1===r.paint.get("raster-opacity")?Ae.ReadWrite:Ae.ReadOnly,a.LESS),v=t.getTile(g),x=e.transform.calculatePosMatrix(g.toUnwrapped(),d);v.registerFadeDuration(r.paint.get("raster-fade-duration"));var b=t.findLoadedParent(g,0),_=dn(v,b,t,r,e.transform),w=void 0,k=void 0,T="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),v.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),b?(b.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),w=Math.pow(2,b.tileID.overscaledZ-v.tileID.overscaledZ),k=[v.tileID.canonical.x*w%1,v.tileID.canonical.y*w%1]):v.texture.bind(T,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST);var S=Wr(x,k||[0,0],w||1,_,r);o instanceof z?s.draw(i,a.TRIANGLES,y,Ee.disabled,l,Pe.disabled,S,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,y,u[g.overscaledZ],l,Pe.disabled,S,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,t,r){var n=r.paint.get("background-color"),i=r.paint.get("background-opacity");if(0!==i){var a=e.context,o=a.gl,s=e.transform,l=s.tileSize,c=r.paint.get("background-pattern");if(!e.isPatternMissing(c)){var u=!c&&1===n.a&&1===i&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===u){var h=Ee.disabled,p=e.depthModeForSublayer(0,"opaque"===u?Ae.ReadWrite:Ae.ReadOnly),d=e.colorModeForRenderPass(),f=e.useProgram(c?"backgroundPattern":"background"),m=s.coveringTiles({tileSize:l});c&&(a.activeTexture.set(o.TEXTURE0),e.imageManager.bind(e.context));for(var g=r.getCrossfadeParameters(),y=0,v=m;y<v.length;y+=1){var x=v[y],b=e.transform.calculatePosMatrix(x.toUnwrapped()),_=c?Qr(b,i,e,c,{tileID:x,tileSize:l},g):Jr(b,i,n);f.draw(a,o.TRIANGLES,p,h,d,Pe.disabled,_,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}},debug:function(e,t,r){for(var n=0;n<r.length;n++)kn(e,t,r[n])},custom:function(e,t,r){var n=e.context,i=r.implementation;if("offscreen"===e.renderPass){var a=i.prerender;a&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),a.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Ee.disabled);var o="3d"===i.renderingMode?new Ae(e.context.gl.LEQUAL,Ae.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Ae.ReadOnly);n.setDepthMode(o),i.render(n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}},Sn=function(e,t){this.context=new Le(e),this.transform=t,this._tileTextures={},this.setup(),this.numSublayers=Ie.maxUnderzooming+Ie.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Vt,this.gpuTimers={}};Sn.prototype.resize=function(t,r){if(this.width=t*e.browser.devicePixelRatio,this.height=r*e.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,i=this.style._order;n<i.length;n+=1){var a=i[n];this.style._layers[a].resize()}},Sn.prototype.setup=function(){var t=this.context,r=new e.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(r,Zt.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);var n=new e.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(e.EXTENT,0),n.emplaceBack(0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(n,Zt.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);var i=new e.StructArrayLayout4i8;i.emplaceBack(0,0,0,0),i.emplaceBack(e.EXTENT,0,e.EXTENT,0),i.emplaceBack(0,e.EXTENT,0,e.EXTENT),i.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(i,I.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);var a=new e.StructArrayLayout2i4;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,Zt.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);var o=new e.StructArrayLayout1ui2;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);var s=new e.StructArrayLayout3ui6;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new e.Texture(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Ee({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},Sn.prototype.clearStencil=function(){var t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=e.create();e.ortho(n,0,this.width,this.height,0,0,1),e.scale(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,Ae.disabled,this.stencilClearMode,Ce.disabled,Pe.disabled,jr(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Sn.prototype._renderTileClippingMasks=function(e,t){if(this.currentStencilSource!==e.source&&e.isTileClipped()&&t&&t.length){this.currentStencilSource=e.source;var r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Ce.disabled),r.setDepthMode(Ae.disabled);var i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var a=0,o=t;a<o.length;a+=1){var s=o[a],l=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;i.draw(r,n.TRIANGLES,Ae.disabled,new Ee({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),Ce.disabled,Pe.disabled,jr(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Sn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var e=this.nextStencilID++,t=this.context.gl;return new Ee({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)},Sn.prototype.stencilModeForClipping=function(e){var t=this.context.gl;return new Ee({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)},Sn.prototype.stencilConfigForOverlap=function(e){var t,r=this.context.gl,n=e.sort((function(e,t){return t.overscaledZ-e.overscaledZ})),i=n[n.length-1].overscaledZ,a=n[0].overscaledZ-i+1;if(a>1){this.currentStencilSource=void 0,this.nextStencilID+a>256&&this.clearStencil();for(var o={},s=0;s<a;s++)o[s+i]=new Ee({func:r.GEQUAL,mask:255},s+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=a,[o,n]}return[(t={},t[i]=Ee.disabled,t),n]},Sn.prototype.colorModeForRenderPass=function(){var t=this.context.gl;if(this._showOverdrawInspector){var r=1/8;return new Ce([t.CONSTANT_COLOR,t.ONE],new e.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Ce.unblended:Ce.alphaBlended},Sn.prototype.depthModeForSublayer=function(e,t,r){if(!this.opaquePassEnabledForLayer())return Ae.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Ae(r||this.context.gl.LEQUAL,t,[n,n])},Sn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Sn.prototype.render=function(t,r){var n=this;this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.browser.now()),this.imageManager.beginFrame();var i=this.style._order,a=this.style.sourceCaches;for(var o in a){var s=a[o];s.used&&s.prepare(this.context)}var l,c,u={},h={},p={};for(var d in a){var f=a[d];u[d]=f.getVisibleCoordinates(),h[d]=u[d].slice().reverse(),p[d]=f.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<i.length;m++){var g=i[m];if(this.style._layers[g].is3D()){this.opaquePassCutoff=m;break}}this.renderPass="offscreen";for(var y=0,v=i;y<v.length;y+=1){var x=v[y],b=this.style._layers[x];if(b.hasOffscreenPass()&&!b.isHidden(this.transform.zoom)){var _=h[b.source];("custom"===b.type||_.length)&&this.renderLayer(this,a[b.source],b,_)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){var w=this.style._layers[i[this.currentLayer]],k=a[w.source],T=u[w.source];this._renderTileClippingMasks(w,T),this.renderLayer(this,k,w,T)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){var S=this.style._layers[i[this.currentLayer]],A=a[S.source],M=("symbol"===S.type?p:h)[S.source];this._renderTileClippingMasks(S,u[S.source]),this.renderLayer(this,A,S,M)}this.options.showTileBoundaries&&(e.values(this.style._layers).forEach((function(e){e.source&&!e.isHidden(n.transform.zoom)&&(e.source!==(c&&c.id)&&(c=n.style.sourceCaches[e.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&Tn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&xn(this),this.context.setDefault()},Sn.prototype.renderLayer=function(e,t,r,n){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||n.length)&&(this.id=r.id,this.gpuTimingStart(r),Tn[r.type](e,t,r,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},Sn.prototype.gpuTimingStart=function(e){if(this.options.gpuTiming){var t=this.context.extTimerQuery,r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}},Sn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}},Sn.prototype.collectGpuTimers=function(){var e=this.gpuTimers;return this.gpuTimers={},e},Sn.prototype.queryGpuTimers=function(e){var t={};for(var r in e){var n=e[r],i=this.context.extTimerQuery,a=i.getQueryObjectEXT(n.query,i.QUERY_RESULT_EXT)/1e6;i.deleteQueryEXT(n.query),t[r]=a}return t},Sn.prototype.translatePosMatrix=function(t,r,n,i,a){if(!n[0]&&!n[1])return t;var o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){var s=Math.sin(o),l=Math.cos(o);n=[n[0]*l-n[1]*s,n[0]*s+n[1]*l]}var c=[a?n[0]:gt(r,n[0],this.transform.zoom),a?n[1]:gt(r,n[1],this.transform.zoom),0],u=new Float32Array(16);return e.translate(u,t,c),u},Sn.prototype.saveTileTexture=function(e){var t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]},Sn.prototype.getTileTexture=function(e){var t=this._tileTextures[e];return t&&t.length>0?t.pop():null},Sn.prototype.isPatternMissing=function(e){if(!e)return!1;if(!e.from||!e.to)return!0;var t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r},Sn.prototype.useProgram=function(e,t){this.cache=this.cache||{};var r=""+e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Sr(this.context,e,wr[e],t,en[e],this._showOverdrawInspector)),this.cache[r]},Sn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Sn.prototype.setBaseState=function(){var e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)},Sn.prototype.initDebugOverlayCanvas=function(){if(null==this.debugOverlayCanvas){this.debugOverlayCanvas=e.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;var t=this.context.gl;this.debugOverlayTexture=new e.Texture(this.context,this.debugOverlayCanvas,t.RGBA)}},Sn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var An=function(e,t){this.points=e,this.planes=t};An.fromInvProjectionMatrix=function(t,r,n){var i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(r){return e.transformMat4([],r,t)})).map((function(t){return e.scale$1([],t,1/t[3]/r*i)})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(t){var r=e.sub([],a[t[0]],a[t[1]]),n=e.sub([],a[t[2]],a[t[1]]),i=e.normalize([],e.cross([],r,n)),o=-e.dot(i,a[t[1]]);return i.concat(o)}));return new An(a,o)};var Mn=function(t,r){this.min=t,this.max=r,this.center=e.scale$2([],e.add([],this.min,this.max),.5)};Mn.prototype.quadrant=function(t){for(var r=[t%2===0,t<2],n=e.clone$2(this.min),i=e.clone$2(this.max),a=0;a<r.length;a++)n[a]=r[a]?this.min[a]:this.center[a],i[a]=r[a]?this.center[a]:this.max[a];return i[2]=this.max[2],new Mn(n,i)},Mn.prototype.distanceX=function(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]},Mn.prototype.distanceY=function(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]},Mn.prototype.intersects=function(t){for(var r=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,i=0;i<t.planes.length;i++){for(var a=t.planes[i],o=0,s=0;s<r.length;s++)o+=e.dot$1(a,r[s])>=0;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<t.points.length;h++){var p=t.points[h][l]-this.min[l];c=Math.min(c,p),u=Math.max(u,p)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var En=function(e,t,r,n){if(void 0===e&&(e=0),void 0===t&&(t=0),void 0===r&&(r=0),void 0===n&&(n=0),isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n};En.prototype.interpolate=function(t,r,n){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,n)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,n)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,n)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,n)),this},En.prototype.getCenter=function(t,r){var n=e.clamp((this.left+t-this.right)/2,0,t),i=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.Point(n,i)},En.prototype.equals=function(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right},En.prototype.clone=function(){return new En(this.top,this.bottom,this.left,this.right)},En.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var Cn=function(t,r,n,i,a){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===a||a,this._minZoom=t||0,this._maxZoom=r||22,this._minPitch=void 0===n||null===n?0:n,this._maxPitch=void 0===i||null===i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new En,this._posMatrixCache={},this._alignedPosMatrixCache={}},Pn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};Cn.prototype.clone=function(){var e=new Cn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e},Pn.minZoom.get=function(){return this._minZoom},Pn.minZoom.set=function(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))},Pn.maxZoom.get=function(){return this._maxZoom},Pn.maxZoom.set=function(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))},Pn.minPitch.get=function(){return this._minPitch},Pn.minPitch.set=function(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))},Pn.maxPitch.get=function(){return this._maxPitch},Pn.maxPitch.set=function(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))},Pn.renderWorldCopies.get=function(){return this._renderWorldCopies},Pn.renderWorldCopies.set=function(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e},Pn.worldSize.get=function(){return this.tileSize*this.scale},Pn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Pn.size.get=function(){return new e.Point(this.width,this.height)},Pn.bearing.get=function(){return-this.angle/Math.PI*180},Pn.bearing.set=function(t){var r=-e.wrap(t,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=e.create$2(),e.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Pn.pitch.get=function(){return this._pitch/Math.PI*180},Pn.pitch.set=function(t){var r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())},Pn.fov.get=function(){return this._fov/Math.PI*180},Pn.fov.set=function(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())},Pn.zoom.get=function(){return this._zoom},Pn.zoom.set=function(e){var t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},Pn.center.get=function(){return this._center},Pn.center.set=function(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())},Pn.padding.get=function(){return this._edgeInsets.toJSON()},Pn.padding.set=function(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())},Pn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},Cn.prototype.isPaddingEqual=function(e){return this._edgeInsets.equals(e)},Cn.prototype.interpolatePadding=function(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()},Cn.prototype.coveringZoomLevel=function(e){var t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)},Cn.prototype.getVisibleUnwrappedCoordinates=function(t){var r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new e.Point(0,0)),i=this.pointCoordinate(new e.Point(this.width,0)),a=this.pointCoordinate(new e.Point(this.width,this.height)),o=this.pointCoordinate(new e.Point(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=s-1;c<=l+1;c++)0!==c&&r.push(new e.UnwrappedTileID(c,t));return r},Cn.prototype.coveringTiles=function(t){var r=this.coveringZoomLevel(t),n=r;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);var i=e.MercatorCoordinate.fromLngLat(this.center),a=Math.pow(2,r),o=[a*i.x,a*i.y,0],s=An.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),l=t.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=r);var c=function(e){return{aabb:new Mn([e*a,0,0],[(e+1)*a,a,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}},u=[],h=[],p=r,d=t.reparseOverscaled?n:r;if(this._renderWorldCopies)for(var f=1;f<=3;f++)u.push(c(-f)),u.push(c(f));for(u.push(c(0));u.length>0;){var m=u.pop(),g=m.x,y=m.y,v=m.fullyVisible;if(!v){var x=m.aabb.intersects(s);if(0===x)continue;v=2===x}var b=m.aabb.distanceX(o),_=m.aabb.distanceY(o),w=Math.max(Math.abs(b),Math.abs(_)),k=3+(1<<p-m.zoom)-2;if(m.zoom===p||w>k&&m.zoom>=l)h.push({tileID:new e.OverscaledTileID(m.zoom===p?d:m.zoom,m.wrap,m.zoom,g,y),distanceSq:e.sqrLen([o[0]-.5-g,o[1]-.5-y])});else for(var T=0;T<4;T++){var S=(g<<1)+T%2,A=(y<<1)+(T>>1);u.push({aabb:m.aabb.quadrant(T),zoom:m.zoom+1,x:S,y:A,wrap:m.wrap,fullyVisible:v})}}return h.sort((function(e,t){return e.distanceSq-t.distanceSq})).map((function(e){return e.tileID}))},Cn.prototype.resize=function(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()},Pn.unmodified.get=function(){return this._unmodified},Cn.prototype.zoomScale=function(e){return Math.pow(2,e)},Cn.prototype.scaleZoom=function(e){return Math.log(e)/Math.LN2},Cn.prototype.project=function(t){var r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.Point(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)},Cn.prototype.unproject=function(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()},Pn.point.get=function(){return this.project(this.center)},Cn.prototype.setLocationAtPoint=function(t,r){var n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.MercatorCoordinate(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())},Cn.prototype.locationPoint=function(e){return this.coordinatePoint(this.locationCoordinate(e))},Cn.prototype.pointLocation=function(e){return this.coordinateLocation(this.pointCoordinate(e))},Cn.prototype.locationCoordinate=function(t){return e.MercatorCoordinate.fromLngLat(t)},Cn.prototype.coordinateLocation=function(e){return e.toLngLat()},Cn.prototype.pointCoordinate=function(t){var r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.transformMat4(r,r,this.pixelMatrixInverse),e.transformMat4(n,n,this.pixelMatrixInverse);var i=r[3],a=n[3],o=r[0]/i,s=n[0]/a,l=r[1]/i,c=n[1]/a,u=r[2]/i,h=n[2]/a,p=u===h?0:(0-u)/(h-u);return new e.MercatorCoordinate(e.number(o,s,p)/this.worldSize,e.number(l,c,p)/this.worldSize)},Cn.prototype.coordinatePoint=function(t){var r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix),new e.Point(r[0]/r[3],r[1]/r[3])},Cn.prototype.getBounds=function(){return(new e.LngLatBounds).extend(this.pointLocation(new e.Point(0,0))).extend(this.pointLocation(new e.Point(this.width,0))).extend(this.pointLocation(new e.Point(this.width,this.height))).extend(this.pointLocation(new e.Point(0,this.height)))},Cn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},Cn.prototype.setMaxBounds=function(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},Cn.prototype.calculatePosMatrix=function(t,r){void 0===r&&(r=!1);var n=t.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];var a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*o,a.y*o,0]),e.scale(l,l,[o/e.EXTENT,o/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),i[n]=new Float32Array(l),i[n]},Cn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},Cn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,r,n,i,a=-90,o=90,s=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;a=e.mercatorYfromLat(h[1])*this.worldSize,t=(o=e.mercatorYfromLat(h[0])*this.worldSize)-a<c.y?c.y/(o-a):0}if(this.lngRange){var p=this.lngRange;s=e.mercatorXfromLng(p[0])*this.worldSize,r=(l=e.mercatorXfromLng(p[1])*this.worldSize)-s<c.x?c.x/(l-s):0}var d=this.point,f=Math.max(r||0,t||0);if(f)return this.center=this.unproject(new e.Point(r?(l+s)/2:d.x,t?(o+a)/2:d.y)),this.zoom+=this.scaleZoom(f),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var m=d.y,g=c.y/2;m-g<a&&(i=a+g),m+g>o&&(i=o-g)}if(this.lngRange){var y=d.x,v=c.x/2;y-v<s&&(n=s+v),y+v>l&&(n=l-v)}void 0===n&&void 0===i||(this.center=this.unproject(new e.Point(void 0!==n?n:d.x,void 0!==i?i:d.y))),this._unmodified=u,this._constraining=!1}},Cn.prototype._calcMatrices=function(){if(this.height){var t=this._fov/2,r=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(t)*this.height;var n=Math.PI/2+this._pitch,i=this._fov*(.5+r.y/this.height),a=Math.sin(i)*this.cameraToCenterDistance/Math.sin(e.clamp(Math.PI-n-i,.01,Math.PI-.01)),o=this.point,s=o.x,l=o.y,c=1.01*(Math.cos(Math.PI/2-this._pitch)*a+this.cameraToCenterDistance),u=this.height/50,h=new Float64Array(16);e.perspective(h,this._fov,this.width/this.height,u,c),h[8]=2*-r.x/this.width,h[9]=2*r.y/this.height,e.scale(h,h,[1,-1,1]),e.translate(h,h,[0,0,-this.cameraToCenterDistance]),e.rotateX(h,h,this._pitch),e.rotateZ(h,h,this.angle),e.translate(h,h,[-s,-l,0]),this.mercatorMatrix=e.scale([],h,[this.worldSize,this.worldSize,this.worldSize]),e.scale(h,h,[1,1,e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=h,this.invProjMatrix=e.invert([],this.projMatrix);var p=this.width%2/2,d=this.height%2/2,f=Math.cos(this.angle),m=Math.sin(this.angle),g=s-Math.round(s)+f*p+m*d,y=l-Math.round(l)+f*d+m*p,v=new Float64Array(h);if(e.translate(v,v,[g>.5?g-1:g,y>.5?y-1:y,0]),this.alignedProjMatrix=v,h=e.create(),e.scale(h,h,[this.width/2,-this.height/2,1]),e.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.create(),e.scale(h,h,[1,-1,1]),e.translate(h,h,[-1,-1,0]),e.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(h=e.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=h,this._posMatrixCache={},this._alignedPosMatrixCache={}}},Cn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var t=this.pointCoordinate(new e.Point(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance},Cn.prototype.getCameraPoint=function(){var t=this._pitch,r=Math.tan(t)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.Point(0,r))},Cn.prototype.getCameraQueryGeometry=function(t){var r=this.getCameraPoint();if(1===t.length)return[t[0],r];for(var n=r.x,i=r.y,a=r.x,o=r.y,s=0,l=t;s<l.length;s+=1){var c=l[s];n=Math.min(n,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),o=Math.max(o,c.y)}return[new e.Point(n,i),new e.Point(a,i),new e.Point(a,o),new e.Point(n,o),new e.Point(n,i)]},Object.defineProperties(Cn.prototype,Pn);var Ln=function(t){this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(e,t){var r=!1,n=null,i=function(){n=null,r&&(e(),n=setTimeout(i,t),r=!1)};return function(){return r=!0,n||i(),n}}(this._updateHashUnthrottled.bind(this),300)};Ln.prototype.addTo=function(t){return this._map=t,e.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Ln.prototype.remove=function(){return e.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Ln.prototype.getHashString=function(t){var r=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,i=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),a=Math.pow(10,i),o=Math.round(r.lng*a)/a,s=Math.round(r.lat*a)/a,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=t?"/"+o+"/"+s+"/"+n:n+"/"+s+"/"+o,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,p=!1,d=e.window.location.hash.slice(1).split("&").map((function(e){var t=e.split("=")[0];return t===h?(p=!0,t+"="+u):e})).filter((function(e){return e}));return p||d.push(h+"="+u),"#"+d.join("&")}return"#"+u},Ln.prototype._getCurrentHash=function(){var t,r=this,n=e.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(e){return e.split("=")})).forEach((function(e){e[0]===r._hashName&&(t=e)})),(t&&t[1]||"").split("/")):n.split("/")},Ln.prototype._onHashChange=function(){var e=this._getCurrentHash();if(e.length>=3&&!e.some((function(e){return isNaN(e)}))){var t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},Ln.prototype._updateHashUnthrottled=function(){var t=e.window.location.href.replace(/(#.+)?$/,this.getHashString());try{e.window.history.replaceState(e.window.history.state,null,t)}catch(r){}};var In={linearity:.3,easing:e.bezier(0,0,.3,1)},zn=e.extend({deceleration:2500,maxSpeed:1400},In),On=e.extend({deceleration:20,maxSpeed:1400},In),Rn=e.extend({deceleration:1e3,maxSpeed:360},In),Dn=e.extend({deceleration:1e3,maxSpeed:90},In),jn=function(e){this._map=e,this.clear()};function Fn(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Bn(t,r,n){var i=n.maxSpeed,a=n.linearity,o=n.deceleration,s=e.clamp(t*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}jn.prototype.clear=function(){this._inertiaBuffer=[]},jn.prototype.record=function(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.browser.now(),settings:t})},jn.prototype._drainInertiaBuffer=function(){for(var t=this._inertiaBuffer,r=e.browser.now();t.length>0&&r-t[0].time>160;)t.shift()},jn.prototype._onMoveEnd=function(t){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new e.Point(0,0),pinchAround:void 0,around:void 0},n=0,i=this._inertiaBuffer;n<i.length;n+=1){var a=i[n].settings;r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,a.panDelta&&r.pan._add(a.panDelta),a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround)}var o=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,s={};if(r.pan.mag()){var l=Bn(r.pan.mag(),o,e.extend({},zn,t||{}));s.offset=r.pan.mult(l.amount/r.pan.mag()),s.center=this._map.transform.center,Fn(s,l)}if(r.zoom){var c=Bn(r.zoom,o,On);s.zoom=this._map.transform.zoom+c.amount,Fn(s,c)}if(r.bearing){var u=Bn(r.bearing,o,Rn);s.bearing=this._map.transform.bearing+e.clamp(u.amount,-179,179),Fn(s,u)}if(r.pitch){var h=Bn(r.pitch,o,Dn);s.pitch=this._map.transform.pitch+h.amount,Fn(s,h)}if(s.zoom||s.bearing){var p=void 0===r.pinchAround?r.around:r.pinchAround;s.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),e.extend(s,{noMoveStart:!0})}};var Nn=function(t){function n(n,i,a,o){void 0===o&&(o={});var s=r.mousePos(i.getCanvasContainer(),a),l=i.unproject(s);t.call(this,n,e.extend({point:s,lngLat:l,originalEvent:a},o)),this._defaultPrevented=!1,this.target=i}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(e.Event),Un=function(t){function n(n,i,a){var o="touchend"===n?a.changedTouches:a.touches,s=r.touchPos(i.getCanvasContainer(),o),l=s.map((function(e){return i.unproject(e)})),c=s.reduce((function(e,t,r,n){return e.add(t.div(n.length))}),new e.Point(0,0)),u=i.unproject(c);t.call(this,n,{points:s,point:c,lngLats:l,lngLat:u,originalEvent:a}),this._defaultPrevented=!1}t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n;var i={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,i),n}(e.Event),Vn=function(e){function t(t,r,n){e.call(this,t,{originalEvent:n}),this._defaultPrevented=!1}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={defaultPrevented:{configurable:!0}};return t.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(t.prototype,r),t}(e.Event),qn=function(e,t){this._map=e,this._clickTolerance=t.clickTolerance};qn.prototype.reset=function(){delete this._mousedownPos},qn.prototype.wheel=function(e){return this._firePreventable(new Vn(e.type,this._map,e))},qn.prototype.mousedown=function(e,t){return this._mousedownPos=t,this._firePreventable(new Nn(e.type,this._map,e))},qn.prototype.mouseup=function(e){this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.click=function(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.dblclick=function(e){return this._firePreventable(new Nn(e.type,this._map,e))},qn.prototype.mouseover=function(e){this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.mouseout=function(e){this._map.fire(new Nn(e.type,this._map,e))},qn.prototype.touchstart=function(e){return this._firePreventable(new Un(e.type,this._map,e))},qn.prototype.touchmove=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype.touchend=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype.touchcancel=function(e){this._map.fire(new Un(e.type,this._map,e))},qn.prototype._firePreventable=function(e){if(this._map.fire(e),e.defaultPrevented)return{}},qn.prototype.isEnabled=function(){return!0},qn.prototype.isActive=function(){return!1},qn.prototype.enable=function(){},qn.prototype.disable=function(){};var Hn=function(e){this._map=e};Hn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Hn.prototype.mousemove=function(e){this._map.fire(new Nn(e.type,this._map,e))},Hn.prototype.mousedown=function(){this._delayContextMenu=!0},Hn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Nn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Hn.prototype.contextmenu=function(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new Nn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()},Hn.prototype.isEnabled=function(){return!0},Hn.prototype.isActive=function(){return!1},Hn.prototype.enable=function(){},Hn.prototype.disable=function(){};var Gn=function(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1};function Wn(e,t){for(var r={},n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}Gn.prototype.isEnabled=function(){return!!this._enabled},Gn.prototype.isActive=function(){return!!this._active},Gn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Gn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Gn.prototype.mousedown=function(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(r.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)},Gn.prototype.mousemoveWindow=function(e,t){if(this._active){var n=t;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var i=this._startPos;this._lastPos=n,this._box||(this._box=r.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));var a=Math.min(i.x,n.x),o=Math.max(i.x,n.x),s=Math.min(i.y,n.y),l=Math.max(i.y,n.y);r.setTransform(this._box,"translate("+a+"px,"+s+"px)"),this._box.style.width=o-a+"px",this._box.style.height=l-s+"px"}}},Gn.prototype.mouseupWindow=function(t,n){var i=this;if(this._active&&0===t.button){var a=this._startPos,o=n;if(this.reset(),r.suppressClick(),a.x!==o.x||a.y!==o.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:function(e){return e.fitScreenCoordinates(a,o,i._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",t)}},Gn.prototype.keydown=function(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))},Gn.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Gn.prototype._fireEvent=function(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))};var $n=function(e){this.reset(),this.numTouches=e.numTouches};$n.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},$n.prototype.touchstart=function(t,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){for(var r=new e.Point(0,0),n=0,i=t;n<i.length;n+=1){var a=i[n];r._add(a)}return r.div(t.length)}(r),this.touches=Wn(n,r)))},$n.prototype.touchmove=function(e,t,r){if(!this.aborted&&this.centroid){var n=Wn(r,t);for(var i in this.touches){var a=this.touches[i],o=n[i];(!o||o.dist(a)>30)&&(this.aborted=!0)}}},$n.prototype.touchend=function(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Zn=function(e){this.singleTap=new $n(e),this.numTaps=e.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(e,t,r){this.singleTap.touchstart(e,t,r)},Zn.prototype.touchmove=function(e,t,r){this.singleTap.touchmove(e,t,r)},Zn.prototype.touchend=function(e,t,r){var n=this.singleTap.touchend(e,t,r);if(n){var i=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(n)<30;if(i&&a||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var Xn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};Xn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},Xn.prototype.touchstart=function(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)},Xn.prototype.touchmove=function(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)},Xn.prototype.touchend=function(e,t,r){var n=this,i=this._zoomIn.touchend(e,t,r),a=this._zoomOut.touchend(e,t,r);return i?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}}):a?(this._active=!0,e.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(t){return t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(a)},{originalEvent:e})}}):void 0},Xn.prototype.touchcancel=function(){this.reset()},Xn.prototype.enable=function(){this._enabled=!0},Xn.prototype.disable=function(){this._enabled=!1,this.reset()},Xn.prototype.isEnabled=function(){return this._enabled},Xn.prototype.isActive=function(){return this._active};var Yn={0:1,2:2},Kn=function(e){this.reset(),this._clickTolerance=e.clickTolerance||1};Kn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Kn.prototype._correctButton=function(e,t){return!1},Kn.prototype._move=function(e,t){return{}},Kn.prototype.mousedown=function(e,t){if(!this._lastPoint){var n=r.mouseButton(e);this._correctButton(e,n)&&(this._lastPoint=t,this._eventButton=n)}},Kn.prototype.mousemoveWindow=function(e,t){var r=this._lastPoint;if(r)if(e.preventDefault(),function(e,t){var r=Yn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)},Kn.prototype.mouseupWindow=function(e){this._lastPoint&&r.mouseButton(e)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},Kn.prototype.enable=function(){this._enabled=!0},Kn.prototype.disable=function(){this._enabled=!1,this.reset()},Kn.prototype.isEnabled=function(){return this._enabled},Kn.prototype.isActive=function(){return this._active};var Jn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.mousedown=function(t,r){e.prototype.mousedown.call(this,t,r),this._lastPoint&&(this._active=!0)},t.prototype._correctButton=function(e,t){return 0===t&&!e.ctrlKey},t.prototype._move=function(e,t){return{around:t,panDelta:t.sub(e)}},t}(Kn),Qn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(Kn),ei=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._correctButton=function(e,t){return 0===t&&e.ctrlKey||2===t},t.prototype._move=function(e,t){var r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}},t.prototype.contextmenu=function(e){e.preventDefault()},t}(Kn),ti=function(e){this._minTouches=1,this._clickTolerance=e.clickTolerance||1,this.reset()};ti.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new e.Point(0,0)},ti.prototype.touchstart=function(e,t,r){return this._calculateTransform(e,t,r)},ti.prototype.touchmove=function(e,t,r){if(this._active&&!(r.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,t,r)},ti.prototype.touchend=function(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()},ti.prototype.touchcancel=function(){this.reset()},ti.prototype._calculateTransform=function(t,r,n){n.length>0&&(this._active=!0);var i=Wn(n,r),a=new e.Point(0,0),o=new e.Point(0,0),s=0;for(var l in i){var c=i[l],u=this._touches[l];u&&(a._add(c),o._add(c.sub(u)),s++,i[l]=c)}if(this._touches=i,!(s<this._minTouches)&&o.mag()){var h=o.div(s);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:a.div(s),panDelta:h}}},ti.prototype.enable=function(){this._enabled=!0},ti.prototype.disable=function(){this._enabled=!1,this.reset()},ti.prototype.isEnabled=function(){return this._enabled},ti.prototype.isActive=function(){return this._active};var ri=function(){this.reset()};function ni(e,t,r){for(var n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function ii(e,t){return Math.log(e/t)/Math.LN2}ri.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},ri.prototype._start=function(e){},ri.prototype._move=function(e,t,r){return{}},ri.prototype.touchstart=function(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))},ri.prototype.touchmove=function(e,t,r){if(this._firstTwoTouches){e.preventDefault();var n=this._firstTwoTouches,i=n[0],a=n[1],o=ni(r,t,i),s=ni(r,t,a);if(o&&s){var l=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],l,e)}}},ri.prototype.touchend=function(e,t,n){if(this._firstTwoTouches){var i=this._firstTwoTouches,a=i[0],o=i[1],s=ni(n,t,a),l=ni(n,t,o);s&&l||(this._active&&r.suppressClick(),this.reset())}},ri.prototype.touchcancel=function(){this.reset()},ri.prototype.enable=function(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around},ri.prototype.disable=function(){this._enabled=!1,this.reset()},ri.prototype.isEnabled=function(){return this._enabled},ri.prototype.isActive=function(){return this._active};var ai=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._distance,delete this._startDistance},t.prototype._start=function(e){this._startDistance=this._distance=e[0].dist(e[1])},t.prototype._move=function(e,t){var r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ii(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ii(this._distance,r),pinchAround:t}},t}(ri);function oi(e,t){return 180*e.angleWith(t)/Math.PI}var si=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},t.prototype._start=function(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])},t.prototype._move=function(e,t){var r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:oi(this._vector,r),pinchAround:t}},t.prototype._isBelowThreshold=function(e){this._minDiameter=Math.min(this._minDiameter,e.mag());var t=25/(Math.PI*this._minDiameter)*360,r=oi(e,this._startVector);return Math.abs(r)<t},t}(ri);function li(e){return Math.abs(e.y)>Math.abs(e.x)}var ci=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.reset=function(){e.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},t.prototype._start=function(e){this._lastPoints=e,li(e[0].sub(e[1]))&&(this._valid=!1)},t.prototype._move=function(e,t,r){var n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}},t.prototype.gestureBeginsVertically=function(e,t,r){if(void 0!==this._valid)return this._valid;var n=e.mag()>=2,i=t.mag()>=2;if(n||i){if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;var a=e.y>0===t.y>0;return li(e)&&li(t)&&a}},t}(ri),ui={panStep:100,bearingStep:15,pitchStep:10},hi=function(){var e=ui;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1};function pi(e){return e*(2-e)}hi.prototype.reset=function(){this._active=!1},hi.prototype.keydown=function(e){var t=this;if(!(e.altKey||e.ctrlKey||e.metaKey)){var r=0,n=0,i=0,a=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?n=-1:(e.preventDefault(),a=-1);break;case 39:e.shiftKey?n=1:(e.preventDefault(),a=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(n=0,i=0),{cameraAnimation:function(s){var l=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:pi,zoom:r?Math.round(l)+r*(e.shiftKey?2:1):l,bearing:s.getBearing()+n*t._bearingStep,pitch:s.getPitch()+i*t._pitchStep,offset:[-a*t._panStep,-o*t._panStep],center:s.getCenter()},{originalEvent:e})}}}},hi.prototype.enable=function(){this._enabled=!0},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active},hi.prototype.disableRotation=function(){this._rotationDisabled=!0},hi.prototype.enableRotation=function(){this._rotationDisabled=!1};var di=4.000244140625,fi=1/450,mi=function(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=fi,e.bindAll(["_onTimeout"],this)};mi.prototype.setZoomRate=function(e){this._defaultZoomRate=e},mi.prototype.setWheelZoomRate=function(e){this._wheelZoomRate=e},mi.prototype.isEnabled=function(){return!!this._enabled},mi.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},mi.prototype.isZooming=function(){return!!this._zooming},mi.prototype.enable=function(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)},mi.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},mi.prototype.wheel=function(t){if(this.isEnabled()){var r=t.deltaMode===e.window.WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,n=e.browser.now(),i=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==r&&r%di===0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(i*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}},mi.prototype._onTimeout=function(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},mi.prototype._start=function(t){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=r.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},mi.prototype.renderFrame=function(){var t=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>di?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);var a="number"===typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale;this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*i))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var o,s="number"===typeof this._targetZoom?this._targetZoom:r.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((e.browser.now()-this._lastWheelEventTime)/200,1),p=c(h);o=e.number(l,s,p),h<1?this._frameId||(this._frameId=!0):u=!0}else o=s,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){t._zooming=!1,t._handler._triggerRenderFrame(),delete t._targetZoom,delete t._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:o-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},mi.prototype._smoothOutEasing=function(t){var r=e.ease;if(this._prevEase){var n=this._prevEase,i=(e.browser.now()-n.start)/n.duration,a=n.easing(i+.01)-n.easing(i),o=.27/Math.sqrt(a*a+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=e.bezier(o,s,.25,1)}return this._prevEase={start:e.browser.now(),duration:t,easing:r},r},mi.prototype.reset=function(){this._active=!1};var gi=function(e,t){this._clickZoom=e,this._tapZoom=t};gi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},gi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},gi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},gi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var yi=function(){this.reset()};yi.prototype.reset=function(){this._active=!1},yi.prototype.dblclick=function(e,t){return e.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}},yi.prototype.enable=function(){this._enabled=!0},yi.prototype.disable=function(){this._enabled=!1,this.reset()},yi.prototype.isEnabled=function(){return this._enabled},yi.prototype.isActive=function(){return this._active};var vi=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};vi.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},vi.prototype.touchstart=function(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))},vi.prototype.touchmove=function(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;var n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)},vi.prototype.touchend=function(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)},vi.prototype.touchcancel=function(){this.reset()},vi.prototype.enable=function(){this._enabled=!0},vi.prototype.disable=function(){this._enabled=!1,this.reset()},vi.prototype.isEnabled=function(){return this._enabled},vi.prototype.isActive=function(){return this._active};var xi=function(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r};xi.prototype.enable=function(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},xi.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},xi.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},xi.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var bi=function(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r};bi.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},bi.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},bi.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},bi.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var _i=function(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};_i.prototype.enable=function(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},_i.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},_i.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},_i.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},_i.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},_i.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wi=function(e){return e.zoom||e.drag||e.pitch||e.rotate},ki=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(e.Event);function Ti(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}var Si=function(t,n){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new jn(t),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),e.bindAll(["handleEvent","handleWindowEvent"],this);var i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[e.window.document,"mousemove",{capture:!0}],[e.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[e.window,"blur",void 0]];for(var a=0,o=this._listeners;a<o.length;a+=1){var s=o[a],l=s[0],c=s[1],u=s[2];r.addEventListener(l,c,l===e.window.document?this.handleWindowEvent:this.handleEvent,u)}};Si.prototype.destroy=function(){for(var t=0,n=this._listeners;t<n.length;t+=1){var i=n[t],a=i[0],o=i[1],s=i[2];r.removeEventListener(a,o,a===e.window.document?this.handleWindowEvent:this.handleEvent,s)}},Si.prototype._addDefaultHandlers=function(e){var t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new qn(t,e));var n=t.boxZoom=new Gn(t,e);this._add("boxZoom",n);var i=new Xn,a=new yi;t.doubleClickZoom=new gi(a,i),this._add("tapZoom",i),this._add("clickZoom",a);var o=new vi;this._add("tapDragZoom",o);var s=t.touchPitch=new ci;this._add("touchPitch",s);var l=new Qn(e),c=new ei(e);t.dragRotate=new bi(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Jn(e),h=new ti(e);t.dragPan=new xi(r,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var p=new si,d=new ai;t.touchZoomRotate=new _i(r,d,p,o),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]);var f=t.scrollZoom=new mi(t,this);this._add("scrollZoom",f,["mousePan"]);var m=t.keyboard=new hi;this._add("keyboard",m),this._add("blockableMapEvent",new Hn(t));for(var g=0,y=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<y.length;g+=1){var v=y[g];e.interactive&&e[v]&&t[v].enable(e[v])}},Si.prototype._add=function(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t},Si.prototype.stop=function(e){if(!this._updatingCamera){for(var t=0,r=this._handlers;t<r.length;t+=1)r[t].handler.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}},Si.prototype.isActive=function(){for(var e=0,t=this._handlers;e<t.length;e+=1)if(t[e].handler.isActive())return!0;return!1},Si.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Si.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Si.prototype.isMoving=function(){return Boolean(wi(this._eventsInProgress))||this.isZooming()},Si.prototype._blockedByActive=function(e,t,r){for(var n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1},Si.prototype.handleWindowEvent=function(e){this.handleEvent(e,e.type+"Window")},Si.prototype._getMapTouches=function(e){for(var t=[],r=0,n=e;r<n.length;r+=1){var i=n[r],a=i.target;this._el.contains(a)&&t.push(i)}return t},Si.prototype.handleEvent=function(e,t){if("blur"!==e.type){this._updatingCamera=!0;for(var n="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},a={},o={},s=e.touches?this._getMapTouches(e.touches):void 0,l=s?r.touchPos(this._el,s):r.mousePos(this._el,e),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],p=h.handlerName,d=h.handler,f=h.allowed;if(d.isEnabled()){var m=void 0;this._blockedByActive(o,f,p)?d.reset():d[t||e.type]&&(m=d[t||e.type](e,l,s),this.mergeHandlerResult(i,a,m,p,n),m&&m.needsRenderFrame&&this._triggerRenderFrame()),(m||d.isActive())&&(o[p]=d)}}var g={};for(var y in this._previousActiveHandlers)o[y]||(g[y]=n);this._previousActiveHandlers=o,(Object.keys(g).length||Ti(i))&&(this._changes.push([i,a,g]),this._triggerRenderFrame()),(Object.keys(o).length||Ti(i))&&this._map._stop(!0),this._updatingCamera=!1;var v=i.cameraAnimation;v&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],v(this._map))}else this.stop(!0)},Si.prototype.mergeHandlerResult=function(t,r,n,i,a){if(n){e.extend(t,n);var o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}},Si.prototype._applyChanges=function(){for(var t={},r={},n={},i=0,a=this._changes;i<a.length;i+=1){var o=a[i],s=o[0],l=o[1],c=o[2];s.panDelta&&(t.panDelta=(t.panDelta||new e.Point(0,0))._add(s.panDelta)),s.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+s.zoomDelta),s.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+s.bearingDelta),s.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+s.pitchDelta),void 0!==s.around&&(t.around=s.around),void 0!==s.pinchAround&&(t.pinchAround=s.pinchAround),s.noInertia&&(t.noInertia=s.noInertia),e.extend(r,l),e.extend(n,c)}this._updateMapTransform(t,r,n),this._changes=[]},Si.prototype._updateMapTransform=function(e,t,r){var n=this._map,i=n.transform;if(!Ti(e))return this._fireEvents(t,r,!0);var a=e.panDelta,o=e.zoomDelta,s=e.bearingDelta,l=e.pitchDelta,c=e.around,u=e.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var h=i.pointLocation(a?c.sub(a):c);s&&(i.bearing+=s),l&&(i.pitch+=l),o&&(i.zoom+=o),i.setLocationAtPoint(h,c),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)},Si.prototype._fireEvents=function(t,r,n){var i=this,a=wi(this._eventsInProgress),o=wi(t),s={};for(var l in t){var c=t[l].originalEvent;this._eventsInProgress[l]||(s[l+"start"]=c),this._eventsInProgress[l]=t[l]}for(var u in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(u,s[u]);for(var h in o&&this._fireEvent("move",o.originalEvent),t){var p=t[h].originalEvent;this._fireEvent(h,p)}var d,f={};for(var m in this._eventsInProgress){var g=this._eventsInProgress[m],y=g.handlerName,v=g.originalEvent;this._handlersById[y].isActive()||(delete this._eventsInProgress[m],d=r[y]||v,f[m+"end"]=d)}for(var x in f)this._fireEvent(x,f[x]);var b=wi(this._eventsInProgress);if(n&&(a||o)&&!b){this._updatingCamera=!0;var _=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),w=function(e){return 0!==e&&-i._bearingSnap<e&&e<i._bearingSnap};_?(w(_.bearing||this._map.getBearing())&&(_.bearing=0),this._map.easeTo(_,{originalEvent:d})):(this._map.fire(new e.Event("moveend",{originalEvent:d})),w(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Si.prototype._fireEvent=function(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))},Si.prototype._requestFrame=function(){var e=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(t){delete e._frameId,e.handleEvent(new ki("renderFrame",{timeStamp:t})),e._applyChanges()}))},Si.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Ai=function(t){function r(r,n){t.call(this),this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=n.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.getCenter=function(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)},r.prototype.setCenter=function(e,t){return this.jumpTo({center:e},t)},r.prototype.panBy=function(t,r,n){return t=e.Point.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),n)},r.prototype.panTo=function(t,r,n){return this.easeTo(e.extend({center:t},r),n)},r.prototype.getZoom=function(){return this.transform.zoom},r.prototype.setZoom=function(e,t){return this.jumpTo({zoom:e},t),this},r.prototype.zoomTo=function(t,r,n){return this.easeTo(e.extend({zoom:t},r),n)},r.prototype.zoomIn=function(e,t){return this.zoomTo(this.getZoom()+1,e,t),this},r.prototype.zoomOut=function(e,t){return this.zoomTo(this.getZoom()-1,e,t),this},r.prototype.getBearing=function(){return this.transform.bearing},r.prototype.setBearing=function(e,t){return this.jumpTo({bearing:e},t),this},r.prototype.getPadding=function(){return this.transform.padding},r.prototype.setPadding=function(e,t){return this.jumpTo({padding:e},t),this},r.prototype.rotateTo=function(t,r,n){return this.easeTo(e.extend({bearing:t},r),n)},r.prototype.resetNorth=function(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this},r.prototype.resetNorthPitch=function(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this},r.prototype.snapToNorth=function(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this},r.prototype.getPitch=function(){return this.transform.pitch},r.prototype.setPitch=function(e,t){return this.jumpTo({pitch:e},t),this},r.prototype.cameraForBounds=function(t,r){t=e.LngLatBounds.convert(t);var n=r&&r.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),n,r)},r.prototype._cameraForBoxAndBearing=function(t,r,n,i){var a={top:0,bottom:0,right:0,left:0};if("number"===typeof(i=e.extend({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){var o=i.padding;i.padding={top:o,bottom:o,right:o,left:o}}i.padding=e.extend(a,i.padding);var s=this.transform,l=s.padding,c=s.project(e.LngLat.convert(t)),u=s.project(e.LngLat.convert(r)),h=c.rotate(-n*Math.PI/180),p=u.rotate(-n*Math.PI/180),d=new e.Point(Math.max(h.x,p.x),Math.max(h.y,p.y)),f=new e.Point(Math.min(h.x,p.x),Math.min(h.y,p.y)),m=d.sub(f),g=(s.width-(l.left+l.right+i.padding.left+i.padding.right))/m.x,y=(s.height-(l.top+l.bottom+i.padding.top+i.padding.bottom))/m.y;if(!(y<0||g<0)){var v=Math.min(s.scaleZoom(s.scale*Math.min(g,y)),i.maxZoom),x="number"===typeof i.offset.x?new e.Point(i.offset.x,i.offset.y):e.Point.convert(i.offset),b=(i.padding.left-i.padding.right)/2,_=(i.padding.top-i.padding.bottom)/2,w=new e.Point(b,_).rotate(n*Math.PI/180),k=x.add(w).mult(s.scale/s.zoomScale(v));return{center:s.unproject(c.add(u).div(2).sub(k)),zoom:v,bearing:n}}e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},r.prototype.fitBounds=function(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)},r.prototype.fitScreenCoordinates=function(t,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.Point.convert(t)),this.transform.pointLocation(e.Point.convert(r)),n,i),i,a)},r.prototype._fitInternal=function(t,r,n){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this},r.prototype.jumpTo=function(t,r){this.stop();var n=this.transform,i=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(i=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.LngLat.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),i&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),a&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),o&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r))},r.prototype.easeTo=function(t,r){var n=this;this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.browser.prefersReducedMotion)&&(t.duration=0);var i=this.transform,a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="zoom"in t?+t.zoom:a,u="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,p="padding"in t?t.padding:i.padding,d=e.Point.convert(t.offset),f=i.centerPoint.add(d),m=i.pointLocation(f),g=e.LngLat.convert(t.center||m);this._normalizeCenter(g);var y,v,x=i.project(m),b=i.project(g).sub(x),_=i.zoomScale(c-a);t.around&&(y=e.LngLat.convert(t.around),v=i.locationPoint(y));var w={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==a,this._rotating=this._rotating||o!==u,this._pitching=this._pitching||h!==s,this._padding=!i.isPaddingEqual(p),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,w),this._ease((function(t){if(n._zooming&&(i.zoom=e.number(a,c,t)),n._rotating&&(i.bearing=e.number(o,u,t)),n._pitching&&(i.pitch=e.number(s,h,t)),n._padding&&(i.interpolatePadding(l,p,t),f=i.centerPoint.add(d)),y)i.setLocationAtPoint(y,v);else{var m=i.zoomScale(i.zoom-a),g=c>a?Math.min(2,_):Math.max(.5,_),w=Math.pow(g,1-t),k=i.unproject(x.add(b.mult(t*w)).mult(m));i.setLocationAtPoint(i.renderWorldCopies?k.wrap():k,f)}n._fireMoveEvents(r)}),(function(e){n._afterEase(r,e)}),t),this},r.prototype._prepareEase=function(t,r,n){void 0===n&&(n={}),this._moving=!0,r||n.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.Event("pitchstart",t))},r.prototype._fireMoveEvents=function(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))},r.prototype._afterEase=function(t,r){if(!this._easeId||!r||this._easeId!==r){delete this._easeId;var n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.Event("zoomend",t)),i&&this.fire(new e.Event("rotateend",t)),a&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}},r.prototype.flyTo=function(t,r){var n=this;if(!t.essential&&e.browser.prefersReducedMotion){var i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);var a=this.transform,o=this.getZoom(),s=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in t?e.clamp(+t.zoom,a.minZoom,a.maxZoom):o,h="bearing"in t?this._normalizeBearing(t.bearing,s):s,p="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:a.padding,f=a.zoomScale(u-o),m=e.Point.convert(t.offset),g=a.centerPoint.add(m),y=a.pointLocation(g),v=e.LngLat.convert(t.center||y);this._normalizeCenter(v);var x=a.project(y),b=a.project(v).sub(x),_=t.curve,w=Math.max(a.width,a.height),k=w/f,T=b.mag();if("minZoom"in t){var S=e.clamp(Math.min(t.minZoom,o,u),a.minZoom,a.maxZoom),A=w/a.zoomScale(S-o);_=Math.sqrt(A/T*2)}var M=_*_;function E(e){var t=(k*k-w*w+(e?-1:1)*M*M*T*T)/(2*(e?k:w)*M*T);return Math.log(Math.sqrt(t*t+1)-t)}function C(e){return(Math.exp(e)-Math.exp(-e))/2}function P(e){return(Math.exp(e)+Math.exp(-e))/2}var L=E(0),I=function(e){return P(L)/P(L+_*e)},z=function(e){return w*((P(L)*(C(t=L+_*e)/P(t))-C(L))/M)/T;var t},O=(E(1)-L)/_;if(Math.abs(T)<1e-6||!isFinite(O)){if(Math.abs(w-k)<1e-6)return this.easeTo(t,r);var R=k<w?-1:1;O=Math.abs(Math.log(k/w))/_,z=function(){return 0},I=function(e){return Math.exp(R*_*e)}}if("duration"in t)t.duration=+t.duration;else{var D="screenSpeed"in t?+t.screenSpeed/_:+t.speed;t.duration=1e3*O/D}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=s!==h,this._pitching=p!==l,this._padding=!a.isPaddingEqual(d),this._prepareEase(r,!1),this._ease((function(t){var i=t*O,f=1/I(i);a.zoom=1===t?u:o+a.scaleZoom(f),n._rotating&&(a.bearing=e.number(s,h,t)),n._pitching&&(a.pitch=e.number(l,p,t)),n._padding&&(a.interpolatePadding(c,d,t),g=a.centerPoint.add(m));var y=1===t?v:a.unproject(x.add(b.mult(z(i))).mult(f));a.setLocationAtPoint(a.renderWorldCopies?y.wrap():y,g),n._fireMoveEvents(r)}),(function(){return n._afterEase(r)}),t),this},r.prototype.isEasing=function(){return!!this._easeFrameId},r.prototype.stop=function(){return this._stop()},r.prototype._stop=function(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}if(!e){var n=this.handlers;n&&n.stop(!1)}return this},r.prototype._ease=function(t,r,n){!1===n.animate||0===n.duration?(t(1),r()):(this._easeStart=e.browser.now(),this._easeOptions=n,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},r.prototype._renderFrameCallback=function(){var t=Math.min((e.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},r.prototype._normalizeBearing=function(t,r){t=e.wrap(t,-180,180);var n=Math.abs(t-r);return Math.abs(t-360-r)<n&&(t-=360),Math.abs(t+360-r)<n&&(t+=360),t},r.prototype._normalizeCenter=function(e){var t=this.transform;if(t.renderWorldCopies&&!t.lngRange){var r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}},r}(e.Evented),Mi=function(t){void 0===t&&(t={}),this.options=t,e.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Mi.prototype.getDefaultPosition=function(){return"bottom-right"},Mi.prototype.onAdd=function(e){var t=this.options&&this.options.compact;return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Mi.prototype.onRemove=function(){r.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Mi.prototype._setElementTitle=function(e,t){var r=this._map._getUIString("AttributionControl."+t);e.title=r,e.setAttribute("aria-label",r)},Mi.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Mi.prototype._updateEditLink=function(){var t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));var r=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.config.ACCESS_TOKEN}];if(t){var n=r.reduce((function(e,t,n){return t.value&&(e+=t.key+"="+t.value+(n<r.length-1?"&":"")),e}),"?");t.href=e.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),t.rel="noopener nofollow",this._setElementTitle(t,"MapFeedback")}},Mi.prototype._updateData=function(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType||(this._updateAttributions(),this._updateEditLink())},Mi.prototype._updateAttributions=function(){if(this._map.style){var e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((function(e){return"string"!==typeof e?"":e}))):"string"===typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){var t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}var r=this._map.style.sourceCaches;for(var n in r){var i=r[n];if(i.used){var a=i.getSource();a.attribution&&e.indexOf(a.attribution)<0&&e.push(a.attribution)}}e.sort((function(e,t){return e.length-t.length}));var o=(e=e.filter((function(t,r){for(var n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}))).join(" | ");o!==this._attribHTML&&(this._attribHTML=o,e.length?(this._innerContainer.innerHTML=o,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Mi.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Ei=function(){e.bindAll(["_updateLogo"],this),e.bindAll(["_updateCompact"],this)};Ei.prototype.onAdd=function(e){this._map=e,this._container=r.create("div","mapboxgl-ctrl");var t=r.create("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Ei.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Ei.prototype.getDefaultPosition=function(){return"bottom-left"},Ei.prototype._updateLogo=function(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Ei.prototype._logoRequired=function(){if(this._map.style){var e=this._map.style.sourceCaches;for(var t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Ei.prototype._updateCompact=function(){var e=this._container.children;if(e.length){var t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}};var Ci=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Ci.prototype.add=function(e){var t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t},Ci.prototype.remove=function(e){for(var t=this._currentlyRunning,r=0,n=t?this._queue.concat(t):this._queue;r<n.length;r+=1){var i=n[r];if(i.id===e)return void(i.cancelled=!0)}},Ci.prototype.run=function(e){void 0===e&&(e=0);var t=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,n=t;r<n.length;r+=1){var i=n[r];if(!i.cancelled&&(i.callback(e),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Ci.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var Pi={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Li=e.window.HTMLImageElement,Ii=e.window.HTMLElement,zi=e.window.ImageBitmap,Oi=60,Ri={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:Oi,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Di=function(n){function i(t){var r=this;if(null!=(t=e.extend({},Ri,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>Oi)throw new Error("maxPitch must be less than or equal to 60");var i=new Cn(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies);if(n.call(this,i,t),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new Ci,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},Pi,t.locale),this._clickTolerance=t.clickTolerance,this._requestManager=new e.RequestManager(t.transformRequest,t.accessToken),"string"===typeof t.container){if(this._container=e.window.document.getElementById(t.container),!this._container)throw new Error("Container '"+t.container+"' not found.")}else{if(!(t.container instanceof Ii))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),"undefined"!==typeof e.window&&(e.window.addEventListener("online",this._onWindowOnline,!1),e.window.addEventListener("resize",this._onWindowResize,!1),e.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Si(this,t);var a="string"===typeof t.hash&&t.hash||void 0;this._hash=t.hash&&new Ln(a).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Mi({customAttribution:t.customAttribution})),this.addControl(new Ei,t.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(t){r._update("style"===t.dataType),r.fire(new e.Event(t.dataType+"data",t))})),this.on("dataloading",(function(t){r.fire(new e.Event(t.dataType+"dataloading",t))}))}n&&(i.__proto__=n),i.prototype=Object.create(n&&n.prototype),i.prototype.constructor=i;var a={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return i.prototype._getMapId=function(){return this._mapId},i.prototype.addControl=function(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=t.onAdd(this);this._controls.push(t);var i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this},i.prototype.removeControl=function(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this},i.prototype.hasControl=function(e){return this._controls.indexOf(e)>-1},i.prototype.resize=function(t){var r=this._containerDimensions(),n=r[0],i=r[1];this._resizeCanvas(n,i),this.transform.resize(n,i),this.painter.resize(n,i);var a=!this._moving;return a&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),a&&this.fire(new e.Event("moveend",t)),this},i.prototype.getBounds=function(){return this.transform.getBounds()},i.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},i.prototype.setMaxBounds=function(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()},i.prototype.setMinZoom=function(e){if((e=null===e||void 0===e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},i.prototype.getMinZoom=function(){return this.transform.minZoom},i.prototype.setMaxZoom=function(e){if((e=null===e||void 0===e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")},i.prototype.getMaxZoom=function(){return this.transform.maxZoom},i.prototype.setMinPitch=function(e){if((e=null===e||void 0===e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},i.prototype.getMinPitch=function(){return this.transform.minPitch},i.prototype.setMaxPitch=function(e){if((e=null===e||void 0===e?Oi:e)>Oi)throw new Error("maxPitch must be less than or equal to 60");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")},i.prototype.getMaxPitch=function(){return this.transform.maxPitch},i.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},i.prototype.setRenderWorldCopies=function(e){return this.transform.renderWorldCopies=e,this._update()},i.prototype.project=function(t){return this.transform.locationPoint(e.LngLat.convert(t))},i.prototype.unproject=function(t){return this.transform.pointLocation(e.Point.convert(t))},i.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},i.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},i.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},i.prototype._createDelegatedListener=function(e,t,r){var n,i=this;if("mouseenter"===e||"mouseover"===e){var a=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){var o=i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?a||(a=!0,r.call(i,new Nn(e,i,n.originalEvent,{features:o}))):a=!1},mouseout:function(){a=!1}}}}if("mouseleave"===e||"mouseout"===e){var o=!1;return{layer:t,listener:r,delegates:{mousemove:function(n){(i.getLayer(t)?i.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?o=!0:o&&(o=!1,r.call(i,new Nn(e,i,n.originalEvent)))},mouseout:function(t){o&&(o=!1,r.call(i,new Nn(e,i,t.originalEvent)))}}}}return{layer:t,listener:r,delegates:(n={},n[e]=function(e){var n=i.getLayer(t)?i.queryRenderedFeatures(e.point,{layers:[t]}):[];n.length&&(e.features=n,r.call(i,e),delete e.features)},n)}},i.prototype.on=function(e,t,r){if(void 0===r)return n.prototype.on.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i),i.delegates)this.on(a,i.delegates[a]);return this},i.prototype.once=function(e,t,r){if(void 0===r)return n.prototype.once.call(this,e,t);var i=this._createDelegatedListener(e,t,r);for(var a in i.delegates)this.once(a,i.delegates[a]);return this},i.prototype.off=function(e,t,r){var i=this;return void 0===r?n.prototype.off.call(this,e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&function(n){for(var a=n[e],o=0;o<a.length;o++){var s=a[o];if(s.layer===t&&s.listener===r){for(var l in s.delegates)i.off(l,s.delegates[l]);return a.splice(o,1),i}}}(this._delegatedListeners),this)},i.prototype.queryRenderedFeatures=function(t,r){if(!this.style)return[];var n;if(void 0!==r||void 0===t||t instanceof e.Point||Array.isArray(t)||(r=t,t=void 0),r=r||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof e.Point||"number"===typeof t[0])n=[e.Point.convert(t)];else{var i=e.Point.convert(t[0]),a=e.Point.convert(t[1]);n=[i,new e.Point(a.x,i.y),a,new e.Point(i.x,a.y),i]}return this.style.queryRenderedFeatures(n,r,this.transform)},i.prototype.querySourceFeatures=function(e,t){return this.style.querySourceFeatures(e,t)},i.prototype.setStyle=function(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))},i.prototype._getUIString=function(e){var t=this._locale[e];if(null==t)throw new Error("Missing UI string '"+e+"'");return t},i.prototype._updateStyle=function(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new $t(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"===typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)},i.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new $t(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},i.prototype._diffStyle=function(t,r){var n=this;if("string"===typeof t){var i=this._requestManager.normalizeStyleURL(t),a=this._requestManager.transformRequest(i,e.ResourceType.Style);e.getJSON(a,(function(t,i){t?n.fire(new e.ErrorEvent(t)):i&&n._updateDiff(i,r)}))}else"object"===typeof t&&this._updateDiff(t,r)},i.prototype._updateDiff=function(t,r){try{this.style.setState(t)&&this._update(!0)}catch(n){e.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+". Rebuilding the style from scratch."),this._updateStyle(t,r)}},i.prototype.getStyle=function(){if(this.style)return this.style.serialize()},i.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")},i.prototype.addSource=function(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)},i.prototype.isSourceLoaded=function(t){var r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.ErrorEvent(new Error("There is no source with ID '"+t+"'")))},i.prototype.areTilesLoaded=function(){var e=this.style&&this.style.sourceCaches;for(var t in e){var r=e[t]._tiles;for(var n in r){var i=r[n];if("loaded"!==i.state&&"errored"!==i.state)return!1}}return!0},i.prototype.addSourceType=function(e,t,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)},i.prototype.removeSource=function(e){return this.style.removeSource(e),this._update(!0)},i.prototype.getSource=function(e){return this.style.getSource(e)},i.prototype.addImage=function(t,r,n){void 0===n&&(n={});var i=n.pixelRatio;void 0===i&&(i=1);var a=n.sdf;void 0===a&&(a=!1);var o=n.stretchX,s=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),r instanceof Li||zi&&r instanceof zi){var c=e.browser.getImageData(r),u=c.width,h=c.height,p=c.data;this.style.addImage(t,{data:new e.RGBAImage({width:u,height:h},p),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new e.ErrorEvent(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`")));var d=r.width,f=r.height,m=r.data,g=r;this.style.addImage(t,{data:new e.RGBAImage({width:d,height:f},new Uint8Array(m)),pixelRatio:i,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:g}),g.onAdd&&g.onAdd(this,t)}},i.prototype.updateImage=function(t,r){var n=this.style.getImage(t);if(!n)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var i=r instanceof Li||zi&&r instanceof zi?e.browser.getImageData(r):r,a=i.width,o=i.height,s=i.data;if(void 0===a||void 0===o)return this.fire(new e.ErrorEvent(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(a!==n.data.width||o!==n.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));var l=!(r instanceof Li||zi&&r instanceof zi);n.data.replace(s,l),this.style.updateImage(t,n)},i.prototype.hasImage=function(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)},i.prototype.removeImage=function(e){this.style.removeImage(e)},i.prototype.loadImage=function(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),r)},i.prototype.listImages=function(){return this.style.listImages()},i.prototype.addLayer=function(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)},i.prototype.moveLayer=function(e,t){return this.style.moveLayer(e,t),this._update(!0)},i.prototype.removeLayer=function(e){return this.style.removeLayer(e),this._update(!0)},i.prototype.getLayer=function(e){return this.style.getLayer(e)},i.prototype.setLayerZoomRange=function(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)},i.prototype.setFilter=function(e,t,r){return void 0===r&&(r={}),this.style.setFilter(e,t,r),this._update(!0)},i.prototype.getFilter=function(e){return this.style.getFilter(e)},i.prototype.setPaintProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setPaintProperty(e,t,r,n),this._update(!0)},i.prototype.getPaintProperty=function(e,t){return this.style.getPaintProperty(e,t)},i.prototype.setLayoutProperty=function(e,t,r,n){return void 0===n&&(n={}),this.style.setLayoutProperty(e,t,r,n),this._update(!0)},i.prototype.getLayoutProperty=function(e,t){return this.style.getLayoutProperty(e,t)},i.prototype.setLight=function(e,t){return void 0===t&&(t={}),this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)},i.prototype.getLight=function(){return this.style.getLight()},i.prototype.setFeatureState=function(e,t){return this.style.setFeatureState(e,t),this._update()},i.prototype.removeFeatureState=function(e,t){return this.style.removeFeatureState(e,t),this._update()},i.prototype.getFeatureState=function(e){return this.style.getFeatureState(e)},i.prototype.getContainer=function(){return this._container},i.prototype.getCanvasContainer=function(){return this._canvasContainer},i.prototype.getCanvas=function(){return this._canvas},i.prototype._containerDimensions=function(){var e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]},i.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==e.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},i.prototype._setupContainer=function(){var e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=r.create("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();var t=this._canvasContainer=r.create("div","mapboxgl-canvas-container",e);this._interactive&&t.classList.add("mapboxgl-interactive"),this._canvas=r.create("canvas","mapboxgl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var i=this._controlContainer=r.create("div","mapboxgl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(e){a[e]=r.create("div","mapboxgl-ctrl-"+e,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},i.prototype._resizeCanvas=function(t,r){var n=e.browser.devicePixelRatio||1;this._canvas.width=n*t,this._canvas.height=n*r,this._canvas.style.width=t+"px",this._canvas.style.height=r+"px"},i.prototype._setupPainter=function(){var r=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);n?(this.painter=new Sn(n,this.transform),e.webpSupported.testSupport(n)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))},i.prototype._contextLost=function(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))},i.prototype._contextRestored=function(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))},i.prototype._onMapScroll=function(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},i.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},i.prototype._update=function(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this},i.prototype._requestRenderFrame=function(e){return this._update(),this._renderTaskQueue.add(e)},i.prototype._cancelRenderFrame=function(e){this._renderTaskQueue.remove(e)},i.prototype._render=function(t){var r,n=this,i=0,a=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=a.createQueryEXT(),a.beginQueryEXT(a.TIME_ELAPSED_EXT,r),i=e.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),!this._removed){var o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var s=this.transform.zoom,l=e.browser.now();this.style.zoomHistory.update(s,l);var c=new e.EvaluationParameters(s,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(o=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=e.browser.now()-i;a.endQueryEXT(a.TIME_ELAPSED_EXT,r),setTimeout((function(){var t=a.getQueryObjectEXT(r,a.QUERY_RESULT_EXT)/1e6;a.deleteQueryEXT(r),n.fire(new e.Event("gpu-timing-frame",{cpuTime:h,gpuTime:t}))}),50)}if(this.listens("gpu-timing-layer")){var p=this.painter.collectGpuTimers();setTimeout((function(){var t=n.painter.queryGpuTimers(p);n.fire(new e.Event("gpu-timing-layer",{layerTimes:t}))}),50)}var d=this._sourcesDirty||this._styleDirty||this._placementDirty;return d||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),!this._loaded||this._fullyLoaded||d||(this._fullyLoaded=!0),this}},i.prototype.remove=function(){this._hash&&this._hash.remove();for(var t=0,r=this._controls;t<r.length;t+=1)r[t].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!==typeof e.window&&(e.window.removeEventListener("resize",this._onWindowResize,!1),e.window.removeEventListener("orientationchange",this._onWindowResize,!1),e.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext&&n.loseContext(),ji(this._canvasContainer),ji(this._controlContainer),ji(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new e.Event("remove"))},i.prototype.triggerRepaint=function(){var t=this;this.style&&!this._frame&&(this._frame=e.browser.frame((function(e){t._frame=null,t._render(e)})))},i.prototype._onWindowOnline=function(){this._update()},i.prototype._onWindowResize=function(e){this._trackResize&&this.resize({originalEvent:e})._update()},a.showTileBoundaries.get=function(){return!!this._showTileBoundaries},a.showTileBoundaries.set=function(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())},a.showPadding.get=function(){return!!this._showPadding},a.showPadding.set=function(e){this._showPadding!==e&&(this._showPadding=e,this._update())},a.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},a.showCollisionBoxes.set=function(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())},a.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},a.showOverdrawInspector.set=function(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())},a.repaint.get=function(){return!!this._repaint},a.repaint.set=function(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())},a.vertices.get=function(){return!!this._vertices},a.vertices.set=function(e){this._vertices=e,this._update()},i.prototype._setCacheLimits=function(t,r){e.setCacheLimits(t,r)},a.version.get=function(){return e.version},Object.defineProperties(i.prototype,a),i}(Ai);function ji(e){e.parentNode&&e.parentNode.removeChild(e)}var Fi={showCompass:!0,showZoom:!0,visualizePitch:!1},Bi=function(t){var n=this;this.options=e.extend({},Fi,t),this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(e){return n._map.zoomIn({},{originalEvent:e})})),r.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(e){return n._map.zoomOut({},{originalEvent:e})})),r.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(e){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:e}):n._map.resetNorth({},{originalEvent:e})})),this._compassIcon=r.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Bi.prototype._updateZoomButtons=function(){var e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},Bi.prototype._rotateCompassArrow=function(){var e=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=e},Bi.prototype.onAdd=function(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ni(this._map,this._compass,this.options.visualizePitch)),this._container},Bi.prototype.onRemove=function(){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},Bi.prototype._createButton=function(e,t){var n=r.create("button",e,this._container);return n.type="button",n.addEventListener("click",t),n},Bi.prototype._setButtonTitle=function(e,t){var r=this._map._getUIString("NavigationControl."+t);e.title=r,e.setAttribute("aria-label",r)};var Ni=function(t,n,i){void 0===i&&(i=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Qn({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new ei({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(n,"mousedown",this.mousedown),r.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(n,"touchmove",this.touchmove),r.addEventListener(n,"touchend",this.touchend),r.addEventListener(n,"touchcancel",this.reset)};function Ui(t,r,n){if(t=new e.LngLat(t.lng,t.lat),r){var i=new e.LngLat(t.lng-360,t.lat),a=new e.LngLat(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(r);n.locationPoint(i).distSqr(r)<o?t=i:n.locationPoint(a).distSqr(r)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){var s=n.locationPoint(t);if(s.x>=0&&s.y>=0&&s.x<=n.width&&s.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t}Ni.prototype.down=function(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),r.disableDrag()},Ni.prototype.move=function(e,t){var r=this.map,n=this.mouseRotate.mousemoveWindow(e,t);if(n&&n.bearingDelta&&r.setBearing(r.getBearing()+n.bearingDelta),this.mousePitch){var i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}},Ni.prototype.off=function(){var e=this.element;r.removeEventListener(e,"mousedown",this.mousedown),r.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(e,"touchmove",this.touchmove),r.removeEventListener(e,"touchend",this.touchend),r.removeEventListener(e,"touchcancel",this.reset),this.offTemp()},Ni.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(e.window,"mousemove",this.mousemove),r.removeEventListener(e.window,"mouseup",this.mouseup)},Ni.prototype.mousedown=function(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:function(){return t.preventDefault()}}),r.mousePos(this.element,t)),r.addEventListener(e.window,"mousemove",this.mousemove),r.addEventListener(e.window,"mouseup",this.mouseup)},Ni.prototype.mousemove=function(e){this.move(e,r.mousePos(this.element,e))},Ni.prototype.mouseup=function(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()},Ni.prototype.touchstart=function(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return e.preventDefault()}},this._startPos))},Ni.prototype.touchmove=function(e){1!==e.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:function(){return e.preventDefault()}},this._lastPos))},Ni.prototype.touchend=function(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Ni.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Vi={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 qi(e,t,r){var n=e.classList;for(var i in Vi)n.remove("mapboxgl-"+r+"-anchor-"+i);n.add("mapboxgl-"+r+"-anchor-"+t)}var Hi,Gi=function(t){function n(n,i){if(t.call(this),(n instanceof e.window.HTMLElement||i)&&(n=e.extend({element:n},i)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=e.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var a=r.createNS("http://www.w3.org/2000/svg","svg");a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height","41px"),a.setAttributeNS(null,"width","27px"),a.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");var l=r.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{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"}];c<u.length;c+=1){var h=u[c],p=r.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",h.rx),p.setAttributeNS(null,"ry",h.ry),l.appendChild(p)}var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"fill",this._color);var f=r.createNS("http://www.w3.org/2000/svg","path");f.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"),d.appendChild(f);var m=r.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"opacity","0.25"),m.setAttributeNS(null,"fill","#000000");var g=r.createNS("http://www.w3.org/2000/svg","path");g.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"),m.appendChild(g);var y=r.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(6.0, 7.0)"),y.setAttributeNS(null,"fill","#FFFFFF");var v=r.createNS("http://www.w3.org/2000/svg","g");v.setAttributeNS(null,"transform","translate(8.0, 8.0)");var x=r.createNS("http://www.w3.org/2000/svg","circle");x.setAttributeNS(null,"fill","#000000"),x.setAttributeNS(null,"opacity","0.25"),x.setAttributeNS(null,"cx","5.5"),x.setAttributeNS(null,"cy","5.5"),x.setAttributeNS(null,"r","5.4999962");var b=r.createNS("http://www.w3.org/2000/svg","circle");b.setAttributeNS(null,"fill","#FFFFFF"),b.setAttributeNS(null,"cx","5.5"),b.setAttributeNS(null,"cy","5.5"),b.setAttributeNS(null,"r","5.4999962"),v.appendChild(x),v.appendChild(b),s.appendChild(l),s.appendChild(d),s.appendChild(m),s.appendChild(y),s.appendChild(v),a.appendChild(s),a.setAttributeNS(null,"height",41*this._scale+"px"),a.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(a),this._offset=e.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(e){e.preventDefault()})),this._element.addEventListener("mousedown",(function(e){e.preventDefault()})),qi(this._element,this._anchor,"marker"),this._popup=null}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){var t=13.5,r=Math.sqrt(Math.pow(t,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[r,-1*(24.6+r)],"bottom-right":[-r,-1*(24.6+r)],left:[t,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(e){var t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},n.prototype._onMapClick=function(e){var t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this},n.prototype._update=function(e){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Ui(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var t="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?t="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(t="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),e&&"moveend"!==e.type||(this._pos=this._pos.round()),r.setTransform(this._element,Vi[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+t)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(t){return this._offset=e.Point.convert(t),this._update(),this},n.prototype._onMove=function(t){if(!this._isDragging){var r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.Event("dragstart"))),this.fire(new e.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(e){return this._rotation=e||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(e){return this._rotationAlignment=e||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(e.Evented),Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},$i=0,Zi=!1,Xi=function(t){function n(r){t.call(this),this.options=e.extend({},Wi,r),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.onAdd=function(t){var n;return this._map=t,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Hi?n(Hi):void 0!==e.window.navigator.permissions?e.window.navigator.permissions.query({name:"geolocation"}).then((function(e){Hi="denied"!==e.state,n(Hi)})):(Hi=!!e.window.navigator.geolocation,n(Hi)),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,$i=0,Zi=!1},n.prototype._isOutOfMapMaxBounds=function(e){var t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}},n.prototype._updateCamera=function(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,i=this._map.getBearing(),a=e.extend({bearing:i},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(n),a,{geolocateSource:!0})},n.prototype._updateMarker=function(t){if(t){var r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),n=t.distanceTo(r),i=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=i+"px",this._circleElement.style.height=i+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new e.Event("error",t)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(t){var n=this;if(this._container.addEventListener("contextmenu",(function(e){return e.preventDefault()})),this._geolocateButton=r.create("button","mapboxgl-ctrl-geolocate",this._container),r.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)}else{var a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Gi(this._dotElement),this._circleElement=r.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(t){var r=t.originalEvent&&"resize"===t.originalEvent.type;t.geolocateSource||"ACTIVE_LOCK"!==n._watchState||r||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new e.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return e.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$i--,Zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var t;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++$i>1?(t={maximumAge:6e5,timeout:0},Zi=!0):(t=this.options.positionOptions,Zi=!1),this._geolocationWatchID=e.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else e.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){e.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(e.Evented),Yi={maxWidth:100,unit:"metric"},Ki=function(t){this.options=e.extend({},Yi,t),e.bindAll(["_onMove","setUnit"],this)};function Ji(e,t,r){var n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){var l=3.2808*s;l>5280?Qi(t,n,l/5280,e._getUIString("ScaleControl.Miles")):Qi(t,n,l,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Qi(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Qi(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Qi(t,n,s,e._getUIString("ScaleControl.Meters"))}function Qi(e,t,r,n){var i=function(e){var t=Math.pow(10,(""+Math.floor(e)).length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){var t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r),a=i/r;e.style.width=t*a+"px",e.innerHTML=i+"&nbsp;"+n}Ki.prototype.getDefaultPosition=function(){return"bottom-left"},Ki.prototype._onMove=function(){Ji(this._map,this._container,this.options)},Ki.prototype.onAdd=function(e){return this._map=e,this._container=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ki.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ki.prototype.setUnit=function(e){this.options.unit=e,Ji(this._map,this._container,this.options)};var ea=function(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof e.window.HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in e.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in e.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in e.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in e.window.document&&(this._fullscreenchange="MSFullscreenChange")};ea.prototype.onAdd=function(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},ea.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,e.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},ea.prototype._checkFullscreenSupport=function(){return!!(e.window.document.fullscreenEnabled||e.window.document.mozFullScreenEnabled||e.window.document.msFullscreenEnabled||e.window.document.webkitFullscreenEnabled)},ea.prototype._setupUI=function(){var t=this._fullscreenButton=r.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","mapboxgl-ctrl-icon",t).setAttribute("aria-hidden",!0),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),e.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},ea.prototype._updateTitle=function(){var e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e},ea.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},ea.prototype._isFullscreen=function(){return this._fullscreen},ea.prototype._changeIcon=function(){(e.window.document.fullscreenElement||e.window.document.mozFullScreenElement||e.window.document.webkitFullscreenElement||e.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},ea.prototype._onClickFullscreen=function(){this._isFullscreen()?e.window.document.exitFullscreen?e.window.document.exitFullscreen():e.window.document.mozCancelFullScreen?e.window.document.mozCancelFullScreen():e.window.document.msExitFullscreen?e.window.document.msExitFullscreen():e.window.document.webkitCancelFullScreen&&e.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ta={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ra=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=function(t){function n(r){t.call(this),this.options=e.extend(Object.create(ta),r),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return t&&(n.__proto__=t),n.prototype=Object.create(t&&t.prototype),n.prototype.constructor=n,n.prototype.addTo=function(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new e.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new e.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(t){return this.setDOMContent(e.window.document.createTextNode(t))},n.prototype.setHTML=function(t){var r,n=e.window.document.createDocumentFragment(),i=e.window.document.createElement("body");for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(e){return this.options.maxWidth=e,this._update(),this},n.prototype.setDOMContent=function(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(e){this._container&&this._container.classList.add(e)},n.prototype.removeClassName=function(e){this._container&&this._container.classList.remove(e)},n.prototype.setOffset=function(e){return this.options.offset=e,this._update(),this},n.prototype.toggleClassName=function(e){if(this._container)return this._container.classList.toggle(e)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(e){this._update(e.point)},n.prototype._onMouseMove=function(e){this._update(e.point)},n.prototype._onDrag=function(e){this._update(e.point)},n.prototype._update=function(e){var t=this,n=this._lngLat||this._trackPointer;if(this._map&&n&&this._content&&(this._container||(this._container=r.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(e){return t._container.classList.add(e)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ui(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),a=this.options.anchor,o=ia(this.options.offset);if(!a){var s,l=this._container.offsetWidth,c=this._container.offsetHeight;s=i.y+o.bottom.y<c?["top"]:i.y>this._map.transform.height-c?["bottom"]:[],i.x<l/2?s.push("left"):i.x>this._map.transform.width-l/2&&s.push("right"),a=0===s.length?"bottom":s.join("-")}var u=i.add(o[a]).round();r.setTransform(this._container,Vi[a]+" translate("+u.x+"px,"+u.y+"px)"),qi(this._container,a,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var e=this._container.querySelector(ra);e&&e.focus()}},n.prototype._onClose=function(){this.remove()},n}(e.Evented);function ia(t){if(t){if("number"===typeof t){var r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.Point(0,0),top:new e.Point(0,t),"top-left":new e.Point(r,r),"top-right":new e.Point(-r,r),bottom:new e.Point(0,-t),"bottom-left":new e.Point(r,-r),"bottom-right":new e.Point(-r,-r),left:new e.Point(t,0),right:new e.Point(-t,0)}}if(t instanceof e.Point||Array.isArray(t)){var n=e.Point.convert(t);return{center:n,top:n,"top-left":n,"top-right":n,bottom:n,"bottom-left":n,"bottom-right":n,left:n,right:n}}return{center:e.Point.convert(t.center||[0,0]),top:e.Point.convert(t.top||[0,0]),"top-left":e.Point.convert(t["top-left"]||[0,0]),"top-right":e.Point.convert(t["top-right"]||[0,0]),bottom:e.Point.convert(t.bottom||[0,0]),"bottom-left":e.Point.convert(t["bottom-left"]||[0,0]),"bottom-right":e.Point.convert(t["bottom-right"]||[0,0]),left:e.Point.convert(t.left||[0,0]),right:e.Point.convert(t.right||[0,0])}}return ia(new e.Point(0,0))}var aa={version:e.version,supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:Di,NavigationControl:Bi,GeolocateControl:Xi,AttributionControl:Mi,ScaleControl:Ki,FullscreenControl:ea,Popup:na,Marker:Gi,Style:$t,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.Point,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,config:e.config,prewarm:function(){Ne().acquire(De)},clearPrewarmedResources:function(){var e=Fe;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(De),Fe=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return e.config.ACCESS_TOKEN},set accessToken(t){e.config.ACCESS_TOKEN=t},get baseApiUrl(){return e.config.API_URL},set baseApiUrl(t){e.config.API_URL=t},get workerCount(){return je.workerCount},set workerCount(e){je.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage:function(t){e.clearTileCache(t)},workerUrl:""};return aa})),r},"object"===typeof e&&"undefined"!==typeof t?t.exports=n():(r=r||self).mapboxgl=n()}}),wb=p({"src/plots/mapbox/layers.js"(e,t){var r=st(),n=At().sanitizeHTML,i=mb(),a=cb();function o(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n<t.length;n++)if("string"!==typeof t[n]||0===t[n].length)return!1;return!0}return r.isPlainObject(t)||"string"===typeof t&&t.length>0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(t,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapboxLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapboxLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if("string"===typeof n&&0===n.indexOf(a.traceLayerPrefix)){e=n;break}}return e},s.updateLayer=function(e){var t=this.subplot,r=c(e),n=this.lookupBelow(),i=this.findFollowingMapboxLayerId(n);this.removeLayer(),l(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=e.type,this.below=n},s.updateStyle=function(e){if(l(e)){var t=c(e);this.subplot.setOptions(this.idLayer,"setLayoutProperty",t.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",t.paint)}},s.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)},s.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)},t.exports=function(e,t,r){var n=new o(e,t);return n.update(r),n}}}),kb=p({"src/plots/mapbox/mapbox.js"(e,t){var r=_b(),n=st(),i=og(),a=Ve(),o=nr(),s=hr(),l=zr(),c=Or(),u=c.drawMode,h=c.selectMode,p=Mn().prepSelect,d=Mn().clearOutline,f=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=cb(),y=wb();function v(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.accessToken=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(e,t,r){var n,i=this,a=t[i.id];i.map&&a.accesstoken!==i.accessToken&&(i.map.remove(),i.map=null,i.styleObj=null,i.traceHash={},i.layerList=[]),n=i.map?new Promise((function(r,n){i.updateMap(e,t,r,n)})):new Promise((function(r,n){i.createMap(e,t,r,n)})),r.push(n)},x.createMap=function(e,t,n,a){var o=this,s=t[o.id],l=o.styleObj=_(s.style,t);o.accessToken=s.accesstoken;var c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:k(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0}));h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(e,t);var p=[];p.push(new Promise((function(e){h.once("load",e)}))),p=p.concat(i.fetchTraceGeoData(e)),Promise.all(p).then((function(){o.fillBelowLookup(e,t),o.updateData(e),o.updateLayout(t),o.resolveOnRender(n)})).catch(a)},x.updateMap=function(e,t,r,n){var a=this,o=a.map,s=t[this.id];a.rejectOnError(n);var l=[],c=_(s.style,t);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(e){o.once("styledata",e)})))),l=l.concat(i.fetchTraceGeoData(e)),Promise.all(l).then((function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(e,t){var r,n,i=t[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,l=s._module;"string"===typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"===typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,p={};for(u in a)p[n=a[u]]?p[n].push(u):p[n]=[u];for(n in p){var d=p[n];if(d.length>1)for(r=0;r<d.length;r++)0===(u=d[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var b={choroplethmapbox:0,densitymapbox:1,scattermapbox:2};function _(e,t){var r={};if(n.isPlainObject(e))r.id=e.id,r.style=e;else if("string"===typeof e)if(r.id=e,-1!==g.styleValuesMapbox.indexOf(e))r.style=w(e);else if(g.stylesNonMapbox[e]){r.style=g.stylesNonMapbox[e];var i=r.style.sources["plotly-"+e],a=i?i.tiles:void 0;a&&a[0]&&"?api_key="===a[0].slice(-9)&&(a[0]+=t._mapboxAccessToken)}else r.style=e;else r.id=g.styleValueDflt,r.style=w(g.styleValueDflt);return r.transition={duration:0,delay:0},r}function w(e){return g.styleUrlPrefix+e+"-"+g.styleUrlSuffix}function k(e){return[e.lon,e.lat]}x.updateData=function(e){var t,r,n,i,a=this.traceHash,o=e.slice().sort((function(e,t){return b[e[0].trace.type]-b[t[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(t=a[(r=s[0].trace).uid])&&(t.type===r.type?(t.update(s),l=!0):t.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);e:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<e.length;i++)if(u===(r=e[i][0].trace).uid)continue e;(t=a[u]).dispose(),delete a[u]}},x.updateLayout=function(e){var t=this.map,r=e[this.id];this.dragging||this.wheeling||(t.setCenter(k(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.mapbox?t.scrollZoom.enable():t.scrollZoom.disable()},x.resolveOnRender=function(e){var t=this.map;t.on("render",(function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))}))},x.rejectOnError=function(e){var t=this.map;function r(){e(new Error(g.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)},x.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),t.xaxis={_id:"x",c2p:function(e){return t.project(e).x}},t.yaxis={_id:"y",c2p:function(e){return t.project(e).y}},t.updateFramework(e),t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(t.mockAxis,e)},x.initFx=function(e,t){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(t._hoverlayer)}function s(){var e=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}i.on("moveend",(function(e){if(r.map){var t=n._fullLayout;if(e.originalEvent||r.wheeling){var i=t[r.id];a.call("_storeDirectGUIEdit",n.layout,t._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t._rehover&&t._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(e){var t=r.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,e,r.id)},l.hover(n,e,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var e=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;i.setCenter(k(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=r.getView();e._input.center=e.center=o.center,e._input.zoom=e.zoom=o.zoom,e._input.bearing=e.bearing=o.bearing,e._input.pitch=e.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){f(r.dragOptions),d(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(y(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(e,t){var r=this.map;if("string"===typeof t){if(""===t)return void r.addLayer(e,t);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id)return void r.addLayer(e,t);n.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)},x.project=function(e){return this.map.project(new r.LngLat(e[0],e[1]))},x.getView=function(){var e=this.map,t=e.getCenter(),r={lon:t.lng,lat:t.lat},n=e.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([i,0]).toArray(),e.unproject([i,a]).toArray(),e.unproject([0,a]).toArray()]}}},x.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[t+"."+a]=e[a]}return n},x.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r},t.exports=v}}),Tb=p({"src/plots/mapbox/layout_defaults.js"(e,t){var r=st(),n=qs(),i=Ft(),a=ub();function o(e,t,r,n){r("accesstoken",n.accessToken),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var a=r("bounds.west"),o=r("bounds.east"),l=r("bounds.south"),c=r("bounds.north");void 0!==a&&void 0!==o&&void 0!==l&&void 0!==c||delete t.bounds,i(e,t,{name:"layers",handleItemDefaults:s}),t._input=e}function s(e,t){function n(n,i){return r.coerce(e,t,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=t.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}t.exports=function(e,t,r){n(e,t,r,{type:"mapbox",attributes:a,handleDefaults:o,partition:"y",accessToken:t._mapboxAccessToken})}}}),Sb=p({"src/plots/mapbox/index.js"(e){var t=_b(),r=st(),n=r.strTranslate,i=r.strScale,a=_t().getSubplotCalcData,o=Tt(),s=v(),l=Jt(),c=At(),u=kb(),h="mapbox",p=e.constants=cb();e.name=h,e.attr="subplot",e.idRoot=h,e.idRegex=e.attrRegex=r.counterRegex(h);var d=["mapbox subplots and traces are deprecated!","Please consider switching to `map` subplots and traces.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" ");e.attributes={subplot:{valType:"subplotid",dflt:"mapbox",editType:"calc"}},e.layoutAttributes=ub(),e.supplyLayoutDefaults=Tb();var f=!0;function m(e){return"string"===typeof e&&(-1!==p.styleValuesMapbox.indexOf(e)||0===e.indexOf("mapbox://")||0===e.indexOf("stamen"))}e.plot=function(e){f&&(f=!1,r.warn(d));var n=e._fullLayout,i=e.calcdata,o=n._subplots[h];if(t.version!==p.requiredVersion)throw new Error(p.wrongVersionErrorMsg);var s=function(e,t){var n=e._fullLayout,i=e._context;if(""===i.mapboxAccessToken)return"";for(var a=[],o=[],s=!1,l=!1,c=0;c<t.length;c++){var u=n[t[c]],h=u.accesstoken;m(u.style)&&(h?r.pushUnique(a,h):(m(u._input.style)&&(r.error("Uses Mapbox map style, but did not set an access token."),s=!0),l=!0)),h&&r.pushUnique(o,h)}if(l){var d=s?p.noAccessTokenErrorMsg:p.missingStyleErrorMsg;throw r.error(d),new Error(d)}return a.length?(a.length>1&&r.warn(p.multipleTokensErrorMsg),a[0]):(o.length&&r.log(["Listed mapbox access token(s)",o.join(","),"but did not use a Mapbox map style, ignoring token(s)."].join(" ")),"")}(e,o);t.accessToken=s;for(var l=0;l<o.length;l++){var c=o[l],g=a(i,h,c),y=n[c],v=y._subplot;v||(v=new u(e,c),n[c]._subplot=v),v.viewInitial||(v.viewInitial={center:r.extendFlat({},y.center),zoom:y.zoom,bearing:y.bearing,pitch:y.pitch}),v.plot(g,n,e._promises)}},e.clean=function(e,t,r,n){for(var i=n._subplots[h]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,r=t._subplots[h],a=t._size,u=0;u<r.length;u++){var d=t[r[u]],f=d.domain,m=d._subplot.toImage("png");t._glimages.append("svg:image").attr({xmlns:o.svg,"xlink:href":m,x:a.l+a.w*f.x[0],y:a.t+a.h*(1-f.y[1]),width:a.w*(f.x[1]-f.x[0]),height:a.h*(f.y[1]-f.y[0]),preserveAspectRatio:"none"});var g=s.select(d._subplot.div);if(null!==g.select(".mapboxgl-ctrl-logo").node().offsetParent){var y=t._glimages.append("g");y.attr("transform",n(a.l+a.w*f.x[0]+10,a.t+a.h*(1-f.y[0])-31)),y.append("path").attr("d",p.mapboxLogo.path0).style({opacity:.9,fill:"#ffffff","enable-background":"new"}),y.append("path").attr("d",p.mapboxLogo.path1).style("opacity",.35).style("enable-background","new"),y.append("path").attr("d",p.mapboxLogo.path2).style("opacity",.35).style("enable-background","new"),y.append("polygon").attr("points",p.mapboxLogo.polygon).style({opacity:.9,fill:"#ffffff","enable-background":"new"})}var v=g.select(".mapboxgl-ctrl-attrib").text().replace("Improve this map",""),x=t._glimages.append("g"),b=x.append("text");b.text(v).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":v});var _=l.bBox(b.node()),w=a.w*(f.x[1]-f.x[0]);if(_.width>w/2){var k=v.split("|").join("<br>");b.text(k).attr("data-unformatted",k).call(c.convertToTspans,e),_=l.bBox(b.node())}b.attr("transform",n(-3,8-_.height)),x.insert("rect",".static-attribution").attr({x:-_.width-6,y:-_.height-3,width:_.width+6,height:_.height+3,fill:"rgba(255, 255, 255, 0.75)"});var T=1;_.width+6>w&&(T=w/(_.width+6));var S=[a.l+a.w*f.x[1],a.t+a.h*(1-f.y[0])];x.attr("transform",n(S[0],S[1])+i(T))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[h],n=0;n<r.length;n++)t[r[n]]._subplot.updateFx(t)}}}),Ab=p({"src/traces/scattermapbox/index.js"(e,t){["*scattermapbox* trace is deprecated!","Please consider switching to the *scattermap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),t.exports={attributes:hb(),supplyDefaults:db(),colorbar:pi(),formatLabels:fb(),calc:Xm(),plot:yb(),hoverPoints:vb().hoverPoints,eventData:xb(),selectPoints:bb(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermapbox",basePlotModule:Sb(),categories:["mapbox","gl","symbols","showLegend","scatter-like"],meta:{}}}}),Mb=p({"lib/scattermapbox.js"(e,t){t.exports=Ab()}}),Eb=p({"src/traces/choroplethmapbox/attributes.js"(e,t){var r=wg(),n=Lt(),i=Oe().hovertemplateAttrs,a=N(),o=R().extendFlat;t.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),Cb=p({"src/traces/choroplethmapbox/defaults.js"(e,t){var r=st(),n=Vt(),i=Eb();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"===typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),t._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(e,t,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,s)):t.visible=!1}}}),Pb=p({"src/traces/choroplethmapbox/convert.js"(e,t){var r=k(),n=st(),i=Wt(),a=Jt(),o=Qm().makeBlank,s=og();function l(e){var t,r=e[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<e.length;s++){var l=e[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}t={type:"identity",property:"mo2"}}else t=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":t}),n.extendFlat(i.line.paint,{"line-opacity":t}),i}t.exports={convert:function(e){var t=e[0].trace,a=!0===t.visible&&0!==t._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=t._opts={fill:c,line:u,geojson:o()};if(!a)return h;var p=s.extractTraceFeature(e);if(!p)return h;var d,f,m,g=i.makeColorScaleFuncFromTrace(t),y=t.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(d=function(e){var t=e.mo;return r(t)?+n.constrain(t,0,1):0}),n.isArrayOrTypedArray(v.color)&&(f=function(e){return e.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(e){return e.mlw});for(var x=0;x<e.length;x++){var b=e[x],_=b.fOut;if(_){var w=_.properties;w.fc=g(b.z),d&&(w.mo=d(b)),f&&(w.mlc=f(b)),m&&(w.mlw=m(b)),b.ct=w.ct,b._polygons=s.feature2polygons(_)}}var k=d?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),n.extendFlat(u.paint,{"line-color":f?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:p},l(e),h},convertOnSelect:l}}}),Lb=p({"src/traces/choroplethmapbox/plot.js"(e,t){var r=Pb().convert,n=Pb().convertOnSelect,i=cb().traceLayerPrefix;function a(e,t){this.type="choroplethmapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["fill",i+t+"-fill"],["line",i+t+"-line"]],this.below=null}var o=a.prototype;o.update=function(e){this._update(r(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(n(e))},o._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&t.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),Ib=p({"src/traces/choroplethmapbox/index.js"(e,t){["*choroplethmapbox* trace is deprecated!","Please consider switching to the *choroplethmap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),t.exports={attributes:Eb(),supplyDefaults:Cb(),colorbar:No(),calc:Tg(),plot:Lb(),hoverPoints:Mg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"===typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmapbox",basePlotModule:Sb(),categories:["mapbox","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_mapbox"}}}}),zb=p({"lib/choroplethmapbox.js"(e,t){t.exports=Ib()}}),Ob=p({"src/traces/densitymapbox/attributes.js"(e,t){var r=Lt(),n=Oe().hovertemplateAttrs,i=N(),a=hb(),o=R().extendFlat;t.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),Rb=p({"src/traces/densitymapbox/defaults.js"(e,t){var r=st(),n=Vt(),i=Ob();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(t._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}}}),Db=p({"src/traces/densitymapbox/calc.js"(e,t){var r=k(),n=st().isArrayOrTypedArray,i=T().BADNUM,a=Gt(),o=st()._;t.exports=function(e,t){for(var s=t._length,l=new Array(s),c=t.z,u=n(c)&&c.length,h=0;h<s;h++){var p=l[h]={},d=t.lon[h],f=t.lat[h];if(p.lonlat=r(d)&&r(f)?[+d,+f]:[i,i],u){var m=c[h];p.z=r(m)?m:i}}return a(e,t,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(e,"lat:")+" ",lon:o(e,"lon:")+" "}}),l}}}),jb=p({"src/traces/densitymapbox/convert.js"(e,t){var r=k(),n=st(),i=q(),a=Wt(),o=T().BADNUM,s=Qm().makeBlank;t.exports=function(e){var t=e[0].trace,l=!0===t.visible&&0!==t._length,c=t._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],p=t.z,d=t.radius,f=n.isArrayOrTypedArray(p)&&p.length,m=n.isArrayOrTypedArray(d);for(u=0;u<e.length;u++){var g=e[u],y=g.lonlat;if(y[0]!==o){var v={};if(f){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(d[u])&&d[u]>0?+d[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(t),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),Fb=p({"src/traces/densitymapbox/plot.js"(e,t){var r=jb(),n=cb().traceLayerPrefix;function i(e,t){this.type="densitymapbox",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];t.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&t.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),Bb=p({"src/traces/densitymapbox/hover.js"(e,t){var r=nr(),n=vb().hoverPoints,i=vb().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),Nb=p({"src/traces/densitymapbox/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),Ub=p({"src/traces/densitymapbox/index.js"(e,t){["*densitymapbox* trace is deprecated!","Please consider switching to the *densitymap* trace type and `map` subplots.","Learn more at: https://plotly.com/python/maplibre-migration/","as well as https://plotly.com/javascript/maplibre-migration/"].join(" "),t.exports={attributes:Ob(),supplyDefaults:Rb(),colorbar:No(),formatLabels:fb(),calc:Db(),plot:Fb(),hoverPoints:Bb(),eventData:Nb(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"===typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymapbox",basePlotModule:Sb(),categories:["mapbox","gl","showLegend"],meta:{hr_name:"density_mapbox"}}}}),Vb=p({"lib/densitymapbox.js"(e,t){t.exports=Ub()}}),qb=p({"src/plots/map/styles/arcgis-sat-hybrid.js"(e,t){t.exports={version:8,name:"orto",metadata:{"maputnik:renderer":"mlgljs"},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}},{id:"waterway_tunnel",type:"line",source:"openmaptiles","source-layer":"waterway",minzoom:14,filter:["all",["in","class","river","stream","canal"],["==","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]},"line-dasharray":[2,4]}},{id:"waterway-other",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["!in","class","canal","river","stream"],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,2]]}}},{id:"waterway-stream-canal",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["in","class","canal","stream"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.3,stops:[[13,.5],[20,6]]}}},{id:"waterway-river",type:"line",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"waterway",filter:["all",["==","class","river"],["!=","brunnel","tunnel"]],layout:{"line-cap":"round"},paint:{"line-color":"#a0c8f0","line-width":{base:1.2,stops:[[10,.8],[20,4]]},"line-opacity":.5}},{id:"water-offset",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",maxzoom:8,filter:["==","$type","Polygon"],layout:{visibility:"visible"},paint:{"fill-opacity":0,"fill-color":"#a0c8f0","fill-translate":{base:1,stops:[[6,[2,0]],[8,[0,0]]]}}},{id:"water",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-color":"hsl(210, 67%, 85%)","fill-opacity":0}},{id:"water-pattern",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"water",layout:{visibility:"visible"},paint:{"fill-translate":[0,2.5],"fill-pattern":"wave","fill-opacity":1}},{id:"landcover-ice-shelf",type:"fill",metadata:{"mapbox:group":"1444849382550.77"},source:"openmaptiles","source-layer":"landcover",filter:["==","subclass","ice_shelf"],layout:{visibility:"visible"},paint:{"fill-color":"#fff","fill-opacity":{base:1,stops:[[0,.9],[10,.3]]}}},{id:"tunnel-service-track-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[15,1],[16,4],[20,11]]}}},{id:"tunnel-minor-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor"]],layout:{"line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,1]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"tunnel-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"tunnel-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.7}},{id:"tunnel-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-dasharray":[.5,.25],"line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"tunnel-path",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"tunnel-service-track",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","service","track"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-width":{base:1.2,stops:[[15.5,0],[16,2],[20,7.5]]}}},{id:"tunnel-minor",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","minor_road"]],layout:{"line-join":"round"},paint:{"line-color":"#fff","line-opacity":1,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"tunnel-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,10]]}}},{id:"tunnel-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fff4c6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-motorway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","motorway"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"#ffdaa6","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"tunnel-railway",type:"line",metadata:{"mapbox:group":"1444849354174.1904"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","tunnel"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]},"line-dasharray":[2,2]}},{id:"ferry",type:"line",source:"openmaptiles","source-layer":"transportation",filter:["all",["in","class","ferry"]],layout:{"line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(108, 159, 182, 1)","line-width":1.1,"line-dasharray":[2,2]}},{id:"aeroway-taxiway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","taxiway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,2],[17,12]]},"line-opacity":1}},{id:"aeroway-runway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:12,filter:["all",["in","class","runway"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(153, 153, 153, 1)","line-width":{base:1.5,stops:[[11,5],[17,55]]},"line-opacity":1}},{id:"aeroway-taxiway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","taxiway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,1],[17,10]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"aeroway-runway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"aeroway",minzoom:4,filter:["all",["in","class","runway"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"rgba(255, 255, 255, 1)","line-width":{base:1.5,stops:[[11,4],[17,50]]},"line-opacity":{base:1,stops:[[11,0],[12,1]]}}},{id:"highway-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-link-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"highway-minor-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#cfcdca","line-opacity":{stops:[[12,0],[12.5,0]]},"line-width":{base:1.2,stops:[[12,.5],[13,1],[14,4],[20,15]]}}},{id:"highway-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":.5,"line-width":{base:1.2,stops:[[8,1.5],[20,17]]}}},{id:"highway-primary-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[7,0],[8,.6]]},"line-width":{base:1.2,stops:[[7,0],[8,.6],[9,1.5],[20,22]]}}},{id:"highway-trunk-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-opacity":{stops:[[5,0],[6,.5]]},"line-width":{base:1.2,stops:[[5,0],[6,.6],[7,1.5],[20,22]]}}},{id:"highway-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:4,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]],layout:{"line-cap":"butt","line-join":"round",visibility:"visible"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[4,0],[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":{stops:[[4,0],[5,.5]]}}},{id:"highway-path",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","path"]]],paint:{"line-color":"#cba","line-dasharray":[1.5,.75],"line-width":{base:1.2,stops:[[15,1.2],[20,4]]}}},{id:"highway-motorway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:12,filter:["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway_link"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-link",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"highway-minor",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!=","brunnel","tunnel"],["in","class","minor","service","track"]]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fff","line-opacity":.5,"line-width":{base:1.2,stops:[[13.5,0],[14,2.5],[20,11.5]]}}},{id:"highway-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["!in","brunnel","bridge","tunnel"],["in","class","secondary","tertiary"]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[8,.5],[20,13]]},"line-opacity":.5}},{id:"highway-primary",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","primary"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[8.5,0],[9,.5],[20,18]]},"line-opacity":0}},{id:"highway-trunk",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["in","class","trunk"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"highway-motorway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",minzoom:5,filter:["all",["==","$type","LineString"],["all",["!in","brunnel","bridge","tunnel"],["==","class","motorway"]]],layout:{"line-cap":"round","line-join":"round",visibility:"visible"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"railway-transit",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-transit-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","transit"],["!in","brunnel","tunnel"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway-service",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],paint:{"line-color":"hsla(0, 0%, 73%, 0.77)","line-width":{base:1.4,stops:[[14,.4],[20,1]]}}},{id:"railway-service-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","class","rail"],["has","service"]]],layout:{visibility:"visible"},paint:{"line-color":"hsla(0, 0%, 73%, 0.68)","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,2],[20,6]]}}},{id:"railway",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"railway-hatching",type:"line",metadata:{"mapbox:group":"1444849345966.4436"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["!has","service"],["!in","brunnel","bridge","tunnel"],["==","class","rail"]]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"bridge-motorway-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-link-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[12,1],[13,3],[14,4],[20,15]]}}},{id:"bridge-secondary-tertiary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-opacity":1,"line-width":{base:1.2,stops:[[8,1.5],[20,28]]}}},{id:"bridge-trunk-primary-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"hsl(28, 76%, 67%)","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,26]]}}},{id:"bridge-motorway-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#e9ac77","line-width":{base:1.2,stops:[[5,.4],[6,.6],[7,1.5],[20,22]]},"line-opacity":.5}},{id:"bridge-path-casing",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#f8f4f0","line-width":{base:1.2,stops:[[15,1.2],[20,18]]}}},{id:"bridge-path",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","$type","LineString"],["all",["==","brunnel","bridge"],["==","class","path"]]],paint:{"line-color":"#cba","line-width":{base:1.2,stops:[[15,1.2],[20,4]]},"line-dasharray":[1.5,.75]}},{id:"bridge-motorway-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-link",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary_link","secondary_link","tertiary_link","trunk_link"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[12.5,0],[13,1.5],[14,2.5],[20,11.5]]}}},{id:"bridge-secondary-tertiary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","secondary","tertiary"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,20]]}}},{id:"bridge-trunk-primary",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["in","class","primary","trunk"]],layout:{"line-join":"round"},paint:{"line-color":"#fea","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]}}},{id:"bridge-motorway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","motorway"]],layout:{"line-join":"round"},paint:{"line-color":"#fc8","line-width":{base:1.2,stops:[[6.5,0],[7,.5],[20,18]]},"line-opacity":.5}},{id:"bridge-railway",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-width":{base:1.4,stops:[[14,.4],[15,.75],[20,2]]}}},{id:"bridge-railway-hatching",type:"line",metadata:{"mapbox:group":"1444849334699.1902"},source:"openmaptiles","source-layer":"transportation",filter:["all",["==","brunnel","bridge"],["==","class","rail"]],paint:{"line-color":"#bbb","line-dasharray":[.2,8],"line-width":{base:1.4,stops:[[14.5,0],[15,3],[20,8]]}}},{id:"cablecar",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,1],[19,2.5]]}}},{id:"cablecar-dash",type:"line",source:"openmaptiles","source-layer":"transportation",minzoom:13,filter:["==","class","cable_car"],layout:{visibility:"visible","line-cap":"round"},paint:{"line-color":"hsl(0, 0%, 70%)","line-width":{base:1,stops:[[11,3],[19,5.5]]},"line-dasharray":[2,3]}},{id:"boundary-land-level-4",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",[">=","admin_level",4],["<=","admin_level",8],["!=","maritime",1]],layout:{"line-join":"round"},paint:{"line-color":"#9e9cab","line-dasharray":[3,1,1,1],"line-width":{base:1.4,stops:[[4,.4],[5,1],[12,3]]},"line-opacity":.6}},{id:"boundary-land-level-2",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["==","admin_level",2],["!=","maritime",1],["!=","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 66%)","line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,2]]}}},{id:"boundary-land-disputed",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["!=","maritime",1],["==","disputed",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"hsl(248, 7%, 70%)","line-dasharray":[1,3],"line-width":{base:1,stops:[[0,.6],[4,1.4],[5,2],[12,8]]}}},{id:"boundary-water",type:"line",source:"openmaptiles","source-layer":"boundary",filter:["all",["in","admin_level",2,4],["==","maritime",1]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"rgba(154, 189, 214, 1)","line-width":{base:1,stops:[[0,.6],[4,1],[5,1],[12,1]]},"line-opacity":{stops:[[6,0],[10,0]]}}},{id:"waterway-name",type:"symbol",source:"openmaptiles","source-layer":"waterway",minzoom:13,filter:["all",["==","$type","LineString"],["has","name"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin} {name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","text-letter-spacing":.2,"symbol-spacing":350},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-lakeline",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["==","$type","LineString"],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"line","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-ocean",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["==","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":14,"text-field":"{name:latin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"water-name-other",type:"symbol",source:"openmaptiles","source-layer":"water_name",filter:["all",["==","$type","Point"],["!in","class","ocean"]],layout:{"text-font":["Noto Sans Italic"],"text-size":{stops:[[0,10],[6,14]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":5,"text-rotation-alignment":"map","symbol-placement":"point","symbol-spacing":350,"text-letter-spacing":.2,visibility:"visible"},paint:{"text-color":"#74aee9","text-halo-width":1.5,"text-halo-color":"rgba(255,255,255,0.7)"}},{id:"poi-level-3",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:16,filter:["all",["==","$type","Point"],[">=","rank",25]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-2",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:15,filter:["all",["==","$type","Point"],["<=","rank",24],[">=","rank",15]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"poi-level-1",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:14,filter:["all",["==","$type","Point"],["<=","rank",14],["has","name"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":11,"text-max-width":9},paint:{"text-halo-blur":.5,"text-color":"rgba(191, 228, 172, 1)","text-halo-width":1,"text-halo-color":"rgba(30, 29, 29, 1)"}},{id:"poi-railway",type:"symbol",source:"openmaptiles","source-layer":"poi",minzoom:13,filter:["all",["==","$type","Point"],["has","name"],["==","class","railway"],["==","subclass","station"]],layout:{"text-padding":2,"text-font":["Noto Sans Regular"],"text-anchor":"top","icon-image":"{class}_11","text-field":"{name:latin}\n{name:nonlatin}","text-offset":[0,.6],"text-size":12,"text-max-width":9,"icon-optional":!1,"icon-ignore-placement":!1,"icon-allow-overlap":!1,"text-ignore-placement":!1,"text-allow-overlap":!1,"text-optional":!0},paint:{"text-halo-blur":.5,"text-color":"#666","text-halo-width":1,"text-halo-color":"#ffffff"}},{id:"road_oneway",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"road_oneway_opposite",type:"symbol",source:"openmaptiles","source-layer":"transportation",minzoom:15,filter:["all",["==","oneway",-1],["in","class","motorway","trunk","primary","secondary","tertiary","minor","service"]],layout:{"symbol-placement":"line","icon-image":"oneway","symbol-spacing":75,"icon-padding":2,"icon-rotation-alignment":"map","icon-rotate":-90,"icon-size":{stops:[[15,.5],[19,1]]}},paint:{"icon-opacity":.5}},{id:"highway-name-path",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15.5,filter:["==","class","path"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-color":"#f8f4f0","text-color":"hsl(30, 23%, 62%)","text-halo-width":.5}},{id:"highway-name-minor",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:15,filter:["all",["==","$type","LineString"],["in","class","minor","service","track"]],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-name-major",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:12.2,filter:["in","class","primary","secondary","tertiary","trunk"],layout:{"text-size":{base:1,stops:[[13,12],[14,13]]},"text-font":["Noto Sans Regular"],"text-field":"{name:latin} {name:nonlatin}","symbol-placement":"line","text-rotation-alignment":"map"},paint:{"text-halo-blur":.5,"text-color":"#765","text-halo-width":1}},{id:"highway-shield",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:8,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["!in","network","us-interstate","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"road_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-opacity":1,"text-color":"rgba(20, 19, 19, 1)","text-halo-color":"rgba(230, 221, 221, 0)","text-halo-width":2,"icon-color":"rgba(183, 18, 18, 1)","icon-opacity":.3,"icon-halo-color":"rgba(183, 55, 55, 0)"}},{id:"highway-shield-us-interstate",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:7,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-interstate"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[7,"point"],[7,"line"],[8,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"highway-shield-us-other",type:"symbol",source:"openmaptiles","source-layer":"transportation_name",minzoom:9,filter:["all",["<=","ref_length",6],["==","$type","LineString"],["in","network","us-highway","us-state"]],layout:{"text-size":10,"icon-image":"{network}_{ref_length}","icon-rotation-alignment":"viewport","symbol-spacing":200,"text-font":["Noto Sans Regular"],"symbol-placement":{base:1,stops:[[10,"point"],[11,"line"]]},"text-rotation-alignment":"viewport","icon-size":1,"text-field":"{ref}"},paint:{"text-color":"rgba(0, 0, 0, 1)"}},{id:"place-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:12,filter:["!in","class","city","town","village","country","continent"],layout:{"text-letter-spacing":.1,"text-size":{base:1.2,stops:[[12,10],[15,14]]},"text-font":["Noto Sans Bold"],"text-field":"{name:latin}\n{name:nonlatin}","text-transform":"uppercase","text-max-width":9,visibility:"visible"},paint:{"text-color":"rgba(255,255,255,1)","text-halo-width":1.2,"text-halo-color":"rgba(57, 28, 28, 1)"}},{id:"place-village",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",minzoom:10,filter:["==","class","village"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,12],[15,16]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(10, 9, 9, 0.8)"}},{id:"place-town",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["==","class","town"],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[10,14],[15,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(255, 255, 255, 1)","text-halo-width":1.2,"text-halo-color":"rgba(22, 22, 22, 0.8)"}},{id:"place-city",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["!=","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,visibility:"visible"},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-city-capital",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","capital",2],["==","class","city"]],layout:{"text-font":["Noto Sans Regular"],"text-size":{base:1.2,stops:[[7,14],[11,24]]},"text-field":"{name:latin}\n{name:nonlatin}","text-max-width":8,"icon-image":"star_11","text-offset":[.4,0],"icon-size":.8,"text-anchor":"left",visibility:"visible"},paint:{"text-color":"#333","text-halo-width":1.2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-other",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["!has","iso_a2"]],layout:{"text-font":["Noto Sans Italic"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-3",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],[">=","rank",3],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[3,11],[7,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-2",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",2],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[2,11],[5,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-country-1",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",filter:["all",["==","class","country"],["==","rank",1],["has","iso_a2"]],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":{stops:[[1,11],[4,17]]},"text-transform":"uppercase","text-max-width":6.25,visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}},{id:"place-continent",type:"symbol",metadata:{"mapbox:group":"1444849242106.713"},source:"openmaptiles","source-layer":"place",maxzoom:1,filter:["==","class","continent"],layout:{"text-font":["Noto Sans Bold"],"text-field":"{name:latin}","text-size":14,"text-max-width":6.25,"text-transform":"uppercase",visibility:"visible"},paint:{"text-halo-blur":1,"text-color":"#334","text-halo-width":2,"text-halo-color":"rgba(255,255,255,0.8)"}}],id:"qebnlkra6"}}}),Hb=p({"src/plots/map/styles/arcgis-sat.js"(e,t){t.exports={version:8,name:"orto",metadata:{},center:[1.537786,41.837539],zoom:12,bearing:0,pitch:0,light:{anchor:"viewport",color:"white",intensity:.4,position:[1.15,45,30]},sources:{ortoEsri:{type:"raster",tiles:["https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}"],tileSize:256,maxzoom:18,attribution:"ESRI &copy; <a href='http://www.esri.com'>ESRI</a>"},ortoInstaMaps:{type:"raster",tiles:["https://tilemaps.icgc.cat/mapfactory/wmts/orto_8_12/CAT3857/{z}/{x}/{y}.png"],tileSize:256,maxzoom:13},ortoICGC:{type:"raster",tiles:["https://geoserveis.icgc.cat/icc_mapesmultibase/noutm/wmts/orto/GRID3857/{z}/{x}/{y}.jpeg"],tileSize:256,minzoom:13.1,maxzoom:20},openmaptiles:{type:"vector",url:"https://geoserveis.icgc.cat/contextmaps/basemap.json"}},sprite:"https://geoserveis.icgc.cat/contextmaps/sprites/sprite@1",glyphs:"https://geoserveis.icgc.cat/contextmaps/glyphs/{fontstack}/{range}.pbf",layers:[{id:"background",type:"background",paint:{"background-color":"#F4F9F4"}},{id:"ortoEsri",type:"raster",source:"ortoEsri",maxzoom:16,layout:{visibility:"visible"}},{id:"ortoICGC",type:"raster",source:"ortoICGC",minzoom:13.1,maxzoom:19,layout:{visibility:"visible"}},{id:"ortoInstaMaps",type:"raster",source:"ortoInstaMaps",maxzoom:13,layout:{visibility:"visible"}}]}}}),Gb=p({"src/plots/map/constants.js"(e,t){var r=We(),n=qb(),i="https://basemaps.cartocdn.com/gl/positron-gl-style/style.json",a="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",o="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json",s={basic:o,streets:o,outdoors:o,light:i,dark:a,satellite:Hb(),"satellite-streets":n,"open-street-map":{id:"osm",version:8,sources:{"plotly-osm-tiles":{type:"raster",attribution:'\xa9 <a target="_blank" href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',tiles:["https://tile.openstreetmap.org/{z}/{x}/{y}.png"],tileSize:256}},layers:[{id:"plotly-osm-tiles",type:"raster",source:"plotly-osm-tiles",minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"white-bg":{id:"white-bg",version:8,sources:{},layers:[{id:"white-bg",type:"background",paint:{"background-color":"#FFFFFF"},minzoom:0,maxzoom:22}],glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf"},"carto-positron":i,"carto-darkmatter":a,"carto-voyager":o,"carto-positron-nolabels":"https://basemaps.cartocdn.com/gl/positron-nolabels-gl-style/style.json","carto-darkmatter-nolabels":"https://basemaps.cartocdn.com/gl/dark-matter-nolabels-gl-style/style.json","carto-voyager-nolabels":"https://basemaps.cartocdn.com/gl/voyager-nolabels-gl-style/style.json"},l=r(s);t.exports={styleValueDflt:"basic",stylesMap:s,styleValuesMap:l,traceLayerPrefix:"plotly-trace-layer-",layoutLayerPrefix:"plotly-layout-layer-",missingStyleErrorMsg:["No valid maplibre style found, please set `map.style` to one of:",l.join(", "),"or use a tile service."].join("\n"),mapOnErrorMsg:"Map error."}}}),Wb=p({"src/plots/map/layout_attributes.js"(e,t){var r=st(),n=q().defaultLine,i=ka().attributes,a=D(),o=wn().textposition,s=Le().overrideAll,l=gt().templatedArray,c=Gb(),u=a({noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0});u.family.dflt="Open Sans Regular, Arial Unicode MS Regular",(t.exports=s({_arrayAttrRegexps:[r.counterRegex("map",".layers",!0)],domain:i({name:"map"}),style:{valType:"any",values:c.styleValuesMap,dflt:c.styleValueDflt},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},bounds:{west:{valType:"number"},east:{valType:"number"},south:{valType:"number"},north:{valType:"number"}},layers:l("layer",{visible:{valType:"boolean",dflt:!0},sourcetype:{valType:"enumerated",values:["geojson","vector","raster","image"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},sourceattribution:{valType:"string"},type:{valType:"enumerated",values:["circle","line","fill","symbol","raster"],dflt:"circle"},coordinates:{valType:"any"},below:{valType:"string"},color:{valType:"color",dflt:n},opacity:{valType:"number",min:0,max:1,dflt:1},minzoom:{valType:"number",min:0,max:24,dflt:0},maxzoom:{valType:"number",min:0,max:24,dflt:24},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2},dash:{valType:"data_array"}},fill:{outlinecolor:{valType:"color",dflt:n}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},placement:{valType:"enumerated",values:["point","line","line-center"],dflt:"point"},textfont:u,textposition:r.extendFlat({},o,{arrayOk:!1})}})},"plot","from-root")).uirevision={valType:"any",editType:"none"}}}),$b=p({"src/traces/scattermap/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=_n(),a=Wm(),o=wn(),s=Wb(),l=N(),c=Lt(),u=R().extendFlat,h=Le().overrideAll,p=Wb(),d=a.line,f=a.marker;t.exports=h({lon:a.lon,lat:a.lat,cluster:{enabled:{valType:"boolean"},maxzoom:u({},p.layers.maxzoom,{}),step:{valType:"number",arrayOk:!0,dflt:-1,min:-1},size:{valType:"number",arrayOk:!0,dflt:20,min:0},color:{valType:"color",arrayOk:!0},opacity:u({},f.opacity,{dflt:1})},mode:u({},o.mode,{dflt:"markers"}),text:u({},o.text,{}),texttemplate:n({editType:"plot"},{keys:["lat","lon","text"]}),hovertext:u({},o.hovertext,{}),line:{color:d.color,width:d.width},connectgaps:o.connectgaps,marker:u({symbol:{valType:"string",dflt:"circle",arrayOk:!0},angle:{valType:"number",dflt:"auto",arrayOk:!0},allowoverlap:{valType:"boolean",dflt:!1},opacity:f.opacity,size:f.size,sizeref:f.sizeref,sizemin:f.sizemin,sizemode:f.sizemode},c("marker")),fill:a.fill,fillcolor:i(),textfont:s.layers.symbol.textfont,textposition:s.layers.symbol.textposition,below:{valType:"string"},selected:{marker:o.selected.marker},unselected:{marker:o.unselected.marker},hoverinfo:u({},l.hoverinfo,{flags:["lon","lat","text","name"]}),hovertemplate:r()},"calc","nested")}}),Zb=p({"src/traces/scattermap/constants.js"(e,t){var r=["Metropolis Black Italic","Metropolis Black","Metropolis Bold Italic","Metropolis Bold","Metropolis Extra Bold Italic","Metropolis Extra Bold","Metropolis Extra Light Italic","Metropolis Extra Light","Metropolis Light Italic","Metropolis Light","Metropolis Medium Italic","Metropolis Medium","Metropolis Regular Italic","Metropolis Regular","Metropolis Semi Bold Italic","Metropolis Semi Bold","Metropolis Thin Italic","Metropolis Thin","Open Sans Bold Italic","Open Sans Bold","Open Sans Extrabold Italic","Open Sans Extrabold","Open Sans Italic","Open Sans Light Italic","Open Sans Light","Open Sans Regular","Open Sans Semibold Italic","Open Sans Semibold","Klokantech Noto Sans Bold","Klokantech Noto Sans CJK Bold","Klokantech Noto Sans CJK Regular","Klokantech Noto Sans Italic","Klokantech Noto Sans Regular"];t.exports={isSupportedFont:function(e){return-1!==r.indexOf(e)}}}}),Xb=p({"src/traces/scattermap/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Xn(),s=Yn(),l=$b(),c=Zb().isSupportedFont;t.exports=function(e,t,u,h){function p(n,i){return r.coerce(e,t,l,n,i)}function d(n,i){return r.coerce2(e,t,l,n,i)}var f=function(e,t,r){var n=r("lon")||[],i=r("lat")||[],a=Math.min(n.length,i.length);return t._length=a,a}(0,t,p);if(f){if(p("text"),p("texttemplate"),p("hovertext"),p("hovertemplate"),p("mode"),p("below"),n.hasMarkers(t)){i(e,t,u,h,p,{noLine:!0,noAngle:!0}),p("marker.allowoverlap"),p("marker.angle");var m=t.marker;"circle"!==m.symbol&&(r.isArrayOrTypedArray(m.size)&&(m.size=m.size[0]),r.isArrayOrTypedArray(m.color)&&(m.color=m.color[0]))}n.hasLines(t)&&(a(e,t,u,h,p,{noDash:!0}),p("connectgaps"));var g=d("cluster.maxzoom"),y=d("cluster.step"),v=d("cluster.color",t.marker&&t.marker.color||u),x=d("cluster.size"),b=d("cluster.opacity");if(p("cluster.enabled",!1!==g||!1!==y||!1!==v||!1!==x||!1!==b)||n.hasText(t)){var _=h.font.family;o(e,t,h,p,{noSelect:!0,noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0,font:{family:c(_)?_:"Open Sans Regular",weight:h.font.weight,style:h.font.style,size:h.font.size,color:h.font.color}})}p("fill"),"none"!==t.fill&&s(e,t,u,p),r.coerceSelectionMarkerOpacity(t,p)}else t.visible=!1}}}),Yb=p({"src/traces/scattermap/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot.mockAxis,o=e.lonlat;return i.lonLabel=r.tickText(a,a.c2l(o[0]),!0).text,i.latLabel=r.tickText(a,a.c2l(o[1]),!0).text,i}}}),Kb=p({"src/plots/map/convert_text_opts.js"(e,t){var r=st();t.exports=function(e,t){var n=e.split(" "),i=n[0],a=n[1],o=r.isArrayOrTypedArray(t)?r.mean(t):t,s=.5+o/100,l=1.5+o/100,c=["",""],u=[0,0];switch(i){case"top":c[0]="top",u[1]=-l;break;case"bottom":c[0]="bottom",u[1]=l}switch(a){case"left":c[1]="right",u[0]=-s;break;case"right":c[1]="left",u[0]=s}return{anchor:c[0]&&c[1]?c.join("-"):c[0]?c[0]:c[1]?c[1]:"center",offset:u}}}}),Jb=p({"src/traces/scattermap/convert.js"(e,t){var r=k(),n=st(),i=T().BADNUM,a=Qm(),o=Wt(),s=Jt(),l=Zt(),c=$t(),u=Zb().isSupportedFont,h=Kb(),p=Xt().appendArrayPointValue,d=At().NEWLINES,f=At().BR_TAG_ALL;function m(e){return{type:e,geojson:a.makeBlank(),layout:{visibility:"none"},filter:null,paint:{}}}function g(e,t){return n.isArrayOrTypedArray(e)?t?function(t){return r(e[t])?+e[t]:0}:function(t){return e[t]}:e?function(){return e}:y}function y(){return""}function v(e){return e[0]===i}function x(e,t){var r;if(n.isArrayOrTypedArray(e)&&n.isArrayOrTypedArray(t)){r=["step",["get","point_count"],e[0]];for(var i=1;i<e.length;i++)r.push(t[i-1],e[i])}else r=e;return r}function b(e){var t=e.textfont,r=t.family,n=t.style,i=t.weight,a=r.split(" "),o="Italic"===a[a.length-1];o&&a.pop(),o=o||"italic"===n;var s=a.join(" ");return"bold"===i&&-1===a.indexOf("Bold")?s+=" Bold":i<=1e3&&("Metropolis"===a[0]?(s="Metropolis",s+=i>850?" Black":i>750?" Extra Bold":i>650?" Bold":i>550?" Semi Bold":i>450?" Medium":i>350?" Regular":i>250?" Light":i>150?" Extra Light":" Thin"):"Open Sans"===a.slice(0,2).join(" ")?(s="Open Sans",s+=i>750?" Extrabold":i>650?" Bold":i>550?" Semibold":i>350?" Regular":" Light"):"Klokantech Noto Sans"===a.slice(0,3).join(" ")&&(s="Klokantech Noto Sans","CJK"===a[3]&&(s+=" CJK"),s+=i>500?" Bold":" Regular")),o&&(s+=" Italic"),"Open Sans Regular Italic"===s?s="Open Sans Italic":"Open Sans Regular Bold"===s?s="Open Sans Bold":"Open Sans Regular Bold Italic"===s?s="Open Sans Bold Italic":"Klokantech Noto Sans Regular Italic"===s&&(s="Klokantech Noto Sans Italic"),u(s)||(s=r),s.split(", ")}t.exports=function(e,t){var i,u=t[0].trace,_=!0===u.visible&&0!==u._length,w="none"!==u.fill,k=c.hasLines(u),T=c.hasMarkers(u),S=c.hasText(u),A=T&&"circle"===u.marker.symbol,M=T&&"circle"!==u.marker.symbol,E=u.cluster&&u.cluster.enabled,C=m("fill"),P=m("line"),L=m("circle"),I=m("symbol"),z={fill:C,line:P,circle:L,symbol:I};if(!_)return z;if((w||k)&&(i=a.calcTraceToLineCoords(t)),w&&(C.geojson=a.makePolygon(i),C.layout.visibility="visible",n.extendFlat(C.paint,{"fill-color":u.fillcolor})),k&&(P.geojson=a.makeLine(i),P.layout.visibility="visible",n.extendFlat(P.paint,{"line-width":u.line.width,"line-color":u.line.color,"line-opacity":u.opacity})),A){var O=function(e){var t,i,a,c,u=e[0].trace,h=u.marker,p=u.selectedpoints,d=n.isArrayOrTypedArray(h.color),f=n.isArrayOrTypedArray(h.size),m=n.isArrayOrTypedArray(h.opacity);function g(e){return u.opacity*e}function y(e){return e/2}d&&(i=o.hasColorscale(u,"marker")?o.makeColorScaleFuncFromTrace(h):n.identity),f&&(a=l(u)),m&&(c=function(e){return g(r(e)?+n.constrain(e,0,1):0)});var x,b=[];for(t=0;t<e.length;t++){var _=e[t],w=_.lonlat;if(!v(w)){var k={};i&&(k.mcc=_.mcc=i(_.mc)),a&&(k.mrc=_.mrc=a(_.ms)),c&&(k.mo=c(_.mo)),p&&(k.selected=_.selected||0),b.push({type:"Feature",id:t+1,geometry:{type:"Point",coordinates:w},properties:k})}}if(p)for(x=s.makeSelectedPointStyleFns(u),t=0;t<b.length;t++){var T=b[t].properties;x.selectedOpacityFn&&(T.mo=g(x.selectedOpacityFn(T))),x.selectedColorFn&&(T.mcc=x.selectedColorFn(T)),x.selectedSizeFn&&(T.mrc=x.selectedSizeFn(T))}return{geojson:{type:"FeatureCollection",features:b},mcc:d||x&&x.selectedColorFn?{type:"identity",property:"mcc"}:h.color,mrc:f||x&&x.selectedSizeFn?{type:"identity",property:"mrc"}:y(h.size),mo:m||x&&x.selectedOpacityFn?{type:"identity",property:"mo"}:g(h.opacity)}}(t);L.geojson=O.geojson,L.layout.visibility="visible",E&&(L.filter=["!",["has","point_count"]],z.cluster={type:"circle",filter:["has","point_count"],layout:{visibility:"visible"},paint:{"circle-color":x(u.cluster.color,u.cluster.step),"circle-radius":x(u.cluster.size,u.cluster.step),"circle-opacity":x(u.cluster.opacity,u.cluster.step)}},z.clusterCount={type:"symbol",filter:["has","point_count"],paint:{},layout:{"text-field":"{point_count_abbreviated}","text-font":b(u),"text-size":12}}),n.extendFlat(L.paint,{"circle-color":O.mcc,"circle-radius":O.mrc,"circle-opacity":O.mo})}if(A&&E&&(L.filter=["!",["has","point_count"]]),(M||S)&&(I.geojson=function(e,t){for(var r=t._fullLayout,i=e[0].trace,a=i.marker||{},o=a.symbol,s=a.angle,l="circle"!==o?g(o):y,u="auto"!==s?g(s,!0):y,h=c.hasText(i)?g(i.text):y,m=[],x=0;x<e.length;x++){var b=e[x];if(!v(b.lonlat)){var _,w=i.texttemplate;if(w){var k=Array.isArray(w)?w[x]||"":w,T=i._module.formatLabels(b,i,r),S={};p(S,i,b.i);var A=i._meta||{};_=n.texttemplateString(k,T,r._d3locale,S,b,A)}else _=h(x);_&&(_=_.replace(d,"").replace(f,"\n")),m.push({type:"Feature",geometry:{type:"Point",coordinates:b.lonlat},properties:{symbol:l(x),angle:u(x),text:_}})}}return{type:"FeatureCollection",features:m}}(t,e),n.extendFlat(I.layout,{visibility:"visible","icon-image":"{symbol}-15","text-field":"{text}"}),M&&(n.extendFlat(I.layout,{"icon-size":u.marker.size/10}),"angle"in u.marker&&"auto"!==u.marker.angle&&n.extendFlat(I.layout,{"icon-rotate":{type:"identity",property:"angle"},"icon-rotation-alignment":"map"}),I.layout["icon-allow-overlap"]=u.marker.allowoverlap,n.extendFlat(I.paint,{"icon-opacity":u.opacity*u.marker.opacity,"icon-color":u.marker.color})),S)){var R=(u.marker||{}).size,D=h(u.textposition,R);n.extendFlat(I.layout,{"text-size":u.textfont.size,"text-anchor":D.anchor,"text-offset":D.offset,"text-font":b(u)}),n.extendFlat(I.paint,{"text-color":u.textfont.color,"text-opacity":u.opacity})}return z}}}),Qb=p({"src/traces/scattermap/plot.js"(e,t){var r=st(),n=Jb(),i=Gb().traceLayerPrefix,a={cluster:["cluster","clusterCount","circle"],nonCluster:["fill","line","circle","symbol"]};function o(e,t,r,n){this.type="scattermap",this.subplot=e,this.uid=t,this.clusterEnabled=r,this.isHidden=n,this.sourceIds={fill:"source-"+t+"-fill",line:"source-"+t+"-line",circle:"source-"+t+"-circle",symbol:"source-"+t+"-symbol",cluster:"source-"+t+"-circle",clusterCount:"source-"+t+"-circle"},this.layerIds={fill:i+t+"-fill",line:i+t+"-line",circle:i+t+"-circle",symbol:i+t+"-symbol",cluster:i+t+"-cluster",clusterCount:i+t+"-cluster-count"},this.below=null}var s=o.prototype;s.addSource=function(e,t,n){var i={type:"geojson",data:t.geojson};n&&n.enabled&&r.extendFlat(i,{cluster:!0,clusterMaxZoom:n.maxzoom});var a=this.subplot.map.getSource(this.sourceIds[e]);a?a.setData(t.geojson):this.subplot.map.addSource(this.sourceIds[e],i)},s.setSourceData=function(e,t){this.subplot.map.getSource(this.sourceIds[e]).setData(t.geojson)},s.addLayer=function(e,t,r){var n={type:t.type,id:this.layerIds[e],source:this.sourceIds[e],layout:t.layout,paint:t.paint};t.filter&&(n.filter=t.filter);for(var i,a=this.layerIds[e],o=this.subplot.getMapLayers(),s=0;s<o.length;s++)if(o[s].id===a){i=!0;break}i?(this.subplot.setOptions(a,"setLayoutProperty",n.layout),"visible"===n.layout.visibility&&this.subplot.setOptions(a,"setPaintProperty",n.paint)):this.subplot.addLayer(n,r)},s.update=function(e){var t=e[0].trace,r=this.subplot,i=r.map,o=n(r.gd,e),s=r.belowLookup["trace-"+this.uid],l=!(!t.cluster||!t.cluster.enabled),c=!!this.clusterEnabled,u=this;function h(e){c?function(e){for(var t=a.cluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n])}e||i.removeSource(u.sourceIds.circle)}(e):function(e){for(var t=a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];i.removeLayer(u.layerIds[n]),e||i.removeSource(u.sourceIds[n])}}(e)}function p(e){l?function(e){e||u.addSource("circle",o.circle,t.cluster);for(var r=a.cluster,n=0;n<r.length;n++){var i=r[n],l=o[i];u.addLayer(i,l,s)}}(e):function(e){for(var t=a.nonCluster,r=0;r<t.length;r++){var n=t[r],i=o[n];e||u.addSource(n,i),u.addLayer(n,i,s)}}(e)}function d(){for(var e=l?a.cluster:a.nonCluster,t=0;t<e.length;t++){var n=e[t],i=o[n];i&&(r.setOptions(u.layerIds[n],"setLayoutProperty",i.layout),"visible"===i.layout.visibility&&("cluster"!==n&&u.setSourceData(n,i),r.setOptions(u.layerIds[n],"setPaintProperty",i.paint)))}}var f=this.isHidden,m=!0!==t.visible;m?f||h():f?m||p():c!==l?(h(),p()):this.below!==s?(h(!0),p(!0),d()):d(),this.clusterEnabled=l,this.isHidden=m,this.below=s,e[0].trace._glTrace=this},s.dispose=function(){for(var e=this.subplot.map,t=this.clusterEnabled?a.cluster:a.nonCluster,r=t.length-1;r>=0;r--){var n=t[r];e.removeLayer(this.layerIds[n]),e.removeSource(this.sourceIds[n])}},t.exports=function(e,t){var r,i,s,l=t[0].trace,c=l.cluster&&l.cluster.enabled,u=!0!==l.visible,h=new o(e,l.uid,c,u),p=n(e.gd,t),d=h.below=e.belowLookup["trace-"+l.uid];if(c)for(h.addSource("circle",p.circle,l.cluster),r=0;r<a.cluster.length;r++)s=p[i=a.cluster[r]],h.addLayer(i,s,d);else for(r=0;r<a.nonCluster.length;r++)s=p[i=a.nonCluster[r]],h.addSource(i,s,l.cluster),h.addLayer(i,s,d);return t[0].trace._glTrace=h,h}}}),e_=p({"src/traces/scattermap/hover.js"(e,t){var r=zr(),n=st(),i=mi(),a=n.fillText,o=T().BADNUM,s=Gb().traceLayerPrefix;function l(e,t,r){if(!e.hovertemplate){var n=(t.hi||e.hoverinfo).split("+"),i=-1!==n.indexOf("all"),o=-1!==n.indexOf("lon"),s=-1!==n.indexOf("lat"),l=t.lonlat,c=[];return i||o&&s?c.push("("+u(l[1])+", "+u(l[0])+")"):o?c.push(r.lon+u(l[0])):s&&c.push(r.lat+u(l[1])),(i||-1!==n.indexOf("text"))&&a(t,e,c),c.join("<br>")}function u(e){return e+"\xb0"}}t.exports={hoverPoints:function(e,t,a){var c=e.cd,u=c[0].trace,h=e.xa,p=e.ya,d=e.subplot,f=[],m=s+u.uid+"-circle",g=u.cluster&&u.cluster.enabled;if(g){var y=d.map.queryRenderedFeatures(null,{layers:[m]});f=y.map((function(e){return e.id}))}var v=360*(t>=0?Math.floor((t+180)/360):Math.ceil((t-180)/360)),x=t-v;if(r.getClosest(c,(function(e){var t=e.lonlat;if(t[0]===o)return 1/0;if(g&&-1===f.indexOf(e.i+1))return 1/0;var r=n.modHalf(t[0],360),i=t[1],s=d.project([r,i]),l=s.x-h.c2p([x,i]),c=s.y-p.c2p([r,a]),u=Math.max(3,e.mrc||0);return Math.max(Math.sqrt(l*l+c*c)-u,1-3/u)}),e),!1!==e.index){var b=c[e.index],_=b.lonlat,w=[n.modHalf(_[0],360)+v,_[1]],k=h.c2p(w),T=p.c2p(w),S=b.mrc||1;e.x0=k-S,e.x1=k+S,e.y0=T-S,e.y1=T+S;var A={};A[u.subplot]={_subplot:d};var M=u._module.formatLabels(b,u,A);return e.lonLabel=M.lonLabel,e.latLabel=M.latLabel,e.color=i(u,b),e.extraText=l(u,b,c[0].t.labels),e.hovertemplate=u.hovertemplate,[e]}},getExtraText:l}}}),t_=p({"src/traces/scattermap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e}}}),r_=p({"src/traces/scattermap/select.js"(e,t){var r=st(),n=$t(),i=T().BADNUM;t.exports=function(e,t){var a,o=e.cd,s=e.xaxis,l=e.yaxis,c=[],u=o[0].trace;if(!n.hasMarkers(u))return[];if(!1===t)for(a=0;a<o.length;a++)o[a].selected=0;else for(a=0;a<o.length;a++){var h=o[a],p=h.lonlat;if(p[0]!==i){var d=[r.modHalf(p[0],360),p[1]],f=[s.c2p(d),l.c2p(d)];t.contains(f,null,a,e)?(c.push({pointNumber:a,lon:p[0],lat:p[1]}),h.selected=1):h.selected=0}}return c}}}),n_=p({"node_modules/maplibre-gl/dist/maplibre-gl.js"(e,t){var n,a;n=e,a=function(){var e={},t={};function n(r,n,i){if(t[r]=i,"index"===r){var a="var sharedModule = {}; ("+t.shared+")(sharedModule); ("+t.worker+")(sharedModule);",o={};return t.shared(o),t.index(e,o),"undefined"!==typeof window&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),e}}return n("shared",0,(function(e){function t(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(t){a(t)}}function s(e){try{l(n.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}"function"==typeof SuppressedError&&SuppressedError;var a=s;function s(e,t){this.x=e,this.y=t}s.prototype={clone:function(){return new s(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),n=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=n,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-n*(this.y-t.y),this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},s.convert=function(e){return e instanceof s?e:Array.isArray(e)?new s(e[0],e[1]):e};var h=n(a),p=d;function d(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}d.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var f=n(p);let m,g;function y(){return null==m&&(m="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),m}function v(){if(null==g&&(g=!1,y())){const e=5,t=new OffscreenCanvas(e,e).getContext("2d",{willReadFrequently:!0});if(t){for(let n=0;n<e*e;n++){const r=4*n;t.fillStyle=`rgb(${r},${r+1},${r+2})`,t.fillRect(n%e,Math.floor(n/e),1,1)}const r=t.getImageData(0,0,e,e).data;for(let t=0;t<e*e*4;t++)if(t%4!=3&&r[t]!==t){g=!0;break}}}return g||!1}function x(e,t,r,n){const i=new f(e,t,r,n);return e=>i.solve(e)}const b=x(.25,.1,.25,1);function _(e,t,r){return Math.min(r,Math.max(t,e))}function w(e,t,r){const n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function k(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(const i of r)for(const t in i)e[t]=i[t];return e}let T=1;function S(e,t,r){const n={};for(const i in e)n[i]=t.call(this,e[i],i,e);return n}function A(e,t,r){const n={};for(const i in e)t.call(this,e[i],i,e)&&(n[i]=e[i]);return n}function M(e){return Array.isArray(e)?e.map(M):"object"==typeof e&&e?S(e,M):e}const E={};function C(e){E[e]||("undefined"!=typeof console&&console.warn(e),E[e]=!0)}function P(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function L(e){return"undefined"!=typeof WorkerGlobalScope&&void 0!==e&&e instanceof WorkerGlobalScope}let I=null;function z(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}const O="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function R(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const t=new VideoFrame(e,{timestamp:0});try{const o=null==t?void 0:t.format;if(!o||!o.startsWith("BGR")&&!o.startsWith("RGB"))throw new Error(`Unrecognized format ${o}`);const s=o.startsWith("BGR"),l=new Uint8ClampedArray(i*a*4);if(yield t.copyTo(l,function(e,t,r,n,i){const a=4*Math.max(-t,0),o=(Math.max(0,r)-r)*n*4+a,s=4*n,l=Math.max(0,t),c=Math.max(0,r);return{rect:{x:l,y:c,width:Math.min(e.width,t+n)-l,height:Math.min(e.height,r+i)-c},layout:[{offset:o,stride:s}]}}(e,r,n,i,a)),s)for(let e=0;e<l.length;e+=4){const t=l[e];l[e]=l[e+2],l[e+2]=t}return l}finally{t.close()}}))}let D,j;const F="AbortError";function B(){return new Error(F)}const N={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function U(e){return N.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}const V="global-dispatcher";class q extends Error{constructor(e,t,r,n){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=n}}const H=()=>L(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,G=function(e,r){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){const t=U(e.url);if(t)return t(e,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:V},r)}if(!(/^file:/.test(n=e.url)||/^file:/.test(H())&&!/^\w+:/.test(n))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(e,r){return t(this,void 0,void 0,(function*(){const t=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:H(),signal:r.signal});"json"!==e.type||t.headers.has("Accept")||t.headers.set("Accept","application/json");const n=yield fetch(t);if(!n.ok){const t=yield n.blob();throw new q(n.status,n.statusText,e.url,t)}let i;i="arrayBuffer"===e.type||"image"===e.type?n.arrayBuffer():"json"===e.type?n.json():n.text();const a=yield i;if(r.signal.aborted)throw B();return{data:a,cacheControl:n.headers.get("Cache-Control"),expires:n.headers.get("Expires")}}))}(e,r);if(L(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:V},r)}var n,i,a;return i=e,a=r,new Promise(((e,t)=>{var r;const n=new XMLHttpRequest;n.open(i.method||"GET",i.url,!0),"arrayBuffer"!==i.type&&"image"!==i.type||(n.responseType="arraybuffer");for(const a in i.headers)n.setRequestHeader(a,i.headers[a]);"json"===i.type&&(n.responseType="text",(null===(r=i.headers)||void 0===r?void 0:r.Accept)||n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{t(new Error(n.statusText))},n.onload=()=>{if(!a.signal.aborted)if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let a=n.response;if("json"===i.type)try{a=JSON.parse(n.response)}catch(r){return void t(r)}e({data:a,cacheControl:n.getResponseHeader("Cache-Control"),expires:n.getResponseHeader("Expires")})}else{const e=new Blob([n.response],{type:n.getResponseHeader("Content-Type")});t(new q(n.status,n.statusText,i.url,e))}},a.signal.addEventListener("abort",(()=>{n.abort(),t(B())})),n.send(i.body)}))};function W(e){if(!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:"))return!0;const t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function $(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Z(e,t,r){if(r&&r[e]){const n=r[e].indexOf(t);-1!==n&&r[e].splice(n,1)}}class X{constructor(e){k(this,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.type=e}}class Y extends X{constructor(e){super("error",k({error:e},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}}class K{on(e,t){return this._listeners=this._listeners||{},$(e,t,this._listeners),this}off(e,t){return Z(e,t,this._listeners),Z(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},$(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new X(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const n=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const a of n)Z(r,a,this._oneTimeListeners),a.call(this,e);const i=this._eventedParent;i&&(k(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),i.fire(e))}else e instanceof Y&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var J={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const Q=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ee(e,t){const r={};for(const n in e)"ref"!==n&&(r[n]=e[n]);return Q.forEach((e=>{e in t&&(r[e]=t[e])})),r}function te(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!te(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!te(e[r],t[r]))return!1;return!0}return e===t}function re(e,t){e.push(t)}function ne(e,t,r){re(r,{command:"addSource",args:[e,t[e]]})}function ie(e,t,r){re(t,{command:"removeSource",args:[e]}),r[e]=!0}function ae(e,t,r,n){ie(e,r,n),ne(e,t,r)}function oe(e,t,r){let n;for(n in e[r])if(Object.prototype.hasOwnProperty.call(e[r],n)&&"data"!==n&&!te(e[r][n],t[r][n]))return!1;for(n in t[r])if(Object.prototype.hasOwnProperty.call(t[r],n)&&"data"!==n&&!te(e[r][n],t[r][n]))return!1;return!0}function se(e,t,r,n,i,a){e=e||{},t=t||{};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(te(e[o],t[o])||r.push({command:a,args:[n,o,t[o],i]}));for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&!Object.prototype.hasOwnProperty.call(e,o)&&(te(e[o],t[o])||r.push({command:a,args:[n,o,t[o],i]}))}function le(e){return e.id}function ce(e,t){return e[t.id]=t,e}class ue{constructor(e,t,r,n){this.message=(e?`${e}: `:"")+r,n&&(this.identifier=n),null!=t&&t.__line__&&(this.line=t.__line__)}}function he(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(const i of r)for(const t in i)e[t]=i[t];return e}class pe extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class de{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.parent=e,this.bindings={};for(const[r,n]of t)this.bindings[r]=n}concat(e){return new de(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const fe={kind:"null"},me={kind:"number"},ge={kind:"string"},ye={kind:"boolean"},ve={kind:"color"},xe={kind:"object"},be={kind:"value"},_e={kind:"collator"},we={kind:"formatted"},ke={kind:"padding"},Te={kind:"resolvedImage"},Se={kind:"variableAnchorOffsetCollection"};function Ae(e,t){return{kind:"array",itemType:e,N:t}}function Me(e){if("array"===e.kind){const t=Me(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ee=[fe,me,ge,ye,ve,we,xe,Ae(be),ke,Te,Se];function Ce(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ce(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ee)if(!Ce(e,t))return null}return`Expected ${Me(e)} but found ${Me(t)} instead.`}function Pe(e,t){return t.some((t=>t.kind===e.kind))}function Le(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Ie(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const ze=.96422,Oe=.82521,Re=4/29,De=6/29,je=3*De*De,Fe=De*De*De,Be=Math.PI/180,Ne=180/Math.PI;function Ue(e){return(e%=360)<0&&(e+=360),e}function Ve(e){let t,r,[n,i,a,o]=e;const s=He((.2225045*(n=qe(n))+.7168786*(i=qe(i))+.0606169*(a=qe(a)))/1);n===i&&i===a?t=r=s:(t=He((.4360747*n+.3850649*i+.1430804*a)/ze),r=He((.0139322*n+.0971045*i+.7141733*a)/Oe));const l=116*s-16;return[l<0?0:l,500*(t-s),200*(s-r),o]}function qe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function He(e){return e>Fe?Math.pow(e,1/3):e/je+Re}function Ge(e){let[t,r,n,i]=e,a=(t+16)/116,o=isNaN(r)?a:a+r/500,s=isNaN(n)?a:a-n/200;return a=1*$e(a),o=ze*$e(o),s=Oe*$e(s),[We(3.1338561*o-1.6168667*a-.4906146*s),We(-.9787684*o+1.9161415*a+.033454*s),We(.0719453*o-.2289914*a+1.4052427*s),i]}function We(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function $e(e){return e>De?e*e*e:je*(e-Re)}function Ze(e){return parseInt(e.padEnd(2,e),16)/255}function Xe(e,t){return Ye(t?e/100:e,0,1)}function Ye(e,t,r){return Math.min(Math.max(t,e),r)}function Ke(e){return!e.some(Number.isNaN)}const Je={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};class Qe{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.r=e,this.g=t,this.b=r,this.a=n,i||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Qe)return e;if("string"!=typeof e)return;const t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Je[e];if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+=t)),Ze(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){const t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){const[e,r,n,i,a,o,s,l,c,u,h,p]=t,d=[i||" ",s||" ",u].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,o,c].join(""),t="%%%"===e?100:""===e?255:0;if(t){const e=[Ye(+r/t,0,1),Ye(+a/t,0,1),Ye(+l/t,0,1),h?Xe(+h,p):1];if(Ke(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,i,a,o,s,l,c]=r,u=[n||" ",a||" ",s].join("");if(" "===u||" /"===u||",,"===u||",,,"===u){const e=[+t,Ye(+i,0,100),Ye(+o,0,100),l?Xe(+l,c):1];if(Ke(e))return function(e){let[t,r,n,i]=e;function a(e){const i=(e+t/30)%12,a=r*Math.min(n,1-n);return n-a*Math.max(-1,Math.min(i-3,9-i,1))}return t=Ue(t),r/=100,n/=100,[a(0),a(8),a(4),i]}(e)}}}(e);return t?new Qe(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,i=n||1/0;return this.overwriteGetter("rgb",[e/i,t/i,r/i,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,i]=Ve(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ue(Math.atan2(n,r)*Ne):NaN,a,t,i]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ve(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${n})`}}Qe.black=new Qe(0,0,0,1),Qe.white=new Qe(1,1,1,1),Qe.transparent=new Qe(0,0,0,0),Qe.red=new Qe(1,0,0,1);class et{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tt{constructor(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i}}class rt{constructor(e){this.sections=e}static fromString(e){return new rt([new tt(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof rt?e:rt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class nt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof nt)return e;if("number"==typeof e)return new nt([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new nt(e)}}toString(){return JSON.stringify(this.values)}}const it=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class at{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof at)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!it.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new at(e)}}toString(){return JSON.stringify(this.values)}}class ot{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new ot({name:e,available:!1}):null}}function st(e,t,r,n){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function lt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Qe||e instanceof et||e instanceof rt||e instanceof nt||e instanceof at||e instanceof ot)return!0;if(Array.isArray(e)){for(const t of e)if(!lt(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!lt(e[t]))return!1;return!0}return!1}function ct(e){if(null===e)return fe;if("string"==typeof e)return ge;if("boolean"==typeof e)return ye;if("number"==typeof e)return me;if(e instanceof Qe)return ve;if(e instanceof et)return _e;if(e instanceof rt)return we;if(e instanceof nt)return ke;if(e instanceof at)return Se;if(e instanceof ot)return Te;if(Array.isArray(e)){const t=e.length;let r;for(const n of e){const e=ct(n);if(r){if(r===e)continue;r=be;break}r=e}return Ae(r||be,t)}return xe}function ut(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Qe||e instanceof rt||e instanceof nt||e instanceof at||e instanceof ot?e.toString():JSON.stringify(e)}class ht{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!lt(e[1]))return t.error("invalid value");const r=e[1];let n=ct(r);const i=t.expectedType;return"array"!==n.kind||0!==n.N||!i||"array"!==i.kind||"number"==typeof i.N&&0!==i.N||(n=i),new ht(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class pt{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const dt={string:ge,number:me,boolean:ye,object:xe};class ft{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,n=1;const i=e[0];if("array"===i){let i,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in dt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);i=dt[r],n++}else i=be;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=Ae(i,a)}else{if(!dt[i])throw new Error(`Types doesn't contain name = ${i}`);r=dt[i]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,be);if(!r)return null;a.push(r)}return new ft(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Ce(this.type,ct(r)))return r;if(t===this.args.length-1)throw new pt(`Expected value to be of type ${Me(this.type)}, but found ${Me(ct(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const mt={"to-boolean":ye,"to-color":ve,"to-number":me,"to-string":ge};class gt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!mt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const n=mt[r],i=[];for(let a=1;a<e.length;a++){const r=t.parse(e[a],a,be);if(!r)return null;i.push(r)}return new gt(n,i)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Qe)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:st(t[0],t[1],t[2],t[3]),!r))return new Qe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new pt(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=nt.parse(t);if(n)return n}throw new pt(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=at.parse(t);if(n)return n}throw new pt(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new pt(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return rt.fromString(ut(this.args[0].evaluate(e)));case"resolvedImage":return ot.fromString(ut(this.args[0].evaluate(e)));default:return ut(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const yt=["Unknown","Point","LineString","Polygon"];class vt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?yt[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Qe.parse(e)),t}}class xt{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new de,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];this.registry=e,this.path=r,this.key=r.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)}_parse(e,t){function r(e,t,r){return"assert"===r?new ft(t,[e]):"coerce"===r?new gt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const a=this.registry[i];if(a){let i=a.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof ht)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){const e=new vt;try{i=new ht(i.type,i.evaluate(e))}catch(n){return this.error(n.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const n="number"==typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new xt(this.registry,this._isConstant,n,t||null,i,this.errors)}error(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const i=`${this.key}${r.map((e=>`[${e}]`)).join("")}`;this.errors.push(new pe(i,e))}checkSubtype(e,t){const r=Ce(e,t);return r&&this.error(r),r}}class bt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const a=t.parse(e[i+1],i+1);if(!a)return null;r.push([n,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new bt(r,n):null}outputDefined(){return this.result.outputDefined()}}class _t{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new _t(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class wt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,me),n=t.parse(e[2],2,Ae(t.expectedType||be));return r&&n?new wt(n.type.itemType,r,n):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new pt(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new pt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new pt(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class kt{constructor(e,t){this.type=ye,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,be);return r&&n?Pe(r.type,[ye,ge,me,fe,be])?new kt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Me(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Le(t,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${Me(ct(t))} instead.`);if(!Le(r,["string","array"]))throw new pt(`Expected second argument to be of type array or string, but found ${Me(ct(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Tt{constructor(e,t,r){this.type=me,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,be);if(!r||!n)return null;if(!Pe(r.type,[ye,ge,me,fe,be]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Me(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,me);return i?new Tt(r,n,i):null}return new Tt(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Le(t,["boolean","string","number","null"]))throw new pt(`Expected first argument to be of type boolean, string, number or null, but found ${Me(ct(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Le(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(Le(r,["array"]))return r.indexOf(t,n);throw new pt(`Expected second argument to be of type array or string, but found ${Me(ct(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class St{constructor(e,t,r,n,i,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const i={},a=[];for(let l=2;l<e.length-1;l+=2){let o=e[l];const s=e[l+1];Array.isArray(o)||(o=[o]);const c=t.concat(l);if(0===o.length)return c.error("Expected at least one branch label.");for(const e of o){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,ct(e)))return null}else r=ct(e);if(void 0!==i[String(e)])return c.error("Branch labels must be unique.");i[String(e)]=a.length}const u=t.parse(s,l,n);if(!u)return null;n=n||u.type,a.push(u)}const o=t.parse(e[1],1,be);if(!o)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==o.type.kind&&t.concat(1).checkSubtype(r,o.type)?null:new St(r,n,o,i,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ct(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class At{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n=[];for(let a=1;a<e.length-1;a+=2){const i=t.parse(e[a],a,ye);if(!i)return null;const o=t.parse(e[a+1],a+1,r);if(!o)return null;n.push([i,o]),r=r||o.type}const i=t.parse(e[e.length-1],e.length-1,r);if(!i)return null;if(!r)throw new Error("Can't infer output type");return new At(r,n,i)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((e=>{let[t,r]=e;return r.outputDefined()}))&&this.otherwise.outputDefined()}}class Mt{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,be),n=t.parse(e[2],2,me);if(!r||!n)return null;if(!Pe(r.type,[Ae(be),ge,be]))return t.error(`Expected first argument to be of type array or string, but found ${Me(r.type)} instead`);if(4===e.length){const i=t.parse(e[3],3,me);return i?new Mt(r.type,r,n,i):null}return new Mt(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Le(t,["string"]))return[...t].slice(r,n).join("");if(Le(t,["array"]))return t.slice(r,n);throw new pt(`Expected first argument to be of type array or string, but found ${Me(ct(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function Et(e,t){const r=e.length-1;let n,i,a=0,o=r,s=0;for(;a<=o;)if(s=Math.floor((a+o)/2),n=e[s],i=e[s+1],n<=t){if(s===r||t<i)return s;a=s+1}else{if(!(n>t))throw new pt("Input is not a number.");o=s-1}return 0}class Ct{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[n,i]of r)this.labels.push(n),this.outputs.push(i)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,me);if(!r)return null;const n=[];let i=null;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);for(let a=1;a<e.length;a+=2){const r=1===a?-1/0:e[a],o=e[a+1],s=a,l=a+1;if("number"!=typeof r)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(n.length&&n[n.length-1][0]>=r)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(o,l,i);if(!c)return null;i=i||c.type,n.push([r,c])}return new Ct(i,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[Et(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}var Pt=Lt;function Lt(e,t,r,n){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}Lt.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,n=0;n<8;n++){var i=this.sampleCurveX(r)-e;if(Math.abs(i)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=i/a}var o=0,s=1;for(r=e,n=0;n<20&&(i=this.sampleCurveX(r),!(Math.abs(i-e)<t));n++)e>i?o=r:s=r,r=.5*(s-o)+o;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var It,zt=(It=Pt)&&It.__esModule&&Object.prototype.hasOwnProperty.call(It,"default")?It.default:It;function Ot(e,t,r){return e+r*(t-e)}function Rt(e,t,r){return e.map(((e,n)=>Ot(e,t[n],r)))}const Dt={number:Ot,color:function(e,t,r){switch(arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb"){case"rgb":{const[n,i,a,o]=Rt(e.rgb,t.rgb,r);return new Qe(n,i,a,o,!1)}case"hcl":{const[n,i,a,o]=e.hcl,[s,l,c,u]=t.hcl;let h,p;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?h=NaN:(h=s,1!==a&&0!==a||(p=l)):(h=n,1!==c&&0!==c||(p=i));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),h=n+r*e}const[d,f,m,g]=function(e){let[t,r,n,i]=e;return t=isNaN(t)?0:t*Be,Ge([n,Math.cos(t)*r,Math.sin(t)*r,i])}([h,null!=p?p:Ot(i,l,r),Ot(a,c,r),Ot(o,u,r)]);return new Qe(d,f,m,g,!1)}case"lab":{const[n,i,a,o]=Ge(Rt(e.lab,t.lab,r));return new Qe(n,i,a,o,!1)}}},array:Rt,padding:function(e,t,r){return new nt(Rt(e.values,t.values,r))},variableAnchorOffsetCollection:function(e,t,r){const n=e.values,i=t.values;if(n.length!==i.length)throw new pt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let o=0;o<n.length;o+=2){if(n[o]!==i[o])throw new pt(`Cannot interpolate values containing mismatched anchors. from[${o}]: ${n[o]}, to[${o}]: ${i[o]}`);a.push(n[o]);const[e,t]=n[o+1],[s,l]=i[o+1];a.push([Ot(e,s,r),Ot(t,l,r)])}return new at(a)}};class jt{constructor(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[a,o]of i)this.labels.push(a),this.outputs.push(o)}static interpolationFactor(e,t,r,n){let i=0;if("exponential"===e.name)i=Ft(t,e.base,r,n);else if("linear"===e.name)i=Ft(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;i=new zt(a[0],a[1],a[2],a[3]).solve(Ft(t,1,r,n))}return i}static parse(e,t){let[r,n,i,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(i=t.parse(i,2,me),!i)return null;const o=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=ve:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let l=0;l<a.length;l+=2){const e=a[l],r=a[l+1],n=l+3,i=l+4;if("number"!=typeof e)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=e)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(r,i,s);if(!c)return null;s=s||c.type,o.push([e,c])}return Ie(s,me)||Ie(s,ve)||Ie(s,ke)||Ie(s,Se)||Ie(s,Ae(me))?new jt(s,r,n,i,o):t.error(`Type ${Me(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);const a=Et(t,n),o=jt.interpolationFactor(this.interpolation,n,t[a],t[a+1]),s=r[a].evaluate(e),l=r[a+1].evaluate(e);switch(this.operator){case"interpolate":return Dt[this.type.kind](s,l,o);case"interpolate-hcl":return Dt.color(s,l,o,"hcl");case"interpolate-lab":return Dt.color(s,l,o,"lab")}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Ft(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}class Bt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const i=[];for(const o of e.slice(1)){const e=t.parse(o,1+i.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,i.push(e)}if(!r)throw new Error("No output type");const a=n&&i.some((e=>Ce(n,e.type)));return new Bt(a?be:r,i)}evaluate(e){let t,r=null,n=0;for(const i of this.args)if(n++,r=i.evaluate(e),r&&r instanceof ot&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function Nt(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Ut(e,t,r,n){return 0===n.compare(t,r)}function Vt(e,t,r){const n="=="!==e&&"!="!==e;return class i{constructor(e,t,r){this.type=ye,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let a=t.parse(e[1],1,be);if(!a)return null;if(!Nt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Me(a.type)}'.`);let o=t.parse(e[2],2,be);if(!o)return null;if(!Nt(r,o.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Me(o.type)}'.`);if(a.type.kind!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error(`Cannot compare types '${Me(a.type)}' and '${Me(o.type)}'.`);n&&("value"===a.type.kind&&"value"!==o.type.kind?a=new ft(o.type,[a]):"value"!==a.type.kind&&"value"===o.type.kind&&(o=new ft(a.type,[o])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==o.type.kind&&"value"!==a.type.kind&&"value"!==o.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,_e),!s)return null}return new i(a,o,s)}evaluate(i){const a=this.lhs.evaluate(i),o=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){const t=ct(a),r=ct(o);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new pt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ct(a),r=ct(o);if("string"!==e.kind||"string"!==r.kind)return t(i,a,o)}return this.collator?r(i,a,o,this.collator.evaluate(i)):t(i,a,o)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const qt=Vt("==",(function(e,t,r){return t===r}),Ut),Ht=Vt("!=",(function(e,t,r){return t!==r}),(function(e,t,r,n){return!Ut(0,t,r,n)})),Gt=Vt("<",(function(e,t,r){return t<r}),(function(e,t,r,n){return n.compare(t,r)<0})),Wt=Vt(">",(function(e,t,r){return t>r}),(function(e,t,r,n){return n.compare(t,r)>0})),$t=Vt("<=",(function(e,t,r){return t<=r}),(function(e,t,r,n){return n.compare(t,r)<=0})),Zt=Vt(">=",(function(e,t,r){return t>=r}),(function(e,t,r,n){return n.compare(t,r)>=0}));class Xt{constructor(e,t,r){this.type=_e,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ye);if(!n)return null;const i=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ye);if(!i)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,ge),!a)?null:new Xt(n,i,a)}evaluate(e){return new et(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}class Yt{constructor(e,t,r,n,i){this.type=ge,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,me);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let i=null;if(n.locale&&(i=t.parse(n.locale,1,ge),!i))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,ge),!a))return null;let o=null;if(n["min-fraction-digits"]&&(o=t.parse(n["min-fraction-digits"],1,me),!o))return null;let s=null;return n["max-fraction-digits"]&&(s=t.parse(n["max-fraction-digits"],1,me),!s)?null:new Yt(r,i,a,o,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Kt{constructor(e){this.type=we,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const n=[];let i=!1;for(let a=1;a<=e.length-1;++a){const r=e[a];if(i&&"object"==typeof r&&!Array.isArray(r)){i=!1;let e=null;if(r["font-scale"]&&(e=t.parse(r["font-scale"],1,me),!e))return null;let a=null;if(r["text-font"]&&(a=t.parse(r["text-font"],1,Ae(ge)),!a))return null;let o=null;if(r["text-color"]&&(o=t.parse(r["text-color"],1,ve),!o))return null;const s=n[n.length-1];s.scale=e,s.font=a,s.textColor=o}else{const r=t.parse(e[a],1,be);if(!r)return null;const o=r.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:r,scale:null,font:null,textColor:null})}}return new Kt(n)}evaluate(e){return new rt(this.sections.map((t=>{const r=t.content.evaluate(e);return ct(r)===Te?new tt("",r,null,null,null):new tt(ut(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class Jt{constructor(e){this.type=Te,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ge);return r?new Jt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=ot.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Qt{constructor(e){this.type=me,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Me(r.type)} instead.`):new Qt(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new pt(`Expected value to be of type string or array, but found ${Me(ct(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const er=8192;function tr(e,t){const r=(180+e[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,i=Math.pow(2,t.z);return[Math.round(r*i*er),Math.round(n*i*er)]}function rr(e,t){const r=Math.pow(2,t.z);return[(i=(e[0]/er+t.x)/r,360*i-180),(n=(e[1]/er+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*n)*Math.PI/180))-90)];var n,i}function nr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function ir(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function ar(e,t,r){const n=e[0]-t[0],i=e[1]-t[1],a=e[0]-r[0],o=e[1]-r[1];return n*o-a*i==0&&n*a<=0&&i*o<=0}function or(e,t,r,n){return 0!=(i=[n[0]-r[0],n[1]-r[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-i[1]*a[0]&&!(!pr(e,t,r,n)||!pr(r,n,e,t));var i,a}function sr(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(or(e,t,n[r],n[r+1]))return!0;return!1}function lr(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=!1;for(const s of t)for(let t=0;t<s.length-1;t++){if(ar(e,s[t],s[t+1]))return r;(a=s[t])[1]>(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-a[0])*(i[1]-a[1])/(o[1]-a[1])+a[0]&&(n=!n)}var i,a,o;return n}function cr(e,t){for(const r of t)if(lr(e,r))return!0;return!1}function ur(e,t){for(const r of e)if(!lr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(sr(e[r],e[r+1],t))return!1;return!0}function hr(e,t){for(const r of t)if(ur(e,r))return!0;return!1}function pr(e,t,r,n){const i=n[0]-r[0],a=n[1]-r[1],o=(e[0]-r[0])*a-i*(e[1]-r[1]),s=(t[0]-r[0])*a-i*(t[1]-r[1]);return o>0&&s<0||o<0&&s>0}function dr(e,t,r){const n=[];for(let i=0;i<e.length;i++){const a=[];for(let n=0;n<e[i].length;n++){const o=tr(e[i][n],r);nr(t,o),a.push(o)}n.push(a)}return n}function fr(e,t,r){const n=[];for(let i=0;i<e.length;i++){const a=dr(e[i],t,r);n.push(a)}return n}function mr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let i=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===i&&(i=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=i}nr(t,e)}function gr(e,t,r,n){const i=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],o=[];for(const s of e)for(const e of s){const n=[e.x+a[0],e.y+a[1]];mr(n,t,r,i),o.push(n)}return o}function yr(e,t,r,n){const i=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],o=[];for(const l of e){const e=[];for(const r of l){const n=[r.x+a[0],r.y+a[1]];nr(t,n),e.push(n)}o.push(e)}if(t[2]-t[0]<=i/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of o)for(const n of e)mr(n,t,r,i)}var s;return o}class vr{constructor(e,t){this.type=ye,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(lt(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length)return new vr(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new vr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new vr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const a=dr(t.coordinates,n,i),o=gr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!lr(e,a))return!1}if("MultiPolygon"===t.type){const a=fr(t.coordinates,n,i),o=gr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!cr(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],i=e.canonicalID();if("Polygon"===t.type){const a=dr(t.coordinates,n,i),o=yr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!ur(e,a))return!1}if("MultiPolygon"===t.type){const a=fr(t.coordinates,n,i),o=yr(e.geometry(),r,n,i);if(!ir(r,n))return!1;for(const e of o)if(!hr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let xr=class{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>e<t?-1:e>t?1:0;if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}};function br(e,t,r,n,i){_r(e,t,r,n||e.length-1,i||kr)}function _r(e,t,r,n,i){for(;n>r;){if(n-r>600){var a=n-r+1,o=t-r+1,s=Math.log(a),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(a-l)/a)*(o-a/2<0?-1:1);_r(e,t,Math.max(r,Math.floor(t-o*l/a+c)),Math.min(n,Math.floor(t+(a-o)*l/a+c)),i)}var u=e[t],h=r,p=n;for(wr(e,r,t),i(e[n],u)>0&&wr(e,r,n);h<p;){for(wr(e,h,p),h++,p--;i(e[h],u)<0;)h++;for(;i(e[p],u)>0;)p--}0===i(e[r],u)?wr(e,r,p):wr(e,++p,n),p<=t&&(r=p+1),t<=p&&(n=p-1)}}function wr(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function kr(e,t){return e<t?-1:e>t?1:0}function Tr(e,t){if(e.length<=1)return[e];const r=[];let n,i;for(const a of e){const e=Ar(a);0!==e&&(a.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(n&&r.push(n),n=[a]):n.push(a))}if(n&&r.push(n),t>1)for(let a=0;a<r.length;a++)r[a].length<=t||(br(r[a],t,1,r[a].length-1,Sr),r[a]=r[a].slice(0,t));return r}function Sr(e,t){return t.area-e.area}function Ar(e){let t=0;for(let r,n,i=0,a=e.length,o=a-1;i<a;o=i++)r=e[i],n=e[o],t+=(n.x-r.x)*(r.y+n.y);return t}const Mr=1/298.257223563,Er=Mr*(2-Mr),Cr=Math.PI/180;class Pr{constructor(e){const t=6378.137*Cr*1e3,r=Math.cos(e*Cr),n=1/(1-Er*(1-r*r)),i=Math.sqrt(n);this.kx=t*i*r,this.ky=t*i*n*(1-Er)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,i,a,o=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],c=e[s][1],u=this.wrap(e[s+1][0]-l)*this.kx,h=(e[s+1][1]-c)*this.ky,p=0;0===u&&0===h||(p=(this.wrap(t[0]-l)*this.kx*u+(t[1]-c)*this.ky*h)/(u*u+h*h),p>1?(l=e[s+1][0],c=e[s+1][1]):p>0&&(l+=u/this.kx*p,c+=h/this.ky*p)),u=this.wrap(t[0]-l)*this.kx,h=(t[1]-c)*this.ky;const d=u*u+h*h;d<o&&(o=d,r=l,n=c,i=s,a=p)}return{point:[r,n],index:i,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Lr(e,t){return t[0]-e[0]}function Ir(e){return e[1]-e[0]+1}function zr(e,t){return e[1]>=e[0]&&e[1]<t}function Or(e,t){if(e[0]>e[1])return[null,null];const r=Ir(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function Rr(e,t){if(!zr(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)nr(r,e[n]);return r}function Dr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)nr(t,e);return t}function jr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Fr(e,t,r){if(!jr(e)||!jr(t))return NaN;let n=0,i=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(i=e[1]-t[3]),e[3]<t[1]&&(i=t[1]-e[3]),r.distance([0,0],[n,i])}function Br(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Nr(e,t,r,n,i){const a=Math.min(Br(e,[r,n],i),Br(t,[r,n],i)),o=Math.min(Br(r,[e,t],i),Br(n,[e,t],i));return Math.min(a,o)}function Ur(e,t,r,n,i){if(!zr(t,e.length)||!zr(n,r.length))return 1/0;let a=1/0;for(let o=t[0];o<t[1];++o){const t=e[o],s=e[o+1];for(let e=n[0];e<n[1];++e){const n=r[e],o=r[e+1];if(or(t,s,n,o))return 0;a=Math.min(a,Nr(t,s,n,o,i))}}return a}function Vr(e,t,r,n,i){if(!zr(t,e.length)||!zr(n,r.length))return NaN;let a=1/0;for(let o=t[0];o<=t[1];++o)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,i.distance(e[o],r[t])),0===a)return a;return a}function qr(e,t,r){if(lr(e,t,!0))return 0;let n=1/0;for(const i of t){const t=i[0],a=i[i.length-1];if(t!==a&&(n=Math.min(n,Br(e,[a,t],r)),0===n))return n;const o=r.pointOnLine(i,e);if(n=Math.min(n,r.distance(e,o.point)),0===n)return n}return n}function Hr(e,t,r,n){if(!zr(t,e.length))return NaN;for(let a=t[0];a<=t[1];++a)if(lr(e[a],r,!0))return 0;let i=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],o=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(or(t,o,a,l))return 0;i=Math.min(i,Nr(t,o,a,l,n))}}return i}function Gr(e,t){for(const r of e)for(const e of r)if(lr(e,t,!0))return!0;return!1}function Wr(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0;const i=Dr(e),a=Dr(t);if(n!==1/0&&Fr(i,a,r)>=n)return n;if(ir(i,a)){if(Gr(e,t))return 0}else if(Gr(t,e))return 0;let o=1/0;for(const s of e)for(let e=0,n=s.length,i=n-1;e<n;i=e++){const n=s[i],a=s[e];for(const e of t)for(let t=0,i=e.length,s=i-1;t<i;s=t++){const i=e[s],l=e[t];if(or(n,a,i,l))return 0;o=Math.min(o,Nr(n,a,i,l,r))}}return o}function $r(e,t,r,n,i,a){if(!a)return;const o=Fr(Rr(n,a),i,r);o<t&&e.push([o,a,[0,0]])}function Zr(e,t,r,n,i,a,o){if(!a||!o)return;const s=Fr(Rr(n,a),Rr(i,o),r);s<t&&e.push([s,a,o])}function Xr(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1/0,a=Math.min(n.distance(e[0],r[0][0]),i);if(0===a)return a;const o=new xr([[0,[0,e.length-1],[0,0]]],Lr),s=Dr(r);for(;o.length>0;){const i=o.pop();if(i[0]>=a)continue;const l=i[1],c=t?50:100;if(Ir(l)<=c){if(!zr(l,e.length))return NaN;if(t){const t=Hr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const i=qr(e[t],r,n);if(a=Math.min(a,i),0===a)return 0}}else{const r=Or(l,t);$r(o,a,n,e,s,r[0]),$r(o,a,n,e,s,r[1])}}return a}function Yr(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1/0,o=Math.min(a,i.distance(e[0],r[0]));if(0===o)return o;const s=new xr([[0,[0,e.length-1],[0,r.length-1]]],Lr);for(;s.length>0;){const a=s.pop();if(a[0]>=o)continue;const l=a[1],c=a[2],u=t?50:100,h=n?50:100;if(Ir(l)<=u&&Ir(c)<=h){if(!zr(l,e.length)&&zr(c,r.length))return NaN;let a;if(t&&n)a=Ur(e,l,r,c,i),o=Math.min(o,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=c[0];e<=c[1];++e)if(a=Br(r[e],t,i),o=Math.min(o,a),0===o)return o}else if(!t&&n){const t=r.slice(c[0],c[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Br(e[r],t,i),o=Math.min(o,a),0===o)return o}else a=Vr(e,l,r,c,i),o=Math.min(o,a)}else{const a=Or(l,t),u=Or(c,n);Zr(s,o,i,e,r,a[0],u[0]),Zr(s,o,i,e,r,a[0],u[1]),Zr(s,o,i,e,r,a[1],u[0]),Zr(s,o,i,e,r,a[1],u[1])}}return o}function Kr(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Jr{constructor(e,t){this.type=me,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(lt(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Jr(t,t.features.map((e=>Kr(e.geometry))).flat());if("Feature"===t.type)return new Jr(t,Kr(t.geometry));if("type"in t&&"coordinates"in t)return new Jr(t,Kr(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>rr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Pr(n[0][1]);let a=1/0;for(const o of t){switch(o.type){case"Point":a=Math.min(a,Yr(n,!1,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Yr(n,!1,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!1,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map((t=>rr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;const i=new Pr(n[0][1]);let a=1/0;for(const o of t){switch(o.type){case"Point":a=Math.min(a,Yr(n,!0,[o.coordinates],!1,i,a));break;case"LineString":a=Math.min(a,Yr(n,!0,o.coordinates,!0,i,a));break;case"Polygon":a=Math.min(a,Xr(n,!0,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=Tr(r,0).map((t=>t.map((t=>t.map((t=>rr([t.x,t.y],e.canonical))))))),i=new Pr(n[0][0][0][1]);let a=1/0;for(const o of t)for(const e of n){switch(o.type){case"Point":a=Math.min(a,Xr([o.coordinates],!1,e,i,a));break;case"LineString":a=Math.min(a,Xr(o.coordinates,!0,e,i,a));break;case"Polygon":a=Math.min(a,Wr(e,o.coordinates,i,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Qr={"==":qt,"!=":Ht,">":Wt,"<":Gt,">=":Zt,"<=":$t,array:ft,at:wt,boolean:ft,case:At,coalesce:Bt,collator:Xt,format:Kt,image:Jt,in:kt,"index-of":Tt,interpolate:jt,"interpolate-hcl":jt,"interpolate-lab":jt,length:Qt,let:bt,literal:ht,match:St,number:ft,"number-format":Yt,object:ft,slice:Mt,step:Ct,string:ft,"to-boolean":gt,"to-color":gt,"to-number":gt,"to-string":gt,var:_t,within:vr,distance:Jr};class en{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],n=en.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const i=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=a.filter((t=>{let[r]=t;return!Array.isArray(r)||r.length===e.length-1}));let s=null;for(const[l,c]of o){s=new xt(t.registry,on,t.path,null,t.scope);const n=[];let a=!1;for(let t=1;t<e.length;t++){const r=e[t],i=Array.isArray(l)?l[t-1]:l.type,o=s.parse(r,1+n.length,i);if(!o){a=!0;break}n.push(o)}if(!a)if(Array.isArray(l)&&l.length!==n.length)s.error(`Expected ${l.length} arguments, but found ${n.length} instead.`);else{for(let e=0;e<n.length;e++){const t=Array.isArray(l)?l[e]:l.type,r=n[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new en(r,i,c,n)}}if(1===o.length)t.errors.push(...s.errors);else{const r=(o.length?o:a).map((e=>{let[t]=e;return r=t,Array.isArray(r)?`(${r.map(Me).join(", ")})`:`(${Me(r.type)}...)`;var r})).join(" | "),n=[];for(let i=1;i<e.length;i++){const r=t.parse(e[i],1+n.length);if(!r)return null;n.push(Me(r.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){en.definitions=t;for(const r in t)e[r]=en}}function tn(e,t){let[r,n,i,a]=t;r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);const o=a?a.evaluate(e):1,s=st(r,n,i,o);if(s)throw new pt(s);return new Qe(r/255,n/255,i/255,o,!1)}function rn(e,t){return e in t}function nn(e,t){const r=t[e];return void 0===r?null:r}function an(e){return{type:e}}function on(e){if(e instanceof _t)return on(e.boundExpression);if(e instanceof en&&"error"===e.name)return!1;if(e instanceof Xt)return!1;if(e instanceof vr)return!1;if(e instanceof Jr)return!1;const t=e instanceof gt||e instanceof ft;let r=!0;return e.eachChild((e=>{r=t?r&&on(e):r&&e instanceof ht})),!!r&&sn(e)&&cn(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function sn(e){if(e instanceof en){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof vr)return!1;if(e instanceof Jr)return!1;let t=!0;return e.eachChild((e=>{t&&!sn(e)&&(t=!1)})),t}function ln(e){if(e instanceof en&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!ln(e)&&(t=!1)})),t}function cn(e,t){if(e instanceof en&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!cn(e,t)&&(r=!1)})),r}function un(e){return{result:"success",value:e}}function hn(e){return{result:"error",value:e}}function pn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function dn(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function fn(e){return!!e.expression&&e.expression.interpolated}function mn(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function gn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function yn(e){return e}function vn(e,t){const r="color"===t.type,n=e.stops&&"object"==typeof e.stops[0][0],i=n||!(n||void 0!==e.property),a=e.type||(fn(t)?"exponential":"interval");if(r||"padding"===t.type){const n=r?Qe.parse:nt.parse;(e=he({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],n(e[1])]))),e.default=n(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==(o=e.colorSpace)&&"hcl"!==o&&"lab"!==o)throw new Error(`Unknown color space: "${e.colorSpace}"`);var o;let s,l,c;if("exponential"===a)s=wn;else if("interval"===a)s=_n;else if("categorical"===a){s=bn,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];c=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=kn}if(n){const r={},n=[];for(let t=0;t<e.stops.length;t++){const i=e.stops[t],a=i[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},n.push(a)),r[a].stops.push([i[0].value,i[1]])}const i=[];for(const e of n)i.push([r[e].zoom,vn(r[e],t)]);const a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:jt.interpolationFactor.bind(void 0,a),zoomStops:i.map((e=>e[0])),evaluate:(r,n)=>{let{zoom:a}=r;return wn({stops:i,base:e.base},t,a).evaluate(a,n)}}}if(i){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:jt.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:r=>{let{zoom:n}=r;return s(e,t,n,l,c)}}}return{kind:"source",evaluate(r,n){const i=n&&n.properties?n.properties[e.property]:void 0;return void 0===i?xn(e.default,t.default):s(e,t,i,l,c)}}}function xn(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function bn(e,t,r,n,i){return xn(typeof r===i?n[r]:void 0,e.default,t.default)}function _n(e,t,r){if("number"!==mn(r))return xn(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const i=Et(e.stops.map((e=>e[0])),r);return e.stops[i][1]}function wn(e,t,r){const n=void 0!==e.base?e.base:1;if("number"!==mn(r))return xn(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const a=Et(e.stops.map((e=>e[0])),r),o=function(e,t,r,n){const i=n-r,a=e-r;return 0===i?0:1===t?a/i:(Math.pow(t,a)-1)/(Math.pow(t,i)-1)}(r,n,e.stops[a][0],e.stops[a+1][0]),s=e.stops[a][1],l=e.stops[a+1][1],c=Dt[t.type]||yn;return"function"==typeof s.evaluate?{evaluate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];const i=s.evaluate.apply(void 0,r),a=l.evaluate.apply(void 0,r);if(void 0!==i&&void 0!==a)return c(i,a,o,e.colorSpace)}}:c(s,l,o,e.colorSpace)}function kn(e,t,r){switch(t.type){case"color":r=Qe.parse(r);break;case"formatted":r=rt.fromString(r.toString());break;case"resolvedImage":r=ot.fromString(r.toString());break;case"padding":r=nt.parse(r);break;default:mn(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return xn(r,e.default,t.default)}en.register(Qr,{error:[{kind:"error"},[ge],(e,t)=>{let[r]=t;throw new pt(r.evaluate(e))}],typeof:[ge,[be],(e,t)=>{let[r]=t;return Me(ct(r.evaluate(e)))}],"to-rgba":[Ae(me,4),[ve],(e,t)=>{let[r]=t;const[n,i,a,o]=r.evaluate(e).rgb;return[255*n,255*i,255*a,o]}],rgb:[ve,[me,me,me],tn],rgba:[ve,[me,me,me,me],tn],has:{type:ye,overloads:[[[ge],(e,t)=>{let[r]=t;return rn(r.evaluate(e),e.properties())}],[[ge,xe],(e,t)=>{let[r,n]=t;return rn(r.evaluate(e),n.evaluate(e))}]]},get:{type:be,overloads:[[[ge],(e,t)=>{let[r]=t;return nn(r.evaluate(e),e.properties())}],[[ge,xe],(e,t)=>{let[r,n]=t;return nn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[be,[ge],(e,t)=>{let[r]=t;return nn(r.evaluate(e),e.featureState||{})}],properties:[xe,[],e=>e.properties()],"geometry-type":[ge,[],e=>e.geometryType()],id:[be,[],e=>e.id()],zoom:[me,[],e=>e.globals.zoom],"heatmap-density":[me,[],e=>e.globals.heatmapDensity||0],"line-progress":[me,[],e=>e.globals.lineProgress||0],accumulated:[be,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[me,an(me),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[me,an(me),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:me,overloads:[[[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)-n.evaluate(e)}],[[me],(e,t)=>{let[r]=t;return-r.evaluate(e)}]]},"/":[me,[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)/n.evaluate(e)}],"%":[me,[me,me],(e,t)=>{let[r,n]=t;return r.evaluate(e)%n.evaluate(e)}],ln2:[me,[],()=>Math.LN2],pi:[me,[],()=>Math.PI],e:[me,[],()=>Math.E],"^":[me,[me,me],(e,t)=>{let[r,n]=t;return Math.pow(r.evaluate(e),n.evaluate(e))}],sqrt:[me,[me],(e,t)=>{let[r]=t;return Math.sqrt(r.evaluate(e))}],log10:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN10}],ln:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))}],log2:[me,[me],(e,t)=>{let[r]=t;return Math.log(r.evaluate(e))/Math.LN2}],sin:[me,[me],(e,t)=>{let[r]=t;return Math.sin(r.evaluate(e))}],cos:[me,[me],(e,t)=>{let[r]=t;return Math.cos(r.evaluate(e))}],tan:[me,[me],(e,t)=>{let[r]=t;return Math.tan(r.evaluate(e))}],asin:[me,[me],(e,t)=>{let[r]=t;return Math.asin(r.evaluate(e))}],acos:[me,[me],(e,t)=>{let[r]=t;return Math.acos(r.evaluate(e))}],atan:[me,[me],(e,t)=>{let[r]=t;return Math.atan(r.evaluate(e))}],min:[me,an(me),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[me,an(me),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[me,[me],(e,t)=>{let[r]=t;return Math.abs(r.evaluate(e))}],round:[me,[me],(e,t)=>{let[r]=t;const n=r.evaluate(e);return n<0?-Math.round(-n):Math.round(n)}],floor:[me,[me],(e,t)=>{let[r]=t;return Math.floor(r.evaluate(e))}],ceil:[me,[me],(e,t)=>{let[r]=t;return Math.ceil(r.evaluate(e))}],"filter-==":[ye,[ge,be],(e,t)=>{let[r,n]=t;return e.properties()[r.value]===n.value}],"filter-id-==":[ye,[be],(e,t)=>{let[r]=t;return e.id()===r.value}],"filter-type-==":[ye,[ge],(e,t)=>{let[r]=t;return e.geometryType()===r.value}],"filter-<":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<a}],"filter-id-<":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n<i}],"filter->":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>a}],"filter-id->":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>i}],"filter-<=":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i<=a}],"filter-id-<=":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n<=i}],"filter->=":[ye,[ge,be],(e,t)=>{let[r,n]=t;const i=e.properties()[r.value],a=n.value;return typeof i==typeof a&&i>=a}],"filter-id->=":[ye,[be],(e,t)=>{let[r]=t;const n=e.id(),i=r.value;return typeof n==typeof i&&n>=i}],"filter-has":[ye,[be],(e,t)=>{let[r]=t;return r.value in e.properties()}],"filter-has-id":[ye,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ye,[Ae(ge)],(e,t)=>{let[r]=t;return r.value.indexOf(e.geometryType())>=0}],"filter-id-in":[ye,[Ae(be)],(e,t)=>{let[r]=t;return r.value.indexOf(e.id())>=0}],"filter-in-small":[ye,[ge,Ae(be)],(e,t)=>{let[r,n]=t;return n.value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[ye,[ge,Ae(be)],(e,t)=>{let[r,n]=t;return function(e,t,r,n){for(;r<=n;){const i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:ye,overloads:[[[ye,ye],(e,t)=>{let[r,n]=t;return r.evaluate(e)&&n.evaluate(e)}],[an(ye),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ye,overloads:[[[ye,ye],(e,t)=>{let[r,n]=t;return r.evaluate(e)||n.evaluate(e)}],[an(ye),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ye,[ye],(e,t)=>{let[r]=t;return!r.evaluate(e)}],"is-supported-script":[ye,[ge],(e,t)=>{let[r]=t;const n=e.globals&&e.globals.isSupportedScript;return!n||n(r.evaluate(e))}],upcase:[ge,[ge],(e,t)=>{let[r]=t;return r.evaluate(e).toUpperCase()}],downcase:[ge,[ge],(e,t)=>{let[r]=t;return r.evaluate(e).toLowerCase()}],concat:[ge,an(be),(e,t)=>t.map((t=>ut(t.evaluate(e)))).join("")],"resolved-locale":[ge,[_e],(e,t)=>{let[r]=t;return r.evaluate(e).resolvedLocale()}]});class Tn{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new vt,this._defaultValue=t?"color"===(r=t).type&&gn(r.default)?new Qe(0,0,0,0):"color"===r.type?Qe.parse(r.default)||null:"padding"===r.type?nt.parse(r.default)||null:"variableAnchorOffsetCollection"===r.type?at.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,i,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=a||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new pt(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,"undefined"!=typeof console&&console.warn(o.message)),this._defaultValue}}}function Sn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Qr}function An(e,t){const r=new xt(Qr,on,[],t?function(e){const t={color:ve,string:ge,number:me,enum:ge,boolean:ye,formatted:we,padding:ke,resolvedImage:Te,variableAnchorOffsetCollection:Se};return"array"===e.type?Ae(t[e.value]||be,e.length):t[e.type]}(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?un(new Tn(n,t)):hn(r.errors)}class Mn{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ln(t.expression)}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}}class En{constructor(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ln(t.expression),this.interpolationType=n}evaluateWithoutErrorHandling(e,t,r,n,i,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,a)}evaluate(e,t,r,n,i,a){return this._styleExpression.evaluate(e,t,r,n,i,a)}interpolationFactor(e,t,r){return this.interpolationType?jt.interpolationFactor(this.interpolationType,e,t,r):0}}function Cn(e,t){const r=An(e,t);if("error"===r.result)return r;const n=r.value.expression,i=sn(n);if(!i&&!pn(t))return hn([new pe("","data expressions not supported")]);const a=cn(n,["zoom"]);if(!a&&!dn(t))return hn([new pe("","zoom expressions not supported")]);const o=Ln(n);return o||a?o instanceof pe?hn([o]):o instanceof jt&&!fn(t)?hn([new pe("",'"interpolate" expressions cannot be used with this property')]):un(o?new En(i?"camera":"composite",r.value,o.labels,o instanceof jt?o.interpolation:void 0):new Mn(i?"constant":"source",r.value)):hn([new pe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Pn{constructor(e,t){this._parameters=e,this._specification=t,he(this,vn(this._parameters,this._specification))}static deserialize(e){return new Pn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Ln(e){let t=null;if(e instanceof bt)t=Ln(e.result);else if(e instanceof Bt){for(const r of e.args)if(t=Ln(r),t)break}else(e instanceof Ct||e instanceof jt)&&e.input instanceof en&&"zoom"===e.input.name&&(t=e);return t instanceof pe||e.eachChild((e=>{const r=Ln(e);r instanceof pe?t=r:!t&&r?t=new pe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new pe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function In(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!In(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const zn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function On(e){if(null==e)return{filter:()=>!0,needGeometry:!1};In(e)||(e=jn(e));const t=An(e,zn);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,n)=>t.value.evaluate(e,r,{},n),needGeometry:Dn(e)}}function Rn(e,t){return e<t?-1:e>t?1:0}function Dn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(Dn(e[t]))return!0;return!1}function jn(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?Fn(e[1],e[2],"=="):"!="===t?Un(Fn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Fn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(jn))):"all"===t?["all"].concat(e.slice(1).map(jn)):"none"===t?["all"].concat(e.slice(1).map(jn).map(Un)):"in"===t?Bn(e[1],e.slice(2)):"!in"===t?Un(Bn(e[1],e.slice(2))):"has"===t?Nn(e[1]):"!has"!==t||Un(Nn(e[1]));var r}function Fn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Bn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Rn)]]:["filter-in-small",e,["literal",t]]}}function Nn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Un(e){return["!",e]}function Vn(e){const t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const r of e)t+=`${Vn(r)},`;return`${t}]`}const r=Object.keys(e).sort();let n="{";for(let i=0;i<r.length;i++)n+=`${JSON.stringify(r[i])}:${Vn(e[r[i]])},`;return`${n}}`}function qn(e){let t="";for(const r of Q)t+=`/${Vn(e[r])}`;return t}function Hn(e){const t=e.value;return t?[new ue(e.key,t,"constants have been deprecated as of v8")]:[]}function Gn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Wn(e){if(Array.isArray(e))return e.map(Wn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=Wn(e[r]);return t}return Gn(e)}function $n(e){const t=e.key,r=e.value,n=e.valueSpec||{},i=e.objectElementValidators||{},a=e.style,o=e.styleSpec,s=e.validateSpec;let l=[];const c=mn(r);if("object"!==c)return[new ue(t,r,`object expected, ${c} found`)];for(const u in r){const e=u.split(".")[0],c=n[e]||n["*"];let h;if(i[e])h=i[e];else if(n[e])h=s;else if(i["*"])h=i["*"];else{if(!n["*"]){l.push(new ue(t,r[u],`unknown property "${u}"`));continue}h=s}l=l.concat(h({key:(t?`${t}.`:t)+u,value:r[u],valueSpec:c,style:a,styleSpec:o,object:r,objectKey:u,validateSpec:s},r))}for(const u in n)i[u]||n[u].required&&void 0===n[u].default&&void 0===r[u]&&l.push(new ue(t,r,`missing required property "${u}"`));return l}function Zn(e){const t=e.value,r=e.valueSpec,n=e.style,i=e.styleSpec,a=e.key,o=e.arrayElementValidator||e.validateSpec;if("array"!==mn(t))return[new ue(a,t,`array expected, ${mn(t)} found`)];if(r.length&&t.length!==r.length)return[new ue(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new ue(a,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let s={type:r.value,values:r.values};i.$version<7&&(s.function=r.function),"object"===mn(r.value)&&(s=r.value);let l=[];for(let c=0;c<t.length;c++)l=l.concat(o({array:t,arrayIndex:c,value:t[c],valueSpec:s,validateSpec:e.validateSpec,style:n,styleSpec:i,key:`${a}[${c}]`}));return l}function Xn(e){const t=e.key,r=e.value,n=e.valueSpec;let i=mn(r);return"number"===i&&r!=r&&(i="NaN"),"number"!==i?[new ue(t,r,`number expected, ${i} found`)]:"minimum"in n&&r<n.minimum?[new ue(t,r,`${r} is less than the minimum value ${n.minimum}`)]:"maximum"in n&&r>n.maximum?[new ue(t,r,`${r} is greater than the maximum value ${n.maximum}`)]:[]}function Yn(e){const t=e.valueSpec,r=Gn(e.value.type);let n,i,a,o={};const s="categorical"!==r&&void 0===e.value.property,l=!s,c="array"===mn(e.value.stops)&&"array"===mn(e.value.stops[0])&&"object"===mn(e.value.stops[0][0]),u=$n({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new ue(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const n=e.value;return t=t.concat(Zn({key:e.key,value:n,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===mn(n)&&0===n.length&&t.push(new ue(e.key,n,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&s&&u.push(new ue(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new ue(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!fn(e.valueSpec)&&u.push(new ue(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!pn(e.valueSpec)?u.push(new ue(e.key,e.value,"property functions not supported")):s&&!dn(e.valueSpec)&&u.push(new ue(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==e.value.property||u.push(new ue(e.key,e.value,'"property" property is required')),u;function h(e){let r=[];const n=e.value,s=e.key;if("array"!==mn(n))return[new ue(s,n,`array expected, ${mn(n)} found`)];if(2!==n.length)return[new ue(s,n,`array length 2 expected, length ${n.length} found`)];if(c){if("object"!==mn(n[0]))return[new ue(s,n,`object expected, ${mn(n[0])} found`)];if(void 0===n[0].zoom)return[new ue(s,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new ue(s,n,"object stop key must have value")];if(a&&a>Gn(n[0].zoom))return[new ue(s,n[0].zoom,"stop zoom values must appear in ascending order")];Gn(n[0].zoom)!==a&&(a=Gn(n[0].zoom),i=void 0,o={}),r=r.concat($n({key:`${s}[0]`,value:n[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Xn,value:p}}))}else r=r.concat(p({key:`${s}[0]`,value:n[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},n));return Sn(Wn(n[1]))?r.concat([new ue(`${s}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(e.validateSpec({key:`${s}[1]`,value:n[1],valueSpec:t,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function p(e,a){const s=mn(e.value),l=Gn(e.value),c=null!==e.value?e.value:a;if(n){if(s!==n)return[new ue(e.key,c,`${s} stop domain type must match previous stop domain type ${n}`)]}else n=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ue(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let n=`number expected, ${s} found`;return pn(t)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ue(e.key,c,n)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==i&&l<i?[new ue(e.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===r&&l in o?[new ue(e.key,c,"stop domain values must be unique")]:(o[l]=!0,[])):[new ue(e.key,c,`integer expected, found ${l}`)]}}function Kn(e){const t=("property"===e.expressionContext?Cn:An)(Wn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new ue(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new ue(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!ln(r))return[new ue(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!ln(r))return[new ue(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!cn(r,["zoom","feature-state"]))return[new ue(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!sn(r))return[new ue(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jn(e){const t=e.key,r=e.value,n=e.valueSpec,i=[];return Array.isArray(n.values)?-1===n.values.indexOf(Gn(r))&&i.push(new ue(t,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(Gn(r))&&i.push(new ue(t,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),i}function Qn(e){return In(Wn(e.value))?Kn(he({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ei(e)}function ei(e){const t=e.value,r=e.key;if("array"!==mn(t))return[new ue(r,t,`array expected, ${mn(t)} found`)];const n=e.styleSpec;let i,a=[];if(t.length<1)return[new ue(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Jn({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),Gn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===Gn(t[1])&&a.push(new ue(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&a.push(new ue(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=mn(t[1]),"string"!==i&&a.push(new ue(`${r}[1]`,t[1],`string expected, ${i} found`)));for(let o=2;o<t.length;o++)i=mn(t[o]),"$type"===Gn(t[1])?a=a.concat(Jn({key:`${r}[${o}]`,value:t[o],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new ue(`${r}[${o}]`,t[o],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let n=1;n<t.length;n++)a=a.concat(ei({key:`${r}[${n}]`,value:t[n],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=mn(t[1]),2!==t.length?a.push(new ue(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==i&&a.push(new ue(`${r}[1]`,t[1],`string expected, ${i} found`))}return a}function ti(e,t){const r=e.key,n=e.validateSpec,i=e.style,a=e.styleSpec,o=e.value,s=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];const c=s.match(/^(.*)-transition$/);if("paint"===t&&c&&l[c[1]]&&l[c[1]].transition)return n({key:r,value:o,valueSpec:a.transition,style:i,styleSpec:a});const u=e.valueSpec||l[s];if(!u)return[new ue(r,o,`unknown property "${s}"`)];let h;if("string"===mn(o)&&pn(u)&&!u.tokens&&(h=/^{([^}]+)}$/.exec(o)))return[new ue(r,o,`"${s}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(h[1])} }\`.`)];const p=[];return"symbol"===e.layerType&&("text-field"===s&&i&&!i.glyphs&&p.push(new ue(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&gn(Wn(o))&&"identity"===Gn(o.type)&&p.push(new ue(r,o,'"text-font" does not support identity functions'))),p.concat(n({key:e.key,value:o,valueSpec:u,style:i,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:s}))}function ri(e){return ti(e,"paint")}function ni(e){return ti(e,"layout")}function ii(e){let t=[];const r=e.value,n=e.key,i=e.style,a=e.styleSpec;r.type||r.ref||t.push(new ue(n,r,'either "type" or "ref" is required'));let o=Gn(r.type);const s=Gn(r.ref);if(r.id){const a=Gn(r.id);for(let o=0;o<e.arrayIndex;o++){const e=i.layers[o];Gn(e.id)===a&&t.push(new ue(n,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new ue(n,r[e],`"${e}" is prohibited for ref layers`))})),i.layers.forEach((t=>{Gn(t.id)===s&&(e=t)})),e?e.ref?t.push(new ue(n,r.ref,"ref cannot reference another ref layer")):o=Gn(e.type):t.push(new ue(n,r.ref,`ref layer "${s}" not found`))}else if("background"!==o)if(r.source){const e=i.sources&&i.sources[r.source],a=e&&Gn(e.type);e?"vector"===a&&"raster"===o?t.push(new ue(n,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===o?t.push(new ue(n,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==o?t.push(new ue(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==o?t.push(new ue(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==o||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&e.lineMetrics||t.push(new ue(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ue(n,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ue(n,r.source,`source "${r.source}" not found`))}else t.push(new ue(n,r,'missing required property "source"'));return t=t.concat($n({key:n,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${n}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Qn,layout:e=>$n({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>ni(he({layerType:o},e))}}),paint:e=>$n({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>ri(he({layerType:o},e))}})}})),t}function ai(e){const t=e.value,r=e.key,n=mn(t);return"string"!==n?[new ue(r,t,`string expected, ${n} found`)]:[]}const oi={promoteId:function(e){let{key:t,value:r}=e;if("string"===mn(r))return ai({key:t,value:r});{const e=[];for(const n in r)e.push(...ai({key:`${t}.${n}`,value:r[n]}));return e}}};function si(e){const t=e.value,r=e.key,n=e.styleSpec,i=e.style,a=e.validateSpec;if(!t.type)return[new ue(r,t,'"type" is required')];const o=Gn(t.type);let s;switch(o){case"vector":case"raster":return s=$n({key:r,value:t,valueSpec:n[`source_${o.replace("-","_")}`],style:e.style,styleSpec:n,objectElementValidators:oi,validateSpec:a}),s;case"raster-dem":return s=function(e){var t;const r=null!==(t=e.sourceName)&&void 0!==t?t:"",n=e.value,i=e.styleSpec,a=i.source_raster_dem,o=e.style;let s=[];const l=mn(n);if(void 0===n)return s;if("object"!==l)return s.push(new ue("source_raster_dem",n,`object expected, ${l} found`)),s;const c="custom"===Gn(n.encoding),u=["redFactor","greenFactor","blueFactor","baseShift"],h=e.value.encoding?`"${e.value.encoding}"`:"Default";for(const p in n)!c&&u.includes(p)?s.push(new ue(p,n[p],`In "${r}": "${p}" is only valid when "encoding" is set to "custom". ${h} encoding found`)):a[p]?s=s.concat(e.validateSpec({key:p,value:n[p],valueSpec:a[p],validateSpec:e.validateSpec,style:o,styleSpec:i})):s.push(new ue(p,n[p],`unknown property "${p}"`));return s}({sourceName:r,value:t,style:e.style,styleSpec:n,validateSpec:a}),s;case"geojson":if(s=$n({key:r,value:t,valueSpec:n.source_geojson,style:i,styleSpec:n,validateSpec:a,objectElementValidators:oi}),t.cluster)for(const e in t.clusterProperties){const[n,i]=t.clusterProperties[e],o="string"==typeof n?[n,["accumulated"],["get",e]]:n;s.push(...Kn({key:`${r}.${e}.map`,value:i,validateSpec:a,expressionContext:"cluster-map"})),s.push(...Kn({key:`${r}.${e}.reduce`,value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return $n({key:r,value:t,valueSpec:n.source_video,style:i,validateSpec:a,styleSpec:n});case"image":return $n({key:r,value:t,valueSpec:n.source_image,style:i,validateSpec:a,styleSpec:n});case"canvas":return[new ue(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:i,validateSpec:a,styleSpec:n})}}function li(e){const t=e.value,r=e.styleSpec,n=r.light,i=e.style;let a=[];const o=mn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new ue("light",t,`object expected, ${o} found`)]),a;for(const s in t){const o=s.match(/^(.*)-transition$/);a=a.concat(o&&n[o[1]]&&n[o[1]].transition?e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:i,styleSpec:r}):n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)])}return a}function ci(e){const t=e.value,r=e.styleSpec,n=r.sky,i=e.style,a=mn(t);if(void 0===t)return[];if("object"!==a)return[new ue("sky",t,`object expected, ${a} found`)];let o=[];for(const s in t)o=o.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return o}function ui(e){const t=e.value,r=e.styleSpec,n=r.terrain,i=e.style;let a=[];const o=mn(t);if(void 0===t)return a;if("object"!==o)return a=a.concat([new ue("terrain",t,`object expected, ${o} found`)]),a;for(const s in t)a=a.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],validateSpec:e.validateSpec,style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return a}function hi(e){let t=[];const r=e.value,n=e.key;if(Array.isArray(r)){const i=[],a=[];for(const o in r)r[o].id&&i.includes(r[o].id)&&t.push(new ue(n,r,`all the sprites' ids must be unique, but ${r[o].id} is duplicated`)),i.push(r[o].id),r[o].url&&a.includes(r[o].url)&&t.push(new ue(n,r,`all the sprites' URLs must be unique, but ${r[o].url} is duplicated`)),a.push(r[o].url),t=t.concat($n({key:`${n}[${o}]`,value:r[o],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return ai({key:n,value:r})}const pi={"*":()=>[],array:Zn,boolean:function(e){const t=e.value,r=e.key,n=mn(t);return"boolean"!==n?[new ue(r,t,`boolean expected, ${n} found`)]:[]},number:Xn,color:function(e){const t=e.key,r=e.value,n=mn(r);return"string"!==n?[new ue(t,r,`color expected, ${n} found`)]:Qe.parse(String(r))?[]:[new ue(t,r,`color expected, "${r}" found`)]},constants:Hn,enum:Jn,filter:Qn,function:Yn,layer:ii,object:$n,source:si,light:li,sky:ci,terrain:ui,projection:function(e){const t=e.value,r=e.styleSpec,n=r.projection,i=e.style,a=mn(t);if(void 0===t)return[];if("object"!==a)return[new ue("projection",t,`object expected, ${a} found`)];let o=[];for(const s in t)o=o.concat(n[s]?e.validateSpec({key:s,value:t[s],valueSpec:n[s],style:i,styleSpec:r}):[new ue(s,t[s],`unknown property "${s}"`)]);return o},string:ai,formatted:function(e){return 0===ai(e).length?[]:Kn(e)},resolvedImage:function(e){return 0===ai(e).length?[]:Kn(e)},padding:function(e){const t=e.key,r=e.value;if("array"===mn(r)){if(r.length<1||r.length>4)return[new ue(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const n={type:"number"};let i=[];for(let a=0;a<r.length;a++)i=i.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:n}));return i}return Xn({key:t,value:r,valueSpec:{}})},variableAnchorOffsetCollection:function(e){const t=e.key,r=e.value,n=mn(r),i=e.styleSpec;if("array"!==n||r.length<1||r.length%2!=0)return[new ue(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let o=0;o<r.length;o+=2)a=a.concat(Jn({key:`${t}[${o}]`,value:r[o],valueSpec:i.layout_symbol["text-anchor"]})),a=a.concat(Zn({key:`${t}[${o+1}]`,value:r[o+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:i}));return a},sprite:hi};function di(e){const t=e.value,r=e.valueSpec,n=e.styleSpec;return e.validateSpec=di,r.expression&&gn(Gn(t))?Yn(e):r.expression&&Sn(Wn(t))?Kn(e):r.type&&pi[r.type]?pi[r.type](e):$n(he({},e,{valueSpec:r.type?n[r.type]:r}))}function fi(e){const t=e.value,r=e.key,n=ai(e);return n.length||(-1===t.indexOf("{fontstack}")&&n.push(new ue(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&n.push(new ue(r,t,'"glyphs" url must include a "{range}" token'))),n}function mi(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:J,r=[];return r=r.concat(di({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:di,objectElementValidators:{glyphs:fi,"*":()=>[]}})),e.constants&&(r=r.concat(Hn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:di}))),yi(r)}function gi(e){return function(t){return e(((e,t)=>r(e,i(t)))(((e,t)=>{for(var r in t||(t={}))l.call(t,r)&&u(e,r,t[r]);if(o)for(var r of o(t))c.call(t,r)&&u(e,r,t[r]);return e})({},t),{validateSpec:di}))}}function yi(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function vi(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return yi(e.apply(this,r))}}mi.source=vi(gi(si)),mi.sprite=vi(gi(hi)),mi.glyphs=vi(gi(fi)),mi.light=vi(gi(li)),mi.sky=vi(gi(ci)),mi.terrain=vi(gi(ui)),mi.layer=vi(gi(ii)),mi.filter=vi(gi(Qn)),mi.paintProperty=vi(gi(ri)),mi.layoutProperty=vi(gi(ni));const xi=mi,bi=xi.light,_i=xi.sky,wi=xi.paintProperty,ki=xi.layoutProperty;function Ti(e,t){let r=!1;if(t&&t.length)for(const n of t)e.fire(new Y(new Error(n.message))),r=!0;return r}class Si{constructor(e,t,r){const n=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const i=new Int32Array(this.arrayBuffer);e=i[0],this.d=(t=i[1])+2*(r=i[2]);for(let e=0;e<this.d*this.d;e++){const t=i[3+e],r=i[3+e+1];n.push(t===r?null:i.subarray(t,r))}const a=i[3+n.length+1];this.keys=i.subarray(i[3+n.length],a),this.bboxes=i.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)n.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;const i=r/t*e;this.min=-i,this.max=e+i}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,n,i,a){this.cells[i].push(a)}query(e,t,r,n,i){const a=this.min,o=this.max;if(e<=a&&t<=a&&o<=r&&o<=n&&!i)return Array.prototype.slice.call(this.keys);{const a=[];return this._forEachCell(e,t,r,n,this._queryCell,a,{},i),a}}_queryCell(e,t,r,n,i,a,o,s){const l=this.cells[i];if(null!==l){const i=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){const h=l[u];if(void 0===o[h]){const l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):e<=c[l+2]&&t<=c[l+3]&&r>=c[l+0]&&n>=c[l+1])?(o[h]=!0,a.push(i[h])):o[h]=!1}}}}_forEachCell(e,t,r,n,i,a,o,s){const l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++){const c=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&i.call(this,e,t,r,n,c,a,o,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,t=3+this.cells.length+1+1;let r=0;for(let a=0;a<this.cells.length;a++)r+=this.cells[a].length;const n=new Int32Array(t+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;let i=t;for(let a=0;a<e.length;a++){const t=e[a];n[3+a]=i,n.set(t,i),i+=t.length}return n[3+e.length]=i,n.set(this.keys,i),i+=this.keys.length,n[3+e.length+1]=i,n.set(this.bboxes,i),i+=this.bboxes.length,n.buffer}static serialize(e,t){const r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(e){return new Si(e.buffer)}}const Ai={};function Mi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ai[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ai[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}Mi("Object",Object),Mi("TransferableGridIndex",Si),Mi("Color",Qe),Mi("Error",Error),Mi("AJAXError",q),Mi("ResolvedImage",ot),Mi("StylePropertyFunction",Pn),Mi("StyleExpression",Tn,{omit:["_evaluator"]}),Mi("ZoomDependentExpression",En),Mi("ZoomConstantExpression",Mn),Mi("CompoundExpression",en,{omit:["_evaluate"]});for(const r in Qr)Qr[r]._classRegistryKey||Mi(`Expression_${r}`,Qr[r]);function Ei(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ci(e){return e.$name||e.constructor._classRegistryKey}function Pi(e){return!function(e){if(null===e||"object"!=typeof e)return!1;const t=Ci(e);return!(!t||"Object"===t)}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||Ei(e)||z(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function Li(e,t){if(Pi(e))return(Ei(e)||z(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const n of e)r.push(Li(n,t));return r}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);const r=Ci(e);if(!r)throw new Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!Ai[r])throw new Error(`${r} is not registered.`);const{klass:n}=Ai[r],i=n.serialize?n.serialize(e,t):{};if(n.serialize){if(t&&i===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const n in e){if(!e.hasOwnProperty(n))continue;if(Ai[r].omit.indexOf(n)>=0)continue;const a=e[n];i[n]=Ai[r].shallow.indexOf(n)>=0?a:Li(a,t)}e instanceof Error&&(i.message=e.message)}if(i.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(i.$name=r),i}function Ii(e){if(Pi(e))return e;if(Array.isArray(e))return e.map(Ii);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);const t=Ci(e)||"Object";if(!Ai[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Ai[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const n=Object.create(r.prototype);for(const i of Object.keys(e)){if("$name"===i)continue;const r=e[i];n[i]=Ai[t].shallow.indexOf(i)>=0?r:Ii(r)}return n}class zi{constructor(){this.first=!0}update(e,t){const r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}const Oi=e=>e>=128&&e<=255,Ri=e=>e>=6016&&e<=6143,Di=e=>e>=8192&&e<=8303,ji=e=>e>=8448&&e<=8527,Fi=e=>e>=8528&&e<=8591,Bi=e=>e>=8960&&e<=9215,Ni=e=>e>=9216&&e<=9279,Ui=e=>e>=9280&&e<=9311,Vi=e=>e>=9312&&e<=9471,qi=e=>e>=9632&&e<=9727,Hi=e=>e>=9728&&e<=9983,Gi=e=>e>=11008&&e<=11263,Wi=e=>e>=12272&&e<=12287,$i=e=>e>=12288&&e<=12351,Zi=e=>e>=12448&&e<=12543,Xi=e=>e>=12688&&e<=12703,Yi=e=>e>=12736&&e<=12783,Ki=e=>e>=12800&&e<=13055,Ji=e=>e>=13056&&e<=13311,Qi=e=>e>=19904&&e<=19967,ea=e=>e>=57344&&e<=63743,ta=e=>e>=65040&&e<=65055,ra=e=>e>=65072&&e<=65103,na=e=>e>=65104&&e<=65135,ia=e=>e>=65280&&e<=65519;function aa(e){for(const t of e)if(ha(t.charCodeAt(0)))return!0;return!1}function oa(e){for(const t of e)if(!ca(t.charCodeAt(0)))return!1;return!0}function sa(e){const t=e.map((e=>{try{return new RegExp(`\\p{sc=${e}}`,"u").source}catch(t){return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}const la=sa(["Arab","Dupl","Mong","Ougr","Syrc"]);function ca(e){return!la.test(String.fromCodePoint(e))}const ua=sa(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ha(e){return!(746!==e&&747!==e&&(e<4352||!(ra(e)&&!(e>=65097&&e<=65103)||Ji(e)||Yi(e)||!(!$i(e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Ki(e)||Wi(e)||Xi(e)||Zi(e)&&12540!==e||!(!ia(e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!na(e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||ta(e)||Qi(e)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(e))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(e))||ua.test(String.fromCodePoint(e)))))}function pa(e){return!(ha(e)||(t=e,Oi(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Di(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||ji(t)||Fi(t)||Bi(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Ni(t)&&9251!==t||Ui(t)||Vi(t)||qi(t)||Hi(t)&&!(t>=9754&&t<=9759)||Gi(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||$i(t)||Zi(t)||ea(t)||ra(t)||na(t)||ia(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}const da=sa(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function fa(e){return da.test(String.fromCodePoint(e))}function ma(e,t){return!(!t&&fa(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ri(e))}function ga(e){for(const t of e)if(fa(t.charCodeAt(0)))return!0;return!1}const ya=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class va{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new zi,this.transition={})}isSupportedScript(e){return function(e,t){for(const r of e)if(!ma(r.charCodeAt(0),t))return!1;return!0}(e,"loaded"===ya.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}class xa{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(gn(e))return new Pn(e,t);if(Sn(e)){const r=Cn(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Qe.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=at.parse(e)):r=nt.parse(e),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class ba{constructor(e){this.property=e,this.value=new xa(e,void 0)}transitioned(e,t){return new wa(this.property,this.value,t,k({},e.transition,this.transition),e.now)}untransitioned(){return new wa(this.property,this.value,null,{},0)}}class _a{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return M(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ba(this._values[e].property)),this._values[e].value=new xa(this._values[e].property,null===t?void 0:M(t))}getTransition(e){return M(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new ba(this._values[e].property)),this._values[e].transition=M(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const n=this.getTransition(t);void 0!==n&&(e[`${t}-transition`]=n)}return e}transitioned(e,t){const r=new ka(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].transitioned(e,t._values[n]);return r}untransitioned(){const e=new ka(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class wa{constructor(e,t,r,n,i){this.property=e,this.value=t,this.begin=i+n.delay||0,this.end=this.begin+n.duration||0,e.specification.transition&&(n.delay||n.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const n=e.now||0,i=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(n>this.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(n<this.begin)return a.possiblyEvaluate(e,t,r);{const o=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),i,function(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(o))}}return i}}class ka{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ta{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}hasValue(e){return void 0!==this._values[e].value}getValue(e){return M(this._values[e].value)}setValue(e,t){this._values[e]=new xa(this._values[e].property,null===t?void 0:M(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const n=new Aa(this._properties);for(const i of Object.keys(this._values))n._values[i]=this._values[i].possiblyEvaluate(e,t,r);return n}}class Sa{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,n){return this.property.evaluate(this.value,this.parameters,e,t,r,n)}}class Aa{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Ma{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){const n=Dt[this.specification.type];return n?n(e,t,r):e}}class Ea{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,n){return new Sa(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,n)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Sa(this,{kind:"constant",value:void 0},e.parameters);const n=Dt[this.specification.type];if(n){const i=n(e.value.value,t.value.value,r);return new Sa(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,n,i,a){return"constant"===e.kind?e.value:e.evaluate(t,r,n,i,a)}}class Ca extends Ea{possiblyEvaluate(e,t,r,n){if(void 0===e.value)return new Sa(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n),a="resolvedImage"===e.property.specification.type&&"string"!=typeof i?i.name:i,o=this._calculate(a,a,a,t);return new Sa(this,{kind:"constant",value:o},t)}if("camera"===e.expression.kind){const r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Sa(this,{kind:"constant",value:r},t)}return new Sa(this,e.expression,t)}evaluate(e,t,r,n,i,a){if("source"===e.kind){const o=e.evaluate(t,r,n,i,a);return this._calculate(o,o,o,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,n),e.evaluate({zoom:Math.floor(t.zoom)},r,n),e.evaluate({zoom:Math.floor(t.zoom)+1},r,n),t):e.value}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class Pa{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){const i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new va(Math.floor(t.zoom-1),t)),e.expression.evaluate(new va(Math.floor(t.zoom),t)),e.expression.evaluate(new va(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class La{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)}interpolate(){return!1}}class Ia{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const t in e){const r=e[t];r.specification.overridable&&this.overridableProperties.push(t);const n=this.defaultPropertyValues[t]=new xa(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new ba(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}}}Mi("DataDrivenProperty",Ea),Mi("DataConstantProperty",Ma),Mi("CrossFadedDataDrivenProperty",Ca),Mi("CrossFadedProperty",Pa),Mi("ColorRampProperty",La);const za="-transition";class Oa extends K{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new Ta(t.layout)),t.paint)){this._transitionablePaint=new _a(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Aa(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};null!=t&&this._validate(ki,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(za)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!=t&&this._validate(wi,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(za))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{const r=this._transitionablePaint._values[e],n="cross-faded-data-driven"===r.property.specification["property-type"],i=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const o=this._transitionablePaint._values[e].value;return o.isDataDriven()||i||n||this._handleOverridablePaintPropertyUpdate(e,a,o)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),A(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!i||!1!==i.validate)&&Ti(this,e.call(xi,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:J,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof Sa&&pn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}const Ra={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Da{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ja{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Fa(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=0,n=0;return{members:e.map((e=>{const i=Ra[e.type].BYTES_PER_ELEMENT,a=r=Ba(r,Math.max(t,i)),o=e.components||1;return n=Math.max(n,i),r+=i*o,{name:e.name,type:e.type,components:o,offset:a}})),size:Ba(r,Math.max(n,t)),alignment:t}}function Ba(e,t){return Math.ceil(e/t)*t}class Na extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e}}Na.prototype.bytesPerElement=4,Mi("StructArrayLayout2i4",Na);class Ua extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e}}Ua.prototype.bytesPerElement=6,Mi("StructArrayLayout3i6",Ua);class Va extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=n,this.int16[a+3]=i,e}}Va.prototype.bytesPerElement=8,Mi("StructArrayLayout4i8",Va);class qa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}qa.prototype.bytesPerElement=12,Mi("StructArrayLayout2i4i12",qa);class Ha extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=a,this.uint8[l+7]=o,e}}Ha.prototype.bytesPerElement=8,Mi("StructArrayLayout2i4ub8",Ha);class Ga extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e}}Ga.prototype.bytesPerElement=8,Mi("StructArrayLayout2f8",Ga);class Wa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,a,o,s,l,c)}emplace(e,t,r,n,i,a,o,s,l,c,u){const h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=n,this.uint16[h+3]=i,this.uint16[h+4]=a,this.uint16[h+5]=o,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e}}Wa.prototype.bytesPerElement=20,Mi("StructArrayLayout10ui20",Wa);class $a extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c,u,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,n,i,a,o,s,l,c,u,h)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p){const d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=n,this.int16[d+3]=i,this.uint16[d+4]=a,this.uint16[d+5]=o,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,e}}$a.prototype.bytesPerElement=24,Mi("StructArrayLayout4i4ui4i24",$a);class Za extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}Za.prototype.bytesPerElement=12,Mi("StructArrayLayout3f12",Za);class Xa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Xa.prototype.bytesPerElement=4,Mi("StructArrayLayout1ul4",Xa);class Ya extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,a,o,s,l)}emplace(e,t,r,n,i,a,o,s,l,c){const u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=a,this.int16[u+5]=o,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e}}Ya.prototype.bytesPerElement=20,Mi("StructArrayLayout6i1ul2ui20",Ya);class Ka extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=a,this.int16[s+5]=o,e}}Ka.prototype.bytesPerElement=12,Mi("StructArrayLayout2i2i2i12",Ka);class Ja extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i)}emplace(e,t,r,n,i,a){const o=4*e,s=8*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.int16[s+6]=i,this.int16[s+7]=a,e}}Ja.prototype.bytesPerElement=16,Mi("StructArrayLayout2f1f2i16",Ja);class Qa extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i,a)}emplace(e,t,r,n,i,a,o){const s=16*e,l=4*e,c=8*e;return this.uint8[s+0]=t,this.uint8[s+1]=r,this.float32[l+1]=n,this.float32[l+2]=i,this.int16[c+6]=a,this.int16[c+7]=o,e}}Qa.prototype.bytesPerElement=16,Mi("StructArrayLayout2ub2f2i16",Qa);class eo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e}}eo.prototype.bytesPerElement=6,Mi("StructArrayLayout3ui6",eo);class to extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g){const y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y){const v=24*e,x=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=a,this.uint32[x+3]=o,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=h,this.float32[x+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e}}to.prototype.bytesPerElement=48,Mi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",to);class ro extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M){const E=this.length;return this.resize(E+1),this.emplace(E,e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M)}emplace(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S,A,M,E){const C=32*e,P=16*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=n,this.int16[C+3]=i,this.int16[C+4]=a,this.int16[C+5]=o,this.int16[C+6]=s,this.int16[C+7]=l,this.uint16[C+8]=c,this.uint16[C+9]=u,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=m,this.uint16[C+15]=g,this.uint16[C+16]=y,this.uint16[C+17]=v,this.uint16[C+18]=x,this.uint16[C+19]=b,this.uint16[C+20]=_,this.uint16[C+21]=w,this.uint16[C+22]=k,this.uint32[P+12]=T,this.float32[P+13]=S,this.float32[P+14]=A,this.uint16[C+30]=M,this.uint16[C+31]=E,e}}ro.prototype.bytesPerElement=64,Mi("StructArrayLayout8i15ui1ul2f2ui64",ro);class no extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}no.prototype.bytesPerElement=4,Mi("StructArrayLayout1f4",no);class io extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=3*e;return this.uint16[6*e+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e}}io.prototype.bytesPerElement=12,Mi("StructArrayLayout1ui2f12",io);class ao extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)}emplace(e,t,r,n){const i=4*e;return this.uint32[2*e+0]=t,this.uint16[i+2]=r,this.uint16[i+3]=n,e}}ao.prototype.bytesPerElement=8,Mi("StructArrayLayout1ul2ui8",ao);class oo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e}}oo.prototype.bytesPerElement=4,Mi("StructArrayLayout2ui4",oo);class so extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}so.prototype.bytesPerElement=2,Mi("StructArrayLayout1ui2",so);class lo extends ja{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,n){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)}emplace(e,t,r,n,i){const a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.float32[a+3]=i,e}}lo.prototype.bytesPerElement=16,Mi("StructArrayLayout4f16",lo);class co extends Da{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new h(this.anchorPointX,this.anchorPointY)}}co.prototype.size=20;class uo extends Ya{get(e){return new co(this,e)}}Mi("CollisionBoxArray",uo);class ho extends Da{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ho.prototype.size=48;class po extends to{get(e){return new ho(this,e)}}Mi("PlacedSymbolArray",po);class fo extends Da{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}fo.prototype.size=64;class mo extends ro{get(e){return new fo(this,e)}}Mi("SymbolInstanceArray",mo);class go extends no{getoffsetX(e){return this.float32[1*e+0]}}Mi("GlyphOffsetArray",go);class yo extends Ua{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}Mi("SymbolLineVertexArray",yo);class vo extends Da{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}vo.prototype.size=12;class xo extends io{get(e){return new vo(this,e)}}Mi("TextAnchorOffsetArray",xo);class bo extends Da{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}bo.prototype.size=8;class _o extends ao{get(e){return new bo(this,e)}}Mi("FeatureIndexArray",_o);class wo extends Na{}class ko extends Na{}class To extends Na{}class So extends qa{}class Ao extends Ha{}class Mo extends Ga{}class Eo extends Wa{}class Co extends $a{}class Po extends Za{}class Lo extends Xa{}class Io extends Ka{}class zo extends Qa{}class Oo extends eo{}class Ro extends oo{}const Do=Fa([{name:"a_pos",components:2,type:"Int16"}],4),{members:jo}=Do;class Fo{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=e}prepareSegment(e,t,r,n){let i=this.segments[this.segments.length-1];return e>Fo.MAX_VERTEX_ARRAY_LENGTH&&C(`Max vertices per segment is ${Fo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!i||i.vertexLength+e>Fo.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,n){return new Fo([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:n,vaos:{},sortKey:0}])}}function Bo(e,t){return 256*(e=_(Math.floor(e),0,255))+_(Math.floor(t),0,255)}Fo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Mi("SegmentVector",Fo);const No=Fa([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Uo={exports:{}},Vo={exports:{}};Vo.exports=function(e,t){var r,n,i,a,o,s,l,c;for(n=e.length-(r=3&e.length),i=t,o=3432918353,s=461845907,c=0;c<n;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,i=27492+(65535&(a=5*(65535&(i=(i^=l=(65535&(l=(l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0};var qo=Vo.exports,Ho={exports:{}};Ho.exports=function(e,t){for(var r,n=e.length,i=t^n,a=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++a;switch(n){case 3:i^=(255&e.charCodeAt(a+2))<<16;case 2:i^=(255&e.charCodeAt(a+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(a)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0};var Go=qo,Wo=Ho.exports;Uo.exports=Go,Uo.exports.murmur3=Go,Uo.exports.murmur2=Wo;var $o=n(Uo.exports);class Zo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,n){this.ids.push(Xo(e)),this.positions.push(t,r,n)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const t=Xo(e);let r=0,n=this.ids.length-1;for(;r<n;){const e=r+n>>1;this.ids[e]>=t?n=e:r=e+1}const i=[];for(;this.ids[r]===t;)i.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return i}static serialize(e,t){const r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return Yo(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}}static deserialize(e){const t=new Zo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function Xo(e){const t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:$o(String(e))}function Yo(e,t,r,n){for(;r<n;){const i=e[r+n>>1];let a=r-1,o=n+1;for(;;){do{a++}while(e[a]<i);do{o--}while(e[o]>i);if(a>=o)break;Ko(e,a,o),Ko(t,3*a,3*o),Ko(t,3*a+1,3*o+1),Ko(t,3*a+2,3*o+2)}o-r<n-o?(Yo(e,t,r,o),r=o+1):(Yo(e,t,o+1,n),n=o)}}function Ko(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}Mi("FeaturePositionMap",Zo);class Jo{constructor(e,t){this.gl=e.gl,this.location=t}}class Qo extends Jo{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class es extends Jo{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class ts extends Jo{constructor(e,t){super(e,t),this.current=Qe.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const rs=new Float32Array(16);function ns(e){return[Bo(255*e.r,255*e.g),Bo(255*e.b,255*e.a)]}class is{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new ts(e,t):new Qo(e,t)}}class as{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,n){const i="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;i&&e.set(i)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new es(e,t):new Qo(e,t)}}class os{constructor(e,t,r,n){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new n}populatePaintArray(e,t,r,n,i){const a=this.paintVertexArray.length,o=this.expression.evaluate(new va(0),t,{},n,[],i);this.paintVertexArray.resize(e),this._setPaintValue(a,e,o)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:0},r,n);this._setPaintValue(e,t,i)}_setPaintValue(e,t,r){if("color"===this.type){const n=ns(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class ss{constructor(e,t,r,n,i,a){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=n,this.zoom=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,n,i){const a=this.expression.evaluate(new va(this.zoom),t,{},n,[],i),o=this.expression.evaluate(new va(this.zoom+1),t,{},n,[],i),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,a,o)}updatePaintArray(e,t,r,n){const i=this.expression.evaluate({zoom:this.zoom},r,n),a=this.expression.evaluate({zoom:this.zoom+1},r,n);this._setPaintValue(e,t,i,a)}_setPaintValue(e,t,r,n){if("color"===this.type){const i=ns(r),a=ns(n);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1],a[0],a[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r,n);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(n))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){const r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,n=_(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(n)}getBinding(e,t,r){return new Qo(e,t)}}class ls{constructor(e,t,r,n,i,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=n,this.layerId=a,this.zoomInPaintVertexArray=new i,this.zoomOutPaintVertexArray=new i}populatePaintArray(e,t,r){const n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(n,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,n,i){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],i)}_setPaintValues(e,t,r,n){if(!n||!r)return;const{min:i,mid:a,max:o}=r,s=n[i],l=n[a],c=n[o];if(s&&l&&c)for(let u=e;u<t;u++)this.zoomInPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(u,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,No.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,No.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class cs{constructor(e,t,r){this.binders={},this._buffers=[];const n=[];for(const i in e.paint._values){if(!r(i))continue;const a=e.paint.get(i);if(!(a instanceof Sa&&pn(a.property.specification)))continue;const o=hs(i,e.type),s=a.value,l=a.property.specification.type,c=a.property.useIntegerZoom,u=a.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[i]=h?new as(s.value,o):new is(s.value,o,l),n.push(`/u_${i}`);else if("source"===s.kind||h){const r=ps(i,l,"source");this.binders[i]=h?new ls(s,l,c,t,r,e.id):new os(s,o,l,r),n.push(`/a_${i}`)}else{const e=ps(i,l,"composite");this.binders[i]=new ss(s,o,l,c,t,e),n.push(`/z_${i}`)}}this.cacheKey=n.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof os||t instanceof ss?t.maxValue:0}populatePaintArrays(e,t,r,n,i){for(const a in this.binders){const o=this.binders[a];(o instanceof os||o instanceof ss||o instanceof ls)&&o.populatePaintArray(e,t,r,n,i)}}setConstantPatternPositions(e,t){for(const r in this.binders){const n=this.binders[r];n instanceof as&&n.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,n,i){let a=!1;for(const o in e){const s=t.getPositions(o);for(const t of s){const s=r.feature(t.index);for(const r in this.binders){const l=this.binders[r];if((l instanceof os||l instanceof ss||l instanceof ls)&&!0===l.expression.isStateDependent){const c=n.paint.get(r);l.expression=c.value,l.updatePaintArray(t.start,t.end,s,e[o],i),a=!0}}}}return a}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof is||r instanceof as)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof os||r instanceof ss)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof ls)for(let t=0;t<No.members.length;t++)e.push(No.members[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof is||r instanceof as||r instanceof ss)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){const r=[];for(const n in this.binders){const i=this.binders[n];if(i instanceof is||i instanceof as||i instanceof ss)for(const a of i.uniformNames)if(t[a]){const o=i.getBinding(e,t[a],a);r.push({name:a,property:n,binding:o})}}return r}setUniforms(e,t,r,n){for(const{name:i,property:a,binding:o}of t)this.binders[a].setUniform(o,n,r.get(a),i)}updatePaintBuffers(e){this._buffers=[];for(const t in this.binders){const r=this.binders[t];if(e&&r instanceof ls){const t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof os||r instanceof ss)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof os||r instanceof ss||r instanceof ls)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof os||t instanceof ss||t instanceof ls)&&t.destroy()}}}class us{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;this.programConfigurations={};for(const n of e)this.programConfigurations[n.id]=new cs(n,t,r);this.needsUpload=!1,this._featureMap=new Zo,this._bufferOffset=0}populatePaintArrays(e,t,r,n,i,a){for(const o in this.programConfigurations)this.programConfigurations[o].populatePaintArrays(e,t,n,i,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,n){for(const i of r)this.needsUpload=this.programConfigurations[i.id].updatePaintArrays(e,this._featureMap,t,i,n)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function hs(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function ps(e,t,r){const n={color:{source:Ga,composite:lo},number:{source:no,composite:Ga}},i={"line-pattern":{source:Eo,composite:Eo},"fill-pattern":{source:Eo,composite:Eo},"fill-extrusion-pattern":{source:Eo,composite:Eo}}[e];return i&&i[r]||n[t][r]}Mi("ConstantBinder",is),Mi("CrossFadedConstantBinder",as),Mi("SourceExpressionBinder",os),Mi("CrossFadedCompositeBinder",ls),Mi("CompositeExpressionBinder",ss),Mi("ProgramConfiguration",cs,{omit:["_buffers"]}),Mi("ProgramConfigurationSet",us);const ds=8192,fs=Math.pow(2,14)-1,ms=-fs-1;function gs(e){const t=ds/e.extent,r=e.loadGeometry();for(let n=0;n<r.length;n++){const e=r[n];for(let r=0;r<e.length;r++){const n=e[r],i=Math.round(n.x*t),a=Math.round(n.y*t);n.x=_(i,ms,fs),n.y=_(a,ms,fs),(i<n.x||i>n.x+1||a<n.y||a>n.y+1)&&C("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function ys(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?gs(e):[]}}function vs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}class xs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ko,this.indexArray=new Oo,this.segments=new Fo,this.programConfigurations=new us(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){const n=this.layers[0],i=[];let a=null,o=!1;"circle"===n.type&&(a=n.layout.get("circle-sort-key"),o=!a.isConstant());for(const{feature:s,id:l,index:c,sourceLayerIndex:u}of e){const e=this.layers[0]._featureFilter.needGeometry,t=ys(s,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),t,r))continue;const n=o?a.evaluate(t,{},r):void 0,h={id:l,properties:s.properties,type:s.type,sourceLayerIndex:u,index:c,geometry:e?t.geometry:gs(s),patterns:{},sortKey:n};i.push(h)}o&&i.sort(((e,t)=>e.sortKey-t.sortKey));for(const s of i){const{geometry:n,index:i,sourceLayerIndex:a}=s,o=e[i].feature;this.addFeature(s,n,i,r),t.featureIndex.insert(o,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,jo),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,n){for(const i of t)for(const t of i){const r=t.x,n=t.y;if(r<0||r>=ds||n<0||n>=ds)continue;const i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=i.vertexLength;vs(this.layoutVertexArray,r,n,-1,-1),vs(this.layoutVertexArray,r,n,1,-1),vs(this.layoutVertexArray,r,n,1,1),vs(this.layoutVertexArray,r,n,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),i.vertexLength+=4,i.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)}}function bs(e,t){for(let r=0;r<e.length;r++)if(Cs(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Cs(e,t[r]))return!0;return!!Ts(e,t)}function _s(e,t,r){return!!Cs(e,t)||!!As(t,e,r)}function ws(e,t){if(1===e.length)return Es(t,e[0]);for(let r=0;r<t.length;r++){const n=t[r];for(let t=0;t<n.length;t++)if(Cs(e,n[t]))return!0}for(let r=0;r<e.length;r++)if(Es(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Ts(e,t[r]))return!0;return!1}function ks(e,t,r){if(e.length>1){if(Ts(e,t))return!0;for(let n=0;n<t.length;n++)if(As(t[n],e,r))return!0}for(let n=0;n<e.length;n++)if(As(e[n],t,r))return!0;return!1}function Ts(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const n=e[r],i=e[r+1];for(let e=0;e<t.length-1;e++)if(Ss(n,i,t[e],t[e+1]))return!0}return!1}function Ss(e,t,r,n){return P(e,r,n)!==P(t,r,n)&&P(e,t,r)!==P(e,t,n)}function As(e,t,r){const n=r*r;if(1===t.length)return e.distSqr(t[0])<n;for(let i=1;i<t.length;i++)if(Ms(e,t[i-1],t[i])<n)return!0;return!1}function Ms(e,t,r){const n=t.distSqr(r);if(0===n)return e.distSqr(t);const i=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/n;return e.distSqr(i<0?t:i>1?r:r.sub(t)._mult(i)._add(t))}function Es(e,t){let r,n,i,a=!1;for(let o=0;o<e.length;o++){r=e[o];for(let e=0,o=r.length-1;e<r.length;o=e++)n=r[e],i=r[o],n.y>t.y!=i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function Cs(e,t){let r=!1;for(let n=0,i=e.length-1;n<e.length;i=n++){const a=e[n],o=e[i];a.y>t.y!=o.y>t.y&&t.x<(o.x-a.x)*(t.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}function Ps(e,t,r){const n=r[0],i=r[2];if(e.x<n.x&&t.x<n.x||e.x>i.x&&t.x>i.x||e.y<n.y&&t.y<n.y||e.y>i.y&&t.y>i.y)return!1;const a=P(e,t,r[0]);return a!==P(e,t,r[1])||a!==P(e,t,r[2])||a!==P(e,t,r[3])}function Ls(e,t,r){const n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Is(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function zs(e,t,r,n,i){if(!t[0]&&!t[1])return e;const a=h.convert(t)._mult(i);"viewport"===r&&a._rotate(-n);const o=[];for(let s=0;s<e.length;s++)o.push(e[s].sub(a));return o}let Os,Rs;Mi("CircleBucket",xs,{omit:["layers"]});var Ds={get paint(){return Rs=Rs||new Ia({"circle-radius":new Ea(J.paint_circle["circle-radius"]),"circle-color":new Ea(J.paint_circle["circle-color"]),"circle-blur":new Ea(J.paint_circle["circle-blur"]),"circle-opacity":new Ea(J.paint_circle["circle-opacity"]),"circle-translate":new Ma(J.paint_circle["circle-translate"]),"circle-translate-anchor":new Ma(J.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Ma(J.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Ma(J.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ea(J.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ea(J.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ea(J.paint_circle["circle-stroke-opacity"])})},get layout(){return Os=Os||new Ia({"circle-sort-key":new Ea(J.layout_circle["circle-sort-key"])})}},js=1e-6,Fs="undefined"!=typeof Float32Array?Float32Array:Array;function Bs(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Ns(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*h+w*m,e[1]=x*i+b*l+_*p+w*g,e[2]=x*a+b*c+_*d+w*y,e[3]=x*o+b*u+_*f+w*v,e[4]=(x=r[4])*n+(b=r[5])*s+(_=r[6])*h+(w=r[7])*m,e[5]=x*i+b*l+_*p+w*g,e[6]=x*a+b*c+_*d+w*y,e[7]=x*o+b*u+_*f+w*v,e[8]=(x=r[8])*n+(b=r[9])*s+(_=r[10])*h+(w=r[11])*m,e[9]=x*i+b*l+_*p+w*g,e[10]=x*a+b*c+_*d+w*y,e[11]=x*o+b*u+_*f+w*v,e[12]=(x=r[12])*n+(b=r[13])*s+(_=r[14])*h+(w=r[15])*m,e[13]=x*i+b*l+_*p+w*g,e[14]=x*a+b*c+_*d+w*y,e[15]=x*o+b*u+_*f+w*v,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Us,Vs=Ns;function qs(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}Us=new Fs(4),Fs!=Float32Array&&(Us[0]=0,Us[1]=0,Us[2]=0,Us[3]=0);class Hs extends Oa{constructor(e){super(e,Ds)}createBucket(e){return new xs(e)}queryRadius(e){const t=e;return Ls("circle-radius",this,t)+Ls("circle-stroke-width",this,t)+Is(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o,s){const l=zs(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,o),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:(d=s,l.map((e=>Gs(e,d)))),p=u?c*o:c;var d;for(const f of n)for(const e of f){const t=u?e:Gs(e,s);let r=p;const n=qs([],[e.x,e.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=n[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/n[3]),_s(h,t,r))return!0}return!1}}function Gs(e,t){const r=qs([],[e.x,e.y,0,1],t);return new h(r[0]/r[3],r[1]/r[3])}class Ws extends xs{}let $s;Mi("HeatmapBucket",Ws,{omit:["layers"]});var Zs={get paint(){return $s=$s||new Ia({"heatmap-radius":new Ea(J.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ea(J.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Ma(J.paint_heatmap["heatmap-intensity"]),"heatmap-color":new La(J.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Ma(J.paint_heatmap["heatmap-opacity"])})}};function Xs(e,t,r,n){let{width:i,height:a}=t;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==i*a*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${i*a*r}`)}else n=new Uint8Array(i*a*r);return e.width=i,e.height=a,e.data=n,e}function Ys(e,t,r){let{width:n,height:i}=t;if(n===e.width&&i===e.height)return;const a=Xs({},{width:n,height:i},r);Ks(e,a,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,n),height:Math.min(e.height,i)},r),e.width=n,e.height=i,e.data=a.data}function Ks(e,t,r,n,i,a){if(0===i.width||0===i.height)return t;if(i.width>e.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");const o=e.data,s=t.data;if(o===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<i.height;l++){const c=((r.y+l)*e.width+r.x)*a,u=((n.y+l)*t.width+n.x)*a;for(let e=0;e<i.width*a;e++)s[u+e]=o[c+e]}return t}class Js{constructor(e,t){Xs(this,e,1,t)}resize(e){Ys(this,e,1)}clone(){return new Js({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Ks(e,t,r,n,i,1)}}class Qs{constructor(e,t){Xs(this,e,4,t)}resize(e){Ys(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Qs({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,n,i){Ks(e,t,r,n,i,4)}}function el(e){const t={},r=e.resolution||256,n=e.clips?e.clips.length:1,i=e.image||new Qs({width:r,height:n});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const a=(r,n,a)=>{t[e.evaluationKey]=a;const o=e.expression.evaluate(t);i.data[r+n+0]=Math.floor(255*o.r/o.a),i.data[r+n+1]=Math.floor(255*o.g/o.a),i.data[r+n+2]=Math.floor(255*o.b/o.a),i.data[r+n+3]=Math.floor(255*o.a)};if(e.clips)for(let o=0,s=0;o<n;++o,s+=4*r)for(let t=0,n=0;t<r;t++,n+=4){const i=t/(r-1),{start:l,end:c}=e.clips[o];a(s,n,l*(1-i)+c*i)}else for(let o=0,s=0;o<r;o++,s+=4)a(0,s,o/(r-1));return i}Mi("AlphaImage",Js),Mi("RGBAImage",Qs);const tl="big-fb";class rl extends Oa{createBucket(e){return new Ws(e)}constructor(e){super(e,Zs),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=el({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(tl)&&this.heatmapFbos.delete(tl)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let nl;var il={get paint(){return nl=nl||new Ia({"hillshade-illumination-direction":new Ma(J.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new Ma(J.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Ma(J.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Ma(J.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Ma(J.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Ma(J.paint_hillshade["hillshade-accent-color"])})}};class al extends Oa{constructor(e){super(e,il)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const ol=Fa([{name:"a_pos",components:2,type:"Int16"}],4),{members:sl}=ol;function ll(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;const n=t&&t.length,i=n?t[0]*r:e.length;let a=cl(e,0,i,r,!0);const o=[];if(!a||a.next===a.prev)return o;let s,l,c;if(n&&(a=function(e,t,r,n){const i=[];for(let a=0,o=t.length;a<o;a++){const r=cl(e,t[a]*n,a<o-1?t[a+1]*n:e.length,n,!1);r===r.next&&(r.steiner=!0),i.push(bl(r))}i.sort(gl);for(let a=0;a<i.length;a++)r=yl(i[a],r);return r}(e,t,a,r)),e.length>80*r){s=1/0,l=1/0;let t=-1/0,n=-1/0;for(let a=r;a<i;a+=r){const r=e[a],i=e[a+1];r<s&&(s=r),i<l&&(l=i),r>t&&(t=r),i>n&&(n=i)}c=Math.max(t-s,n-l),c=0!==c?32767/c:0}return hl(a,o,r,s,l,c,0),o}function cl(e,t,r,n,i){let a;if(i===function(e,t,r,n){let i=0;for(let a=t,o=r-n;a<r;a+=n)i+=(e[o]-e[a])*(e[a+1]+e[o+1]),o=a;return i}(e,t,r,n)>0)for(let o=t;o<r;o+=n)a=Pl(o/n|0,e[o],e[o+1],a);else for(let o=r-n;o>=t;o-=n)a=Pl(o/n|0,e[o],e[o+1],a);return a&&Tl(a,a.next)&&(Ll(a),a=a.next),a}function ul(e,t){if(!e)return e;t||(t=e);let r,n=e;do{if(r=!1,n.steiner||!Tl(n,n.next)&&0!==kl(n.prev,n,n.next))n=n.next;else{if(Ll(n),n=t=n.prev,n===n.next)break;r=!0}}while(r||n!==t);return t}function hl(e,t,r,n,i,a,o){if(!e)return;!o&&a&&function(e,t,r,n){let i=e;do{0===i.z&&(i.z=xl(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){let t,r=1;do{let n,i=e;e=null;let a=null;for(t=0;i;){t++;let o=i,s=0;for(let e=0;e<r&&(s++,o=o.nextZ,o);e++);let l=r;for(;s>0||l>0&&o;)0!==s&&(0===l||!o||i.z<=o.z)?(n=i,i=i.nextZ,s--):(n=o,o=o.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;i=o}a.nextZ=null,r*=2}while(t>1)}(i)}(e,n,i,a);let s=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(a?dl(e,n,i,a):pl(e))t.push(l.i,e.i,c.i),Ll(e),e=c.next,s=c.next;else if((e=c)===s){o?1===o?hl(e=fl(ul(e),t),t,r,n,i,a,2):2===o&&ml(e,t,r,n,i,a):hl(ul(e),t,r,n,i,a,1);break}}}function pl(e){const t=e.prev,r=e,n=e.next;if(kl(t,r,n)>=0)return!1;const i=t.x,a=r.x,o=n.x,s=t.y,l=r.y,c=n.y,u=i<a?i<o?i:o:a<o?a:o,h=s<l?s<c?s:c:l<c?l:c,p=i>a?i>o?i:o:a>o?a:o,d=s>l?s>c?s:c:l>c?l:c;let f=n.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&_l(i,s,a,l,o,c,f.x,f.y)&&kl(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function dl(e,t,r,n){const i=e.prev,a=e,o=e.next;if(kl(i,a,o)>=0)return!1;const s=i.x,l=a.x,c=o.x,u=i.y,h=a.y,p=o.y,d=s<l?s<c?s:c:l<c?l:c,f=u<h?u<p?u:p:h<p?h:p,m=s>l?s>c?s:c:l>c?l:c,g=u>h?u>p?u:p:h>p?h:p,y=xl(d,f,t,r,n),v=xl(m,g,t,r,n);let x=e.prevZ,b=e.nextZ;for(;x&&x.z>=y&&b&&b.z<=v;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,p,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,b.x>=d&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,p,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}for(;x&&x.z>=y;){if(x.x>=d&&x.x<=m&&x.y>=f&&x.y<=g&&x!==i&&x!==o&&_l(s,u,l,h,c,p,x.x,x.y)&&kl(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;b&&b.z<=v;){if(b.x>=d&&b.x<=m&&b.y>=f&&b.y<=g&&b!==i&&b!==o&&_l(s,u,l,h,c,p,b.x,b.y)&&kl(b.prev,b,b.next)>=0)return!1;b=b.nextZ}return!0}function fl(e,t){let r=e;do{const n=r.prev,i=r.next.next;!Tl(n,i)&&Sl(n,r,r.next,i)&&El(n,i)&&El(i,n)&&(t.push(n.i,r.i,i.i),Ll(r),Ll(r.next),r=e=i),r=r.next}while(r!==e);return ul(r)}function ml(e,t,r,n,i,a){let o=e;do{let e=o.next.next;for(;e!==o.prev;){if(o.i!==e.i&&wl(o,e)){let s=Cl(o,e);return o=ul(o,o.next),s=ul(s,s.next),hl(o,t,r,n,i,a,0),void hl(s,t,r,n,i,a,0)}e=e.next}o=o.next}while(o!==e)}function gl(e,t){return e.x-t.x}function yl(e,t){const r=function(e,t){let r=t;const n=e.x,i=e.y;let a,o=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){const e=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(e<=n&&e>o&&(o=e,a=r.x<r.next.x?r:r.next,e===n))return a}r=r.next}while(r!==t);if(!a)return null;const s=a,l=a.x,c=a.y;let u=1/0;r=a;do{if(n>=r.x&&r.x>=l&&n!==r.x&&_l(i<c?n:o,i,l,c,i<c?o:n,i,r.x,r.y)){const t=Math.abs(i-r.y)/(n-r.x);El(r,e)&&(t<u||t===u&&(r.x>a.x||r.x===a.x&&vl(a,r)))&&(a=r,u=t)}r=r.next}while(r!==s);return a}(e,t);if(!r)return t;const n=Cl(r,e);return ul(n,n.next),ul(r,r.next)}function vl(e,t){return kl(e.prev,e,t.prev)<0&&kl(t.next,e,e.next)<0}function xl(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*i|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*i|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function bl(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function _l(e,t,r,n,i,a,o,s){return(i-o)*(t-s)>=(e-o)*(a-s)&&(e-o)*(n-s)>=(r-o)*(t-s)&&(r-o)*(a-s)>=(i-o)*(n-s)}function wl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Sl(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(El(e,t)&&El(t,e)&&function(e,t){let r=e,n=!1;const i=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)&&(kl(e.prev,e,t.prev)||kl(e,t.prev,t))||Tl(e,t)&&kl(e.prev,e,e.next)>0&&kl(t.prev,t,t.next)>0)}function kl(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Tl(e,t){return e.x===t.x&&e.y===t.y}function Sl(e,t,r,n){const i=Ml(kl(e,t,r)),a=Ml(kl(e,t,n)),o=Ml(kl(r,n,e)),s=Ml(kl(r,n,t));return i!==a&&o!==s||!(0!==i||!Al(e,r,t))||!(0!==a||!Al(e,n,t))||!(0!==o||!Al(r,e,n))||!(0!==s||!Al(r,t,n))}function Al(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function Ml(e){return e>0?1:e<0?-1:0}function El(e,t){return kl(e.prev,e,e.next)<0?kl(e,t,e.next)>=0&&kl(e,e.prev,t)>=0:kl(e,t,e.prev)<0||kl(e,e.next,t)<0}function Cl(e,t){const r=Il(e.i,e.x,e.y),n=Il(t.i,t.x,t.y),i=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function Pl(e,t,r,n){const i=Il(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Ll(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Il(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function zl(e,t,r){const n=r.patternDependencies;let i=!1;for(const a of t){const t=a.paint.get(`${e}-pattern`);t.isConstant()||(i=!0);const r=t.constantOr(null);r&&(i=!0,n[r.to]=!0,n[r.from]=!0)}return i}function Ol(e,t,r,n,i){const a=i.patternDependencies;for(const o of t){const t=o.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:n-1},r,{},i.availableImages),s=t.evaluate({zoom:n},r,{},i.availableImages),l=t.evaluate({zoom:n+1},r,{},i.availableImages);e=e&&e.name?e.name:e,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,a[e]=!0,a[s]=!0,a[l]=!0,r.patterns[o.id]={min:e,mid:s,max:l}}}return r}class Rl{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new To,this.indexArray=new Oo,this.indexArray2=new Ro,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.segments2=new Fo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=zl("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=ys(o,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),u,r))continue;const h=i?n.evaluate(u,{},r,t.availableImages):void 0,p={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:gs(o),patterns:{},sortKey:h};a.push(p)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const e=Ol("fill",this.layers,o,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(o,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sl),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,n,i){for(const a of Tr(t,500)){let e=0;for(const s of a)e+=s.length;const t=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),r=t.vertexLength,n=[],i=[];for(const s of a){if(0===s.length)continue;s!==a[0]&&i.push(n.length/2);const e=this.segments2.prepareSegment(s.length,this.layoutVertexArray,this.indexArray2),t=e.vertexLength;this.layoutVertexArray.emplaceBack(s[0].x,s[0].y),this.indexArray2.emplaceBack(t+s.length-1,t),n.push(s[0].x),n.push(s[0].y);for(let r=1;r<s.length;r++)this.layoutVertexArray.emplaceBack(s[r].x,s[r].y),this.indexArray2.emplaceBack(t+r-1,t+r),n.push(s[r].x),n.push(s[r].y);e.vertexLength+=s.length,e.primitiveLength+=s.length}const o=ll(n,i);for(let a=0;a<o.length;a+=3)this.indexArray.emplaceBack(r+o[a],r+o[a+1],r+o[a+2]);t.vertexLength+=e,t.primitiveLength+=o.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}let Dl,jl;Mi("FillBucket",Rl,{omit:["layers","patternFeatures"]});var Fl={get paint(){return jl=jl||new Ia({"fill-antialias":new Ma(J.paint_fill["fill-antialias"]),"fill-opacity":new Ea(J.paint_fill["fill-opacity"]),"fill-color":new Ea(J.paint_fill["fill-color"]),"fill-outline-color":new Ea(J.paint_fill["fill-outline-color"]),"fill-translate":new Ma(J.paint_fill["fill-translate"]),"fill-translate-anchor":new Ma(J.paint_fill["fill-translate-anchor"]),"fill-pattern":new Ca(J.paint_fill["fill-pattern"])})},get layout(){return Dl=Dl||new Ia({"fill-sort-key":new Ea(J.layout_fill["fill-sort-key"])})}};class Bl extends Oa{constructor(e){super(e,Fl)}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new Rl(e)}queryRadius(){return Is(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o){return ws(zs(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,o),n)}isTileClipped(){return!0}}const Nl=Fa([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ul=Fa([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Vl}=Nl;var ql={},Hl=a,Gl=Wl;function Wl(e,t,r,n,i){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=n,this._values=i,e.readFields($l,this,t)}function $l(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var n=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[n]=i}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function Zl(e){for(var t,r,n=0,i=0,a=e.length,o=a-1;i<a;o=i++)n+=((r=e[o]).x-(t=e[i]).x)*(t.y+r.y);return n}Wl.types=["Unknown","Point","LineString","Polygon"],Wl.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,n=1,i=0,a=0,o=0,s=[];e.pos<r;){if(i<=0){var l=e.readVarint();n=7&l,i=l>>3}if(i--,1===n||2===n)a+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&s.push(t),t=[]),t.push(new Hl(a,o));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Wl.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(n<=0){var u=e.readVarint();r=7&u,n=u>>3}if(n--,1===r||2===r)(i+=e.readSVarint())<o&&(o=i),i>s&&(s=i),(a+=e.readSVarint())<l&&(l=a),a>c&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},Wl.prototype.toGeoJSON=function(e,t,r){var n,i,a=this.extent*Math.pow(2,r),o=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Wl.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+o)/a-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/a)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,n,i=[],a=0;a<t;a++){var o=Zl(e[a]);0!==o&&(void 0===n&&(n=o<0),n===o<0?(r&&i.push(r),r=[e[a]]):r.push(e[a]))}return r&&i.push(r),i}(l),n=0;n<l.length;n++)for(i=0;i<l[n].length;i++)u(l[n][i])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Xl=Gl,Yl=Kl;function Kl(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Jl,this,t),this.length=this._features.length}function Jl(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var n=e.readVarint()>>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}(r))}Kl.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Xl(this._pbf,t,this.extent,this._keys,this._values)};var Ql=Yl;function ec(e,t,r){if(3===e){var n=new Ql(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}ql.VectorTile=function(e,t){this.layers=e.readFields(ec,{},t)},ql.VectorTileFeature=Gl,ql.VectorTileLayer=Yl;const tc=ql.VectorTileFeature.types,rc=Math.pow(2,13);function nc(e,t,r,n,i,a,o,s){e.emplaceBack(t,r,2*Math.floor(n*rc)+o,i*rc*2,a*rc*2,Math.round(s))}class ic{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new So,this.centroidVertexArray=new wo,this.indexArray=new Oo,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=zl("fill-extrusion",this.layers,t);for(const{feature:n,id:i,index:a,sourceLayerIndex:o}of e){const e=this.layers[0]._featureFilter.needGeometry,s=ys(n,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),s,r))continue;const l={id:i,sourceLayerIndex:o,index:a,geometry:e?s.geometry:gs(n),properties:n.properties,type:n.type,patterns:{}};this.hasPattern?this.features.push(Ol("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(n,l.geometry,a,o,this.index,!0)}}addFeatures(e,t,r){for(const n of this.features){const{geometry:e}=n;this.addFeature(n,e,n.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vl),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,Ul.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,n,i){for(const a of Tr(t,500)){const t={x:0,y:0,vertexCount:0};let r=0;for(const e of a)r+=e.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const e of a){if(0===e.length)continue;if(oc(e))continue;let r=0;for(let i=0;i<e.length;i++){const a=e[i];if(i>=1){const o=e[i-1];if(!ac(a,o)){n.vertexLength+4>Fo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const e=a.sub(o)._perp()._unit(),i=o.dist(a);r+i>32768&&(r=0),nc(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,r),nc(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,r),t.x+=2*a.x,t.y+=2*a.y,t.vertexCount+=2,r+=i,nc(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,0,r),nc(this.layoutVertexArray,o.x,o.y,e.x,e.y,0,1,r),t.x+=2*o.x,t.y+=2*o.y,t.vertexCount+=2;const s=n.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+r>Fo.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),"Polygon"!==tc[e.type])continue;const i=[],o=[],s=n.vertexLength;for(const e of a)if(0!==e.length){e!==a[0]&&o.push(i.length/2);for(let r=0;r<e.length;r++){const n=e[r];nc(this.layoutVertexArray,n.x,n.y,0,0,1,1,0),t.x+=n.x,t.y+=n.y,t.vertexCount+=1,i.push(n.x),i.push(n.y)}}const l=ll(i,o);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(s+l[e],s+l[e+2],s+l[e+1]);n.primitiveLength+=l.length/3,n.vertexLength+=r;for(let e=0;e<t.vertexCount;e++){const e=Math.floor(t.x/t.vertexCount),r=Math.floor(t.y/t.vertexCount);this.centroidVertexArray.emplaceBack(e,r)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}}function ac(e,t){return e.x===t.x&&(e.x<0||e.x>ds)||e.y===t.y&&(e.y<0||e.y>ds)}function oc(e){return e.every((e=>e.x<0))||e.every((e=>e.x>ds))||e.every((e=>e.y<0))||e.every((e=>e.y>ds))}let sc;Mi("FillExtrusionBucket",ic,{omit:["layers","features"]});var lc={get paint(){return sc=sc||new Ia({"fill-extrusion-opacity":new Ma(J["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ea(J["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Ma(J["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ca(J["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ea(J["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ea(J["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Ma(J["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class cc extends Oa{constructor(e){super(e,lc)}createBucket(e){return new ic(e)}queryRadius(){return Is(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,n,i,a,o,s){const l=zs(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),c=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),p=function(e,t){const r=[];for(const n of e){const e=[n.x,n.y,0,1];qs(e,e,t),r.push(new h(e[0]/e[3],e[1]/e[3]))}return r}(l,s),d=function(e,t,r,n){const i=[],a=[],o=n[8]*t,s=n[9]*t,l=n[10]*t,c=n[11]*t,u=n[8]*r,p=n[9]*r,d=n[10]*r,f=n[11]*r;for(const m of e){const e=[],t=[];for(const r of m){const i=r.x,a=r.y,m=n[0]*i+n[4]*a+n[12],g=n[1]*i+n[5]*a+n[13],y=n[2]*i+n[6]*a+n[14],v=n[3]*i+n[7]*a+n[15],x=y+l,b=v+c,_=m+u,w=g+p,k=y+d,T=v+f,S=new h((m+o)/b,(g+s)/b);S.z=x/b,e.push(S);const A=new h(_/T,w/T);A.z=k/T,t.push(A)}i.push(e),a.push(t)}return[i,a]}(n,u,c,s);return function(e,t,r){let n=1/0;ws(r,t)&&(n=hc(r,t[0]));for(let i=0;i<t.length;i++){const a=t[i],o=e[i];for(let e=0;e<a.length-1;e++){const t=a[e],i=[t,a[e+1],o[e+1],o[e],t];bs(r,i)&&(n=Math.min(n,hc(r,i)))}}return n!==1/0&&n}(d[0],d[1],p)}}function uc(e,t){return e.x*t.x+e.y*t.y}function hc(e,t){if(1===e.length){let r=0;const n=t[r++];let i;for(;!i||n.equals(i);)if(i=t[r++],!i)return 1/0;for(;r<t.length;r++){const a=t[r],o=e[0],s=i.sub(n),l=a.sub(n),c=o.sub(n),u=uc(s,s),h=uc(s,l),p=uc(l,l),d=uc(c,s),f=uc(c,l),m=u*p-h*h,g=(p*d-h*f)/m,y=(u*f-h*d)/m,v=n.z*(1-g-y)+i.z*g+a.z*y;if(isFinite(v))return v}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}const pc=Fa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:dc}=pc,fc=Fa([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:mc}=fc,gc=ql.VectorTileFeature.types,yc=Math.cos(Math.PI/180*37.5),vc=Math.pow(2,14)/.5;class xc{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Ao,this.layoutVertexArray2=new Mo,this.indexArray=new Oo,this.programConfigurations=new us(e.layers,e.zoom),this.segments=new Fo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=zl("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),i=!n.isConstant(),a=[];for(const{feature:o,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,t=ys(o,e);if(!this.layers[0]._featureFilter.filter(new va(this.zoom),t,r))continue;const u=i?n.evaluate(t,{},r):void 0,h={id:s,properties:o.properties,type:o.type,sourceLayerIndex:c,index:l,geometry:e?t.geometry:gs(o),patterns:{},sortKey:u};a.push(h)}i&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(const o of a){const{geometry:n,index:i,sourceLayerIndex:a}=o;if(this.hasPattern){const e=Ol("line",this.layers,o,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(o,n,i,r,{});t.featureIndex.insert(e[i].feature,n,i,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,mc)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dc),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,n,i){const a=this.layers[0].layout,o=a.get("line-join").evaluate(e,{}),s=a.get("line-cap"),l=a.get("line-miter-limit"),c=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const u of t)this.addLine(u,e,o,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,i,n)}addLine(e,t,r,n,i,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const o="Polygon"===gc[t.type];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(o?3:2))return;"bevel"===r&&(i=1.05);const c=this.overscaling<=16?15*ds/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,p,d,f,m;this.e1=this.e2=-1,o&&(h=e[s-2],m=e[l].sub(h)._unit()._perp());for(let g=l;g<s;g++){if(d=g===s-1?o?e[l+1]:void 0:e[g+1],d&&e[g].equals(d))continue;m&&(f=m),h&&(p=h),h=e[g],m=d?d.sub(h)._unit()._perp():f,f=f||m;let t=f.add(m);0===t.x&&0===t.y||t._unit();const y=f.x*m.x+f.y*m.y,v=t.x*m.x+t.y*m.y,x=0!==v?1/v:1/0,b=2*Math.sqrt(2-2*v),_=v<yc&&p&&d,w=f.x*m.y-f.y*m.x>0;if(_&&g>l){const e=h.dist(p);if(e>2*c){const t=h.sub(h.sub(p)._mult(c/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,f,0,0,u),p=t}}const k=p&&d;let T=k?r:o?"butt":n;if(k&&"round"===T&&(x<a?T="miter":x<=2&&(T="fakeround")),"miter"===T&&x>i&&(T="bevel"),"bevel"===T&&(x>2&&(T="flipbevel"),x<i&&(T="miter")),p&&this.updateDistance(p,h),"miter"===T)t._mult(x),this.addCurrentVertex(h,t,0,0,u);else if("flipbevel"===T){if(x>100)t=m.mult(-1);else{const e=x*f.add(m).mag()/f.sub(m).mag();t._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(h,t,0,0,u),this.addCurrentVertex(h,t.mult(-1),0,0,u)}else if("bevel"===T||"fakeround"===T){const e=-Math.sqrt(x*x-1),t=w?e:0,r=w?0:e;if(p&&this.addCurrentVertex(h,f,t,r,u),"fakeround"===T){const e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+y*(y*(3.55645-1.43519*y)-3.2452))*e*e+(.848013+y*(.215638*y-1.06021)))}const n=m.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,n.x,n.y,!1,w,0,u)}}d&&this.addCurrentVertex(h,m,-t,-r,u)}else if("butt"===T)this.addCurrentVertex(h,t,0,0,u);else if("square"===T){const e=p?1:-1;this.addCurrentVertex(h,t,e,e,u)}else"round"===T&&(p&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),d&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(_&&g<s-1){const e=h.dist(d);if(e>2*c){const t=h.add(d.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}}}addCurrentVertex(e,t,r,n,i){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=t.y*n-t.x,s=-t.y-t.x*n;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,i),this.addHalfVertex(e,o,s,a,!0,-n,i),this.distance>vc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,n,i,a))}addHalfVertex(e,t,r,n,i,a,o){let{x:s,y:l}=e;const c=.5*(this.lineClips?this.scaledDistance*(vc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&c)<<2,c>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),i?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}let bc,_c;Mi("LineBucket",xc,{omit:["layers","patternFeatures"]});var wc={get paint(){return _c=_c||new Ia({"line-opacity":new Ea(J.paint_line["line-opacity"]),"line-color":new Ea(J.paint_line["line-color"]),"line-translate":new Ma(J.paint_line["line-translate"]),"line-translate-anchor":new Ma(J.paint_line["line-translate-anchor"]),"line-width":new Ea(J.paint_line["line-width"]),"line-gap-width":new Ea(J.paint_line["line-gap-width"]),"line-offset":new Ea(J.paint_line["line-offset"]),"line-blur":new Ea(J.paint_line["line-blur"]),"line-dasharray":new Pa(J.paint_line["line-dasharray"]),"line-pattern":new Ca(J.paint_line["line-pattern"]),"line-gradient":new La(J.paint_line["line-gradient"])})},get layout(){return bc=bc||new Ia({"line-cap":new Ma(J.layout_line["line-cap"]),"line-join":new Ea(J.layout_line["line-join"]),"line-miter-limit":new Ma(J.layout_line["line-miter-limit"]),"line-round-limit":new Ma(J.layout_line["line-round-limit"]),"line-sort-key":new Ea(J.layout_line["line-sort-key"])})}};class kc extends Ea{possiblyEvaluate(e,t){return t=new va(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,n){return t=k({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,n)}}let Tc;class Sc extends Oa{constructor(e){super(e,wc),this.gradientVersion=0,Tc||(Tc=new kc(wc.paint.properties["line-width"].specification),Tc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){const e=this.gradientExpression();this.stepInterpolant=!(void 0===e._styleExpression)&&e._styleExpression.expression instanceof Ct,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Tc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new xc(e)}queryRadius(e){const t=e,r=Ac(Ls("line-width",this,t),Ls("line-gap-width",this,t)),n=Ls("line-offset",this,t);return r/2+Math.abs(n)+Is(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,n,i,a,o){const s=zs(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),l=o/2*Ac(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),c=this.paint.get("line-offset").evaluate(t,r);return c&&(n=function(e,t){const r=[];for(let n=0;n<e.length;n++){const i=e[n],a=[];for(let e=0;e<i.length;e++){const r=i[e-1],n=i[e],o=i[e+1],s=0===e?new h(0,0):n.sub(r)._unit()._perp(),l=e===i.length-1?new h(0,0):o.sub(n)._unit()._perp(),c=s._add(l)._unit(),u=c.x*l.x+c.y*l.y;0!==u&&c._mult(1/u),a.push(c._mult(t)._add(n))}r.push(a)}return r}(n,c*o)),function(e,t,r){for(let n=0;n<t.length;n++){const i=t[n];if(e.length>=3)for(let t=0;t<i.length;t++)if(Cs(e,i[t]))return!0;if(ks(e,i,r))return!0}return!1}(s,n,l)}isTileClipped(){return!0}}function Ac(e,t){return t>0?t+2*e:e}const Mc=Fa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Ec=Fa([{name:"a_projected_pos",components:3,type:"Float32"}],4);Fa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const Cc=Fa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Fa([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Pc=Fa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Lc=Fa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ic(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const n=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===n?e=e.toLocaleUpperCase():"lowercase"===n&&(e=e.toLocaleLowerCase()),ya.applyArabicShaping&&(e=ya.applyArabicShaping(e)),e}(e.text,t,r)})),e}Fa([{name:"triangle",components:3,type:"Uint16"}]),Fa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Fa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Fa([{type:"Float32",name:"offsetX"}]),Fa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Fa([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const zc={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};var Oc=24,Rc=Fc,Dc=function(e,t,r,n,i){var a,o,s=8*i-n-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?i-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+e[t+h],h+=p,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+e[t+h],h+=p,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},jc=function(e,t,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<<c)-1,h=u>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(t*l-1)*Math.pow(2,i),o+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=f,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;e[r+d]=255&o,d+=f,o/=256,c-=8);e[r+d-f]|=128*m};function Fc(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Fc.Varint=0,Fc.Fixed64=1,Fc.Bytes=2,Fc.Fixed32=5;var Bc=4294967296,Nc=1/Bc,Uc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Vc(e){return e.type===Fc.Bytes?e.readVarint()+e.pos:e.pos+1}function qc(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Hc(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function Gc(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Wc(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function $c(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Zc(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Xc(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Yc(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Kc(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Jc(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Qc(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function eu(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function tu(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function ru(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Fc.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,a=this.pos;this.type=7&n,e(i,t,this),this.pos===a&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=eu(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=ru(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=eu(this.buf,this.pos)+eu(this.buf,this.pos+4)*Bc;return this.pos+=8,e},readSFixed64:function(){var e=eu(this.buf,this.pos)+ru(this.buf,this.pos+4)*Bc;return this.pos+=8,e},readFloat:function(){var e=Dc(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Dc(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:function(e,t,r){var n,i,a=r.buf;if(n=(112&(i=a[r.pos++]))>>4,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<3,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<10,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<17,i<128)return qc(e,n,t);if(n|=(127&(i=a[r.pos++]))<<24,i<128)return qc(e,n,t);if(n|=(1&(i=a[r.pos++]))<<31,i<128)return qc(e,n,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e,t,r,n=this.readVarint()+this.pos,i=this.pos;return this.pos=n,n-i>=12&&Uc?(e=this.buf,t=i,r=n,Uc.decode(e.subarray(t,r))):function(e,t,r){for(var n="",i=t;i<r;){var a,o,s,l=e[i],c=null,u=l>239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(a=e[i+1]))&&(c=(31&l)<<6|63&a)<=127&&(c=null):3===u?(o=e[i+2],128==(192&(a=e[i+1]))&&128==(192&o)&&((c=(15&l)<<12|(63&a)<<6|63&o)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+2],s=e[i+3],128==(192&(a=e[i+1]))&&128==(192&o)&&128==(192&s)&&((c=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}(this.buf,i,n)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Fc.Bytes)return e.push(this.readVarint(t));var r=Vc(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Fc.Bytes)return e.push(this.readSVarint());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Fc.Bytes)return e.push(this.readBoolean());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Fc.Bytes)return e.push(this.readFloat());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Fc.Bytes)return e.push(this.readDouble());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Fc.Bytes)return e.push(this.readFixed32());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Fc.Bytes)return e.push(this.readSFixed32());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Fc.Bytes)return e.push(this.readFixed64());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Fc.Bytes)return e.push(this.readSFixed64());var t=Vc(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Fc.Varint)for(;this.buf[this.pos++]>127;);else if(t===Fc.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Fc.Fixed32)this.pos+=4;else{if(t!==Fc.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),tu(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),tu(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),tu(this.buf,-1&e,this.pos),tu(this.buf,Math.floor(e*Nc),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),tu(this.buf,-1&e,this.pos),tu(this.buf,Math.floor(e*Nc),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,n,i,a;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),i=r,(a=t).buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,i>>>=7,a.buf[a.pos++]=127&i|128,a.buf[a.pos]=127&(i>>>=7),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(n,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var n,i,a=0;a<t.length;a++){if((n=t.charCodeAt(a))>55295&&n<57344){if(!i){n>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&Hc(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),jc(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),jc(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var n=this.pos-r;n>=128&&Hc(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,Fc.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Gc,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Wc,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Xc,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,$c,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Zc,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Yc,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Kc,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Jc,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Qc,t)},writeBytesField:function(e,t){this.writeTag(e,Fc.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Fc.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Fc.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Fc.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Fc.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Fc.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var nu,iu=n(Rc);function au(e,t,r){1===e&&r.readMessage(ou,t)}function ou(e,t,r){if(3===e){const{id:e,bitmap:n,width:i,height:a,left:o,top:s,advance:l}=r.readMessage(su,{});t.push({id:e,bitmap:new Js({width:i+6,height:a+6},n),metrics:{width:i,height:a,left:o,top:s,advance:l}})}}function su(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function lu(e){let t=0,r=0;for(const o of e)t+=o.w*o.h,r=Math.max(r,o.w);e.sort(((e,t)=>t.h-e.h));const n=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let i=0,a=0;for(const o of e)for(let e=n.length-1;e>=0;e--){const t=n[e];if(!(o.w>t.w||o.h>t.h)){if(o.x=t.x,o.y=t.y,a=Math.max(a,o.y+o.h),i=Math.max(i,o.x+o.w),o.w===t.w&&o.h===t.h){const t=n.pop();e<n.length&&(n[e]=t)}else o.h===t.h?(t.x+=o.w,t.w-=o.w):o.w===t.w?(t.y+=o.h,t.h-=o.h):(n.push({x:t.x+o.w,y:t.y,w:t.w-o.w,h:o.h}),t.y+=o.h,t.h-=o.h);break}}return{w:i,h:a,fill:t/(i*a)||0}}class cu{constructor(e,t){let{pixelRatio:r,version:n,stretchX:i,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;this.paddedRect=e,this.pixelRatio=r,this.stretchX=i,this.stretchY=a,this.content=o,this.version=n,this.textFitWidth=s,this.textFitHeight=l}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class uu{constructor(e,t){const r={},n={};this.haveRenderCallbacks=[];const i=[];this.addImages(e,r,i),this.addImages(t,n,i);const{w:a,h:o}=lu(i),s=new Qs({width:a||1,height:o||1});for(const l in e){const t=e[l],n=r[l].paddedRect;Qs.copy(t.data,s,{x:0,y:0},{x:n.x+1,y:n.y+1},t.data)}for(const l in t){const e=t[l],r=n[l].paddedRect,i=r.x+1,a=r.y+1,o=e.data.width,c=e.data.height;Qs.copy(e.data,s,{x:0,y:0},{x:i,y:a},e.data),Qs.copy(e.data,s,{x:0,y:c-1},{x:i,y:a-1},{width:o,height:1}),Qs.copy(e.data,s,{x:0,y:0},{x:i,y:a+c},{width:o,height:1}),Qs.copy(e.data,s,{x:o-1,y:0},{x:i-1,y:a},{width:1,height:c}),Qs.copy(e.data,s,{x:0,y:0},{x:i+o,y:a},{width:1,height:c})}this.image=s,this.iconPositions=r,this.patternPositions=n}addImages(e,t,r){for(const n in e){const i=e[n],a={x:0,y:0,w:i.data.width+2,h:i.data.height+2};r.push(a),t[n]=new cu(a,i),i.hasRenderCallback&&this.haveRenderCallbacks.push(n)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[n,i]=e.tl;r.update(t.data,void 0,{x:n,y:i})}}Mi("ImagePosition",cu),Mi("ImageAtlas",uu),e.ah=void 0,(nu=e.ah||(e.ah={}))[nu.none=0]="none",nu[nu.horizontal=1]="horizontal",nu[nu.vertical=2]="vertical",nu[nu.horizontalOnly=3]="horizontalOnly";const hu=-17;class pu{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new pu;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new pu;return t.imageName=e,t}}class du{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new du;for(let n=0;n<e.sections.length;n++){const i=e.sections[n];i.image?r.addImageSection(i):r.addTextSection(i,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r+1)||null,i=e.charCodeAt(r-1)||null;t+=n&&pa(n)&&!zc[e[r+1]]||i&&pa(i)&&!zc[e[r-1]]||!zc[e[r]]?e[r]:zc[e[r]]}return t}(this.text)}trim(){let e=0;for(let r=0;r<this.text.length&&mu[this.text.charCodeAt(r)];r++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&mu[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new du;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(pu.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let n=0;n<e.text.length;++n)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void C("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(pu.forImage(t)),this.sectionIndex.push(this.sections.length-1)):C("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function fu(t,r,n,i,a,o,s,l,c,u,h,p,d,f,m){const g=du.fromFeature(t,a);let y;p===e.ah.vertical&&g.verticalizePunctuation();const{processBidirectionalText:v,processStyledBidirectionalText:x}=ya;if(v&&1===g.sections.length){y=[];const e=v(g.toString(),ku(g,u,o,r,i,f));for(const t of e){const e=new du;e.text=t,e.sections=g.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);y.push(e)}}else if(x){y=[];const e=x(g.text,g.sectionIndex,ku(g,u,o,r,i,f));for(const t of e){const e=new du;e.text=t[0],e.sectionIndex=t[1],e.sections=g.sections,y.push(e)}}else y=function(e,t){const r=[],n=e.text;let i=0;for(const a of t)r.push(e.substring(i,a)),i=a;return i<n.length&&r.push(e.substring(i,n.length)),r}(g,ku(g,u,o,r,i,f));const b=[],_={positionedLines:b,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(t,r,n,i,a,o,s,l,c,u,h,p){let d=0,f=hu,m=0,g=0;const y="right"===l?1:"left"===l?0:.5;let v=0;for(const k of a){k.trim();const a=k.getMaxScale(),s=(a-1)*Oc,l={positionedGlyphs:[],lineOffset:0};t.positionedLines[v]=l;const b=l.positionedGlyphs;let _=0;if(!k.length()){f+=o,++v;continue}for(let o=0;o<k.length();o++){const l=k.getSection(o),m=k.getSectionIndex(o),g=k.getCharCode(o);let y=0,v=null,w=null,T=null,S=Oc;const A=!(c===e.ah.horizontal||!h&&!ha(g)||h&&(mu[g]||(x=g,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(x)))));if(l.imageName){const e=i[l.imageName];if(!e)continue;T=l.imageName,t.iconsInText=t.iconsInText||!0,w=e.paddedRect;const r=e.displaySize;l.scale=l.scale*Oc/p,v={width:r[0],height:r[1],left:1,top:-3,advance:A?r[1]:r[0]},y=s+(Oc-r[1]*l.scale),S=v.advance;const n=A?r[0]*l.scale-Oc*a:r[1]*l.scale-Oc*a;n>0&&n>_&&(_=n)}else{const e=n[l.fontStack],t=e&&e[g];if(t&&t.rect)w=t.rect,v=t.metrics;else{const e=r[l.fontStack],t=e&&e[g];if(!t)continue;v=t.metrics}y=(a-l.scale)*Oc}A?(t.verticalizable=!0,b.push({glyph:g,imageName:T,x:d,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),d+=S*l.scale+u):(b.push({glyph:g,imageName:T,x:d,y:f+y,vertical:A,scale:l.scale,fontStack:l.fontStack,sectionIndex:m,metrics:v,rect:w}),d+=v.advance*l.scale+u)}0!==b.length&&(m=Math.max(d-u,m),Su(b,0,b.length-1,y,_)),d=0;const w=o*a+_;l.lineOffset=Math.max(_,s),f+=w,g=Math.max(w,g),++v}var x;const b=f-hu,{horizontalAlign:_,verticalAlign:w}=Tu(s);(function(e,t,r,n,i,a,o,s,l){const c=(t-r)*i;let u=0;u=a!==o?-s*n-hu:(-n*l+.5)*o;for(const h of e)for(const e of h.positionedGlyphs)e.x+=c,e.y+=u})(t.positionedLines,y,_,w,m,g,o,b,a.length),t.top+=-w*b,t.bottom=t.top+b,t.left+=-_*m,t.right=t.left+m}(_,r,n,i,y,s,l,c,p,u,d,m),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(b)&&_}const mu={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},gu={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},yu={40:!0};function vu(e,t,r,n,i,a){if(t.imageName){const e=n[t.imageName];return e?e.displaySize[0]*t.scale*Oc/a+i:0}{const n=r[t.fontStack],a=n&&n[e];return a?a.metrics.advance*t.scale+i:0}}function xu(e,t,r,n){const i=Math.pow(e-t,2);return n?e<t?i/2:2*i:i+Math.abs(r)*r}function bu(e,t,r){let n=0;return 10===e&&(n-=1e4),r&&(n+=150),40!==e&&65288!==e||(n+=50),41!==t&&65289!==t||(n+=50),n}function _u(e,t,r,n,i,a){let o=null,s=xu(t,r,i,a);for(const l of n){const e=xu(t-l.x,r,i,a)+l.badness;e<=s&&(o=l,s=e)}return{index:e,x:t,priorBreak:o,badness:s}}function wu(e){return e?wu(e.priorBreak).concat(e.index):[]}function ku(e,t,r,n,i,a){if(!e)return[];const o=[],s=function(e,t,r,n,i,a){let o=0;for(let s=0;s<e.length();s++){const r=e.getSection(s);o+=vu(e.getCharCode(s),r,n,i,t,a)}return o/Math.max(1,Math.ceil(o/r))}(e,t,r,n,i,a),l=e.text.indexOf("\u200b")>=0;let c=0;for(let h=0;h<e.length();h++){const r=e.getSection(h),p=e.getCharCode(h);if(mu[p]||(c+=vu(p,r,n,i,t,a)),h<e.length()-1){const t=!((u=p)<11904)&&(!!ra(u)||!!Ji(u)||!!Yi(u)||!!$i(u)||!!Ki(u)||!!ia(u)||!!Wi(u)||!!ta(u)||ua.test(String.fromCodePoint(u)));(gu[p]||t||r.imageName||h!==e.length()-2&&yu[e.getCharCode(h+1)])&&o.push(_u(h+1,c,s,o,bu(p,e.getCharCode(h+1),t&&l),!1))}}var u;return wu(_u(e.length(),c,s,o,0,!0))}function Tu(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Su(e,t,r,n,i){if(!n&&!i)return;const a=e[r],o=(e[r].x+a.metrics.advance*a.scale)*n;for(let s=t;s<=r;s++)e[s].x-=o,e[s].y+=i}function Au(e,t,r){const{horizontalAlign:n,verticalAlign:i}=Tu(r),a=t[0]-e.displaySize[0]*n,o=t[1]-e.displaySize[1]*i;return{image:e,top:o,bottom:o+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function Mu(e){var t,r;let n=e.left,i=e.top,a=e.right-n,o=e.bottom-i;const s=null!==(t=e.image.textFitWidth)&&void 0!==t?t:"stretchOrShrink",l=null!==(r=e.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",c=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if("proportional"===l){if("stretchOnly"===s&&a/o<c||"proportional"===s){const e=Math.ceil(o*c);n*=e/a,a=e}}else if("proportional"===s&&"stretchOnly"===l&&0!==c&&a/o>c){const e=Math.ceil(a/c);i*=e/o,o=e}return{x1:n,y1:i,x2:n+a,y2:i+o}}function Eu(e,t,r,n,i,a){const o=e.image;let s;if(o.content){const e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}const l=t.left*a,c=t.right*a;let u,h,p,d;"width"===r||"both"===r?(d=i[0]+l-n[3],h=i[0]+c+n[1]):(d=i[0]+(l+c-o.displaySize[0])/2,h=d+o.displaySize[0]);const f=t.top*a,m=t.bottom*a;return"height"===r||"both"===r?(u=i[1]+f-n[0],p=i[1]+m+n[2]):(u=i[1]+(f+m-o.displaySize[1])/2,p=u+o.displaySize[1]),{image:o,top:u,right:h,bottom:p,left:d,collisionPadding:s}}const Cu=128,Pu=32640;function Lu(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new va(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:n}=r;let i=0;for(;i<t.length&&t[i]<=e;)i++;i=Math.max(0,i-1);let a=i;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);const o=t[i],s=t[a];return"composite"===r.kind?{kind:"composite",minZoom:o,maxZoom:s,interpolationType:n}:{kind:"camera",minZoom:o,maxZoom:s,minSize:r.evaluate(new va(o)),maxSize:r.evaluate(new va(s)),interpolationType:n}}}function Iu(e,t,r){let n="never";const i=e.get(t);return i?n=i:e.get(r)&&(n="always"),n}const zu=ql.VectorTileFeature.types,Ou=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Ru(e,t,r,n,i,a,o,s,l,c,u,h,p){const d=s?Math.min(Pu,Math.round(s[0])):0,f=s?Math.min(Pu,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*n),Math.round(32*i),a,o,(d<<1)+(l?1:0),f,16*c,16*u,256*h,256*p)}function Du(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function ju(e){for(const t of e.sections)if(ga(t.text))return!0;return!1}class Fu{constructor(e){this.layoutVertexArray=new Co,this.indexArray=new Oo,this.programConfigurations=e,this.segments=new Fo,this.dynamicLayoutVertexArray=new Po,this.opacityVertexArray=new Lo,this.hasVisibleVertices=!1,this.placedSymbolArray=new po}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,n){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Mc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Ec.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Ou,!0),this.opacityVertexBuffer.itemSize=1),(r||n)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Mi("SymbolBuffers",Fu);class Bu{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new Fo,this.collisionVertexArray=new zo}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Cc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Mi("CollisionBuffers",Bu);class Nu{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Bs([]),this.placementViewportMatrix=Bs([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Lu(this.zoom,r["text-size"]),this.iconSizeData=Lu(this.zoom,r["icon-size"]);const n=this.layers[0].layout,i=n.get("symbol-sort-key"),a=n.get("symbol-z-order");this.canOverlap="never"!==Iu(n,"text-overlap","text-allow-overlap")||"never"!==Iu(n,"icon-overlap","icon-allow-overlap")||n.get("text-ignore-placement")||n.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===n.get("symbol-placement")&&(this.writingModes=n.get("text-writing-mode").map((t=>e.ah[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Fu(new us(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new Fu(new us(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new go,this.lineVertexArray=new yo,this.symbolInstances=new mo,this.textAnchorOffsets=new xo}calculateGlyphDependencies(e,t,r,n,i){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||n)&&i){const r=zc[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(t,r,n){const i=this.layers[0],a=i.layout,o=a.get("text-font"),s=a.get("text-field"),l=a.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof rt&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=a.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const p=r.iconDependencies,d=r.glyphDependencies,f=r.availableImages,m=new va(this.zoom);for(const{feature:g,id:y,index:v,sourceLayerIndex:x}of t){const t=i._featureFilter.needGeometry,r=ys(g,t);if(!i._featureFilter.filter(m,r,n))continue;let s,l;if(t||(r.geometry=gs(g)),c){const e=i.getValueAndResolveTokens("text-field",r,n,f),t=rt.factory(e),a=this.hasRTLText=this.hasRTLText||ju(t);(!a||"unavailable"===ya.getRTLTextPluginStatus()||a&&ya.isParsed())&&(s=Ic(t,i,r))}if(u){const e=i.getValueAndResolveTokens("icon-image",r,n,f);l=e instanceof ot?e:ot.fromString(e)}if(!s&&!l)continue;const b=this.sortFeaturesByKey?h.evaluate(r,{},n):void 0;if(this.features.push({id:y,text:s,icon:l,index:v,sourceLayerIndex:x,geometry:r.geometry,properties:g.properties,type:zu[g.type],sortKey:b}),l&&(p[l.name]=!0),s){const t=o.evaluate(r,{},n).join(","),i="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ah.vertical)>=0;for(const e of s.sections)if(e.image)p[e.image.name]=!0;else{const r=aa(s.toString()),n=e.fontStack||t,a=d[n]=d[n]||{};this.calculateGlyphDependencies(e.text,a,i,this.allowVerticalPlacement,r)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){const t={},r={},n=[];let i=0;function a(t){n.push(e[t]),i++}function o(e,t,i){const a=r[e];return delete r[e],r[t]=a,n[a].geometry[0].pop(),n[a].geometry[0]=n[a].geometry[0].concat(i[0]),a}function s(e,r,i){const a=t[r];return delete t[r],t[e]=a,n[a].geometry[0].shift(),n[a].geometry[0]=i[0].concat(n[a].geometry[0]),a}function l(e,t,r){const n=r?t[0][t[0].length-1]:t[0][0];return`${e}:${n.x}:${n.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,p=u.text?u.text.toString():null;if(!p){a(c);continue}const d=l(p,h),f=l(p,h,!0);if(d in r&&f in t&&r[d]!==t[f]){const e=s(d,f,h),i=o(d,f,n[e].geometry);delete t[d],delete r[f],r[l(p,n[i].geometry,!0)]=i,n[e].geometry=null}else d in r?o(d,f,h):f in t?s(d,f,h):(a(c),t[d]=i-1,r[f]=i-1)}return n.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),n=e.dist(t[e.segment]);const i={};for(let a=e.segment+1;a<t.length;a++)i[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:r},a<t.length-1&&(r+=t[a+1].dist(t[a]));for(let a=e.segment||0;a>=0;a--)i[a]={x:t[a].x,y:t[a].y,tileUnitDistanceFromAnchor:n},a>0&&(n+=t[a-1].dist(t[a]));for(let e=0;e<t.length;e++){const t=i[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,r,n,i,a,o,s,l,c,u,h,p){const d=t.indexArray,f=t.layoutVertexArray,m=t.segments.prepareSegment(4*r.length,f,d,this.canOverlap?o.sortKey:void 0),g=this.glyphOffsetArray.length,y=m.vertexLength,v=this.allowVerticalPlacement&&s===e.ah.vertical?Math.PI/2:0,x=o.text&&o.text.sections;for(let e=0;e<r.length;e++){const{tl:i,tr:a,bl:s,br:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:g,minFontScaleX:y,minFontScaleY:b,glyphOffset:_,isSDF:w,sectionIndex:k}=r[e],T=m.vertexLength,S=_[1];Ru(f,l.x,l.y,i.x,S+i.y,u.x,u.y,n,w,h.x,h.y,y,b),Ru(f,l.x,l.y,a.x,S+a.y,u.x+u.w,u.y,n,w,g.x,h.y,y,b),Ru(f,l.x,l.y,s.x,S+s.y,u.x,u.y+u.h,n,w,h.x,g.y,y,b),Ru(f,l.x,l.y,c.x,S+c.y,u.x+u.w,u.y+u.h,n,w,g.x,g.y,y,b),Du(t.dynamicLayoutVertexArray,l,v),d.emplaceBack(T,T+1,T+2),d.emplaceBack(T+1,T+2,T+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(_[0]),e!==r.length-1&&k===r[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},p,x&&x[k])}t.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,y,c,u,l.segment,n?n[0]:0,n?n[1]:0,i[0],i[1],s,0,!1,0,h)}_addCollisionDebugVertex(e,t,r,n,i,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,n,i,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,n,i,a,o){const s=i.segments.prepareSegment(4,i.layoutVertexArray,i.indexArray),l=s.vertexLength,c=i.layoutVertexArray,u=i.collisionVertexArray,p=o.anchorX,d=o.anchorY;this._addCollisionDebugVertex(c,u,a,p,d,new h(e,t)),this._addCollisionDebugVertex(c,u,a,p,d,new h(r,t)),this._addCollisionDebugVertex(c,u,a,p,d,new h(r,n)),this._addCollisionDebugVertex(c,u,a,p,d,new h(e,n)),s.vertexLength+=4;const f=i.indexArray;f.emplaceBack(l,l+1),f.emplaceBack(l+1,l+2),f.emplaceBack(l+2,l+3),f.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,n){for(let i=e;i<t;i++){const e=this.collisionBoxArray.get(i);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,n?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Bu(Io,Pc.members,Ro),this.iconCollisionBox=new Bu(Io,Pc.members,Ro);for(let e=0;e<this.symbolInstances.length;e++){const t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,n,i,a,o,s,l){const c={};for(let u=t;u<r;u++){const t=e.get(u);c.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.textFeatureIndex=t.featureIndex;break}for(let u=n;u<i;u++){const t=e.get(u);c.verticalTextBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.verticalTextFeatureIndex=t.featureIndex;break}for(let u=a;u<o;u++){const t=e.get(u);c.iconBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.iconFeatureIndex=t.featureIndex;break}for(let u=s;u<l;u++){const t=e.get(u);c.verticalIconBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.verticalIconFeatureIndex=t.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs;for(let i=r.vertexStartIndex;i<n;i+=4)e.indexArray.emplaceBack(i,i+1,i+2),e.indexArray.emplaceBack(i+1,i+2,i+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),n=[],i=[],a=[];for(let o=0;o<this.symbolInstances.length;++o){a.push(o);const e=this.symbolInstances.get(o);n.push(0|Math.round(t*e.anchorX+r*e.anchorY)),i.push(e.featureIndex)}return a.sort(((e,t)=>n[e]-n[t]||i[t]-i[e])),a}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Uu,Vu;Mi("SymbolBucket",Nu,{omit:["layers","collisionBoxArray","features","compareText"]}),Nu.MAX_GLYPHS=65535,Nu.addDynamicAttributes=Du;var qu={get paint(){return Vu=Vu||new Ia({"icon-opacity":new Ea(J.paint_symbol["icon-opacity"]),"icon-color":new Ea(J.paint_symbol["icon-color"]),"icon-halo-color":new Ea(J.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ea(J.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ea(J.paint_symbol["icon-halo-blur"]),"icon-translate":new Ma(J.paint_symbol["icon-translate"]),"icon-translate-anchor":new Ma(J.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ea(J.paint_symbol["text-opacity"]),"text-color":new Ea(J.paint_symbol["text-color"],{runtimeType:ve,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Ea(J.paint_symbol["text-halo-color"]),"text-halo-width":new Ea(J.paint_symbol["text-halo-width"]),"text-halo-blur":new Ea(J.paint_symbol["text-halo-blur"]),"text-translate":new Ma(J.paint_symbol["text-translate"]),"text-translate-anchor":new Ma(J.paint_symbol["text-translate-anchor"])})},get layout(){return Uu=Uu||new Ia({"symbol-placement":new Ma(J.layout_symbol["symbol-placement"]),"symbol-spacing":new Ma(J.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Ma(J.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ea(J.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Ma(J.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Ma(J.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Ma(J.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Ma(J.layout_symbol["icon-ignore-placement"]),"icon-optional":new Ma(J.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Ma(J.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ea(J.layout_symbol["icon-size"]),"icon-text-fit":new Ma(J.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Ma(J.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ea(J.layout_symbol["icon-image"]),"icon-rotate":new Ea(J.layout_symbol["icon-rotate"]),"icon-padding":new Ea(J.layout_symbol["icon-padding"]),"icon-keep-upright":new Ma(J.layout_symbol["icon-keep-upright"]),"icon-offset":new Ea(J.layout_symbol["icon-offset"]),"icon-anchor":new Ea(J.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Ma(J.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Ma(J.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Ma(J.layout_symbol["text-rotation-alignment"]),"text-field":new Ea(J.layout_symbol["text-field"]),"text-font":new Ea(J.layout_symbol["text-font"]),"text-size":new Ea(J.layout_symbol["text-size"]),"text-max-width":new Ea(J.layout_symbol["text-max-width"]),"text-line-height":new Ma(J.layout_symbol["text-line-height"]),"text-letter-spacing":new Ea(J.layout_symbol["text-letter-spacing"]),"text-justify":new Ea(J.layout_symbol["text-justify"]),"text-radial-offset":new Ea(J.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Ma(J.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Ea(J.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Ea(J.layout_symbol["text-anchor"]),"text-max-angle":new Ma(J.layout_symbol["text-max-angle"]),"text-writing-mode":new Ma(J.layout_symbol["text-writing-mode"]),"text-rotate":new Ea(J.layout_symbol["text-rotate"]),"text-padding":new Ma(J.layout_symbol["text-padding"]),"text-keep-upright":new Ma(J.layout_symbol["text-keep-upright"]),"text-transform":new Ea(J.layout_symbol["text-transform"]),"text-offset":new Ea(J.layout_symbol["text-offset"]),"text-allow-overlap":new Ma(J.layout_symbol["text-allow-overlap"]),"text-overlap":new Ma(J.layout_symbol["text-overlap"]),"text-ignore-placement":new Ma(J.layout_symbol["text-ignore-placement"]),"text-optional":new Ma(J.layout_symbol["text-optional"])})}};class Hu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:fe,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Mi("FormatSectionOverride",Hu,{omit:["defaultValue"]});class Gu extends Oa{constructor(e){super(e,qu)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const e=this.layout.get("text-writing-mode");if(e){const t=[];for(const r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,n){const i=this.layout.get(e).evaluate(t,{},r,n),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||Sn(a.value)||!i?i:(o=t.properties,i.replace(/{([^{}]+)}/g,((e,t)=>o&&t in o?String(o[t]):"")));var o}createBucket(e){return new Nu(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of qu.paint.overridableProperties){if(!Gu.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new Hu(t),n=new Tn(r,t.property.specification);let i=null;i="constant"===t.value.kind||"source"===t.value.kind?new Mn("source",n):new En("composite",n,t.value.zoomStops),this.paint._values[e]=new Sa(t.property,i,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&Gu.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),n=qu.paint.properties[t];let i=!1;const a=e=>{for(const t of e)if(n.overrides&&n.overrides.hasOverride(t))return void(i=!0)};if("constant"===r.value.kind&&r.value.value instanceof rt)a(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{i||(t instanceof ht&&ct(t.value)===we?a(t.value.sections):t instanceof Kt?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return i}}let Wu;var $u={get paint(){return Wu=Wu||new Ia({"background-color":new Ma(J.paint_background["background-color"]),"background-pattern":new Pa(J.paint_background["background-pattern"]),"background-opacity":new Ma(J.paint_background["background-opacity"])})}};class Zu extends Oa{constructor(e){super(e,$u)}}let Xu;var Yu={get paint(){return Xu=Xu||new Ia({"raster-opacity":new Ma(J.paint_raster["raster-opacity"]),"raster-hue-rotate":new Ma(J.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Ma(J.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Ma(J.paint_raster["raster-brightness-max"]),"raster-saturation":new Ma(J.paint_raster["raster-saturation"]),"raster-contrast":new Ma(J.paint_raster["raster-contrast"]),"raster-resampling":new Ma(J.paint_raster["raster-resampling"]),"raster-fade-duration":new Ma(J.paint_raster["raster-fade-duration"])})}};class Ku extends Oa{constructor(e){super(e,Yu)}}class Ju extends Oa{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Qu{constructor(e){this._methodToThrottle=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const eh=6371008.8;class th{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new th(w(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,n=e.lat*t,i=Math.sin(r)*Math.sin(n)+Math.cos(r)*Math.cos(n)*Math.cos((e.lng-this.lng)*t);return eh*Math.acos(Math.min(i,1))}static convert(e){if(e instanceof th)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new th(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new th(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const rh=2*Math.PI*eh;function nh(e){return rh*Math.cos(e*Math.PI/180)}function ih(e){return(180+e)/360}function ah(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function oh(e,t){return e/nh(t)}function sh(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class lh{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=th.convert(e);return new lh(ih(r.lng),ah(r.lat),oh(t,r.lat))}toLngLat(){return new th(360*this.x-180,sh(this.y))}toAltitude(){return this.z*nh(sh(this.y))}meterInMercatorCoordinateUnits(){return 1/rh*(e=sh(this.y),1/Math.cos(e*Math.PI/180));var e}}function ch(e,t,r){var n=2*Math.PI*6378137/256/Math.pow(2,r);return[e*n-2*Math.PI*6378137/2,t*n-2*Math.PI*6378137/2]}class uh{constructor(e,t,r){if(i=t,a=r,(n=e)<0||n>25||a<0||a>=Math.pow(2,n)||i<0||i>=Math.pow(2,n))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);var n,i,a;this.z=e,this.x=t,this.y=r,this.key=dh(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){const n=(a=this.y,o=this.z,s=ch(256*(i=this.x),256*(a=Math.pow(2,o)-a-1),o),l=ch(256*(i+1),256*(a+1),o),s[0]+","+s[1]+","+l[0]+","+l[1]);var i,a,o,s,l;const c=function(e,t,r){let n,i="";for(let a=e;a>0;a--)n=1<<a-1,i+=(t&n?1:0)+(r&n?2:0);return i}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,n)}isChildOf(e){const t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){const t=Math.pow(2,this.z);return new h((e.x*t-this.x)*ds,(e.y*t-this.y)*ds)}toString(){return`${this.z}/${this.x}/${this.y}`}}class hh{constructor(e,t){this.wrap=e,this.canonical=t,this.key=dh(e,t.z,t.z,t.x,t.y)}}class ph{constructor(e,t,r,n,i){if(e<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new uh(r,+n,+i),this.key=dh(t,e,r,n,i)}clone(){return new ph(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const t=this.canonical.z-e;return e>this.canonical.z?new ph(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ph(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?dh(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):dh(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new ph(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,n=2*this.canonical.y;return[new ph(t,this.wrap,t,r,n),new ph(t,this.wrap,t,r+1,n),new ph(t,this.wrap,t,r,n+1),new ph(t,this.wrap,t,r+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new ph(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new ph(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new hh(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new lh(e.x-this.wrap,e.y))}}function dh(e,t,r,n,i){(e*=2)<0&&(e=-1*e-1);const a=1<<r;return(a*a*e+a*i+n).toString(36)+r.toString(36)+t.toString(36)}Mi("CanonicalTileID",uh),Mi("OverscaledTileID",ph,{omit:["posMatrix"]});class fh{constructor(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0;if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void C(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;const s=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=n,this.greenFactor=i,this.blueFactor=a,this.baseShift=o;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let l=0;l<s;l++)this.data[this._idx(-1,l)]=this.data[this._idx(0,l)],this.data[this._idx(s,l)]=this.data[this._idx(s-1,l)],this.data[this._idx(l,-1)]=this.data[this._idx(l,0)],this.data[this._idx(l,s)]=this.data[this._idx(l,s-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(s,-1)]=this.data[this._idx(s-1,0)],this.data[this._idx(-1,s)]=this.data[this._idx(0,s-1)],this.data[this._idx(s,s)]=this.data[this._idx(s-1,s-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let l=0;l<s;l++)for(let e=0;e<s;e++){const t=this.get(l,e);t>this.max&&(this.max=t),t<this.min&&(this.min=t)}}get(e,t){const r=new Uint8Array(this.data.buffer),n=4*this._idx(e,t);return this.unpack(r[n],r[n+1],r[n+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}getPixels(){return new Qs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let n=t*this.dim,i=t*this.dim+this.dim,a=r*this.dim,o=r*this.dim+this.dim;switch(t){case-1:n=i-1;break;case 1:i=n+1}switch(r){case-1:a=o-1;break;case 1:o=a+1}const s=-t*this.dim,l=-r*this.dim;for(let c=a;c<o;c++)for(let t=n;t<i;t++)this.data[this._idx(t,c)]=e.data[this._idx(t+s,c+l)]}}Mi("DEMData",fh);class mh{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class gh{constructor(e,t,r,n,i){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=n,this.properties=e.properties,this.id=i}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class yh{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Si(ds,16,0),this.grid3D=new Si(ds,16,0),this.featureIndexArray=new _o,this.promoteId=t}insert(e,t,r,n,i,a){const o=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,n,i);const s=a?this.grid3D:this.grid;for(let l=0;l<t.length;l++){const e=t[l],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<e.length;t++){const n=e[t];r[0]=Math.min(r[0],n.x),r[1]=Math.min(r[1],n.y),r[2]=Math.max(r[2],n.x),r[3]=Math.max(r[3],n.y)}r[0]<ds&&r[1]<ds&&r[2]>=0&&r[3]>=0&&s.insert(o,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ql.VectorTile(new iu(this.rawTileData)).layers,this.sourceLayerCoder=new mh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,n){this.loadVTLayers();const i=e.params||{},a=ds/e.tileSize/e.scale,o=On(i.filter),s=e.queryGeometry,l=e.queryPadding*a,c=xh(s),u=this.grid.query(c.minX-l,c.minY-l,c.maxX+l,c.maxY+l),p=xh(e.cameraQueryGeometry),d=this.grid3D.query(p.minX-l,p.minY-l,p.maxX+l,p.maxY+l,((t,r,n,i)=>function(e,t,r,n,i){for(const o of e)if(t<=o.x&&r<=o.y&&n>=o.x&&i>=o.y)return!0;const a=[new h(t,r),new h(t,i),new h(n,i),new h(n,r)];if(e.length>2)for(const o of a)if(Cs(e,o))return!0;for(let o=0;o<e.length-1;o++)if(Ps(e[o],e[o+1],a))return!0;return!1}(e.cameraQueryGeometry,t-l,r-l,n+l,i+l)));for(const h of d)u.push(h);u.sort(bh);const f={};let m;for(let h=0;h<u.length;h++){const l=u[h];if(l===m)continue;m=l;const c=this.featureIndexArray.get(l);let p=null;this.loadMatchingFeature(f,c.bucketIndex,c.sourceLayerIndex,c.featureIndex,o,i.layers,i.availableImages,t,r,n,((t,r,n)=>(p||(p=gs(t)),r.queryIntersectsFeature(s,t,n,p,this.z,e.transform,a,e.pixelPosMatrix))))}return f}loadMatchingFeature(e,t,r,n,i,a,o,s,l,c,u){const h=this.bucketLayerIDs[t];if(a&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(a,h))return;const p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(n);if(i.needGeometry){const e=ys(d,!0);if(!i.filter(new va(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new va(this.tileID.overscaledZ),d))return;const f=this.getId(d,p);for(let m=0;m<h.length;m++){const t=h[m];if(a&&a.indexOf(t)<0)continue;const r=s[t];if(!r)continue;let i={};f&&c&&(i=c.getState(r.sourceLayer||"_geojsonTileLayer",f));const p=k({},l[t]);p.paint=vh(p.paint,r.paint,d,i,o),p.layout=vh(p.layout,r.layout,d,i,o);const g=!u||u(d,r,i);if(!g)continue;const y=new gh(d,this.z,this.x,this.y,f);y.layer=p;let v=e[t];void 0===v&&(v=e[t]=[]),v.push({featureIndex:n,feature:y,intersectionZ:g})}}lookupSymbolFeatures(e,t,r,n,i,a,o,s){const l={};this.loadVTLayers();const c=On(i);for(const u of e)this.loadMatchingFeature(l,r,n,u,c,a,o,s,t);return l}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;return this.promoteId&&(r=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]],"boolean"==typeof r&&(r=Number(r))),r}}function vh(e,t,r,n,i){return S(e,((e,a)=>{const o=t instanceof Aa?t.get(a):null;return o&&o.evaluate?o.evaluate(r,n,i):o}))}function xh(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return{minX:t,minY:r,maxX:n,maxY:i}}function bh(e,t){return t-e}function _h(e,t,r,n,i){const a=[];for(let o=0;o<e.length;o++){const s=e[o];let l;for(let e=0;e<s.length-1;e++){let o=s[e],c=s[e+1];o.x<t&&c.x<t||(o.x<t?o=new h(t,o.y+(t-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x<t&&(c=new h(t,o.y+(t-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y<r&&c.y<r||(o.y<r?o=new h(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round():c.y<r&&(c=new h(o.x+(r-o.y)/(c.y-o.y)*(c.x-o.x),r)._round()),o.x>=n&&c.x>=n||(o.x>=n?o=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round():c.x>=n&&(c=new h(n,o.y+(n-o.x)/(c.x-o.x)*(c.y-o.y))._round()),o.y>=i&&c.y>=i||(o.y>=i?o=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round():c.y>=i&&(c=new h(o.x+(i-o.y)/(c.y-o.y)*(c.x-o.x),i)._round()),l&&o.equals(l[l.length-1])||(l=[o],a.push(l)),l.push(c)))))}}return a}Mi("FeatureIndex",yh,{omit:["rawTileData","sourceLayerCoder"]});class wh extends h{constructor(e,t,r,n){super(e,t),this.angle=r,void 0!==n&&(this.segment=n)}clone(){return new wh(this.x,this.y,this.angle,this.segment)}}function kh(e,t,r,n,i){if(void 0===t.segment||0===r)return!0;let a=t,o=t.segment+1,s=0;for(;s>-r/2;){if(o--,o<0)return!1;s-=e[o].dist(a),a=e[o]}s+=e[o].dist(e[o+1]),o++;const l=[];let c=0;for(;s<r/2;){const t=e[o],r=e[o+1];if(!r)return!1;let a=e[o-1].angleTo(t)-t.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:a}),c+=a;s-l[0].distance>n;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=t.dist(r)}return!0}function Th(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Sh(e,t,r){return e?.6*t*r:0}function Ah(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Mh(e,t,r,n,i,a){const o=Sh(r,i,a),s=Ah(r,n)*a;let l=0;const c=Th(e)/2;for(let u=0;u<e.length-1;u++){const r=e[u],n=e[u+1],i=r.dist(n);if(l+i>c){const a=(c-l)/i,h=Dt.number(r.x,n.x,a),p=Dt.number(r.y,n.y,a),d=new wh(h,p,n.angleTo(r),u);return d._round(),!o||kh(e,d,s,o,t)?d:void 0}l+=i}}function Eh(e,t,r,n,i,a,o,s,l){const c=Sh(n,a,o),u=Ah(n,i),h=u*o,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),Ch(e,p?t/2*s%t:(u/2+2*a)*o*s%t,t,c,r,h,p,!1,l)}function Ch(e,t,r,n,i,a,o,s,l){const c=a/2,u=Th(e);let h=0,p=t-r,d=[];for(let f=0;f<e.length-1;f++){const t=e[f],o=e[f+1],s=t.dist(o),m=o.angleTo(t);for(;p+r<h+s;){p+=r;const g=(p-h)/s,y=Dt.number(t.x,o.x,g),v=Dt.number(t.y,o.y,g);if(y>=0&&y<l&&v>=0&&v<l&&p-c>=0&&p+c<=u){const t=new wh(y,v,m,f);t._round(),n&&!kh(e,t,a,n,i)||d.push(t)}}h+=s}return s||d.length||o||(d=Ch(e,h/2,r,n,i,a,o,!0,l)),d}function Ph(e,t,r,n){const i=[],a=e.image,o=a.pixelRatio,s=a.paddedRect.w-2,l=a.paddedRect.h-2;let c={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom};const u=a.stretchX||[[0,s]],p=a.stretchY||[[0,l]],d=(e,t)=>e+t[1]-t[0],f=u.reduce(d,0),m=p.reduce(d,0),g=s-f,y=l-m;let v=0,x=f,b=0,_=m,w=0,k=g,T=0,S=y;if(a.content&&n){const t=a.content,r=t[2]-t[0],n=t[3]-t[1];(a.textFitWidth||a.textFitHeight)&&(c=Mu(e)),v=Lh(u,0,t[0]),b=Lh(p,0,t[1]),x=Lh(u,t[0],t[2]),_=Lh(p,t[1],t[3]),w=t[0]-v,T=t[1]-b,k=r-x,S=n-_}const A=c.x1,M=c.y1,E=c.x2-A,C=c.y2-M,P=(e,n,i,s)=>{const l=zh(e.stretch-v,x,E,A),c=Oh(e.fixed-w,k,e.stretch,f),u=zh(n.stretch-b,_,C,M),p=Oh(n.fixed-T,S,n.stretch,m),d=zh(i.stretch-v,x,E,A),g=Oh(i.fixed-w,k,i.stretch,f),y=zh(s.stretch-b,_,C,M),P=Oh(s.fixed-T,S,s.stretch,m),L=new h(l,u),I=new h(d,u),z=new h(d,y),O=new h(l,y),R=new h(c/o,p/o),D=new h(g/o,P/o),j=t*Math.PI/180;if(j){const e=Math.sin(j),t=Math.cos(j),r=[t,-e,e,t];L._matMult(r),I._matMult(r),O._matMult(r),z._matMult(r)}const F=e.stretch+e.fixed,B=n.stretch+n.fixed;return{tl:L,tr:I,bl:O,br:z,tex:{x:a.paddedRect.x+1+F,y:a.paddedRect.y+1+B,w:i.stretch+i.fixed-F,h:s.stretch+s.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:D,minFontScaleX:k/o/E,minFontScaleY:S/o/C,isSDF:r}};if(n&&(a.stretchX||a.stretchY)){const e=Ih(u,g,f),t=Ih(p,y,m);for(let r=0;r<e.length-1;r++){const n=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++)i.push(P(n,t[e],a,t[e+1]))}}else i.push(P({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return i}function Lh(e,t,r){let n=0;for(const i of e)n+=Math.max(t,Math.min(r,i[1]))-Math.max(t,Math.min(r,i[0]));return n}function Ih(e,t,r){const n=[{fixed:-1,stretch:0}];for(const[i,a]of e){const e=n[n.length-1];n.push({fixed:i-e.stretch,stretch:e.stretch}),n.push({fixed:i-e.stretch,stretch:e.stretch+(a-i)})}return n.push({fixed:t+1,stretch:r}),n}function zh(e,t,r,n){return e/t*r+n}function Oh(e,t,r,n){return e-t*r/n}Mi("Anchor",wh);class Rh{constructor(e,t,r,n,i,a,o,s,l,c){var u;if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom;const r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let n=t-e;n>0&&(n=Math.max(10,n),this.circleDiameter=n)}else{const l=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?Mu(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};l.y1=l.y1*o-s[0],l.y2=l.y2*o+s[2],l.x1=l.x1*o-s[3],l.x2=l.x2*o+s[1];const p=a.collisionPadding;if(p&&(l.x1-=p[0]*o,l.y1-=p[1]*o,l.x2+=p[2]*o,l.y2+=p[3]*o),c){const e=new h(l.x1,l.y1),t=new h(l.x2,l.y1),r=new h(l.x1,l.y2),n=new h(l.x2,l.y2),i=c*Math.PI/180;e._rotate(i),t._rotate(i),r._rotate(i),n._rotate(i),l.x1=Math.min(e.x,t.x,r.x,n.x),l.x2=Math.max(e.x,t.x,r.x,n.x),l.y1=Math.min(e.y,t.y,r.y,n.y),l.y2=Math.max(e.y,t.y,r.y,n.y)}e.emplaceBack(t.x,t.y,l.x1,l.y1,l.x2,l.y2,r,n,i)}this.boxEndIndex=e.length}}class Dh{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>e<t?-1:e>t?1:0;if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let r=(this.length>>1)-1;r>=0;r--)this._down(r)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const i=e-1>>1,a=t[i];if(r(n,a)>=0)break;t[e]=a,e=i}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,i=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],i)>=0)break;t[e]=t[n],e=n}t[e]=i}}function jh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=1/0,i=1/0,a=-1/0,o=-1/0;const s=e[0];for(let h=0;h<s.length;h++){const e=s[h];(!h||e.x<n)&&(n=e.x),(!h||e.y<i)&&(i=e.y),(!h||e.x>a)&&(a=e.x),(!h||e.y>o)&&(o=e.y)}const l=Math.min(a-n,o-i);let c=l/2;const u=new Dh([],Fh);if(0===l)return new h(n,i);for(let h=n;h<a;h+=l)for(let t=i;t<o;t+=l)u.push(new Bh(h+c,t+c,c,e));let p=function(e){let t=0,r=0,n=0;const i=e[0];for(let a=0,o=i.length,s=o-1;a<o;s=a++){const e=i[a],o=i[s],l=e.x*o.y-o.x*e.y;r+=(e.x+o.x)*l,n+=(e.y+o.y)*l,t+=3*l}return new Bh(r/t,n/t,0,e)}(e),d=u.length;for(;u.length;){const n=u.pop();(n.d>p.d||!p.d)&&(p=n,r&&console.log("found best %d after %d probes",Math.round(1e4*n.d)/1e4,d)),n.max-p.d<=t||(c=n.h/2,u.push(new Bh(n.p.x-c,n.p.y-c,c,e)),u.push(new Bh(n.p.x+c,n.p.y-c,c,e)),u.push(new Bh(n.p.x-c,n.p.y+c,c,e)),u.push(new Bh(n.p.x+c,n.p.y+c,c,e)),d+=4)}return r&&(console.log(`num probes: ${d}`),console.log(`best distance: ${p.d}`)),p.p}function Fh(e,t){return t.max-e.max}function Bh(e,t,r,n){this.p=new h(e,t),this.h=r,this.d=function(e,t){let r=!1,n=1/0;for(let i=0;i<t.length;i++){const a=t[i];for(let t=0,i=a.length,o=i-1;t<i;o=t++){const i=a[t],s=a[o];i.y>e.y!=s.y>e.y&&e.x<(s.x-i.x)*(e.y-i.y)/(s.y-i.y)+i.x&&(r=!r),n=Math.min(n,Ms(e,i,s))}}return(r?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var Nh;e.aq=void 0,(Nh=e.aq||(e.aq={}))[Nh.center=1]="center",Nh[Nh.left=2]="left",Nh[Nh.right=3]="right",Nh[Nh.top=4]="top",Nh[Nh.bottom=5]="bottom",Nh[Nh["top-left"]=6]="top-left",Nh[Nh["top-right"]=7]="top-right",Nh[Nh["bottom-left"]=8]="bottom-left",Nh[Nh["bottom-right"]=9]="bottom-right";const Uh=Number.POSITIVE_INFINITY;function Vh(e,t){return t[1]!==Uh?function(e,t,r){let n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-7;break;case"bottom-right":case"bottom-left":case"bottom":i=7-r}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}(e,t[0],t[1]):function(e,t){let r=0,n=0;t<0&&(t=0);const i=t/Math.SQRT2;switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}(e,t[0])}function qh(e,t,r){var n;const i=e.layout,a=null===(n=i.get("text-variable-anchor-offset"))||void 0===n?void 0:n.evaluate(t,{},r);if(a){const e=a.values,t=[];for(let r=0;r<e.length;r+=2){const n=t[r]=e[r],i=e[r+1].map((e=>e*Oc));n.startsWith("top")?i[1]-=7:n.startsWith("bottom")&&(i[1]+=7),t[r+1]=i}return new at(t)}const o=i.get("text-variable-anchor");if(o){let n;n=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[i.get("text-radial-offset").evaluate(t,{},r)*Oc,Uh]:i.get("text-offset").evaluate(t,{},r).map((e=>e*Oc));const a=[];for(const e of o)a.push(e,Vh(e,n));return new at(a)}return null}function Hh(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Gh(t,r,n,i,a,o,s,l,c,u,h){let p=o.textMaxSize.evaluate(r,{});void 0===p&&(p=s);const d=t.layers[0].layout,f=d.get("icon-offset").evaluate(r,{},h),m=$h(n.horizontal),g=s/24,y=t.tilePixelRatio*g,v=t.tilePixelRatio*p/24,x=t.tilePixelRatio*l,b=t.tilePixelRatio*d.get("symbol-spacing"),_=d.get("text-padding")*t.tilePixelRatio,w=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const i=e.get("icon-padding").evaluate(t,{},r),a=i&&i.values;return[a[0]*n,a[1]*n,a[2]*n,a[3]*n]}(d,r,h,t.tilePixelRatio),k=d.get("text-max-angle")/180*Math.PI,T="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),S="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),A=d.get("symbol-placement"),M=b/2,E=d.get("icon-text-fit");let P;i&&"none"!==E&&(t.allowVerticalPlacement&&n.vertical&&(P=Eu(i,n.vertical,E,d.get("icon-text-fit-padding"),f,g)),m&&(i=Eu(i,m,E,d.get("icon-text-fit-padding"),f,g)));const L=(l,p)=>{p.x<0||p.x>=ds||p.y<0||p.y>=ds||function(t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x,b,_,w,k,T,S){const A=t.addToLineVertexArray(r,n);let M,E,P,L,I=0,z=0,O=0,R=0,D=-1,j=-1;const F={};let B=$o("");if(t.allowVerticalPlacement&&i.vertical){const e=l.layout.get("text-rotate").evaluate(_,{},T)+90;P=new Rh(c,r,u,h,p,i.vertical,d,f,m,e),s&&(L=new Rh(c,r,u,h,p,s,y,v,m,e))}if(a){const n=l.layout.get("icon-rotate").evaluate(_,{}),i="none"!==l.layout.get("icon-text-fit"),o=Ph(a,n,k,i),d=s?Ph(s,n,k,i):void 0;E=new Rh(c,r,u,h,p,a,y,v,!1,n),I=4*o.length;const f=t.iconSizeData;let m=null;"source"===f.kind?(m=[Cu*l.layout.get("icon-size").evaluate(_,{})],m[0]>Pu&&C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[Cu*w.compositeIconSizes[0].evaluate(_,{},T),Cu*w.compositeIconSizes[1].evaluate(_,{},T)],(m[0]>Pu||m[1]>Pu)&&C(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,o,m,b,x,_,e.ah.none,r,A.lineStartIndex,A.lineLength,-1,T),D=t.icon.placedSymbolArray.length-1,d&&(z=4*d.length,t.addSymbols(t.icon,d,m,b,x,_,e.ah.vertical,r,A.lineStartIndex,A.lineLength,-1,T),j=t.icon.placedSymbolArray.length-1)}const N=Object.keys(i.horizontal);for(const C of N){const n=i.horizontal[C];if(!M){B=$o(n.text);const e=l.layout.get("text-rotate").evaluate(_,{},T);M=new Rh(c,r,u,h,p,n,d,f,m,e)}const a=1===n.positionedLines.length;if(O+=Wh(t,r,n,o,l,m,_,g,A,i.vertical?e.ah.horizontal:e.ah.horizontalOnly,a?N:[C],F,D,w,T),a)break}i.vertical&&(R+=Wh(t,r,i.vertical,o,l,m,_,g,A,e.ah.vertical,["vertical"],F,j,w,T));const U=M?M.boxStartIndex:t.collisionBoxArray.length,V=M?M.boxEndIndex:t.collisionBoxArray.length,q=P?P.boxStartIndex:t.collisionBoxArray.length,H=P?P.boxEndIndex:t.collisionBoxArray.length,G=E?E.boxStartIndex:t.collisionBoxArray.length,W=E?E.boxEndIndex:t.collisionBoxArray.length,$=L?L.boxStartIndex:t.collisionBoxArray.length,Z=L?L.boxEndIndex:t.collisionBoxArray.length;let X=-1;const Y=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;X=Y(M,X),X=Y(P,X),X=Y(E,X),X=Y(L,X);const K=X>-1?1:0;K&&(X*=S/Oc),t.glyphOffsetArray.length>=Nu.MAX_GLYPHS&&C("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey);const J=qh(l,_,T),[Q,ee]=function(t,r){const n=t.length,i=null==r?void 0:r.values;if((null==i?void 0:i.length)>0)for(let a=0;a<i.length;a+=2){const r=i[a+1];t.emplaceBack(e.aq[i[a]],r[0],r[1])}return[n,t.length]}(t.textAnchorOffsets,J);t.symbolInstances.emplaceBack(r.x,r.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,D,j,B,U,V,q,H,G,W,$,Z,u,O,R,I,z,K,0,d,X,Q,ee)}(t,p,l,n,i,a,P,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,y,[_,_,_,_],T,c,x,w,S,f,r,o,u,h,s)};if("line"===A)for(const e of _h(r.geometry,0,0,ds,ds)){const r=Eh(e,b,k,n.vertical||m,i,24,v,t.overscaling,ds);for(const n of r)m&&Zh(t,m.text,M,n)||L(e,n)}else if("line-center"===A){for(const e of r.geometry)if(e.length>1){const t=Mh(e,k,n.vertical||m,i,24,v);t&&L(e,t)}}else if("Polygon"===r.type)for(const e of Tr(r.geometry,0)){const t=jh(e,16);L(e[0],new wh(t.x,t.y,0))}else if("LineString"===r.type)for(const e of r.geometry)L(e,new wh(e[0].x,e[0].y,0));else if("Point"===r.type)for(const e of r.geometry)for(const t of e)L([t],new wh(t.x,t.y,0))}function Wh(e,t,r,n,i,a,o,s,l,c,u,p,d,f,m){const g=function(e,t,r,n,i,a,o,s){const l=n.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,c=[];for(const u of t.positionedLines)for(const e of u.positionedGlyphs){if(!e.rect)continue;const n=e.rect||{};let a=4,p=!0,d=1,f=0;const m=(i||s)&&e.vertical,g=e.metrics.advance*e.scale/2;if(s&&t.verticalizable&&(f=u.lineOffset/2-(e.imageName?-(Oc-e.metrics.width*e.scale)/2:(e.scale-1)*Oc)),e.imageName){const t=o[e.imageName];p=t.sdf,d=t.pixelRatio,a=1/d}const y=i?[e.x+g,e.y]:[0,0];let v=i?[0,0]:[e.x+g+r[0],e.y+r[1]-f],x=[0,0];m&&(x=v,v=[0,0]);const b=e.metrics.isDoubleResolution?2:1,_=(e.metrics.left-a)*e.scale-g+v[0],w=(-e.metrics.top-a)*e.scale+v[1],k=_+n.w/b*e.scale/d,T=w+n.h/b*e.scale/d,S=new h(_,w),A=new h(k,w),M=new h(_,T),E=new h(k,T);if(m){const t=new h(-g,g-hu),r=-Math.PI/2,n=12-g,i=new h(22-n,-(e.imageName?n:0)),a=new h(...x);S._rotateAround(r,t)._add(i)._add(a),A._rotateAround(r,t)._add(i)._add(a),M._rotateAround(r,t)._add(i)._add(a),E._rotateAround(r,t)._add(i)._add(a)}if(l){const e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];S._matMult(r),A._matMult(r),M._matMult(r),E._matMult(r)}const C=new h(0,0),P=new h(0,0);c.push({tl:S,tr:A,bl:M,br:E,tex:n,writingMode:t.writingMode,glyphOffset:y,sectionIndex:e.sectionIndex,isSDF:p,pixelOffsetTL:C,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return c}(0,r,s,i,a,o,n,e.allowVerticalPlacement),y=e.textSizeData;let v=null;"source"===y.kind?(v=[Cu*i.layout.get("text-size").evaluate(o,{})],v[0]>Pu&&C(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===y.kind&&(v=[Cu*f.compositeTextSizes[0].evaluate(o,{},m),Cu*f.compositeTextSizes[1].evaluate(o,{},m)],(v[0]>Pu||v[1]>Pu)&&C(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,v,s,a,o,c,t,l.lineStartIndex,l.lineLength,d,m);for(const h of u)p[h]=e.text.placedSymbolArray.length-1;return 4*g.length}function $h(e){for(const t in e)return e[t];return null}function Zh(e,t,r,n){const i=e.compareText;if(t in i){const e=i[t];for(let t=e.length-1;t>=0;t--)if(n.dist(e[t])<r)return!0}else i[t]=[];return i[t].push(n),!1}const Xh=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Yh{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");const n=r>>4;if(1!==n)throw new Error(`Got v${n} data when expected v1.`);const i=Xh[15&r];if(!i)throw new Error("Unrecognized array type.");const[a]=new Uint16Array(e,2,1),[o]=new Uint32Array(e,4,1);return new Yh(o,a,i,e)}constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:64,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float64Array,n=arguments.length>3?arguments[3]:void 0;if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const i=Xh.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw new Error(`Unexpected typed array class: ${r}.`);n&&n instanceof ArrayBuffer?(this.data=n,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+o+s),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+o+s,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return Kh(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,n){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],l=[];for(;s.length;){const c=s.pop()||0,u=s.pop()||0,h=s.pop()||0;if(u-h<=o){for(let o=h;o<=u;o++){const s=a[2*o],c=a[2*o+1];s>=e&&s<=r&&c>=t&&c<=n&&l.push(i[o])}continue}const p=h+u>>1,d=a[2*p],f=a[2*p+1];d>=e&&d<=r&&f>=t&&f<=n&&l.push(i[p]),(0===c?e<=d:t<=f)&&(s.push(h),s.push(p-1),s.push(1-c)),(0===c?r>=d:n>=f)&&(s.push(p+1),s.push(u),s.push(1-c))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:i,nodeSize:a}=this,o=[0,n.length-1,0],s=[],l=r*r;for(;o.length;){const c=o.pop()||0,u=o.pop()||0,h=o.pop()||0;if(u-h<=a){for(let r=h;r<=u;r++)tp(i[2*r],i[2*r+1],e,t)<=l&&s.push(n[r]);continue}const p=h+u>>1,d=i[2*p],f=i[2*p+1];tp(d,f,e,t)<=l&&s.push(n[p]),(0===c?e-r<=d:t-r<=f)&&(o.push(h),o.push(p-1),o.push(1-c)),(0===c?e+r>=d:t+r>=f)&&(o.push(p+1),o.push(u),o.push(1-c))}return s}}function Kh(e,t,r,n,i,a){if(i-n<=r)return;const o=n+i>>1;Jh(e,t,o,n,i,a),Kh(e,t,r,n,o-1,1-a),Kh(e,t,r,o+1,i,1-a)}function Jh(e,t,r,n,i,a){for(;i>n;){if(i-n>600){const o=i-n+1,s=r-n+1,l=Math.log(o),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(o-c)/o)*(s-o/2<0?-1:1);Jh(e,t,r,Math.max(n,Math.floor(r-s*c/o+u)),Math.min(i,Math.floor(r+(o-s)*c/o+u)),a)}const o=t[2*r+a];let s=n,l=i;for(Qh(e,t,n,r),t[2*i+a]>o&&Qh(e,t,n,i);s<l;){for(Qh(e,t,s,l),s++,l--;t[2*s+a]<o;)s++;for(;t[2*l+a]>o;)l--}t[2*n+a]===o?Qh(e,t,n,l):(l++,Qh(e,t,l,i)),l<=r&&(n=l+1),r<=l&&(i=l-1)}}function Qh(e,t,r,n){ep(e,r,n),ep(t,2*r,2*n),ep(t,2*r+1,2*n+1)}function ep(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function tp(e,t,r,n){const i=e-r,a=t-n;return i*i+a*a}var rp;e.bg=void 0,(rp=e.bg||(e.bg={})).create="create",rp.load="load",rp.fullLoad="fullLoad";let np=null,ip=[];const ap=1e3/60,op="loadTime",sp="fullLoadTime",lp={mark(e){performance.mark(e)},frame(e){const t=e;null!=np&&ip.push(t-np),np=t},clearMetrics(){np=null,ip=[],performance.clearMeasures(op),performance.clearMeasures(sp);for(const t in e.bg)performance.clearMarks(e.bg[t])},getPerformanceMetrics(){performance.measure(op,e.bg.create,e.bg.load),performance.measure(sp,e.bg.create,e.bg.fullLoad);const t=performance.getEntriesByName(op)[0].duration,r=performance.getEntriesByName(sp)[0].duration,n=ip.length,i=1/(ip.reduce(((e,t)=>e+t),0)/n/1e3),a=ip.filter((e=>e>ap)).reduce(((e,t)=>e+(t-ap)/ap),0);return{loadTime:t,fullLoadTime:r,fps:i,percentDroppedFrames:a/(n+a)*100,totalFrames:n}}};e.$=class extends Va{},e.A=Fs,e.B=_i,e.C=function(e){if(null==I){const t=e.navigator?e.navigator.userAgent:null;I=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return I},e.D=Ma,e.E=K,e.F=class{constructor(e,t){var r,n,i;this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Qu((()=>this.process())),this.subscription=(r=this.target,n="message",i=e=>this.receive(e),r.addEventListener(n,i,!1),{unsubscribe:()=>{r.removeEventListener(n,i,!1)}}),this.globalScope=L(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise(((r,n)=>{const i=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[i]={resolve:r,reject:n},t&&t.signal.addEventListener("abort",(()=>{delete this.resolveRejects[i];const t={id:i,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)}),{once:!0});const a=[],o=Object.assign(Object.assign({},e),{id:i,sourceMapId:this.mapId,origin:location.origin,data:Li(e.data,a)});this.target.postMessage(o,{transfer:a})}))}receive(e){const t=e.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];const e=this.abortControllers[r];return delete this.abortControllers[r],void(e&&e.abort())}if(L(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,r){return t(this,void 0,void 0,(function*(){if("<response>"===r.type){const t=this.resolveRejects[e];if(delete this.resolveRejects[e],!t)return;return void(r.error?t.reject(Ii(r.error)):t.resolve(Ii(r.data)))}if(!this.messageHandlers[r.type])return void this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const t=Ii(r.data),n=new AbortController;this.abortControllers[e]=n;try{const i=yield this.messageHandlers[r.type](r.sourceMapId,t,n);this.completeTask(e,null,i)}catch(i){this.completeTask(e,i)}}))}completeTask(e,t,r){const n=[];delete this.abortControllers[e];const i={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?Li(t):null,data:Li(r,n)};this.target.postMessage(i,{transfer:n})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.G=V,e.H=function(){var e=new Fs(16);return Fs!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.I=cu,e.J=function(e,t,r){var n,i,a,o,s,l,c,u,h,p,d,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(i=t[1],a=t[2],o=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=n=t[0],e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=n*m+s*g+h*y+t[12],e[13]=i*m+l*g+p*y+t[13],e[14]=a*m+c*g+d*y+t[14],e[15]=o*m+u*g+f*y+t[15]),e},e.K=function(e,t,r){var n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.L=Ns,e.M=function(e,t){const r={};for(let n=0;n<t.length;n++){const i=t[n];i in e&&(r[i]=e[i])}return r},e.N=th,e.O=ih,e.P=h,e.Q=ah,e.R=Qs,e.S=ph,e.T=_a,e.U=y,e.V=v,e.W=R,e.X=ds,e.Y=Fa,e.Z=lh,e._=t,e.a=N,e.a$=function(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],g=e[14],y=e[15],v=t[0],x=t[1],b=t[2],_=t[3],w=t[4],k=t[5],T=t[6],S=t[7],A=t[8],M=t[9],E=t[10],C=t[11],P=t[12],L=t[13],I=t[14],z=t[15];return Math.abs(r-v)<=js*Math.max(1,Math.abs(r),Math.abs(v))&&Math.abs(n-x)<=js*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=js*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(a-_)<=js*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(o-w)<=js*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-k)<=js*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(l-T)<=js*Math.max(1,Math.abs(l),Math.abs(T))&&Math.abs(c-S)<=js*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(u-A)<=js*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(h-M)<=js*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-E)<=js*Math.max(1,Math.abs(p),Math.abs(E))&&Math.abs(d-C)<=js*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(f-P)<=js*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-L)<=js*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(g-I)<=js*Math.max(1,Math.abs(g),Math.abs(I))&&Math.abs(y-z)<=js*Math.max(1,Math.abs(y),Math.abs(z))},e.a0=Fo,e.a1=uh,e.a2=ue,e.a3=e=>{const t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(const n of e){const e=window.document.createElement("source");W(n)||(t.crossOrigin="Anonymous"),e.src=n,t.appendChild(e)}}))},e.a4=function(){return T++},e.a5=uo,e.a6=Nu,e.a7=On,e.a8=ys,e.a9=gh,e.aA=function(e){if("custom"===e.type)return new Ju(e);switch(e.type){case"background":return new Zu(e);case"circle":return new Hs(e);case"fill":return new Bl(e);case"fill-extrusion":return new cc(e);case"heatmap":return new rl(e);case"hillshade":return new al(e);case"line":return new Sc(e);case"raster":return new Ku(e);case"symbol":return new Gu(e)}},e.aB=M,e.aC=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!te(e.version,t.version))return[{command:"setStyle",args:[t]}];te(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),te(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),te(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),te(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),te(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),te(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),te(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),te(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),te(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),te(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),te(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});const n={},i=[];!function(e,t,r,n){let i;for(i in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,i)&&(Object.prototype.hasOwnProperty.call(t,i)||ie(i,r,n));for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(Object.prototype.hasOwnProperty.call(e,i)?te(e[i],t[i])||("geojson"===e[i].type&&"geojson"===t[i].type&&oe(e,t,i)?re(r,{command:"setGeoJSONSourceData",args:[i,t[i].data]}):ae(i,t,r,n)):ne(i,t,r))}(e.sources,t.sources,i,n);const a=[];e.layers&&e.layers.forEach((e=>{"source"in e&&n[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)})),r=r.concat(i),function(e,t,r){t=t||[];const n=(e=e||[]).map(le),i=t.map(le),a=e.reduce(ce,{}),o=t.reduce(ce,{}),s=n.slice(),l=Object.create(null);let c,u,h,p,d;for(let f=0,m=0;f<n.length;f++)c=n[f],Object.prototype.hasOwnProperty.call(o,c)?m++:(re(r,{command:"removeLayer",args:[c]}),s.splice(s.indexOf(c,m),1));for(let f=0,m=0;f<i.length;f++)c=i[i.length-1-f],s[s.length-1-f]!==c&&(Object.prototype.hasOwnProperty.call(a,c)?(re(r,{command:"removeLayer",args:[c]}),s.splice(s.lastIndexOf(c,s.length-m),1)):m++,p=s[s.length-f],re(r,{command:"addLayer",args:[o[c],p]}),s.splice(s.length-f,0,c),l[c]=!0);for(let f=0;f<i.length;f++)if(c=i[f],u=a[c],h=o[c],!l[c]&&!te(u,h))if(te(u.source,h.source)&&te(u["source-layer"],h["source-layer"])&&te(u.type,h.type)){for(d in se(u.layout,h.layout,r,c,null,"setLayoutProperty"),se(u.paint,h.paint,r,c,null,"setPaintProperty"),te(u.filter,h.filter)||re(r,{command:"setFilter",args:[c,h.filter]}),te(u.minzoom,h.minzoom)&&te(u.maxzoom,h.maxzoom)||re(r,{command:"setLayerZoomRange",args:[c,h.minzoom,h.maxzoom]}),u)Object.prototype.hasOwnProperty.call(u,d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?se(u[d],h[d],r,c,d.slice(6),"setPaintProperty"):te(u[d],h[d])||re(r,{command:"setLayerProperty",args:[c,d,h[d]]}));for(d in h)Object.prototype.hasOwnProperty.call(h,d)&&!Object.prototype.hasOwnProperty.call(u,d)&&"layout"!==d&&"paint"!==d&&"filter"!==d&&"metadata"!==d&&"minzoom"!==d&&"maxzoom"!==d&&(0===d.indexOf("paint.")?se(u[d],h[d],r,c,d.slice(6),"setPaintProperty"):te(u[d],h[d])||re(r,{command:"setLayerProperty",args:[c,d,h[d]]}))}else re(r,{command:"removeLayer",args:[c]}),p=s[s.lastIndexOf(c)+1],re(r,{command:"addLayer",args:[h,p]})}(a,t.layers,r)}catch(n){console.warn("Unable to compute style diff:",n),r=[{command:"setStyle",args:[t]}]}return r},e.aD=function(e){const t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.aE=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let n=0;n<t.length;n++)if(!e(t[n],r[n]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r)return!1;if(Object.keys(t).length!==Object.keys(r).length)return!1;for(const n in t)if(!e(t[n],r[n]))return!1;return!0}return t===r},e.aF=S,e.aG=A,e.aH=class extends Jo{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.aI=Qo,e.aJ=class extends Jo{constructor(e,t){super(e,t),this.current=rs}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.aK=es,e.aL=ts,e.aM=Qe,e.aN=class extends Jo{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.aO=class extends Jo{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.aP=function(e,t,r,n,i,a,o){var s=1/(t-r),l=1/(n-i),c=1/(a-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*l,e[14]=(o+a)*c,e[15]=1,e},e.aQ=Vs,e.aR=class extends Ja{},e.aS=Lc,e.aT=class extends eo{},e.aU=tl,e.aV=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.aW=el,e.aX=wo,e.aY=Oo,e.aZ=class extends so{},e.a_=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},e.aa=function(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,n,i)=>{const a=n||i;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t},e.ab=function(e,t){const r=[];for(const n in e)n in t||r.push(n);return r},e.ac=_,e.ad=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+u*n,e[2]=s*i+h*n,e[3]=l*i+p*n,e[4]=c*i-a*n,e[5]=u*i-o*n,e[6]=h*i-s*n,e[7]=p*i-l*n,e},e.ae=function(e){var t=new Fs(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.af=qs,e.ag=function(e,t){let r=0,n=0;if("constant"===e.kind)n=e.layoutSize;else if("source"!==e.kind){const{interpolationType:i,minZoom:a,maxZoom:o}=e,s=i?_(jt.interpolationFactor(i,t,a,o),0,1):0;"camera"===e.kind?n=Dt.number(e.minSize,e.maxSize,s):r=s}return{uSizeT:r,uSize:n}},e.ai=function(e,t,r){let{uSize:n,uSizeT:i}=t,{lowerSize:a,upperSize:o}=r;return"source"===e.kind?a/Cu:"composite"===e.kind?Dt.number(a/Cu,o/Cu,i):n},e.aj=Du,e.ak=function(e,t,r,n){const i=t.y-e.y,a=t.x-e.x,o=n.y-r.y,s=n.x-r.x,l=o*a-s*i;if(0===l)return null;const c=(s*(e.y-r.y)-o*(e.x-r.x))/l;return new h(e.x+c*a,e.y+c*i)},e.al=_h,e.am=bs,e.an=Bs,e.ao=function(e){let t=1/0,r=1/0,n=-1/0,i=-1/0;for(const a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),n=Math.max(n,a.x),i=Math.max(i,a.y);return[t,r,n,i]},e.ap=Oc,e.ar=Iu,e.as=function(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*o,x=r*l-i*o,b=r*c-a*o,_=n*l-i*s,w=n*c-a*s,k=i*c-a*l,T=u*m-h*f,S=u*g-p*f,A=u*y-d*f,M=h*g-p*m,E=h*y-d*m,C=p*y-d*g,P=v*C-x*E+b*M+_*A-w*S+k*T;return P?(e[0]=(s*C-l*E+c*M)*(P=1/P),e[1]=(i*E-n*C-a*M)*P,e[2]=(m*k-g*w+y*_)*P,e[3]=(p*w-h*k-d*_)*P,e[4]=(l*A-o*C-c*S)*P,e[5]=(r*C-i*A+a*S)*P,e[6]=(g*b-f*k-y*x)*P,e[7]=(u*k-p*b+d*x)*P,e[8]=(o*E-s*A+c*T)*P,e[9]=(n*A-r*E-a*T)*P,e[10]=(f*w-m*b+y*v)*P,e[11]=(h*b-u*w-d*v)*P,e[12]=(s*S-o*M-l*T)*P,e[13]=(r*M-n*S+i*T)*P,e[14]=(m*x-f*_-g*v)*P,e[15]=(u*_-h*x+p*v)*P,e):null},e.at=Hh,e.au=Tu,e.av=Yh,e.aw=function(){const e={},t=J.$version;for(const r in J.$root){const n=J.$root[r];if(n.required){let i=null;i="version"===r?t:"array"===n.type?[]:{},null!=i&&(e[r]=i)}}return e},e.ax=zi,e.ay=H,e.az=function(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=ee(e[r],t[e[r].ref]));return e},e.b=z,e.b0=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.b1=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},e.b2=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.b3=w,e.b4=hh,e.b5=oh,e.b6=function(e,t,r,n,i){var a,o=1/Math.tan(t/2);return e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=i&&i!==1/0?(e[10]=(i+n)*(a=1/(n-i)),e[14]=2*i*n*a):(e[10]=-1,e[14]=-2*n),e},e.b7=function(e,t,r){var n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+u*n,e[6]=s*i+h*n,e[7]=l*i+p*n,e[8]=c*i-a*n,e[9]=u*i-o*n,e[10]=h*i-s*n,e[11]=p*i-l*n,e},e.b8=x,e.b9=b,e.bA=Rc,e.bB=function(e){return e.message===F},e.bC=An,e.bD=ya,e.ba=function(e){return e*Math.PI/180},e.bb=function(e,t){const{x:r,y:n}=lh.fromLngLat(t);return!(e<0||e>25||n<0||n>=1||r<0||r>=1)},e.bc=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.bd=class extends Ua{},e.be=eh,e.bf=lp,e.bh=q,e.bi=function(e,t){N.REGISTERED_PROTOCOLS[e]=t},e.bj=function(e){delete N.REGISTERED_PROTOCOLS[e]},e.bk=function(e,t){const r={};for(let i=0;i<e.length;i++){const n=t&&t[e[i].id]||qn(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}const n=[];for(const i in r)n.push(r[i]);return n},e.bl=Mi,e.bm=mh,e.bn=yh,e.bo=uu,e.bp=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=ds/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;const r=t.bucket.layers[0],n=r.layout,i=r._unevaluatedLayout._values,a={layoutIconSize:i["icon-size"].possiblyEvaluate(new va(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new va(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new va(18))};if("composite"===t.bucket.textSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.textSizeData;a.compositeTextSizes=[i["text-size"].possiblyEvaluate(new va(e),t.canonical),i["text-size"].possiblyEvaluate(new va(r),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.iconSizeData;a.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new va(e),t.canonical),i["icon-size"].possiblyEvaluate(new va(r),t.canonical)]}const o=n.get("text-line-height")*Oc,s="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement"),l=n.get("text-keep-upright"),c=n.get("text-size");for(const u of t.bucket.features){const i=n.get("text-font").evaluate(u,{},t.canonical).join(","),h=c.evaluate(u,{},t.canonical),p=a.layoutTextSize.evaluate(u,{},t.canonical),d=a.layoutIconSize.evaluate(u,{},t.canonical),f={horizontal:{},vertical:void 0},m=u.text;let g,y=[0,0];if(m){const a=m.toString(),c=n.get("text-letter-spacing").evaluate(u,{},t.canonical)*Oc,d=oa(a)?c:0,g=n.get("text-anchor").evaluate(u,{},t.canonical),v=qh(r,u,t.canonical);if(!v){const e=n.get("text-radial-offset").evaluate(u,{},t.canonical);y=e?Vh(g,[e*Oc,Uh]):n.get("text-offset").evaluate(u,{},t.canonical).map((e=>e*Oc))}let x=s?"center":n.get("text-justify").evaluate(u,{},t.canonical);const b="point"===n.get("symbol-placement")?n.get("text-max-width").evaluate(u,{},t.canonical)*Oc:1/0,_=()=>{t.bucket.allowVerticalPlacement&&aa(a)&&(f.vertical=fu(m,t.glyphMap,t.glyphPositions,t.imagePositions,i,b,o,g,"left",d,y,e.ah.vertical,!0,p,h))};if(!s&&v){const r=new Set;if("auto"===x)for(let e=0;e<v.values.length;e+=2)r.add(Hh(v.values[e]));else r.add(x);let n=!1;for(const a of r)if(!f.horizontal[a])if(n)f.horizontal[a]=f.horizontal[0];else{const r=fu(m,t.glyphMap,t.glyphPositions,t.imagePositions,i,b,o,"center",a,d,y,e.ah.horizontal,!1,p,h);r&&(f.horizontal[a]=r,n=1===r.positionedLines.length)}_()}else{"auto"===x&&(x=Hh(g));const r=fu(m,t.glyphMap,t.glyphPositions,t.imagePositions,i,b,o,g,x,d,y,e.ah.horizontal,!1,p,h);r&&(f.horizontal[x]=r),_(),aa(a)&&s&&l&&(f.vertical=fu(m,t.glyphMap,t.glyphPositions,t.imagePositions,i,b,o,g,x,d,y,e.ah.vertical,!1,p,h))}}let v=!1;if(u.icon&&u.icon.name){const e=t.imageMap[u.icon.name];e&&(g=Au(t.imagePositions[u.icon.name],n.get("icon-offset").evaluate(u,{},t.canonical),n.get("icon-anchor").evaluate(u,{},t.canonical)),v=!!e.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=v:t.bucket.sdfIcons!==v&&C("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.bucket.pixelRatio||0!==n.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}const x=$h(f.horizontal)||f.vertical;t.bucket.iconsInText=!!x&&x.iconsInText,(x||g)&&Gh(t.bucket,u,f,g,t.imageMap,a,p,d,y,v,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.bq=xc,e.br=Rl,e.bs=ic,e.bt=ql,e.bu=iu,e.bv=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.bw=function(e,r,n,i,a){return t(this,void 0,void 0,(function*(){if(v())try{return yield R(e,r,n,i,a)}catch(t){}return function(e,t,r,n,i){const a=e.width,o=e.height;D&&j||(D=new OffscreenCanvas(a,o),j=D.getContext("2d",{willReadFrequently:!0})),D.width=a,D.height=o,j.drawImage(e,0,0,a,o);const s=j.getImageData(t,r,n,i);return j.clearRect(0,0,a,o),s.data}(e,r,n,i,a)}))},e.bx=fh,e.by=n,e.bz=a,e.c=B,e.d=e=>t(void 0,void 0,void 0,(function*(){if(0===e.byteLength)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t)}catch(r){throw new Error(`Could not load image because of ${r.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),e.e=k,e.f=e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>{t(n),URL.revokeObjectURL(n.src),n.onload=null,window.requestAnimationFrame((()=>{n.src=O}))},n.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(e)],{type:"image/png"});n.src=e.byteLength?URL.createObjectURL(i):O})),e.g=U,e.h=(e,t)=>G(k(e,{type:"json"}),t),e.i=L,e.j=Y,e.k=X,e.l=(e,t)=>G(k(e,{type:"arrayBuffer"}),t),e.m=G,e.n=function(e){return new iu(e).readFields(au,[])},e.o=Js,e.p=lu,e.q=Ia,e.r=bi,e.s=W,e.t=Ti,e.u=xi,e.v=J,e.w=C,e.x=function(e){let[t,r,n]=e;return r+=90,r*=Math.PI/180,n*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(n),y:t*Math.sin(r)*Math.sin(n),z:t*Math.cos(n)}},e.y=Dt,e.z=va})),n("worker",0,(function(e){class t{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,r){for(const i of t){this._layerConfigs[i.id]=i;const t=this._layers[i.id]=e.aA(i);t._featureFilter=e.a7(t.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const n=e.bk(Object.values(this._layerConfigs),this.keyCache);for(const e of n){const t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;const n=r.source||"";let i=this.familiesBySource[n];i||(i=this.familiesBySource[n]={});const a=r.sourceLayer||"_geojsonTileLayer";let o=i[a];o||(o=i[a]=[]),o.push(t)}}}class r{constructor(t){const r={},n=[];for(const e in t){const i=t[e],a=r[e]={};for(const e in i){const t=i[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}const{w:i,h:a}=e.p(n),o=new e.o({width:i||1,height:a||1});for(const s in t){const n=t[s];for(const t in n){const i=n[+t];if(!i||0===i.bitmap.width||0===i.bitmap.height)continue;const a=r[s][t].rect;e.o.copy(i.bitmap,o,{x:0,y:0},{x:a.x+1,y:a.y+1},i.bitmap)}}this.image=o,this.positions=r}}e.bl("GlyphAtlas",r);class n{constructor(t){this.tileID=new e.S(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,n,a,o){return e._(this,void 0,void 0,(function*(){this.status="parsing",this.data=t,this.collisionBoxArray=new e.a5;const s=new e.bm(Object.keys(t.layers).sort()),l=new e.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},u={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:a},h=n.familiesBySource[this.source];for(const r in h){const n=t.layers[r];if(!n)continue;1===n.version&&e.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=s.encode(r),p=[];for(let e=0;e<n.length;e++){const t=n.feature(e),i=l.getId(t,r);p.push({feature:t,id:i,index:e,sourceLayerIndex:o})}for(const t of h[r]){const r=t[0];r.source!==this.source&&e.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(i(t,this.zoom,a),(c[r.id]=r.createBucket({index:l.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(p,u,this.tileID.canonical),l.bucketLayerIDs.push(t.map((e=>e.id))))}}const p=e.aF(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>null==e?void 0:e.abort())),this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(p).length){const e=new AbortController;this.inFlightDependencies.push(e),d=o.sendAsync({type:"GG",data:{stacks:p,source:this.source,tileID:this.tileID,type:"glyphs"}},e)}const f=Object.keys(u.iconDependencies);let m=Promise.resolve({});if(f.length){const e=new AbortController;this.inFlightDependencies.push(e),m=o.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},e)}const g=Object.keys(u.patternDependencies);let y=Promise.resolve({});if(g.length){const e=new AbortController;this.inFlightDependencies.push(e),y=o.sendAsync({type:"GI",data:{icons:g,source:this.source,tileID:this.tileID,type:"patterns"}},e)}const[v,x,b]=yield Promise.all([d,m,y]),_=new r(v),w=new e.bo(x,b);for(const t in c){const r=c[t];r instanceof e.a6?(i(r.layers,this.zoom,a),e.bp({bucket:r,glyphMap:v,glyphPositions:_.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):r.hasPattern&&(r instanceof e.bq||r instanceof e.br||r instanceof e.bs)&&(i(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter((e=>!e.isEmpty())),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:_.image,imageAtlas:w,glyphMap:this.returnDependencies?v:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?_.positions:null}}))}}function i(t,r,n){const i=new e.z(r);for(const e of t)e.recalculate(i,n)}class a{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){const n=yield e.l(t.request,r);try{return{vectorTile:new e.bt.VectorTile(new e.bu(n.data)),rawData:n.data,cacheControl:n.cacheControl,expires:n.expires}}catch(i){const e=new Uint8Array(n.data);let r=`Unable to parse the tile at ${t.request.url}, `;throw r+=31===e[0]&&139===e[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${i.message}`,new Error(r)}}))}loadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid,i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request),a=new n(t);this.loading[r]=a;const o=new AbortController;a.abort=o;try{const n=yield this.loadVectorTile(t,o);if(delete this.loading[r],!n)return null;const s=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);const c={};if(i){const e=i.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=n.vectorTile;const u=a.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[r]=a,this.fetching[r]={rawTileData:s,cacheControl:l,resourceTiming:c};try{const t=yield u;return e.e({rawTileData:s.slice(0)},t,l,c)}finally{delete this.fetching[r]}}catch(s){throw delete this.loading[r],a.status="done",this.loaded[r]=a,s}}))}reloadTile(t){return e._(this,void 0,void 0,(function*(){const r=t.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const n=this.loaded[r];if(n.showCollisionBoxes=t.showCollisionBoxes,"parsing"===n.status){const t=yield n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor);let i;if(this.fetching[r]){const{rawTileData:n,cacheControl:a,resourceTiming:o}=this.fetching[r];delete this.fetching[r],i=e.e({rawTileData:n.slice(0)},t,a,o)}else i=t;return i}if("done"===n.status&&n.vectorTile)return n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){const e=this.loading,r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort.abort(),delete e[r])}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[t.uid]&&delete this.loaded[t.uid]}))}}class o{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,(function*(){const{uid:r,encoding:n,rawImageData:i,redFactor:a,greenFactor:o,blueFactor:s,baseShift:l}=t,c=i.width+2,u=i.height+2,h=e.b(i)?new e.R({width:c,height:u},yield e.bw(i,-1,-1,c,u)):i,p=new e.bx(r,h,n,a,o,s,l);return this.loaded=this.loaded||{},this.loaded[r]=p,p}))}removeTile(e){const t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}function s(e,t){if(0!==e.length){l(e[0],t);for(var r=1;r<e.length;r++)l(e[r],!t)}}function l(e,t){for(var r=0,n=0,i=0,a=e.length,o=a-1;i<a;o=i++){var s=(e[i][0]-e[o][0])*(e[o][1]+e[i][1]),l=r+s;n+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+n>=0!=!!t&&e.reverse()}var c=e.by((function e(t,r){var n,i=t&&t.type;if("FeatureCollection"===i)for(n=0;n<t.features.length;n++)e(t.features[n],r);else if("GeometryCollection"===i)for(n=0;n<t.geometries.length;n++)e(t.geometries[n],r);else if("Feature"===i)e(t.geometry,r);else if("Polygon"===i)s(t.coordinates,r);else if("MultiPolygon"===i)for(n=0;n<t.coordinates.length;n++)s(t.coordinates[n],r);return t}));const u=e.bt.VectorTileFeature.prototype.toGeoJSON;var h={exports:{}},p=e.bz,d=e.bt.VectorTileFeature,f=m;function m(e,t){this.options=t||{},this.features=e,this.length=e.length}function g(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}m.prototype.feature=function(e){return new g(this.features[e],this.options.extent)},g.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],n=[],i=0;i<r.length;i++)n.push(new p(r[i][0],r[i][1]));this.geometry.push(n)}return this.geometry},g.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,n=1/0,i=-1/0,a=0;a<e.length;a++)for(var o=e[a],s=0;s<o.length;s++){var l=o[s];t=Math.min(t,l.x),r=Math.max(r,l.x),n=Math.min(n,l.y),i=Math.max(i,l.y)}return[t,n,r,i]},g.prototype.toGeoJSON=d.prototype.toGeoJSON;var y=e.bA,v=f;function x(e){var t=new y;return function(e,t){for(var r in e.layers)t.writeMessage(3,b,e.layers[r])}(e,t),t.finish()}function b(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)n.feature=e.feature(r),t.writeMessage(2,_,n);var i=n.keys;for(r=0;r<i.length;r++)t.writeStringField(3,i[r]);var a=n.values;for(r=0;r<a.length;r++)t.writeMessage(4,A,a[r])}function _(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,w,e),t.writeVarintField(3,r.type),t.writeMessage(4,S,r)}function w(e,t){var r=e.feature,n=e.keys,i=e.values,a=e.keycache,o=e.valuecache;for(var s in r.properties){var l=r.properties[s],c=a[s];if(null!==l){void 0===c&&(n.push(s),a[s]=c=n.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,p=o[h];void 0===p&&(i.push(l),o[h]=p=i.length-1),t.writeVarint(p)}}}function k(e,t){return(t<<3)+(7&e)}function T(e){return e<<1^e>>31}function S(e,t){for(var r=e.loadGeometry(),n=e.type,i=0,a=0,o=r.length,s=0;s<o;s++){var l=r[s],c=1;1===n&&(c=l.length),t.writeVarint(k(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&t.writeVarint(k(2,u-1));var p=l[h].x-i,d=l[h].y-a;t.writeVarint(T(p)),t.writeVarint(T(d)),i+=p,a+=d}3===n&&t.writeVarint(k(7,1))}}function A(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}h.exports=x,h.exports.fromVectorTileJs=x,h.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var n in e)r[n]=new v(e[n].features,t),r[n].name=n,r[n].version=t.version,r[n].extent=t.extent;return x({layers:r})},h.exports.GeoJSONWrapper=v;var M=e.by(h.exports);const E={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},C=Math.fround||(P=new Float32Array(1),e=>(P[0]=+e,P[0]));var P;class L{constructor(e){this.options=Object.assign(Object.create(E),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:r,maxZoom:n}=this.options;t&&console.time("total time");const i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;const a=[];for(let s=0;s<e.length;s++){const t=e[s];if(!t.geometry)continue;const[r,n]=t.geometry.coordinates,i=C(O(r)),o=C(R(n));a.push(i,o,1/0,s,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[n+1]=this._createTree(a);t&&console.timeEnd(i);for(let s=n;s>=r;s--){const e=+Date.now();o=this.trees[s]=this._createTree(this._cluster(o,s)),t&&console.log("z%d: %d clusters in %dms",s,o.numItems,+Date.now()-e)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const n=Math.max(-90,Math.min(90,e[1]));let i=180===e[2]?180:((e[2]+180)%360+360)%360-180;const a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,i=180;else if(r>i){const e=this.getClusters([r,n,180,a],t),o=this.getClusters([-180,n,i,a],t);return e.concat(o)}const o=this.trees[this._limitZoom(t)],s=o.range(O(r),R(a),O(i),R(n)),l=o.data,c=[];for(const u of s){const e=this.stride*u;c.push(l[e+5]>1?I(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),n="No cluster with the specified id.",i=this.trees[r];if(!i)throw new Error(n);const a=i.data;if(t*this.stride>=a.length)throw new Error(n);const o=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=i.within(a[t*this.stride],a[t*this.stride+1],o),l=[];for(const c of s){const t=c*this.stride;a[t+4]===e&&l.push(a[t+5]>1?I(a,t,this.clusterProps):this.points[a[t+3]])}if(0===l.length)throw new Error(n);return l}getLeaves(e,t,r){const n=[];return this._appendLeaves(n,e,t=t||10,r=r||0,0),n}getTile(e,t,r){const n=this.trees[this._limitZoom(e)],i=Math.pow(2,e),{extent:a,radius:o}=this.options,s=o/a,l=(r-s)/i,c=(r+1+s)/i,u={features:[]};return this._addTileFeatures(n.range((t-s)/i,l,(t+1+s)/i,c),n.data,t,r,i,u),0===t&&this._addTileFeatures(n.range(1-s/i,l,1,c),n.data,i,r,i,u),t===i-1&&this._addTileFeatures(n.range(0,l,s/i,c),n.data,-1,r,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,n,i){const a=this.getChildren(t);for(const o of a){const t=o.properties;if(t&&t.cluster?i+t.point_count<=n?i+=t.point_count:i=this._appendLeaves(e,t.cluster_id,r,n,i):i<n?i++:e.push(o),e.length===r)break}return i}_createTree(t){const r=new e.av(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)r.add(t[e],t[e+1]);return r.finish(),r.data=t,r}_addTileFeatures(e,t,r,n,i,a){for(const o of e){const e=o*this.stride,s=t[e+5]>1;let l,c,u;if(s)l=z(t,e,this.clusterProps),c=t[e],u=t[e+1];else{const r=this.points[t[e+3]];l=r.properties;const[n,i]=r.geometry.coordinates;c=O(n),u=R(i)}const h={type:1,geometry:[[Math.round(this.options.extent*(c*i-r)),Math.round(this.options.extent*(u*i-n))]],tags:l};let p;p=s||this.options.generateId?t[e+3]:this.points[t[e+3]].id,void 0!==p&&(h.id=p),a.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:r,extent:n,reduce:i,minPoints:a}=this.options,o=r/(n*Math.pow(2,t)),s=e.data,l=[],c=this.stride;for(let u=0;u<s.length;u+=c){if(s[u+2]<=t)continue;s[u+2]=t;const r=s[u],n=s[u+1],h=e.within(s[u],s[u+1],o),p=s[u+5];let d=p;for(const e of h){const r=e*c;s[r+2]>t&&(d+=s[r+5])}if(d>p&&d>=a){let e,a=r*p,o=n*p,f=-1;const m=(u/c<<5)+(t+1)+this.points.length;for(const r of h){const n=r*c;if(s[n+2]<=t)continue;s[n+2]=t;const l=s[n+5];a+=s[n]*l,o+=s[n+1]*l,s[n+4]=m,i&&(e||(e=this._map(s,u,!0),f=this.clusterProps.length,this.clusterProps.push(e)),i(e,this._map(s,n)))}s[u+4]=m,l.push(a/d,o/d,1/0,m,-1,d),i&&l.push(f)}else{for(let e=0;e<c;e++)l.push(s[u+e]);if(d>1)for(const e of h){const r=e*c;if(!(s[r+2]<=t)){s[r+2]=t;for(let e=0;e<c;e++)l.push(s[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){const n=this.clusterProps[e[t+6]];return r?Object.assign({},n):n}const n=this.points[e[t+3]].properties,i=this.options.map(n);return r&&i===n?Object.assign({},i):i}}function I(e,t,r){return{type:"Feature",id:e[t+3],properties:z(e,t,r),geometry:{type:"Point",coordinates:[(n=e[t],360*(n-.5)),D(e[t+1])]}};var n}function z(e,t,r){const n=e[t+5],i=n>=1e4?`${Math.round(n/1e3)}k`:n>=1e3?Math.round(n/100)/10+"k":n,a=e[t+6],o=-1===a?{}:Object.assign({},r[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+3],point_count:n,point_count_abbreviated:i})}function O(e){return e/360+.5}function R(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function D(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function j(e,t,r,n){let i=n;const a=t+(r-t>>1);let o,s=r-t;const l=e[t],c=e[t+1],u=e[r],h=e[r+1];for(let p=t+3;p<r;p+=3){const t=F(e[p],e[p+1],l,c,u,h);if(t>i)o=p,i=t;else if(t===i){const e=Math.abs(p-a);e<s&&(o=p,s=e)}}i>n&&(o-t>3&&j(e,t,o,n),e[o+2]=i,r-o>3&&j(e,o,r,n))}function F(e,t,r,n,i,a){let o=i-r,s=a-n;if(0!==o||0!==s){const l=((e-r)*o+(t-n)*s)/(o*o+s*s);l>1?(r=i,n=a):l>0&&(r+=o*l,n+=s*l)}return o=e-r,s=t-n,o*o+s*s}function B(e,t,r,n){const i={id:null==e?null:e,type:t,geometry:r,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)N(i,r);else if("Polygon"===t)N(i,r[0]);else if("MultiLineString"===t)for(const a of r)N(i,a);else if("MultiPolygon"===t)for(const a of r)N(i,a[0]);return i}function N(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function U(e,t,r,n){if(!t.geometry)return;const i=t.geometry.coordinates;if(i&&0===i.length)return;const a=t.geometry.type,o=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2);let s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=n||0),"Point"===a)V(i,s);else if("MultiPoint"===a)for(const c of i)V(c,s);else if("LineString"===a)q(i,s,o,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(const r of i)s=[],q(r,s,o,!1),e.push(B(l,"LineString",s,t.properties));return}H(i,s,o,!1)}else if("Polygon"===a)H(i,s,o,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(const i of t.geometry.geometries)U(e,{id:l,geometry:i,properties:t.properties},r,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const e of i){const t=[];H(e,t,o,!0),s.push(t)}}e.push(B(l,a,s,t.properties))}function V(e,t){t.push(G(e[0]),W(e[1]),0)}function q(e,t,r,n){let i,a,o=0;for(let l=0;l<e.length;l++){const r=G(e[l][0]),s=W(e[l][1]);t.push(r,s,0),l>0&&(o+=n?(i*s-r*a)/2:Math.sqrt(Math.pow(r-i,2)+Math.pow(s-a,2))),i=r,a=s}const s=t.length-3;t[2]=1,j(t,0,s,r),t[s+2]=1,t.size=Math.abs(o),t.start=0,t.end=t.size}function H(e,t,r,n){for(let i=0;i<e.length;i++){const a=[];q(e[i],a,r,n),t.push(a)}}function G(e){return e/360+.5}function W(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function $(e,t,r,n,i,a,o,s){if(n/=t,a>=(r/=t)&&o<n)return e;if(o<r||a>=n)return null;const l=[];for(const c of e){const e=c.geometry;let t=c.type;const a=0===i?c.minX:c.minY,o=0===i?c.maxX:c.maxY;if(a>=r&&o<n){l.push(c);continue}if(o<r||a>=n)continue;let u=[];if("Point"===t||"MultiPoint"===t)Z(e,u,r,n,i);else if("LineString"===t)X(e,u,r,n,i,!1,s.lineMetrics);else if("MultiLineString"===t)K(e,u,r,n,i,!1);else if("Polygon"===t)K(e,u,r,n,i,!0);else if("MultiPolygon"===t)for(const s of e){const e=[];K(s,e,r,n,i,!0),e.length&&u.push(e)}if(u.length){if(s.lineMetrics&&"LineString"===t){for(const e of u)l.push(B(c.id,t,e,c.tags));continue}"LineString"!==t&&"MultiLineString"!==t||(1===u.length?(t="LineString",u=u[0]):t="MultiLineString"),"Point"!==t&&"MultiPoint"!==t||(t=3===u.length?"Point":"MultiPoint"),l.push(B(c.id,t,u,c.tags))}}return l.length?l:null}function Z(e,t,r,n,i){for(let a=0;a<e.length;a+=3){const o=e[a+i];o>=r&&o<=n&&J(t,e[a],e[a+1],e[a+2])}}function X(e,t,r,n,i,a,o){let s=Y(e);const l=0===i?Q:ee;let c,u,h=e.start;for(let g=0;g<e.length-3;g+=3){const p=e[g],d=e[g+1],f=e[g+2],m=e[g+3],y=e[g+4],v=0===i?p:d,x=0===i?m:y;let b=!1;o&&(c=Math.sqrt(Math.pow(p-m,2)+Math.pow(d-y,2))),v<r?x>r&&(u=l(s,p,d,m,y,r),o&&(s.start=h+c*u)):v>n?x<n&&(u=l(s,p,d,m,y,n),o&&(s.start=h+c*u)):J(s,p,d,f),x<r&&v>=r&&(u=l(s,p,d,m,y,r),b=!0),x>n&&v<=n&&(u=l(s,p,d,m,y,n),b=!0),!a&&b&&(o&&(s.end=h+c*u),t.push(s),s=Y(e)),o&&(h+=c)}let p=e.length-3;const d=e[p],f=e[p+1],m=0===i?d:f;m>=r&&m<=n&&J(s,d,f,e[p+2]),p=s.length-3,a&&p>=3&&(s[p]!==s[0]||s[p+1]!==s[1])&&J(s,s[0],s[1],s[2]),s.length&&t.push(s)}function Y(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function K(e,t,r,n,i,a){for(const o of e)X(o,t,r,n,i,a,!1)}function J(e,t,r,n){e.push(t,r,n)}function Q(e,t,r,n,i,a){const o=(a-t)/(n-t);return J(e,a,r+(i-r)*o,1),o}function ee(e,t,r,n,i,a){const o=(a-r)/(i-r);return J(e,t+(n-t)*o,a,1),o}function te(e,t){const r=[];for(let n=0;n<e.length;n++){const i=e[n],a=i.type;let o;if("Point"===a||"MultiPoint"===a||"LineString"===a)o=re(i.geometry,t);else if("MultiLineString"===a||"Polygon"===a){o=[];for(const e of i.geometry)o.push(re(e,t))}else if("MultiPolygon"===a){o=[];for(const e of i.geometry){const r=[];for(const n of e)r.push(re(n,t));o.push(r)}}r.push(B(i.id,a,o,i.tags))}return r}function re(e,t){const r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(let n=0;n<e.length;n+=3)r.push(e[n]+t,e[n+1],e[n+2]);return r}function ne(e,t){if(e.transformed)return e;const r=1<<e.z,n=e.x,i=e.y;for(const a of e.features){const e=a.geometry,o=a.type;if(a.geometry=[],1===o)for(let s=0;s<e.length;s+=2)a.geometry.push(ie(e[s],e[s+1],t,r,n,i));else for(let s=0;s<e.length;s++){const o=[];for(let a=0;a<e[s].length;a+=2)o.push(ie(e[s][a],e[s][a+1],t,r,n,i));a.geometry.push(o)}}return e.transformed=!0,e}function ie(e,t,r,n,i,a){return[Math.round(r*(e*n-i)),Math.round(r*(t*n-a))]}function ae(e,t,r,n,i){const a=t===i.maxZoom?0:i.tolerance/((1<<t)*i.extent),o={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:r,y:n,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const s of e)oe(o,s,a,i);return o}function oe(e,t,r,n){const i=t.geometry,a=t.type,o=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===a||"MultiPoint"===a)for(let s=0;s<i.length;s+=3)o.push(i[s],i[s+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)se(o,i,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let s=0;s<i.length;s++)se(o,i[s],e,r,"Polygon"===a,0===s);else if("MultiPolygon"===a)for(let s=0;s<i.length;s++){const t=i[s];for(let n=0;n<t.length;n++)se(o,t[n],e,r,!0,0===n)}if(o.length){let r=t.tags||null;if("LineString"===a&&n.lineMetrics){r={};for(const e in t.tags)r[e]=t.tags[e];r.mapbox_clip_start=i.start/i.size,r.mapbox_clip_end=i.end/i.size}const s={geometry:o,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==t.id&&(s.id=t.id),e.features.push(s)}}function se(e,t,r,n,i,a){const o=n*n;if(n>0&&t.size<(i?o:n))return void(r.numPoints+=t.length/3);const s=[];for(let l=0;l<t.length;l+=3)(0===n||t[l+2]>o)&&(r.numSimplified++,s.push(t[l],t[l+1])),r.numPoints++;i&&function(e,t){let r=0;for(let n=0,i=e.length,a=i-2;n<i;a=n,n+=2)r+=(e[n]-e[a])*(e[n+1]+e[a+1]);if(r>0===t)for(let n=0,i=e.length;n<i/2;n+=2){const t=e[n],r=e[n+1];e[n]=e[i-2-n],e[n+1]=e[i-1-n],e[i-2-n]=t,e[i-1-n]=r}}(s,a),e.push(s)}const le={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class ce{constructor(e,t){const r=(t=this.options=function(e,t){for(const r in t)e[r]=t[r];return e}(Object.create(le),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let n=function(e,t){const r=[];if("FeatureCollection"===e.type)for(let n=0;n<e.features.length;n++)U(r,e.features[n],t,n);else U(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),n=function(e,t){const r=t.buffer/t.extent;let n=e;const i=$(e,1,-1-r,r,0,-1,2,t),a=$(e,1,1-r,2+r,0,-1,2,t);return(i||a)&&(n=$(e,1,-r,1+r,0,-1,2,t)||[],i&&(n=te(i,1).concat(n)),a&&(n=n.concat(te(a,-1)))),n}(n,t),n.length&&this.splitTile(n,0,0,0),r&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,t,r,n,i,a,o){const s=[e,t,r,n],l=this.options,c=l.debug;for(;s.length;){n=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();const u=1<<t,h=ue(t,r,n);let p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=ae(e,t,r,n,l),this.tileCoords.push({z:t,x:r,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,n,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(p.source=e,null==i){if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===i)continue;if(null!=i){const e=i-t;if(r!==a>>e||n!==o>>e)continue}}if(p.source=null,0===e.length)continue;c>1&&console.time("clipping");const d=.5*l.buffer/l.extent,f=.5-d,m=.5+d,g=1+d;let y=null,v=null,x=null,b=null,_=$(e,u,r-d,r+m,0,p.minX,p.maxX,l),w=$(e,u,r+f,r+g,0,p.minX,p.maxX,l);e=null,_&&(y=$(_,u,n-d,n+m,1,p.minY,p.maxY,l),v=$(_,u,n+f,n+g,1,p.minY,p.maxY,l),_=null),w&&(x=$(w,u,n-d,n+m,1,p.minY,p.maxY,l),b=$(w,u,n+f,n+g,1,p.minY,p.maxY,l),w=null),c>1&&console.timeEnd("clipping"),s.push(y||[],t+1,2*r,2*n),s.push(v||[],t+1,2*r,2*n+1),s.push(x||[],t+1,2*r+1,2*n),s.push(b||[],t+1,2*r+1,2*n+1)}}getTile(e,t,r){e=+e,t=+t,r=+r;const n=this.options,{extent:i,debug:a}=n;if(e<0||e>24)return null;const o=1<<e,s=ue(e,t=t+o&o-1,r);if(this.tiles[s])return ne(this.tiles[s],i);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l,c=e,u=t,h=r;for(;!l&&c>0;)c--,u>>=1,h>>=1,l=this.tiles[ue(c,u,h)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",c,u,h),console.time("drilling down")),this.splitTile(l.source,c,u,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[s]?ne(this.tiles[s],i):null):null}}function ue(e,t,r){return 32*((1<<e)*r+t)+e}function he(e,t){return t?e.properties[t]:e.id}function pe(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=he(e,t);if("FeatureCollection"===e.type){const r=new Set;for(const n of e.features){const e=he(n,t);if(null==e)return!1;if(r.has(e))return!1;r.add(e)}return!0}return!1}function de(e,t){const r=new Map;if(null==e);else if("Feature"===e.type)r.set(he(e,t),e);else for(const n of e.features)r.set(he(n,t),n);return r}class fe extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){const r=t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const n=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!n)return null;const i=new class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.X,this.length=t.length,this._features=t}feature(t){return new class{constructor(t){this._feature=t,this.extent=e.X,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const r of this._feature.geometry)t.push([new e.P(r[0],r[1])]);return t}{const t=[];for(const r of this._feature.geometry){const n=[];for(const t of r)n.push(new e.P(t[0],t[1]));t.push(n)}return t}}toGeoJSON(e,t,r){return u.call(this,e,t,r)}}(this._features[t])}}(n.features);let a=M(i);return 0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:i,rawData:a.buffer}}))}loadData(t){return e._(this,void 0,void 0,(function*(){var r;null===(r=this._pendingRequest)||void 0===r||r.abort();const n=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.bv(t.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(t,this._pendingRequest),this._geoJSONIndex=t.cluster?new L(function(t){let{superclusterOptions:r,clusterProperties:n}=t;if(!n||!r)return r;const i={},a={},o={accumulated:null,zoom:0},s={properties:null},l=Object.keys(n);for(const c of l){const[t,r]=n[c],o=e.bC(r),s=e.bC("string"==typeof t?[t,["accumulated"],["get",c]]:t);i[c]=o.value,a[c]=s.value}return r.map=e=>{s.properties=e;const t={};for(const r of l)t[r]=i[r].evaluate(o,s);return t},r.reduce=(e,t)=>{s.properties=t;for(const r of l)o.accumulated=e[r],e[r]=a[r].evaluate(o,s)},r}(t)).load((yield this._pendingData).features):(i=yield this._pendingData,new ce(i,t.geojsonVtOptions)),this.loaded={};const r={};if(n){const e=n.finish();e&&(r.resourceTiming={},r.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return r}catch(a){if(delete this._pendingRequest,e.bB(a))return{abandoned:!0};throw a}var i}))}getData(){return e._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(e){const t=this.loaded;return t&&t[e.uid]?super.reloadTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let n=yield this.loadGeoJSON(t,r);if(delete this._pendingRequest,"object"!=typeof n)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(c(n,!0),t.filter){const r=e.bC(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=n.features.filter((e=>r.value.evaluate({zoom:0},e)));n={type:"FeatureCollection",features:i}}return n}))}loadGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){const{promoteId:n}=t;if(t.request){const i=yield e.h(t.request,r);return this._dataUpdateable=pe(i.data,n)?de(i.data,n):void 0,i.data}if("string"==typeof t.data)try{const e=JSON.parse(t.data);return this._dataUpdateable=pe(e,n)?de(e,n):void 0,e}catch(i){throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${t.source}`);return function(e,t,r){var n,i,a,o;if(t.removeAll&&e.clear(),t.remove)for(const s of t.remove)e.delete(s);if(t.add)for(const s of t.add){const t=he(s,r);null!=t&&e.set(t,s)}if(t.update)for(const s of t.update){let t=e.get(s.id);if(null==t)continue;const r=!s.removeAllProperties&&((null===(n=s.removeProperties)||void 0===n?void 0:n.length)>0||(null===(i=s.addOrUpdateProperties)||void 0===i?void 0:i.length)>0);if((s.newGeometry||s.removeAllProperties||r)&&(t=Object.assign({},t),e.set(s.id,t),r&&(t.properties=Object.assign({},t.properties))),s.newGeometry&&(t.geometry=s.newGeometry),s.removeAllProperties)t.properties={};else if((null===(a=s.removeProperties)||void 0===a?void 0:a.length)>0)for(const e of s.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null===(o=s.addOrUpdateProperties)||void 0===o?void 0:o.length)>0)for(const{key:e,value:n}of s.addOrUpdateProperties)t.properties[e]=n}}(this._dataUpdateable,t.dataDiff,n),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(t){return e._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}class me{constructor(t){this.self=t,this.actor=new e.F(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.bi,this.self.removeProtocol=e.bj,this.self.registerRTLTextPlugin=t=>{if(e.bD.isParsed())throw new Error("RTL text plugin already registered.");e.bD.setMethods(t)},this.actor.registerMessageHandler("LDT",((e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t))),this.actor.registerMessageHandler("RDT",((t,r)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t))),this.actor.registerMessageHandler("GD",((e,t)=>this._getWorkerSource(e,t.type,t.source).getData())),this.actor.registerMessageHandler("LT",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t))),this.actor.registerMessageHandler("RT",((e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t))),this.actor.registerMessageHandler("AT",((e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t))),this.actor.registerMessageHandler("RMT",((e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t))),this.actor.registerMessageHandler("RS",((t,r)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;const e=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],void 0!==e.removeSource&&e.removeSource(r)})))),this.actor.registerMessageHandler("RM",(t=>e._(this,void 0,void 0,(function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t]})))),this.actor.registerMessageHandler("SR",((t,r)=>e._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler("IS",((t,r)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler("UL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(r.layers,r.removedIds)})))),this.actor.registerMessageHandler("SL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(r)}))))}_setImages(t,r){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=r;for(const e in this.workerSources[t]){const n=this.workerSources[t][e];for(const e in n)n[e].availableImages=r}}))}_syncRTLPluginState(t,r){return e._(this,void 0,void 0,(function*(){if(e.bD.isParsed())return e.bD.getState();if("loading"!==r.pluginStatus)return e.bD.setState(r),r;const t=r.pluginURL;if(this.self.importScripts(t),e.bD.isParsed()){const r={pluginStatus:"loaded",pluginURL:t};return e.bD.setState(r),r}throw e.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new t),r}_getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){const n={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new a(n,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new fe(n,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](n,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new o),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new me(self)),me})),n("index",0,(function(e,t){var r="4.7.1";let n,i;const a={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:e=>new Promise(((r,n)=>{const i=requestAnimationFrame(r);e.signal.addEventListener("abort",(()=>{cancelAnimationFrame(i),n(t.c())}))})),getImageData(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){const t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL:e=>(n||(n=document.createElement("a")),n.href=e,n.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==i&&(i=matchMedia("(prefers-reduced-motion: reduce)")),i.matches)}};class o{static testProp(e){if(!o.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in o.docStyle)return e[t];return e[0]}static create(e,t,r){const n=window.document.createElement(e);return void 0!==t&&(n.className=t),r&&r.appendChild(n),n}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(e,t){e.style[o.transformProp]=t}static addEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.addEventListener(t,r,"passive"in n?n:n.capture)}static removeEventListener(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.removeEventListener(t,r,"passive"in n?n:n.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(e){const t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,r,n){const i=r.boundingClientRect;return new t.P((n.clientX-i.left)/r.x-e.clientLeft,(n.clientY-i.top)/r.y-e.clientTop)}static mousePos(e,t){const r=o.getScale(e);return o.getPoint(e,r,t)}static touchPos(e,t){const r=[],n=o.getScale(e);for(let i=0;i<t.length;i++)r.push(o.getPoint(e,n,t[i]));return r}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}o.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);const s={supported:!1,testSupport:function(e){!u&&c&&(h?p(e):l=e)}};let l,c,u=!1,h=!1;function p(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,c),e.isContextLost())return;s.supported=!0}catch(r){}e.deleteTexture(t),u=!0}var d;"undefined"!=typeof document&&(c=document.createElement("img"),c.onload=()=>{l&&p(l),l=null,h=!0},c.onerror=()=>{u=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(e){let r,n,i,a;e.resetRequestQueue=()=>{r=[],n=0,i=0,a={}},e.addThrottleControl=e=>{const t=i++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],l()},e.getImage=function(e,n){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise(((a,o)=>{s.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),t.e(e,{type:"image"}),r.push({abortController:n,requestParameters:e,supportImageRefresh:i,state:"queued",onError:e=>{o(e)},onSuccess:e=>{a(e)}}),l()}))};const o=e=>t._(this,void 0,void 0,(function*(){e.state="running";const{requestParameters:r,supportImageRefresh:i,onError:a,onSuccess:o,abortController:s}=e,u=!1===i&&!t.i(self)&&!t.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((e,t)=>e&&"accept"===t),!0));n++;const h=u?c(r,s):t.m(r,s);try{const r=yield h;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||t.b(r.data)?o(r):r.data&&o({data:yield(p=r.data,"function"==typeof createImageBitmap?t.d(p):t.f(p)),cacheControl:r.cacheControl,expires:r.expires})}catch(d){delete e.abortController,a(d)}finally{n--,l()}var p})),l=()=>{const e=(()=>{for(const e of Object.keys(a))if(a[e]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=n;t<e&&r.length>0;t++){const e=r.shift();e.abortController.signal.aborted?t--:o(e)}},c=(e,r)=>new Promise(((n,i)=>{const a=new Image,o=e.url,s=e.credentials;s&&"include"===s?a.crossOrigin="use-credentials":(s&&"same-origin"===s||!t.s(o))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",i(t.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,n({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=o}))}(d||(d={})),d.resetRequestQueue();class f{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function m(e){var r=new t.A(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}var g,y=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e};g=new t.A(3),t.A!=Float32Array&&(g[0]=0,g[1]=0,g[2]=0);var v=function(e){var t=e[0],r=e[1];return t*t+r*r};function x(e){const t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){const r=[];for(const{id:n,url:i}of e){const e=`${n}${i}`;-1===r.indexOf(e)&&(r.push(e),t.push({id:n,url:i}))}}return t}function b(e,t,r){const n=e.split("?");return n[0]+=`${t}${r}`,n.join("?")}!function(){var e=new t.A(2);t.A!=Float32Array&&(e[0]=0,e[1]=0)}();class _{constructor(e,t,r,n){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,n)}update(e,r,n){const{width:i,height:a}=e,o=!(this.size&&this.size[0]===i&&this.size[1]===a||n),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),o)this.size=[i,a],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,e):l.texImage2D(l.TEXTURE_2D,0,this.format,i,a,0,this.format,l.UNSIGNED_BYTE,e.data);else{const{x:r,y:o}=n||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||t.b(e)?l.texSubImage2D(l.TEXTURE_2D,0,r,o,l.RGBA,l.UNSIGNED_BYTE,e):l.texSubImage2D(l.TEXTURE_2D,0,r,o,i,a,l.RGBA,l.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,r){const{context:n}=this,{gl:i}=n;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),e!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function w(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class k extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){const r=this.images[e];if(r&&!r.data&&r.spriteData){const e=r.spriteData;r.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),r.spriteData=null}return r}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,r){let n=!0;const i=r.data||r.spriteData;return this._validateStretch(r.stretchX,i&&i.width)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchX" value`))),n=!1),this._validateStretch(r.stretchY,i&&i.height)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "stretchY" value`))),n=!1),this._validateContent(r.content,r)||(this.fire(new t.j(new Error(`Image "${e}" has invalid "content" value`))),n=!1),n}_validateStretch(e,t){if(!e)return!0;let r=0;for(const n of e){if(n[0]<r||n[1]<n[0]||t<n[1])return!1;r=n[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;const r=t.spriteData,n=r&&r.width||t.data.width,i=r&&r.height||t.data.height;return!(e[0]<0||n<e[0]||e[1]<0||i<e[1]||e[2]<0||n<e[2]||e[3]<0||i<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const n=this.getImage(e);if(r&&(n.data.width!==t.data.width||n.data.height!==t.data.height))throw new Error(`size mismatch between old image (${n.data.width}x${n.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=n.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((t,r)=>{let n=!0;if(!this.isLoaded())for(const i of e)this.images[i]||(n=!1);this.isLoaded()||n?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){const r={};for(const n of e){let e=this.getImage(n);e||(this.fire(new t.k("styleimagemissing",{id:n})),e=this.getImage(n)),e?r[n]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:Boolean(e.userImage&&e.userImage.render)}:t.w(`Image "${n}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){const r=this.patterns[e],n=this.getImage(e);if(!n)return null;if(r&&r.position.version===n.version)return r.position;if(r)r.position.version=n.version;else{const r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},i=new t.I(r,n);this.patterns[e]={bin:r,position:i}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new _(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const t in this.patterns)e.push(this.patterns[t].bin);const{w:r,h:n}=t.p(e),i=this.atlasImage;i.resize({width:r||1,height:n||1});for(const a in this.patterns){const{bin:e}=this.patterns[a],r=e.x+1,n=e.y+1,o=this.getImage(a).data,s=o.width,l=o.height;t.R.copy(o,i,{x:0,y:0},{x:r,y:n},{width:s,height:l}),t.R.copy(o,i,{x:0,y:l-1},{x:r,y:n-1},{width:s,height:1}),t.R.copy(o,i,{x:0,y:0},{x:r,y:n+l},{width:s,height:1}),t.R.copy(o,i,{x:s-1,y:0},{x:r-1,y:n},{width:1,height:l}),t.R.copy(o,i,{x:0,y:0},{x:r+s,y:n},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const e=this.getImage(r);e||t.w(`Image with ID: "${r}" was not found`),w(e)&&this.updateImage(r,e)}}}const T=1e20;function S(e,t,r,n,i,a,o,s,l){for(let c=t;c<t+n;c++)A(e,r*a+c,a,i,o,s,l);for(let c=r;c<r+i;c++)A(e,c*a+t,1,n,o,s,l)}function A(e,t,r,n,i,a,o){a[0]=0,o[0]=-T,o[1]=T,i[0]=e[t];for(let s=1,l=0,c=0;s<n;s++){i[s]=e[t+s*r];const n=s*s;do{const e=a[l];c=(i[s]-i[e]+n-e*e)/(s-e)/2}while(c<=o[l]&&--l>-1);l++,a[l]=s,o[l]=c,o[l+1]=T}for(let s=0,l=0;s<n;s++){for(;o[l+1]<s;)l++;const n=a[l],c=s-n;e[t+s*r]=i[n]+c*c}}class M{constructor(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return t._(this,void 0,void 0,(function*(){const t=[];for(const i in e)for(const r of e[i])t.push(this._getAndCacheGlyphsPromise(i,r));const r=yield Promise.all(t),n={};for(const{stack:e,id:i,glyph:a}of r)n[e]||(n[e]={}),n[e][i]=a&&{id:a.id,bitmap:a.bitmap.clone(),metrics:a.metrics};return n}))}_getAndCacheGlyphsPromise(e,r){return t._(this,void 0,void 0,(function*(){let t=this.entries[e];t||(t=this.entries[e]={glyphs:{},requests:{},ranges:{}});let n=t.glyphs[r];if(void 0!==n)return{stack:e,id:r,glyph:n};if(n=this._tinySDF(t,e,r),n)return t.glyphs[r]=n,{stack:e,id:r,glyph:n};const i=Math.floor(r/256);if(256*i>65535)throw new Error("glyphs > 65535 not supported");if(t.ranges[i])return{stack:e,id:r,glyph:n};if(!this.url)throw new Error("glyphsUrl is not set");if(!t.requests[i]){const r=M.loadGlyphRange(e,i,this.url,this.requestManager);t.requests[i]=r}const a=yield t.requests[i];for(const e in a)this._doesCharSupportLocalGlyph(+e)||(t.glyphs[+e]=a[+e]);return t.ranges[i]=!0,{stack:e,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,r,n){const i=this.localIdeographFontFamily;if(!i)return;if(!this._doesCharSupportLocalGlyph(n))return;let a=e.tinySDF;if(!a){let t="400";/bold/i.test(r)?t="900":/medium/i.test(r)?t="500":/light/i.test(r)&&(t="200"),a=e.tinySDF=new M.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:i,fontWeight:t})}const o=a.draw(String.fromCharCode(n));return{id:n,bitmap:new t.o({width:o.width||60,height:o.height||60},o.data),metrics:{width:o.glyphWidth/2||24,height:o.glyphHeight/2||24,left:o.glyphLeft/2+.5||0,top:o.glyphTop/2-27.5||-8,advance:o.glyphAdvance/2||24,isDoubleResolution:!0}}}}M.loadGlyphRange=function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const a=256*r,o=a+255,s=i.transformRequest(n.replace("{fontstack}",e).replace("{range}",`${a}-${o}`),"Glyphs"),l=yield t.l(s,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${o}`);const c={};for(const e of t.n(l.data))c[e.id]=e;return c}))},M.TinySDF=class{constructor(){let{fontSize:e=24,buffer:t=3,radius:r=8,cutoff:n=.25,fontFamily:i="sans-serif",fontWeight:a="normal",fontStyle:o="normal"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.buffer=t,this.cutoff=n,this.radius=r;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${o} ${a} ${e}px ${i}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:n,actualBoundingBoxLeft:i,actualBoundingBoxRight:a}=this.ctx.measureText(e),o=Math.ceil(r),s=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-i))),l=Math.min(this.size-this.buffer,o+Math.ceil(n)),c=s+2*this.buffer,u=l+2*this.buffer,h=Math.max(c*u,0),p=new Uint8ClampedArray(h),d={data:p,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:o,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return d;const{ctx:f,buffer:m,gridInner:g,gridOuter:y}=this;f.clearRect(m,m,s,l),f.fillText(e,m,m+o);const v=f.getImageData(m,m,s,l);y.fill(T,0,h),g.fill(0,0,h);for(let x=0;x<l;x++)for(let e=0;e<s;e++){const t=v.data[4*(x*s+e)+3]/255;if(0===t)continue;const r=(x+m)*c+e+m;if(1===t)y[r]=0,g[r]=T;else{const e=.5-t;y[r]=e>0?e*e:0,g[r]=e<0?e*e:0}}S(y,0,0,c,u,c,this.f,this.v,this.z),S(g,m,m,s,l,c,this.f,this.v,this.z);for(let x=0;x<h;x++){const e=Math.sqrt(y[x])-Math.sqrt(g[x]);p[x]=Math.round(255-255*(e/this.radius+this.cutoff))}return d}};class E{constructor(){this.specification=t.v.light.position}possiblyEvaluate(e,r){return t.x(e.expression.evaluate(r))}interpolate(e,r,n){return{x:t.y.number(e.x,r.x,n),y:t.y.number(e.y,r.y,n),z:t.y.number(e.z,r.z,n)}}}let C;class P extends t.E{constructor(e){super(),C=C||new t.q({anchor:new t.D(t.v.light.anchor),position:new E,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.T(C),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.r,e,r))for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,n){return(!n||!1!==n.validate)&&t.t(this,e.call(t.u,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}const L=new t.q({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class I extends t.E{constructor(e){super(),this._transitionable=new t.T(L),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.z(0))}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this._validate(t.B,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const t in e){const r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!1!==(null==n?void 0:n.validate)&&t.t(this,e.call(t.u,t.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class z{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){const r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){const n=[];let i=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,o=!0;n.push({left:i,right:a,isDash:o,zeroLength:0===e[0]});let s=e[0];for(let l=1;l<e.length;l++){o=!o;const t=e[l];i=s*r,s+=t,a=s*r,n.push({left:i,right:a,isDash:o,zeroLength:0===t})}return n}addRoundDash(e,t,r){const n=t/2;for(let i=-r;i<=r;i++){const t=this.width*(this.nextRow+r+i);let a=0,o=e[a];for(let s=0;s<this.width;s++){s/o.right>1&&(o=e[++a]);const l=Math.abs(s-o.left),c=Math.abs(s-o.right),u=Math.min(l,c);let h;const p=i/r*(n+1);if(o.isDash){const e=n-Math.abs(p);h=Math.sqrt(u*u+e*e)}else h=n-Math.sqrt(u*u+p*p);this.data[t+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e){for(let o=e.length-1;o>=0;--o){const t=e[o],r=e[o+1];t.zeroLength?e.splice(o,1):r&&r.isDash===t.isDash&&(r.left=t.left,e.splice(o,1))}const t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);const n=this.width*this.nextRow;let i=0,a=e[i];for(let o=0;o<this.width;o++){o/a.right>1&&(a=e[++i]);const t=Math.abs(o-a.left),r=Math.abs(o-a.right),s=Math.min(t,r);this.data[n+o]=Math.max(0,Math.min(255,(a.isDash?s:-s)+128))}}addDash(e,r){const n=r?7:0,i=2*n+1;if(this.nextRow+i>this.height)return t.w("LineAtlas out of space"),null;let a=0;for(let t=0;t<e.length;t++)a+=e[t];if(0!==a){const t=this.width/a,i=this.getDashRanges(e,this.width,t);r?this.addRoundDash(i,t,n):this.addRegularDash(i)}const o={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:a};return this.nextRow+=i,this.dirty=!0,o}bind(e){const t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}const O="maplibre_preloaded_worker_pool";class R{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<R.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[O]}numActive(){return Object.keys(this.active).length}}const D=Math.floor(a.hardwareConcurrency/2);let j,F;function B(){return j||(j=new R),j}R.workerCount=t.C(globalThis)?Math.max(Math.min(D,3),1):1;class N{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;const n=this.workerPool.acquire(r);for(let i=0;i<n.length;i++){const e=new t.F(n[i],r);e.name=`Worker ${i}`,this.actors.push(e)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,t){const r=[];for(const n of this.actors)r.push(n.sendAsync({type:e,data:t}));return Promise.all(r)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.actors.forEach((e=>{e.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(const r of this.actors)r.registerMessageHandler(e,t)}}function U(){return F||(F=new N(B(),t.G),F.registerMessageHandler("GR",((e,r,n)=>t.m(r,n)))),F}function V(e,r){const n=t.H();return t.J(n,n,[1,1,0]),t.K(n,n,[.5*e.width,.5*e.height,1]),t.L(n,n,e.calculatePosMatrix(r.toUnwrapped()))}function q(e,t,r,n,i,a){const o=function(e,t,r){if(e)for(const n of e){const e=t[n];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(const n in t){const e=t[n];if(e.source===r&&"fill-extrusion"===e.type)return!0}return!1}(i&&i.layers,t,e.id),s=a.maxPitchScaleFactor(),l=e.tilesIn(n,s,o);l.sort(H);const c=[];for(const h of l)c.push({wrappedTileID:h.tileID.wrapped().key,queryResults:h.tile.queryRenderedFeatures(t,r,e._state,h.queryGeometry,h.cameraQueryGeometry,h.scale,i,a,s,V(e.transform,h.tileID))});const u=function(e){const t={},r={};for(const n of e){const e=n.queryResults,i=n.wrappedTileID,a=r[i]=r[i]||{};for(const r in e){const n=e[r],i=a[r]=a[r]||{},o=t[r]=t[r]||[];for(const e of n)i[e.featureIndex]||(i[e.featureIndex]=!0,o.push(e))}}return t}(c);for(const h in u)u[h].forEach((t=>{const r=t.feature,n=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=n}));return u}function H(e,t){const r=e.tileID,n=t.tileID;return r.overscaledZ-n.overscaledZ||r.canonical.y-n.canonical.y||r.wrap-n.wrap||r.canonical.x-n.canonical.x}function G(e,r,n){return t._(this,void 0,void 0,(function*(){let i=e;if(e.url?i=(yield t.h(r.transformRequest(e.url,"Source"),n)).data:yield a.frameAsync(n),!i)return null;const o=t.M(t.e(i,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in i&&i.vector_layers&&(o.vectorLayerIds=i.vector_layers.map((e=>e.id))),o}))}class W{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.N?new t.N(e.lng,e.lat):t.N.convert(e),this}extend(e){const r=this._sw,n=this._ne;let i,a;if(e instanceof t.N)i=e,a=e;else{if(!(e instanceof W))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(W.convert(e)):this.extend(t.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(t.N.convert(e)):this;if(i=e._sw,a=e._ne,!i||!a)return this}return r||n?(r.lng=Math.min(i.lng,r.lng),r.lat=Math.min(i.lat,r.lat),n.lng=Math.max(a.lng,n.lng),n.lat=Math.max(a.lat,n.lat)):(this._sw=new t.N(i.lng,i.lat),this._ne=new t.N(a.lng,a.lat)),this}getCenter(){return new t.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.N(this.getWest(),this.getNorth())}getSouthEast(){return new t.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:r,lat:n}=t.N.convert(e);let i=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&i}static convert(e){return e instanceof W?e:e?new W(e):e}static fromLngLat(e){const r=360*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0)/40075017,n=r/Math.cos(Math.PI/180*e.lat);return new W(new t.N(e.lng-n,e.lat-r),new t.N(e.lng+n,e.lat+r))}adjustAntiMeridian(){const e=new t.N(this._sw.lng,this._sw.lat),r=new t.N(this._ne.lng,this._ne.lat);return new W(e,e.lng>r.lng?new t.N(r.lng+360,r.lat):r)}}class ${constructor(e,t,r){this.bounds=W.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const r=Math.pow(2,e.z),n=Math.floor(t.O(this.bounds.getWest())*r),i=Math.floor(t.Q(this.bounds.getNorth())*r),a=Math.ceil(t.O(this.bounds.getEast())*r),o=Math.ceil(t.Q(this.bounds.getSouth())*r);return e.x>=n&&e.x<a&&e.y>=i&&e.y<o}}class Z extends t.E{constructor(e,r,n,i){if(super(),this.id=e,this.dispatcher=n,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.e(this,t.M(r,["url","scheme","tileSize","promoteId"])),this._options=t.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(i)}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(t.e(this,e),e.bounds&&(this.tileBounds=new $(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};r.request.collectResourceTiming=this._collectResourceTiming;let n="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,r)=>{e.reloadPromise={resolve:t,reject:r}}))}else e.actor=this.dispatcher.getActor(),n="LT";e.abortController=new AbortController;try{const t=yield e.actor.sendAsync({type:n,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(i){if(delete e.abortController,e.aborted)return;if(i&&404!==i.status)throw i;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,t){if(t&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.loadVectorData(t,this.map.painter),e.reloadPromise){const t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class X extends t.E{constructor(e,r,n,i){super(),this.id=e,this.dispatcher=n,this.setEventedParent(i),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},r),t.e(this,t.M(r,["url","scheme","tileSize"]))}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield G(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(t.e(this,e),e.bounds&&(this.tileBounds=new $(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new t.j(e))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const r=yield d.getImage(this.map._requestManager.transformRequest(t,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const t=this.map.painter.context,n=t.gl,i=r.data;e.texture=this.map.painter.getTileTexture(i.width),e.texture?e.texture.update(i,{useMipmap:!0}):(e.texture=new _(t,i,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(r){if(delete e.abortController,e.aborted)e.state="unloaded";else if(r)throw e.state="errored",r}}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class Y extends X{constructor(e,r,n,i){super(e,r,n,i),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){const r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const r=yield d.getImage(n,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){const n=r.data;this.map._refreshExpiredTiles&&r.cacheControl&&r.expires&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});const i=t.b(n)&&t.U()?n:yield this.readImageNow(n),a={type:this.type,uid:e.uid,source:this.id,rawImageData:i,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();const t=yield e.actor.sendAsync({type:"LDT",data:a});e.dem=t,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(i){if(delete e.abortController,e.aborted)e.state="unloaded";else if(i)throw e.state="errored",i}}))}readImageNow(e){return t._(this,void 0,void 0,(function*(){if("undefined"!=typeof VideoFrame&&t.V()){const n=e.width+2,i=e.height+2;try{return new t.R({width:n,height:i},yield t.W(e,-1,-1,n,i))}catch(r){}}return a.getImageData(e,1)}))}_getNeighboringTiles(e){const r=e.canonical,n=Math.pow(2,r.z),i=(r.x-1+n)%n,a=0===r.x?e.wrap-1:e.wrap,o=(r.x+1+n)%n,s=r.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.S(e.overscaledZ,a,r.z,i,r.y).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y).key]={backfilled:!1},r.y>0&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y-1).key]={backfilled:!1}),r.y+1<n&&(l[new t.S(e.overscaledZ,a,r.z,i,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.S(e.overscaledZ,s,r.z,o,r.y+1).key]={backfilled:!1}),l}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))}))}}class K extends t.E{constructor(e,r,n,i){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=n.getActor(),this.setEventedParent(i),this._data=r.data,this._options=t.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const a=t.X/this.tileSize;void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*a,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*a,extent:t.X,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.X,radius:(r.clusterRadius||50)*a,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return t._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return t._(this,void 0,void 0,(function*(){const e=t.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),void 0!==e.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,t,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})}_updateWorkerData(e){return t._(this,void 0,void 0,(function*(){const r=t.e({type:this.type},this.workerOptions);e?r.dataDiff=e:"string"==typeof this._data?(r.request=this.map._requestManager.transformRequest(a.resolveURL(this._data),"Source"),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new t.k("dataloading",{dataType:"source"}));try{const e=yield this.actor.sendAsync({type:"LD",data:r});if(this._pendingLoads--,this._removed||e.abandoned)return void this.fire(new t.k("dataabort",{dataType:"source"}));let n=null;e.resourceTiming&&e.resourceTiming[this.id]&&(n=e.resourceTiming[this.id].slice(0));const i={dataType:"source"};this._collectResourceTiming&&n&&n.length>0&&t.e(i,{resourceTiming:n}),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"metadata"}))),this.fire(new t.k("data",Object.assign(Object.assign({},i),{sourceDataType:"content"})))}catch(n){if(this._pendingLoads--,this._removed)return void this.fire(new t.k("dataabort",{dataType:"source"}));this.fire(new t.j(n))}}))}loaded(){return 0===this._pendingLoads}loadTile(e){return t._(this,void 0,void 0,(function*(){const t=e.actor?"RT":"LT";e.actor=this.actor;const r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const n=yield this.actor.sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(n,this.map.painter,"RT"===t)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var J=t.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends t.E{constructor(e,t,r,n){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(n),this.options=t}load(e){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const t=yield d.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,t&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(r){this._request=null,this._loaded=!0,this.fire(new t.j(r))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const r=e.map(t.Z.fromLngLat);this.tileID=function(e){let r=1/0,n=1/0,i=-1/0,a=-1/0;for(const t of e)r=Math.min(r,t.x),n=Math.min(n,t.y),i=Math.max(i,t.x),a=Math.max(a,t.y);const o=Math.max(i-r,a-n),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),l=Math.pow(2,s);return new t.a1(s,Math.floor((r+i)/2*l),Math.floor((n+a)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const n=r.map((e=>this.tileID.getTilePoint(e)._round()));return this._boundsArray=new t.$,this._boundsArray.emplaceBack(n[0].x,n[0].y,0,0),this._boundsArray.emplaceBack(n[1].x,n[1].y,t.X,0),this._boundsArray.emplaceBack(n[3].x,n[3].y,0,t.X),this._boundsArray.emplaceBack(n[2].x,n[2].y,t.X,t.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new _(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class ee extends Q{constructor(e,t,r,n){super(e,t,r,n),this.roundZoom=!0,this.type="video",this.options=t}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const t of e.urls)this.urls.push(this.map._requestManager.transformRequest(t,"Source").url);try{const e=yield t.a3(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(r){this.fire(new t.j(r))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.j(new t.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const e=this.map.painter.context,r=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new _(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class te extends Q{constructor(e,r,n,i){super(e,r,n,i),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new t.j(new t.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.j(new t.a2(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.j(new t.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new t.j(new t.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.j(new t.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,n=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,J.members)),this.boundsSegments||(this.boundsSegments=t.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new _(r,this.canvas,n.RGBA,{premultiply:!0});let i=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,i=!0)}i&&this.fire(new t.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const re={},ne=e=>{switch(e){case"geojson":return K;case"image":return Q;case"raster":return X;case"raster-dem":return Y;case"vector":return Z;case"video":return ee;case"canvas":return te}return re[e]},ie="RTLPluginLoaded";class ae extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=U()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status="error",e}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,(function(e){var t=this;let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return function*(){if(t.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(t.url=a.resolveURL(e),!t.url)throw new Error(`requested url ${e} is invalid`);if("unavailable"===t.status){if(!r)return t._requestImport();t.status="deferred",t._syncState(t.status)}else if("requested"===t.status)return t._requestImport()}()}))}_requestImport(){return t._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.k(ie))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let oe=null;function se(){return oe||(oe=new ae),oe}class le{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a4(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const t=e+this.timeAdded;t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,n){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){const r={};if(!t)return r;for(const n of e){const e=n.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){n.layers=e,n.stateDependentLayerIds&&(n.stateDependentLayers=n.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)r[t.id]=n}}return r}(e.buckets,r.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6){if(this.hasSymbolBuckets=!0,!n)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const r=this.buckets[e];if(r instanceof t.a6&&r.hasRTLText){this.hasRTLText=!0,se().lazyLoad();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new t.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const r in this.buckets){const t=this.buckets[r];t.uploadPending()&&t.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new _(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new _(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,n,i,a,o,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:i,scale:a,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:o,queryPadding:this.queryPadding*l},e,t,r):{}}querySourceFeatures(e,r){const n=this.latestFeatureIndex;if(!n||!n.rawTileData)return;const i=n.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",o=i._geojsonTileLayer||i[a];if(!o)return;const s=t.a7(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let p=0;p<o.length;p++){const r=o.feature(p);if(s.needGeometry){const e=t.a8(r,!0);if(!s.filter(new t.z(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!s.filter(new t.z(this.tileID.overscaledZ),r))continue;const i=n.getId(r,a),d=new t.a9(r,l,c,u,i);d.tile=h,e.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const r=this.expirationTime;if(e.cacheControl){const r=t.aa(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(r)if(this.expirationTime<r)t=!0;else{const n=this.expirationTime-r;n?this.expirationTime=e+Math.max(n,3e4):t=!0}else t=!0;t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const n in this.buckets){if(!t.style.hasLayer(n))continue;const i=this.buckets[n],a=i.layers[0].sourceLayer||"_geojsonTileLayer",o=r[a],s=e[a];if(!o||!s||0===Object.keys(s).length)continue;i.update(s,o,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=t&&t.style&&t.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(i)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<a.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=a.now()+e}setDependencies(e,t){const r={};for(const n of t)r[n]=!0;this.dependencies[e]=r}hasDependency(e,t){for(const r of e){const e=this.dependencies[r];if(e)for(const r of t)if(e[r])return!0}return!1}}class ce{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){const n=e.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);const i={value:t,timeout:void 0};if(void 0!==r&&(i.timeout=setTimeout((()=>{this.remove(e,i)}),r)),this.data[n].push(i),this.order.push(n),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const r=e.wrapped().key,n=void 0===t?0:this.data[r].indexOf(t),i=this.data[r][n];return this.data[r].splice(n,1),i.timeout&&clearTimeout(i.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(i.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const r in this.data)for(const n of this.data[r])e(n.value)||t.push(n);for(const r of t)this.remove(r.value.tileID,r)}}class ue{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,n){const i=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][i]=this.stateChanges[e][i]||{},t.e(this.stateChanges[e][i],n),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==i&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][i]){this.deletedStates[e][i]={};for(const t in this.state[e][i])n[t]||(this.deletedStates[e][i][t]=null)}else for(const t in n)this.deletedStates[e]&&this.deletedStates[e][i]&&null===this.deletedStates[e][i][t]&&delete this.deletedStates[e][i][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;const n=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][n]&&(this.deletedStates[e][n]=this.deletedStates[e][n]||{},this.deletedStates[e][n][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][n])for(r in this.deletedStates[e][n]={},this.stateChanges[e][n])this.deletedStates[e][n][r]=null;else this.deletedStates[e][n]=null;else this.deletedStates[e]=null}getState(e,r){const n=String(r),i=t.e({},(this.state[e]||{})[n],(this.stateChanges[e]||{})[n]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const t=this.deletedStates[e][r];if(null===t)return{};for(const e in t)delete i[e]}return i}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,r){const n={};for(const i in this.stateChanges){this.state[i]=this.state[i]||{};const e={};for(const r in this.stateChanges[i])this.state[i][r]||(this.state[i][r]={}),t.e(this.state[i][r],this.stateChanges[i][r]),e[r]=this.state[i][r];n[i]=e}for(const i in this.deletedStates){this.state[i]=this.state[i]||{};const e={};if(null===this.deletedStates[i])for(const t in this.state[i])e[t]={},this.state[i][t]={};else for(const t in this.deletedStates[i]){if(null===this.deletedStates[i][t])this.state[i][t]={};else for(const e of Object.keys(this.deletedStates[i][t]))delete this.state[i][t][e];e[t]=this.state[i][t]}n[i]=n[i]||{},t.e(n[i],e)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(const t in e)e[t].setFeatureState(n,r)}}class he extends t.E{constructor(e,t,r){super(),this.id=e,this.dispatcher=r,this.on("data",(e=>this._dataHandler(e))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,r,n)=>{const i=new(ne(t.type))(e,t,r,n);if(i.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${i.id}`);return i})(e,t,r,this),this._tiles={},this._cache=new ce(0,(e=>this._unloadTile(e))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ue,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,n){return t._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,n)}catch(i){e.state="errored",404!==i.status?this._source.fire(new t.j(i,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(pe).map((e=>e.key))}getRenderableIds(e){const r=[];for(const t in this._tiles)this._isIdRenderable(t,e)&&r.push(this._tiles[t]);return e?r.sort(((e,r)=>{const n=e.tileID,i=r.tileID,a=new t.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle),o=new t.P(i.canonical.x,i.canonical.y)._rotate(this.transform.angle);return n.overscaledZ-i.overscaledZ||o.y-a.y||o.x-a.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(pe).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,r){return t._(this,void 0,void 0,(function*(){const t=this._tiles[e];t&&("loading"!==t.state&&(t.state=r),yield this._loadTile(t,e,r))}))}_tileLoaded(e,r,n){e.timeAdded=a.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const t=this.getRenderableIds();for(let n=0;n<t.length;n++){const i=t[n];if(e.neighboringTiles&&e.neighboringTiles[i]){const t=this.getTileByID(i);r(e,t),r(t,e)}}function r(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x;const n=t.tileID.canonical.y-e.tileID.canonical.y,i=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===n||Math.abs(n)>1||(Math.abs(r)>1&&(1===Math.abs(r+i)?r+=i:1===Math.abs(r-i)&&(r-=i)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,n),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,r,n){for(const i in this._tiles){let a=this._tiles[i];if(n[i]||!a.hasData()||a.tileID.overscaledZ<=t||a.tileID.overscaledZ>r)continue;let o=a.tileID;for(;a&&a.tileID.overscaledZ>t+1;){const e=a.tileID.scaledTo(a.tileID.overscaledZ-1);a=this._tiles[e.key],a&&a.hasData()&&(o=e)}let s=o;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){n[o.key]=o;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){const t=e.scaledTo(r),n=this._getLoadedTile(t);if(n)return n}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const r=Math.ceil(e.width/this._source.tileSize)+1,n=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(r*n*(null===this._maxTileCacheZoomLevels?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(a)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const r in this._tiles){const n=this._tiles[r];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),e[n.tileID.key]=n}this._tiles=e;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(e,t,r,n,i,o){const s={},l={},c=Object.keys(e),u=a.now();for(const a of c){const r=e[a],n=this._tiles[a];if(!n||0!==n.fadeEndTime&&n.fadeEndTime<=u)continue;const i=this.findLoadedParent(r,t),o=this.findLoadedSibling(r),c=i||o||null;c&&(this._addTile(c.tileID),s[c.tileID.key]=c.tileID),l[a]=r}this._retainLoadedChildren(l,n,r,e);for(const a in s)e[a]||(this._coveredTiles[a]=!0,e[a]=s[a]);if(o){const t={},r={};for(const e of i)this._tiles[e.key].hasData()?t[e.key]=e:r[e.key]=e;for(const n in r){const i=r[n].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(t[i[0].key]=e[i[0].key]=i[0],t[i[1].key]=e[i[1].key]=i[1],t[i[2].key]=e[i[2].key]=i[2],t[i[3].key]=e[i[3].key]=i[3],delete r[n])}for(const n in r){const i=r[n],a=this.findLoadedParent(i,this._source.minzoom),o=this.findLoadedSibling(i),s=a||o||null;if(s){t[s.tileID.key]=e[s.tileID.key]=s.tileID;for(const e in t)t[e].isChildOf(s.tileID)&&delete t[e]}}for(const e in this._tiles)t[e]||(this._coveredTiles[e]=!0)}}update(e,r){if(!this._sourceLoaded||this._paused)return;let n;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?n=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.S(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(n=e.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(n=n.filter((e=>this._source.hasTile(e))))):n=[];const i=e.coveringZoomLevel(this._source),a=Math.max(i-he.maxOverzooming,this._source.minzoom),o=Math.max(i+he.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const e={};for(const t of n)if(t.canonical.z>this._source.minzoom){const r=t.scaledTo(t.canonical.z-1);e[r.key]=r;const n=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[n.key]=n}n=n.concat(Object.values(e))}const s=0===n.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new t.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(n,i);de(this._source.type)&&this._updateCoveredAndRetainedTiles(l,a,o,i,n,r);for(const t in l)this._tiles[t].clearFadeHold();const c=t.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var r;const n={},i={},a=Math.max(t-he.maxOverzooming,this._source.minzoom),o=Math.max(t+he.maxUnderzooming,this._source.minzoom),s={};for(const l of e){const e=this._addTile(l);n[l.key]=l,e.hasData()||t<this._source.maxzoom&&(s[l.key]=l)}this._retainLoadedChildren(s,t,o,n);for(const l of e){let e=this._tiles[l.key];if(e.hasData())continue;if(t+1>this._source.maxzoom){const e=l.children(this._source.maxzoom)[0],t=this.getTile(e);if(t&&t.hasData()){n[e.key]=e;continue}}else{const e=l.children(this._source.maxzoom);if(n[e[0].key]&&n[e[1].key]&&n[e[2].key]&&n[e[3].key])continue}let o=e.wasRequested();for(let t=l.overscaledZ-1;t>=a;--t){const a=l.scaledTo(t);if(i[a.key])break;if(i[a.key]=!0,e=this.getTile(a),!e&&o&&(e=this._addTile(a)),e){const t=e.hasData();if((t||!(null===(r=this.map)||void 0===r?void 0:r.cancelPendingTileRequestsWhileZooming)||o)&&(n[a.key]=a),o=e.wasRequested(),t)break}}}return n}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let r,n=this._tiles[e].tileID;for(;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){r=this._loadedParentTiles[n.key];break}t.push(n.key);const e=n.scaledTo(n.overscaledZ-1);if(r=this._getLoadedTile(e),r)break;n=e}for(const e of t)this._loadedParentTiles[e]=r}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const t=this._tiles[e].tileID,r=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=r}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));const n=r;return r||(r=new le(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,n||this._source.fire(new t.k("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){const t=e.sourceDataType;"source"===e.dataType&&"metadata"===t&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===t&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,n){const i=[],a=this.transform;if(!a)return i;const o=n?a.getCameraQueryGeometry(e):e,s=e.map((e=>a.pointCoordinate(e,this.terrain))),l=o.map((e=>a.pointCoordinate(e,this.terrain))),c=this.getIds();let u=1/0,h=1/0,p=-1/0,d=-1/0;for(const t of l)u=Math.min(u,t.x),h=Math.min(h,t.y),p=Math.max(p,t.x),d=Math.max(d,t.y);for(let f=0;f<c.length;f++){const e=this._tiles[c[f]];if(e.holdingForFade())continue;const n=e.tileID,o=Math.pow(2,a.zoom-e.tileID.overscaledZ),m=r*e.queryPadding*t.X/e.tileSize/o,g=[n.getTilePoint(new t.Z(u,h)),n.getTilePoint(new t.Z(p,d))];if(g[0].x-m<t.X&&g[0].y-m<t.X&&g[1].x+m>=0&&g[1].y+m>=0){const t=s.map((e=>n.getTilePoint(e))),r=l.map((e=>n.getTilePoint(e)));i.push({tile:e,tileID:n,queryGeometry:t,cameraQueryGeometry:r,scale:o})}}return i}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const r of t)r.posMatrix=this.transform.calculatePosMatrix(r.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(de(this._source.type)){const e=a.now();for(const t in this._tiles)if(this._tiles[t].fadeEndTime>=e)return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){const n=this._tiles[e];n&&n.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(const r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}}function pe(e,t){const r=Math.abs(2*e.wrap)-+(e.wrap<0),n=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||n-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function de(e){return"raster"===e||"image"===e||"video"===e}he.maxOverzooming=10,he.maxUnderzooming=3;class fe{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=t.ac(e,0,1);let r=1,n=this._distances[r];const i=e*this.paddedLength+this.padding;for(;n<i&&r<this._distances.length;)n=this._distances[++r];const a=r-1,o=this._distances[a],s=n-o,l=s>0?(i-o)/s:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function me(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class ge{constructor(e,t,r){const n=this.boxCells=[],i=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let a=0;a<this.xCellCount*this.yCellCount;a++)n.push([]),i.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,n,i){this._forEachCell(t,r,n,i,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(n),this.bboxes.push(i)}insertCircle(e,t,r,n){this._forEachCell(t-n,r-n,t+n,r+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(n)}_insertBoxCell(e,t,r,n,i,a){this.boxCells[i].push(a)}_insertCircleCell(e,t,r,n,i,a){this.circleCells[i].push(a)}_query(e,t,r,n,i,a,o){if(r<0||e>this.width||n<0||t>this.height)return[];const s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=n){if(i)return[{key:null,x1:e,y1:t,x2:r,y2:n}];for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],r=this.circles[3*e+1],n=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-n,y1:r-n,x2:t+n,y2:r+n})}}else this._forEachCell(e,t,r,n,this._queryCell,s,{hitTest:i,overlapMode:a,seenUids:{box:{},circle:{}}},o);return s}query(e,t,r,n){return this._query(e,t,r,n,!1,null)}hitTest(e,t,r,n,i,a){return this._query(e,t,r,n,!0,i,a).length>0}hitTestCircle(e,t,r,n,i){const a=e-r,o=e+r,s=t-r,l=t+r;if(o<0||a>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(a,s,o,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:n,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},i),c.length>0}_queryCell(e,t,r,n,i,a,o,s){const{seenUids:l,hitTest:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const i=this.bboxes;for(const o of h)if(!l.box[o]){l.box[o]=!0;const h=4*o,p=this.boxKeys[o];if(e<=i[h+2]&&t<=i[h+3]&&r>=i[h+0]&&n>=i[h+1]&&(!s||s(p))&&(!c||!me(u,p.overlapMode))&&(a.push({key:p,x1:i[h],y1:i[h+1],x2:i[h+2],y2:i[h+3]}),c))return!0}}const p=this.circleCells[i];if(null!==p){const i=this.circles;for(const o of p)if(!l.circle[o]){l.circle[o]=!0;const h=3*o,p=this.circleKeys[o];if(this._circleAndRectCollide(i[h],i[h+1],i[h+2],e,t,r,n)&&(!s||s(p))&&(!c||!me(u,p.overlapMode))){const e=i[h],t=i[h+1],r=i[h+2];if(a.push({key:p,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),c)return!0}}}return!1}_queryCellCircle(e,t,r,n,i,a,o,s){const{circle:l,seenUids:c,overlapMode:u}=o,h=this.boxCells[i];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const r=4*t,n=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(n))&&!me(u,n.overlapMode))return a.push(!0),!0}}const p=this.circleCells[i];if(null!==p){const e=this.circles;for(const t of p)if(!c.circle[t]){c.circle[t]=!0;const r=3*t,n=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(n))&&!me(u,n.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,n,i,a,o,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(n);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(i.call(this,e,t,r,n,this.xCellCount*l+p,a,o,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,n,i,a){const o=n-e,s=i-t,l=r+a;return l*l>o*o+s*s}_circleAndRectCollide(e,t,r,n,i,a,o){const s=(a-n)/2,l=Math.abs(e-(n+s));if(l>s+r)return!1;const c=(o-i)/2,u=Math.abs(t-(i+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,p=u-c;return h*h+p*p<=r*r}}function ye(e,r,n,i,a){const o=t.H();return r?(t.K(o,o,[1/a,1/a,1]),n||t.ad(o,o,i.angle)):t.L(o,i.labelPlaneMatrix,e),o}function ve(e,r,n,i,a){if(r){const r=t.ae(e);return t.K(r,r,[a,a,1]),n||t.ad(r,r,-i.angle),r}return i.glCoordMatrix}function xe(e,r,n,i){let a;i?(a=[e,r,i(e,r),1],t.af(a,a,n)):(a=[e,r,0,1],Oe(a,a,n));const o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}function be(e,t){return.5+e/t*.5}function _e(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function we(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m){const g=i?e.textSizeData:e.iconSizeData,y=t.ag(g,n.transform.zoom),v=[256/n.width*2+1,256/n.height*2+1],x=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;x.clear();const b=e.lineVertexArray,_=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,w=n.transform.width/n.transform.height;let k=!1;for(let T=0;T<_.length;T++){const i=_.get(T);if(i.hidden||i.writingMode===t.ah.vertical&&!k){ze(i.numGlyphs,x);continue}k=!1;const S=xe(i.anchorX,i.anchorY,r,m);if(!_e(S.point,v)){ze(i.numGlyphs,x);continue}const A=be(n.transform.cameraToCenterDistance,S.signedDistanceFromCamera),M=t.ai(g,y,i),E=s?M/A:M*A,C={getElevation:m,labelPlaneMatrix:a,lineVertexArray:b,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:u,tileAnchorPoint:new t.P(i.anchorX,i.anchorY),unwrappedTileID:h,width:p,height:d,translation:f},P=Se(C,i,E,!1,l,r,o,e.glyphOffsetArray,x,w,c);k=P.useVertical,(P.notEnoughRoom||k||P.needsFlipping&&Se(C,i,E,!0,l,r,o,e.glyphOffsetArray,x,w,c).notEnoughRoom)&&ze(i.numGlyphs,x)}i?e.text.dynamicLayoutVertexBuffer.updateData(x):e.icon.dynamicLayoutVertexBuffer.updateData(x)}function ke(e,t,r,n,i,a,o,s){const l=a.glyphStartIndex+a.numGlyphs,c=a.lineStartIndex,u=a.lineStartIndex+a.lineLength,h=t.getoffsetX(a.glyphStartIndex),p=t.getoffsetX(l-1),d=Le(e*h,r,n,i,a.segment,c,u,s,o);if(!d)return null;const f=Le(e*p,r,n,i,a.segment,c,u,s,o);return f?s.projectionCache.anyProjectionOccluded?null:{first:d,last:f}:null}function Te(e,r,n,i){return e===t.ah.horizontal&&Math.abs(n.y-r.y)>Math.abs(n.x-r.x)*i?{useVertical:!0}:(e===t.ah.vertical?r.y<n.y:r.x>n.x)?{needsFlipping:!0}:null}function Se(e,r,n,i,a,o,s,l,c,u,h){const p=n/24,d=r.lineOffsetX*p,f=r.lineOffsetY*p;let m;if(r.numGlyphs>1){const t=r.glyphStartIndex+r.numGlyphs,n=r.lineStartIndex,o=r.lineStartIndex+r.lineLength,c=ke(p,l,d,f,i,r,h,e);if(!c)return{notEnoughRoom:!0};const g=xe(c.first.point.x,c.first.point.y,s,e.getElevation).point,y=xe(c.last.point.x,c.last.point.y,s,e.getElevation).point;if(a&&!i){const e=Te(r.writingMode,g,y,u);if(e)return e}m=[c.first];for(let a=r.glyphStartIndex+1;a<t-1;a++)m.push(Le(p*l.getoffsetX(a),d,f,i,r.segment,n,o,e,h));m.push(c.last)}else{if(a&&!i){const n=xe(e.tileAnchorPoint.x,e.tileAnchorPoint.y,o,e.getElevation).point,i=r.lineStartIndex+r.segment+1,a=new t.P(e.lineVertexArray.getx(i),e.lineVertexArray.gety(i)),s=xe(a.x,a.y,o,e.getElevation),l=s.signedDistanceFromCamera>0?s.point:Ae(e.tileAnchorPoint,a,n,1,o,e),c=Te(r.writingMode,n,l,u);if(c)return c}const n=Le(p*l.getoffsetX(r.glyphStartIndex),d,f,i,r.segment,r.lineStartIndex,r.lineStartIndex+r.lineLength,e,h);if(!n||e.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[n]}for(const g of m)t.aj(c,g.point,g.angle);return{}}function Ae(e,t,r,n,i,a){const o=e.add(e.sub(t)._unit()),s=void 0!==i?xe(o.x,o.y,i,a.getElevation).point:Ee(o.x,o.y,a).point,l=r.sub(s);return r.add(l._mult(n/l.mag()))}function Me(e,r,n){const i=r.projectionCache;if(i.projections[e])return i.projections[e];const a=new t.P(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),o=Ee(a.x,a.y,r);if(o.signedDistanceFromCamera>0)return i.projections[e]=o.point,i.anyProjectionOccluded=i.anyProjectionOccluded||o.isOccluded,o.point;const s=e-n.direction;return l=0===n.distanceFromAnchor?r.tileAnchorPoint:new t.P(r.lineVertexArray.getx(s),r.lineVertexArray.gety(s)),c=a,u=n.previousVertex,h=n.absOffsetX-n.distanceFromAnchor+1,Ae(l,c,u,h,void 0,r);var l,c,u,h}function Ee(e,t,r){const n=e+r.translation[0],i=t+r.translation[1];let a;return!r.pitchWithMap&&r.projection.useSpecialProjectionForSymbols?(a=r.projection.projectTileCoordinates(n,i,r.unwrappedTileID,r.getElevation),a.point.x=(.5*a.point.x+.5)*r.width,a.point.y=(.5*-a.point.y+.5)*r.height):(a=xe(n,i,r.labelPlaneMatrix,r.getElevation),a.isOccluded=!1),a}function Ce(e,t,r){return e._unit()._perp()._mult(t*r)}function Pe(e,r,n,i,a,o,s,l,c){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];const u=n.add(r);if(e+c.direction<i||e+c.direction>=a)return l.projectionCache.offsets[e]=u,u;const h=Me(e+c.direction,l,c),p=Ce(h.sub(n),s,c.direction),d=n.add(p),f=h.add(p);return l.projectionCache.offsets[e]=t.ak(o,u,d,f)||u,l.projectionCache.offsets[e]}function Le(e,t,r,n,i,a,o,s,l){const c=n?e-t:e+t;let u=c>0?1:-1,h=0;n&&(u*=-1,h=Math.PI),u<0&&(h+=Math.PI);let p,d=u>0?a+i:a+i+1;s.projectionCache.cachedAnchorPoint?p=s.projectionCache.cachedAnchorPoint:(p=Ee(s.tileAnchorPoint.x,s.tileAnchorPoint.y,s).point,s.projectionCache.cachedAnchorPoint=p);let f,m,g=p,y=p,v=0,x=0;const b=Math.abs(c),_=[];let w;for(;v+x<=b;){if(d+=u,d<a||d>=o)return null;v+=x,y=g,m=f;const e={absOffsetX:b,direction:u,distanceFromAnchor:v,previousVertex:y};if(g=Me(d,s,e),0===r)_.push(y),w=g.sub(y);else{let t;const n=g.sub(y);t=0===n.mag()?Ce(Me(d+u,s,e).sub(g),r,u):Ce(n,r,u),m||(m=y.add(t)),f=Pe(d,t,g,a,o,m,r,s,e),_.push(m),w=f.sub(m)}x=w.mag()}const k=w._mult((b-v)/x)._add(m||y),T=h+Math.atan2(g.y-y.y,g.x-y.x);return _.push(k),{point:k,angle:l?T:0,path:_}}const Ie=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ze(e,t){for(let r=0;r<e;r++){const e=t.length;t.resize(e+4),t.float32.set(Ie,3*e)}}function Oe(e,t,r){const n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e[3]=r[3]*n+r[7]*i+r[15],e}const Re=100;class De{constructor(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new ge(e.width+200,e.height+200,25),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new ge(e.width+200,e.height+200,25);this.transform=e,this.mapProjection=t,this.grid=r,this.ignoredGrid=n,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Re,this.screenBottomBoundary=e.height+Re,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,n,i,a,o,s,l,c,u){const h=e.anchorPointX+s[0],p=e.anchorPointY+s[1],d=this.projectAndGetPerspectiveRatio(n,h,p,i,c),f=r*d.perspectiveRatio;let m;if(a||o)m=this._projectCollisionBox(e,f,n,i,a,o,s,d,c,u);else{const t=d.point.x+(u?u.x*f:0),r=d.point.y+(u?u.y*f:0);m={allPointsOccluded:!1,box:[t+e.x1*f,r+e.y1*f,t+e.x2*f,r+e.y2*f]}}const[g,y,v,x]=m.box;return this.mapProjection.useSpecialProjectionForSymbols&&(a?m.allPointsOccluded:this.mapProjection.isOccluded(h,p,i))||d.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(g,y,v,x)||"always"!==t&&this.grid.hitTest(g,y,v,x,t,l)?{box:[g,y,v,x],placeable:!1,offscreen:!1}:{box:[g,y,v,x],placeable:!0,offscreen:this.isOffscreen(g,y,v,x)}}placeCollisionCircles(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g){const y=[],v=new t.P(r.anchorX,r.anchorY),x=this.getPerspectiveRatio(o,v.x,v.y,s,g),b=(h?a/x:a*x)/t.ap,_={getElevation:g,labelPlaneMatrix:l,lineVertexArray:n,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:v,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:m},w=ke(b,i,r.lineOffsetX*b,r.lineOffsetY*b,!1,r,!1,_);let k=!1,T=!1,S=!0;if(w){const r=.5*d*x+f,n=new t.P(-100,-100),i=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new fe,o=w.first,s=w.last;let l=[];for(let e=o.path.length-1;e>=1;e--)l.push(o.path[e]);for(let e=1;e<s.path.length;e++)l.push(s.path[e]);const h=2.5*r;if(c){const e=this.projectPathToScreenSpace(l,_,c);l=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let m=[];if(l.length>0){const e=l[0].clone(),r=l[0].clone();for(let t=1;t<l.length;t++)e.x=Math.min(e.x,l[t].x),e.y=Math.min(e.y,l[t].y),r.x=Math.max(r.x,l[t].x),r.y=Math.max(r.y,l[t].y);m=e.x>=n.x&&r.x<=i.x&&e.y>=n.y&&r.y<=i.y?[l]:r.x<n.x||e.x>i.x||r.y<n.y||e.y>i.y?[]:t.al([l],n.x,n.y,i.x,i.y)}for(const t of m){a.reset(t,.25*r);let n=0;n=a.length<=.5*r?1:Math.ceil(a.paddedLength/h)+1;for(let t=0;t<n;t++){const i=t/Math.max(n-1,1),o=a.lerp(i),s=o.x+Re,l=o.y+Re;y.push(s,l,r,0);const c=s-r,h=l-r,d=s+r,f=l+r;if(S=S&&this.isOffscreen(c,h,d,f),T=T||this.isInsideGrid(c,h,d,f),"always"!==e&&this.grid.hitTestCircle(s,l,r,e,p)&&(k=!0,!u))return{circles:[],offscreen:!1,collisionDetected:k}}}}return{circles:!u&&k||!T||x<this.perspectiveRatioCutoff?[]:y,offscreen:S,collisionDetected:k}}projectPathToScreenSpace(e,t,r){return e.map((e=>xe(e.x,e.y,r,t.getElevation)))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let n=1/0,i=1/0,a=-1/0,o=-1/0;for(const u of e){const e=new t.P(u.x+Re,u.y+Re);n=Math.min(n,e.x),i=Math.min(i,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y),r.push(e)}const s=this.grid.query(n,i,a,o).concat(this.ignoredGrid.query(n,i,a,o)),l={},c={};for(const u of s){const e=u.key;if(void 0===l[e.bucketInstanceId]&&(l[e.bucketInstanceId]={}),l[e.bucketInstanceId][e.featureIndex])continue;const n=[new t.P(u.x1,u.y1),new t.P(u.x2,u.y1),new t.P(u.x2,u.y2),new t.P(u.x1,u.y2)];t.am(r,n)&&(l[e.bucketInstanceId][e.featureIndex]=!0,void 0===c[e.bucketInstanceId]&&(c[e.bucketInstanceId]=[]),c[e.bucketInstanceId].push(e.featureIndex))}return c}insertCollisionBox(e,t,r,n,i,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,n,i,a){const o=r?this.ignoredGrid:this.grid,s={bucketInstanceId:n,featureIndex:i,collisionGroupID:a,overlapMode:t};for(let l=0;l<e.length;l+=4)o.insertCircle(s,e[l],e[l+1],e[l+2])}projectAndGetPerspectiveRatio(e,r,n,i,a){let o;a?(o=[r,n,a(r,n),1],t.af(o,o,e)):(o=[r,n,0,1],Oe(o,o,e));const s=o[3];return{point:new t.P((o[0]/s+1)/2*this.transform.width+Re,(-o[1]/s+1)/2*this.transform.height+Re),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}getPerspectiveRatio(e,t,r,n,i){const a=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(t,r,n,i):xe(t,r,e,i);return.5+this.transform.cameraToCenterDistance/a.signedDistanceFromCamera*.5}isOffscreen(e,t,r,n){return r<Re||e>=this.screenRightBoundary||n<Re||t>this.screenBottomBoundary}isInsideGrid(e,t,r,n){return r>=0&&e<this.gridRightBoundary&&n>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const e=t.an([]);return t.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,n,i,a,o,s,l,c,u){let h=new t.P(1,0),p=new t.P(0,1);const d=new t.P(e.anchorPointX+s[0],e.anchorPointY+s[1]);if(o&&!a){const e=this.projectAndGetPerspectiveRatio(n,d.x+1,d.y,i,c).point.sub(l.point).unit(),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0),a=Math.sin(r),o=Math.cos(r);h=new t.P(o,a),p=new t.P(-a,o)}else if(!o&&a){const e=-this.transform.angle,r=Math.sin(e),n=Math.cos(e);h=new t.P(n,r),p=new t.P(-r,n)}let f=l.point,m=r;if(a){f=d;const e=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-e),m*=this.mapProjection.getPitchedTextCorrection(this.transform,d,i),u||(m*=t.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}u&&(f=f.add(h.mult(u.x*m)).add(p.mult(u.y*m)));const g=e.x1*m,y=e.x2*m,v=(g+y)/2,x=e.y1*m,b=e.y2*m,_=(x+b)/2,w=[{offsetX:g,offsetY:x},{offsetX:v,offsetY:x},{offsetX:y,offsetY:x},{offsetX:y,offsetY:_},{offsetX:y,offsetY:b},{offsetX:v,offsetY:b},{offsetX:g,offsetY:b},{offsetX:g,offsetY:_}];let k=[];for(const{offsetX:S,offsetY:A}of w)k.push(new t.P(f.x+h.x*S+p.x*A,f.y+h.y*S+p.y*A));let T=!1;if(a){const e=k.map((e=>this.projectAndGetPerspectiveRatio(n,e.x,e.y,i,c)));T=e.some((e=>!e.isOccluded)),k=e.map((e=>e.point))}else T=!0;return{box:t.ao(k),allPointsOccluded:!T}}}function je(e,r,n){return r*(t.X/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}class Fe{constructor(e,t,r,n){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):n&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Be{constructor(e,t,r,n,i){this.text=new Fe(e?e.text:null,t,r,i),this.icon=new Fe(e?e.icon:null,t,n,i)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ne{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Ue{constructor(){this.invProjMatrix=t.H(),this.viewportMatrix=t.H(),this.circles=[]}}class Ve{constructor(e,t,r,n,i){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=n,this.tileID=i}}class qe{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function He(e,r,n,i,a){const{horizontalAlign:o,verticalAlign:s}=t.au(e);return new t.P(-(o-.5)*r+i[0]*a,-(s-.5)*n+i[1]*a)}class Ge{constructor(e,t,r,n,i,a){this.transform=e.clone(),this.terrain=r,this.collisionIndex=new De(this.transform,t),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=n,this.retainedQueryData={},this.collisionGroups=new qe(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=a,a&&(a.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const t=this.terrain;return t?(r,n)=>t.getElevation(e,r,n):null}getBucketParts(e,r,n,i){const a=n.getBucket(r),o=n.latestFeatureIndex;if(!a||!o||r.id!==a.layerIds[0])return;const s=n.collisionBoxArray,l=a.layers[0].layout,c=a.layers[0].paint,u=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),h=n.tileSize/t.X,p=n.tileID.toUnwrapped(),d=this.transform.calculatePosMatrix(p),f="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),g=je(n,1,this.transform.zoom),y=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("text-translate"),c.get("text-translate-anchor")),v=this.collisionIndex.mapProjection.translatePosition(this.transform,n,c.get("icon-translate"),c.get("icon-translate-anchor")),x=ye(d,f,m,this.transform,g);let b=null;if(f){const e=ve(d,f,m,this.transform,g);b=t.L([],this.transform.labelPlaneMatrix,e)}this.retainedQueryData[a.bucketInstanceId]=new Ve(a.bucketInstanceId,o,a.sourceLayerIndex,a.index,n.tileID);const _={bucket:a,layout:l,translationText:y,translationIcon:v,posMatrix:d,unwrappedTileID:p,textLabelPlaneMatrix:x,labelToScreenMatrix:b,scale:u,textPixelRatio:h,holdingForFade:n.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.ag(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(i)for(const t of a.sortKeyRanges){const{sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i}=t;e.push({sortKey:r,symbolInstanceStart:n,symbolInstanceEnd:i,parameters:_})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:_})}attemptAnchorPlacement(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y,v,x){const b=t.aq[e.textAnchor],_=[e.textOffset0,e.textOffset1],w=He(b,n,i,_,a),k=this.collisionIndex.placeCollisionBox(r,p,l,c,u,s,o,g,h.predicate,x,w);if((!v||this.collisionIndex.placeCollisionBox(v,p,l,c,u,s,o,y,h.predicate,x,w).placeable)&&k.placeable){let e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(e=this.prevPlacement.variableOffsets[d.crossTileID].anchor),0===d.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:_,width:n,height:i,anchor:b,textBoxScale:a,prevAnchor:e},this.markUsedJustification(f,b,d,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,d),this.placedOrientations[d.crossTileID]=m),{shift:w,placedGlyphBoxes:k}}}placeLayerBucketPart(e,r,n){const{bucket:i,layout:a,translationText:o,translationIcon:s,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:u,labelToScreenMatrix:h,textPixelRatio:p,holdingForFade:d,collisionBoxArray:f,partiallyEvaluatedTextSize:m,collisionGroup:g}=e.parameters,y=a.get("text-optional"),v=a.get("icon-optional"),x=t.ar(a,"text-overlap","text-allow-overlap"),b="always"===x,_=t.ar(a,"icon-overlap","icon-allow-overlap"),w="always"===_,k="map"===a.get("text-rotation-alignment"),T="map"===a.get("text-pitch-alignment"),S="none"!==a.get("icon-text-fit"),A="viewport-y"===a.get("symbol-z-order"),M=b&&(w||!i.hasIconData()||v),E=w&&(b||!i.hasTextData()||y);!i.collisionArrays&&f&&i.deserializeCollisionBoxes(f);const C=this._getTerrainElevationFunc(this.retainedQueryData[i.bucketInstanceId].tileID),P=(e,f,w)=>{var A,P;if(r[e.crossTileID])return;if(d)return void(this.placements[e.crossTileID]=new Ne(!1,!1,!1));let L=!1,I=!1,z=!0,O=null,R={box:null,placeable:!1,offscreen:null},D={box:null,placeable:!1,offscreen:null},j=null,F=null,B=null,N=0,U=0,V=0;f.textFeatureIndex?N=f.textFeatureIndex:e.useRuntimeCollisionCircles&&(N=e.featureIndex),f.verticalTextFeatureIndex&&(U=f.verticalTextFeatureIndex);const q=f.textBox;if(q){const r=r=>{let n=t.ah.horizontal;if(i.allowVerticalPlacement&&!r&&this.prevPlacement){const t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,n=t,this.markUsedOrientation(i,n,e))}return n},a=(r,n)=>{if(i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&f.verticalTextBox){for(const e of i.writingModes)if(e===t.ah.vertical?(R=n(),D=R):R=r(),R&&R.placeable)break}else R=r()},u=e.textAnchorOffsetStartIndex,h=e.textAnchorOffsetEndIndex;if(h===u){const n=(t,r)=>{const n=this.collisionIndex.placeCollisionBox(t,x,p,l,c,T,k,o,g.predicate,C);return n&&n.placeable&&(this.markUsedOrientation(i,r,e),this.placedOrientations[e.crossTileID]=r),n};a((()=>n(q,t.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?n(r,t.ah.vertical):{box:null,offscreen:null}})),r(R&&R.placeable)}else{let d=t.aq[null===(P=null===(A=this.prevPlacement)||void 0===A?void 0:A.variableOffsets[e.crossTileID])||void 0===P?void 0:P.anchor];const m=(r,a,f)=>{const m=r.x2-r.x1,y=r.y2-r.y1,v=e.textBoxScale,b=S&&"never"===_?a:null;let w=null,A="never"===x?1:2,M="never";d&&A++;for(let t=0;t<A;t++){for(let t=u;t<h;t++){const n=i.textAnchorOffsets.get(t);if(d&&n.textAnchor!==d)continue;const a=this.attemptAnchorPlacement(n,r,m,y,v,k,T,p,l,c,g,M,e,i,f,o,s,b,C);if(a&&(w=a.placedGlyphBoxes,w&&w.placeable))return L=!0,O=a.shift,w}d?d=null:M=x}return n&&!w&&(w={box:this.collisionIndex.placeCollisionBox(q,"always",p,l,c,T,k,o,g.predicate,C,new t.P(0,0)).box,offscreen:!1,placeable:!1}),w};a((()=>m(q,f.iconBox,t.ah.horizontal)),(()=>{const r=f.verticalTextBox;return i.allowVerticalPlacement&&(!R||!R.placeable)&&e.numVerticalGlyphVertices>0&&r?m(r,f.verticalIconBox,t.ah.vertical):{box:null,occluded:!0,offscreen:null}})),R&&(L=R.placeable,z=R.offscreen);const y=r(R&&R.placeable);if(!L&&this.prevPlacement){const t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(i,t.anchor,e,y))}}}if(j=R,L=j&&j.placeable,z=j&&j.offscreen,e.useRuntimeCollisionCircles){const r=i.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),s=t.ai(i.textSizeData,m,r),p=a.get("text-padding");F=this.collisionIndex.placeCollisionCircles(x,r,i.lineVertexArray,i.glyphOffsetArray,s,l,c,u,h,n,T,g.predicate,e.collisionCircleDiameter,p,o,C),F.circles.length&&F.collisionDetected&&!n&&t.w("Collisions detected, but collision boxes are not shown"),L=b||F.circles.length>0&&!F.collisionDetected,z=z&&F.offscreen}if(f.iconFeatureIndex&&(V=f.iconFeatureIndex),f.iconBox){const e=e=>this.collisionIndex.placeCollisionBox(e,_,p,l,c,T,k,s,g.predicate,C,S&&O?O:void 0);D&&D.placeable&&f.verticalIconBox?(B=e(f.verticalIconBox),I=B.placeable):(B=e(f.iconBox),I=B.placeable),z=z&&B.offscreen}const H=y||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,G=v||0===e.numIconVertices;H||G?G?H||(I=I&&L):L=I&&L:I=L=I&&L;const W=I&&B.placeable;if(L&&j.placeable&&this.collisionIndex.insertCollisionBox(j.box,x,a.get("text-ignore-placement"),i.bucketInstanceId,D&&D.placeable&&U?U:N,g.ID),W&&this.collisionIndex.insertCollisionBox(B.box,_,a.get("icon-ignore-placement"),i.bucketInstanceId,V,g.ID),F&&L&&this.collisionIndex.insertCollisionCircles(F.circles,x,a.get("text-ignore-placement"),i.bucketInstanceId,N,g.ID),n&&this.storeCollisionData(i.bucketInstanceId,w,f,j,B,F),0===e.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===i.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[e.crossTileID]=new Ne(L||M,I||E,z||i.justReloaded),r[e.crossTileID]=!0};if(A){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const t=i.getSortedSymbolIndexes(this.transform.angle);for(let e=t.length-1;e>=0;--e){const r=t[e];P(i.symbolInstances.get(r),i.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)P(i.symbolInstances.get(t),i.collisionArrays[t],t);if(n&&i.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[i.bucketInstanceId];t.as(e.invProjMatrix,l),e.viewportMatrix=this.collisionIndex.getViewportMatrix()}i.justReloaded=!1}storeCollisionData(e,t,r,n,i,a){if(r.textBox||r.iconBox){let a,o;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a)),a.has(t)?o=a.get(t):(o={text:null,icon:null},a.set(t,o)),r.textBox&&(o.text=n.box),r.iconBox&&(o.icon=i.box)}if(a){let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Ue);for(let e=0;e<a.circles.length;e+=4)t.circles.push(a.circles[e+0]),t.circles.push(a.circles[e+1]),t.circles.push(a.circles[e+2]),t.circles.push(a.collisionDetected?1:0)}}markUsedJustification(e,r,n,i){let a;a=i===t.ah.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.at(r)];const o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];for(const t of o)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:n.crossTileID)}markUsedOrientation(e,r,n){const i=r===t.ah.horizontal||r===t.ah.horizontalOnly?r:0,a=r===t.ah.vertical?r:0,o=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];for(const t of o)e.text.placedSymbolArray.get(t).placedOrientation=i;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const n=t?t.symbolFadeChange(e):1,i=t?t.opacities:{},a=t?t.variableOffsets:{},o=t?t.placedOrientations:{};for(const s in this.placements){const e=this.placements[s],t=i[s];t?(this.opacities[s]=new Be(t,n,e.text,e.icon),r=r||e.text!==t.text.placed||e.icon!==t.icon.placed):(this.opacities[s]=new Be(null,n,e.text,e.icon,e.skipFade),r=r||e.text||e.icon)}for(const s in i){const e=i[s];if(!this.opacities[s]){const t=new Be(e,n,!1,!1);t.isHidden()||(this.opacities[s]=t,r=r||e.text.placed||e.icon.placed)}}for(const s in a)this.variableOffsets[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.variableOffsets[s]=a[s]);for(const s in o)this.placedOrientations[s]||!this.opacities[s]||this.opacities[s].isHidden()||(this.placedOrientations[s]=o[s]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const r={};for(const n of t){const t=n.getBucket(e);t&&n.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,n.tileID,r,n.collisionBoxArray)}}updateBucketOpacities(e,r,n,i){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const a=e.layers[0],o=a.layout,s=new Be(null,0,!1,!1,!0),l=o.get("text-allow-overlap"),c=o.get("icon-allow-overlap"),u=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),h="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),d="none"!==o.get("icon-text-fit"),f=new Be(null,0,l&&(c||!e.hasIconData()||o.get("icon-optional")),c&&(l||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);const m=(e,t,r)=>{for(let n=0;n<t/4;n++)e.opacityVertexArray.emplaceBack(r);e.hasVisibleVertices=e.hasVisibleVertices||r!==tt},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let y=0;y<e.symbolInstances.length;y++){const r=e.symbolInstances.get(y),{numHorizontalGlyphVertices:i,numVerticalGlyphVertices:a,crossTileID:o}=r;let l=this.opacities[o];n[o]?l=s:l||(l=f,this.opacities[o]=l),n[o]=!0;const c=r.numIconVertices>0,v=this.placedOrientations[r.crossTileID],x=v===t.ah.vertical,b=v===t.ah.horizontal||v===t.ah.horizontalOnly;if(i>0||a>0){const t=et(l.text);m(e.text,i,x?tt:t),m(e.text,a,b?tt:t);const n=l.text.isHidden();[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=n||x?1:0)})),r.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).hidden=n||b?1:0);const o=this.variableOffsets[r.crossTileID];o&&this.markUsedJustification(e,o.anchor,r,v);const s=this.placedOrientations[r.crossTileID];s&&(this.markUsedJustification(e,"left",r,s),this.markUsedOrientation(e,s,r))}if(c){const t=et(l.icon),n=!(d&&r.verticalPlacedIconSymbolIndex&&x);r.placedIconSymbolIndex>=0&&(m(e.icon,r.numIconVertices,n?t:tt),e.icon.placedSymbolArray.get(r.placedIconSymbolIndex).hidden=l.icon.isHidden()),r.verticalPlacedIconSymbolIndex>=0&&(m(e.icon,r.numVerticalIconVertices,n?tt:t),e.icon.placedSymbolArray.get(r.verticalPlacedIconSymbolIndex).hidden=l.icon.isHidden())}const _=g&&g.has(y)?g.get(y):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const r=e.collisionArrays[y];if(r){let n=new t.P(0,0);if(r.textBox||r.verticalTextBox){let t=!0;if(u){const e=this.variableOffsets[o];e?(n=He(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),h&&n._rotate(p?this.transform.angle:-this.transform.angle)):t=!1}if(r.textBox||r.verticalTextBox){let i;r.textBox&&(i=x),r.verticalTextBox&&(i=b),We(e.textCollisionBox.collisionVertexArray,l.text.placed,!t||i,_.text,n.x,n.y)}}if(r.iconBox||r.verticalIconBox){const t=Boolean(!b&&r.verticalIconBox);let i;r.iconBox&&(i=t),r.verticalIconBox&&(i=!t),We(e.iconCollisionBox.collisionVertexArray,l.icon.placed,i,_.icon,d?n.x:0,d?n.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=t.invProjMatrix,e.placementViewportMatrix=t.viewportMatrix,e.collisionCircleArray=t.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function We(e,t,r,n,i,a){n&&0!==n.length||(n=[0,0,0,0]);const o=n[0]-Re,s=n[1]-Re,l=n[2]-Re,c=n[3]-Re;e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,s),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,l,c),e.emplaceBack(t?1:0,r?1:0,i||0,a||0,o,c)}const $e=Math.pow(2,25),Ze=Math.pow(2,24),Xe=Math.pow(2,17),Ye=Math.pow(2,16),Ke=Math.pow(2,9),Je=Math.pow(2,8),Qe=Math.pow(2,1);function et(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*$e+t*Ze+r*Xe+t*Ye+r*Ke+t*Je+r*Qe+t}const tt=0;function rt(){return{isOccluded:(e,t,r)=>!1,getPitchedTextCorrection:(e,t,r)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(e,t,r,n){throw new Error("Not implemented.")},translatePosition:(e,t,r,n)=>function(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!r[0]&&!r[1])return[0,0];const a=i?"map"===n?e.angle:0:"viewport"===n?-e.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[i?r[0]:je(t,r[0],e.zoom),i?r[1]:je(t,r[1],e.zoom)]}(e,t,r,n),getCircleRadiusCorrection:e=>1}}class nt{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,n,i){const a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,n,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,i())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,i())return!0;return!1}}class it{constructor(e,t,r,n,i,a,o,s){this.placement=new Ge(e,rt(),t,a,o,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=i,this._done=!1}isDone(){return this._done}continuePlacement(e,t,r){const n=a.now(),i=()=>!this._forceFullPlacement&&a.now()-n>2;for(;this._currentPlacementIndex>=0;){const n=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===n.type&&(!n.minzoom||n.minzoom<=a)&&(!n.maxzoom||n.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new nt(n)),this._inProgressLayer.continuePlacement(r[n.source],this.placement,this._showCollisionBoxes,n,i))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const at=512/t.X/2;class ot{constructor(e,r,n){this.tileID=e,this.bucketInstanceId=n,this._symbolsByKey={};const i=new Map;for(let t=0;t<r.length;t++){const e=r.get(t),n=e.key,a=i.get(n);a?a.push(e):i.set(n,[e])}for(const[a,o]of i){const e={positions:o.map((e=>({x:Math.floor(e.anchorX*at),y:Math.floor(e.anchorY*at)}))),crossTileIDs:o.map((e=>e.crossTileID))};if(e.positions.length>128){const r=new t.av(e.positions.length,16,Uint16Array);for(const{x:t,y:n}of e.positions)r.add(t,n);r.finish(),delete e.positions,e.index=r}this._symbolsByKey[a]=e}}getScaledCoordinates(e,r){const{x:n,y:i,z:a}=this.tileID.canonical,{x:o,y:s,z:l}=r.canonical,c=at/Math.pow(2,l-a),u=(s*t.X+e.anchorY)*c,h=i*t.X*at;return{x:Math.floor((o*t.X+e.anchorX)*c-n*t.X*at),y:Math.floor(u-h)}}findMatches(e,t,r){const n=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let i=0;i<e.length;i++){const a=e.get(i);if(a.crossTileID)continue;const o=this._symbolsByKey[a.key];if(!o)continue;const s=this.getScaledCoordinates(a,t);if(o.index){const e=o.index.range(s.x-n,s.y-n,s.x+n,s.y+n).sort();for(const t of e){const e=o.crossTileIDs[t];if(!r[e]){r[e]=!0,a.crossTileID=e;break}}}else if(o.positions)for(let e=0;e<o.positions.length;e++){const t=o.positions[e],i=o.crossTileIDs[e];if(Math.abs(t.x-s.x)<=n&&Math.abs(t.y-s.y)<=n&&!r[i]){r[i]=!0,a.crossTileID=i;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((e=>{let{crossTileIDs:t}=e;return t}))}}class st{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class lt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const r in this.indexes){const e=this.indexes[r],n={};for(const r in e){const i=e[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),n[i.tileID.key]=i}this.indexes[r]=n}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let i=0;i<t.symbolInstances.length;i++)t.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const n=this.usedCrossTileIDs[e.overscaledZ];for(const i in this.indexes){const r=this.indexes[i];if(Number(i)>e.overscaledZ)for(const i in r){const a=r[i];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,n)}else{const a=r[e.scaledTo(Number(i)).key];a&&a.findMatches(t.symbolInstances,e,n)}}for(let i=0;i<t.symbolInstances.length;i++){const e=t.symbolInstances.get(i);e.crossTileID||(e.crossTileID=r.generate(),n[e.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new ot(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const r of t.getCrossTileIDsLists())for(const t of r)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(const r in this.indexes){const n=this.indexes[r];for(const i in n)e[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,n[i]),delete n[i],t=!0)}return t}}class ct{constructor(){this.layerIndexes={},this.crossTileIDs=new st,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let n=this.layerIndexes[e.id];void 0===n&&(n=this.layerIndexes[e.id]=new lt);let i=!1;const a={};n.handleWrapJump(r);for(const o of t){const t=o.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(o.tileID,t,this.crossTileIDs)&&(i=!0),a[t.bucketInstanceId]=!0)}return n.removeStaleBuckets(a)&&(i=!0),i}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const r in this.layerIndexes)t[r]||delete this.layerIndexes[r]}}const ut=(e,r)=>t.t(e,r&&r.filter((e=>"source.canvas"!==e.identifier))),ht=t.aw();class pt extends t.E{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),this._rtlPluginLoaded=()=>{for(const e in this.sourceCaches){const t=this.sourceCaches[e].getSource().type;"vector"!==t&&"geojson"!==t||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new N(B(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((e,t)=>this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler("GI",((e,t)=>this.getImages(e,t))),this.imageManager=new k,this.imageManager.setEventedParent(this),this.glyphManager=new M(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new z(256,512),this.crossTileSymbolIndex=new ct,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",t.ay()),se().on(ie,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.sourceCaches[e.sourceId];if(!t)return;const r=t.getSource();if(r&&r.vectorLayerIds)for(const n in this._layers){const e=this._layers[n];e.source===r.id&&this._validateLayer(e)}}))}loadURL(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;const i=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const a=this._loadStyleRequest;t.h(i,this._loadStyleRequest).then((e=>{this._loadStyleRequest=null,this._load(e.data,r,n)})).catch((e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.j(e))}))}loadJSON(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this.fire(new t.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(e,r,n)})).catch((()=>{}))}loadEmpty(){this.fire(new t.k("dataloading",{dataType:"style"})),this._load(ht,{validate:!1})}_load(e,r,n){var i;const a=r.transformStyle?r.transformStyle(n,e):e;if(!r.validate||!ut(this,t.u(a))){this._loaded=!0,this.stylesheet=a;for(const e in a.sources)this.addSource(e,a.sources[e],{validate:!1});a.sprite?this._loadSprite(a.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(a.glyphs),this._createLayers(),this.light=new P(this.stylesheet.light),this.sky=new I(this.stylesheet.sky),this.map.setTerrain(null!==(i=this.stylesheet.terrain)&&void 0!==i?i:null),this.fire(new t.k("data",{dataType:"style"})),this.fire(new t.k("style.load"))}}_createLayers(){const e=t.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(const r of e){const e=t.aA(r);e.setEventedParent(this,{layer:{id:r.id}}),this._layers[r.id]=e}}_loadSprite(e){let r,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,r,n,i){return t._(this,void 0,void 0,(function*(){const o=x(e),s=n>1?"@2x":"",l={},c={};for(const{id:e,url:n}of o){const a=r.transformRequest(b(n,s,".json"),"SpriteJSON");l[e]=t.h(a,i);const o=r.transformRequest(b(n,s,".png"),"SpriteImage");c[e]=d.getImage(o,i)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(e,r){return t._(this,void 0,void 0,(function*(){const t={};for(const n in e){t[n]={};const i=a.getImageCanvasContext((yield r[n]).data),o=(yield e[n]).data;for(const e in o){const{width:r,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:d,textFitWidth:f,textFitHeight:m}=o[e];t[n][e]={data:null,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:d,textFitWidth:f,textFitHeight:m,spriteData:{width:r,height:a,x:s,y:l,context:i}}}}return t}))}(l,c)}))}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(const t in e){this._spritesImagesIds[t]=[];const r=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(const e of r)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(const i in e[t]){const r="default"===t?i:`${t}:${i}`;this._spritesImagesIds[t].push(r),r in this.imageManager.images?this.imageManager.updateImage(r,e[t][i],!1):this.imageManager.addImage(r,e[t][i]),n&&(this._changedImages[r]=!0)}}})).catch((e=>{this._spriteRequest=null,r=e,this.fire(new t.j(r))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),n&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"})),i&&i(r)}))}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}_validateLayer(e){const r=this.sourceCaches[e.source];if(!r)return;const n=e.sourceLayer;if(!n)return;const i=r.getSource();("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(n))&&this.fire(new t.j(new Error(`Source layer "${n}" does not exist on source "${i.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=this._serializedAllLayers();if(!e||0===e.length)return Object.values(r?t.aB(n):n);const i=[];for(const a of e)if(n[a]){const e=r?t.aB(n[a]):n[a];i.push(e)}return i}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const t=Object.keys(this._layers);for(const r of t){const t=this._layers[r];"custom"!==t.type&&(e[r]=t.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const r=this._changed;if(r){const t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(t.length||r.length)&&this._updateWorkerLayers(t,r);for(const e in this._updatedSources){const t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const n in this._updatedPaintProps)this._layers[n].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const n={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];n[t]=e.used,e.used=!1}for(const t of this._order){const r=this._layers[t];r.recalculate(e,this._availableImages),!r.isHidden(e.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const i in n){const e=this.sourceCaches[i];!!n[i]!=!!e.used&&e.fire(new t.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:i}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,r&&this.fire(new t.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n;this._checkLoaded();const i=this.serialize();if(e=r.transformStyle?r.transformStyle(i,e):e,(null===(n=r.validate)||void 0===n||n)&&ut(this,t.u(e)))return!1;(e=t.aB(e)).layers=t.az(e.layers);const a=t.aC(i,e),o=this._getOperationsToPerform(a);if(o.unimplemented.length>0)throw new Error(`Unimplemented: ${o.unimplemented.join(", ")}.`);if(0===o.operations.length)return!1;for(const t of o.operations)t();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const t=[],r=[];for(const n of e)switch(n.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":t.push((()=>this.addLayer.apply(this,n.args)));break;case"removeLayer":t.push((()=>this.removeLayer.apply(this,n.args)));break;case"setPaintProperty":t.push((()=>this.setPaintProperty.apply(this,n.args)));break;case"setLayoutProperty":t.push((()=>this.setLayoutProperty.apply(this,n.args)));break;case"setFilter":t.push((()=>this.setFilter.apply(this,n.args)));break;case"addSource":t.push((()=>this.addSource.apply(this,n.args)));break;case"removeSource":t.push((()=>this.removeSource.apply(this,n.args)));break;case"setLayerZoomRange":t.push((()=>this.setLayerZoomRange.apply(this,n.args)));break;case"setLight":t.push((()=>this.setLight.apply(this,n.args)));break;case"setGeoJSONSourceData":t.push((()=>this.setGeoJSONSourceData.apply(this,n.args)));break;case"setGlyphs":t.push((()=>this.setGlyphs.apply(this,n.args)));break;case"setSprite":t.push((()=>this.setSprite.apply(this,n.args)));break;case"setSky":t.push((()=>this.setSky.apply(this,n.args)));break;case"setTerrain":t.push((()=>this.map.setTerrain.apply(this,n.args)));break;case"setTransition":t.push((()=>{}));break;default:r.push(n.command)}return{operations:t,unimplemented:r}}addImage(e,r){if(this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.u.source,`sources.${e}`,r,null,n))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const i=this.sourceCaches[e]=new he(e,r,this.dispatcher);i.style=this,i.setEventedParent(this,(()=>({isSourceLoaded:i.loaded(),source:i.serialize(),sourceId:e}))),i.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(const n in this._layers)if(this._layers[n].source===e)return this.fire(new t.j(new Error(`Source "${e}" cannot be removed while layer "${n}" is using it.`)));const r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);const r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=e.id;if(this.getLayer(i))return void this.fire(new t.j(new Error(`Layer "${i}" already exists on this map.`)));let a;if("custom"===e.type){if(ut(this,t.aD(e)))return;a=t.aA(e)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(i,e.source),e=t.aB(e),e=t.e(e,{source:i})),this._validate(t.u.layer,`layers.${i}`,e,{arrayIndex:-1},n))return;a=t.aA(e),this._validateLayer(a),a.setEventedParent(this,{layer:{id:i}})}const o=r?this._order.indexOf(r):this._order.length;if(r&&-1===o)this.fire(new t.j(new Error(`Cannot add layer "${i}" before non-existing layer "${r}".`)));else{if(this._order.splice(o,0,i),this._layerOrderChanged=!0,this._layers[i]=a,this._removedLayers[i]&&a.source&&"custom"!==a.type){const e=this._removedLayers[i];delete this._removedLayers[i],e.type!==a.type?this._updatedSources[a.source]="clear":(this._updatedSources[a.source]="reload",this.sourceCaches[a.source].pause())}this._updateLayer(a),a.onAdd&&a.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;const n=this._order.indexOf(e);this._order.splice(n,1);const i=r?this._order.indexOf(r):this._order.length;r&&-1===i?this.fire(new t.j(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const r=this._layers[e];if(!r)return void this.fire(new t.j(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);const n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,n){this._checkLoaded();const i=this.getLayer(e);i?i.minzoom===r&&i.maxzoom===n||(null!=r&&(i.minzoom=r),null!=n&&(i.maxzoom=n),this._updateLayer(i)):this.fire(new t.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._checkLoaded();const i=this.getLayer(e);if(i){if(!t.aE(i.filter,r))return null==r?(i.filter=void 0,void this._updateLayer(i)):void(this._validate(t.u.filter,`layers.${i.id}.filter`,r,null,n)||(i.filter=t.aB(r),this._updateLayer(i)))}else this.fire(new t.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.aB(this.getLayer(e).filter)}setLayoutProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);a?t.aE(a.getLayoutProperty(r),n)||(a.setLayoutProperty(r,n,i),this._updateLayer(a)):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){const n=this.getLayer(e);if(n)return n.getLayoutProperty(r);this.fire(new t.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};this._checkLoaded();const a=this.getLayer(e);a?t.aE(a.getPaintProperty(r),n)||(a.setPaintProperty(r,n,i)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new t.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,r){this._checkLoaded();const n=e.source,i=e.sourceLayer,a=this.sourceCaches[n];if(void 0===a)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const o=a.getSource().type;"geojson"===o&&i?this.fire(new t.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==o||i?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),a.setFeatureState(i,e.id,r)):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();const n=e.source,i=this.sourceCaches[n];if(void 0===i)return void this.fire(new t.j(new Error(`The source '${n}' does not exist in the map's style.`)));const a=i.getSource().type,o="vector"===a?e.sourceLayer:void 0;"vector"!==a||o?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.j(new Error("A feature id is required to remove its specific state property."))):i.removeFeatureState(o,e.id,r):this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const r=e.source,n=e.sourceLayer,i=this.sourceCaches[r];if(void 0!==i)return"vector"!==i.getSource().type||n?(void 0===e.id&&this.fire(new t.j(new Error("The feature id parameter must be provided."))),i.getFeatureState(n,e.id)):void this.fire(new t.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.j(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=t.aF(this.sourceCaches,(e=>e.serialize())),r=this._serializeByIds(this._order,!0),n=this.map.getTerrain()||void 0,i=this.stylesheet;return t.aG({version:i.version,name:i.name,metadata:i.metadata,light:i.light,sky:i.sky,center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch,sprite:i.sprite,glyphs:i.glyphs,transition:i.transition,sources:e,layers:r,terrain:n},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,r={},n=[];for(let a=this._order.length-1;a>=0;a--){const i=this._order[a];if(t(i)){r[i]=a;for(const t of e){const e=t[i];if(e)for(const t of e)n.push(t)}}}n.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const i=[];for(let a=this._order.length-1;a>=0;a--){const o=this._order[a];if(t(o))for(let e=n.length-1;e>=0;e--){const t=n[e].feature;if(r[t.layer.id]<a)break;i.push(t),n.pop()}else for(const t of e){const e=t[o];if(e)for(const t of e)i.push(t.feature)}}return i}queryRenderedFeatures(e,r,n){r&&r.filter&&this._validate(t.u.filter,"queryRenderedFeatures.filter",r.filter,null,r);const i={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.j(new Error("parameters.layers must be an Array."))),[];for(const e of r.layers){const r=this._layers[e];if(!r)return this.fire(new t.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];i[r.source]=!0}}const a=[];r.availableImages=this._availableImages;const o=this._serializedAllLayers();for(const t in this.sourceCaches)r.layers&&!i[t]||a.push(q(this.sourceCaches[t],this._layers,o,e,r,n));return this.placement&&a.push(function(e,t,r,n,i,a,o){const s={},l=a.queryRenderedSymbols(n),c=[];for(const u of Object.keys(l).map(Number))c.push(o[u]);c.sort(H);for(const u of c){const r=u.featureIndex.lookupSymbolFeatures(l[u.bucketInstanceId],t,u.bucketIndex,u.sourceLayerIndex,i.filter,i.layers,i.availableImages,e);for(const e in r){const t=s[e]=s[e]||[],n=r[e];n.sort(((e,t)=>{const r=u.featureSortOrder;if(r){const n=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-n}return t.featureIndex-e.featureIndex}));for(const e of n)t.push(e)}}for(const u in s)s[u].forEach((t=>{const n=t.feature,i=r[e[u].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=i}));return s}(this._layers,o,this.sourceCaches,e,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r&&r.filter&&this._validate(t.u.filter,"querySourceFeatures.filter",r.filter,null,r);const n=this.sourceCaches[e];return n?function(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),n=[],i={};for(let a=0;a<r.length;a++){const e=r[a],o=e.tileID.canonical.key;i[o]||(i[o]=!0,e.querySourceFeatures(n,t))}return n}(n,r):[]}getLight(){return this.light.getLight()}setLight(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded();const n=this.light.getLight();let i=!1;for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(o)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getSky();let i=!1;if(!e&&!n)return;if(e&&!n)i=!0;else if(!e&&n)i=!0;else for(const a in e)if(!t.aE(e[a],n[a])){i=!0;break}if(!i)return;const o={now:a.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(o)}_validate(e,r,n,i){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(!a||!1!==a.validate)&&ut(this,e.call(t.u,t.e({key:r,style:this.serialize(),value:n,styleSpec:t.v},i)))}_remove(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),se().off(ie,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=!1,s=!1;const l={};for(const a of this._order){const t=this._layers[a];if("symbol"!==t.type)continue;if(!l[t.source]){const e=this.sourceCaches[t.source];l[t.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const r=this.crossTileSymbolIndex.addLayer(t,l[t.source],e.center.lng);o=o||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((i=i||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.now(),e.zoom))&&(this.pauseablePlacement=new it(e,this.map.terrain,this._order,i,t,r,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.now()),s=!0),o&&this.pauseablePlacement.placement.setStale()),s||o)for(const a of this._order){const e=this._layers[a];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();const t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,r.icons),e}))}getGlyphs(e,r){return t._(this,void 0,void 0,(function*(){const e=yield this.glyphManager.getGlyphs(r.stacks),t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,[""]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._checkLoaded(),e&&this._validate(t.u.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;this._checkLoaded();const a=[{id:e,url:r}],o=[...x(this.stylesheet.sprite),...a];this._validate(t.u.sprite,"sprite",o,null,n)||(this.stylesheet.sprite=o,this._loadSprite(a,!0,i))}removeSprite(e){this._checkLoaded();const r=x(this.stylesheet.sprite);if(r.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(const t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;r.splice(r.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.k("data",{dataType:"style"}))}else this.fire(new t.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return x(this.stylesheet.sprite)}setSprite(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;this._checkLoaded(),e&&this._validate(t.u.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,n):(this._unloadSprite(),n&&n(null)))}}var dt=t.Y([{name:"a_pos",type:"Int16",components:2}]);const ft={prelude:mt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:mt("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:mt("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:mt("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:mt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:mt("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:mt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:mt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:mt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:mt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:mt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:mt("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:mt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:mt("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:mt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:mt("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:mt("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:mt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:mt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:mt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:mt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:mt("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:mt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:mt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:mt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:mt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:mt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:mt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function mt(e,t){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=t.match(/attribute ([\w]+) ([\w]+)/g),i=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=a?a.concat(i):i,s={};return{fragmentSource:e=e.replace(r,((e,t,r,n,i)=>(s[i]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = u_${i};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,n,i)=>{const a="float"===n?"vec2":"vec4",o=i.match(/color/)?"color":a;return s[i]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\nvarying ${r} ${n} ${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${i}\nuniform lowp float u_${i}_t;\nattribute ${r} ${a} a_${i};\n#else\nuniform ${r} ${n} u_${i};\n#endif\n`:"vec4"===o?`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = a_${i};\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${i}\n ${r} ${n} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);\n#else\n ${r} ${n} ${i} = u_${i};\n#endif\n`})),staticAttributes:n,staticUniforms:o}}class gt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,n,i,a,o,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==n.length;for(let u=0;!c&&u<n.length;u++)this.boundPaintVertexBuffers[u]!==n[u]&&(c=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||c||this.boundIndexBuffer!==i||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,r,n,i,a,o,s,l):(e.bindVertexArray.set(this.vao),o&&o.bind(),i&&i.dynamicDraw&&i.bind(),s&&s.bind(),l&&l.bind())}freshBind(e,t,r,n,i,a,o,s){const l=e.numAttributes,c=this.context,u=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=n,this.boundVertexOffset=i,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,t.enableAttributes(u,e);for(const h of r)h.enableAttributes(u,e);a&&a.enableAttributes(u,e),o&&o.enableAttributes(u,e),s&&s.enableAttributes(u,e),t.bind(),t.setVertexAttribPointers(u,e,i);for(const h of r)h.bind(),h.setVertexAttribPointers(u,e,i);a&&(a.bind(),a.setVertexAttribPointers(u,e,i)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(u,e,i)),s&&(s.bind(),s.setVertexAttribPointers(u,e,i)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const yt=(e,r,n,i,a)=>({u_matrix:e,u_texture:0,u_ele_delta:r,u_fog_matrix:n,u_fog_color:i?i.properties.get("fog-color"):t.aM.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:i?i.calculateFogBlendOpacity(a):0,u_horizon_color:i?i.properties.get("horizon-color"):t.aM.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1});function vt(e){const t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;const n=e[r].split(" ");t.push(n.pop())}return t}class xt{constructor(e,r,n,i,a,o){const s=e.gl;this.program=s.createProgram();const l=vt(r.staticAttributes),c=n?n.getBinderAttributes():[],u=l.concat(c),h=ft.prelude.staticUniforms?vt(ft.prelude.staticUniforms):[],p=r.staticUniforms?vt(r.staticUniforms):[],d=n?n.getBinderUniforms():[],f=h.concat(p).concat(d),m=[];for(const t of f)m.indexOf(t)<0&&m.push(t);const g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");const y=g.concat(ft.prelude.fragmentSource,r.fragmentSource).join("\n"),v=g.concat(ft.prelude.vertexSource,r.vertexSource).join("\n"),x=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(x,y),s.compileShader(x),!s.getShaderParameter(x,s.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${s.getShaderInfoLog(x)}`);s.attachShader(this.program,x);const b=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(b,v),s.compileShader(b),!s.getShaderParameter(b,s.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${s.getShaderInfoLog(b)}`);s.attachShader(this.program,b),this.attributes={};const _={};this.numAttributes=u.length;for(let t=0;t<this.numAttributes;t++)u[t]&&(s.bindAttribLocation(this.program,t,u[t]),this.attributes[u[t]]=t);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw new Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(b),s.deleteShader(x);for(let t=0;t<m.length;t++){const e=m[t];if(e&&!_[e]){const t=s.getUniformLocation(this.program,e);t&&(_[e]=t)}}var w,k;this.fixedUniforms=i(e,_),this.terrainUniforms=(w=e,k=_,{u_depth:new t.aH(w,k.u_depth),u_terrain:new t.aH(w,k.u_terrain),u_terrain_dim:new t.aI(w,k.u_terrain_dim),u_terrain_matrix:new t.aJ(w,k.u_terrain_matrix),u_terrain_unpack:new t.aK(w,k.u_terrain_unpack),u_terrain_exaggeration:new t.aI(w,k.u_terrain_exaggeration)}),this.binderUniforms=n?n.getUniforms(e,_):[]}draw(e,t,r,n,i,a,o,s,l,c,u,h,p,d,f,m,g,y){const v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(n),e.setColorMode(i),e.setCullFace(a),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(const e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}for(const b in this.fixedUniforms)this.fixedUniforms[b].set(o[b]);f&&f.setUniforms(e,this.binderUniforms,p,{zoom:d});let x=0;switch(t){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(const b of h.get()){const r=b.vaos||(b.vaos={});(r[l]||(r[l]=new gt)).bind(e,this,c,f?f.getPaintVertexBuffers():[],u,b.vertexOffset,m,g,y),v.drawElements(t,b.primitiveLength*x,v.UNSIGNED_SHORT,b.primitiveOffset*x*2)}}}function bt(e,t,r){const n=1/je(r,1,t.transform.tileZoom),i=Math.pow(2,r.tileID.overscaledZ),a=r.tileSize*Math.pow(2,t.transform.tileZoom)/i,o=a*(r.tileID.canonical.x+r.tileID.wrap*i),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const _t=(e,r,n,i)=>{const a=r.style.light,o=a.properties.get("position"),s=[o.x,o.y,o.z],l=function(){var e=new t.A(9);return t.A!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}();"viewport"===a.properties.get("anchor")&&function(e,t){var r=Math.sin(t),n=Math.cos(t);e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1}(l,-r.transform.angle),function(e,t,r){var n=t[0],i=t[1],a=t[2];e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8]}(s,s,l);const c=a.properties.get("color");return{u_matrix:e,u_lightpos:s,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i}},wt=(e,r,n,i,a,o,s)=>t.e(_t(e,r,n,i),bt(o,r,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),kt=e=>({u_matrix:e}),Tt=(e,r,n,i)=>t.e(kt(e),bt(n,r,i)),St=(e,t)=>({u_matrix:e,u_world:t}),At=(e,r,n,i,a)=>t.e(Tt(e,r,n,i),{u_world:a}),Mt=(e,t,r,n)=>{const i=e.transform;let a,o;if("map"===n.paint.get("circle-pitch-alignment")){const e=je(r,1,i.zoom);a=!0,o=[e,e]}else a=!1,o=i.pixelsToGLUnits;return{u_camera_to_center_distance:i.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+a,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o}},Et=(e,t,r)=>({u_matrix:e,u_inv_matrix:t,u_camera_to_center_distance:r.cameraToCenterDistance,u_viewport_size:[r.width,r.height]}),Ct=function(e,t){return{u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:arguments.length>2&&void 0!==arguments[2]?arguments[2]:1}},Pt=e=>({u_matrix:e}),Lt=(e,t,r,n)=>({u_matrix:e,u_extrude_scale:je(t,1,r),u_intensity:n}),It=(e,r,n,i)=>{const a=t.H();t.aP(a,0,e.width,e.height,0,0,1);const o=e.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:n,u_color_ramp:i,u_opacity:r.paint.get("heatmap-opacity")}};function zt(e,r){const n=Math.pow(2,r.canonical.z),i=r.canonical.y;return[new t.Z(0,i/n).toLngLat().lat,new t.Z(0,(i+1)/n).toLngLat().lat]}const Ot=(e,t,r,n)=>{const i=e.transform;return{u_matrix:Bt(e,t,r,n),u_ratio:1/je(t,1,i.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/i.pixelsToGLUnits[0],1/i.pixelsToGLUnits[1]]}},Rt=(e,r,n,i,a)=>t.e(Ot(e,r,n,a),{u_image:0,u_image_height:i}),Dt=(e,t,r,n,i)=>{const a=e.transform,o=Ft(t,a);return{u_matrix:Bt(e,t,r,i),u_texsize:t.imageAtlasTexture.size,u_ratio:1/je(t,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},jt=(e,r,n,i,a,o)=>{const s=e.lineAtlas,l=Ft(r,e.transform),c="round"===n.layout.get("line-cap"),u=s.getDash(i.from,c),h=s.getDash(i.to,c),p=u.width*a.fromScale,d=h.width*a.toScale;return t.e(Ot(e,r,n,o),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/d,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*e.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:a.t})};function Ft(e,t){return 1/je(e,1,t.tileZoom)}function Bt(e,t,r,n){return e.translatePosMatrix(n?n.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const Nt=(e,t,r,n,i)=>{return{u_matrix:e,u_tl_parent:t,u_scale_parent:r,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(o=i.paint.get("raster-saturation"),o>0?1-1/(1.001-o):-o),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Ut(i.paint.get("raster-hue-rotate"))};var a,o};function Ut(e){e*=Math.PI/180;const t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const Vt=(e,t,r,n,i,a,o,s,l,c,u,h,p,d)=>{const f=o.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:f.width/f.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+h,u_pitch_with_map:+n,u_is_along_line:i,u_is_variable_anchor:a,u_texsize:p,u_texture:0,u_translation:u,u_pitched_scale:d}},qt=(e,r,n,i,a,o,s,l,c,u,h,p,d,f,m)=>{const g=s.transform;return t.e(Vt(e,r,n,i,a,o,s,l,c,u,h,p,d,m),{u_gamma_scale:i?Math.cos(g._pitch)*g.cameraToCenterDistance:1,u_device_pixel_ratio:s.pixelRatio,u_is_halo:+f})},Ht=(e,r,n,i,a,o,s,l,c,u,h,p,d,f)=>t.e(qt(e,r,n,i,a,o,s,l,c,u,h,!0,p,!0,f),{u_texsize_icon:d,u_texture_icon:1}),Gt=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),Wt=(e,r,n,i,a,o)=>t.e(function(e,t,r,n){const i=r.imageManager.getPattern(e.from.toString()),a=r.imageManager.getPattern(e.to.toString()),{width:o,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(n.tileID.canonical.x+n.tileID.wrap*l),h=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:i.tl,u_pattern_br_a:i.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:t.t,u_pattern_size_a:i.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/je(n,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,a),{u_matrix:e,u_opacity:r}),$t={fillExtrusion:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_opacity:new t.aI(e,r.u_opacity)}),fillExtrusionPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_lightpos:new t.aN(e,r.u_lightpos),u_lightintensity:new t.aI(e,r.u_lightintensity),u_lightcolor:new t.aN(e,r.u_lightcolor),u_vertical_gradient:new t.aI(e,r.u_vertical_gradient),u_height_factor:new t.aI(e,r.u_height_factor),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade),u_opacity:new t.aI(e,r.u_opacity)}),fill:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),fillPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),fillOutline:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world)}),fillOutlinePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_texsize:new t.aO(e,r.u_texsize),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),circle:(e,r)=>({u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_scale_with_map:new t.aH(e,r.u_scale_with_map),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_extrude_scale:new t.aO(e,r.u_extrude_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_matrix:new t.aJ(e,r.u_matrix)}),collisionBox:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_pixel_extrude_scale:new t.aO(e,r.u_pixel_extrude_scale)}),collisionCircle:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_inv_matrix:new t.aJ(e,r.u_inv_matrix),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_viewport_size:new t.aO(e,r.u_viewport_size)}),debug:(e,r)=>({u_color:new t.aL(e,r.u_color),u_matrix:new t.aJ(e,r.u_matrix),u_overlay:new t.aH(e,r.u_overlay),u_overlay_scale:new t.aI(e,r.u_overlay_scale)}),clippingMask:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix)}),heatmap:(e,r)=>({u_extrude_scale:new t.aI(e,r.u_extrude_scale),u_intensity:new t.aI(e,r.u_intensity),u_matrix:new t.aJ(e,r.u_matrix)}),heatmapTexture:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_world:new t.aO(e,r.u_world),u_image:new t.aH(e,r.u_image),u_color_ramp:new t.aH(e,r.u_color_ramp),u_opacity:new t.aI(e,r.u_opacity)}),hillshade:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_latrange:new t.aO(e,r.u_latrange),u_light:new t.aO(e,r.u_light),u_shadow:new t.aL(e,r.u_shadow),u_highlight:new t.aL(e,r.u_highlight),u_accent:new t.aL(e,r.u_accent)}),hillshadePrepare:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_image:new t.aH(e,r.u_image),u_dimension:new t.aO(e,r.u_dimension),u_zoom:new t.aI(e,r.u_zoom),u_unpack:new t.aK(e,r.u_unpack)}),line:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels)}),lineGradient:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_image:new t.aH(e,r.u_image),u_image_height:new t.aI(e,r.u_image_height)}),linePattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texsize:new t.aO(e,r.u_texsize),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_image:new t.aH(e,r.u_image),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_scale:new t.aN(e,r.u_scale),u_fade:new t.aI(e,r.u_fade)}),lineSDF:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ratio:new t.aI(e,r.u_ratio),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.aO(e,r.u_units_to_pixels),u_patternscale_a:new t.aO(e,r.u_patternscale_a),u_patternscale_b:new t.aO(e,r.u_patternscale_b),u_sdfgamma:new t.aI(e,r.u_sdfgamma),u_image:new t.aH(e,r.u_image),u_tex_y_a:new t.aI(e,r.u_tex_y_a),u_tex_y_b:new t.aI(e,r.u_tex_y_b),u_mix:new t.aI(e,r.u_mix)}),raster:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_tl_parent:new t.aO(e,r.u_tl_parent),u_scale_parent:new t.aI(e,r.u_scale_parent),u_buffer_scale:new t.aI(e,r.u_buffer_scale),u_fade_t:new t.aI(e,r.u_fade_t),u_opacity:new t.aI(e,r.u_opacity),u_image0:new t.aH(e,r.u_image0),u_image1:new t.aH(e,r.u_image1),u_brightness_low:new t.aI(e,r.u_brightness_low),u_brightness_high:new t.aI(e,r.u_brightness_high),u_saturation_factor:new t.aI(e,r.u_saturation_factor),u_contrast_factor:new t.aI(e,r.u_contrast_factor),u_spin_weights:new t.aN(e,r.u_spin_weights)}),symbolIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolSDF:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texture:new t.aH(e,r.u_texture),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),symbolTextAndIcon:(e,r)=>({u_is_size_zoom_constant:new t.aH(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.aH(e,r.u_is_size_feature_constant),u_size_t:new t.aI(e,r.u_size_t),u_size:new t.aI(e,r.u_size),u_camera_to_center_distance:new t.aI(e,r.u_camera_to_center_distance),u_pitch:new t.aI(e,r.u_pitch),u_rotate_symbol:new t.aH(e,r.u_rotate_symbol),u_aspect_ratio:new t.aI(e,r.u_aspect_ratio),u_fade_change:new t.aI(e,r.u_fade_change),u_matrix:new t.aJ(e,r.u_matrix),u_label_plane_matrix:new t.aJ(e,r.u_label_plane_matrix),u_coord_matrix:new t.aJ(e,r.u_coord_matrix),u_is_text:new t.aH(e,r.u_is_text),u_pitch_with_map:new t.aH(e,r.u_pitch_with_map),u_is_along_line:new t.aH(e,r.u_is_along_line),u_is_variable_anchor:new t.aH(e,r.u_is_variable_anchor),u_texsize:new t.aO(e,r.u_texsize),u_texsize_icon:new t.aO(e,r.u_texsize_icon),u_texture:new t.aH(e,r.u_texture),u_texture_icon:new t.aH(e,r.u_texture_icon),u_gamma_scale:new t.aI(e,r.u_gamma_scale),u_device_pixel_ratio:new t.aI(e,r.u_device_pixel_ratio),u_is_halo:new t.aH(e,r.u_is_halo),u_translation:new t.aO(e,r.u_translation),u_pitched_scale:new t.aI(e,r.u_pitched_scale)}),background:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_color:new t.aL(e,r.u_color)}),backgroundPattern:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_opacity:new t.aI(e,r.u_opacity),u_image:new t.aH(e,r.u_image),u_pattern_tl_a:new t.aO(e,r.u_pattern_tl_a),u_pattern_br_a:new t.aO(e,r.u_pattern_br_a),u_pattern_tl_b:new t.aO(e,r.u_pattern_tl_b),u_pattern_br_b:new t.aO(e,r.u_pattern_br_b),u_texsize:new t.aO(e,r.u_texsize),u_mix:new t.aI(e,r.u_mix),u_pattern_size_a:new t.aO(e,r.u_pattern_size_a),u_pattern_size_b:new t.aO(e,r.u_pattern_size_b),u_scale_a:new t.aI(e,r.u_scale_a),u_scale_b:new t.aI(e,r.u_scale_b),u_pixel_coord_upper:new t.aO(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.aO(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.aI(e,r.u_tile_units_to_pixels)}),terrain:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_ele_delta:new t.aI(e,r.u_ele_delta),u_fog_matrix:new t.aJ(e,r.u_fog_matrix),u_fog_color:new t.aL(e,r.u_fog_color),u_fog_ground_blend:new t.aI(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.aI(e,r.u_fog_ground_blend_opacity),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon_fog_blend:new t.aI(e,r.u_horizon_fog_blend)}),terrainDepth:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_ele_delta:new t.aI(e,r.u_ele_delta)}),terrainCoords:(e,r)=>({u_matrix:new t.aJ(e,r.u_matrix),u_texture:new t.aH(e,r.u_texture),u_terrain_coords_id:new t.aI(e,r.u_terrain_coords_id),u_ele_delta:new t.aI(e,r.u_ele_delta)}),sky:(e,r)=>({u_sky_color:new t.aL(e,r.u_sky_color),u_horizon_color:new t.aL(e,r.u_horizon_color),u_horizon:new t.aI(e,r.u_horizon),u_sky_horizon_blend:new t.aI(e,r.u_sky_horizon_blend)})};class Zt{constructor(e,t,r){this.context=e;const n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Xt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Yt{constructor(e,t,r,n){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=n,this.context=e;const i=e.gl;this.buffer=i.createBuffer(),e.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){const n=t.attributes[this.attributes[r].name];void 0!==n&&e.enableVertexAttribArray(n)}}setVertexAttribPointers(e,t,r){for(let n=0;n<this.attributes.length;n++){const i=this.attributes[n],a=t.attributes[i.name];void 0!==a&&e.vertexAttribPointer(a,i.components,e[Xt[i.type]],!1,this.itemSize,i.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Kt=new WeakMap;function Jt(e){var t;if(Kt.has(e))return Kt.get(e);{const r=null===(t=e.getParameter(e.VERSION))||void 0===t?void 0:t.startsWith("WebGL 2.0");return Kt.set(e,r),r}}class Qt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class er extends Qt{getDefault(){return t.aM.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class tr extends Qt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class rr extends Qt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class nr extends Qt{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class ir extends Qt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class ar extends Qt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class or extends Qt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class sr extends Qt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class lr extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class cr extends Qt{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class ur extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class hr extends Qt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class pr extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class dr extends Qt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class fr extends Qt{getDefault(){return t.aM.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class mr extends Qt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class gr extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class yr extends Qt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class vr extends Qt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class xr extends Qt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class br extends Qt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class _r extends Qt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class wr extends Qt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class kr extends Qt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Tr extends Qt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Sr extends Qt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Ar extends Qt{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Mr extends Qt{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;const r=this.gl;Jt(r)?r.bindVertexArray(e):null===(t=r.getExtension("OES_vertex_array_object"))||void 0===t||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Er extends Qt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Cr extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Pr extends Qt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Lr extends Qt{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Ir extends Lr{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class zr extends Lr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Or extends Lr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Rr{constructor(e,t,r,n,i){this.context=e,this.width=t,this.height=r;const a=e.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new Ir(e,o),n)this.depthAttachment=i?new Or(e,o):new zr(e,o);else if(i)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class Dr{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}Dr.Replace=[1,0],Dr.disabled=new Dr(Dr.Replace,t.aM.transparent,[!1,!1,!1,!1]),Dr.unblended=new Dr(Dr.Replace,t.aM.transparent,[!0,!0,!0,!0]),Dr.alphaBlended=new Dr([1,771],t.aM.transparent,[!0,!0,!0,!0]);class jr{constructor(e){var t,r;if(this.gl=e,this.clearColor=new er(this),this.clearDepth=new tr(this),this.clearStencil=new rr(this),this.colorMask=new nr(this),this.depthMask=new ir(this),this.stencilMask=new ar(this),this.stencilFunc=new or(this),this.stencilOp=new sr(this),this.stencilTest=new lr(this),this.depthRange=new cr(this),this.depthTest=new ur(this),this.depthFunc=new hr(this),this.blend=new pr(this),this.blendFunc=new dr(this),this.blendColor=new fr(this),this.blendEquation=new mr(this),this.cullFace=new gr(this),this.cullFaceSide=new yr(this),this.frontFace=new vr(this),this.program=new xr(this),this.activeTexture=new br(this),this.viewport=new _r(this),this.bindFramebuffer=new wr(this),this.bindRenderbuffer=new kr(this),this.bindTexture=new Tr(this),this.bindVertexBuffer=new Sr(this),this.bindElementBuffer=new Ar(this),this.bindVertexArray=new Mr(this),this.pixelStoreUnpack=new Er(this),this.pixelStoreUnpackPremultiplyAlpha=new Cr(this),this.pixelStoreUnpackFlipY=new Pr(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Jt(e)){this.HALF_FLOAT=e.HALF_FLOAT;const n=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(t=e.RGBA16F)&&void 0!==t?t:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!==(r=e.RGB16F)&&void 0!==r?r:null==n?void 0:n.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==t?void 0:t.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new Zt(this,e,t)}createVertexBuffer(e,t,r){return new Yt(this,e,t,r)}createRenderbuffer(e,t,r){const n=this.gl,i=n.createRenderbuffer();return this.bindRenderbuffer.set(i),n.renderbufferStorage(n.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),i}createFramebuffer(e,t,r,n){return new Rr(this,e,t,r,n)}clear(e){let{color:t,depth:r,stencil:n}=e;const i=this.gl;let a=0;t&&(a|=i.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(a|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),void 0!==n&&(a|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(n),this.stencilMask.set(255)),i.clear(a)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.aE(e.blendFunction,Dr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Jt(this.gl)?this.gl.createVertexArray():null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return Jt(this.gl)?this.gl.deleteVertexArray(e):null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class Fr{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}Fr.ReadOnly=!1,Fr.ReadWrite=!0,Fr.disabled=new Fr(519,Fr.ReadOnly,[0,1]);const Br=7680;class Nr{constructor(e,t,r,n,i,a){this.test=e,this.ref=t,this.mask=r,this.fail=n,this.depthFail=i,this.pass=a}}Nr.disabled=new Nr({func:519,mask:0},0,0,Br,Br,Br);class Ur{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}let Vr;function qr(e,r,n,i,a){const o=e.context,s=o.gl,l=e.useProgram("collisionBox"),c=[];let u=0,h=0;for(let v=0;v<i.length;v++){const d=i[v],f=r.getTile(d).getBucket(n);if(!f)continue;const m=a?f.textCollisionBox:f.iconCollisionBox,g=f.collisionCircleArray;if(g.length>0){const r=t.H();t.aQ(r,f.placementInvProjMatrix,e.transform.glCoordMatrix),t.aQ(r,r,f.placementViewportMatrix),c.push({circleArray:g,circleOffset:h,transform:d.posMatrix,invTransform:r,coord:d}),u+=g.length/4,h=u}m&&l.draw(o,s.LINES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,{u_matrix:d.posMatrix,u_pixel_extrude_scale:[1/(p=e.transform).width,1/p.height]},e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),n.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,null,e.transform.zoom,null,null,m.collisionVertexBuffer)}var p;if(!a||!c.length)return;const d=e.useProgram("collisionCircle"),f=new t.aR;f.resize(4*u),f._trim();let m=0;for(const t of c)for(let e=0;e<t.circleArray.length/4;e++){const r=4*e,n=t.circleArray[r+0],i=t.circleArray[r+1],a=t.circleArray[r+2],o=t.circleArray[r+3];f.emplace(m++,n,i,a,o,0),f.emplace(m++,n,i,a,o,1),f.emplace(m++,n,i,a,o,2),f.emplace(m++,n,i,a,o,3)}(!Vr||Vr.length<2*u)&&(Vr=function(e){const r=2*e,n=new t.aT;n.resize(r),n._trim();for(let t=0;t<r;t++){const e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(u));const g=o.createIndexBuffer(Vr,!0),y=o.createVertexBuffer(f,t.aS.members,!0);for(const v of c){const r=Et(v.transform,v.invTransform,e.transform);d.draw(o,s.TRIANGLES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,r,e.style.map.terrain&&e.style.map.terrain.getTerrainData(v.coord),n.id,y,g,t.a0.simpleSegment(0,2*v.circleOffset,v.circleArray.length,v.circleArray.length/2),null,e.transform.zoom,null,null,null)}y.destroy(),g.destroy()}Ur.disabled=new Ur(!1,1029,2305),Ur.backCCW=new Ur(!0,1029,2305);const Hr=t.an(new Float32Array(16));function Gr(e,r,n,i,a,o){const{horizontalAlign:s,verticalAlign:l}=t.au(e);return new t.P((-(s-.5)*r/a+i[0])*o,(-(l-.5)*n/a+i[1])*o)}function Wr(e,r,n,i,a,o){const s=r.tileAnchorPoint.add(new t.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let e=i.mult(o);n||(e=e.rotate(-a));const t=s.add(e);return xe(t.x,t.y,r.labelPlaneMatrix,r.getElevation).point}if(n){const t=Ee(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),n=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(i.rotate(n))}return e.add(i)}function $r(e,r,n,i,a,o,s,l,c,u,h,p,d,f){const m=e.text.placedSymbolArray,g=e.text.dynamicLayoutVertexArray,y=e.icon.dynamicLayoutVertexArray,v={};g.clear();for(let x=0;x<m.length;x++){const y=m.get(x),b=y.hidden||!y.crossTileID||e.allowVerticalPlacement&&!y.placedOrientation?null:i[y.crossTileID];if(b){const i=new t.P(y.anchorX,y.anchorY),m={getElevation:f,width:a.width,height:a.height,labelPlaneMatrix:o,lineVertexArray:null,pitchWithMap:n,projection:h,projectionCache:null,tileAnchorPoint:i,translation:p,unwrappedTileID:d},x=n?xe(i.x,i.y,s,f):Ee(i.x,i.y,m),_=be(a.cameraToCenterDistance,x.signedDistanceFromCamera);let w=t.ai(e.textSizeData,c,y)*_/t.ap;n&&(w*=e.tilePixelRatio/l);const{width:k,height:T,anchor:S,textOffset:A,textBoxScale:M}=b,E=Gr(S,k,T,A,M,w),C=h.getPitchedTextCorrection(a,i.add(new t.P(p[0],p[1])),d),P=Wr(x.point,m,r,E,a.angle,C),L=e.allowVerticalPlacement&&y.placedOrientation===t.ah.vertical?Math.PI/2:0;for(let e=0;e<y.numGlyphs;e++)t.aj(g,P,L);u&&y.associatedIconIndex>=0&&(v[y.associatedIconIndex]={shiftedAnchor:P,angle:L})}else ze(y.numGlyphs,g)}if(u){y.clear();const r=e.icon.placedSymbolArray;for(let e=0;e<r.length;e++){const n=r.get(e);if(n.hidden)ze(n.numGlyphs,y);else{const r=v[e];if(r)for(let e=0;e<n.numGlyphs;e++)t.aj(y,r.shiftedAnchor,r.angle);else ze(n.numGlyphs,y)}}e.icon.dynamicLayoutVertexBuffer.updateData(y)}e.text.dynamicLayoutVertexBuffer.updateData(g)}function Zr(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function Xr(e,r,n,i,a,o,s,l,c,u,h,p){const d=e.context,f=d.gl,m=e.transform,g=rt(),y="map"===l,v="map"===c,x="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),b=y&&!v&&!x,_=!v&&x,w=!n.layout.get("symbol-sort-key").isConstant();let k=!1;const T=e.depthModeForSublayer(0,Fr.ReadOnly),S=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=[],M=g.getCircleRadiusCorrection(m);for(const E of i){const i=r.getTile(E),l=i.getBucket(n);if(!l)continue;const c=a?l.text:l.icon;if(!c||!c.segments.get().length||!c.hasVisibleVertices)continue;const h=c.programConfigurations.get(n.id),p=a||l.sdfIcons,d=a?l.textSizeData:l.iconSizeData,T=v||0!==m.pitch,C=e.useProgram(Zr(p,a,l),h),P=t.ag(d,m.zoom),L=e.style.map.terrain&&e.style.map.terrain.getTerrainData(E);let I,z,O,R,D=[0,0],j=null;if(a)z=i.glyphAtlasTexture,O=f.LINEAR,I=i.glyphAtlasTexture.size,l.iconsInText&&(D=i.imageAtlasTexture.size,j=i.imageAtlasTexture,R=T||e.options.rotating||e.options.zooming||"composite"===d.kind||"camera"===d.kind?f.LINEAR:f.NEAREST);else{const t=1!==n.layout.get("icon-size").constantOr(0)||l.iconsNeedLinear;z=i.imageAtlasTexture,O=p||e.options.rotating||e.options.zooming||t||T?f.LINEAR:f.NEAREST,I=i.imageAtlasTexture.size}const F=je(i,1,e.transform.zoom),B=_?E.posMatrix:Hr,N=ye(B,v,y,e.transform,F),U=ve(B,v,y,e.transform,F),V=ve(E.posMatrix,v,y,e.transform,F),q=g.translatePosition(e.transform,i,o,s),H=S&&l.hasTextData(),G="none"!==n.layout.get("icon-text-fit")&&H&&l.hasIconData();if(x){const t=e.style.map.terrain?(t,r)=>e.style.map.terrain.getElevation(E,t,r):null,r="map"===n.layout.get("text-rotation-alignment");we(l,E.posMatrix,e,a,N,V,v,u,r,g,E.toUnwrapped(),m.width,m.height,q,t)}const W=E.posMatrix,$=a&&S||G,Z=x||$?Hr:N,X=U,Y=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);let K;K=p?l.iconsInText?Ht(d.kind,P,b,v,x,$,e,W,Z,X,q,I,D,M):qt(d.kind,P,b,v,x,$,e,W,Z,X,q,a,I,!0,M):Vt(d.kind,P,b,v,x,$,e,W,Z,X,q,a,I,M);const J={program:C,buffers:c,uniformValues:K,atlasTexture:z,atlasTextureIcon:j,atlasInterpolation:O,atlasInterpolationIcon:R,isSDF:p,hasHalo:Y};if(w&&l.canOverlap){k=!0;const e=c.segments.get();for(const r of e)A.push({segments:new t.a0([r]),sortKey:r.sortKey,state:J,terrainData:L})}else A.push({segments:c.segments,sortKey:0,state:J,terrainData:L})}k&&A.sort(((e,t)=>e.sortKey-t.sortKey));for(const t of A){const r=t.state;if(d.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){const i=r.uniformValues;r.hasHalo&&(i.u_is_halo=1,Yr(r.buffers,t.segments,n,e,r.program,T,h,p,i,t.terrainData)),i.u_is_halo=0}Yr(r.buffers,t.segments,n,e,r.program,T,h,p,r.uniformValues,t.terrainData)}}function Yr(e,t,r,n,i,a,o,s,l,c){const u=n.context;i.draw(u,u.gl.TRIANGLES,a,o,s,Ur.disabled,l,c,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,n.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Kr(e,r,n,i){const a=e.context,o=a.gl,s=Nr.disabled,l=new Dr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]),c=r.getBucket(n);if(!c)return;const u=i.key;let h=n.heatmapFbos.get(u);h||(h=Qr(a,r.tileSize,r.tileSize),n.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,r.tileSize,r.tileSize]),a.clear({color:t.aM.transparent});const p=c.programConfigurations.get(n.id),d=e.useProgram("heatmap",p),f=e.style.map.terrain.getTerrainData(i);d.draw(a,o.TRIANGLES,Fr.disabled,s,l,Ur.disabled,Lt(i.posMatrix,r,e.transform.zoom,n.paint.get("heatmap-intensity")),f,n.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,n.paint,e.transform.zoom,p)}function Jr(e,t,r){const n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());const a=en(n,t),o=r.key,s=t.heatmapFbos.get(o);s&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,s.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),a.bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,It(e,t,0,1),null,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,e.transform.zoom),s.destroy(),t.heatmapFbos.delete(o))}function Qr(e,t,r){var n,i;const a=e.gl,o=a.createTexture();a.bindTexture(a.TEXTURE_2D,o),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);const s=null!==(n=e.HALF_FLOAT)&&void 0!==n?n:a.UNSIGNED_BYTE,l=null!==(i=e.RGBA16F)&&void 0!==i?i:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t,r,0,a.RGBA,s,null);const c=e.createFramebuffer(t,r,!1,!1);return c.colorAttachment.set(o),c}function en(e,t){return t.colorRampTexture||(t.colorRampTexture=new _(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function tn(e,t,r,n,i){if(!r||!n||!n.imageAtlas)return;const a=n.imageAtlas.patternPositions;let o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){const e=i.getPaintProperty(t);o=a[e],s=a[e]}o&&s&&e.setConstantPatternPositions(o,s)}function rn(e,t,r,n,i,a,o){const s=e.context.gl,l="fill-pattern",c=r.paint.get(l),u=c&&c.constantOr(1),h=r.getCrossfadeParameters();let p,d,f,m,g;o?(d=u&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=s.LINES):(d=u?"fillPattern":"fill",p=s.TRIANGLES);const y=c.constantOr(null);for(const v of n){const n=t.getTile(v);if(u&&!n.patternsLoaded())continue;const c=n.getBucket(r);if(!c)continue;const x=c.programConfigurations.get(r.id),b=e.useProgram(d,x),_=e.style.map.terrain&&e.style.map.terrain.getTerrainData(v);u&&(e.context.activeTexture.set(s.TEXTURE0),n.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),x.updatePaintBuffers(h)),tn(x,l,y,n,r);const w=_?v:null,k=e.translatePosMatrix(w?w.posMatrix:v.posMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(o){m=c.indexBuffer2,g=c.segments2;const t=[s.drawingBufferWidth,s.drawingBufferHeight];f="fillOutlinePattern"===d&&u?At(k,e,h,n,t):St(k,t)}else m=c.indexBuffer,g=c.segments,f=u?Tt(k,e,h,n):kt(k);b.draw(e.context,p,i,e.stencilModeForClipping(v),a,Ur.disabled,f,_,r.id,c.layoutVertexBuffer,m,g,r.paint,e.transform.zoom,x)}}function nn(e,t,r,n,i,a,o){const s=e.context,l=s.gl,c="fill-extrusion-pattern",u=r.paint.get(c),h=u.constantOr(1),p=r.getCrossfadeParameters(),d=r.paint.get("fill-extrusion-opacity"),f=u.constantOr(null);for(const m of n){const n=t.getTile(m),u=n.getBucket(r);if(!u)continue;const g=e.style.map.terrain&&e.style.map.terrain.getTerrainData(m),y=u.programConfigurations.get(r.id),v=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",y);h&&(e.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(p)),tn(y,c,f,n,r);const x=e.translatePosMatrix(m.posMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),b=r.paint.get("fill-extrusion-vertical-gradient"),_=h?wt(x,e,b,d,m,p,n):_t(x,e,b,d);v.draw(s,s.gl.TRIANGLES,i,a,o,Ur.backCCW,_,g,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,e.transform.zoom,y,e.style.map.terrain&&u.centroidVertexBuffer)}}function an(e,t,r,n,i,a,o){const s=e.context,l=s.gl,c=r.fbo;if(!c)return;const u=e.useProgram("hillshade"),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((e,t,r,n)=>{const i=r.paint.get("hillshade-shadow-color"),a=r.paint.get("hillshade-highlight-color"),o=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:n?n.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:zt(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:i,u_highlight:a,u_accent:o}})(e,r,n,h?t:null),h,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function on(e,r,n,i,a,o){const s=e.context,l=s.gl,c=r.dem;if(c&&c.data){const u=c.dim,h=c.stride,p=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||e.getTileTexture(h),r.demTexture){const e=r.demTexture;e.update(p,{premultiply:!1}),e.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else r.demTexture=new _(s,p,l.RGBA,{premultiply:!1}),r.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let d=r.fbo;if(!d){const e=new _(s,{width:u,height:u,data:null},l.RGBA);e.bind(l.LINEAR,l.CLAMP_TO_EDGE),d=r.fbo=s.createFramebuffer(u,u,!0,!1),d.colorAttachment.set(e.texture)}s.bindFramebuffer.set(d.framebuffer),s.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,i,a,o,Ur.disabled,((e,r)=>{const n=r.stride,i=t.H();return t.aP(i,0,t.X,-t.X,0,0,1),t.J(i,i,[0,-t.X,0]),{u_matrix:i,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,c),null,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function sn(e,r,n,i,o,s){const l=i.paint.get("raster-fade-duration");if(!s&&l>0){const i=a.now(),s=(i-e.timeAdded)/l,c=r?(i-r.timeAdded)/l:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),p=!r||Math.abs(r.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),d=p&&e.refreshedUponExpiration?1:t.ac(p?s:1-c,0,1);return e.refreshedUponExpiration&&s>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}const ln=new t.aM(1,0,0,1),cn=new t.aM(0,1,0,1),un=new t.aM(0,0,1,1),hn=new t.aM(1,0,1,1),pn=new t.aM(0,1,1,1);function dn(e,t,r,n){mn(e,0,t+r/2,e.transform.width,r,n)}function fn(e,t,r,n){mn(e,t-r/2,0,r,e.transform.height,n)}function mn(e,t,r,n,i,a){const o=e.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,n*e.pixelRatio,i*e.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function gn(e,r,n){const i=e.context,a=i.gl,o=n.posMatrix,s=e.useProgram("debug"),l=Fr.disabled,c=Nr.disabled,u=e.colorModeForRenderPass(),h="$debug",p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(n);i.activeTexture.set(a.TEXTURE0);const d=r.getTileByID(n.key).latestRawTileData,f=Math.floor((d&&d.byteLength||0)/1024),m=r.getTile(n).tileSize,g=512/Math.min(m,512)*(n.overscaledZ/e.transform.zoom)*.5;let y=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(y+=` => ${n.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();const r=e.debugOverlayCanvas,n=e.context.gl,i=e.debugOverlayCanvas.getContext("2d");i.clearRect(0,0,r.width,r.height),i.shadowColor="white",i.shadowBlur=2,i.lineWidth=1.5,i.strokeStyle="white",i.textBaseline="top",i.font="bold 36px Open Sans, sans-serif",i.fillText(t,5,5),i.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,`${y} ${f}kB`),s.draw(i,a.TRIANGLES,l,c,Dr.alphaBlended,Ur.disabled,Ct(o,t.aM.transparent,g),null,h,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(i,a.LINE_STRIP,l,c,u,Ur.disabled,Ct(o,t.aM.red),p,h,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function yn(e,t,r){const n=e.context,i=n.gl,a=e.colorModeForRenderPass(),o=new Fr(i.LEQUAL,Fr.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh();n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height]);for(const c of r){const r=e.renderToTexture.getTexture(c),u=t.getTerrainData(c.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,r.texture);const h=e.transform.calculatePosMatrix(c.tileID.toUnwrapped()),p=t.getMeshFrameDelta(e.transform.zoom),d=e.transform.calculateFogMatrix(c.tileID.toUnwrapped()),f=yt(h,p,d,e.style.sky,e.transform.pitch);s.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,f,u,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class vn{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class xn{constructor(e,r){this.context=new jr(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=he.maxUnderzooming+he.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ct}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const n of this.style._order)this.style._layers[n].resize()}setup(){const e=this.context,r=new t.aX;r.emplaceBack(0,0),r.emplaceBack(t.X,0),r.emplaceBack(0,t.X),r.emplaceBack(t.X,t.X),this.tileExtentBuffer=e.createVertexBuffer(r,dt.members),this.tileExtentSegments=t.a0.simpleSegment(0,0,4,2);const n=new t.aX;n.emplaceBack(0,0),n.emplaceBack(t.X,0),n.emplaceBack(0,t.X),n.emplaceBack(t.X,t.X),this.debugBuffer=e.createVertexBuffer(n,dt.members),this.debugSegments=t.a0.simpleSegment(0,0,4,5);const i=new t.$;i.emplaceBack(0,0,0,0),i.emplaceBack(t.X,0,t.X,0),i.emplaceBack(0,t.X,0,t.X),i.emplaceBack(t.X,t.X,t.X,t.X),this.rasterBoundsBuffer=e.createVertexBuffer(i,J.members),this.rasterBoundsSegments=t.a0.simpleSegment(0,0,4,2);const a=new t.aX;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(a,dt.members),this.viewportSegments=t.a0.simpleSegment(0,0,4,2);const o=new t.aZ;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);const s=new t.aY;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(s);const l=this.context.gl;this.stencilClearMode=new Nr({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const n=t.H();t.aP(n,0,this.width,this.height,0,0,1),t.K(n,n,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,Fr.disabled,this.stencilClearMode,Dr.disabled,Ur.disabled,Pt(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;const r=this.context,n=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(Dr.disabled),r.setDepthMode(Fr.disabled);const i=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const a of t){const e=this._tileClippingMaskIDs[a.key]=this.nextStencilID++,t=this.style.map.terrain&&this.style.map.terrain.getTerrainData(a);i.draw(r,n.TRIANGLES,Fr.disabled,new Nr({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),Dr.disabled,Ur.disabled,Pt(a.posMatrix),t,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Nr({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){const t=this.context.gl;return new Nr({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),n=r[r.length-1].overscaledZ,i=r[0].overscaledZ-n+1;if(i>1){this.currentStencilSource=void 0,this.nextStencilID+i>256&&this.clearStencil();const e={};for(let r=0;r<i;r++)e[r+n]=new Nr({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=i,[e,r]}return[{[n]:Nr.disabled},r]}colorModeForRenderPass(){const e=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new Dr([e.CONSTANT_COLOR,e.ONE],new t.aM(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Dr.unblended:Dr.alphaBlended}depthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return Fr.disabled;const n=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Fr(r||this.context.gl.LEQUAL,t,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(a.now()),this.imageManager.beginFrame();const n=this.style._order,i=this.style.sourceCaches,o={},s={},l={};for(const t in i){const e=i[t];e.used&&e.prepare(this.context),o[t]=e.getVisibleCoordinates(),s[t]=o[t].slice().reverse(),l[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const t of n){const e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const r=s[e.source];("custom"===e.type||r.length)&&this.renderLayer(this,i[e.source],e,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.aM.black:t.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(e,r){const n=e.context,i=n.gl,a=(u=r,h=e.style.map.transform,p=e.pixelRatio,{u_sky_color:u.properties.get("sky-color"),u_horizon_color:u.properties.get("horizon-color"),u_horizon:(h.height/2+h.getHorizon())*p,u_sky_horizon_blend:u.properties.get("sky-horizon-blend")*h.height/2*p}),o=new Fr(i.LEQUAL,Fr.ReadWrite,[0,1]),s=Nr.disabled,l=e.colorModeForRenderPass(),c=e.useProgram("sky");var u,h,p;if(!r.mesh){const e=new t.aX;e.emplaceBack(-1,-1),e.emplaceBack(1,-1),e.emplaceBack(1,1),e.emplaceBack(-1,1);const i=new t.aY;i.emplaceBack(0,1,2),i.emplaceBack(0,2,3),r.mesh=new vn(n.createVertexBuffer(e,dt.members),n.createIndexBuffer(i),t.a0.simpleSegment(0,0,e.length,i.length))}c.draw(n,i.TRIANGLES,o,s,l,Ur.disabled,a,void 0,"sky",r.mesh.vertexBuffer,r.mesh.indexBuffer,r.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[n[this.currentLayer]],t=i[e.source],r=o[e.source];this._renderTileClippingMasks(e,r),this.renderLayer(this,t,e,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){const e=this.style._layers[n[this.currentLayer]],t=i[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e))continue;const r=("symbol"===e.type?l:s)[e.source];this._renderTileClippingMasks(e,o[e.source]),this.renderLayer(this,t,e,r)}if(this.options.showTileBoundaries){const e=function(e,t){let r=null;const n=Object.values(e._layers).flatMap((r=>r.source&&!r.isHidden(t)?[e.sourceCaches[r.source]]:[])),i=n.filter((e=>"vector"===e.getSource().type)),a=n.filter((e=>"vector"!==e.getSource().type)),o=e=>{(!r||r.getSource().maxzoom<e.getSource().maxzoom)&&(r=e)};return i.forEach((e=>o(e))),r||a.forEach((e=>o(e))),r}(this.style,this.transform.zoom);e&&function(e,t,r){for(let n=0;n<r.length;n++)gn(e,t,r[n])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;dn(e,e.transform.height-(t.top||0),3,ln),dn(e,t.bottom||0,3,cn),fn(e,t.left||0,3,un),fn(e,e.transform.width-(t.right||0),3,hn);const r=e.transform.centerPoint;var n,i,a,o;n=e,i=r.x,a=e.transform.height-r.y,mn(n,i-1,a-10,2,20,o=pn),mn(n,i-10,a-1,20,2,o)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix;let i=this.terrainFacilitator.dirty;i||(i=e?!t.a_(r,n):!t.a$(r,n)),i||(i=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),i&&(t.b0(r,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,r){const n=e.context,i=n.gl,a=Dr.unblended,o=new Fr(i.LEQUAL,Fr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=e.useProgram("terrainDepth");n.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1});for(const t of l){const l=r.getTerrainData(t.tileID),u={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};c.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,u,l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,r){const n=e.context,i=n.gl,a=Dr.unblended,o=new Fr(i.LEQUAL,Fr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=e.useProgram("terrainCoords");n.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),n.clear({color:t.aM.transparent,depth:1}),r.coordsIndex=[];for(const t of c){const c=r.getTerrainData(t.tileID);n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,l.texture);const h={u_matrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped()),u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(e.transform.zoom)};u.draw(n,i.TRIANGLES,o,Nr.disabled,a,Ur.backCCW,h,c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(t.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,r,n,i){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(i||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(e,r,n,i,a){if("translucent"!==e.renderPass)return;const o=Nr.disabled,s=e.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,r,n,i,a,o,s,l,c){const u=r.transform,h=rt(),p="map"===a,d="map"===o;for(const f of e){const e=i.getTile(f),a=e.getBucket(n);if(!a||!a.text||!a.text.segments.get().length)continue;const o=t.ag(a.textSizeData,u.zoom),m=je(e,1,r.transform.zoom),g=ye(f.posMatrix,d,p,r.transform,m),y="none"!==n.layout.get("icon-text-fit")&&a.hasIconData();if(o){const t=Math.pow(2,u.zoom-e.tileID.overscaledZ),n=r.style.map.terrain?(e,t)=>r.style.map.terrain.getElevation(f,e,t):null,i=h.translatePosition(u,e,s,l);$r(a,p,d,c,u,g,f.posMatrix,t,o,y,h,i,f.toUnwrapped(),n)}}}(i,e,n,r,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&Xr(e,r,n,i,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&Xr(e,r,n,i,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),r.map.showCollisionBoxes&&(qr(e,r,n,i,!0),qr(e,r,n,i,!1))}(e,r,n,i,this.style.placement.variableOffsets);break;case"circle":!function(e,r,n,i){if("translucent"!==e.renderPass)return;const a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;const c=e.context,u=c.gl,h=e.depthModeForSublayer(0,Fr.ReadOnly),p=Nr.disabled,d=e.colorModeForRenderPass(),f=[];for(let m=0;m<i.length;m++){const a=i[m],o=r.getTile(a),s=o.getBucket(n);if(!s)continue;const c=s.programConfigurations.get(n.id),u=e.useProgram("circle",c),h=s.layoutVertexBuffer,p=s.indexBuffer,d=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),g={programConfiguration:c,program:u,layoutVertexBuffer:h,indexBuffer:p,uniformValues:Mt(e,a,o,n),terrainData:d};if(l){const e=s.segments.get();for(const r of e)f.push({segments:new t.a0([r]),sortKey:r.sortKey,state:g})}else f.push({segments:s.segments,sortKey:0,state:g})}l&&f.sort(((e,t)=>e.sortKey-t.sortKey));for(const t of f){const{programConfiguration:r,program:i,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=t.state;i.draw(c,u.TRIANGLES,h,p,d,Ur.disabled,s,l,n.id,a,o,t.segments,n.paint,e.transform.zoom,r)}}(e,r,n,i);break;case"heatmap":!function(e,r,n,i){if(0===n.paint.get("heatmap-opacity"))return;const a=e.context;if(e.style.map.terrain){for(const t of i){const i=r.getTile(t);r.hasRenderableParent(t)||("offscreen"===e.renderPass?Kr(e,i,n,t):"translucent"===e.renderPass&&Jr(e,n,t))}a.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,r,n,i){const a=e.context,o=a.gl,s=Nr.disabled,l=new Dr([o.ONE,o.ONE],t.aM.transparent,[!0,!0,!0,!0]);(function(e,r,n){const i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=n.heatmapFbos.get(t.aU);a?(i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=Qr(e,r.width/4,r.height/4),n.heatmapFbos.set(t.aU,a))})(a,e,n),a.clear({color:t.aM.transparent});for(let t=0;t<i.length;t++){const c=i[t];if(r.hasRenderableParent(c))continue;const u=r.getTile(c),h=u.getBucket(n);if(!h)continue;const p=h.programConfigurations.get(n.id),d=e.useProgram("heatmap",p),{zoom:f}=e.transform;d.draw(a,o.TRIANGLES,Fr.disabled,s,l,Ur.disabled,Lt(c.posMatrix,u,f,n.paint.get("heatmap-intensity")),null,n.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,n.paint,e.transform.zoom,p)}a.viewport.set([0,0,e.width,e.height])}(e,r,n,i):"translucent"===e.renderPass&&function(e,r){const n=e.context,i=n.gl;n.setColorMode(e.colorModeForRenderPass());const a=r.heatmapFbos.get(t.aU);a&&(n.activeTexture.set(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(i.TEXTURE1),en(n,r).bind(i.LINEAR,i.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,i.TRIANGLES,Fr.disabled,Nr.disabled,e.colorModeForRenderPass(),Ur.disabled,It(e,r,0,1),null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}(e,n)}(e,r,n,i);break;case"line":!function(e,r,n,i){if("translucent"!==e.renderPass)return;const a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;const s=e.depthModeForSublayer(0,Fr.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),p=n.paint.get("line-gradient"),d=n.getCrossfadeParameters(),f=h?"linePattern":c?"lineSDF":p?"lineGradient":"line",m=e.context,g=m.gl;let y=!0;for(const v of i){const i=r.getTile(v);if(h&&!i.patternsLoaded())continue;const a=i.getBucket(n);if(!a)continue;const o=a.programConfigurations.get(n.id),x=e.context.program.get(),b=e.useProgram(f,o),w=y||b.program!==x,k=e.style.map.terrain&&e.style.map.terrain.getTerrainData(v),T=u.constantOr(null);if(T&&i.imageAtlas){const e=i.imageAtlas,t=e.patternPositions[T.to.toString()],r=e.patternPositions[T.from.toString()];t&&r&&o.setConstantPatternPositions(t,r)}const S=k?v:null,A=h?Dt(e,i,n,d,S):c?jt(e,i,n,c,d,S):p?Rt(e,i,n,a.lineClipsArray.length,S):Ot(e,i,n,S);if(h)m.activeTexture.set(g.TEXTURE0),i.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),o.updatePaintBuffers(d);else if(c&&(w||e.lineAtlas.dirty))m.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(m);else if(p){const i=a.gradients[n.id];let o=i.texture;if(n.gradientVersion!==i.version){let s=256;if(n.stepInterpolant){const n=r.getSource().maxzoom,i=v.canonical.z===n?Math.ceil(1<<e.transform.maxZoom-v.canonical.z):1;s=t.ac(t.aV(a.maxLineLength/t.X*1024*i),256,m.maxTextureSize)}i.gradient=t.aW({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:s,image:i.gradient||void 0,clips:a.lineClipsArray}),i.texture?i.texture.update(i.gradient):i.texture=new _(m,i.gradient,g.RGBA),i.version=n.gradientVersion,o=i.texture}m.activeTexture.set(g.TEXTURE0),o.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}b.draw(m,g.TRIANGLES,s,e.stencilModeForClipping(v),l,Ur.disabled,A,k,n.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,n.paint,e.transform.zoom,o,a.layoutVertexBuffer2),y=!1}}(e,r,n,i);break;case"fill":!function(e,r,n,i){const a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;const s=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(t.aM.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){const t=e.depthModeForSublayer(1,"opaque"===e.renderPass?Fr.ReadWrite:Fr.ReadOnly);rn(e,r,n,i,t,s,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){const t=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Fr.ReadOnly);rn(e,r,n,i,t,s,!0)}}(e,r,n,i);break;case"fill-extrusion":!function(e,t,r,n){const i=r.paint.get("fill-extrusion-opacity");if(0!==i&&"translucent"===e.renderPass){const a=new Fr(e.context.gl.LEQUAL,Fr.ReadWrite,e.depthRangeFor3D);if(1!==i||r.paint.get("fill-extrusion-pattern").constantOr(1))nn(e,t,r,n,a,Nr.disabled,Dr.disabled),nn(e,t,r,n,a,e.stencilModeFor3D(),e.colorModeForRenderPass());else{const i=e.colorModeForRenderPass();nn(e,t,r,n,a,Nr.disabled,i)}}}(e,r,n,i);break;case"hillshade":!function(e,t,r,n){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const i=e.context,a=e.depthModeForSublayer(0,Fr.ReadOnly),o=e.colorModeForRenderPass(),[s,l]="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n];for(const c of l){const n=t.getTile(c);void 0!==n.needsHillshadePrepare&&n.needsHillshadePrepare&&"offscreen"===e.renderPass?on(e,n,r,a,Nr.disabled,o):"translucent"===e.renderPass&&an(e,c,n,r,a,s[c.overscaledZ],o)}i.viewport.set([0,0,e.width,e.height])}(e,r,n,i);break;case"raster":!function(e,t,r,n){if("translucent"!==e.renderPass)return;if(0===r.paint.get("raster-opacity"))return;if(!n.length)return;const i=e.context,a=i.gl,o=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),[c,u]=o instanceof Q?[{},n]:e.stencilConfigForOverlap(n),h=u[u.length-1].overscaledZ,p=!e.options.moving;for(const d of u){const n=e.depthModeForSublayer(d.overscaledZ-h,1===r.paint.get("raster-opacity")?Fr.ReadWrite:Fr.ReadOnly,a.LESS),u=t.getTile(d);u.registerFadeDuration(r.paint.get("raster-fade-duration"));const f=t.findLoadedParent(d,0),m=t.findLoadedSibling(d),g=sn(u,f||m||null,t,r,e.transform,e.style.map.terrain);let y,v;const x="nearest"===r.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;i.activeTexture.set(a.TEXTURE0),u.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.activeTexture.set(a.TEXTURE1),f?(f.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,f.tileID.overscaledZ-u.tileID.overscaledZ),v=[u.tileID.canonical.x*y%1,u.tileID.canonical.y*y%1]):u.texture.bind(x,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),u.texture.useMipmap&&i.extTextureFilterAnisotropic&&e.transform.pitch>20&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax);const b=e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),_=b?d:null,w=_?_.posMatrix:e.transform.calculatePosMatrix(d.toUnwrapped(),p),k=Nt(w,v||[0,0],y||1,g,r);o instanceof Q?s.draw(i,a.TRIANGLES,n,Nr.disabled,l,Ur.disabled,k,b,r.id,o.boundsBuffer,e.quadTriangleIndexBuffer,o.boundsSegments):s.draw(i,a.TRIANGLES,n,c[d.overscaledZ],l,Ur.disabled,k,b,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}(e,r,n,i);break;case"background":!function(e,t,r,n){const i=r.paint.get("background-color"),a=r.paint.get("background-opacity");if(0===a)return;const o=e.context,s=o.gl,l=e.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(e.isPatternMissing(u))return;const h=!u&&1===i.a&&1===a&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==h)return;const p=Nr.disabled,d=e.depthModeForSublayer(0,"opaque"===h?Fr.ReadWrite:Fr.ReadOnly),f=e.colorModeForRenderPass(),m=e.useProgram(u?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:e.style.map.terrain});u&&(o.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));const y=r.getCrossfadeParameters();for(const v of g){const t=n?v.posMatrix:e.transform.calculatePosMatrix(v.toUnwrapped()),l=u?Wt(t,a,e,u,{tileID:v,tileSize:c},y):Gt(t,a,i),h=e.style.map.terrain&&e.style.map.terrain.getTerrainData(v);m.draw(o,s.TRIANGLES,d,p,f,Ur.disabled,l,h,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}(e,0,n,i);break;case"custom":!function(e,t,r){const n=e.context,i=r.implementation;if("offscreen"===e.renderPass){const t=i.prerender;t&&(e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),t.call(i,n.gl,e.transform.customLayerMatrix()),n.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),n.setColorMode(e.colorModeForRenderPass()),n.setStencilMode(Nr.disabled);const t="3d"===i.renderingMode?new Fr(e.context.gl.LEQUAL,Fr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,Fr.ReadOnly);n.setDepthMode(t),i.render(n.gl,e.transform.customLayerMatrix(),{farZ:e.transform.farZ,nearZ:e.transform.nearZ,fov:e.transform._fov,modelViewProjectionMatrix:e.transform.modelViewProjectionMatrix,projectionMatrix:e.transform.projectionMatrix}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(null)}}(e,0,n)}}translatePosMatrix(e,r,n,i,a){if(!n[0]&&!n[1])return e;const o=a?"map"===i?this.transform.angle:0:"viewport"===i?-this.transform.angle:0;if(o){const e=Math.sin(o),t=Math.cos(o);n=[n[0]*t-n[1]*e,n[0]*e+n[1]*t]}const s=[a?n[0]:je(r,n[0],this.transform.zoom),a?n[1]:je(r,n[1],this.transform.zoom),0],l=new Float32Array(16);return t.J(l,e,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t){this.cache=this.cache||{};const r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new xt(this.context,ft[e],t,$t[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new _(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}class bn{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(e,r,n){const i=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((n=>{const a=1/(n=t.af([],n,e))[3]/r*i;return t.b1(n,n,[a,a,1/n[3],a])})),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((e=>{const t=function(e,t){var r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}([],function(e,t,r){var n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],l=r[2];return e[0]=i*l-a*s,e[1]=a*o-n*l,e[2]=n*s-i*o,e}([],y([],a[e[0]],a[e[1]]),y([],a[e[2]],a[e[1]]))),r=-((n=t)[0]*(i=a[e[1]])[0]+n[1]*i[1]+n[2]*i[2]);var n,i;return t.concat(r)}));return new bn(a,o)}}class _n{constructor(e,t){var r,n,i;this.min=e,this.max=t,this.center=function(e,t){return e[0]=.5*t[0],e[1]=.5*t[1],e[2]=.5*t[2],e}([],(r=[],n=this.min,i=this.max,r[0]=n[0]+i[0],r[1]=n[1]+i[1],r[2]=n[2]+i[2],r))}quadrant(e){const t=[e%2==0,e<2],r=m(this.min),n=m(this.max);for(let i=0;i<t.length;i++)r[i]=t[i]?this.min[i]:this.center[i],n[i]=t[i]?this.center[i]:this.max[i];return n[2]=this.max[2],new _n(r,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){const r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let n=!0;for(let i=0;i<e.planes.length;i++){const a=e.planes[i];let o=0;for(let e=0;e<r.length;e++)t.b2(a,r[e])>=0&&o++;if(0===o)return 0;o!==r.length&&(n=!1)}if(n)return 2;for(let t=0;t<3;t++){let r=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let i=0;i<e.points.length;i++){const a=e.points[i][t]-this.min[t];r=Math.min(r,a),n=Math.max(n,a)}if(n<0||r>this.max[t]-this.min[t])return 0}return 1}}class wn{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=n}interpolate(e,r,n){return null!=r.top&&null!=e.top&&(this.top=t.y.number(e.top,r.top,n)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.y.number(e.bottom,r.bottom,n)),null!=r.left&&null!=e.left&&(this.left=t.y.number(e.left,r.left,n)),null!=r.right&&null!=e.right&&(this.right=t.y.number(e.right,r.right,n)),this}getCenter(e,r){const n=t.ac((this.left+e-this.right)/2,0,e),i=t.ac((this.top+r-this.bottom)/2,0,r);return new t.P(n,i)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new wn(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const kn=85.051129;class Tn{constructor(e,r,n,i,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==n?0:n,this._maxPitch=null==i?60:i,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wn,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new Tn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const r=-t.b3(e,-180,180)*Math.PI/180;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=function(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}(),function(e,t,r){var n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=n*l+a*s,e[1]=i*l+o*s,e[2]=n*-s+a*l,e[3]=i*-s+o*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const r=t.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.tileZoom=Math.max(0,Math.floor(t)),this.scale=this.zoomScale(t),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(e){const r=[new t.b4(0,e)];if(this._renderWorldCopies){const n=this.pointCoordinate(new t.P(0,0)),i=this.pointCoordinate(new t.P(this.width,0)),a=this.pointCoordinate(new t.P(this.width,this.height)),o=this.pointCoordinate(new t.P(0,this.height)),s=Math.floor(Math.min(n.x,i.x,a.x,o.x)),l=Math.floor(Math.max(n.x,i.x,a.x,o.x)),c=1;for(let u=s-c;u<=l+c;u++)0!==u&&r.push(new t.b4(u,e))}return r}coveringTiles(e){var r,n;let i=this.coveringZoomLevel(e);const a=i;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);const o=this.pointCoordinate(this.getCameraPoint()),s=t.Z.fromLngLat(this.center),l=Math.pow(2,i),c=[l*o.x,l*o.y,0],u=[l*s.x,l*s.y,0],h=bn.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,i);let p=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=i);const d=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,f=e=>({aabb:new _n([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),m=[],g=[],y=i,x=e.reparseOverscaled?a:i;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(f(-t)),m.push(f(t));for(m.push(f(0));m.length>0;){const i=m.pop(),a=i.x,o=i.y;let s=i.fullyVisible;if(!s){const e=i.aabb.intersects(h);if(0===e)continue;s=2===e}const l=e.terrain?c:u,f=i.aabb.distanceX(l),b=i.aabb.distanceY(l),_=Math.max(Math.abs(f),Math.abs(b));if(i.zoom===y||_>d+(1<<y-i.zoom)-2&&i.zoom>=p){const e=y-i.zoom,r=c[0]-.5-(a<<e),n=c[1]-.5-(o<<e);g.push({tileID:new t.S(i.zoom===y?x:i.zoom,i.wrap,i.zoom,a,o),distanceSq:v([u[0]-.5-a,u[1]-.5-o]),tileDistanceToCamera:Math.sqrt(r*r+n*n)})}else for(let c=0;c<4;c++){const l=(a<<1)+c%2,u=(o<<1)+(c>>1),h=i.zoom+1;let p=i.aabb.quadrant(c);if(e.terrain){const a=new t.S(h,i.wrap,h,l,u),o=e.terrain.getMinMaxElevation(a),s=null!==(r=o.minElevation)&&void 0!==r?r:this.elevation,c=null!==(n=o.maxElevation)&&void 0!==n?n:this.elevation;p=new _n([p.min[0],p.min[1],s],[p.max[0],p.max[1],c])}m.push({aabb:p,zoom:h,x:l,y:u,wrap:i.wrap,fullyVisible:s})}}return g.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const r=t.ac(e.lat,-85.051129,kn);return new t.P(t.O(e.lng)*this.worldSize,t.Q(r)*this.worldSize)}unproject(e){return new t.Z(e.x/this.worldSize,e.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(e){const r=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,i=this.pointLocation(this.centerPoint,e),a=e.getElevationForLngLatZoom(i,this.tileZoom);if(!(this.elevation-a))return;const o=n+r-a,s=Math.cos(this._pitch)*this.cameraToCenterDistance/o/t.b5(1,i.lat),l=this.scaleZoom(s/this.tileSize);this._elevation=a,this._center=i,this.zoom=l}setLocationAtPoint(e,r){const n=this.pointCoordinate(r),i=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(e),o=new t.Z(a.x-(n.x-i.x),a.y-(n.y-i.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),t.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(e){return t.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,r){if(r){const t=r.pointCoordinate(e);if(null!=t)return t}const n=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.af(n,n,this.pixelMatrixInverse),t.af(i,i,this.pixelMatrixInverse);const a=n[3],o=i[3],s=n[1]/a,l=i[1]/o,c=n[2]/a,u=i[2]/o,h=c===u?0:(0-c)/(u-c);return new t.Z(t.y.number(n[0]/a,i[0]/o,h)/this.worldSize,t.y.number(s,l,h)/this.worldSize)}coordinatePoint(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.pixelMatrix;const i=[e.x*this.worldSize,e.y*this.worldSize,r,1];return t.af(i,i,n),new t.P(i[0]/i[3],i[1]/i[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return(new W).extend(this.pointLocation(new t.P(0,e))).extend(this.pointLocation(new t.P(this.width,e))).extend(this.pointLocation(new t.P(this.width,this.height))).extend(this.pointLocation(new t.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new W([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,kn])}calculateTileMatrix(e){const r=e.canonical,n=this.worldSize/this.zoomScale(r.z),i=r.x+Math.pow(2,r.z)*e.wrap,a=t.an(new Float64Array(16));return t.J(a,a,[i*n,r.y*n,0]),t.K(a,a,[n/t.X,n/t.X,1]),a}calculatePosMatrix(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=e.key,i=r?this._alignedPosMatrixCache:this._posMatrixCache;if(i[n])return i[n];const a=this.calculateTileMatrix(e);return t.L(a,r?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,a),i[n]=new Float32Array(a),i[n]}calculateFogMatrix(e){const r=e.key,n=this._fogMatrixCache;if(n[r])return n[r];const i=this.calculateTileMatrix(e);return t.L(i,this.fogMatrix,i),n[r]=new Float32Array(i),n[r]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,r){r=t.ac(+r,this.minZoom,this.maxZoom);const n={center:new t.N(e.lng,e.lat),zoom:r};let i=this.lngRange;if(!this._renderWorldCopies&&null===i){const e=180-1e-10;i=[-e,e]}const a=this.tileSize*this.zoomScale(n.zoom);let o=0,s=a,l=0,c=a,u=0,h=0;const{x:p,y:d}=this.size;if(this.latRange){const e=this.latRange;o=t.Q(e[1])*a,s=t.Q(e[0])*a,s-o<d&&(u=d/(s-o))}i&&(l=t.b3(t.O(i[0])*a,0,a),c=t.b3(t.O(i[1])*a,0,a),c<l&&(c+=a),c-l<p&&(h=p/(c-l)));const{x:f,y:m}=this.project.call({worldSize:a},e);let g,y;const v=Math.max(h||0,u||0);if(v){const e=new t.P(h?(c+l)/2:f,u?(s+o)/2:m);return n.center=this.unproject.call({worldSize:a},e).wrap(),n.zoom+=this.scaleZoom(v),n}if(this.latRange){const e=d/2;m-e<o&&(y=o+e),m+e>s&&(y=s-e)}if(i){const e=(l+c)/2;let r=f;this._renderWorldCopies&&(r=t.b3(f,e-a/2,e+a/2));const n=p/2;r-n<l&&(g=l+n),r+n>c&&(g=c-n)}if(void 0!==g||void 0!==y){const e=new t.P(null!=g?g:f,null!=y?y:m);n.center=this.unproject.call({worldSize:a},e).wrap()}return n}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:t,zoom:r}=this.getConstrained(this.center,this.zoom);this.center=t,this.zoom=r,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,r=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=t.b5(1,this.center.lat)*this.worldSize;let i=t.an(new Float64Array(16));t.K(i,i,[this.width/2,-this.height/2,1]),t.J(i,i,[1,-1,0]),this.labelPlaneMatrix=i,i=t.an(new Float64Array(16)),t.K(i,i,[1,-1,1]),t.J(i,i,[-1,-1,0]),t.K(i,i,[2/this.width,2/this.height,1]),this.glCoordMatrix=i;const a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,u=this._fov*(.5+e.y/this.height),h=Math.sin(u)*l/Math.sin(t.ac(Math.PI-c-u,.01,Math.PI-.01)),p=this.getHorizon(),d=2*Math.atan(p/this.cameraToCenterDistance)*(.5+e.y/(2*p)),f=Math.sin(d)*l/Math.sin(t.ac(Math.PI-c-d,.01,Math.PI-.01)),m=Math.min(h,f);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,i=new Float64Array(16),t.b6(i,this._fov,this.width/this.height,this.nearZ,this.farZ),i[8]=2*-e.x/this.width,i[9]=2*e.y/this.height,this.projectionMatrix=t.ae(i),t.K(i,i,[1,-1,1]),t.J(i,i,[0,0,-this.cameraToCenterDistance]),t.b7(i,i,this._pitch),t.ad(i,i,this.angle),t.J(i,i,[-r,-n,0]),this.mercatorMatrix=t.K([],i,[this.worldSize,this.worldSize,this.worldSize]),t.K(i,i,[1,1,this._pixelPerMeter]),this.pixelMatrix=t.L(new Float64Array(16),this.labelPlaneMatrix,i),t.J(i,i,[0,0,-this.elevation]),this.modelViewProjectionMatrix=i,this.invModelViewProjectionMatrix=t.as([],i),this.fogMatrix=new Float64Array(16),t.b6(this.fogMatrix,this._fov,this.width/this.height,a,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,t.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b7(this.fogMatrix,this.fogMatrix,this._pitch),t.ad(this.fogMatrix,this.fogMatrix,this.angle),t.J(this.fogMatrix,this.fogMatrix,[-r,-n,0]),t.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),t.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=t.L(new Float64Array(16),this.labelPlaneMatrix,i);const g=this.width%2/2,y=this.height%2/2,v=Math.cos(this.angle),x=Math.sin(this.angle),b=r-Math.round(r)+v*g+x*y,_=n-Math.round(n)+v*y+x*g,w=new Float64Array(i);if(t.J(w,w,[b>.5?b-1:b,_>.5?_-1:_,0]),this.alignedModelViewProjectionMatrix=w,i=t.as(new Float64Array(16),this.pixelMatrix),!i)throw new Error("failed to invert matrix");this.pixelMatrixInverse=i,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new t.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.af(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(0,e))}getCameraQueryGeometry(e){const r=this.getCameraPoint();if(1===e.length)return[e[0],r];{let n=r.x,i=r.y,a=r.x,o=r.y;for(const t of e)n=Math.min(n,t.x),i=Math.min(i,t.y),a=Math.max(a,t.x),o=Math.max(o,t.y);return[new t.P(n,i),new t.P(a,i),new t.P(a,o),new t.P(n,o),new t.P(n,i)]}}lngLatToCameraDepth(e,r){const n=this.locationCoordinate(e),i=[n.x*this.worldSize,n.y*this.worldSize,r,1];return t.af(i,i,this.modelViewProjectionMatrix),i[2]/i[3]}}function Sn(e,t){var r=this;let n,i=!1,a=null,o=null;const s=()=>{a=null,i&&(e.apply(o,n),a=setTimeout(s,t),i=!1)};return function(){for(var e=arguments.length,t=new Array(e),l=0;l<e;l++)t[l]=arguments[l];return i=!0,o=r,n=t,a||s(),a}}class An{constructor(e){this._getCurrentHash=()=>{const e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{const e=this._getCurrentHash();if(e.length>=3&&!e.some((e=>isNaN(e)))){const t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{const e=this._getCurrentHash();if(0===e.length)return;const t=e.join("/");let r=t;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${t}`);let n=window.location.hash.replace(r,"");n.startsWith("#&")?n=n.slice(0,1)+n.slice(2):"#"===n&&(n="");let i=window.location.href.replace(/(#.+)?$/,n);i=i.replace("&&","&"),window.history.replaceState(window.history.state,null,i)},this._updateHash=Sn(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),i=Math.pow(10,n),a=Math.round(t.lng*i)/i,o=Math.round(t.lat*i)/i,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const e=this._hashName;let t=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===e?(t=!0,`${n}=${c}`):r})).filter((e=>e));return t||r.push(`${e}=${c}`),`#${r.join("&")}`}return`#${c}`}}const Mn={linearity:.3,easing:t.b8(0,0,.3,1)},En=t.e({deceleration:2500,maxSpeed:1400},Mn),Cn=t.e({deceleration:20,maxSpeed:1400},Mn),Pn=t.e({deceleration:1e3,maxSpeed:360},Mn),Ln=t.e({deceleration:1e3,maxSpeed:90},Mn);class In{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,t=a.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)r.zoom+=t.zoomDelta||0,r.bearing+=t.bearingDelta||0,r.pitch+=t.pitchDelta||0,t.panDelta&&r.pan._add(t.panDelta),t.around&&(r.around=t.around),t.pinchAround&&(r.pinchAround=t.pinchAround);const n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,i={};if(r.pan.mag()){const a=On(r.pan.mag(),n,t.e({},En,e||{}));i.offset=r.pan.mult(a.amount/r.pan.mag()),i.center=this._map.transform.center,zn(i,a)}if(r.zoom){const e=On(r.zoom,n,Cn);i.zoom=this._map.transform.zoom+e.amount,zn(i,e)}if(r.bearing){const e=On(r.bearing,n,Pn);i.bearing=this._map.transform.bearing+t.ac(e.amount,-179,179),zn(i,e)}if(r.pitch){const e=On(r.pitch,n,Ln);i.pitch=this._map.transform.pitch+e.amount,zn(i,e)}if(i.zoom||i.bearing){const e=void 0===r.pinchAround?r.around:r.pinchAround;i.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(i,{noMoveStart:!0})}}function zn(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function On(e,r,n){const{maxSpeed:i,linearity:a,deceleration:o}=n,s=t.ac(e*a/(r/1e3),-i,i),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:s*(l/2)}}class Rn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const a=o.mousePos(r.getCanvas(),n),s=r.unproject(a);super(e,t.e({point:a,lngLat:s,originalEvent:n},i)),this._defaultPrevented=!1,this.target=r}}class Dn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,n){const i="touchend"===e?n.changedTouches:n.touches,a=o.touchPos(r.getCanvasContainer(),i),s=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,n)=>e.add(t.div(n.length))),new t.P(0,0));super(e,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:n}),this._defaultPrevented=!1}}class jn extends t.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class Fn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new jn(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new Rn(e.type,this._map,e))}mouseup(e){this._map.fire(new Rn(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new Rn(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Rn(e.type,this._map,e))}mouseover(e){this._map.fire(new Rn(e.type,this._map,e))}mouseout(e){this._map.fire(new Rn(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dn(e.type,this._map,e))}touchmove(e){this._map.fire(new Dn(e.type,this._map,e))}touchend(e){this._map.fire(new Dn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Bn{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Rn(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Rn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Rn(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nn{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(t.P.convert(e),this._map.terrain)}}class Un{constructor(e,t){this._map=e,this._tr=new Nn(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;const n=this._startPos;this._lastPos=r,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const i=Math.min(n.x,r.x),a=Math.max(n.x,r.x),s=Math.min(n.y,r.y),l=Math.max(n.y,r.y);o.setTransform(this._box,`translate(${i}px,${s}px)`),this._box.style.width=a-i+"px",this._box.style.height=l-s+"px"}mouseupWindow(e,r){if(!this._active)return;if(0!==e.button)return;const n=this._startPos,i=r;if(this.reset(),o.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new t.k("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(n,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new t.k(e,{originalEvent:r}))}}function Vn(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);const r={};for(let n=0;n<e.length;n++)r[e[n].identifier]=t[n];return r}class qn{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){const r=new t.P(0,0);for(const t of e)r._add(t);return r.div(e.length)}(r),this.touches=Vn(n,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const n=Vn(r,t);for(const i in this.touches){const e=n[i];(!e||e.dist(this.touches[i])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Hn{constructor(e){this.singleTap=new qn(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){const n=this.singleTap.touchend(e,t,r);if(n){const t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(n)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class Gn{constructor(e){this._tr=new Nn(e),this._zoomIn=new Hn({numTouches:1,numTaps:2}),this._zoomOut=new Hn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){const n=this._zoomIn.touchend(e,t,r),i=this._zoomOut.touchend(e,t,r),a=this._tr;return n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:e})}):i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(i)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Wn{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(){const e=this._moveFunction(...arguments);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=t.length?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;const r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const n=t.length?t[0]:t;return!this._moved&&n.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(r,n))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&o.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const $n={0:1,2:2};class Zn{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const t=o.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){const r=$n[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton)}isValidEndEvent(e){return o.mouseButton(e)===this._eventButton}}class Xn{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}const Yn=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}},Kn=e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Wn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Yn})},Jn=e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new Wn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Yn})};class Qn{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active){if(!this._shouldBePrevented(r.length))return e.preventDefault(),this._calculateTransform(e,t,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,n){n.length>0&&(this._active=!0);const i=Vn(n,r),a=new t.P(0,0),o=new t.P(0,0);let s=0;for(const t in i){const e=i[t],r=this._touches[t];r&&(a._add(e),o._add(e.sub(r)),s++,i[t]=e)}if(this._touches=i,this._shouldBePrevented(s)||!o.mag())return;const l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ei{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();const[n,i]=this._firstTwoTouches,a=ti(r,t,n),o=ti(r,t,i);if(!a||!o)return;const s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;const[n,i]=this._firstTwoTouches,a=ti(r,t,n),s=ti(r,t,i);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ti(e,t,r){for(let n=0;n<e.length;n++)if(e[n].identifier===r)return t[n]}function ri(e,t){return Math.log(e/t)/Math.LN2}class ni extends ei{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(ri(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:ri(this._distance,r),pinchAround:t}}}function ii(e,t){return 180*e.angleWith(t)/Math.PI}class ai extends ei{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){const n=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ii(this._vector,n),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,r=ii(e,this._startVector);return Math.abs(r)<t}}function oi(e){return Math.abs(e.y)>Math.abs(e.x)}class si extends ei{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,oi(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const n=e[0].sub(this._lastPoints[0]),i=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,i,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(n.y+i.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;const n=e.mag()>=2,i=t.mag()>=2;if(!n&&!i)return;if(!n||!i)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const a=e.y>0==t.y>0;return oi(e)&&oi(t)&&a}}const li={panStep:100,bearingStep:15,pitchStep:10};class ci{constructor(e){this._tr=new Nn(e);const t=li;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,n=0,i=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),i=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),i=1);break;case 38:e.shiftKey?n=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?n=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,n=0),{cameraAnimation:o=>{const s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:ui,zoom:t?Math.round(s.zoom)+t*(e.shiftKey?2:1):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-i*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function ui(e){return e*(2-e)}const hi=4.000244140625;class pi{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Nn(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const r=a.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%hi==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=o.mousePos(this._map.getCanvas(),e),n=this._tr;this._around=r.y>n.transform.height/2-n.transform.getHorizon()?t.N.convert(this._aroundCenter?n.center:n.unproject(r)):t.N.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const e=this._tr.transform;if(0!==this._delta){const t="wheel"===this._type&&Math.abs(this._delta)>hi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*t)));this._delta<0&&0!==r&&(r=1/r);const n="number"==typeof this._targetZoom?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(n*r))),"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:e.zoom,n=this._startZoom,i=this._easing;let o,s=!1;const l=a.now()-this._lastWheelEventTime;if("wheel"===this._type&&n&&i&&l){const e=Math.min(l/200,1),a=i(e);o=t.y.number(n,r,a),e<1?this._frameId||(this._frameId=!0):s=!0}else o=r,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:o-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=t.b9;if(this._prevEase){const e=this._prevEase,n=(a.now()-e.start)/e.duration,i=e.easing(n+.01)-e.easing(n),o=.27/Math.sqrt(i*i+1e-4)*.01,s=Math.sqrt(.0729-o*o);r=t.b8(o,s,.25,1)}return this._prevEase={start:a.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class di{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class fi{constructor(e){this._tr=new Nn(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mi{constructor(){this._tap=new Hn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(this._tapTime){const n=t[0],i=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(n)<30;i&&a?r.length>0&&(this._swipePoint=n,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(e,t,r)}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const n=t[0],i=n.y-this._swipePoint.y;return this._swipePoint=n,e.preventDefault(),this._active=!0,{zoomDelta:i/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{const n=this._tap.touchend(e,t,r);n&&(this._tapTime=e.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gi{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class yi{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class vi{constructor(e,t,r,n){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class xi{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=t,this._container.appendChild(n);const i=document.createElement("div");i.className="maplibregl-mobile-message",i.textContent=r,this._container.appendChild(i),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new t.k("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const bi=e=>e.zoom||e.drag||e.pitch||e.rotate;class _i extends t.k{}function wi(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class ki{constructor(e,t){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,t)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},i={},a={},s=e.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._map.getCanvas(),l):o.mousePos(this._map.getCanvas(),e);for(const{handlerName:o,handler:p,allowed:d}of this._handlers){if(!p.isEnabled())continue;let s;this._blockedByActive(a,d,o)?p.reset():p[t||e.type]&&(s=p[t||e.type](e,c,l),this.mergeHandlerResult(n,i,s,o,r),s&&s.needsRenderFrame&&this._triggerRenderFrame()),(s||p.isActive())&&(a[o]=p)}const u={};for(const o in this._previousActiveHandlers)a[o]||(u[o]=r);this._previousActiveHandlers=a,(Object.keys(u).length||wi(n))&&(this._changes.push([n,i,u]),this._triggerRenderFrame()),(Object.keys(a).length||wi(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new In(e),this._bearingSnap=t.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(t);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[n,i,a]of this._listeners)o.addEventListener(n,i,n===document?this.handleWindowEvent:this.handleEvent,a)}destroy(){for(const[e,t,r]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new Fn(t,e));const n=t.boxZoom=new Un(t,e);this._add("boxZoom",n),e.interactive&&e.boxZoom&&n.enable();const i=t.cooperativeGestures=new xi(t,e.cooperativeGestures);this._add("cooperativeGestures",i),e.cooperativeGestures&&i.enable();const a=new Gn(t),s=new fi(t);t.doubleClickZoom=new di(s,a),this._add("tapZoom",a),this._add("clickZoom",s),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();const l=new mi;this._add("tapDragZoom",l);const c=t.touchPitch=new si(t);this._add("touchPitch",c),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);const u=Kn(e),h=Jn(e);t.dragRotate=new yi(e,u,h),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate"]),e.interactive&&e.dragRotate&&t.dragRotate.enable();const p=(e=>{let{enable:t,clickTolerance:r}=e;const n=new Zn({checkCorrectEvent:e=>0===o.mouseButton(e)&&!e.ctrlKey});return new Wn({clickTolerance:r,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:n,enable:t,assignEvents:Yn})})(e),d=new Qn(e,t);t.dragPan=new gi(r,p,d),this._add("mousePan",p),this._add("touchPan",d,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);const f=new ai,m=new ni;t.touchZoomRotate=new vi(r,m,f,l),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate);const g=t.scrollZoom=new pi(t,(()=>this._triggerRenderFrame()));this._add("scrollZoom",g,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);const y=t.keyboard=new ci(t);this._add("keyboard",y),e.interactive&&e.keyboard&&t.keyboard.enable(),this._add("blockableMapEvent",new Bn(t))}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(bi(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,r){for(const n in e)if(n!==r&&(!t||t.indexOf(n)<0))return!0;return!1}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}mergeHandlerResult(e,r,n,i,a){if(!n)return;t.e(e,n);const o={handlerName:i,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(r.zoom=o),void 0!==n.panDelta&&(r.drag=o),void 0!==n.pitchDelta&&(r.pitch=o),void 0!==n.bearingDelta&&(r.rotate=o)}_applyChanges(){const e={},r={},n={};for(const[i,a,o]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),void 0!==i.around&&(e.around=i.around),void 0!==i.pinchAround&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),t.e(r,a),t.e(n,o);this._updateMapTransform(e,r,n),this._changes=[]}_updateMapTransform(e,t,r){const n=this._map,i=n._getTransformForUpdate(),a=n.terrain;if(!(wi(e)||a&&this._terrainMovement))return this._fireEvents(t,r,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:u,pinchAround:h}=e;void 0!==h&&(u=h),n._stop(!0),u=u||n.transform.centerPoint;const p=i.pointLocation(o?u.sub(o):u);l&&(i.bearing+=l),c&&(i.pitch+=c),s&&(i.zoom+=s),a?this._terrainMovement||!t.drag&&!t.zoom?t.drag&&this._terrainMovement?i.center=i.pointLocation(i.centerPoint.sub(o)):i.setLocationAtPoint(p,u):(this._terrainMovement=!0,this._map._elevationFreeze=!0,i.setLocationAtPoint(p,u)):i.setLocationAtPoint(p,u),n._applyUpdatedTransform(i),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_fireEvents(e,r,n){const i=bi(this._eventsInProgress),o=bi(e),s={};for(const t in e){const{originalEvent:r}=e[t];this._eventsInProgress[t]||(s[`${t}start`]=r),this._eventsInProgress[t]=e[t]}!i&&o&&this._fireEvent("movestart",o.originalEvent);for(const t in s)this._fireEvent(t,s[t]);o&&this._fireEvent("move",o.originalEvent);for(const t in e){const{originalEvent:r}=e[t];this._fireEvent(t,r)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=r[e]||n,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const u=bi(this._eventsInProgress),h=(i||o)&&!u;if(h&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const e=this._map._getTransformForUpdate();e.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(e)}if(n&&h){this._updatingCamera=!0;const e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&a.prefersReducedMotion?(this._map.fire(new t.k("moveend",{originalEvent:c})),r(this._map.getBearing())&&this._map.resetNorth()):(r(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new t.k(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new _i("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Ti extends t.E{constructor(e,t){super(),this._renderFrameCallback=()=>{const e=Math.min((a.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=t.bearingSnap,this.on("moveend",(()=>{delete this._requestedCameraState}))}getCenter(){return new t.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(e,r,n){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},r),n)}panTo(e,r,n){return this.easeTo(t.e({center:e},r),n)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,r,n){return this.easeTo(t.e({zoom:e},r),n)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,r,n){return this.easeTo(t.e({bearing:e},r),n)}resetNorth(e,r){return this.rotateTo(0,t.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(t.e({bearing:0,pitch:0,duration:1e3},e),r),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(e,t){e=W.convert(e).adjustAntiMeridian();const r=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,r,n,i){const a={top:0,bottom:0,right:0,left:0};if("number"==typeof(i=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},i)).padding){const e=i.padding;i.padding={top:e,bottom:e,right:e,left:e}}i.padding=t.e(a,i.padding);const o=this.transform,s=o.padding,l=new W(e,r),c=o.project(l.getNorthWest()),u=o.project(l.getNorthEast()),h=o.project(l.getSouthEast()),p=o.project(l.getSouthWest()),d=t.ba(-n),f=c.rotate(d),m=u.rotate(d),g=h.rotate(d),y=p.rotate(d),v=new t.P(Math.max(f.x,m.x,y.x,g.x),Math.max(f.y,m.y,y.y,g.y)),x=new t.P(Math.min(f.x,m.x,y.x,g.x),Math.min(f.y,m.y,y.y,g.y)),b=v.sub(x),_=(o.width-(s.left+s.right+i.padding.left+i.padding.right))/b.x,w=(o.height-(s.top+s.bottom+i.padding.top+i.padding.bottom))/b.y;if(w<0||_<0)return void t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const k=Math.min(o.scaleZoom(o.scale*Math.min(_,w)),i.maxZoom),T=t.P.convert(i.offset),S=new t.P((i.padding.left-i.padding.right)/2,(i.padding.top-i.padding.bottom)/2).rotate(t.ba(n)),A=T.add(S).mult(o.scale/o.zoomScale(k));return{center:o.unproject(c.add(h).div(2).sub(A)),zoom:k,bearing:n}}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,r,n,i,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.P.convert(e)),this.transform.pointLocation(t.P.convert(r)),n,i),i,a)}_fitInternal(e,r,n){return e?(delete(r=t.e(e,r)).padding,r.linear?this.easeTo(r,n):this.flyTo(r,n)):this}jumpTo(e,r){this.stop();const n=this._getTransformForUpdate();let i=!1,a=!1,o=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(i=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.N.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(a=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(o=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this._applyUpdatedTransform(n),this.fire(new t.k("movestart",r)).fire(new t.k("move",r)),i&&this.fire(new t.k("zoomstart",r)).fire(new t.k("zoom",r)).fire(new t.k("zoomend",r)),a&&this.fire(new t.k("rotatestart",r)).fire(new t.k("rotate",r)).fire(new t.k("rotateend",r)),o&&this.fire(new t.k("pitchstart",r)).fire(new t.k("pitch",r)).fire(new t.k("pitchend",r)),this.fire(new t.k("moveend",r))}calculateCameraOptionsFromTo(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const a=t.Z.fromLngLat(e,r),o=t.Z.fromLngLat(n,i),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const h=Math.hypot(s,l),p=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),d=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(h/u)/Math.PI;return f=c<0?90-f:90+f,{center:o.toLngLat(),zoom:p,pitch:f,bearing:d}}easeTo(e,r){var n;this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.b9},e)).animate||!e.essential&&a.prefersReducedMotion)&&(e.duration=0);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:i.padding,d=t.P.convert(e.offset);let f=i.centerPoint.add(d);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.project(m),x=i.project(g).sub(v),b=i.zoomScale(y-o);let _,w;e.around&&(_=t.N.convert(e.around),w=i.locationPoint(_));const k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==l,this._padding=!i.isPaddingEqual(p),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,k),this.terrain&&this._prepareElevation(g),this._ease((n=>{if(this._zooming&&(i.zoom=t.y.number(o,y,n)),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),f=i.centerPoint.add(d)),this.terrain&&!e.freezeElevation&&this._updateElevation(n),_)i.setLocationAtPoint(_,w);else{const e=i.zoomScale(i.zoom-o),t=y>o?Math.min(2,b):Math.max(.5,b),r=Math.pow(t,1-n),a=i.unproject(v.add(x.mult(n*r)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,f)}this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,t)}),e),this}_prepareEase(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._moving=!0,r||n.moving||this.fire(new t.k("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.k("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.k("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(r-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.elevation=t.y.number(this._elevationStart,this._elevationTarget,e)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){const t=e.getCameraPosition(),r=this.terrain.getElevationForLngLatZoom(t.lngLat,e.zoom);if(t.altitude<r){const n=this.calculateCameraOptionsFromTo(t.lngLat,r,e.center,e.elevation);return{pitch:n.pitch,zoom:n.zoom}}return{}}_applyUpdatedTransform(e){const t=[];if(this.terrain&&t.push((e=>this._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;const r=e.clone();for(const n of t){const e=r.clone(),{center:t,zoom:i,pitch:a,bearing:o,elevation:s}=n(e);t&&(e.center=t),void 0!==i&&(e.zoom=i),void 0!==a&&(e.pitch=a),void 0!==o&&(e.bearing=o),void 0!==s&&(e.elevation=s),r.apply(e)}this.transform.apply(r)}_fireMoveEvents(e){this.fire(new t.k("move",e)),this._zooming&&this.fire(new t.k("zoom",e)),this._rotating&&this.fire(new t.k("rotate",e)),this._pitching&&this.fire(new t.k("pitch",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const n=this._zooming,i=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.k("zoomend",e)),i&&this.fire(new t.k("rotateend",e)),a&&this.fire(new t.k("pitchend",e)),this.fire(new t.k("moveend",e))}flyTo(e,r){var n;if(!e.essential&&a.prefersReducedMotion){const n=t.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.b9},e);const i=this._getTransformForUpdate(),o=i.zoom,s=i.bearing,l=i.pitch,c=i.padding,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:i.padding,d=t.P.convert(e.offset);let f=i.centerPoint.add(d);const m=i.pointLocation(f),{center:g,zoom:y}=i.getConstrained(t.N.convert(e.center||m),null!==(n=e.zoom)&&void 0!==n?n:o);this._normalizeCenter(g,i);const v=i.zoomScale(y-o),x=i.project(m),b=i.project(g).sub(x);let _=e.curve;const w=Math.max(i.width,i.height),k=w/v,T=b.mag();if("minZoom"in e){const r=t.ac(Math.min(e.minZoom,o,y),i.minZoom,i.maxZoom),n=w/i.zoomScale(r-o);_=Math.sqrt(n/T*2)}const S=_*_;function A(e){const t=(k*k-w*w+(e?-1:1)*S*S*T*T)/(2*(e?k:w)*S*T);return Math.log(Math.sqrt(t*t+1)-t)}function M(e){return(Math.exp(e)-Math.exp(-e))/2}function E(e){return(Math.exp(e)+Math.exp(-e))/2}const C=A(!1);let P=function(e){return E(C)/E(C+_*e)},L=function(e){return w*((E(C)*(M(t=C+_*e)/E(t))-M(C))/S)/T;var t},I=(A(!0)-C)/_;if(Math.abs(T)<1e-6||!isFinite(I)){if(Math.abs(w-k)<1e-6)return this.easeTo(e,r);const t=k<w?-1:1;I=Math.abs(Math.log(k/w))/_,L=()=>0,P=e=>Math.exp(t*_*e)}return e.duration="duration"in e?+e.duration:1e3*I/("screenSpeed"in e?+e.screenSpeed/_:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==u,this._pitching=h!==l,this._padding=!i.isPaddingEqual(p),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g),this._ease((n=>{const a=n*I,m=1/P(a);i.zoom=1===n?y:o+i.scaleZoom(m),this._rotating&&(i.bearing=t.y.number(s,u,n)),this._pitching&&(i.pitch=t.y.number(l,h,n)),this._padding&&(i.interpolatePadding(c,p,n),f=i.centerPoint.add(d)),this.terrain&&!e.freezeElevation&&this._updateElevation(n);const v=1===n?g:i.unproject(x.add(b.mult(L(a))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?v.wrap():v,f),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=a.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=t.b3(e,-180,180);const n=Math.abs(e-r);return Math.abs(e-360-r)<n&&(e-=360),Math.abs(e+360-r)<n&&(e+=360),e}_normalizeCenter(e,t){if(!t.renderWorldCopies||t.lngRange)return;const r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const Si={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Ai{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si;this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=e=>{!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style.sourceCaches;for(const n in t){const r=t[n];if(r.used||r.usedForTerrain){const t=r.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let n=r+1;n<e.length;n++)if(e[n].indexOf(t)>=0)return!1;return!0}));const r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Mi{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._updateCompact=()=>{const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");const t=o.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ei{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(const n of r)if(n.id===e)return void(n.cancelled=!0)}run(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const t=this._currentlyRunning=this._queue;this._queue=[];for(const r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ci=t.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Pi extends t.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const n={};for(const i of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))n[i.key]=!0,this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),this._tiles[i.key]=new le(i,this.tileSize));for(const t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(e){for(const t in this._tiles){const r=this._tiles[t];(!e||r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const r={};for(const n of this._renderableTilesKeys){const i=this._tiles[n].tileID;if(i.canonical.equals(e.canonical)){const i=e.clone();i.posMatrix=new Float64Array(16),t.aP(i.posMatrix,0,t.X,0,t.X,0,1),r[n]=i}else if(i.canonical.isChildOf(e.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),c=t.X>>o;t.aP(a.posMatrix,0,c,0,c,0,1),t.J(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),r[n]=a}else if(e.canonical.isChildOf(i.canonical)){const a=e.clone();a.posMatrix=new Float64Array(16);const o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),c=t.X>>o;t.aP(a.posMatrix,0,t.X,0,t.X,0,1),t.J(a.posMatrix,a.posMatrix,[s*c,l*c,0]),t.K(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),r[n]=a}}return r}getSourceTile(e,t){const r=this.sourceCache._source;let n=e.overscaledZ-this.deltaZoom;if(n>r.maxzoom&&(n=r.maxzoom),n<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(n).key);let i=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!i||!i.dem)&&t)for(;n>=r.minzoom&&(!i||!i.dem);)i=this.sourceCache.getTileByID(e.scaledTo(n--).key);return i}tilesAfterTime(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();return Object.values(this._tiles).filter((t=>t.timeAdded>=e))}}class Li{constructor(e,t,r){this.painter=e,this.sourceCache=new Pi(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.X;var a;if(!(r>=0&&r<i&&n>=0&&n<i))return 0;const o=this.getTerrainData(e),s=null===(a=o.tile)||void 0===a?void 0:a.dem;if(!s)return 0;const l=function(e,t,r){var n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}([],[r/i*t.X,n/i*t.X],o.u_terrain_matrix),c=[l[0]*s.dim,l[1]*s.dim],u=Math.floor(c[0]),h=Math.floor(c[1]),p=c[0]-u,d=c[1]-h;return s.get(u,h)*(1-p)*(1-d)+s.get(u+1,h)*p*(1-d)+s.get(u,h+1)*(1-p)*d+s.get(u+1,h+1)*p*d}getElevationForLngLatZoom(e,r){if(!t.bb(r,e.wrap()))return 0;const{tileID:n,mercatorX:i,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(n,i%t.X,a%t.X,t.X)}getElevation(e,r,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.X;return this.getDEMElevation(e,r,n,i)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const e=this.painter.context,r=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new _(e,r,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new _(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.an([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const e=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new _(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const n=r&&r+r.tileID.key+e.key;if(n&&!this._demMatrixCache[n]){const n=this.sourceCache.sourceCache._source.maxzoom;let i=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=n?i=e.canonical.z-n:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const a=e.canonical.x-(e.canonical.x>>i<<i),o=e.canonical.y-(e.canonical.y>>i<<i),s=t.bc(new Float64Array(16),[1/(t.X<<i),1/(t.X<<i),0]);t.J(s,s,[a*t.X,o*t.X,0]),this._demMatrixCache[e.key]={matrix:s,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const t=this.painter,r=t.width/devicePixelRatio,n=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new _(t.context,{width:r,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new _(t.context,{width:r,height:n,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(r,n,!0,!1),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,r,n))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,a=0;t<this._coordsTextureSize;t++)for(let e=0;e<this._coordsTextureSize;e++,a+=4)r[a+0]=255&e,r[a+1]=255&t,r[a+2]=e>>8<<4|t>>8,r[a+3]=0;const n=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),i=new _(e,n,e.gl.RGBA,{premultiply:!1});return i.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=i,i}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),n=this.painter.context,i=n.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),o=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),s=Math.round(this.painter.height/devicePixelRatio);n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),i.readPixels(a,s-o-1,1,1,i.RGBA,i.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const l=r[0]+(r[2]>>4<<8),c=r[1]+((15&r[2])<<8),u=this.coordsIndex[255-r[3]],h=u&&this.sourceCache.getTileByID(u);if(!h)return null;const p=this._coordsTextureSize,d=(1<<h.tileID.canonical.z)*p;return new t.Z((h.tileID.canonical.x*p+l)/d+h.tileID.wrap,(h.tileID.canonical.y*p+c)/d,this.getElevation(h.tileID,l,c,p))}depthAtPoint(e){const t=new Uint8Array(4),r=this.painter.context,n=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,t),r.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const e=this.painter.context,r=new t.bd,n=new t.aY,i=this.meshSize,a=t.X/i,o=i*i;for(let t=0;t<=i;t++)for(let e=0;e<=i;e++)r.emplaceBack(e*a,t*a,0);for(let t=0;t<o;t+=i+1)for(let e=0;e<i;e++)n.emplaceBack(e+t,i+e+t+1,i+e+t+2),n.emplaceBack(e+t,i+e+t+2,e+t+1);const s=r.length,l=s+2*(i+1);for(const h of[0,1])for(let e=0;e<=i;e++)for(const n of[0,1])r.emplaceBack(e*a,h*t.X,n);for(let t=0;t<2*i;t+=2)n.emplaceBack(l+t,l+t+1,l+t+3),n.emplaceBack(l+t,l+t+3,l+t+2),n.emplaceBack(s+t,s+t+3,s+t+1),n.emplaceBack(s+t,s+t+2,s+t+3);const c=r.length,u=c+2*(i+1);for(const h of[0,1])for(let e=0;e<=i;e++)for(const n of[0,1])r.emplaceBack(h*t.X,e*a,n);for(let t=0;t<2*i;t+=2)n.emplaceBack(c+t,c+t+1,c+t+3),n.emplaceBack(c+t,c+t+3,c+t+2),n.emplaceBack(u+t,u+t+3,u+t+1),n.emplaceBack(u+t,u+t+2,u+t+3);return this._mesh=new vn(e.createVertexBuffer(r,Ci.members),e.createIndexBuffer(n),t.a0.simpleSegment(0,0,r.length,n.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*t.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,t){var r;const{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!==(r=this.getMinMaxElevation(n).minElevation)&&void 0!==r?r:0}getMinMaxElevation(e){const t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(e,r){const n=t.Z.fromLngLat(e.wrap()),i=(1<<r)*t.X,a=n.x*i,o=n.y*i,s=Math.floor(a/t.X),l=Math.floor(o/t.X);return{tileID:new t.S(r,0,r,s,l),mercatorX:a,mercatorY:o}}}class Ii{constructor(e,t,r){this._context=e,this._size=t,this._tileSize=r,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const t=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new _(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),t.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),t.colorAttachment.set(r.texture),{id:e,fbo:t,texture:r,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((t=>e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((e=>!e.inUse))}}const zi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Oi{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Ii(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((r=>!e._layers[r].isHidden(t))),this._coordsDescendingInv={};for(const r in e.sourceCaches){this._coordsDescendingInv[r]={};const t=e.sourceCaches[r].getVisibleCoordinates();for(const e of t){const t=this.terrain.sourceCache.getTerrainCoords(e);for(const e in t)this._coordsDescendingInv[r][e]||(this._coordsDescendingInv[r][e]=[]),this._coordsDescendingInv[r][e].push(t[e])}}this._coordsDescendingInvStr={};for(const r of e._order){const t=e._layers[r],n=t.source;if(zi[t.type]&&!this._coordsDescendingInvStr[n]){this._coordsDescendingInvStr[n]={};for(const e in this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][e]=this._coordsDescendingInv[n][e].map((e=>e.key)).sort().join()}}for(const r of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const t=this._coordsDescendingInvStr[e][r.tileID.key];t&&t!==r.rttCoords[e]&&(r.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const r=e.type,n=this.painter,i=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(zi[r]&&(this._prevType&&zi[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(e.id),!i))return!0;if(zi[this._prevType]||zi[r]&&i){this._prevType=r;const e=this._stacks.length-1,i=this._stacks[e]||[];for(const r of this._renderableTiles){if(this.pool.isFull()&&(yn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(r),r.rtt[e]){const t=this.pool.getObjectForId(r.rtt[e].id);if(t.stamp===r.rtt[e].stamp){this.pool.useObject(t);continue}}const a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),r.rtt[e]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:t.aM.transparent,stencil:0}),n.currentStencilSource=void 0;for(let e=0;e<i.length;e++){const t=n.style._layers[i[e]],o=t.source?this._coordsDescendingInv[t.source][r.tileID.key]:[r.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(t,o),n.renderLayer(n,n.style.sourceCaches[t.source],t,o),t.source&&(r.rttCoords[t.source]=this._coordsDescendingInvStr[t.source][r.tileID.key])}}return yn(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),zi[r]}return!1}}const Ri={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Di=r,ji={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Si,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Fi=e=>{e.touchstart=e.dragStart,e.touchmoveWindow=e.dragMove,e.touchend=e.dragEnd},Bi={showCompass:!0,showZoom:!0,visualizePitch:!1};class Ni{constructor(e,r){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.mousedown=e=>{this.startMouse(t.e({},e,{ctrlKey:!0,preventDefault:()=>e.preventDefault()}),o.mousePos(this.element,e)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.moveMouse(e,o.mousePos(this.element,e))},this.mouseup=e=>{this.mouseRotate.dragEnd(e),this.mousePitch&&this.mousePitch.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.startTouch(e,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.moveTouch(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const i=e.dragRotate._mouseRotate.getClickTolerance(),a=e.dragRotate._mousePitch.getClickTolerance();this.element=r,this.mouseRotate=Kn({clickTolerance:i,enable:!0}),this.touchRotate=(e=>{let{enable:t,clickTolerance:r,bearingDegreesPerPixelMoved:n=.8}=e;const i=new Xn;return new Wn({clickTolerance:r,move:(e,t)=>({bearingDelta:(t.x-e.x)*n}),moveStateManager:i,enable:t,assignEvents:Fi})})({clickTolerance:i,enable:!0}),this.map=e,n&&(this.mousePitch=Jn({clickTolerance:a,enable:!0}),this.touchPitch=(e=>{let{enable:t,clickTolerance:r,pitchDegreesPerPixelMoved:n=-.5}=e;const i=new Xn;return new Wn({clickTolerance:r,move:(e,t)=>({pitchDelta:(t.y-e.y)*n}),moveStateManager:i,enable:t,assignEvents:Fi})})({clickTolerance:a,enable:!0})),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMouse(e,t){this.mouseRotate.dragStart(e,t),this.mousePitch&&this.mousePitch.dragStart(e,t),o.disableDrag()}startTouch(e,t){this.touchRotate.dragStart(e,t),this.touchPitch&&this.touchPitch.dragStart(e,t),o.disableDrag()}moveMouse(e,t){const r=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.mousePitch){const{pitchDelta:n}=this.mousePitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}moveTouch(e,t){const r=this.map,{bearingDelta:n}=this.touchRotate.dragMove(e,t)||{};if(n&&r.setBearing(r.getBearing()+n),this.touchPitch){const{pitchDelta:n}=this.touchPitch.dragMove(e,t)||{};n&&r.setPitch(r.getPitch()+n)}}off(){const e=this.element;o.removeEventListener(e,"mousedown",this.mousedown),o.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}let Ui;function Vi(e,r,n){const i=new t.N(e.lng,e.lat);if(e=new t.N(e.lng,e.lat),r){const i=new t.N(e.lng-360,e.lat),a=new t.N(e.lng+360,e.lat),o=n.locationPoint(e).distSqr(r);n.locationPoint(i).distSqr(r)<o?e=i:n.locationPoint(a).distSqr(r)<o&&(e=a)}for(;Math.abs(e.lng-n.center.lng)>180;){const t=n.locationPoint(e);if(t.x>=0&&t.y>=0&&t.x<=n.width&&t.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e.lng!==i.lng&&n.locationPoint(e).y>n.height/2-n.getHorizon()?e:i}const qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Hi(e,t,r){const n=e.classList;for(const i in qi)n.remove(`maplibregl-${r}-anchor-${i}`);n.add(`maplibregl-${r}-anchor-${t}`)}class Gi extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=e=>{const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{var t;if(!this._map)return;const r=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==e?void 0:e.type)||"render"===(null==e?void 0:e.type)&&!r)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Vi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${n}`),a.frameAsync(new AbortController).then((()=>{this._updateOpacity(e&&"moveend"===e.type)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){const t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.k("dragstart"))),this.fire(new t.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.k("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==e?void 0:e.opacity,null==e?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");const r=o.createNS("http://www.w3.org/2000/svg","svg"),n=41,i=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${n}px`),r.setAttributeNS(null,"width",`${i}px`),r.setAttributeNS(null,"viewBox",`0 0 ${i} ${n}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const e of c){const t=o.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),l.appendChild(t)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),u.appendChild(h);const p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");const d=o.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),p.appendChild(d);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#FFFFFF"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962"),m.appendChild(g),m.appendChild(y),s.appendChild(l),s.appendChild(u),s.appendChild(p),s.appendChild(f),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",n*this._scale+"px"),r.setAttributeNS(null,"width",i*this._scale+"px"),this._element.appendChild(r),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),Hi(this._element,this._anchor,"marker"),e&&e.className)for(const t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,r=13.5,n=Math.abs(r)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[n,-1*(t-r+n)],"bottom-right":[-n,-1*(t-r+n)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];var r,n;if(!(null===(r=this._map)||void 0===r?void 0:r.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const i=this._map,a=i.terrain.depthAtPoint(this._pos),o=i.terrain.getElevationForLngLatZoom(this._lngLat,i.transform.tileZoom);if(i.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);const s=-this._offset.y/i.transform._pixelPerMeter,l=Math.sin(i.getPitch()*Math.PI/180)*s,c=i.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),u=i.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null===(n=this._popup)||void 0===n?void 0:n.isOpen())&&u&&this._popup.remove(),this._element.style.opacity=u?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return void 0===e&&void 0===t&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}const Wi={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let $i=0,Zi=!1;const Xi={maxWidth:100,unit:"metric"};function Yi(e,t,r){const n=r&&r.maxWidth||100,i=e._container.clientHeight/2,a=e.unproject([0,i]),o=e.unproject([n,i]),s=a.distanceTo(o);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?Ki(t,n,r/5280,e._getUIString("ScaleControl.Miles")):Ki(t,n,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?Ki(t,n,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?Ki(t,n,s/1e3,e._getUIString("ScaleControl.Kilometers")):Ki(t,n,s,e._getUIString("ScaleControl.Meters"))}function Ki(e,t,r,n){const i=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(i/r)+"px",e.innerHTML=`${i}&nbsp;${n}`}const Ji={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ea(e){if(e){if("number"==typeof e){const r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(r,r),"top-right":new t.P(-r,r),bottom:new t.P(0,-e),"bottom-left":new t.P(r,-r),"bottom-right":new t.P(-r,-r),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){const r=t.P.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e["top-left"]||[0,0]),"top-right":t.P.convert(e["top-right"]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e["bottom-left"]||[0,0]),"bottom-right":t.P.convert(e["bottom-right"]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return ea(new t.P(0,0))}const ta=r;e.AJAXError=t.bh,e.Evented=t.E,e.LngLat=t.N,e.MercatorCoordinate=t.Z,e.Point=t.P,e.addProtocol=t.bi,e.config=t.a,e.removeProtocol=t.bj,e.AttributionControl=Ai,e.BoxZoomHandler=Un,e.CanvasSource=te,e.CooperativeGesturesHandler=xi,e.DoubleClickZoomHandler=di,e.DragPanHandler=gi,e.DragRotateHandler=yi,e.EdgeInsets=wn,e.FullscreenControl=class extends t.E{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const e=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=K,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new t.N(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,i=this._map.getBearing(),a=t.e({bearing:i},this.options.fitBoundsOptions),o=W.fromLngLat(r,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new t.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Zi)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Gi({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Gi({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(e=>{e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.k("trackuserlocationend")),this.fire(new t.k("userlocationlostfocus")))}))}},this.options=t.e({},Wi,e)}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function*(){if(void 0!==Ui&&!e)return Ui;if(void 0===window.navigator.permissions)return Ui=!!window.navigator.geolocation,Ui;try{const e=yield window.navigator.permissions.query({name:"geolocation"});Ui="denied"!==e.state}catch(t){Ui=!!window.navigator.geolocation}return Ui}()}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,$i=0,Zi=!1}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const e=this._map.getBounds(),t=e.getSouthEast(),r=e.getNorthEast(),n=t.distanceTo(r),i=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${i}px`,this._circleElement.style.height=`${i}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":$i--,Zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.k("trackuserlocationstart")),this.fire(new t.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),$i++,$i>1?(e={maximumAge:6e5,timeout:0},Zi=!0):(e=this.options.positionOptions,Zi=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.Hash=An,e.ImageSource=Q,e.KeyboardHandler=ci,e.LngLatBounds=W,e.LogoControl=Mi,e.Map=class extends Ti{constructor(e){t.bf.mark(t.bg.create);const r=Object.assign(Object.assign({},ji),e);if(null!=r.minZoom&&null!=r.maxZoom&&r.minZoom>r.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=r.minPitch&&null!=r.maxPitch&&r.minPitch>r.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=r.minPitch&&r.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=r.maxPitch&&r.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Tn(r.minZoom,r.maxZoom,r.minPitch,r.maxPitch,r.renderWorldCopies),{bearingSnap:r.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ei,this._controls=[],this._mapId=t.a4(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.k("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.k("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=r.interactive,this._maxTileCacheSize=r.maxTileCacheSize,this._maxTileCacheZoomLevels=r.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===r.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===r.preserveDrawingBuffer,this._antialias=!0===r.antialias,this._trackResize=!0===r.trackResize,this._bearingSnap=r.bearingSnap,this._refreshExpiredTiles=!0===r.refreshExpiredTiles,this._fadeDuration=r.fadeDuration,this._crossSourceCollisions=!0===r.crossSourceCollisions,this._collectResourceTiming=!0===r.collectResourceTiming,this._locale=Object.assign(Object.assign({},Ri),r.locale),this._clickTolerance=r.clickTolerance,this._overridePixelRatio=r.pixelRatio,this._maxCanvasSize=r.maxCanvasSize,this.transformCameraUpdate=r.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===r.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=d.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(r.transformRequest),"string"==typeof r.container){if(this._container=document.getElementById(r.container),!this._container)throw new Error(`Container '${r.container}' not found.`)}else{if(!(r.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=r.container}if(r.maxBounds&&this.setMaxBounds(r.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))).on("moveend",(()=>this._update(!1))).on("zoom",(()=>this._update(!0))).on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})).once("idle",(()=>{this._idleTriggered=!0})),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let e=!1;const t=Sn((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{e?t(r):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new ki(this,r),this._hash=r.hash&&new An("string"==typeof r.hash&&r.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:r.center,zoom:r.zoom,bearing:r.bearing,pitch:r.pitch}),r.bounds&&(this.resize(),this.fitBounds(r.bounds,t.e({},r.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=r.localIdeographFontFamily,this._validateStyle=r.validateStyle,r.style&&this.setStyle(r.style,{localIdeographFontFamily:r.localIdeographFontFamily}),r.attributionControl&&this.addControl(new Ai("boolean"==typeof r.attributionControl?void 0:r.attributionControl)),r.maplibreLogo&&this.addControl(new Mi,r.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.k(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.k(`${e.dataType}dataloading`,e))})),this.on("dataabort",(e=>{this.fire(new t.k("sourcedataabort",e))}))}_getMapId(){return this._mapId}addControl(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const n=e.onAdd(this);this._controls.push(e);const i=this._controlPositions[r];return-1!==r.indexOf("bottom")?i.insertBefore(n,i.firstChild):i.appendChild(n),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,r,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,r,n)}resize(e){var r;const n=this._containerDimensions(),i=n[0],a=n[1],o=this._getClampedPixelRatio(i,a);if(this._resizeCanvas(i,a,o),this.painter.resize(i,a,o),this.painter.overLimit()){const e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];const t=this._getClampedPixelRatio(i,a);this._resizeCanvas(i,a,t),this.painter.resize(i,a,t)}this.transform.resize(i,a),null===(r=this._requestedCameraState)||void 0===r||r.resize(i,a);const s=!this._moving;return s&&(this.stop(),this.fire(new t.k("movestart",e)).fire(new t.k("move",e))),this.fire(new t.k("resize",e)),s&&this.fire(new t.k("moveend",e)),this}_getClampedPixelRatio(e,t){const{0:r,1:n}=this._maxCanvasSize,i=this.getPixelRatio(),a=e*i,o=t*i;return Math.min(a>r?r/a:1,o>n?n/o:1)*i}getPixelRatio(){var e;return null!==(e=this._overridePixelRatio)&&void 0!==e?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(W.convert(e)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(e){return this.transform.locationPoint(t.N.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.pointLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e))),o=0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[];o.length?n||(n=!0,r.call(this,new Rn(e,this,i.originalEvent,{features:o}))):n=!1};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:()=>{n=!1}}}}if("mouseleave"===e||"mouseout"===e){let n=!1;const i=i=>{const a=t.filter((e=>this.getLayer(e)));(0!==a.length?this.queryRenderedFeatures(i.point,{layers:a}):[]).length?n=!0:n&&(n=!1,r.call(this,new Rn(e,this,i.originalEvent)))},a=t=>{n&&(n=!1,r.call(this,new Rn(e,this,t.originalEvent)))};return{layers:t,listener:r,delegates:{mousemove:i,mouseout:a}}}{const n=e=>{const n=t.filter((e=>this.getLayer(e))),i=0!==n.length?this.queryRenderedFeatures(e.point,{layers:n}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:n}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners||!this._delegatedListeners[e])return;const n=this._delegatedListeners[e];for(let i=0;i<n.length;i++){const e=n[i];if(e.listener===r&&e.layers.length===t.length&&e.layers.every((e=>t.includes(e)))){for(const t in e.delegates)this.off(t,e.delegates[t]);return void n.splice(i,1)}}}on(e,t,r){if(void 0===r)return super.on(e,t);const n=this._createDelegatedListener(e,"string"==typeof t?[t]:t,r);this._saveDelegatedListener(e,n);for(const i in n.delegates)this.on(i,n.delegates[i]);return this}once(e,t,r){var n=this;if(void 0===r)return super.once(e,t);const i="string"==typeof t?[t]:t,a=this._createDelegatedListener(e,i,r);for(const o in a.delegates){const t=a.delegates[o];a.delegates[o]=function(){n._removeDelegatedListener(e,i,r),t(...arguments)}}this._saveDelegatedListener(e,a);for(const o in a.delegates)this.once(o,a.delegates[o]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._removeDelegatedListener(e,"string"==typeof t?[t]:t,r),this)}queryRenderedFeatures(e,r){if(!this.style)return[];let n;const i=e instanceof t.P||Array.isArray(e),a=i?e:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(i?{}:e)||{},a instanceof t.P||"number"==typeof a[0])n=[t.P.convert(a)];else{const e=t.P.convert(a[0]),r=t.P.convert(a[1]);n=[e,new t.P(r.x,e.y),r,new t.P(e.x,r.y),e]}return this.style.queryRenderedFeatures(n,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,r){return!1!==(r=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(e,t)));const r=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new pt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new pt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){if("string"==typeof e){const n=this._requestManager.transformRequest(e,"Style");t.h(n,new AbortController).then((e=>{this._updateDiff(e.data,r)})).catch((e=>{e&&this.fire(new t.j(e))}))}else"object"==typeof e&&this._updateDiff(e,r)}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(n){t.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){const r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.j(new Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){const r=this.style.sourceCaches[e.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&r.reload();for(const n in this.style._layers){const r=this.style._layers[n];"hillshade"===r.type&&r.source===e.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Li(this.painter,r,e),this.painter.renderToTexture=new Oi(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=t=>{"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new t.k("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!==(t=null===(e=this.terrain)||void 0===e?void 0:e.options)&&void 0!==t?t:null}areTilesLoaded(){const e=this.style&&this.style.sourceCaches;for(const t in e){const r=e[t]._tiles;for(const e in r){const t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(e,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{pixelRatio:i=1,sdf:o=!1,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h}=n;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||t.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new t.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:n,height:a,data:p}=r,d=r;return this.style.addImage(e,{data:new t.R({width:n,height:a},new Uint8Array(p)),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0,userImage:d}),d.onAdd&&d.onAdd(this,e),this}}{const{width:n,height:p,data:d}=a.getImageData(r);this.style.addImage(e,{data:new t.R({width:n,height:p},d),pixelRatio:i,stretchX:s,stretchY:l,content:c,textFitWidth:u,textFitHeight:h,sdf:o,version:0})}}updateImage(e,r){const n=this.style.getImage(e);if(!n)return this.fire(new t.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const i=r instanceof HTMLImageElement||t.b(r)?a.getImageData(r):r,{width:o,height:s,data:l}=i;if(void 0===o||void 0===s)return this.fire(new t.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==n.data.width||s!==n.data.height)return this.fire(new t.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(r instanceof HTMLImageElement||t.b(r));return n.data.replace(l,c),this.style.updateImage(e,n),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.j(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return d.getImage(this._requestManager.transformRequest(e,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setPaintProperty(e,t,r,n),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.style.setLayoutProperty(e,t,r,n),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e){return this._lazyInitEmptyStyle(),this.style.setSky(e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){const e=this._container;e.classList.add("maplibregl-map");const t=this._canvasContainer=o.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),n=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],n);const i=this._controlContainer=o.create("div","maplibregl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{a[e]=o.create("div",`maplibregl-ctrl-${e} `,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const e={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{t={requestedAttributes:e},r&&(t.statusMessage=r.statusMessage,t.type=r.type)}),{once:!0});const r=this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e);if(!r){const e="Failed to initialize WebGL";throw t?(t.message=e,new Error(JSON.stringify(t))):new Error(e)}this.painter=new xn(r,this.transform),s.testSupport(r)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){const r=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const e=this.transform.zoom,i=a.now();this.style.zoomHistory.update(e,i);const o=new t.z(e,{now:i,fadeDuration:r,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),s=o.crossFadingFactor();1===s&&s===this._crossFadingFactor||(n=!0,this._crossFadingFactor=s),this.style.update(o)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,r,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:r,showPadding:this.showPadding}),this.fire(new t.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.bf.mark(t.bg.load),this.fire(new t.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const i=this._sourcesDirty||this._styleDirty||this._placementDirty;return i||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.k("idle")),!this._loaded||this._fullyLoaded||i||(this._fullyLoaded=!0,t.bf.mark(t.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),d.removeThrottleControl(this._imageQueueHandle),null===(e=this._resizeObserver)||void 0===e||e.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==r?void 0:r.loseContext)&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),t.bf.clearMetrics(),this._removed=!0,this.fire(new t.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,a.frameAsync(this._frameRequest).then((e=>{t.bf.frame(e),this._frameRequest=null,this._render(e)})).catch((()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return Di}getCameraTargetElevation(){return this.transform.elevation}},e.MapMouseEvent=Rn,e.MapTouchEvent=Dn,e.MapWheelEvent=jn,e.Marker=Gi,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{const e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{const e=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=e},this._setButtonTitle=(e,t)=>{const r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=t.e({},Bi,e),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ni(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){const r=o.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},e.Popup=class extends t.E{constructor(e){super(),this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var t;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const e of this.options.className.split(" "))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Vi(this._lngLat,this._flatPos,this._map.transform):null===(t=this._lngLat)||void 0===t?void 0:t.wrap(),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let n=this.options.anchor;const i=ea(this.options.offset);if(!n){const e=this._container.offsetWidth,t=this._container.offsetHeight;let a;a=r.y+i.bottom.y<t?["top"]:r.y>this._map.transform.height-t?["bottom"]:[],r.x<e/2?a.push("left"):r.x>this._map.transform.width-e/2&&a.push("right"),n=0===a.length?"bottom":a.join("-")}let a=r.add(i[n]);this.options.subpixelPositioning||(a=a.round()),o.setTransform(this._container,`${qi[n]} translate(${a.x}px,${a.y}px)`),Hi(this._container,n,"popup")},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(Ji),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.N.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),r=document.createElement("body");let n;for(r.innerHTML=e;n=r.firstChild,n;)t.appendChild(n);return this.setDOMContent(t)}getMaxWidth(){var e;return null===(e=this._container)||void 0===e?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(Qi);e&&e.focus()}},e.RasterDEMTileSource=Y,e.RasterTileSource=X,e.ScaleControl=class{constructor(e){this._onMove=()=>{Yi(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,Yi(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Xi),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=pi,e.Style=pt,e.TerrainControl=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=si,e.TwoFingersTouchRotateHandler=ai,e.TwoFingersTouchZoomHandler=ni,e.TwoFingersTouchZoomRotateHandler=vi,e.VectorTileSource=Z,e.VideoSource=ee,e.addSourceType=(e,r)=>t._(void 0,void 0,void 0,(function*(){if(ne(e))throw new Error(`A source type called "${e}" already exists.`);var t;t=r,re[e]=t})),e.clearPrewarmedResources=function(){const e=j;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(O),j=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return se().getRTLTextPluginStatus()},e.getVersion=function(){return ta},e.getWorkerCount=function(){return R.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return U().broadcast("IS",e)},e.prewarm=function(){B().acquire(O)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return se().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){R.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}})),e},"object"===typeof e&&"undefined"!==typeof t?t.exports=a():(n="undefined"!==typeof globalThis?globalThis:n||self).maplibregl=a()}}),i_=p({"src/plots/map/layers.js"(e,t){var r=st(),n=At().sanitizeHTML,i=Kb(),a=Gb();function o(e,t){this.subplot=e,this.uid=e.uid+"-"+t,this.index=t,this.idSource="source-"+this.uid,this.idLayer=a.layoutLayerPrefix+this.uid,this.sourceType=null,this.source=null,this.layerType=null,this.below=null,this.visible=!1}var s=o.prototype;function l(e){if(!e.visible)return!1;var t=e.source;if(Array.isArray(t)&&t.length>0){for(var n=0;n<t.length;n++)if("string"!==typeof t[n]||0===t[n].length)return!1;return!0}return r.isPlainObject(t)||"string"===typeof t&&t.length>0}function c(e){var t={},n={};switch(e.type){case"circle":r.extendFlat(n,{"circle-radius":e.circle.radius,"circle-color":e.color,"circle-opacity":e.opacity});break;case"line":r.extendFlat(n,{"line-width":e.line.width,"line-color":e.color,"line-opacity":e.opacity,"line-dasharray":e.line.dash});break;case"fill":r.extendFlat(n,{"fill-color":e.color,"fill-outline-color":e.fill.outlinecolor,"fill-opacity":e.opacity});break;case"symbol":var a=e.symbol,o=i(a.textposition,a.iconsize);r.extendFlat(t,{"icon-image":a.icon+"-15","icon-size":a.iconsize/10,"text-field":a.text,"text-size":a.textfont.size,"text-anchor":o.anchor,"text-offset":o.offset,"symbol-placement":a.placement}),r.extendFlat(n,{"icon-color":e.color,"text-color":a.textfont.color,"text-opacity":e.opacity});break;case"raster":r.extendFlat(n,{"raster-fade-duration":0,"raster-opacity":e.opacity})}return{layout:t,paint:n}}s.update=function(e){this.visible?this.needsNewImage(e)?this.updateImage(e):this.needsNewSource(e)?(this.removeLayer(),this.updateSource(e),this.updateLayer(e)):this.needsNewLayer(e)?this.updateLayer(e):this.updateStyle(e):(this.updateSource(e),this.updateLayer(e)),this.visible=l(e)},s.needsNewImage=function(e){return this.subplot.map.getSource(this.idSource)&&"image"===this.sourceType&&"image"===e.sourcetype&&(this.source!==e.source||JSON.stringify(this.coordinates)!==JSON.stringify(e.coordinates))},s.needsNewSource=function(e){return this.sourceType!==e.sourcetype||JSON.stringify(this.source)!==JSON.stringify(e.source)||this.layerType!==e.type},s.needsNewLayer=function(e){return this.layerType!==e.type||this.below!==this.subplot.belowLookup["layout-"+this.index]},s.lookupBelow=function(){return this.subplot.belowLookup["layout-"+this.index]},s.updateImage=function(e){this.subplot.map.getSource(this.idSource).updateImage({url:e.source,coordinates:e.coordinates});var t=this.findFollowingMapLayerId(this.lookupBelow());null!==t&&this.subplot.map.moveLayer(this.idLayer,t)},s.updateSource=function(e){var t=this.subplot.map;if(t.getSource(this.idSource)&&t.removeSource(this.idSource),this.sourceType=e.sourcetype,this.source=e.source,l(e)){var r=function(e){var t,r=e.sourcetype,i=e.source,a={type:r};return"geojson"===r?t="data":"vector"===r?t="string"===typeof i?"url":"tiles":"raster"===r?(t="tiles",a.tileSize=256):"image"===r&&(t="url",a.coordinates=e.coordinates),a[t]=i,e.sourceattribution&&(a.attribution=n(e.sourceattribution)),a}(e);t.addSource(this.idSource,r)}},s.findFollowingMapLayerId=function(e){if("traces"===e)for(var t=this.subplot.getMapLayers(),r=0;r<t.length;r++){var n=t[r].id;if("string"===typeof n&&0===n.indexOf(a.traceLayerPrefix)){e=n;break}}return e},s.updateLayer=function(e){var t=this.subplot,r=c(e),n=this.lookupBelow(),i=this.findFollowingMapLayerId(n);this.removeLayer(),l(e)&&t.addLayer({id:this.idLayer,source:this.idSource,"source-layer":e.sourcelayer||"",type:e.type,minzoom:e.minzoom,maxzoom:e.maxzoom,layout:r.layout,paint:r.paint},i),this.layerType=e.type,this.below=n},s.updateStyle=function(e){if(l(e)){var t=c(e);this.subplot.setOptions(this.idLayer,"setLayoutProperty",t.layout),this.subplot.setOptions(this.idLayer,"setPaintProperty",t.paint)}},s.removeLayer=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer)},s.dispose=function(){var e=this.subplot.map;e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),e.getSource(this.idSource)&&e.removeSource(this.idSource)},t.exports=function(e,t,r){var n=new o(e,t);return n.update(r),n}}}),a_=p({"src/plots/map/map.js"(e,t){var r=n_(),n=st(),i=og(),a=Ve(),o=nr(),s=hr(),l=zr(),c=Or(),u=c.drawMode,h=c.selectMode,p=Mn().prepSelect,d=Mn().clearOutline,f=Mn().clearSelectionsCache,m=Mn().selectOnClick,g=Gb(),y=i_();function v(e,t){this.id=t,this.gd=e;var r=e._fullLayout,n=e._context;this.container=r._glcontainer.node(),this.isStatic=n.staticPlot,this.uid=r._uid+"-"+this.id,this.div=null,this.xaxis=null,this.yaxis=null,this.createFramework(r),this.map=null,this.styleObj=null,this.traceHash={},this.layerList=[],this.belowLookup={},this.dragging=!1,this.wheeling=!1}var x=v.prototype;x.plot=function(e,t,r){var n,i=this;n=i.map?new Promise((function(r,n){i.updateMap(e,t,r,n)})):new Promise((function(r,n){i.createMap(e,t,r,n)})),r.push(n)},x.createMap=function(e,t,n,a){var o=this,s=t[o.id],l=o.styleObj=_(s.style),c=s.bounds,u=c?[[c.west,c.south],[c.east,c.north]]:null,h=o.map=new r.Map({container:o.div,style:l.style,center:w(s.center),zoom:s.zoom,bearing:s.bearing,pitch:s.pitch,maxBounds:u,interactive:!o.isStatic,preserveDrawingBuffer:o.isStatic,doubleClickZoom:!1,boxZoom:!1,attributionControl:!1}).addControl(new r.AttributionControl({compact:!0})),p={};h.on("styleimagemissing",(function(e){var t=e.id;if(!p[t]&&t.includes("-15")){p[t]=!0;var r=new Image(15,15);r.onload=function(){h.addImage(t,r)},r.crossOrigin="Anonymous",r.src="https://unpkg.com/maki@2.1.0/icons/"+t+".svg"}})),h.setTransformRequest((function(e){return{url:e=(e=(e=e.replace("https://fonts.openmaptiles.org/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://tiles.basemaps.cartocdn.com/fonts/Open Sans Extrabold","https://fonts.openmaptiles.org/Open Sans Extra Bold")).replace("https://fonts.openmaptiles.org/Open Sans Regular,Arial Unicode MS Regular","https://fonts.openmaptiles.org/Klokantech Noto Sans Regular")}})),h._canvas.style.left="0px",h._canvas.style.top="0px",o.rejectOnError(a),o.isStatic||o.initFx(e,t);var d=[];d.push(new Promise((function(e){h.once("load",e)}))),d=d.concat(i.fetchTraceGeoData(e)),Promise.all(d).then((function(){o.fillBelowLookup(e,t),o.updateData(e),o.updateLayout(t),o.resolveOnRender(n)})).catch(a)},x.updateMap=function(e,t,r,n){var a=this,o=a.map,s=t[this.id];a.rejectOnError(n);var l=[],c=_(s.style);JSON.stringify(a.styleObj)!==JSON.stringify(c)&&(a.styleObj=c,o.setStyle(c.style),a.traceHash={},l.push(new Promise((function(e){o.once("styledata",e)})))),l=l.concat(i.fetchTraceGeoData(e)),Promise.all(l).then((function(){a.fillBelowLookup(e,t),a.updateData(e),a.updateLayout(t),a.resolveOnRender(r)})).catch(n)},x.fillBelowLookup=function(e,t){var r,n,i=t[this.id].layers,a=this.belowLookup={},o=!1;for(r=0;r<e.length;r++){var s=e[r][0].trace,l=s._module;"string"===typeof s.below?n=s.below:l.getBelow&&(n=l.getBelow(s,this)),""===n&&(o=!0),a["trace-"+s.uid]=n||""}for(r=0;r<i.length;r++){var c=i[r];n="string"===typeof c.below?c.below:o?"traces":"",a["layout-"+r]=n}var u,h,p={};for(u in a)p[n=a[u]]?p[n].push(u):p[n]=[u];for(n in p){var d=p[n];if(d.length>1)for(r=0;r<d.length;r++)0===(u=d[r]).indexOf("trace-")?(h=u.split("trace-")[1],this.traceHash[h]&&(this.traceHash[h].below=null)):0===u.indexOf("layout-")&&(h=u.split("layout-")[1],this.layerList[h]&&(this.layerList[h].below=null))}};var b={choroplethmap:0,densitymap:1,scattermap:2};function _(e){var t={};return n.isPlainObject(e)?(t.id=e.id,t.style=e):"string"===typeof e?(t.id=e,g.stylesMap[e]?t.style=g.stylesMap[e]:t.style=e):(t.id=g.styleValueDflt,t.style=function(e){return g.styleUrlPrefix+e+"-"+g.styleUrlSuffix}(g.styleValueDflt)),t.transition={duration:0,delay:0},t}function w(e){return[e.lon,e.lat]}x.updateData=function(e){var t,r,n,i,a=this.traceHash,o=e.slice().sort((function(e,t){return b[e[0].trace.type]-b[t[0].trace.type]}));for(n=0;n<o.length;n++){var s=o[n],l=!1;(t=a[(r=s[0].trace).uid])&&(t.type===r.type?(t.update(s),l=!0):t.dispose()),!l&&r._module&&(a[r.uid]=r._module.plot(this,s))}var c=Object.keys(a);e:for(n=0;n<c.length;n++){var u=c[n];for(i=0;i<e.length;i++)if(u===(r=e[i][0].trace).uid)continue e;(t=a[u]).dispose(),delete a[u]}},x.updateLayout=function(e){var t=this.map,r=e[this.id];this.dragging||this.wheeling||(t.setCenter(w(r.center)),t.setZoom(r.zoom),t.setBearing(r.bearing),t.setPitch(r.pitch)),this.updateLayers(e),this.updateFramework(e),this.updateFx(e),this.map.resize(),this.gd._context._scrollZoom.map?t.scrollZoom.enable():t.scrollZoom.disable()},x.resolveOnRender=function(e){var t=this.map;t.on("render",(function r(){t.loaded()&&(t.off("render",r),setTimeout(e,10))}))},x.rejectOnError=function(e){var t=this.map;function r(){e(new Error(g.mapOnErrorMsg))}t.once("error",r),t.once("style.error",r),t.once("source.error",r),t.once("tile.error",r),t.once("layer.error",r)},x.createFramework=function(e){var t=this,r=t.div=document.createElement("div");r.id=t.uid,r.style.position="absolute",t.container.appendChild(r),t.xaxis={_id:"x",c2p:function(e){return t.project(e).x}},t.yaxis={_id:"y",c2p:function(e){return t.project(e).y}},t.updateFramework(e),t.mockAxis={type:"linear",showexponent:"all",exponentformat:"B"},o.setConvert(t.mockAxis,e)},x.initFx=function(e,t){var r=this,n=r.gd,i=r.map;function o(){l.loneUnhover(t._hoverlayer)}function s(){var e=r.getView();n.emit("plotly_relayouting",r.getViewEditsWithDerived(e))}i.on("moveend",(function(e){if(r.map){var t=n._fullLayout;if(e.originalEvent||r.wheeling){var i=t[r.id];a.call("_storeDirectGUIEdit",n.layout,t._preGUI,r.getViewEdits(i));var o=r.getView();i._input.center=i.center=o.center,i._input.zoom=i.zoom=o.zoom,i._input.bearing=i.bearing=o.bearing,i._input.pitch=i.pitch=o.pitch,n.emit("plotly_relayout",r.getViewEditsWithDerived(o))}e.originalEvent&&"mouseup"===e.originalEvent.type?r.dragging=!1:r.wheeling&&(r.wheeling=!1),t&&t._rehover&&t._rehover()}})),i.on("wheel",(function(){r.wheeling=!0})),i.on("mousemove",(function(e){var t=r.div.getBoundingClientRect(),a=[e.originalEvent.offsetX,e.originalEvent.offsetY];e.target.getBoundingClientRect=function(){return t},r.xaxis.p2c=function(){return i.unproject(a).lng},r.yaxis.p2c=function(){return i.unproject(a).lat},n._fullLayout._rehover=function(){n._fullLayout._hoversubplot===r.id&&n._fullLayout[r.id]&&l.hover(n,e,r.id)},l.hover(n,e,r.id),n._fullLayout._hoversubplot=r.id})),i.on("dragstart",(function(){r.dragging=!0,o()})),i.on("zoomstart",o),i.on("mouseout",(function(){n._fullLayout._hoversubplot=null})),i.on("drag",s),i.on("zoom",s),i.on("dblclick",(function(){var e=n._fullLayout[r.id];a.call("_storeDirectGUIEdit",n.layout,n._fullLayout._preGUI,r.getViewEdits(e));var t=r.viewInitial;i.setCenter(w(t.center)),i.setZoom(t.zoom),i.setBearing(t.bearing),i.setPitch(t.pitch);var o=r.getView();e._input.center=e.center=o.center,e._input.zoom=e.zoom=o.zoom,e._input.bearing=e.bearing=o.bearing,e._input.pitch=e.pitch=o.pitch,n.emit("plotly_doubleclick",null),n.emit("plotly_relayout",r.getViewEditsWithDerived(o))})),r.clearOutline=function(){f(r.dragOptions),d(r.dragOptions.gd)},r.onClickInPanFn=function(e){return function(t){var i=n._fullLayout.clickmode;i.indexOf("select")>-1&&m(t.originalEvent,n,[r.xaxis],[r.yaxis],r.id,e),i.indexOf("event")>-1&&l.click(n,t.originalEvent)}}},x.updateFx=function(e){var t=this,r=t.map,i=t.gd;if(!t.isStatic){var a,o=e.dragmode;a=function(e,r){r.isRect?(e.range={})[t.id]=[c([r.xmin,r.ymin]),c([r.xmax,r.ymax])]:(e.lassoPoints={})[t.id]=r.map(c)};var l=t.dragOptions;t.dragOptions=n.extendDeep(l||{},{dragmode:e.dragmode,element:t.div,gd:i,plotinfo:{id:t.id,domain:e[t.id].domain,xaxis:t.xaxis,yaxis:t.yaxis,fillRangeItems:a},xaxes:[t.xaxis],yaxes:[t.yaxis],subplot:t.id}),r.off("click",t.onClickInPanHandler),h(o)||u(o)?(r.dragPan.disable(),r.on("zoomstart",t.clearOutline),t.dragOptions.prepFn=function(e,r,n){p(e,r,n,t.dragOptions,o)},s.init(t.dragOptions)):(r.dragPan.enable(),r.off("zoomstart",t.clearOutline),t.div.onmousedown=null,t.div.ontouchstart=null,t.div.removeEventListener("touchstart",t.div._ontouchstart),t.onClickInPanHandler=t.onClickInPanFn(t.dragOptions),r.on("click",t.onClickInPanHandler))}function c(e){var r=t.map.unproject(e);return[r.lng,r.lat]}},x.updateFramework=function(e){var t=e[this.id].domain,r=e._size,n=this.div.style;n.width=r.w*(t.x[1]-t.x[0])+"px",n.height=r.h*(t.y[1]-t.y[0])+"px",n.left=r.l+t.x[0]*r.w+"px",n.top=r.t+(1-t.y[1])*r.h+"px",this.xaxis._offset=r.l+t.x[0]*r.w,this.xaxis._length=r.w*(t.x[1]-t.x[0]),this.yaxis._offset=r.t+(1-t.y[1])*r.h,this.yaxis._length=r.h*(t.y[1]-t.y[0])},x.updateLayers=function(e){var t,r=e[this.id].layers,n=this.layerList;if(r.length!==n.length){for(t=0;t<n.length;t++)n[t].dispose();for(n=this.layerList=[],t=0;t<r.length;t++)n.push(y(this,t,r[t]))}else for(t=0;t<r.length;t++)n[t].update(r[t])},x.destroy=function(){this.map&&(this.map.remove(),this.map=null,this.container.removeChild(this.div))},x.toImage=function(){return this.map.stop(),this.map.getCanvas().toDataURL()},x.setOptions=function(e,t,r){for(var n in r)this.map[t](e,n,r[n])},x.getMapLayers=function(){return this.map.getStyle().layers},x.addLayer=function(e,t){var r=this.map;if("string"===typeof t){if(""===t)return void r.addLayer(e,t);for(var i=this.getMapLayers(),a=0;a<i.length;a++)if(t===i[a].id)return void r.addLayer(e,t);n.warn(["Trying to add layer with *below* value",t,"referencing a layer that does not exist","or that does not yet exist."].join(" "))}r.addLayer(e)},x.project=function(e){return this.map.project(new r.LngLat(e[0],e[1]))},x.getView=function(){var e=this.map,t=e.getCenter(),r={lon:t.lng,lat:t.lat},n=e.getCanvas(),i=parseInt(n.style.width),a=parseInt(n.style.height);return{center:r,zoom:e.getZoom(),bearing:e.getBearing(),pitch:e.getPitch(),_derived:{coordinates:[e.unproject([0,0]).toArray(),e.unproject([i,0]).toArray(),e.unproject([i,a]).toArray(),e.unproject([0,a]).toArray()]}}},x.getViewEdits=function(e){for(var t=this.id,r=["center","zoom","bearing","pitch"],n={},i=0;i<r.length;i++){var a=r[i];n[t+"."+a]=e[a]}return n},x.getViewEditsWithDerived=function(e){var t=this.id,r=this.getViewEdits(e);return r[t+"._derived"]=e._derived,r},t.exports=v}}),o_=p({"src/plots/map/layout_defaults.js"(e,t){var r=st(),n=qs(),i=Ft(),a=Wb();function o(e,t,r){r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch");var n=r("bounds.west"),a=r("bounds.east"),o=r("bounds.south"),l=r("bounds.north");void 0!==n&&void 0!==a&&void 0!==o&&void 0!==l||delete t.bounds,i(e,t,{name:"layers",handleItemDefaults:s}),t._input=e}function s(e,t){function n(n,i){return r.coerce(e,t,a.layers,n,i)}if(n("visible")){var i,o=n("sourcetype"),s="raster"===o||"image"===o;n("source"),n("sourceattribution"),"vector"===o&&n("sourcelayer"),"image"===o&&n("coordinates"),s&&(i="raster");var l=n("type",i);s&&"raster"!==l&&(l=t.type="raster",r.log("Source types *raster* and *image* must drawn *raster* layer type.")),n("below"),n("color"),n("opacity"),n("minzoom"),n("maxzoom"),"circle"===l&&n("circle.radius"),"line"===l&&(n("line.width"),n("line.dash")),"fill"===l&&n("fill.outlinecolor"),"symbol"===l&&(n("symbol.icon"),n("symbol.iconsize"),n("symbol.text"),r.coerceFont(n,"symbol.textfont",void 0,{noFontVariant:!0,noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0}),n("symbol.textposition"),n("symbol.placement"))}}t.exports=function(e,t,r){n(e,t,r,{type:"map",attributes:a,handleDefaults:o,partition:"y"})}}}),s_=p({"src/plots/map/index.js"(e){var t=st(),r=t.strTranslate,n=t.strScale,i=_t().getSubplotCalcData,a=Tt(),o=v(),s=Jt(),l=At(),c=a_(),u="map";e.name=u,e.attr="subplot",e.idRoot=u,e.idRegex=e.attrRegex=t.counterRegex(u),e.attributes={subplot:{valType:"subplotid",dflt:"map",editType:"calc"}},e.layoutAttributes=Wb(),e.supplyLayoutDefaults=o_(),e.plot=function(e){for(var r=e._fullLayout,n=e.calcdata,a=r._subplots[u],o=0;o<a.length;o++){var s=a[o],l=i(n,u,s),h=r[s],p=h._subplot;p||(p=new c(e,s),r[s]._subplot=p),p.viewInitial||(p.viewInitial={center:t.extendFlat({},h.center),zoom:h.zoom,bearing:h.bearing,pitch:h.pitch}),p.plot(l,r,e._promises)}},e.clean=function(e,t,r,n){for(var i=n._subplots[u]||[],a=0;a<i.length;a++){var o=i[a];!t[o]&&n[o]._subplot&&n[o]._subplot.destroy()}},e.toSVG=function(e){for(var t=e._fullLayout,i=t._subplots[u],c=t._size,h=0;h<i.length;h++){var p=t[i[h]],d=p.domain,f=p._subplot.toImage("png");t._glimages.append("svg:image").attr({xmlns:a.svg,"xlink:href":f,x:c.l+c.w*d.x[0],y:c.t+c.h*(1-d.y[1]),width:c.w*(d.x[1]-d.x[0]),height:c.h*(d.y[1]-d.y[0]),preserveAspectRatio:"none"});var m=o.select(p._subplot.div).select(".maplibregl-ctrl-attrib").text().replace("Improve this map",""),g=t._glimages.append("g"),y=g.append("text");y.text(m).classed("static-attribution",!0).attr({"font-size":12,"font-family":"Arial",color:"rgba(0, 0, 0, 0.75)","text-anchor":"end","data-unformatted":m});var v=s.bBox(y.node()),x=c.w*(d.x[1]-d.x[0]);if(v.width>x/2){var b=m.split("|").join("<br>");y.text(b).attr("data-unformatted",b).call(l.convertToTspans,e),v=s.bBox(y.node())}y.attr("transform",r(-3,8-v.height)),g.insert("rect",".static-attribution").attr({x:-v.width-6,y:-v.height-3,width:v.width+6,height:v.height+3,fill:"rgba(255, 255, 255, 0.75)"});var _=1;v.width+6>x&&(_=x/(v.width+6));var w=[c.l+c.w*d.x[1],c.t+c.h*(1-d.y[0])];g.attr("transform",r(w[0],w[1])+n(_))}},e.updateFx=function(e){for(var t=e._fullLayout,r=t._subplots[u],n=0;n<r.length;n++)t[r[n]]._subplot.updateFx(t)}}}),l_=p({"src/traces/scattermap/index.js"(e,t){t.exports={attributes:$b(),supplyDefaults:Xb(),colorbar:pi(),formatLabels:Yb(),calc:Xm(),plot:Qb(),hoverPoints:e_().hoverPoints,eventData:t_(),selectPoints:r_(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.update(t)},moduleType:"trace",name:"scattermap",basePlotModule:s_(),categories:["map","gl","symbols","showLegend","scatter-like"],meta:{}}}}),c_=p({"lib/scattermap.js"(e,t){t.exports=l_()}}),u_=p({"src/traces/choroplethmap/attributes.js"(e,t){var r=wg(),n=Lt(),i=Oe().hovertemplateAttrs,a=N(),o=R().extendFlat;t.exports=o({locations:{valType:"data_array",editType:"calc"},z:{valType:"data_array",editType:"calc"},geojson:{valType:"any",editType:"calc"},featureidkey:o({},r.featureidkey,{}),below:{valType:"string",editType:"plot"},text:r.text,hovertext:r.hovertext,marker:{line:{color:o({},r.marker.line.color,{editType:"plot"}),width:o({},r.marker.line.width,{editType:"plot"}),editType:"calc"},opacity:o({},r.marker.opacity,{editType:"plot"}),editType:"calc"},selected:{marker:{opacity:o({},r.selected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},unselected:{marker:{opacity:o({},r.unselected.marker.opacity,{editType:"plot"}),editType:"plot"},editType:"plot"},hoverinfo:r.hoverinfo,hovertemplate:i({},{keys:["properties"]}),showlegend:o({},a.showlegend,{dflt:!1})},n("",{cLetter:"z",editTypeOverride:"calc"}))}}),h_=p({"src/traces/choroplethmap/defaults.js"(e,t){var r=st(),n=Vt(),i=u_();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("locations"),c=s("z"),u=s("geojson");r.isArrayOrTypedArray(l)&&l.length&&r.isArrayOrTypedArray(c)&&c.length&&("string"===typeof u&&""!==u||r.isPlainObject(u))?(s("featureidkey"),t._length=Math.min(l.length,c.length),s("below"),s("text"),s("hovertext"),s("hovertemplate"),s("marker.line.width")&&s("marker.line.color"),s("marker.opacity"),n(e,t,o,s,{prefix:"",cLetter:"z"}),r.coerceSelectionMarkerOpacity(t,s)):t.visible=!1}}}),p_=p({"src/traces/choroplethmap/convert.js"(e,t){var r=k(),n=st(),i=Wt(),a=Jt(),o=Qm().makeBlank,s=og();function l(e){var t,r=e[0].trace,i=r._opts;if(r.selectedpoints){for(var o=a.makeSelectedPointStyleFns(r),s=0;s<e.length;s++){var l=e[s];l.fOut&&(l.fOut.properties.mo2=o.selectedOpacityFn(l))}t={type:"identity",property:"mo2"}}else t=n.isArrayOrTypedArray(r.marker.opacity)?{type:"identity",property:"mo"}:r.marker.opacity;return n.extendFlat(i.fill.paint,{"fill-opacity":t}),n.extendFlat(i.line.paint,{"line-opacity":t}),i}t.exports={convert:function(e){var t=e[0].trace,a=!0===t.visible&&0!==t._length,c={layout:{visibility:"none"},paint:{}},u={layout:{visibility:"none"},paint:{}},h=t._opts={fill:c,line:u,geojson:o()};if(!a)return h;var p=s.extractTraceFeature(e);if(!p)return h;var d,f,m,g=i.makeColorScaleFuncFromTrace(t),y=t.marker,v=y.line||{};n.isArrayOrTypedArray(y.opacity)&&(d=function(e){var t=e.mo;return r(t)?+n.constrain(t,0,1):0}),n.isArrayOrTypedArray(v.color)&&(f=function(e){return e.mlc}),n.isArrayOrTypedArray(v.width)&&(m=function(e){return e.mlw});for(var x=0;x<e.length;x++){var b=e[x],_=b.fOut;if(_){var w=_.properties;w.fc=g(b.z),d&&(w.mo=d(b)),f&&(w.mlc=f(b)),m&&(w.mlw=m(b)),b.ct=w.ct,b._polygons=s.feature2polygons(_)}}var k=d?{type:"identity",property:"mo"}:y.opacity;return n.extendFlat(c.paint,{"fill-color":{type:"identity",property:"fc"},"fill-opacity":k}),n.extendFlat(u.paint,{"line-color":f?{type:"identity",property:"mlc"}:v.color,"line-width":m?{type:"identity",property:"mlw"}:v.width,"line-opacity":k}),c.layout.visibility="visible",u.layout.visibility="visible",h.geojson={type:"FeatureCollection",features:p},l(e),h},convertOnSelect:l}}}),d_=p({"src/traces/choroplethmap/plot.js"(e,t){var r=p_().convert,n=p_().convertOnSelect,i=Gb().traceLayerPrefix;function a(e,t){this.type="choroplethmap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["fill",i+t+"-fill"],["line",i+t+"-line"]],this.below=null}var o=a.prototype;o.update=function(e){this._update(r(e)),e[0].trace._glTrace=this},o.updateOnSelect=function(e){this._update(n(e))},o._update=function(e){var t=this.subplot,r=this.layerList,n=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(e.geojson),n!==this.below&&(this._removeLayers(),this._addLayers(e,n),this.below=n);for(var i=0;i<r.length;i++){var a=r[i],o=a[0],s=a[1],l=e[o];t.setOptions(s,"setLayoutProperty",l.layout),"visible"===l.layout.visibility&&t.setOptions(s,"setPaintProperty",l.paint)}},o._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},o._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},o.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,i=new a(e,n.uid),o=i.sourceId,s=r(t),l=i.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),i._addLayers(s,l),t[0].trace._glTrace=i,i}}}),f_=p({"src/traces/choroplethmap/index.js"(e,t){t.exports={attributes:u_(),supplyDefaults:h_(),colorbar:No(),calc:Tg(),plot:d_(),hoverPoints:Mg(),eventData:Eg(),selectPoints:Cg(),styleOnSelect:function(e,t){t&&t[0].trace._glTrace.updateOnSelect(t)},getBelow:function(e,t){for(var r=t.getMapLayers(),n=r.length-2;n>=0;n--){var i=r[n].id;if("string"===typeof i&&0===i.indexOf("water"))for(var a=n+1;a<r.length;a++)if("string"===typeof(i=r[a].id)&&-1===i.indexOf("plotly-"))return i}},moduleType:"trace",name:"choroplethmap",basePlotModule:s_(),categories:["map","gl","noOpacity","showLegend"],meta:{hr_name:"choropleth_map"}}}}),m_=p({"lib/choroplethmap.js"(e,t){t.exports=f_()}}),g_=p({"src/traces/densitymap/attributes.js"(e,t){var r=Lt(),n=Oe().hovertemplateAttrs,i=N(),a=$b(),o=R().extendFlat;t.exports=o({lon:a.lon,lat:a.lat,z:{valType:"data_array",editType:"calc"},radius:{valType:"number",editType:"plot",arrayOk:!0,min:1,dflt:30},below:{valType:"string",editType:"plot"},text:a.text,hovertext:a.hovertext,hoverinfo:o({},i.hoverinfo,{flags:["lon","lat","z","text","name"]}),hovertemplate:n(),showlegend:o({},i.showlegend,{dflt:!1})},r("",{cLetter:"z",editTypeOverride:"calc"}))}}),y_=p({"src/traces/densitymap/defaults.js"(e,t){var r=st(),n=Vt(),i=g_();t.exports=function(e,t,a,o){function s(n,a){return r.coerce(e,t,i,n,a)}var l=s("lon")||[],c=s("lat")||[],u=Math.min(l.length,c.length);u?(t._length=u,s("z"),s("radius"),s("below"),s("text"),s("hovertext"),s("hovertemplate"),n(e,t,o,s,{prefix:"",cLetter:"z"})):t.visible=!1}}}),v_=p({"src/traces/densitymap/calc.js"(e,t){var r=k(),n=st().isArrayOrTypedArray,i=T().BADNUM,a=Gt(),o=st()._;t.exports=function(e,t){for(var s=t._length,l=new Array(s),c=t.z,u=n(c)&&c.length,h=0;h<s;h++){var p=l[h]={},d=t.lon[h],f=t.lat[h];if(p.lonlat=r(d)&&r(f)?[+d,+f]:[i,i],u){var m=c[h];p.z=r(m)?m:i}}return a(e,t,{vals:u?c:[0,1],containerStr:"",cLetter:"z"}),s&&(l[0].t={labels:{lat:o(e,"lat:")+" ",lon:o(e,"lon:")+" "}}),l}}}),x_=p({"src/traces/densitymap/convert.js"(e,t){var r=k(),n=st(),i=q(),a=Wt(),o=T().BADNUM,s=Qm().makeBlank;t.exports=function(e){var t=e[0].trace,l=!0===t.visible&&0!==t._length,c=t._opts={heatmap:{layout:{visibility:"none"},paint:{}},geojson:s()};if(!l)return c;var u,h=[],p=t.z,d=t.radius,f=n.isArrayOrTypedArray(p)&&p.length,m=n.isArrayOrTypedArray(d);for(u=0;u<e.length;u++){var g=e[u],y=g.lonlat;if(y[0]!==o){var v={};if(f){var x=g.z;v.z=x!==o?x:0}m&&(v.r=r(d[u])&&d[u]>0?+d[u]:0),h.push({type:"Feature",geometry:{type:"Point",coordinates:y},properties:v})}}var b=a.extractOpts(t),_=b.reversescale?a.flipScale(b.colorscale):b.colorscale,w=_[0][1],k=["interpolate",["linear"],["heatmap-density"],0,i.opacity(w)<1?w:i.addOpacity(w,0)];for(u=1;u<_.length;u++)k.push(_[u][0],_[u][1]);var T=["interpolate",["linear"],["get","z"],b.min,0,b.max,1];return n.extendFlat(c.heatmap.paint,{"heatmap-weight":f?T:1/(b.max-b.min),"heatmap-color":k,"heatmap-radius":m?{type:"identity",property:"r"}:t.radius,"heatmap-opacity":t.opacity}),c.geojson={type:"FeatureCollection",features:h},c.heatmap.layout.visibility="visible",c}}}),b_=p({"src/traces/densitymap/plot.js"(e,t){var r=x_(),n=Gb().traceLayerPrefix;function i(e,t){this.type="densitymap",this.subplot=e,this.uid=t,this.sourceId="source-"+t,this.layerList=[["heatmap",n+t+"-heatmap"]],this.below=null}var a=i.prototype;a.update=function(e){var t=this.subplot,n=this.layerList,i=r(e),a=t.belowLookup["trace-"+this.uid];t.map.getSource(this.sourceId).setData(i.geojson),a!==this.below&&(this._removeLayers(),this._addLayers(i,a),this.below=a);for(var o=0;o<n.length;o++){var s=n[o],l=s[0],c=s[1],u=i[l];t.setOptions(c,"setLayoutProperty",u.layout),"visible"===u.layout.visibility&&t.setOptions(c,"setPaintProperty",u.paint)}},a._addLayers=function(e,t){for(var r=this.subplot,n=this.layerList,i=this.sourceId,a=0;a<n.length;a++){var o=n[a],s=o[0],l=e[s];r.addLayer({type:s,id:o[1],source:i,layout:l.layout,paint:l.paint},t)}},a._removeLayers=function(){for(var e=this.subplot.map,t=this.layerList,r=t.length-1;r>=0;r--)e.removeLayer(t[r][1])},a.dispose=function(){var e=this.subplot.map;this._removeLayers(),e.removeSource(this.sourceId)},t.exports=function(e,t){var n=t[0].trace,a=new i(e,n.uid),o=a.sourceId,s=r(t),l=a.below=e.belowLookup["trace-"+n.uid];return e.map.addSource(o,{type:"geojson",data:s.geojson}),a._addLayers(s,l),a}}}),__=p({"src/traces/densitymap/hover.js"(e,t){var r=nr(),n=e_().hoverPoints,i=e_().getExtraText;t.exports=function(e,t,a){var o=n(e,t,a);if(o){var s=o[0],l=s.cd,c=l[0].trace,u=l[s.index];if(delete s.color,"z"in u){var h=s.subplot.mockAxis;s.z=u.z,s.zLabel=r.tickText(h,h.c2l(u.z),"hover").text}return s.extraText=i(c,u,l[0].t.labels),[s]}}}}),w_=p({"src/traces/densitymap/event_data.js"(e,t){t.exports=function(e,t){return e.lon=t.lon,e.lat=t.lat,e.z=t.z,e}}}),k_=p({"src/traces/densitymap/index.js"(e,t){t.exports={attributes:g_(),supplyDefaults:y_(),colorbar:No(),formatLabels:Yb(),calc:v_(),plot:b_(),hoverPoints:__(),eventData:w_(),getBelow:function(e,t){for(var r=t.getMapLayers(),n=0;n<r.length;n++){var i=r[n],a=i.id;if("symbol"===i.type&&"string"===typeof a&&-1===a.indexOf("plotly-"))return a}},moduleType:"trace",name:"densitymap",basePlotModule:s_(),categories:["map","gl","showLegend"],meta:{hr_name:"density_map"}}}}),T_=p({"lib/densitymap.js"(e,t){t.exports=k_()}}),S_=p({"src/traces/sankey/attributes.js"(e,t){var r=D(),n=N(),i=V(),a=B(),o=ka().attributes,s=Oe().hovertemplateAttrs,l=Lt(),c=gt().templatedArray,u=Et().descriptionOnlyNumbers,h=R().extendFlat,p=Le().overrideAll;t.exports=p({hoverinfo:h({},n.hoverinfo,{flags:[],arrayOk:!1}),hoverlabel:a.hoverlabel,domain:o({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s",description:u("value")},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:r({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:i.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:a.hoverlabel,hovertemplate:s({},{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:i.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:a.hoverlabel,hovertemplate:s({},{keys:["value","label"]}),colorscales:c("concentrationscales",{editType:"calc",label:{valType:"string",editType:"calc",dflt:""},cmax:{valType:"number",editType:"calc",dflt:1},cmin:{valType:"number",editType:"calc",dflt:0},colorscale:h(l().colorscale,{dflt:[[0,"white"],[1,"black"]]})})}},"calc","nested")}}),A_=p({"src/traces/sankey/defaults.js"(e,t){var r=st(),n=S_(),i=q(),a=O(),o=ka().defaults,s=Ar(),l=gt(),c=Ft();function u(e,t){function i(i,a){return r.coerce(e,t,n.link.colorscales,i,a)}i("label"),i("cmin"),i("cmax"),i("colorscale")}t.exports=function(e,t,h,p){function d(i,a){return r.coerce(e,t,n,i,a)}var f=r.extendDeep(p.hoverlabel,e.hoverlabel),m=e.node,g=l.newContainer(t,"node");function y(e,t){return r.coerce(m,g,n.node,e,t)}y("label"),y("groups"),y("x"),y("y"),y("pad"),y("thickness"),y("line.color"),y("line.width"),y("hoverinfo",e.hoverinfo),s(m,g,y,f),y("hovertemplate"),y("align");var v=p.colorway;y("color",g.label.map((function(e,t){return i.addOpacity(function(e){return v[e%v.length]}(t),.8)}))),y("customdata");var x=e.link||{},b=l.newContainer(t,"link");function _(e,t){return r.coerce(x,b,n.link,e,t)}_("label"),_("arrowlen"),_("source"),_("target"),_("value"),_("line.color"),_("line.width"),_("hoverinfo",e.hoverinfo),s(x,b,_,f),_("hovertemplate");var w,k=a(p.paper_bgcolor).getLuminance()<.333,T=_("color",k?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)");function S(e){var t=a(e);if(!t.isValid())return e;var r=t.getAlpha();return r<=.8?t.setAlpha(r+.2):t=k?t.brighten():t.darken(),t.toRgbString()}_("hovercolor",Array.isArray(T)?T.map(S):S(T)),_("customdata"),c(x,b,{name:"colorscales",handleItemDefaults:u}),o(t,p,d),d("orientation"),d("valueformat"),d("valuesuffix"),g.x.length&&g.y.length&&(w="freeform"),d("arrangement",w),r.coerceFont(d,"textfont",p.font,{autoShadowDflt:!0}),t._length=null}}}),M_=p({"node_modules/strongly-connected-components/scc.js"(e,t){t.exports=function(e){for(var t=e.length,r=new Array(t),n=new Array(t),i=new Array(t),a=new Array(t),o=new Array(t),s=new Array(t),l=0;l<t;++l)r[l]=-1,n[l]=0,i[l]=!1,a[l]=0,o[l]=-1,s[l]=[];var c,u=0,h=[],p=[];function d(t){var l=[t],c=[t];for(r[t]=n[t]=u,i[t]=!0,u+=1;c.length>0;){t=c[c.length-1];var d=e[t];if(a[t]<d.length){for(var f=a[t];f<d.length;++f){var m=d[f];if(r[m]<0){r[m]=n[m]=u,i[m]=!0,u+=1,l.push(m),c.push(m);break}i[m]&&(n[t]=0|Math.min(n[t],n[m])),o[m]>=0&&s[t].push(o[m])}a[t]=f}else{if(n[t]===r[t]){var g=[],y=[],v=0;for(f=l.length-1;f>=0;--f){var x=l[f];if(i[x]=!1,g.push(x),y.push(s[x]),v+=s[x].length,o[x]=h.length,x===t){l.length=f;break}}h.push(g);var b=new Array(v);for(f=0;f<y.length;f++)for(var _=0;_<y[f].length;_++)b[--v]=y[f][_];p.push(b)}c.pop()}}}for(l=0;l<t;++l)r[l]<0&&d(l);for(l=0;l<p.length;l++){var f=p[l];if(0!==f.length){f.sort((function(e,t){return e-t})),c=[f[0]];for(var m=1;m<f.length;m++)f[m]!==f[m-1]&&c.push(f[m]);p[l]=c}}return{components:h,adjacencyList:p}}}}),E_=p({"src/traces/sankey/calc.js"(e,t){var r=M_(),n=st(),i=Ox().wrap,a=n.isArrayOrTypedArray,o=n.isIndex,s=Wt();function l(e){var t,i=e.node,l=e.link,c=[],u=a(l.color),h=a(l.hovercolor),p=a(l.customdata),d={},f={},m=l.colorscales.length;for(t=0;t<m;t++){var g=l.colorscales[t],y=s.extractScale(g,{cLetter:"c"}),v=s.makeColorScaleFunc(y);f[g.label]=v}var x=0;for(t=0;t<l.value.length;t++)l.source[t]>x&&(x=l.source[t]),l.target[t]>x&&(x=l.target[t]);var b,_=x+1;e.node._count=_;var w=e.node.groups,k={};for(t=0;t<w.length;t++){var T=w[t];for(b=0;b<T.length;b++){var S=T[b],A=_+t;k.hasOwnProperty(S)?n.warn("Node "+S+" is already part of a group."):k[S]=A}}var M={source:[],target:[]};for(t=0;t<l.value.length;t++){var E=l.value[t],C=l.source[t],P=l.target[t];if(E>0&&o(C,_)&&o(P,_)&&(!k.hasOwnProperty(C)||!k.hasOwnProperty(P)||k[C]!==k[P])){k.hasOwnProperty(P)&&(P=k[P]),k.hasOwnProperty(C)&&(C=k[C]),P=+P,d[C=+C]=d[P]=!0;var L="";l.label&&l.label[t]&&(L=l.label[t]);var I=null;L&&f.hasOwnProperty(L)&&(I=f[L]),c.push({pointNumber:t,label:L,color:u?l.color[t]:l.color,hovercolor:h?l.hovercolor[t]:l.hovercolor,customdata:p?l.customdata[t]:l.customdata,concentrationscale:I,source:C,target:P,value:+E}),M.source.push(C),M.target.push(P)}}var z=_+w.length,O=a(i.color),R=a(i.customdata),D=[];for(t=0;t<z;t++)if(d[t]){var j=i.label[t];D.push({group:t>_-1,childrenNodes:[],pointNumber:t,label:j,color:O?i.color[t]:i.color,customdata:R?i.customdata[t]:i.customdata})}var F=!1;return function(e,t,i){for(var a=n.init2dArray(e,0),o=0;o<Math.min(t.length,i.length);o++)if(n.isIndex(t[o],e)&&n.isIndex(i[o],e)){if(t[o]===i[o])return!0;a[t[o]].push(i[o])}var s=r(a);return s.components.some((function(e){return e.length>1}))}(z,M.source,M.target)&&(F=!0),{circular:F,links:c,nodes:D,groups:w,groupLookup:k}}t.exports=function(e,t){var r=l(t);return i({circular:r.circular,_nodes:r.nodes,_links:r.links,_groups:r.groups,_groupLookup:r.groupLookup})}}}),C_=p({"node_modules/d3-quadtree/dist/d3-quadtree.js"(e,t){var r,n;r=e,n=function(e){function t(e,t,r,n){if(isNaN(t)||isNaN(r))return e;var i,a,o,s,l,c,u,h,p,d=e._root,f={data:n},m=e._x0,g=e._y0,y=e._x1,v=e._y1;if(!d)return e._root=f,e;for(;d.length;)if((c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o,i=d,!(d=d[h=u<<1|c]))return i[h]=f,e;if(s=+e._x.call(null,d.data),l=+e._y.call(null,d.data),t===s&&r===l)return f.next=d,i?i[h]=f:e._root=f,e;do{i=i?i[h]=new Array(4):e._root=new Array(4),(c=t>=(a=(m+y)/2))?m=a:y=a,(u=r>=(o=(g+v)/2))?g=o:v=o}while((h=u<<1|c)===(p=(l>=o)<<1|s>=a));return i[p]=d,i[h]=f,e}function r(e,t,r,n,i){this.node=e,this.x0=t,this.y0=r,this.x1=n,this.y1=i}function n(e){return e[0]}function i(e){return e[1]}function a(e,t,r){var a=new o(null==t?n:t,null==r?i:r,NaN,NaN,NaN,NaN);return null==e?a:a.addAll(e)}function o(e,t,r,n,i,a){this._x=e,this._y=t,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function s(e){for(var t={data:e.data},r=t;e=e.next;)r=r.next={data:e.data};return t}var l=a.prototype=o.prototype;l.copy=function(){var e,t,r=new o(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=s(n),r;for(e=[{source:n,target:r._root=new Array(4)}];n=e.pop();)for(var i=0;i<4;++i)(t=n.source[i])&&(t.length?e.push({source:t,target:n.target[i]=new Array(4)}):n.target[i]=s(t));return r},l.add=function(e){var r=+this._x.call(null,e),n=+this._y.call(null,e);return t(this.cover(r,n),r,n,e)},l.addAll=function(e){var r,n,i,a,o=e.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,p=-1/0;for(n=0;n<o;++n)isNaN(i=+this._x.call(null,r=e[n]))||isNaN(a=+this._y.call(null,r))||(s[n]=i,l[n]=a,i<c&&(c=i),i>h&&(h=i),a<u&&(u=a),a>p&&(p=a));if(c>h||u>p)return this;for(this.cover(c,u).cover(h,p),n=0;n<o;++n)t(this,s[n],l[n],e[n]);return this},l.cover=function(e,t){if(isNaN(e=+e)||isNaN(t=+t))return this;var r=this._x0,n=this._y0,i=this._x1,a=this._y1;if(isNaN(r))i=(r=Math.floor(e))+1,a=(n=Math.floor(t))+1;else{for(var o,s,l=i-r,c=this._root;r>e||e>=i||n>t||t>=a;)switch(s=(t<n)<<1|e<r,(o=new Array(4))[s]=c,c=o,l*=2,s){case 0:i=r+l,a=n+l;break;case 1:r=i-l,a=n+l;break;case 2:i=r+l,n=a-l;break;case 3:r=i-l,n=a-l}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var e=[];return this.visit((function(t){if(!t.length)do{e.push(t.data)}while(t=t.next)})),e},l.extent=function(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(e,t,n){var i,a,o,s,l,c,u,h=this._x0,p=this._y0,d=this._x1,f=this._y1,m=[],g=this._root;for(g&&m.push(new r(g,h,p,d,f)),null==n?n=1/0:(h=e-n,p=t-n,d=e+n,f=t+n,n*=n);c=m.pop();)if(!(!(g=c.node)||(a=c.x0)>d||(o=c.y0)>f||(s=c.x1)<h||(l=c.y1)<p))if(g.length){var y=(a+s)/2,v=(o+l)/2;m.push(new r(g[3],y,v,s,l),new r(g[2],a,v,y,l),new r(g[1],y,o,s,v),new r(g[0],a,o,y,v)),(u=(t>=v)<<1|e>=y)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=e-+this._x.call(null,g.data),b=t-+this._y.call(null,g.data),_=x*x+b*b;if(_<n){var w=Math.sqrt(n=_);h=e-w,p=t-w,d=e+w,f=t+w,i=g.data}}return i},l.remove=function(e){if(isNaN(a=+this._x.call(null,e))||isNaN(o=+this._y.call(null,e)))return this;var t,r,n,i,a,o,s,l,c,u,h,p,d=this._root,f=this._x0,m=this._y0,g=this._x1,y=this._y1;if(!d)return this;if(d.length)for(;;){if((c=a>=(s=(f+g)/2))?f=s:g=s,(u=o>=(l=(m+y)/2))?m=l:y=l,t=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(t[h+1&3]||t[h+2&3]||t[h+3&3])&&(r=t,p=h)}for(;d.data!==e;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):t?(i?t[h]=i:delete t[h],(d=t[0]||t[1]||t[2]||t[3])&&d===(t[3]||t[2]||t[1]||t[0])&&!d.length&&(r?r[p]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(e){for(var t=0,r=e.length;t<r;++t)this.remove(e[t]);return this},l.root=function(){return this._root},l.size=function(){var e=0;return this.visit((function(t){if(!t.length)do{++e}while(t=t.next)})),e},l.visit=function(e){var t,n,i,a,o,s,l=[],c=this._root;for(c&&l.push(new r(c,this._x0,this._y0,this._x1,this._y1));t=l.pop();)if(!e(c=t.node,i=t.x0,a=t.y0,o=t.x1,s=t.y1)&&c.length){var u=(i+o)/2,h=(a+s)/2;(n=c[3])&&l.push(new r(n,u,h,o,s)),(n=c[2])&&l.push(new r(n,i,h,u,s)),(n=c[1])&&l.push(new r(n,u,a,o,h)),(n=c[0])&&l.push(new r(n,i,a,u,h))}return this},l.visitAfter=function(e){var t,n=[],i=[];for(this._root&&n.push(new r(this._root,this._x0,this._y0,this._x1,this._y1));t=n.pop();){var a=t.node;if(a.length){var o,s=t.x0,l=t.y0,c=t.x1,u=t.y1,h=(s+c)/2,p=(l+u)/2;(o=a[0])&&n.push(new r(o,s,l,h,p)),(o=a[1])&&n.push(new r(o,h,l,c,p)),(o=a[2])&&n.push(new r(o,s,p,h,u)),(o=a[3])&&n.push(new r(o,h,p,c,u))}i.push(t)}for(;t=i.pop();)e(t.node,t.x0,t.y0,t.x1,t.y1);return this},l.x=function(e){return arguments.length?(this._x=e,this):this._x},l.y=function(e){return arguments.length?(this._y=e,this):this._y},e.quadtree=a,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),P_=p({"node_modules/d3-collection/dist/d3-collection.js"(e,t){var r;r=e,function(e){var t="$";function r(){}function n(e,t){var n=new r;if(e instanceof r)e.each((function(e,t){n.set(t,e)}));else if(Array.isArray(e)){var i,a=-1,o=e.length;if(null==t)for(;++a<o;)n.set(a,e[a]);else for(;++a<o;)n.set(t(i=e[a],a,e),i)}else if(e)for(var s in e)n.set(s,e[s]);return n}function i(){return{}}function a(e,t,r){e[t]=r}function o(){return n()}function s(e,t,r){e.set(t,r)}function l(){}r.prototype=n.prototype={constructor:r,has:function(e){return t+e in this},get:function(e){return this[t+e]},set:function(e,r){return this[t+e]=r,this},remove:function(e){var r=t+e;return r in this&&delete this[r]},clear:function(){for(var e in this)e[0]===t&&delete this[e]},keys:function(){var e=[];for(var r in this)r[0]===t&&e.push(r.slice(1));return e},values:function(){var e=[];for(var r in this)r[0]===t&&e.push(this[r]);return e},entries:function(){var e=[];for(var r in this)r[0]===t&&e.push({key:r.slice(1),value:this[r]});return e},size:function(){var e=0;for(var r in this)r[0]===t&&++e;return e},empty:function(){for(var e in this)if(e[0]===t)return!1;return!0},each:function(e){for(var r in this)r[0]===t&&e(this[r],r.slice(1),this)}};var c=n.prototype;function u(e,t){var r=new l;if(e instanceof l)e.each((function(e){r.add(e)}));else if(e){var n=-1,i=e.length;if(null==t)for(;++n<i;)r.add(e[n]);else for(;++n<i;)r.add(t(e[n],n,e))}return r}l.prototype=u.prototype={constructor:l,has:c.has,add:function(e){return this[t+(e+="")]=e,this},remove:c.remove,clear:c.clear,values:c.keys,size:c.size,empty:c.empty,each:c.each},e.nest=function(){var e,t,r,l=[],c=[];function u(r,i,a,o){if(i>=l.length)return null!=e&&r.sort(e),null!=t?t(r):r;for(var s,c,h,p=-1,d=r.length,f=l[i++],m=n(),g=a();++p<d;)(h=m.get(s=f(c=r[p])+""))?h.push(c):m.set(s,[c]);return m.each((function(e,t){o(g,t,u(e,i,a,o))})),g}function h(e,r){if(++r>l.length)return e;var n,i=c[r-1];return null!=t&&r>=l.length?n=e.entries():(n=[],e.each((function(e,t){n.push({key:t,values:h(e,r)})}))),null!=i?n.sort((function(e,t){return i(e.key,t.key)})):n}return r={object:function(e){return u(e,0,i,a)},map:function(e){return u(e,0,o,s)},entries:function(e){return h(u(e,0,o,s),0)},key:function(e){return l.push(e),r},sortKeys:function(e){return c[l.length-1]=e,r},sortValues:function(t){return e=t,r},rollup:function(e){return t=e,r}}},e.set=u,e.map=n,e.keys=function(e){var t=[];for(var r in e)t.push(r);return t},e.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},e.entries=function(e){var t=[];for(var r in e)t.push({key:r,value:e[r]});return t},Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:r.d3=r.d3||{})}}),L_=p({"node_modules/d3-dispatch/dist/d3-dispatch.js"(e,t){var r,n;r=e,n=function(e){var t={value:function(){}};function r(){for(var e,t=0,r=arguments.length,i={};t<r;++t){if(!(e=arguments[t]+"")||e in i||/[\s.]/.test(e))throw new Error("illegal type: "+e);i[e]=[]}return new n(i)}function n(e){this._=e}function i(e,t){for(var r,n=0,i=e.length;n<i;++n)if((r=e[n]).name===t)return r.value}function a(e,r,n){for(var i=0,a=e.length;i<a;++i)if(e[i].name===r){e[i]=t,e=e.slice(0,i).concat(e.slice(i+1));break}return null!=n&&e.push({name:r,value:n}),e}n.prototype=r.prototype={constructor:n,on:function(e,t){var r,n,o=this._,s=(n=o,(e+"").trim().split(/^|\s+/).map((function(e){var t="",r=e.indexOf(".");if(r>=0&&(t=e.slice(r+1),e=e.slice(0,r)),e&&!n.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}}))),l=-1,c=s.length;if(!(arguments.length<2)){if(null!=t&&"function"!==typeof t)throw new Error("invalid callback: "+t);for(;++l<c;)if(r=(e=s[l]).type)o[r]=a(o[r],e.name,t);else if(null==t)for(r in o)o[r]=a(o[r],e.name,null);return this}for(;++l<c;)if((r=(e=s[l]).type)&&(r=i(o[r],e.name)))return r},copy:function(){var e={},t=this._;for(var r in t)e[r]=t[r].slice();return new n(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var r,n,i=new Array(r),a=0;a<r;++a)i[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,r=(n=this._[e]).length;a<r;++a)n[a].value.apply(t,i)},apply:function(e,t,r){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var n=this._[e],i=0,a=n.length;i<a;++i)n[i].value.apply(t,r)}},e.dispatch=r,Object.defineProperty(e,"__esModule",{value:!0})},n("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),I_=p({"node_modules/d3-timer/dist/d3-timer.js"(e,t){var r;r=e,function(e){var t,r,n=0,i=0,a=0,o=0,s=0,l=0,c="object"===typeof performance&&performance.now?performance:Date,u="object"===typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function h(){return s||(u(p),s=c.now()+l)}function p(){s=0}function d(){this._call=this._time=this._next=null}function f(e,t,r){var n=new d;return n.restart(e,t,r),n}function m(){h(),++n;for(var e,r=t;r;)(e=s-r._time)>=0&&r._call.call(null,e),r=r._next;--n}function g(){s=(o=c.now())+l,n=i=0;try{m()}finally{n=0,function(){for(var e,n,i=t,a=1/0;i;)i._call?(a>i._time&&(a=i._time),e=i,i=i._next):(n=i._next,i._next=null,i=e?e._next=n:t=n);r=e,v(a)}(),s=0}}function y(){var e=c.now(),t=e-o;t>1e3&&(l-=t,o=e)}function v(e){n||(i&&(i=clearTimeout(i)),e-s>24?(e<1/0&&(i=setTimeout(g,e-c.now()-l)),a&&(a=clearInterval(a))):(a||(o=c.now(),a=setInterval(y,1e3)),n=1,u(g)))}d.prototype=f.prototype={constructor:d,restart:function(e,n,i){if("function"!==typeof e)throw new TypeError("callback is not a function");i=(null==i?h():+i)+(null==n?0:+n),this._next||r===this||(r?r._next=this:t=this,r=this),this._call=e,this._time=i,v()},stop:function(){this._call&&(this._call=null,this._time=1/0,v())}},e.interval=function(e,t,r){var n=new d,i=t;return null==t?(n.restart(e,t,r),n):(t=+t,r=null==r?h():+r,n.restart((function a(o){o+=i,n.restart(a,i+=t,r),e(o)}),t,r),n)},e.now=h,e.timeout=function(e,t,r){var n=new d;return t=null==t?0:+t,n.restart((function(r){n.stop(),e(r+t)}),t,r),n},e.timer=f,e.timerFlush=m,Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),z_=p({"node_modules/d3-force/dist/d3-force.js"(e,t){var r,n;r=e,n=function(e,t,r,n,i){function a(e){return function(){return e}}function o(){return 1e-6*(Math.random()-.5)}function s(e){return e.x+e.vx}function l(e){return e.y+e.vy}function c(e){return e.index}function u(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function h(e){return e.x}function p(e){return e.y}var d=Math.PI*(3-Math.sqrt(5));e.forceCenter=function(e,t){var r;function n(){var n,i,a=r.length,o=0,s=0;for(n=0;n<a;++n)o+=(i=r[n]).x,s+=i.y;for(o=o/a-e,s=s/a-t,n=0;n<a;++n)(i=r[n]).x-=o,i.y-=s}return null==e&&(e=0),null==t&&(t=0),n.initialize=function(e){r=e},n.x=function(t){return arguments.length?(e=+t,n):e},n.y=function(e){return arguments.length?(t=+e,n):t},n},e.forceCollide=function(e){var r,n,i=1,c=1;function u(){for(var e,a,u,p,d,f,m,g=r.length,y=0;y<c;++y)for(a=t.quadtree(r,s,l).visitAfter(h),e=0;e<g;++e)u=r[e],f=n[u.index],m=f*f,p=u.x+u.vx,d=u.y+u.vy,a.visit(v);function v(e,t,r,n,a){var s=e.data,l=e.r,c=f+l;if(!s)return t>p+c||n<p-c||r>d+c||a<d-c;if(s.index>u.index){var h=p-s.x-s.vx,g=d-s.y-s.vy,y=h*h+g*g;y<c*c&&(0===h&&(y+=(h=o())*h),0===g&&(y+=(g=o())*g),y=(c-(y=Math.sqrt(y)))/y*i,u.vx+=(h*=y)*(c=(l*=l)/(m+l)),u.vy+=(g*=y)*c,s.vx-=h*(c=1-c),s.vy-=g*c)}}}function h(e){if(e.data)return e.r=n[e.data.index];for(var t=e.r=0;t<4;++t)e[t]&&e[t].r>e.r&&(e.r=e[t].r)}function p(){if(r){var t,i,a=r.length;for(n=new Array(a),t=0;t<a;++t)i=r[t],n[i.index]=+e(i,t,r)}}return"function"!==typeof e&&(e=a(null==e?1:+e)),u.initialize=function(e){r=e,p()},u.iterations=function(e){return arguments.length?(c=+e,u):c},u.strength=function(e){return arguments.length?(i=+e,u):i},u.radius=function(t){return arguments.length?(e="function"===typeof t?t:a(+t),p(),u):e},u},e.forceLink=function(e){var t,n,i,s,l,h=c,p=function(e){return 1/Math.min(s[e.source.index],s[e.target.index])},d=a(30),f=1;function m(r){for(var i=0,a=e.length;i<f;++i)for(var s,c,u,h,p,d,m,g=0;g<a;++g)c=(s=e[g]).source,h=(u=s.target).x+u.vx-c.x-c.vx||o(),p=u.y+u.vy-c.y-c.vy||o(),h*=d=((d=Math.sqrt(h*h+p*p))-n[g])/d*r*t[g],p*=d,u.vx-=h*(m=l[g]),u.vy-=p*m,c.vx+=h*(m=1-m),c.vy+=p*m}function g(){if(i){var a,o,c=i.length,p=e.length,d=r.map(i,h);for(a=0,s=new Array(c);a<p;++a)(o=e[a]).index=a,"object"!==typeof o.source&&(o.source=u(d,o.source)),"object"!==typeof o.target&&(o.target=u(d,o.target)),s[o.source.index]=(s[o.source.index]||0)+1,s[o.target.index]=(s[o.target.index]||0)+1;for(a=0,l=new Array(p);a<p;++a)o=e[a],l[a]=s[o.source.index]/(s[o.source.index]+s[o.target.index]);t=new Array(p),y(),n=new Array(p),v()}}function y(){if(i)for(var r=0,n=e.length;r<n;++r)t[r]=+p(e[r],r,e)}function v(){if(i)for(var t=0,r=e.length;t<r;++t)n[t]=+d(e[t],t,e)}return null==e&&(e=[]),m.initialize=function(e){i=e,g()},m.links=function(t){return arguments.length?(e=t,g(),m):e},m.id=function(e){return arguments.length?(h=e,m):h},m.iterations=function(e){return arguments.length?(f=+e,m):f},m.strength=function(e){return arguments.length?(p="function"===typeof e?e:a(+e),y(),m):p},m.distance=function(e){return arguments.length?(d="function"===typeof e?e:a(+e),v(),m):d},m},e.forceManyBody=function(){var e,r,n,i,s=a(-30),l=1,c=1/0,u=.81;function d(i){var a,o=e.length,s=t.quadtree(e,h,p).visitAfter(m);for(n=i,a=0;a<o;++a)r=e[a],s.visit(g)}function f(){if(e){var t,r,n=e.length;for(i=new Array(n),t=0;t<n;++t)r=e[t],i[r.index]=+s(r,t,e)}}function m(e){var t,r,n,a,o,s=0,l=0;if(e.length){for(n=a=o=0;o<4;++o)(t=e[o])&&(r=Math.abs(t.value))&&(s+=t.value,l+=r,n+=r*t.x,a+=r*t.y);e.x=n/l,e.y=a/l}else{(t=e).x=t.data.x,t.y=t.data.y;do{s+=i[t.data.index]}while(t=t.next)}e.value=s}function g(e,t,a,s){if(!e.value)return!0;var h=e.x-r.x,p=e.y-r.y,d=s-t,f=h*h+p*p;if(d*d/u<f)return f<c&&(0===h&&(f+=(h=o())*h),0===p&&(f+=(p=o())*p),f<l&&(f=Math.sqrt(l*f)),r.vx+=h*e.value*n/f,r.vy+=p*e.value*n/f),!0;if(!(e.length||f>=c)){(e.data!==r||e.next)&&(0===h&&(f+=(h=o())*h),0===p&&(f+=(p=o())*p),f<l&&(f=Math.sqrt(l*f)));do{e.data!==r&&(d=i[e.data.index]*n/f,r.vx+=h*d,r.vy+=p*d)}while(e=e.next)}}return d.initialize=function(t){e=t,f()},d.strength=function(e){return arguments.length?(s="function"===typeof e?e:a(+e),f(),d):s},d.distanceMin=function(e){return arguments.length?(l=e*e,d):Math.sqrt(l)},d.distanceMax=function(e){return arguments.length?(c=e*e,d):Math.sqrt(c)},d.theta=function(e){return arguments.length?(u=e*e,d):Math.sqrt(u)},d},e.forceRadial=function(e,t,r){var n,i,o,s=a(.1);function l(e){for(var a=0,s=n.length;a<s;++a){var l=n[a],c=l.x-t||1e-6,u=l.y-r||1e-6,h=Math.sqrt(c*c+u*u),p=(o[a]-h)*i[a]*e/h;l.vx+=c*p,l.vy+=u*p}}function c(){if(n){var t,r=n.length;for(i=new Array(r),o=new Array(r),t=0;t<r;++t)o[t]=+e(n[t],t,n),i[t]=isNaN(o[t])?0:+s(n[t],t,n)}}return"function"!==typeof e&&(e=a(+e)),null==t&&(t=0),null==r&&(r=0),l.initialize=function(e){n=e,c()},l.strength=function(e){return arguments.length?(s="function"===typeof e?e:a(+e),c(),l):s},l.radius=function(t){return arguments.length?(e="function"===typeof t?t:a(+t),c(),l):e},l.x=function(e){return arguments.length?(t=+e,l):t},l.y=function(e){return arguments.length?(r=+e,l):r},l},e.forceSimulation=function(e){var t,a=1,o=.001,s=1-Math.pow(o,1/300),l=0,c=.6,u=r.map(),h=i.timer(f),p=n.dispatch("tick","end");function f(){m(),p.call("tick",t),a<o&&(h.stop(),p.call("end",t))}function m(r){var n,i,o=e.length;void 0===r&&(r=1);for(var h=0;h<r;++h)for(a+=(l-a)*s,u.each((function(e){e(a)})),n=0;n<o;++n)null==(i=e[n]).fx?i.x+=i.vx*=c:(i.x=i.fx,i.vx=0),null==i.fy?i.y+=i.vy*=c:(i.y=i.fy,i.vy=0);return t}function g(){for(var t,r=0,n=e.length;r<n;++r){if((t=e[r]).index=r,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=10*Math.sqrt(r),a=r*d;t.x=i*Math.cos(a),t.y=i*Math.sin(a)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function y(t){return t.initialize&&t.initialize(e),t}return null==e&&(e=[]),g(),t={tick:m,restart:function(){return h.restart(f),t},stop:function(){return h.stop(),t},nodes:function(r){return arguments.length?(e=r,g(),u.each(y),t):e},alpha:function(e){return arguments.length?(a=+e,t):a},alphaMin:function(e){return arguments.length?(o=+e,t):o},alphaDecay:function(e){return arguments.length?(s=+e,t):+s},alphaTarget:function(e){return arguments.length?(l=+e,t):l},velocityDecay:function(e){return arguments.length?(c=1-e,t):1-c},force:function(e,r){return arguments.length>1?(null==r?u.remove(e):u.set(e,y(r)),t):u.get(e)},find:function(t,r,n){var i,a,o,s,l,c=0,u=e.length;for(null==n?n=1/0:n*=n,c=0;c<u;++c)(o=(i=t-(s=e[c]).x)*i+(a=r-s.y)*a)<n&&(l=s,n=o);return l},on:function(e,r){return arguments.length>1?(p.on(e,r),t):p.on(e)}}},e.forceX=function(e){var t,r,n,i=a(.1);function o(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vx+=(n[a]-i.x)*r[a]*e}function s(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!==typeof e&&(e=a(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(i="function"===typeof e?e:a(+e),s(),o):i},o.x=function(t){return arguments.length?(e="function"===typeof t?t:a(+t),s(),o):e},o},e.forceY=function(e){var t,r,n,i=a(.1);function o(e){for(var i,a=0,o=t.length;a<o;++a)(i=t[a]).vy+=(n[a]-i.y)*r[a]*e}function s(){if(t){var a,o=t.length;for(r=new Array(o),n=new Array(o),a=0;a<o;++a)r[a]=isNaN(n[a]=+e(t[a],a,t))?0:+i(t[a],a,t)}}return"function"!==typeof e&&(e=a(null==e?0:+e)),o.initialize=function(e){t=e,s()},o.strength=function(e){return arguments.length?(i="function"===typeof e?e:a(+e),s(),o):i},o.y=function(t){return arguments.length?(e="function"===typeof t?t:a(+t),s(),o):e},o},Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,C_(),P_(),L_(),I_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,r.d3)}}),O_=p({"node_modules/d3-path/dist/d3-path.js"(e,t){var r;r=e,function(e){var t=Math.PI,r=2*t,n=1e-6,i=r-n;function a(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function o(){return new a}a.prototype=o.prototype={constructor:a,moveTo:function(e,t){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(e,t){this._+="L"+(this._x1=+e)+","+(this._y1=+t)},quadraticCurveTo:function(e,t,r,n){this._+="Q"+ +e+","+ +t+","+(this._x1=+r)+","+(this._y1=+n)},bezierCurveTo:function(e,t,r,n,i,a){this._+="C"+ +e+","+ +t+","+ +r+","+ +n+","+(this._x1=+i)+","+(this._y1=+a)},arcTo:function(e,r,i,a,o){e=+e,r=+r,i=+i,a=+a,o=+o;var s=this._x1,l=this._y1,c=i-e,u=a-r,h=s-e,p=l-r,d=h*h+p*p;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=e)+","+(this._y1=r);else if(d>n)if(Math.abs(p*c-u*h)>n&&o){var f=i-s,m=a-l,g=c*c+u*u,y=f*f+m*m,v=Math.sqrt(g),x=Math.sqrt(d),b=o*Math.tan((t-Math.acos((g+d-y)/(2*v*x)))/2),_=b/x,w=b/v;Math.abs(_-1)>n&&(this._+="L"+(e+_*h)+","+(r+_*p)),this._+="A"+o+","+o+",0,0,"+ +(p*f>h*m)+","+(this._x1=e+w*c)+","+(this._y1=r+w*u)}else this._+="L"+(this._x1=e)+","+(this._y1=r)},arc:function(e,a,o,s,l,c){e=+e,a=+a,c=!!c;var u=(o=+o)*Math.cos(s),h=o*Math.sin(s),p=e+u,d=a+h,f=1^c,m=c?s-l:l-s;if(o<0)throw new Error("negative radius: "+o);null===this._x1?this._+="M"+p+","+d:(Math.abs(this._x1-p)>n||Math.abs(this._y1-d)>n)&&(this._+="L"+p+","+d),o&&(m<0&&(m=m%r+r),m>i?this._+="A"+o+","+o+",0,1,"+f+","+(e-u)+","+(a-h)+"A"+o+","+o+",0,1,"+f+","+(this._x1=p)+","+(this._y1=d):m>n&&(this._+="A"+o+","+o+",0,"+ +(m>=t)+","+f+","+(this._x1=e+o*Math.cos(l))+","+(this._y1=a+o*Math.sin(l))))},rect:function(e,t,r,n){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +r+"v"+ +n+"h"+-r+"Z"},toString:function(){return this._}},e.path=o,Object.defineProperty(e,"__esModule",{value:!0})}("object"===typeof e&&"undefined"!==typeof t?e:(r=r||self).d3=r.d3||{})}}),R_=p({"node_modules/d3-shape/dist/d3-shape.js"(e,t){var r,n;r=e,n=function(e,t){function r(e){return function(){return e}}var n=Math.abs,i=Math.atan2,a=Math.cos,o=Math.max,s=Math.min,l=Math.sin,c=Math.sqrt,u=1e-12,h=Math.PI,p=h/2,d=2*h;function f(e){return e>=1?p:e<=-1?-p:Math.asin(e)}function m(e){return e.innerRadius}function g(e){return e.outerRadius}function y(e){return e.startAngle}function v(e){return e.endAngle}function x(e){return e&&e.padAngle}function b(e,t,r,n,i,a,s){var l=e-r,u=t-n,h=(s?a:-a)/c(l*l+u*u),p=h*u,d=-h*l,f=e+p,m=t+d,g=r+p,y=n+d,v=(f+g)/2,x=(m+y)/2,b=g-f,_=y-m,w=b*b+_*_,k=i-a,T=f*y-g*m,S=(_<0?-1:1)*c(o(0,k*k*w-T*T)),A=(T*_-b*S)/w,M=(-T*b-_*S)/w,E=(T*_+b*S)/w,C=(-T*b+_*S)/w,P=A-v,L=M-x,I=E-v,z=C-x;return P*P+L*L>I*I+z*z&&(A=E,M=C),{cx:A,cy:M,x01:-p,y01:-d,x11:A*(i/k-1),y11:M*(i/k-1)}}function _(e){this._context=e}function w(e){return new _(e)}function k(e){return e[0]}function T(e){return e[1]}function S(){var e=k,n=T,i=r(!0),a=null,o=w,s=null;function l(r){var l,c,u,h=r.length,p=!1;for(null==a&&(s=o(u=t.path())),l=0;l<=h;++l)!(l<h&&i(c=r[l],l,r))===p&&((p=!p)?s.lineStart():s.lineEnd()),p&&s.point(+e(c,l,r),+n(c,l,r));if(u)return s=null,u+""||null}return l.x=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),l):e},l.y=function(e){return arguments.length?(n="function"===typeof e?e:r(+e),l):n},l.defined=function(e){return arguments.length?(i="function"===typeof e?e:r(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,null!=a&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(null==e?a=s=null:s=o(a=e),l):a},l}function A(){var e=k,n=null,i=r(0),a=T,o=r(!0),s=null,l=w,c=null;function u(r){var u,h,p,d,f,m=r.length,g=!1,y=new Array(m),v=new Array(m);for(null==s&&(c=l(f=t.path())),u=0;u<=m;++u){if(!(u<m&&o(d=r[u],u,r))===g)if(g=!g)h=u,c.areaStart(),c.lineStart();else{for(c.lineEnd(),c.lineStart(),p=u-1;p>=h;--p)c.point(y[p],v[p]);c.lineEnd(),c.areaEnd()}g&&(y[u]=+e(d,u,r),v[u]=+i(d,u,r),c.point(n?+n(d,u,r):y[u],a?+a(d,u,r):v[u]))}if(f)return c=null,f+""||null}function h(){return S().defined(o).curve(l).context(s)}return u.x=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),n=null,u):e},u.x0=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),u):e},u.x1=function(e){return arguments.length?(n=null==e?null:"function"===typeof e?e:r(+e),u):n},u.y=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),a=null,u):i},u.y0=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),u):i},u.y1=function(e){return arguments.length?(a=null==e?null:"function"===typeof e?e:r(+e),u):a},u.lineX0=u.lineY0=function(){return h().x(e).y(i)},u.lineY1=function(){return h().x(e).y(a)},u.lineX1=function(){return h().x(n).y(i)},u.defined=function(e){return arguments.length?(o="function"===typeof e?e:r(!!e),u):o},u.curve=function(e){return arguments.length?(l=e,null!=s&&(c=l(s)),u):l},u.context=function(e){return arguments.length?(null==e?s=c=null:c=l(s=e),u):s},u}function M(e,t){return t<e?-1:t>e?1:t>=e?0:NaN}function E(e){return e}_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var C=L(w);function P(e){this._curve=e}function L(e){function t(t){return new P(e(t))}return t._curve=e,t}function I(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(L(e)):t()._curve},e}function z(){return I(S().curve(C))}function O(){var e=A().curve(C),t=e.curve,r=e.lineX0,n=e.lineX1,i=e.lineY0,a=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return I(r())},delete e.lineX0,e.lineEndAngle=function(){return I(n())},delete e.lineX1,e.lineInnerRadius=function(){return I(i())},delete e.lineY0,e.lineOuterRadius=function(){return I(a())},delete e.lineY1,e.curve=function(e){return arguments.length?t(L(e)):t()._curve},e}function R(e,t){return[(t=+t)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}P.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};var D=Array.prototype.slice;function j(e){return e.source}function F(e){return e.target}function B(e){var n=j,i=F,a=k,o=T,s=null;function l(){var r,l=D.call(arguments),c=n.apply(this,l),u=i.apply(this,l);if(s||(s=r=t.path()),e(s,+a.apply(this,(l[0]=c,l)),+o.apply(this,l),+a.apply(this,(l[0]=u,l)),+o.apply(this,l)),r)return s=null,r+""||null}return l.source=function(e){return arguments.length?(n=e,l):n},l.target=function(e){return arguments.length?(i=e,l):i},l.x=function(e){return arguments.length?(a="function"===typeof e?e:r(+e),l):a},l.y=function(e){return arguments.length?(o="function"===typeof e?e:r(+e),l):o},l.context=function(e){return arguments.length?(s=null==e?null:e,l):s},l}function N(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t=(t+n)/2,r,t,i,n,i)}function U(e,t,r,n,i){e.moveTo(t,r),e.bezierCurveTo(t,r=(r+i)/2,n,r,n,i)}function V(e,t,r,n,i){var a=R(t,r),o=R(t,r=(r+i)/2),s=R(n,r),l=R(n,i);e.moveTo(a[0],a[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var q={draw:function(e,t){var r=Math.sqrt(t/h);e.moveTo(r,0),e.arc(0,0,r,0,d)}},H={draw:function(e,t){var r=Math.sqrt(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},G=Math.sqrt(1/3),W=2*G,$={draw:function(e,t){var r=Math.sqrt(t/W),n=r*G;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},Z=Math.sin(h/10)/Math.sin(7*h/10),X=Math.sin(d/10)*Z,Y=-Math.cos(d/10)*Z,K={draw:function(e,t){var r=Math.sqrt(.8908130915292852*t),n=X*r,i=Y*r;e.moveTo(0,-r),e.lineTo(n,i);for(var a=1;a<5;++a){var o=d*a/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},J={draw:function(e,t){var r=Math.sqrt(t),n=-r/2;e.rect(n,n,r,r)}},Q=Math.sqrt(3),ee={draw:function(e,t){var r=-Math.sqrt(t/(3*Q));e.moveTo(0,2*r),e.lineTo(-Q*r,-r),e.lineTo(Q*r,-r),e.closePath()}},te=-.5,re=Math.sqrt(3)/2,ne=1/Math.sqrt(12),ie=3*(ne/2+1),ae={draw:function(e,t){var r=Math.sqrt(t/ie),n=r/2,i=r*ne,a=n,o=r*ne+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(te*n-re*i,re*n+te*i),e.lineTo(te*a-re*o,re*a+te*o),e.lineTo(te*s-re*l,re*s+te*l),e.lineTo(te*n+re*i,te*i-re*n),e.lineTo(te*a+re*o,te*o-re*a),e.lineTo(te*s+re*l,te*l-re*s),e.closePath()}},oe=[q,H,$,J,K,ee,ae];function se(){}function le(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function ce(e){this._context=e}function ue(e){this._context=e}function he(e){this._context=e}function pe(e,t){this._basis=new ce(e),this._beta=t}ce.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:le(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},ue.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},he.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:le(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},pe.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,r=e.length-1;if(r>0)for(var n,i=e[0],a=t[0],o=e[r]-i,s=t[r]-a,l=-1;++l<=r;)n=l/r,this._basis.point(this._beta*e[l]+(1-this._beta)*(i+n*o),this._beta*t[l]+(1-this._beta)*(a+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};var de=function e(t){function r(e){return 1===t?new ce(e):new pe(e,t)}return r.beta=function(t){return e(+t)},r}(.85);function fe(e,t,r){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-r),e._x2,e._y2)}function me(e,t){this._context=e,this._k=(1-t)/6}me.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:fe(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ge=function e(t){function r(e){return new me(e,t)}return r.tension=function(t){return e(+t)},r}(0);function ye(e,t){this._context=e,this._k=(1-t)/6}ye.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ve=function e(t){function r(e){return new ye(e,t)}return r.tension=function(t){return e(+t)},r}(0);function xe(e,t){this._context=e,this._k=(1-t)/6}xe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:fe(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var be=function e(t){function r(e){return new xe(e,t)}return r.tension=function(t){return e(+t)},r}(0);function _e(e,t,r){var n=e._x1,i=e._y1,a=e._x2,o=e._y2;if(e._l01_a>u){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);n=(n*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>u){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);a=(a*c+e._x1*e._l23_2a-t*e._l12_2a)/h,o=(o*c+e._y1*e._l23_2a-r*e._l12_2a)/h}e._context.bezierCurveTo(n,i,a,o,e._x2,e._y2)}function we(e,t){this._context=e,this._alpha=t}we.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:_e(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var ke=function e(t){function r(e){return t?new we(e,t):new me(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Te(e,t){this._context=e,this._alpha=t}Te.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:_e(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Se=function e(t){function r(e){return t?new Te(e,t):new ye(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ae(e,t){this._context=e,this._alpha=t}Ae.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e=+e,t=+t,this._point){var r=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(r*r+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:_e(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Me=function e(t){function r(e){return t?new Ae(e,t):new xe(e,0)}return r.alpha=function(t){return e(+t)},r}(.5);function Ee(e){this._context=e}function Ce(e){return e<0?-1:1}function Pe(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(Ce(a)+Ce(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Le(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ie(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function ze(e){this._context=e}function Oe(e){this._context=new Re(e)}function Re(e){this._context=e}function De(e){this._context=e}function je(e){var t,r,n=e.length-1,i=new Array(n),a=new Array(n),o=new Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function Fe(e,t){this._context=e,this._t=t}function Be(e,t){if((i=e.length)>1)for(var r,n,i,a=1,o=e[t[0]],s=o.length;a<i;++a)for(n=o,o=e[t[a]],r=0;r<s;++r)o[r][1]+=o[r][0]=isNaN(n[r][1])?n[r][0]:n[r][1]}function Ne(e){for(var t=e.length,r=new Array(t);--t>=0;)r[t]=t;return r}function Ue(e,t){return e[t]}function Ve(e){var t=e.map(qe);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function qe(e){for(var t,r=-1,n=0,i=e.length,a=-1/0;++r<i;)(t=+e[r][1])>a&&(a=t,n=r);return n}function He(e){var t=e.map(Ge);return Ne(e).sort((function(e,r){return t[e]-t[r]}))}function Ge(e){for(var t,r=0,n=-1,i=e.length;++n<i;)(t=+e[n][1])&&(r+=t);return r}Ee.prototype={areaStart:se,areaEnd:se,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},ze.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ie(this,this._t0,Le(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ie(this,Le(this,r=Pe(this,e,t)),r);break;default:Ie(this,this._t0,r=Pe(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}},(Oe.prototype=Object.create(ze.prototype)).point=function(e,t){ze.prototype.point.call(this,t,e)},Re.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}},De.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===r)this._context.lineTo(e[1],t[1]);else for(var n=je(e),i=je(t),a=0,o=1;o<r;++a,++o)this._context.bezierCurveTo(n[0][a],i[0][a],n[1][a],i[1][a],e[o],t[o]);(this._line||0!==this._line&&1===r)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},Fe.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}}this._x=e,this._y=t}},e.arc=function(){var e=m,o=g,_=r(0),w=null,k=y,T=v,S=x,A=null;function M(){var r,m,g,y=+e.apply(this,arguments),v=+o.apply(this,arguments),x=k.apply(this,arguments)-p,M=T.apply(this,arguments)-p,E=n(M-x),C=M>x;if(A||(A=r=t.path()),v<y&&(m=v,v=y,y=m),v>u)if(E>d-u)A.moveTo(v*a(x),v*l(x)),A.arc(0,0,v,x,M,!C),y>u&&(A.moveTo(y*a(M),y*l(M)),A.arc(0,0,y,M,x,C));else{var P,L,I=x,z=M,O=x,R=M,D=E,j=E,F=S.apply(this,arguments)/2,B=F>u&&(w?+w.apply(this,arguments):c(y*y+v*v)),N=s(n(v-y)/2,+_.apply(this,arguments)),U=N,V=N;if(B>u){var q=f(B/y*l(F)),H=f(B/v*l(F));(D-=2*q)>u?(O+=q*=C?1:-1,R-=q):(D=0,O=R=(x+M)/2),(j-=2*H)>u?(I+=H*=C?1:-1,z-=H):(j=0,I=z=(x+M)/2)}var G=v*a(I),W=v*l(I),$=y*a(R),Z=y*l(R);if(N>u){var X,Y=v*a(z),K=v*l(z),J=y*a(O),Q=y*l(O);if(E<h&&(X=function(e,t,r,n,i,a,o,s){var l=r-e,c=n-t,h=o-i,p=s-a,d=p*l-h*c;if(!(d*d<u))return[e+(d=(h*(t-a)-p*(e-i))/d)*l,t+d*c]}(G,W,J,Q,Y,K,$,Z))){var ee=G-X[0],te=W-X[1],re=Y-X[0],ne=K-X[1],ie=1/l(((g=(ee*re+te*ne)/(c(ee*ee+te*te)*c(re*re+ne*ne)))>1?0:g<-1?h:Math.acos(g))/2),ae=c(X[0]*X[0]+X[1]*X[1]);U=s(N,(y-ae)/(ie-1)),V=s(N,(v-ae)/(ie+1))}}j>u?V>u?(P=b(J,Q,G,W,v,V,C),L=b(Y,K,$,Z,v,V,C),A.moveTo(P.cx+P.x01,P.cy+P.y01),V<N?A.arc(P.cx,P.cy,V,i(P.y01,P.x01),i(L.y01,L.x01),!C):(A.arc(P.cx,P.cy,V,i(P.y01,P.x01),i(P.y11,P.x11),!C),A.arc(0,0,v,i(P.cy+P.y11,P.cx+P.x11),i(L.cy+L.y11,L.cx+L.x11),!C),A.arc(L.cx,L.cy,V,i(L.y11,L.x11),i(L.y01,L.x01),!C))):(A.moveTo(G,W),A.arc(0,0,v,I,z,!C)):A.moveTo(G,W),y>u&&D>u?U>u?(P=b($,Z,Y,K,y,-U,C),L=b(G,W,J,Q,y,-U,C),A.lineTo(P.cx+P.x01,P.cy+P.y01),U<N?A.arc(P.cx,P.cy,U,i(P.y01,P.x01),i(L.y01,L.x01),!C):(A.arc(P.cx,P.cy,U,i(P.y01,P.x01),i(P.y11,P.x11),!C),A.arc(0,0,y,i(P.cy+P.y11,P.cx+P.x11),i(L.cy+L.y11,L.cx+L.x11),C),A.arc(L.cx,L.cy,U,i(L.y11,L.x11),i(L.y01,L.x01),!C))):A.arc(0,0,y,R,O,C):A.lineTo($,Z)}else A.moveTo(0,0);if(A.closePath(),r)return A=null,r+""||null}return M.centroid=function(){var t=(+e.apply(this,arguments)+ +o.apply(this,arguments))/2,r=(+k.apply(this,arguments)+ +T.apply(this,arguments))/2-h/2;return[a(r)*t,l(r)*t]},M.innerRadius=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),M):e},M.outerRadius=function(e){return arguments.length?(o="function"===typeof e?e:r(+e),M):o},M.cornerRadius=function(e){return arguments.length?(_="function"===typeof e?e:r(+e),M):_},M.padRadius=function(e){return arguments.length?(w=null==e?null:"function"===typeof e?e:r(+e),M):w},M.startAngle=function(e){return arguments.length?(k="function"===typeof e?e:r(+e),M):k},M.endAngle=function(e){return arguments.length?(T="function"===typeof e?e:r(+e),M):T},M.padAngle=function(e){return arguments.length?(S="function"===typeof e?e:r(+e),M):S},M.context=function(e){return arguments.length?(A=null==e?null:e,M):A},M},e.area=A,e.areaRadial=O,e.curveBasis=function(e){return new ce(e)},e.curveBasisClosed=function(e){return new ue(e)},e.curveBasisOpen=function(e){return new he(e)},e.curveBundle=de,e.curveCardinal=ge,e.curveCardinalClosed=ve,e.curveCardinalOpen=be,e.curveCatmullRom=ke,e.curveCatmullRomClosed=Se,e.curveCatmullRomOpen=Me,e.curveLinear=w,e.curveLinearClosed=function(e){return new Ee(e)},e.curveMonotoneX=function(e){return new ze(e)},e.curveMonotoneY=function(e){return new Oe(e)},e.curveNatural=function(e){return new De(e)},e.curveStep=function(e){return new Fe(e,.5)},e.curveStepAfter=function(e){return new Fe(e,1)},e.curveStepBefore=function(e){return new Fe(e,0)},e.line=S,e.lineRadial=z,e.linkHorizontal=function(){return B(N)},e.linkRadial=function(){var e=B(V);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e},e.linkVertical=function(){return B(U)},e.pie=function(){var e=E,t=M,n=null,i=r(0),a=r(d),o=r(0);function s(r){var s,l,c,u,h,p=r.length,f=0,m=new Array(p),g=new Array(p),y=+i.apply(this,arguments),v=Math.min(d,Math.max(-d,a.apply(this,arguments)-y)),x=Math.min(Math.abs(v)/p,o.apply(this,arguments)),b=x*(v<0?-1:1);for(s=0;s<p;++s)(h=g[m[s]=s]=+e(r[s],s,r))>0&&(f+=h);for(null!=t?m.sort((function(e,r){return t(g[e],g[r])})):null!=n&&m.sort((function(e,t){return n(r[e],r[t])})),s=0,c=f?(v-p*b)/f:0;s<p;++s,y=u)l=m[s],u=y+((h=g[l])>0?h*c:0)+b,g[l]={data:r[l],index:s,value:h,startAngle:y,endAngle:u,padAngle:x};return g}return s.value=function(t){return arguments.length?(e="function"===typeof t?t:r(+t),s):e},s.sortValues=function(e){return arguments.length?(t=e,n=null,s):t},s.sort=function(e){return arguments.length?(n=e,t=null,s):n},s.startAngle=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),s):i},s.endAngle=function(e){return arguments.length?(a="function"===typeof e?e:r(+e),s):a},s.padAngle=function(e){return arguments.length?(o="function"===typeof e?e:r(+e),s):o},s},e.pointRadial=R,e.radialArea=O,e.radialLine=z,e.stack=function(){var e=r([]),t=Ne,n=Be,i=Ue;function a(r){var a,o,s=e.apply(this,arguments),l=r.length,c=s.length,u=new Array(c);for(a=0;a<c;++a){for(var h,p=s[a],d=u[a]=new Array(l),f=0;f<l;++f)d[f]=h=[0,+i(r[f],p,f,r)],h.data=r[f];d.key=p}for(a=0,o=t(u);a<c;++a)u[o[a]].index=a;return n(u,o),u}return a.keys=function(t){return arguments.length?(e="function"===typeof t?t:r(D.call(t)),a):e},a.value=function(e){return arguments.length?(i="function"===typeof e?e:r(+e),a):i},a.order=function(e){return arguments.length?(t=null==e?Ne:"function"===typeof e?e:r(D.call(e)),a):t},a.offset=function(e){return arguments.length?(n=null==e?Be:e,a):n},a},e.stackOffsetDiverging=function(e,t){if((s=e.length)>0)for(var r,n,i,a,o,s,l=0,c=e[t[0]].length;l<c;++l)for(a=o=0,r=0;r<s;++r)(i=(n=e[t[r]][l])[1]-n[0])>0?(n[0]=a,n[1]=a+=i):i<0?(n[1]=o,n[0]=o+=i):(n[0]=0,n[1]=i)},e.stackOffsetExpand=function(e,t){if((n=e.length)>0){for(var r,n,i,a=0,o=e[0].length;a<o;++a){for(i=r=0;r<n;++r)i+=e[r][a][1]||0;if(i)for(r=0;r<n;++r)e[r][a][1]/=i}Be(e,t)}},e.stackOffsetNone=Be,e.stackOffsetSilhouette=function(e,t){if((r=e.length)>0){for(var r,n=0,i=e[t[0]],a=i.length;n<a;++n){for(var o=0,s=0;o<r;++o)s+=e[o][n][1]||0;i[n][1]+=i[n][0]=-s/2}Be(e,t)}},e.stackOffsetWiggle=function(e,t){if((i=e.length)>0&&(n=(r=e[t[0]]).length)>0){for(var r,n,i,a=0,o=1;o<n;++o){for(var s=0,l=0,c=0;s<i;++s){for(var u=e[t[s]],h=u[o][1]||0,p=(h-(u[o-1][1]||0))/2,d=0;d<s;++d){var f=e[t[d]];p+=(f[o][1]||0)-(f[o-1][1]||0)}l+=h,c+=p*h}r[o-1][1]+=r[o-1][0]=a,l&&(a-=c/l)}r[o-1][1]+=r[o-1][0]=a,Be(e,t)}},e.stackOrderAppearance=Ve,e.stackOrderAscending=He,e.stackOrderDescending=function(e){return He(e).reverse()},e.stackOrderInsideOut=function(e){var t,r,n=e.length,i=e.map(Ge),a=Ve(e),o=0,s=0,l=[],c=[];for(t=0;t<n;++t)r=a[t],o<s?(o+=i[r],l.push(r)):(s+=i[r],c.push(r));return c.reverse().concat(l)},e.stackOrderNone=Ne,e.stackOrderReverse=function(e){return Ne(e).reverse()},e.symbol=function(){var e=r(q),n=r(64),i=null;function a(){var r;if(i||(i=r=t.path()),e.apply(this,arguments).draw(i,+n.apply(this,arguments)),r)return i=null,r+""||null}return a.type=function(t){return arguments.length?(e="function"===typeof t?t:r(t),a):e},a.size=function(e){return arguments.length?(n="function"===typeof e?e:r(+e),a):n},a.context=function(e){return arguments.length?(i=null==e?null:e,a):i},a},e.symbolCircle=q,e.symbolCross=H,e.symbolDiamond=$,e.symbolSquare=J,e.symbolStar=K,e.symbolTriangle=ee,e.symbolWye=ae,e.symbols=oe,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,O_()):n((r=r||self).d3=r.d3||{},r.d3)}}),D_=p({"node_modules/@plotly/d3-sankey/build/d3-sankey.js"(e,t){var r,n;r=e,n=function(e,t,r,n){function i(e){return e.target.depth}function a(e,t){return e.sourceLinks.length?e.depth:t-1}function o(e){return function(){return e}}function s(e,t){return c(e.source,t.source)||e.index-t.index}function l(e,t){return c(e.target,t.target)||e.index-t.index}function c(e,t){return e.y0-t.y0}function u(e){return e.value}function h(e){return(e.y0+e.y1)/2}function p(e){return h(e.source)*e.value}function d(e){return h(e.target)*e.value}function f(e){return e.index}function m(e){return e.nodes}function g(e){return e.links}function y(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function v(e){return[e.source.x1,e.y0]}function x(e){return[e.target.x0,e.y1]}e.sankey=function(){var e=0,n=0,i=1,v=1,x=24,b=8,_=f,w=a,k=m,T=g,S=32,A=2/3;function M(){var a={nodes:k.apply(null,arguments),links:T.apply(null,arguments)};return function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,_);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==typeof n&&(n=e.source=y(t,n)),"object"!==typeof i&&(i=e.target=y(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(a),function(e){e.nodes.forEach((function(e){e.value=Math.max(t.sum(e.sourceLinks,u),t.sum(e.targetLinks,u))}))}(a),function(t){var r,n,a;for(r=t.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(e){e.depth=a,e.sourceLinks.forEach((function(e){n.indexOf(e.target)<0&&n.push(e.target)}))}));for(r=t.nodes,n=[],a=0;r.length;++a,r=n,n=[])r.forEach((function(e){e.height=a,e.targetLinks.forEach((function(e){n.indexOf(e.source)<0&&n.push(e.source)}))}));var o=(i-e-x)/(a-1);t.nodes.forEach((function(t){t.x1=(t.x0=e+Math.max(0,Math.min(a-1,Math.floor(w.call(null,t,a))))*o)+x}))}(a),function(e){var i=r.nest().key((function(e){return e.x0})).sortKeys(t.ascending).entries(e.nodes).map((function(e){return e.values}));s(),m();for(var a=1,o=S;o>0;--o)f(a*=.99),m(),l(a),m();function s(){var r=t.max(i,(function(e){return e.length})),a=A*(v-n)/(r-1);b>a&&(b=a);var o=t.min(i,(function(e){return(v-n-(e.length-1)*b)/t.sum(e,u)}));i.forEach((function(e){e.forEach((function(e,t){e.y1=(e.y0=t)+e.value*o}))})),e.links.forEach((function(e){e.width=e.value*o}))}function l(e){i.forEach((function(r){r.forEach((function(r){if(r.targetLinks.length){var n=(t.sum(r.targetLinks,p)/t.sum(r.targetLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function f(e){i.slice().reverse().forEach((function(r){r.forEach((function(r){if(r.sourceLinks.length){var n=(t.sum(r.sourceLinks,d)/t.sum(r.sourceLinks,u)-h(r))*e;r.y0+=n,r.y1+=n}}))}))}function m(){i.forEach((function(e){var t,r,i,a=n,o=e.length;for(e.sort(c),i=0;i<o;++i)(r=a-(t=e[i]).y0)>0&&(t.y0+=r,t.y1+=r),a=t.y1+b;if((r=a-b-v)>0)for(a=t.y0-=r,t.y1-=r,i=o-2;i>=0;--i)(r=(t=e[i]).y1+b-a)>0&&(t.y0-=r,t.y1-=r),a=t.y0}))}}(a),E(a),a}function E(e){e.nodes.forEach((function(e){e.sourceLinks.sort(l),e.targetLinks.sort(s)})),e.nodes.forEach((function(e){var t=e.y0,r=t;e.sourceLinks.forEach((function(e){e.y0=t+e.width/2,t+=e.width})),e.targetLinks.forEach((function(e){e.y1=r+e.width/2,r+=e.width}))}))}return M.update=function(e){return E(e),e},M.nodeId=function(e){return arguments.length?(_="function"===typeof e?e:o(e),M):_},M.nodeAlign=function(e){return arguments.length?(w="function"===typeof e?e:o(e),M):w},M.nodeWidth=function(e){return arguments.length?(x=+e,M):x},M.nodePadding=function(e){return arguments.length?(b=+e,M):b},M.nodes=function(e){return arguments.length?(k="function"===typeof e?e:o(e),M):k},M.links=function(e){return arguments.length?(T="function"===typeof e?e:o(e),M):T},M.size=function(t){return arguments.length?(e=n=0,i=+t[0],v=+t[1],M):[i-e,v-n]},M.extent=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],n=+t[0][1],v=+t[1][1],M):[[e,n],[i,v]]},M.iterations=function(e){return arguments.length?(S=+e,M):S},M},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,i)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=a,e.sankeyLinkHorizontal=function(){return n.linkHorizontal().source(v).target(x)},Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,pg(),P_(),R_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3)}}),j_=p({"node_modules/elementary-circuits-directed-graph/johnson.js"(e,t){var r=M_();t.exports=function(e,t){var n,i=[],a=[],o=[],s={},l=[];function c(e){o[e]=!1,s.hasOwnProperty(e)&&Object.keys(s[e]).forEach((function(t){delete s[e][t],o[t]&&c(t)}))}function u(e){var t,r,i=!1;for(a.push(e),o[e]=!0,t=0;t<l[e].length;t++)(r=l[e][t])===n?(h(n,a),i=!0):o[r]||(i=u(r));if(i)c(e);else for(t=0;t<l[e].length;t++){r=l[e][t];var p=s[r];p||(p={},s[r]=p),p[r]=!0}return a.pop(),i}function h(e,r){var n=[].concat(r).concat(e);t?t(u):i.push(n)}function p(t){!function(t){for(var r=0;r<e.length;r++)r<t&&(e[r]=[]),e[r]=e[r].filter((function(e){return e>=t}))}(t);for(var n,i=r(e).components.filter((function(e){return e.length>1})),a=1/0,o=0;o<i.length;o++)for(var s=0;s<i[o].length;s++)i[o][s]<a&&(a=i[o][s],n=o);var l=i[n];return!!l&&{leastVertex:a,adjList:e.map((function(e,t){return-1===l.indexOf(t)?[]:e.filter((function(e){return-1!==l.indexOf(e)}))}))}}n=0;for(var d=e.length;n<d;){var f=p(n);if(n=f.leastVertex,l=f.adjList){for(var m=0;m<l.length;m++)for(var g=0;g<l[m].length;g++){var y=l[m][g];o[+y]=!1,s[y]={}}u(n),n+=1}else n=d}return t?void 0:i}}}),F_=p({"node_modules/@plotly/d3-sankey-circular/dist/d3-sankey-circular.js"(e,t){var r,n;r=e,n=function(e,t,r,n,i){function a(e){return e.target.depth}function o(e,t){return e.sourceLinks.length?e.depth:t-1}function s(e){return function(){return e}}i=i&&i.hasOwnProperty("default")?i.default:i;var l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function c(e,t){return h(e.source,t.source)||e.index-t.index}function u(e,t){return h(e.target,t.target)||e.index-t.index}function h(e,t){return e.partOfCycle===t.partOfCycle?e.y0-t.y0:"top"===e.circularLinkType||"bottom"===t.circularLinkType?-1:1}function p(e){return e.value}function d(e){return(e.y0+e.y1)/2}function f(e){return d(e.source)}function m(e){return d(e.target)}function g(e){return e.index}function y(e){return e.nodes}function v(e){return e.links}function x(e,t){var r=e.get(t);if(!r)throw new Error("missing: "+t);return r}function b(e,t){return t(e)}var _=25,w=10;function k(e,t){var r=0,n=0;e.links.forEach((function(i){i.circular&&(i.source.circularLinkType||i.target.circularLinkType?i.circularLinkType=i.source.circularLinkType?i.source.circularLinkType:i.target.circularLinkType:i.circularLinkType=r<n?"top":"bottom","top"==i.circularLinkType?r+=1:n+=1,e.nodes.forEach((function(e){b(e,t)!=b(i.source,t)&&b(e,t)!=b(i.target,t)||(e.circularLinkType=i.circularLinkType)})))})),e.links.forEach((function(e){e.circular&&(e.source.circularLinkType==e.target.circularLinkType&&(e.circularLinkType=e.source.circularLinkType),H(e,t)&&(e.circularLinkType=e.source.circularLinkType))}))}function T(e){var t=Math.abs(e.y1-e.y0),r=Math.abs(e.target.x0-e.source.x1);return Math.atan(r/t)}function S(e,t){var r=0;e.sourceLinks.forEach((function(e){r=e.circular&&!H(e,t)?r+1:r}));var n=0;return e.targetLinks.forEach((function(e){n=e.circular&&!H(e,t)?n+1:n})),r+n}function A(e){var t=e.source.sourceLinks,r=0;t.forEach((function(e){r=e.circular?r+1:r}));var n=e.target.targetLinks,i=0;return n.forEach((function(e){i=e.circular?i+1:i})),!(r>1||i>1)}function M(e,t,r){return e.sort(C),e.forEach((function(n,i){var a,o,s=0;if(H(n,r)&&A(n))n.circularPathData.verticalBuffer=s+n.width/2;else{for(var l=0;l<i;l++)if(a=e[i],o=e[l],!(a.source.column<o.target.column)&&!(a.target.column>o.source.column)){var c=e[l].circularPathData.verticalBuffer+e[l].width/2+t;s=c>s?c:s}n.circularPathData.verticalBuffer=s+n.width/2}})),e}function E(e,r,i,a){var o=t.min(e.links,(function(e){return e.source.y0}));e.links.forEach((function(e){e.circular&&(e.circularPathData={})})),M(e.links.filter((function(e){return"top"==e.circularLinkType})),r,a),M(e.links.filter((function(e){return"bottom"==e.circularLinkType})),r,a),e.links.forEach((function(t){if(t.circular){if(t.circularPathData.arcRadius=t.width+w,t.circularPathData.leftNodeBuffer=5,t.circularPathData.rightNodeBuffer=5,t.circularPathData.sourceWidth=t.source.x1-t.source.x0,t.circularPathData.sourceX=t.source.x0+t.circularPathData.sourceWidth,t.circularPathData.targetX=t.target.x0,t.circularPathData.sourceY=t.y0,t.circularPathData.targetY=t.y1,H(t,a)&&A(t))t.circularPathData.leftSmallArcRadius=w+t.width/2,t.circularPathData.leftLargeArcRadius=w+t.width/2,t.circularPathData.rightSmallArcRadius=w+t.width/2,t.circularPathData.rightLargeArcRadius=w+t.width/2,"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=t.source.y1+_+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=t.source.y0-_-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius);else{var s=t.source.column,l=t.circularLinkType,c=e.links.filter((function(e){return e.source.column==s&&e.circularLinkType==l}));"bottom"==t.circularLinkType?c.sort(L):c.sort(P);var u=0;c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.leftSmallArcRadius=w+t.width/2+u,t.circularPathData.leftLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),s=t.target.column,c=e.links.filter((function(e){return e.target.column==s&&e.circularLinkType==l})),"bottom"==t.circularLinkType?c.sort(z):c.sort(I),u=0,c.forEach((function(e,n){e.circularLinkID==t.circularLinkID&&(t.circularPathData.rightSmallArcRadius=w+t.width/2+u,t.circularPathData.rightLargeArcRadius=w+t.width/2+n*r+u),u+=e.width})),"bottom"==t.circularLinkType?(t.circularPathData.verticalFullExtent=Math.max(i,t.source.y1,t.target.y1)+_+t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent-t.circularPathData.rightLargeArcRadius):(t.circularPathData.verticalFullExtent=o-_-t.circularPathData.verticalBuffer,t.circularPathData.verticalLeftInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.leftLargeArcRadius,t.circularPathData.verticalRightInnerExtent=t.circularPathData.verticalFullExtent+t.circularPathData.rightLargeArcRadius)}t.circularPathData.leftInnerExtent=t.circularPathData.sourceX+t.circularPathData.leftNodeBuffer,t.circularPathData.rightInnerExtent=t.circularPathData.targetX-t.circularPathData.rightNodeBuffer,t.circularPathData.leftFullExtent=t.circularPathData.sourceX+t.circularPathData.leftLargeArcRadius+t.circularPathData.leftNodeBuffer,t.circularPathData.rightFullExtent=t.circularPathData.targetX-t.circularPathData.rightLargeArcRadius-t.circularPathData.rightNodeBuffer}if(t.circular)t.path=function(e){return"top"==e.circularLinkType?"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 0 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY-e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 0 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 0 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY-e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 0 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY:"M"+e.circularPathData.sourceX+" "+e.circularPathData.sourceY+" L"+e.circularPathData.leftInnerExtent+" "+e.circularPathData.sourceY+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftSmallArcRadius+" 0 0 1 "+e.circularPathData.leftFullExtent+" "+(e.circularPathData.sourceY+e.circularPathData.leftSmallArcRadius)+" L"+e.circularPathData.leftFullExtent+" "+e.circularPathData.verticalLeftInnerExtent+" A"+e.circularPathData.leftLargeArcRadius+" "+e.circularPathData.leftLargeArcRadius+" 0 0 1 "+e.circularPathData.leftInnerExtent+" "+e.circularPathData.verticalFullExtent+" L"+e.circularPathData.rightInnerExtent+" "+e.circularPathData.verticalFullExtent+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightLargeArcRadius+" 0 0 1 "+e.circularPathData.rightFullExtent+" "+e.circularPathData.verticalRightInnerExtent+" L"+e.circularPathData.rightFullExtent+" "+(e.circularPathData.targetY+e.circularPathData.rightSmallArcRadius)+" A"+e.circularPathData.rightLargeArcRadius+" "+e.circularPathData.rightSmallArcRadius+" 0 0 1 "+e.circularPathData.rightInnerExtent+" "+e.circularPathData.targetY+" L"+e.circularPathData.targetX+" "+e.circularPathData.targetY}(t);else{var h=n.linkHorizontal().source((function(e){return[e.source.x0+(e.source.x1-e.source.x0),e.y0]})).target((function(e){return[e.target.x0,e.y1]}));t.path=h(t)}}))}function C(e,t){return O(e)==O(t)?"bottom"==e.circularLinkType?L(e,t):P(e,t):O(t)-O(e)}function P(e,t){return e.y0-t.y0}function L(e,t){return t.y0-e.y0}function I(e,t){return e.y1-t.y1}function z(e,t){return t.y1-e.y1}function O(e){return e.target.column-e.source.column}function R(e){return e.target.x0-e.source.x1}function D(e,t){var r=T(e),n=R(t)/Math.tan(r);return"up"==q(e)?e.y1+n:e.y1-n}function j(e,t){var r=T(e),n=R(t)/Math.tan(r);return"up"==q(e)?e.y1-n:e.y1+n}function F(e,t,r,n){e.links.forEach((function(i){if(!i.circular&&i.target.column-i.source.column>1){var a=i.source.column+1,o=i.target.column-1,s=1,l=o-a+1;for(s=1;a<=o;a++,s++)e.nodes.forEach((function(o){if(o.column==a){var c,u=s/(l+1),h=Math.pow(1-u,3),p=3*u*Math.pow(1-u,2),d=3*Math.pow(u,2)*(1-u),f=Math.pow(u,3),m=h*i.y0+p*i.y0+d*i.y1+f*i.y1,g=m-i.width/2,y=m+i.width/2;g>o.y0&&g<o.y1?(c=o.y1-g+10,c="bottom"==o.circularLinkType?c:-c,o=B(o,c,t,r),e.nodes.forEach((function(e){var i,a;b(e,n)!=b(o,n)&&e.column==o.column&&(a=e,(i=o).y0>a.y0&&i.y0<a.y1||i.y1>a.y0&&i.y1<a.y1||i.y0<a.y0&&i.y1>a.y1)&&B(e,c,t,r)}))):(y>o.y0&&y<o.y1||g<o.y0&&y>o.y1)&&(c=y-o.y0+10,o=B(o,c,t,r),e.nodes.forEach((function(e){b(e,n)!=b(o,n)&&e.column==o.column&&e.y0<o.y1&&e.y1>o.y1&&B(e,c,t,r)})))}}))}}))}function B(e,t,r,n){return e.y0+t>=r&&e.y1+t<=n&&(e.y0=e.y0+t,e.y1=e.y1+t,e.targetLinks.forEach((function(e){e.y1=e.y1+t})),e.sourceLinks.forEach((function(e){e.y0=e.y0+t}))),e}function N(e,t,r,n){e.nodes.forEach((function(i){n&&i.y+(i.y1-i.y0)>t&&(i.y=i.y-(i.y+(i.y1-i.y0)-t));var a=e.links.filter((function(e){return b(e.source,r)==b(i,r)})),o=a.length;o>1&&a.sort((function(e,t){if(!e.circular&&!t.circular){if(e.target.column==t.target.column)return e.y1-t.y1;if(!V(e,t))return e.y1-t.y1;if(e.target.column>t.target.column){var r=j(t,e);return e.y1-r}if(t.target.column>e.target.column)return j(e,t)-t.y1}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.target.column===t.target.column?e.target.y1-t.target.y1:t.target.column-e.target.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.target.column===t.target.column?t.target.y1-e.target.y1:e.target.column-t.target.column:"top"==e.circularLinkType?-1:1:void 0}));var s=i.y0;a.forEach((function(e){e.y0=s+e.width/2,s+=e.width})),a.forEach((function(e,t){if("bottom"==e.circularLinkType){for(var r=t+1,n=0;r<o;r++)n+=a[r].width;e.y0=i.y1-n-e.width/2}}))}))}function U(e,t,r){e.nodes.forEach((function(t){var n=e.links.filter((function(e){return b(e.target,r)==b(t,r)})),i=n.length;i>1&&n.sort((function(e,t){if(!e.circular&&!t.circular){if(e.source.column==t.source.column)return e.y0-t.y0;if(!V(e,t))return e.y0-t.y0;if(t.source.column<e.source.column){var r=D(t,e);return e.y0-r}if(e.source.column<t.source.column)return D(e,t)-t.y0}return e.circular&&!t.circular?"top"==e.circularLinkType?-1:1:t.circular&&!e.circular?"top"==t.circularLinkType?1:-1:e.circular&&t.circular?e.circularLinkType===t.circularLinkType&&"top"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:e.source.column-t.source.column:e.circularLinkType===t.circularLinkType&&"bottom"==e.circularLinkType?e.source.column===t.source.column?e.source.y1-t.source.y1:t.source.column-e.source.column:"top"==e.circularLinkType?-1:1:void 0}));var a=t.y0;n.forEach((function(e){e.y1=a+e.width/2,a+=e.width})),n.forEach((function(e,r){if("bottom"==e.circularLinkType){for(var a=r+1,o=0;a<i;a++)o+=n[a].width;e.y1=t.y1-o-e.width/2}}))}))}function V(e,t){return q(e)==q(t)}function q(e){return e.y0-e.y1>0?"up":"down"}function H(e,t){return b(e.source,t)==b(e.target,t)}e.sankeyCircular=function(){var e,n,a=0,b=0,T=1,A=1,M=24,C=g,P=o,L=y,I=v,z=32,O=2,R=null;function D(){var o={nodes:L.apply(null,arguments),links:I.apply(null,arguments)};!function(e){e.nodes.forEach((function(e,t){e.index=t,e.sourceLinks=[],e.targetLinks=[]}));var t=r.map(e.nodes,C);e.links.forEach((function(e,r){e.index=r;var n=e.source,i=e.target;"object"!==("undefined"===typeof n?"undefined":l(n))&&(n=e.source=x(t,n)),"object"!==("undefined"===typeof i?"undefined":l(i))&&(i=e.target=x(t,i)),n.sourceLinks.push(e),i.targetLinks.push(e)}))}(o),function(e,t,r){var n=0;if(null===r){for(var a=[],o=0;o<e.links.length;o++){var s=e.links[o],l=s.source.index,c=s.target.index;a[l]||(a[l]=[]),a[c]||(a[c]=[]),-1===a[l].indexOf(c)&&a[l].push(c)}var u=i(a);u.sort((function(e,t){return e.length-t.length}));var h={};for(o=0;o<u.length;o++){var p=u[o].slice(-2);h[p[0]]||(h[p[0]]={}),h[p[0]][p[1]]=!0}e.links.forEach((function(e){var t=e.target.index,r=e.source.index;t===r||h[r]&&h[r][t]?(e.circular=!0,e.circularLinkID=n,n+=1):e.circular=!1}))}else e.links.forEach((function(e){e.source[r]<e.target[r]?e.circular=!1:(e.circular=!0,e.circularLinkID=n,n+=1)}))}(o,0,R),function(e){e.nodes.forEach((function(e){e.partOfCycle=!1,e.value=Math.max(t.sum(e.sourceLinks,p),t.sum(e.targetLinks,p)),e.sourceLinks.forEach((function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)})),e.targetLinks.forEach((function(t){t.circular&&(e.partOfCycle=!0,e.circularLinkType=t.circularLinkType)}))}))}(o),function(e){var t,r,n;for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.depth=n,e.sourceLinks.forEach((function(e){r.indexOf(e.target)<0&&!e.circular&&r.push(e.target)}))}));for(t=e.nodes,r=[],n=0;t.length;++n,t=r,r=[])t.forEach((function(e){e.height=n,e.targetLinks.forEach((function(e){r.indexOf(e.source)<0&&!e.circular&&r.push(e.source)}))}));e.nodes.forEach((function(e){e.column=Math.floor(P.call(null,e,n))}))}(o),k(o,C),function(i,o,s){var l=r.nest().key((function(e){return e.column})).sortKeys(t.ascending).entries(i.nodes).map((function(e){return e.values}));g(s),v();for(var c=1,u=o;u>0;--u)y(c*=.99,s),v();function g(r){if(n){var o=1/0;l.forEach((function(e){var t=A*n/(e.length+1);o=t<o?t:o})),e=o}var s=t.min(l,(function(r){return(A-b-(r.length-1)*e)/t.sum(r,p)}));s*=.3,i.links.forEach((function(e){e.width=e.value*s}));var c=function(e){var r=0,n=0,i=0,a=0,o=t.max(e.nodes,(function(e){return e.column}));return e.links.forEach((function(e){e.circular&&("top"==e.circularLinkType?r+=e.width:n+=e.width,0==e.target.column&&(a+=e.width),e.source.column==o&&(i+=e.width))})),{top:r=r>0?r+_+w:r,bottom:n=n>0?n+_+w:n,left:a=a>0?a+_+w:a,right:i=i>0?i+_+w:i}}(i),u=function(e,r){var n=t.max(e.nodes,(function(e){return e.column})),i=T-a,o=A-b,s=i+r.right+r.left,l=o+r.top+r.bottom,c=i/s,u=o/l;return a=a*c+r.left,T=0==r.right?T:T*c,b=b*u+r.top,A*=u,e.nodes.forEach((function(e){e.x0=a+e.column*((T-a-M)/n),e.x1=e.x0+M})),u}(i,c);s*=u,i.links.forEach((function(e){e.width=e.value*s})),l.forEach((function(e){var t=e.length;e.forEach((function(e,n){e.depth==l.length-1&&1==t||0==e.depth&&1==t?(e.y0=A/2-e.value*s,e.y1=e.y0+e.value*s):e.partOfCycle?0==S(e,r)?(e.y0=A/2+n,e.y1=e.y0+e.value*s):"top"==e.circularLinkType?(e.y0=b+n,e.y1=e.y0+e.value*s):(e.y0=A-e.value*s-n,e.y1=e.y0+e.value*s):0==c.top||0==c.bottom?(e.y0=(A-b)/t*n,e.y1=e.y0+e.value*s):(e.y0=(A-b)/2-t/2+n,e.y1=e.y0+e.value*s)}))}))}function y(e,r){var n=l.length;l.forEach((function(i){var a=i.length,o=i[0].depth;i.forEach((function(i){var s;if(i.sourceLinks.length||i.targetLinks.length)if(i.partOfCycle&&S(i,r)>0);else if(0==o&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else if(o==n-1&&1==a)s=i.y1-i.y0,i.y0=A/2-s/2,i.y1=A/2+s/2;else{var l=t.mean(i.sourceLinks,m),c=t.mean(i.targetLinks,f),u=((l&&c?(l+c)/2:l||c)-d(i))*e;i.y0+=u,i.y1+=u}}))}))}function v(){l.forEach((function(t){var r,n,i,a=b,o=t.length;for(t.sort(h),i=0;i<o;++i)(n=a-(r=t[i]).y0)>0&&(r.y0+=n,r.y1+=n),a=r.y1+e;if((n=a-e-A)>0)for(a=r.y0-=n,r.y1-=n,i=o-2;i>=0;--i)(n=(r=t[i]).y1+e-a)>0&&(r.y0-=n,r.y1-=n),a=r.y0}))}}(o,z,C),j(o);for(var s=0;s<4;s++)N(o,A,C),U(o,0,C),F(o,b,A,C),N(o,A,C),U(o,0,C);return function(e,r,n){var i=e.nodes,a=e.links,o=!1,s=!1;if(a.forEach((function(e){"top"==e.circularLinkType?o=!0:"bottom"==e.circularLinkType&&(s=!0)})),0==o||0==s){var l=t.min(i,(function(e){return e.y0})),c=(n-r)/(t.max(i,(function(e){return e.y1}))-l);i.forEach((function(e){var t=(e.y1-e.y0)*c;e.y0=(e.y0-l)*c,e.y1=e.y0+t})),a.forEach((function(e){e.y0=(e.y0-l)*c,e.y1=(e.y1-l)*c,e.width=e.width*c}))}}(o,b,A),E(o,O,A,C),o}function j(e){e.nodes.forEach((function(e){e.sourceLinks.sort(u),e.targetLinks.sort(c)})),e.nodes.forEach((function(e){var t=e.y0,r=t,n=e.y1,i=n;e.sourceLinks.forEach((function(e){e.circular?(e.y0=n-e.width/2,n-=e.width):(e.y0=t+e.width/2,t+=e.width)})),e.targetLinks.forEach((function(e){e.circular?(e.y1=i-e.width/2,i-=e.width):(e.y1=r+e.width/2,r+=e.width)}))}))}return D.nodeId=function(e){return arguments.length?(C="function"===typeof e?e:s(e),D):C},D.nodeAlign=function(e){return arguments.length?(P="function"===typeof e?e:s(e),D):P},D.nodeWidth=function(e){return arguments.length?(M=+e,D):M},D.nodePadding=function(t){return arguments.length?(e=+t,D):e},D.nodes=function(e){return arguments.length?(L="function"===typeof e?e:s(e),D):L},D.links=function(e){return arguments.length?(I="function"===typeof e?e:s(e),D):I},D.size=function(e){return arguments.length?(a=b=0,T=+e[0],A=+e[1],D):[T-a,A-b]},D.extent=function(e){return arguments.length?(a=+e[0][0],T=+e[1][0],b=+e[0][1],A=+e[1][1],D):[[a,b],[T,A]]},D.iterations=function(e){return arguments.length?(z=+e,D):z},D.circularLinkGap=function(e){return arguments.length?(O=+e,D):O},D.nodePaddingRatio=function(e){return arguments.length?(n=+e,D):n},D.sortNodes=function(e){return arguments.length?(R=e,D):R},D.update=function(e){return k(e,C),j(e),e.links.forEach((function(e){e.circular&&(e.circularLinkType=e.y0+e.y1<A?"top":"bottom",e.source.circularLinkType=e.circularLinkType,e.target.circularLinkType=e.circularLinkType)})),N(e,A,C,!1),U(e,0,C),E(e,O,A,C),e},D},e.sankeyCenter=function(e){return e.targetLinks.length?e.depth:e.sourceLinks.length?t.min(e.sourceLinks,a)-1:0},e.sankeyLeft=function(e){return e.depth},e.sankeyRight=function(e,t){return t-1-e.height},e.sankeyJustify=o,Object.defineProperty(e,"__esModule",{value:!0})},"object"===typeof e&&"undefined"!==typeof t?n(e,pg(),P_(),R_(),j_()):n(r.d3=r.d3||{},r.d3,r.d3,r.d3,null)}}),B_=p({"src/traces/sankey/constants.js"(e,t){t.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"}}}}),N_=p({"src/traces/sankey/render.js"(e,t){var r=z_(),n=(Bd(),m(Rd)).interpolateNumber,i=v(),a=D_(),o=F_(),s=B_(),l=O(),c=q(),u=Jt(),h=st(),p=h.strTranslate,d=h.strRotate,f=Ox(),g=f.keyFun,y=f.repeat,x=f.unwrap,b=At(),_=Ve(),w=St(),k=w.CAP_SHIFT,T=w.LINE_SPACING;function S(e,t,r){var n,i=x(t),c=i.trace,u=c.domain,p="h"===c.orientation,d=c.node.pad,f=c.node.thickness,m={justify:a.sankeyJustify,left:a.sankeyLeft,right:a.sankeyRight,center:a.sankeyCenter}[c.node.align],g=e.width*(u.x[1]-u.x[0]),y=e.height*(u.y[1]-u.y[0]),v=i._nodes,b=i._links,_=i.circular;(n=_?o.sankeyCircular().circularLinkGap(0):a.sankey()).iterations(s.sankeyIterations).size(p?[g,y]:[y,g]).nodeWidth(f).nodePadding(d).nodeId((function(e){return e.pointNumber})).nodeAlign(m).nodes(v).links(b);var w,k,T,S=n();for(var A in n.nodePadding()<d&&h.warn("node.pad was reduced to ",n.nodePadding()," to fit within the figure."),i._groupLookup){var M,E=parseInt(i._groupLookup[A]);for(w=0;w<S.nodes.length;w++)if(S.nodes[w].pointNumber===E){M=S.nodes[w];break}if(M){var C={pointNumber:parseInt(A),x0:M.x0,x1:M.x1,y0:M.y0,y1:M.y1,partOfGroup:!0,sourceLinks:[],targetLinks:[]};S.nodes.unshift(C),M.childrenNodes.unshift(C)}}if(function(){for(w=0;w<S.nodes.length;w++){var e,t,r=S.nodes[w],n={};for(k=0;k<r.targetLinks.length;k++)e=(t=r.targetLinks[k]).source.pointNumber+":"+t.target.pointNumber,n.hasOwnProperty(e)||(n[e]=[]),n[e].push(t);var i=Object.keys(n);for(k=0;k<i.length;k++){var a=n[e=i[k]],o=0,s={};for(T=0;T<a.length;T++)s[(t=a[T]).label]||(s[t.label]=0),s[t.label]+=t.value,o+=t.value;for(T=0;T<a.length;T++)(t=a[T]).flow={value:o,labelConcentration:s[t.label]/o,concentration:t.value/o,links:a},t.concentrationscale&&(t.color=l(t.concentrationscale(t.flow.labelConcentration)))}var c=0;for(k=0;k<r.sourceLinks.length;k++)c+=r.sourceLinks[k].value;for(k=0;k<r.sourceLinks.length;k++)(t=r.sourceLinks[k]).concentrationOut=t.value/c;var u=0;for(k=0;k<r.targetLinks.length;k++)u+=r.targetLinks[k].value;for(k=0;k<r.targetLinks.length;k++)(t=r.targetLinks[k]).concenrationIn=t.value/u}}(),c.node.x.length&&c.node.y.length){for(w=0;w<Math.min(c.node.x.length,c.node.y.length,S.nodes.length);w++)if(c.node.x[w]&&c.node.y[w]){var P=[c.node.x[w]*g,c.node.y[w]*y];S.nodes[w].x0=P[0]-f/2,S.nodes[w].x1=P[0]+f/2;var L=S.nodes[w].y1-S.nodes[w].y0;S.nodes[w].y0=P[1]-L/2,S.nodes[w].y1=P[1]+L/2}if("snap"===c.arrangement){var I=function(e){var t,r,n=e.map((function(e,t){return{x0:e.x0,index:t}})).sort((function(e,t){return e.x0-t.x0})),i=[],a=-1,o=-1/0;for(w=0;w<n.length;w++){var s=e[n[w].index];s.x0>o+f&&(a+=1,t=s.x0),o=s.x0,i[a]||(i[a]=[]),i[a].push(s),r=t-s.x0,s.x0+=r,s.x1+=r}return i}(v=S.nodes);I.forEach((function(e){var t,r,n,i=0,a=e.length;for(e.sort((function(e,t){return e.y0-t.y0})),n=0;n<a;++n)(t=e[n]).y0>=i||(r=i-t.y0)>1e-6&&(t.y0+=r,t.y1+=r),i=t.y1+d}))}n.update(S)}return{circular:_,key:r,trace:c,guid:h.randstr(),horizontal:p,width:g,height:y,nodePad:c.node.pad,nodeLineColor:c.node.line.color,nodeLineWidth:c.node.line.width,linkLineColor:c.link.line.color,linkLineWidth:c.link.line.width,linkArrowLength:c.link.arrowlen,valueFormat:c.valueformat,valueSuffix:c.valuesuffix,textFont:c.textfont,translateX:u.x[0]*e.width+e.margin.l,translateY:e.height-u.y[1]*e.height+e.margin.t,dragParallel:p?y:g,dragPerpendicular:p?g:y,arrangement:c.arrangement,sankey:n,graph:S,forceLayouts:{},interactionState:{dragInProgress:!1,hovered:!1}}}function A(e,t,r){var n=l(t.color),i=l(t.hovercolor),a=t.source.label+"|"+t.target.label+"__"+r;return t.trace=e.trace,t.curveNumber=e.trace.index,{circular:e.circular,key:a,traceId:e.key,pointNumber:t.pointNumber,link:t,tinyColorHue:c.tinyRGB(n),tinyColorAlpha:n.getAlpha(),tinyColorHoverHue:c.tinyRGB(i),tinyColorHoverAlpha:i.getAlpha(),linkPath:M,linkLineColor:e.linkLineColor,linkLineWidth:e.linkLineWidth,linkArrowLength:e.linkArrowLength,valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,parent:e,interactionState:e.interactionState,flow:t.flow}}function M(){return function(e){var t=e.linkArrowLength;if(e.link.circular)return function(e,t){var r="",n=e.width/2,i=e.circularPathData,a=i.sourceX+i.verticalBuffer<i.targetX,o=i.rightFullExtent-i.rightLargeArcRadius-t<=i.leftFullExtent-n;return Math.abs(i.rightFullExtent-i.leftFullExtent-n),"top"===e.circularLinkType?(r="M "+(i.targetX-t)+" "+(i.targetY+n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+"A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent-n-t)+" "+(i.targetY-i.rightSmallArcRadius)+"L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" L "+(i.rightFullExtent+n-(i.rightLargeArcRadius-n)-t)+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius+n))+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent-n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalRightInnerExtent-(i.rightLargeArcRadius-n))+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY-i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.leftInnerExtent+" "+(i.sourceY-n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.sourceY-i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.leftFullExtent-n)+" "+(i.verticalFullExtent+n)+"L"+(i.rightFullExtent+n-t)+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent-n-t)+" "+(i.verticalFullExtent-n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY-i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" L "+(i.targetX-t)+" "+(i.targetY-n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"):(r="M "+(i.targetX-t)+" "+(i.targetY-n)+" L "+(i.rightInnerExtent-t)+" "+(i.targetY-n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightSmallArcRadius+n)+" 0 0 0 "+(i.rightFullExtent-n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" L "+(i.rightFullExtent-n-t)+" "+i.verticalRightInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-n-t)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent+n-t-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:a?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent-t-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.leftFullExtent+n+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent:" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent+n)+" L "+i.leftInnerExtent+" "+(i.verticalFullExtent+n)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+i.verticalLeftInnerExtent,r+=" L "+(i.leftFullExtent+n)+" "+(i.sourceY+i.leftSmallArcRadius)+" A "+(i.leftLargeArcRadius+n)+" "+(i.leftSmallArcRadius+n)+" 0 0 0 "+i.leftInnerExtent+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY-n)+" L "+i.sourceX+" "+(i.sourceY+n)+" L "+i.leftInnerExtent+" "+(i.sourceY+n)+" A "+(i.leftLargeArcRadius-n)+" "+(i.leftSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n)+" "+(i.sourceY+i.leftSmallArcRadius)+" L "+(i.leftFullExtent-n)+" "+i.verticalLeftInnerExtent,r+=a&&o?" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.leftFullExtent-n-(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" L "+(i.rightFullExtent+n-t+(i.rightLargeArcRadius-n))+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:a?" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.leftFullExtent+n)+" "+(i.verticalFullExtent+n)+" L "+(i.rightFullExtent-t-n)+" "+(i.verticalFullExtent+n)+" A "+(i.rightLargeArcRadius+n)+" "+(i.rightLargeArcRadius+n)+" 0 0 0 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent:" A "+(i.leftLargeArcRadius-n)+" "+(i.leftLargeArcRadius-n)+" 0 0 1 "+i.leftInnerExtent+" "+(i.verticalFullExtent-n)+" L "+(i.rightInnerExtent-t)+" "+(i.verticalFullExtent-n)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightLargeArcRadius-n)+" 0 0 1 "+(i.rightFullExtent+n-t)+" "+i.verticalRightInnerExtent,r+=" L "+(i.rightFullExtent+n-t)+" "+(i.targetY+i.rightSmallArcRadius)+" A "+(i.rightLargeArcRadius-n)+" "+(i.rightSmallArcRadius-n)+" 0 0 1 "+(i.rightInnerExtent-t)+" "+(i.targetY+n)+" L "+(i.targetX-t)+" "+(i.targetY+n)+(t>0?" L "+i.targetX+" "+i.targetY:"")+"Z"),r}(e.link,t);var r=Math.abs((e.link.target.x0-e.link.source.x1)/2);t>r&&(t=r);var i=e.link.source.x1,a=e.link.target.x0-t,o=n(i,a),s=o(.5),l=o(.5),c=e.link.y0-e.link.width/2,u=e.link.y0+e.link.width/2,h=e.link.y1-e.link.width/2,p=e.link.y1+e.link.width/2,d="M"+i+","+c,f="C"+s+","+c+" "+l+","+h+" "+a+","+h,m="C"+l+","+p+" "+s+","+u+" "+i+","+u,g=t>0?"L"+(a+t)+","+(h+e.link.width/2):"";return d+f+(g+="L"+a+","+p)+m+"Z"}}function E(e,t){var r=l(t.color),n=s.nodePadAcross,i=e.nodePad/2;t.dx=t.x1-t.x0,t.dy=t.y1-t.y0;var a=t.dx,o=Math.max(.5,t.dy),u="node_"+t.pointNumber;return t.group&&(u=h.randstr()),t.trace=e.trace,t.curveNumber=e.trace.index,{index:t.pointNumber,key:u,partOfGroup:t.partOfGroup||!1,group:t.group,traceId:e.key,trace:e.trace,node:t,nodePad:e.nodePad,nodeLineColor:e.nodeLineColor,nodeLineWidth:e.nodeLineWidth,textFont:e.textFont,size:e.horizontal?e.height:e.width,visibleWidth:Math.ceil(a),visibleHeight:o,zoneX:-n,zoneY:-i,zoneWidth:a+2*n,zoneHeight:o+2*i,labelY:e.horizontal?t.dy/2+1:t.dx/2+1,left:1===t.originalLayer,sizeAcross:e.width,forceLayouts:e.forceLayouts,horizontal:e.horizontal,darkBackground:r.getBrightness()<=128,tinyColorHue:c.tinyRGB(r),tinyColorAlpha:r.getAlpha(),valueFormat:e.valueFormat,valueSuffix:e.valueSuffix,sankey:e.sankey,graph:e.graph,arrangement:e.arrangement,uniqueNodeLabelPathId:[e.guid,e.key,u].join("_"),interactionState:e.interactionState,figure:e}}function C(e){e.attr("transform",(function(e){return p(e.node.x0.toFixed(3),e.node.y0.toFixed(3))}))}function P(e){e.call(C)}function L(e,t){e.call(P),t.attr("d",M())}function I(e){e.attr("width",(function(e){return e.node.x1-e.node.x0})).attr("height",(function(e){return e.visibleHeight}))}function z(e){return e.link.width>1||e.linkLineWidth>0}function R(e){return p(e.translateX,e.translateY)+(e.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function D(e,t,r){e.on(".basic",null).on("mouseover.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.hover(this,e,t),e.interactionState.hovered=[this,e])})).on("mousemove.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.follow(this,e),e.interactionState.hovered=[this,e])})).on("mouseout.basic",(function(e){e.interactionState.dragInProgress||e.partOfGroup||(r.unhover(this,e,t),e.interactionState.hovered=!1)})).on("click.basic",(function(e){e.interactionState.hovered&&(r.unhover(this,e,t),e.interactionState.hovered=!1),e.interactionState.dragInProgress||e.partOfGroup||r.select(this,e,t)}))}function j(e,t,n,a){var o=i.behavior.drag().origin((function(e){return{x:e.node.x0+e.visibleWidth/2,y:e.node.y0+e.visibleHeight/2}})).on("dragstart",(function(i){if("fixed"!==i.arrangement&&(h.ensureSingle(a._fullLayout._infolayer,"g","dragcover",(function(e){a._fullLayout._dragCover=e})),h.raiseToTop(this),i.interactionState.dragInProgress=i.node,B(i.node),i.interactionState.hovered&&(n.nodeEvents.unhover.apply(0,i.interactionState.hovered),i.interactionState.hovered=!1),"snap"===i.arrangement)){var o=i.traceId+"|"+i.key;i.forceLayouts[o]?i.forceLayouts[o].alpha(1):function(e,t,n){!function(e){for(var t=0;t<e.length;t++)e[t].y=(e[t].y0+e[t].y1)/2,e[t].x=(e[t].x0+e[t].x1)/2}(n.graph.nodes);var i=n.graph.nodes.filter((function(e){return e.originalX===n.node.originalX})).filter((function(e){return!e.partOfGroup}));n.forceLayouts[t]=r.forceSimulation(i).alphaDecay(0).force("collide",r.forceCollide().radius((function(e){return e.dy/2+n.nodePad/2})).strength(1).iterations(s.forceIterations)).force("constrain",function(e,t,r,n){return function(){for(var e=0,i=0;i<r.length;i++){var a=r[i];a===n.interactionState.dragInProgress?(a.x=a.lastDraggedX,a.y=a.lastDraggedY):(a.vx=(a.originalX-a.x)/s.forceTicksPerFrame,a.y=Math.min(n.size-a.dy/2,Math.max(a.dy/2,a.y))),e=Math.max(e,Math.abs(a.vx),Math.abs(a.vy))}!n.interactionState.dragInProgress&&e<.1&&n.forceLayouts[t].alpha()>0&&n.forceLayouts[t].alpha(0)}}(0,t,i,n)).stop()}(0,o,i),function(e,t,r,n,i){window.requestAnimationFrame((function a(){var o;for(o=0;o<s.forceTicksPerFrame;o++)r.forceLayouts[n].tick();if(function(e){for(var t=0;t<e.length;t++)e[t].y0=e[t].y-e[t].dy/2,e[t].y1=e[t].y0+e[t].dy,e[t].x0=e[t].x-e[t].dx/2,e[t].x1=e[t].x0+e[t].dx}(r.graph.nodes),r.sankey.update(r.graph),L(e.filter(N(r)),t),r.forceLayouts[n].alpha()>0)window.requestAnimationFrame(a);else{var l=r.node.originalX;r.node.x0=l-r.visibleWidth/2,r.node.x1=l+r.visibleWidth/2,F(r,i)}}))}(e,t,i,o,a)}})).on("drag",(function(r){if("fixed"!==r.arrangement){var n=i.event.x,a=i.event.y;"snap"===r.arrangement?(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2,r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2):("freeform"===r.arrangement&&(r.node.x0=n-r.visibleWidth/2,r.node.x1=n+r.visibleWidth/2),a=Math.max(0,Math.min(r.size-r.visibleHeight/2,a)),r.node.y0=a-r.visibleHeight/2,r.node.y1=a+r.visibleHeight/2),B(r.node),"snap"!==r.arrangement&&(r.sankey.update(r.graph),L(e.filter(N(r)),t))}})).on("dragend",(function(e){if("fixed"!==e.arrangement){e.interactionState.dragInProgress=!1;for(var t=0;t<e.node.childrenNodes.length;t++)e.node.childrenNodes[t].x=e.node.x,e.node.childrenNodes[t].y=e.node.y;"snap"!==e.arrangement&&F(e,a)}}));e.on(".drag",null).call(o)}function F(e,t){for(var r=[],n=[],i=0;i<e.graph.nodes.length;i++){var a=(e.graph.nodes[i].x0+e.graph.nodes[i].x1)/2,o=(e.graph.nodes[i].y0+e.graph.nodes[i].y1)/2;r.push(a/e.figure.width),n.push(o/e.figure.height)}_.call("_guiRestyle",t,{"node.x":[r],"node.y":[n]},e.trace.index).then((function(){t._fullLayout._dragCover&&t._fullLayout._dragCover.remove()}))}function B(e){e.lastDraggedX=e.x0+e.dx/2,e.lastDraggedY=e.y0+e.dy/2}function N(e){return function(t){return t.node.originalX===e.node.originalX}}t.exports=function(e,t,r,n,a){var o=e._context.staticPlot,f=!1;h.ensureSingle(e._fullLayout._infolayer,"g","first-render",(function(){f=!0}));var m=e._fullLayout._dragCover,v=r.filter((function(e){return x(e).trace.visible})).map(S.bind(null,n)),_=t.selectAll("."+s.cn.sankey).data(v,g);_.exit().remove(),_.enter().append("g").classed(s.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events",o?"none":"auto").attr("transform",R),_.each((function(t,r){e._fullData[r]._sankey=t;var n="bgsankey-"+t.trace.uid+"-"+r;h.ensureSingle(e._fullLayout._draggers,"rect",n),e._fullData[r]._bgRect=i.select("."+n),e._fullData[r]._bgRect.style("pointer-events",o?"none":"all").attr("width",t.width).attr("height",t.height).attr("x",t.translateX).attr("y",t.translateY).classed("bgsankey",!0).style({fill:"transparent","stroke-width":0})})),_.transition().ease(s.ease).duration(s.duration).attr("transform",R);var w=_.selectAll("."+s.cn.sankeyLinks).data(y,g);w.enter().append("g").classed(s.cn.sankeyLinks,!0).style("fill","none");var P=w.selectAll("."+s.cn.sankeyLink).data((function(e){return e.graph.links.filter((function(e){return e.value})).map(A.bind(null,e))}),g);P.enter().append("path").classed(s.cn.sankeyLink,!0).call(D,_,a.linkEvents),P.style("stroke",(function(e){return z(e)?c.tinyRGB(l(e.linkLineColor)):e.tinyColorHue})).style("stroke-opacity",(function(e){return z(e)?c.opacity(e.linkLineColor):e.tinyColorAlpha})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})).style("stroke-width",(function(e){return z(e)?e.linkLineWidth:1})).attr("d",M()),P.style("opacity",(function(){return e._context.staticPlot||f||m?1:0})).transition().ease(s.ease).duration(s.duration).style("opacity",1),P.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var L=_.selectAll("."+s.cn.sankeyNodeSet).data(y,g);L.enter().append("g").classed(s.cn.sankeyNodeSet,!0),L.style("cursor",(function(e){switch(e.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}}));var O=L.selectAll("."+s.cn.sankeyNode).data((function(e){var t=e.graph.nodes;return function(e){var t,r=[];for(t=0;t<e.length;t++)e[t].originalX=(e[t].x0+e[t].x1)/2,e[t].originalY=(e[t].y0+e[t].y1)/2,-1===r.indexOf(e[t].originalX)&&r.push(e[t].originalX);for(r.sort((function(e,t){return e-t})),t=0;t<e.length;t++)e[t].originalLayerIndex=r.indexOf(e[t].originalX),e[t].originalLayer=e[t].originalLayerIndex/(r.length-1)}(t),t.map(E.bind(null,e))}),g);O.enter().append("g").classed(s.cn.sankeyNode,!0).call(C).style("opacity",(function(t){return!e._context.staticPlot&&!f||t.partOfGroup?0:1})),O.call(D,_,a.nodeEvents).call(j,P,a,e),O.transition().ease(s.ease).duration(s.duration).call(C).style("opacity",(function(e){return e.partOfGroup?0:1})),O.exit().transition().ease(s.ease).duration(s.duration).style("opacity",0).remove();var F=O.selectAll("."+s.cn.nodeRect).data(y);F.enter().append("rect").classed(s.cn.nodeRect,!0).call(I),F.style("stroke-width",(function(e){return e.nodeLineWidth})).style("stroke",(function(e){return c.tinyRGB(l(e.nodeLineColor))})).style("stroke-opacity",(function(e){return c.opacity(e.nodeLineColor)})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),F.transition().ease(s.ease).duration(s.duration).call(I);var B=O.selectAll("."+s.cn.nodeLabel).data(y);B.enter().append("text").classed(s.cn.nodeLabel,!0).style("cursor","default"),B.attr("data-notex",1).text((function(e){return e.node.label})).each((function(t){var r=i.select(this);u.font(r,t.textFont),b.convertToTspans(r,e)})).attr("text-anchor",(function(e){return e.horizontal&&e.left?"end":"start"})).attr("transform",(function(e){var t=i.select(this),r=b.lineCount(t),n=e.textFont.size*((r-1)*T-k),a=e.nodeLineWidth/2+3,o=((e.horizontal?e.visibleHeight:e.visibleWidth)-n)/2;e.horizontal&&(e.left?a=-a:a+=e.visibleWidth);var s=e.horizontal?"":"scale(-1,1)"+d(90);return p(e.horizontal?a:o,e.horizontal?o:a)+s})),B.transition().ease(s.ease).duration(s.duration)}}}),U_=p({"src/traces/sankey/plot.js"(e,t){var r=v(),n=st(),i=n.numberFormat,a=N_(),o=zr(),s=q(),l=B_().cn,c=n._;function u(e){return""!==e}function h(e,t){return e.filter((function(e){return e.key===t.traceId}))}function p(e,t){r.select(e).select("path").style("fill-opacity",t),r.select(e).select("rect").style("fill-opacity",t)}function d(e){r.select(e).select("text.name").style("fill","black")}function f(e){return function(t){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function m(e){return function(t){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function g(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(f(t)).call(x.bind(0,t,r,!1))}function y(e,t,r){t&&r&&h(r,t).selectAll("."+l.sankeyLink).filter(f(t)).call(b.bind(0,t,r,!1))}function x(e,t,r,n){n.style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(t,e).selectAll("."+l.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverHue})).style("fill-opacity",(function(e){if(!e.link.concentrationscale)return e.tinyColorHoverAlpha}))})),r&&h(t,e).selectAll("."+l.sankeyNode).filter(m(e)).call(g)}function b(e,t,r,n){n.style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha})),n.each((function(r){var n=r.link.label;""!==n&&h(t,e).selectAll("."+l.sankeyLink).filter((function(e){return e.link.label===n})).style("fill",(function(e){return e.tinyColorHue})).style("fill-opacity",(function(e){return e.tinyColorAlpha}))})),r&&h(t,e).selectAll(l.sankeyNode).filter(m(e)).call(y)}function _(e,t){var r=e.hoverlabel||{},i=n.nestedProperty(r,t).get();return!Array.isArray(i)&&i}t.exports=function(e,t){for(var n=e._fullLayout,h=n._paper,f=n._size,m=0;m<e._fullData.length;m++)if(e._fullData[m].visible&&e._fullData[m].type===l.sankey&&!e._fullData[m]._viewInitial){var v=e._fullData[m].node;e._fullData[m]._viewInitial={node:{groups:v.groups.slice(),x:v.x.slice(),y:v.y.slice()}}}var w=c(e,"source:")+" ",k=c(e,"target:")+" ",T=c(e,"concentration:")+" ",S=c(e,"incoming flow count:")+" ",A=c(e,"outgoing flow count:")+" ";a(e,h,t,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{linkEvents:{hover:function(t,n,i){!1!==e._fullLayout.hovermode&&(r.select(t).call(x.bind(0,n,i,!0)),"skip"!==n.link.trace.link.hoverinfo&&(n.link.fullData=n.link.trace,e.emit("plotly_hover",{event:r.event,points:[n.link]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var l=a.link.trace.link;if("none"!==l.hoverinfo&&"skip"!==l.hoverinfo){for(var c=[],h=0,f=0;f<a.flow.links.length;f++){var m=a.flow.links[f];if("closest"!==e._fullLayout.hovermode||a.link.pointNumber===m.pointNumber){a.link.pointNumber===m.pointNumber&&(h=f),m.fullData=m.trace,l=a.link.trace.link;var g=v(m),y={valueLabel:i(a.valueFormat)(m.value)+a.valueSuffix};c.push({x:g[0],y:g[1],name:y.valueLabel,text:[m.label||"",w+m.source.label,k+m.target.label,m.concentrationscale?T+i("%0.2f")(m.flow.labelConcentration):""].filter(u).join("<br>"),color:_(l,"bgcolor")||s.addOpacity(m.color,1),borderColor:_(l,"bordercolor"),fontFamily:_(l,"font.family"),fontSize:_(l,"font.size"),fontColor:_(l,"font.color"),fontWeight:_(l,"font.weight"),fontStyle:_(l,"font.style"),fontVariant:_(l,"font.variant"),fontTextcase:_(l,"font.textcase"),fontLineposition:_(l,"font.lineposition"),fontShadow:_(l,"font.shadow"),nameLength:_(l,"namelength"),textAlign:_(l,"align"),idealAlign:r.event.x<g[0]?"right":"left",hovertemplate:l.hovertemplate,hovertemplateLabels:y,eventData:[m]})}}o.loneHover(c,{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e,anchorIndex:h}).each((function(){a.link.concentrationscale||p(this,.65),d(this)}))}}function v(e){var t,r;e.circular?(t=(e.circularPathData.leftInnerExtent+e.circularPathData.rightInnerExtent)/2,r=e.circularPathData.verticalFullExtent):(t=(e.source.x1+e.target.x0)/2,r=(e.y0+e.y1)/2);var n=[t,r];return"v"===e.trace.orientation&&n.reverse(),n[0]+=a.parent.translateX,n[1]+=a.parent.translateY,n}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(b.bind(0,i,a,!0)),"skip"!==i.link.trace.link.hoverinfo&&(i.link.fullData=i.link.trace,e.emit("plotly_unhover",{event:r.event,points:[i.link]})),o.loneUnhover(n._hoverlayer.node()))},select:function(t,n){var i=n.link;i.originalEvent=r.event,e._hoverdata=[i],o.click(e,{target:!0})}},nodeEvents:{hover:function(t,n,i){!1!==e._fullLayout.hovermode&&(r.select(t).call(g,n,i),"skip"!==n.node.trace.node.hoverinfo&&(n.node.fullData=n.node.trace,e.emit("plotly_hover",{event:r.event,points:[n.node]})))},follow:function(t,a){if(!1!==e._fullLayout.hovermode){var s=a.node.trace.node;if("none"!==s.hoverinfo&&"skip"!==s.hoverinfo){var c=r.select(t).select("."+l.nodeRect),h=e._fullLayout._paperdiv.node().getBoundingClientRect(),f=c.node().getBoundingClientRect(),m=f.left-2-h.left,g=f.right+2-h.left,y=f.top+f.height/4-h.top,v={valueLabel:i(a.valueFormat)(a.node.value)+a.valueSuffix};a.node.fullData=a.node.trace,e._fullLayout._calcInverseTransform(e);var x=e._fullLayout._invScaleX,b=e._fullLayout._invScaleY,w=o.loneHover({x0:x*m,x1:x*g,y:b*y,name:i(a.valueFormat)(a.node.value)+a.valueSuffix,text:[a.node.label,S+a.node.targetLinks.length,A+a.node.sourceLinks.length].filter(u).join("<br>"),color:_(s,"bgcolor")||a.tinyColorHue,borderColor:_(s,"bordercolor"),fontFamily:_(s,"font.family"),fontSize:_(s,"font.size"),fontColor:_(s,"font.color"),fontWeight:_(s,"font.weight"),fontStyle:_(s,"font.style"),fontVariant:_(s,"font.variant"),fontTextcase:_(s,"font.textcase"),fontLineposition:_(s,"font.lineposition"),fontShadow:_(s,"font.shadow"),nameLength:_(s,"namelength"),textAlign:_(s,"align"),idealAlign:"left",hovertemplate:s.hovertemplate,hovertemplateLabels:v,eventData:[a.node]},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:e});p(w,.85),d(w)}}},unhover:function(t,i,a){!1!==e._fullLayout.hovermode&&(r.select(t).call(y,i,a),"skip"!==i.node.trace.node.hoverinfo&&(i.node.fullData=i.node.trace,e.emit("plotly_unhover",{event:r.event,points:[i.node]})),o.loneUnhover(n._hoverlayer.node()))},select:function(t,n,i){var a=n.node;a.originalEvent=r.event,e._hoverdata=[a],r.select(t).call(y,n,i),o.click(e,{target:!0})}}})}}}),V_=p({"src/traces/sankey/base_plot.js"(e){var t=Le().overrideAll,r=_t().getModuleCalcData,n=U_(),i=F(),a=pr(),o=hr(),s=Mn().prepSelect,l=st(),c=Ve(),u="sankey";function h(e,t){var r=e._fullData[t],n=e._fullLayout,i=n.dragmode,u="pan"===n.dragmode?"move":"crosshair",h=r._bgRect;if(h&&"pan"!==i&&"zoom"!==i){a(h,u);var p={_id:"x",c2p:l.identity,_offset:r._sankey.translateX,_length:r._sankey.width},d={_id:"y",c2p:l.identity,_offset:r._sankey.translateY,_length:r._sankey.height},f={gd:e,element:h.node(),plotinfo:{id:t,xaxis:p,yaxis:d,fillRangeItems:l.noop},subplot:t,xaxes:[p],yaxes:[d],doneFnCompleted:function(r){var n,i=e._fullData[t],a=i.node.groups.slice(),o=[];function s(e){for(var t=i._sankey.graph.nodes,r=0;r<t.length;r++)if(t[r].pointNumber===e)return t[r]}for(var l=0;l<r.length;l++){var u=s(r[l].pointNumber);if(u)if(u.group){for(var h=0;h<u.childrenNodes.length;h++)o.push(u.childrenNodes[h].pointNumber);a[u.pointNumber-i.node._count]=!1}else o.push(u.pointNumber)}n=a.filter(Boolean).concat([o]),c.call("_guiRestyle",e,{"node.groups":[n]},t)},prepFn:function(e,t,r){s(e,t,r,f,i)}};o.init(f)}}e.name=u,e.baseLayoutAttrOverrides=t({hoverlabel:i.hoverlabel},"plot","nested"),e.plot=function(t){var i=r(t.calcdata,u)[0];n(t,i),e.updateFx(t)},e.clean=function(e,t,r,n){var i=n._has&&n._has(u),a=t._has&&t._has(u);i&&!a&&(n._paperdiv.selectAll(".sankey").remove(),n._paperdiv.selectAll(".bgsankey").remove())},e.updateFx=function(e){for(var t=0;t<e._fullData.length;t++)h(e,t)}}}),q_=p({"src/traces/sankey/select.js"(e,t){t.exports=function(e,t){for(var r=[],n=e.cd[0].trace,i=n._sankey.graph.nodes,a=0;a<i.length;a++){var o=i[a];if(!o.partOfGroup){var s=[(o.x0+o.x1)/2,(o.y0+o.y1)/2];"v"===n.orientation&&s.reverse(),t&&t.contains(s,!1,a,e)&&r.push({pointNumber:o.pointNumber})}}return r}}}),H_=p({"src/traces/sankey/index.js"(e,t){t.exports={attributes:S_(),supplyDefaults:A_(),calc:E_(),plot:U_(),moduleType:"trace",name:"sankey",basePlotModule:V_(),selectPoints:q_(),categories:["noOpacity"],meta:{}}}}),G_=p({"lib/sankey.js"(e,t){t.exports=H_()}}),W_=p({"src/traces/indicator/base_plot.js"(e){var t=kt();e.name="indicator",e.plot=function(r,n,i,a){t.plotBasePlot(e.name,r,n,i,a)},e.clean=function(r,n,i,a){t.cleanBasePlot(e.name,r,n,i,a)}}}),$_=p({"src/traces/indicator/attributes.js"(e,t){var r=R().extendFlat,n=R().extendDeep,i=Le().overrideAll,a=D(),o=V(),s=ka().attributes,l=Ct(),c=gt().templatedArray,u=Tl(),h=Et().descriptionOnlyNumbers,p=a({editType:"plot",colorEditType:"plot"}),d={color:{valType:"color",editType:"plot"},line:{color:{valType:"color",dflt:o.defaultLine,editType:"plot"},width:{valType:"number",min:0,dflt:0,editType:"plot"},editType:"calc"},thickness:{valType:"number",min:0,max:1,dflt:1,editType:"plot"},editType:"calc"},f={valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],editType:"plot"},m=c("step",n({},d,{range:f}));t.exports={mode:{valType:"flaglist",editType:"calc",flags:["number","delta","gauge"],dflt:"number"},value:{valType:"number",editType:"calc",anim:!0},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},domain:s({name:"indicator",trace:!0,editType:"calc"}),title:{text:{valType:"string",editType:"plot"},align:{valType:"enumerated",values:["left","center","right"],editType:"plot"},font:r({},p,{}),editType:"plot"},number:{valueformat:{valType:"string",dflt:"",editType:"plot",description:h("value")},font:r({},p,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"plot"},delta:{reference:{valType:"number",editType:"calc"},position:{valType:"enumerated",values:["top","bottom","left","right"],dflt:"bottom",editType:"plot"},relative:{valType:"boolean",editType:"plot",dflt:!1},valueformat:{valType:"string",editType:"plot",description:h("value")},increasing:{symbol:{valType:"string",dflt:u.INCREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.INCREASING.COLOR,editType:"plot"},editType:"plot"},decreasing:{symbol:{valType:"string",dflt:u.DECREASING.SYMBOL,editType:"plot"},color:{valType:"color",dflt:u.DECREASING.COLOR,editType:"plot"},editType:"plot"},font:r({},p,{}),prefix:{valType:"string",dflt:"",editType:"plot"},suffix:{valType:"string",dflt:"",editType:"plot"},editType:"calc"},gauge:{shape:{valType:"enumerated",editType:"plot",dflt:"angular",values:["angular","bullet"]},bar:n({},d,{color:{dflt:"green"}}),bgcolor:{valType:"color",editType:"plot"},bordercolor:{valType:"color",dflt:o.defaultLine,editType:"plot"},borderwidth:{valType:"number",min:0,dflt:1,editType:"plot"},axis:i({range:f,visible:r({},l.visible,{dflt:!0}),tickmode:l.minor.tickmode,nticks:l.nticks,tick0:l.tick0,dtick:l.dtick,tickvals:l.tickvals,ticktext:l.ticktext,ticks:r({},l.ticks,{dflt:"outside"}),ticklen:l.ticklen,tickwidth:l.tickwidth,tickcolor:l.tickcolor,ticklabelstep:l.ticklabelstep,showticklabels:l.showticklabels,labelalias:l.labelalias,tickfont:a({}),tickangle:l.tickangle,tickformat:l.tickformat,tickformatstops:l.tickformatstops,tickprefix:l.tickprefix,showtickprefix:l.showtickprefix,ticksuffix:l.ticksuffix,showticksuffix:l.showticksuffix,separatethousands:l.separatethousands,exponentformat:l.exponentformat,minexponent:l.minexponent,showexponent:l.showexponent,editType:"plot"},"plot"),steps:m,threshold:{line:{color:r({},d.line.color,{}),width:r({},d.line.width,{dflt:1}),editType:"plot"},thickness:r({},d.thickness,{dflt:.85}),value:{valType:"number",editType:"calc",dflt:!1},editType:"plot"},editType:"plot"}}}}),Z_=p({"src/traces/indicator/constants.js"(e,t){t.exports={defaultNumberFontSize:80,bulletNumberDomainSize:.25,bulletPadding:.025,innerRadius:.75,valueThickness:.5,titlePadding:5,horizontalPadding:10}}}),X_=p({"src/traces/indicator/defaults.js"(e,t){var r=st(),n=$_(),i=ka().defaults,a=gt(),o=Ft(),s=Z_(),l=Rt(),c=Dt(),u=Bt(),h=Nt();function p(e,t){function i(i,a){return r.coerce(e,t,n.gauge.steps,i,a)}i("color"),i("line.color"),i("line.width"),i("range"),i("thickness")}t.exports={supplyDefaults:function(e,t,d,f){function m(i,a){return r.coerce(e,t,n,i,a)}i(t,f,m),m("mode"),t._hasNumber=-1!==t.mode.indexOf("number"),t._hasDelta=-1!==t.mode.indexOf("delta"),t._hasGauge=-1!==t.mode.indexOf("gauge");var g=m("value");t._range=[0,"number"===typeof g?1.5*g:1];var y,v,x=new Array(2);if(t._hasNumber){m("number.valueformat");var b=r.extendFlat({},f.font);b.size=void 0,r.coerceFont(m,"number.font",b),void 0===t.number.font.size&&(t.number.font.size=s.defaultNumberFontSize,x[0]=!0),m("number.prefix"),m("number.suffix"),y=t.number.font.size}if(t._hasDelta){var _=r.extendFlat({},f.font);_.size=void 0,r.coerceFont(m,"delta.font",_),void 0===t.delta.font.size&&(t.delta.font.size=(t._hasNumber?.5:1)*(y||s.defaultNumberFontSize),x[1]=!0),m("delta.reference",t.value),m("delta.relative"),m("delta.valueformat",t.delta.relative?"2%":""),m("delta.increasing.symbol"),m("delta.increasing.color"),m("delta.decreasing.symbol"),m("delta.decreasing.color"),m("delta.position"),m("delta.prefix"),m("delta.suffix"),v=t.delta.font.size}t._scaleNumbers=(!t._hasNumber||x[0])&&(!t._hasDelta||x[1])||!1;var w,k,T,S,A=r.extendFlat({},f.font);function M(e,t){return r.coerce(w,k,n.gauge,e,t)}function E(e,t){return r.coerce(T,S,n.gauge.axis,e,t)}if(A.size=.25*(y||v||s.defaultNumberFontSize),r.coerceFont(m,"title.font",A),m("title.text"),t._hasGauge){(w=e.gauge)||(w={}),k=a.newContainer(t,"gauge"),M("shape"),(t._isBullet="bullet"===t.gauge.shape)||m("title.align","center"),(t._isAngular="angular"===t.gauge.shape)||m("align","center"),M("bgcolor",f.paper_bgcolor),M("borderwidth"),M("bordercolor"),M("bar.color"),M("bar.line.color"),M("bar.line.width"),M("bar.thickness",s.valueThickness*("bullet"===t.gauge.shape?.5:1)),o(w,k,{name:"steps",handleItemDefaults:p}),M("threshold.value"),M("threshold.thickness"),M("threshold.line.width"),M("threshold.line.color"),T={},w&&(T=w.axis||{}),S=a.newContainer(k,"axis"),E("visible"),t._range=E("range",t._range);var C={font:f.font,noAutotickangles:!0,outerTicks:!0,noTicklabelshift:!0,noTicklabelstandoff:!0};l(T,S,E,"linear"),h(T,S,E,"linear",C),u(T,S,E,"linear",C),c(T,S,E,C)}else m("title.align","center"),m("align","center"),t._isAngular=t._isBullet=!1;t._length=null}}}}),Y_=p({"src/traces/indicator/calc.js"(e,t){t.exports={calc:function(e,t){var r=[],n=t.value;"number"!==typeof t._lastValue&&(t._lastValue=t.value);var i=t._lastValue,a=i;return t._hasDelta&&"number"===typeof t.delta.reference&&(a=t.delta.reference),r[0]={y:n,lastY:i,delta:n-a,relativeDelta:(n-a)/a},r}}}}),K_=p({"src/traces/indicator/plot.js"(e,t){var r=v(),n=(Bd(),m(Rd)).interpolate,i=(Bd(),m(Rd)).interpolateNumber,a=st(),o=a.strScale,s=a.strTranslate,l=a.rad2deg,c=St().MID_SHIFT,u=Jt(),h=Z_(),p=At(),d=nr(),f=wi(),g=ki(),y=Ct(),x=q(),b={left:"start",center:"middle",right:"end"},_={left:0,center:.5,right:1},w=/[yzafpn\xb5mkMGTPEZY]/;function k(e){return e&&e.duration>0}function T(e){e.each((function(e){x.stroke(r.select(this),e.line.color)})).each((function(e){x.fill(r.select(this),e.color)})).style("stroke-width",(function(e){return e.line.width}))}function S(e,t,r){var n=e._fullLayout,i=a.extendFlat({type:"linear",ticks:"outside",range:r,showline:!0},t),o={type:"linear",_id:"x"+t._id},s={letter:"x",font:n.font,noAutotickangles:!0,noHover:!0,noTickson:!0};function l(e,t){return a.coerce(i,o,y,e,t)}return f(i,o,l,s,n),g(i,o,l,s),o}function A(e,t,r){return[Math.min(t/e.width,r/e.height),e,t+"x"+r]}function M(e,t,n,i){var a=document.createElementNS("http://www.w3.org/2000/svg","text"),o=r.select(a);return o.text(e).attr("x",0).attr("y",0).attr("text-anchor",n).attr("data-unformatted",e).call(p.convertToTspans,i).call(u.font,t),u.bBox(o.node())}function E(e,t,r,n,i,o){var s="_cache"+t;e[s]&&e[s].key===i||(e[s]={key:i,value:r});var l=a.aggNums(o,null,[e[s].value,n],2);return e[s].value=l,l}t.exports=function(e,t,f,m){var g,y=e._fullLayout;k(f)&&m&&(g=m()),a.makeTraceGroups(y._indicatorlayer,t,"trace").each((function(t){var m,v,C,P,L,I=t[0].trace,z=r.select(this),O=I._hasGauge,R=I._isAngular,D=I._isBullet,j=I.domain,F={w:y._size.w*(j.x[1]-j.x[0]),h:y._size.h*(j.y[1]-j.y[0]),l:y._size.l+y._size.w*j.x[0],r:y._size.r+y._size.w*(1-j.x[1]),t:y._size.t+y._size.h*(1-j.y[1]),b:y._size.b+y._size.h*j.y[0]},B=F.l+F.w/2,N=F.t+F.h/2,U=Math.min(F.w/2,F.h),V=h.innerRadius*U,q=I.align||"center";if(v=N,O){if(R&&(m=B,v=N+U/2,C=function(e){return function(e,t){var r=Math.sqrt(e.width/2*(e.width/2)+e.height*e.height),n=t/r;return[n,e,t]}(e,.9*V)}),D){var H=h.bulletPadding,G=1-h.bulletNumberDomainSize+H;m=F.l+(G+(1-G)*_[q])*F.w,C=function(e){return A(e,(h.bulletNumberDomainSize-H)*F.w,F.h)}}}else m=F.l+_[q]*F.w,C=function(e){return A(e,F.w,F.h)};!function(e,t,n,l){var c,h,f,m=n[0].trace,g=l.numbersX,y=l.numbersY,v=m.align||"center",T=b[v],A=l.transitionOpts,C=l.onComplete,P=a.ensureSingle(t,"g","numbers"),L=[];m._hasNumber&&L.push("number"),m._hasDelta&&(L.push("delta"),"left"===m.delta.position&&L.reverse());var I=P.selectAll("text").data(L);function z(t,r,n,i){if(!t.match("s")||n>=0===i>=0||r(n).slice(-1).match(w)||r(i).slice(-1).match(w))return r;var a=t.slice().replace("s","f").replace(/\d+/,(function(e){return parseInt(e)-1})),o=S(e,{tickformat:a});return function(e){return Math.abs(e)<1?d.tickText(o,e).text:r(e)}}function O(){var t=S(e,{tickformat:m.number.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=m.number.suffix,s=m.number.prefix,l=P.select("text.number");function h(){var t="number"===typeof n[0].y?s+a(n[0].y)+o:"-";l.text(t).call(u.font,m.number.font).call(p.convertToTspans,e)}return k(A)?l.transition().duration(A.duration).ease(A.easing).each("end",(function(){h(),C&&C()})).each("interrupt",(function(){h(),C&&C()})).attrTween("text",(function(){var e=r.select(this),t=i(n[0].lastY,n[0].y);m._lastValue=n[0].y;var l=z(m.number.valueformat,a,n[0].lastY,n[0].y);return function(r){e.text(s+l(t(r))+o)}})):h(),c=M(s+a(n[0].y)+o,m.number.font,T,e),l}function R(){var t=S(e,{tickformat:m.delta.valueformat},m._range);t.setScale(),d.prepTicks(t);var a=function(e){return d.tickText(t,e).text},o=m.delta.suffix,s=m.delta.prefix,l=function(e){return m.delta.relative?e.relativeDelta:e.delta},c=function(e,t){return 0===e||"number"!==typeof e||isNaN(e)?"-":(e>0?m.delta.increasing.symbol:m.delta.decreasing.symbol)+s+t(e)+o},f=function(e){return e.delta>=0?m.delta.increasing.color:m.delta.decreasing.color};void 0===m._deltaLastValue&&(m._deltaLastValue=l(n[0]));var g=P.select("text.delta");function y(){g.text(c(l(n[0]),a)).call(x.fill,f(n[0])).call(p.convertToTspans,e)}return g.call(u.font,m.delta.font).call(x.fill,f({delta:m._deltaLastValue})),k(A)?g.transition().duration(A.duration).ease(A.easing).tween("text",(function(){var e=r.select(this),t=l(n[0]),o=m._deltaLastValue,s=z(m.delta.valueformat,a,o,t),u=i(o,t);return m._deltaLastValue=t,function(t){e.text(c(u(t),s)),e.call(x.fill,f({delta:u(t)}))}})).each("end",(function(){y(),C&&C()})).each("interrupt",(function(){y(),C&&C()})):y(),h=M(c(l(n[0]),a),m.delta.font,T,e),g}I.enter().append("text"),I.attr("text-anchor",(function(){return T})).attr("class",(function(e){return e})).attr("x",null).attr("y",null).attr("dx",null).attr("dy",null),I.exit().remove();var D,j=m.mode+m.align;if(m._hasDelta&&(D=R(),j+=m.delta.position+m.delta.font.size+m.delta.font.family+m.delta.valueformat,j+=m.delta.increasing.symbol+m.delta.decreasing.symbol,f=h),m._hasNumber&&(O(),j+=m.number.font.size+m.number.font.family+m.number.valueformat+m.number.suffix+m.number.prefix,f=c),m._hasDelta&&m._hasNumber){var F,B,N=[(c.left+c.right)/2,(c.top+c.bottom)/2],U=[(h.left+h.right)/2,(h.top+h.bottom)/2],V=.75*m.delta.font.size;"left"===m.delta.position&&(F=E(m,"deltaPos",0,-1*(c.width*_[m.align]+h.width*(1-_[m.align])+V),j,Math.min),B=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:h.left+F,right:c.right,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"right"===m.delta.position&&(F=E(m,"deltaPos",0,c.width*(1-_[m.align])+h.width*_[m.align]+V,j,Math.max),B=N[1]-U[1],f={width:c.width+h.width+V,height:Math.max(c.height,h.height),left:c.left,right:h.right+F,top:Math.min(c.top,h.top+B),bottom:Math.max(c.bottom,h.bottom+B)}),"bottom"===m.delta.position&&(F=null,B=h.height,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height,bottom:c.bottom+h.height}),"top"===m.delta.position&&(F=null,B=c.top,f={width:Math.max(c.width,h.width),height:c.height+h.height,left:Math.min(c.left,h.left),right:Math.max(c.right,h.right),top:c.bottom-c.height-h.height,bottom:c.bottom}),D.attr({dx:F,dy:B})}(m._hasNumber||m._hasDelta)&&P.attr("transform",(function(){var e=l.numbersScaler(f);j+=e[2];var t,r=E(m,"numbersScale",1,e[0],j,Math.min);m._scaleNumbers||(r=1),t=m._isAngular?y-r*f.bottom:y-r*(f.top+f.bottom)/2,m._numbersTop=r*f.top+t;var n=f[v];"center"===v&&(n=(f.left+f.right)/2);var i=g-r*n;return i=E(m,"numbersTranslate",0,i,j,Math.max),s(i,t)+o(r)}))}(e,z,t,{numbersX:m,numbersY:v,numbersScaler:C,transitionOpts:f,onComplete:g}),O&&(P={range:I.gauge.axis.range,color:I.gauge.bgcolor,line:{color:I.gauge.bordercolor,width:0},thickness:1},L={range:I.gauge.axis.range,color:"rgba(0, 0, 0, 0)",line:{color:I.gauge.bordercolor,width:I.gauge.borderwidth},thickness:1});var W=z.selectAll("g.angular").data(R?t:[]);W.exit().remove();var $=z.selectAll("g.angularaxis").data(R?t:[]);$.exit().remove(),R&&function(e,t,i,a){var o,u,h,p,f=i[0].trace,m=a.size,g=a.radius,y=a.innerRadius,v=a.gaugeBg,x=a.gaugeOutline,b=[m.l+m.w/2,m.t+m.h/2+g/2],_=a.gauge,w=a.layer,A=a.transitionOpts,M=a.onComplete,E=Math.PI/2;function C(e){var t=f.gauge.axis.range[0],r=(e-t)/(f.gauge.axis.range[1]-t)*Math.PI-E;return r<-E?-E:r>E?E:r}function P(e){return r.svg.arc().innerRadius((y+g)/2-e/2*(g-y)).outerRadius((y+g)/2+e/2*(g-y)).startAngle(-E)}function L(e){e.attr("d",(function(e){return P(e.thickness).startAngle(C(e.range[0])).endAngle(C(e.range[1]))()}))}_.enter().append("g").classed("angular",!0),_.attr("transform",s(b[0],b[1])),w.enter().append("g").classed("angularaxis",!0).classed("crisp",!0),w.selectAll("g.xangularaxistick,path,text").remove(),(o=S(e,f.gauge.axis)).type="linear",o.range=f.gauge.axis.range,o._id="xangularaxis",o.ticklabeloverflow="allow",o.setScale();var I=function(e){return(o.range[0]-e.x)/(o.range[1]-o.range[0])*Math.PI+Math.PI},z={},O=d.makeLabelFns(o,0).labelStandoff;z.xFn=function(e){var t=I(e);return Math.cos(t)*O},z.yFn=function(e){var t=I(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(O+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*c)},z.anchorFn=function(e){var t=I(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},z.heightFn=function(e,t,r){var n=I(e);return-.5*(1+Math.sin(n))*r};var R=function(e){return s(b[0]+g*Math.cos(e),b[1]-g*Math.sin(e))};h=function(e){return R(I(e))};var D=function(e){var t=I(e);return R(t)+"rotate("+-l(t)+")"};if(u=d.calcTicks(o),p=d.getTickSigns(o)[2],o.visible){p="inside"===o.ticks?-1:1;var j=(o.linewidth||1)/2;d.drawTicks(e,o,{vals:u,layer:w,path:"M"+p*j+",0h"+p*o.ticklen,transFn:D}),d.drawLabels(e,o,{vals:u,layer:w,transFn:h,labelFns:z})}var F=[v].concat(f.gauge.steps),B=_.selectAll("g.bg-arc").data(F);B.enter().append("g").classed("bg-arc",!0).append("path"),B.select("path").call(L).call(T),B.exit().remove();var N=P(f.gauge.bar.thickness),U=_.selectAll("g.value-arc").data([f.gauge.bar]);U.enter().append("g").classed("value-arc",!0).append("path");var V,q,H,G=U.select("path");k(A)?(G.transition().duration(A.duration).ease(A.easing).each("end",(function(){M&&M()})).each("interrupt",(function(){M&&M()})).attrTween("d",(V=N,q=C(i[0].lastY),H=C(i[0].y),function(){var e=n(q,H);return function(t){return V.endAngle(e(t))()}})),f._lastValue=i[0].y):G.attr("d","number"===typeof i[0].y?N.endAngle(C(i[0].y)):"M0,0Z"),G.call(T),U.exit().remove(),F=[];var W=f.gauge.threshold.value;(W||0===W)&&F.push({range:[W,W],color:f.gauge.threshold.color,line:{color:f.gauge.threshold.line.color,width:f.gauge.threshold.line.width},thickness:f.gauge.threshold.thickness});var $=_.selectAll("g.threshold-arc").data(F);$.enter().append("g").classed("threshold-arc",!0).append("path"),$.select("path").call(L).call(T),$.exit().remove();var Z=_.selectAll("g.gauge-outline").data([x]);Z.enter().append("g").classed("gauge-outline",!0).append("path"),Z.select("path").call(L).call(T),Z.exit().remove()}(e,0,t,{radius:U,innerRadius:V,gauge:W,layer:$,size:F,gaugeBg:P,gaugeOutline:L,transitionOpts:f,onComplete:g});var Z=z.selectAll("g.bullet").data(D?t:[]);Z.exit().remove();var X=z.selectAll("g.bulletaxis").data(D?t:[]);X.exit().remove(),D&&function(e,t,r,n){var i,a,o,l,c,u=r[0].trace,p=n.gauge,f=n.layer,m=n.gaugeBg,g=n.gaugeOutline,y=n.size,v=u.domain,b=n.transitionOpts,_=n.onComplete;p.enter().append("g").classed("bullet",!0),p.attr("transform",s(y.l,y.t)),f.enter().append("g").classed("bulletaxis",!0).classed("crisp",!0),f.selectAll("g.xbulletaxistick,path,text").remove();var w=y.h,A=u.gauge.bar.thickness*w,M=v.x[0],E=v.x[0]+(v.x[1]-v.x[0])*(u._hasNumber||u._hasDelta?1-h.bulletNumberDomainSize:1);function C(e){e.attr("width",(function(e){return Math.max(0,i.c2p(e.range[1])-i.c2p(e.range[0]))})).attr("x",(function(e){return i.c2p(e.range[0])})).attr("y",(function(e){return.5*(1-e.thickness)*w})).attr("height",(function(e){return e.thickness*w}))}(i=S(e,u.gauge.axis))._id="xbulletaxis",i.domain=[M,E],i.setScale(),a=d.calcTicks(i),o=d.makeTransTickFn(i),l=d.getTickSigns(i)[2],c=y.t+y.h,i.visible&&(d.drawTicks(e,i,{vals:"inside"===i.ticks?d.clipEnds(i,a):a,layer:f,path:d.makeTickPath(i,c,l),transFn:o}),d.drawLabels(e,i,{vals:a,layer:f,transFn:o,labelFns:d.makeLabelFns(i,c)}));var P=[m].concat(u.gauge.steps),L=p.selectAll("g.bg-bullet").data(P);L.enter().append("g").classed("bg-bullet",!0).append("rect"),L.select("rect").call(C).call(T),L.exit().remove();var I=p.selectAll("g.value-bullet").data([u.gauge.bar]);I.enter().append("g").classed("value-bullet",!0).append("rect"),I.select("rect").attr("height",A).attr("y",(w-A)/2).call(T),k(b)?I.select("rect").transition().duration(b.duration).ease(b.easing).each("end",(function(){_&&_()})).each("interrupt",(function(){_&&_()})).attr("width",Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y)))):I.select("rect").attr("width","number"===typeof r[0].y?Math.max(0,i.c2p(Math.min(u.gauge.axis.range[1],r[0].y))):0),I.exit().remove();var z=r.filter((function(){return u.gauge.threshold.value||0===u.gauge.threshold.value})),O=p.selectAll("g.threshold-bullet").data(z);O.enter().append("g").classed("threshold-bullet",!0).append("line"),O.select("line").attr("x1",i.c2p(u.gauge.threshold.value)).attr("x2",i.c2p(u.gauge.threshold.value)).attr("y1",(1-u.gauge.threshold.thickness)/2*w).attr("y2",(1-(1-u.gauge.threshold.thickness)/2)*w).call(x.stroke,u.gauge.threshold.line.color).style("stroke-width",u.gauge.threshold.line.width),O.exit().remove();var R=p.selectAll("g.gauge-outline").data([g]);R.enter().append("g").classed("gauge-outline",!0).append("rect"),R.select("rect").call(C).call(T),R.exit().remove()}(e,0,t,{gauge:Z,layer:X,size:F,gaugeBg:P,gaugeOutline:L,transitionOpts:f,onComplete:g});var Y=z.selectAll("text.title").data(t);Y.exit().remove(),Y.enter().append("text").classed("title",!0),Y.attr("text-anchor",(function(){return D?b.right:b[I.title.align]})).text(I.title.text).call(u.font,I.title.font).call(p.convertToTspans,e),Y.attr("transform",(function(){var e,t=F.l+F.w*_[I.title.align],r=h.titlePadding,n=u.bBox(Y.node());return O?(R&&(e=I.gauge.axis.visible?u.bBox($.node()).top-r-n.bottom:F.t+F.h/2-U/2-n.bottom-r),D&&(e=v-(n.top+n.bottom)/2,t=F.l-h.bulletPadding*F.w)):e=I._numbersTop-r-n.bottom,s(t,e)}))}))}}}),J_=p({"src/traces/indicator/index.js"(e,t){t.exports={moduleType:"trace",name:"indicator",basePlotModule:W_(),categories:["svg","noOpacity","noHover"],animatable:!0,attributes:$_(),supplyDefaults:X_().supplyDefaults,calc:Y_().calc,plot:K_(),meta:{}}}}),Q_=p({"lib/indicator.js"(e,t){t.exports=J_()}}),ew=p({"src/traces/table/attributes.js"(e,t){var r=xn(),n=R().extendFlat,i=Le().overrideAll,a=D(),o=ka().attributes,s=Et().descriptionOnlyNumbers;t.exports=i({domain:o({name:"table",trace:!0}),columnwidth:{valType:"number",arrayOk:!0,dflt:null},columnorder:{valType:"data_array"},header:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:28},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))},cells:{values:{valType:"data_array",dflt:[]},format:{valType:"data_array",dflt:[],description:s("cell value")},prefix:{valType:"string",arrayOk:!0,dflt:null},suffix:{valType:"string",arrayOk:!0,dflt:null},height:{valType:"number",dflt:20},align:n({},r.align,{arrayOk:!0}),line:{width:{valType:"number",arrayOk:!0,dflt:1},color:{valType:"color",arrayOk:!0,dflt:"grey"}},fill:{color:{valType:"color",arrayOk:!0,dflt:"white"}},font:n({},a({arrayOk:!0}))}},"calc","from-root")}}),tw=p({"src/traces/table/defaults.js"(e,t){var r=st(),n=ew(),i=ka().defaults;t.exports=function(e,t,a,o){function s(i,a){return r.coerce(e,t,n,i,a)}i(t,o,s),s("columnwidth"),s("header.values"),s("header.format"),s("header.align"),s("header.prefix"),s("header.suffix"),s("header.height"),s("header.line.width"),s("header.line.color"),s("header.fill.color"),r.coerceFont(s,"header.font",o.font),function(e,t){for(var r=e.columnorder||[],n=e.header.values.length,i=r.slice(0,n),a=i.slice().sort((function(e,t){return e-t})),o=i.map((function(e){return a.indexOf(e)})),s=o.length;s<n;s++)o.push(s);t("columnorder",o)}(t,s),s("cells.values"),s("cells.format"),s("cells.align"),s("cells.prefix"),s("cells.suffix"),s("cells.height"),s("cells.line.width"),s("cells.line.color"),s("cells.fill.color"),r.coerceFont(s,"cells.font",o.font),t._length=null}}}),rw=p({"src/traces/table/calc.js"(e,t){var r=Ox().wrap;t.exports=function(){return r({})}}}),nw=p({"src/traces/table/constants.js"(e,t){t.exports={cellPad:8,columnExtentOffset:10,columnTitleOffset:28,emptyHeaderHeight:16,latexCheck:/^\$.*\$$/,goldenRatio:1.618,lineBreaker:"<br>",maxDimensionCount:60,overdrag:45,releaseTransitionDuration:120,releaseTransitionEase:"cubic-out",scrollbarCaptureWidth:18,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,scrollbarOffset:5,scrollbarWidth:8,transitionDuration:100,transitionEase:"cubic-out",uplift:5,wrapSpacer:" ",wrapSplitCharacter:" ",cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}}}),iw=p({"src/traces/table/data_preparation_helper.js"(e,t){var r=nw(),n=R().extendFlat,i=k(),a=M().isTypedArray,o=M().isArrayOrTypedArray;function s(e){if(o(e)){for(var t=0,r=0;r<e.length;r++)t=Math.max(t,s(e[r]));return t}return e}function l(e,t){return e+t}function c(e){var t,r=e.slice(),n=1/0,i=0;for(t=0;t<r.length;t++)a(r[t])?r[t]=Array.from(r[t]):o(r[t])||(r[t]=[r[t]]),n=Math.min(n,r[t].length),i=Math.max(i,r[t].length);if(n!==i)for(t=0;t<r.length;t++){var s=i-r[t].length;s&&(r[t]=r[t].concat(u(s)))}return r}function u(e){for(var t=new Array(e),r=0;r<e;r++)t[r]="";return t}function h(e){return e.calcdata.columns.reduce((function(t,r){return r.xIndex<e.xIndex?t+r.columnWidth:t}),0)}function p(e,t){return Object.keys(e).map((function(r){return n({},e[r],{auxiliaryBlocks:t})}))}function d(e,t){for(var r,n={},i=0,a=0,o={firstRowIndex:null,lastRowIndex:null,rows:[]},s=0,l=0,c=0;c<e.length;c++)r=e[c],o.rows.push({rowIndex:c,rowHeight:r}),((a+=r)>=t||c===e.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}t.exports=function(e,t){var a=c(t.cells.values),f=function(e){return e.slice(t.header.values.length,e.length)},m=c(t.header.values);m.length&&!m[0].length&&(m[0]=[""],m=c(m));var g=m.concat(f(a).map((function(){return u((m[0]||[""]).length)}))),y=t.domain,v=Math.floor(e._fullLayout._size.w*(y.x[1]-y.x[0])),x=Math.floor(e._fullLayout._size.h*(y.y[1]-y.y[0])),b=t.header.values.length?g[0].map((function(){return t.header.height})):[r.emptyHeaderHeight],_=a.length?a[0].map((function(){return t.cells.height})):[],w=b.reduce(l,0),k=d(_,x-w+r.uplift),T=p(d(b,w),[]),S=p(k,T),A={},M=t._fullInput.columnorder;o(M)&&(M=Array.from(M)),M=M.concat(f(a.map((function(e,t){return t}))));var E=g.map((function(e,r){var n=o(t.columnwidth)?t.columnwidth[Math.min(r,t.columnwidth.length-1)]:t.columnwidth;return i(n)?Number(n):1})),C=E.reduce(l,0);E=E.map((function(e){return e/C*v}));var P=Math.max(s(t.header.line.width),s(t.cells.line.width)),L={key:t.uid+e._context.staticPlot,translateX:y.x[0]*e._fullLayout._size.w,translateY:e._fullLayout._size.h*(1-y.y[1]),size:e._fullLayout._size,width:v,maxLineWidth:P,height:x,columnOrder:M,groupHeight:x,rowBlocks:S,headerRowBlocks:T,scrollY:0,cells:n({},t.cells,{values:a}),headerCells:n({},t.header,{values:g}),gdColumns:g.map((function(e){return e[0]})),gdColumnsOriginalOrder:g.map((function(e){return e[0]})),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:g.map((function(e,t){var r=A[e];return A[e]=(r||0)+1,{key:e+"__"+A[e],label:e,specIndex:t,xIndex:M[t],xScale:h,x:void 0,calcdata:void 0,columnWidth:E[t]}}))};return L.columns.forEach((function(e){e.calcdata=L,e.x=h(e)})),L}}}),aw=p({"src/traces/table/data_split_helpers.js"(e){var t=R().extendFlat;e.splitToPanels=function(e){var r=[0,0],n=t({},e,{key:"header",type:"header",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!0,values:e.calcdata.headerCells.values[e.specIndex],rowBlocks:e.calcdata.headerRowBlocks,calcdata:t({},e.calcdata,{cells:e.calcdata.headerCells})});return[t({},e,{key:"cells1",type:"cells",page:0,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),t({},e,{key:"cells2",type:"cells",page:1,prevPages:r,currentRepaint:[null,null],dragHandle:!1,values:e.calcdata.cells.values[e.specIndex],rowBlocks:e.calcdata.rowBlocks}),n]},e.splitToCells=function(e){var t=function(e){var t=e.rowBlocks[e.page],r=t?t.rows[0].rowIndex:0,n=t?r+t.rows.length:0;return[r,n]}(e);return(e.values||[]).slice(t[0],t[1]).map((function(r,n){return{keyWithinBlock:n+("string"===typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:t[0]+n,column:e,calcdata:e.calcdata,page:e.page,rowBlocks:e.rowBlocks,value:r}}))}}}),ow=p({"src/traces/table/plot.js"(e,t){var r=nw(),n=v(),i=st(),a=i.numberFormat,o=Ox(),s=Jt(),l=At(),c=st().raiseToTop,u=st().strTranslate,h=st().cancelTransition,p=iw(),d=aw(),f=q();function m(e){return Math.ceil(e.calcdata.maxLineWidth/2)}function g(e,t){return"clip"+e._fullLayout._uid+"_scrollAreaBottomClip_"+t.key}function y(e,t){return"clip"+e._fullLayout._uid+"_columnBoundaryClippath_"+t.calcdata.key+"_"+t.specIndex}function x(e){return[].concat.apply([],e.map((function(e){return e}))).map((function(e){return e.__data__}))}function b(e,t,i){var a=e.selectAll("."+r.cn.scrollbarKit).data(o.repeat,o.keyFun);a.enter().append("g").classed(r.cn.scrollbarKit,!0).style("shape-rendering","geometricPrecision"),a.each((function(e){var t=e.scrollbarState;t.totalHeight=function(e){var t=e.rowBlocks;return D(t,t.length-1)+(t.length?j(t[t.length-1],1/0):1)}(e),t.scrollableAreaHeight=e.groupHeight-E(e),t.currentlyVisibleHeight=Math.min(t.totalHeight,t.scrollableAreaHeight),t.ratio=t.currentlyVisibleHeight/t.totalHeight,t.barLength=Math.max(t.ratio*t.currentlyVisibleHeight,r.goldenRatio*r.scrollbarWidth),t.barWiggleRoom=t.currentlyVisibleHeight-t.barLength,t.wiggleRoom=Math.max(0,t.totalHeight-t.scrollableAreaHeight),t.topY=0===t.barWiggleRoom?0:e.scrollY/t.wiggleRoom*t.barWiggleRoom,t.bottomY=t.topY+t.barLength,t.dragMultiplier=t.wiggleRoom/t.barWiggleRoom})).attr("transform",(function(e){var t=e.width+r.scrollbarWidth/2+r.scrollbarOffset;return u(t,E(e))}));var s=a.selectAll("."+r.cn.scrollbar).data(o.repeat,o.keyFun);s.enter().append("g").classed(r.cn.scrollbar,!0);var l=s.selectAll("."+r.cn.scrollbarSlider).data(o.repeat,o.keyFun);l.enter().append("g").classed(r.cn.scrollbarSlider,!0),l.attr("transform",(function(e){return u(0,e.scrollbarState.topY||0)}));var c=l.selectAll("."+r.cn.scrollbarGlyph).data(o.repeat,o.keyFun);c.enter().append("line").classed(r.cn.scrollbarGlyph,!0).attr("stroke","black").attr("stroke-width",r.scrollbarWidth).attr("stroke-linecap","round").attr("y1",r.scrollbarWidth/2),c.attr("y2",(function(e){return e.scrollbarState.barLength-r.scrollbarWidth/2})).attr("stroke-opacity",(function(e){return e.columnDragInProgress||!e.scrollbarState.barWiggleRoom||i?0:.4})),c.transition().delay(0).duration(0),c.transition().delay(r.scrollbarHideDelay).duration(r.scrollbarHideDuration).attr("stroke-opacity",0);var h=s.selectAll("."+r.cn.scrollbarCaptureZone).data(o.repeat,o.keyFun);h.enter().append("line").classed(r.cn.scrollbarCaptureZone,!0).attr("stroke","white").attr("stroke-opacity",.01).attr("stroke-width",r.scrollbarCaptureWidth).attr("stroke-linecap","butt").attr("y1",0).on("mousedown",(function(r){var i=n.event.y,a=this.getBoundingClientRect(),o=r.scrollbarState,s=i-a.top,l=n.scale.linear().domain([0,o.scrollableAreaHeight]).range([0,o.totalHeight]).clamp(!0);o.topY<=s&&s<=o.bottomY||P(t,e,null,l(s-o.barLength/2))(r)})).call(n.behavior.drag().origin((function(e){return n.event.stopPropagation(),e.scrollbarState.scrollbarScrollInProgress=!0,e})).on("drag",P(t,e)).on("dragend",(function(){}))),h.attr("y2",(function(e){return e.scrollbarState.scrollableAreaHeight})),t._context.staticPlot&&(c.remove(),h.remove())}function _(e,t,i,a){var l=function(e){var t=e.selectAll("."+r.cn.columnCells).data(o.repeat,o.keyFun);return t.enter().append("g").classed(r.cn.columnCells,!0),t.exit().remove(),t}(i),c=function(e){var t=e.selectAll("."+r.cn.columnCell).data(d.splitToCells,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.columnCell,!0),t.exit().remove(),t}(l);!function(e){e.each((function(e,t){var r=e.calcdata.cells.font,n=e.column.specIndex,i={size:T(r.size,n,t),color:T(r.color,n,t),family:T(r.family,n,t),weight:T(r.weight,n,t),style:T(r.style,n,t),variant:T(r.variant,n,t),textcase:T(r.textcase,n,t),lineposition:T(r.lineposition,n,t),shadow:T(r.shadow,n,t)};e.rowNumber=e.key,e.align=T(e.calcdata.cells.align,n,t),e.cellBorderWidth=T(e.calcdata.cells.line.width,n,t),e.font=i}))}(c);var u=function(e){var t=e.selectAll("."+r.cn.cellRect).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("rect").classed(r.cn.cellRect,!0),t}(c);!function(e){e.attr("width",(function(e){return e.column.columnWidth})).attr("stroke-width",(function(e){return e.cellBorderWidth})).each((function(e){var t=n.select(this);f.stroke(t,T(e.calcdata.cells.line.color,e.column.specIndex,e.rowNumber)),f.fill(t,T(e.calcdata.cells.fill.color,e.column.specIndex,e.rowNumber))}))}(u);var h=function(e){var t=e.selectAll("."+r.cn.cellTextHolder).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("g").classed(r.cn.cellTextHolder,!0).style("shape-rendering","geometricPrecision"),t}(c),p=function(e){var t=e.selectAll("."+r.cn.cellText).data(o.repeat,(function(e){return e.keyWithinBlock}));return t.enter().append("text").classed(r.cn.cellText,!0).style("cursor",(function(){return"auto"})).on("mousedown",(function(){n.event.stopPropagation()})),t}(h);!function(e){e.each((function(e){s.font(n.select(this),e.font)}))}(p),w(p,t,a,e),R(c)}function w(e,t,i,o){e.text((function(e){var t=e.column.specIndex,n=e.rowNumber,i=e.value,o="string"===typeof i,s=o&&i.match(/<br>/i),l=!o||s;e.mayHaveMarkup=o&&i.match(/[<&>]/);var c,u="string"===typeof(c=i)&&c.match(r.latexCheck);e.latex=u;var h,p,d=u?"":T(e.calcdata.cells.prefix,t,n)||"",f=u?"":T(e.calcdata.cells.suffix,t,n)||"",m=u?null:T(e.calcdata.cells.format,t,n)||null,g=d+(m?a(m)(e.value):e.value)+f;if(e.wrappingNeeded=!e.wrapped&&!l&&!u&&(h=k(g)),e.cellHeightMayIncrease=s||u||e.mayHaveMarkup||(void 0===h?k(g):h),e.needsConvertToTspans=e.mayHaveMarkup||e.wrappingNeeded||e.latex,e.wrappingNeeded){var y=(" "===r.wrapSplitCharacter?g.replace(/<a href=/gi,"<a_href="):g).split(r.wrapSplitCharacter),v=" "===r.wrapSplitCharacter?y.map((function(e){return e.replace(/<a_href=/gi,"<a href=")})):y;e.fragments=v.map((function(e){return{text:e,width:null}})),e.fragments.push({fragment:r.wrapSpacer,width:null}),p=v.join(r.lineBreaker)+r.lineBreaker+r.wrapSpacer}else delete e.fragments,p=g;return p})).attr("dy",(function(e){return e.needsConvertToTspans?0:"0.75em"})).each((function(e){var a=this,s=n.select(a),c=e.wrappingNeeded?I:z;e.needsConvertToTspans?l.convertToTspans(s,o,c(i,a,t,o,e)):n.select(a.parentNode).attr("transform",(function(e){return u(O(e),r.cellPad)})).attr("text-anchor",(function(e){return{left:"start",center:"middle",right:"end"}[e.align]}))}))}function k(e){return-1!==e.indexOf(r.wrapSplitCharacter)}function T(e,t,r){if(i.isArrayOrTypedArray(e)){var n=e[Math.min(t,e.length-1)];return i.isArrayOrTypedArray(n)?n[Math.min(r,n.length-1)]:n}return e}function S(e,t,n){e.transition().ease(r.releaseTransitionEase).duration(r.releaseTransitionDuration).attr("transform",u(t.x,n))}function A(e){return"cells"===e.type}function M(e){return"header"===e.type}function E(e){return(e.rowBlocks.length?e.rowBlocks[0].auxiliaryBlocks:[]).reduce((function(e,t){return e+j(t,1/0)}),0)}function C(e,t,r){var n=x(t)[0];if(void 0!==n){var i=n.rowBlocks,a=n.calcdata,o=D(i,i.length),s=n.calcdata.groupHeight-E(n),l=a.scrollY=Math.max(0,Math.min(o-s,a.scrollY)),c=function(e,t,r){for(var n=[],i=0,a=0;a<e.length;a++){for(var o=e[a],s=o.rows,l=0,c=0;c<s.length;c++)l+=s[c].rowHeight;o.allRowsHeight=l,t<i+l&&t+r>i&&n.push(a),i+=l}return n}(i,l,s);1===c.length&&(c[0]===i.length-1?c.unshift(c[0]-1):c.push(c[0]+1)),c[0]%2&&c.reverse(),t.each((function(e,t){e.page=c[t],e.scrollY=l})),t.attr("transform",(function(e){var t=D(e.rowBlocks,e.page)-e.scrollY;return u(0,t)})),e&&(L(e,r,t,c,n.prevPages,n,0),L(e,r,t,c,n.prevPages,n,1),b(r,e))}}function P(e,t,i,a){return function(o){var s=o.calcdata?o.calcdata:o,l=t.filter((function(e){return s.key===e.key})),c=i||s.scrollbarState.dragMultiplier,u=s.scrollY;s.scrollY=void 0===a?s.scrollY+c*n.event.dy:a;var h=l.selectAll("."+r.cn.yColumn).selectAll("."+r.cn.columnBlock).filter(A);return C(e,h,l),s.scrollY===u}}function L(e,t,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout((function(){var a=r.filter((function(e,t){return t===o&&n[t]!==i[t]}));_(e,t,a,r),i[o]=n[o]})))}function I(e,t,i,a){return function(){var o=n.select(t.parentNode);o.each((function(e){var t=e.fragments;o.selectAll("tspan.line").each((function(e,r){t[r].width=this.getComputedTextLength()}));var n,i,a=t[t.length-1].width,s=t.slice(0,-1),l=[],c=0,u=e.column.columnWidth-2*r.cellPad;for(e.value="";s.length;)c+(i=(n=s.shift()).width+a)>u&&(e.value+=l.join(r.wrapSpacer)+r.lineBreaker,l=[],c=0),l.push(n.text),c+=i;c&&(e.value+=l.join(r.wrapSpacer)),e.wrapped=!0})),o.selectAll("tspan.line").remove(),w(o.select("."+r.cn.cellText),i,e,a),n.select(t.parentNode.parentNode).call(R)}}function z(e,t,i,a,o){return function(){if(!o.settledY){var s=n.select(t.parentNode),l=B(o),c=o.key-l.firstRowIndex,h=l.rows[c].rowHeight,p=o.cellHeightMayIncrease?t.parentNode.getBoundingClientRect().height+2*r.cellPad:h,d=Math.max(p,h);d-l.rows[c].rowHeight&&(l.rows[c].rowHeight=d,e.selectAll("."+r.cn.columnCell).call(R),C(null,e.filter(A),0),b(i,a,!0)),s.attr("transform",(function(){var e=this,t=e.parentNode.getBoundingClientRect(),i=n.select(e.parentNode).select("."+r.cn.cellRect).node().getBoundingClientRect(),a=e.transform.baseVal.consolidate(),s=i.top-t.top+(a?a.matrix.f:r.cellPad);return u(O(o,n.select(e.parentNode).select("."+r.cn.cellTextHolder).node().getBoundingClientRect().width),s)})),o.settledY=!0}}}function O(e,t){switch(e.align){case"left":default:return r.cellPad;case"right":return e.column.columnWidth-(t||0)-r.cellPad;case"center":return(e.column.columnWidth-(t||0))/2}}function R(e){e.attr("transform",(function(e){var t=e.rowBlocks[0].auxiliaryBlocks.reduce((function(e,t){return e+j(t,1/0)}),0),r=j(B(e),e.key);return u(0,r+t)})).selectAll("."+r.cn.cellRect).attr("height",(function(e){return(t=B(e),r=e.key,t.rows[r-t.firstRowIndex]).rowHeight;var t,r}))}function D(e,t){for(var r=0,n=t-1;n>=0;n--)r+=F(e[n]);return r}function j(e,t){for(var r=0,n=0;n<e.rows.length&&e.rows[n].rowIndex<t;n++)r+=e.rows[n].rowHeight;return r}function F(e){var t=e.allRowsHeight;if(void 0!==t)return t;for(var r=0,n=0;n<e.rows.length;n++)r+=e.rows[n].rowHeight;return e.allRowsHeight=r,r}function B(e){return e.rowBlocks[e.page]}t.exports=function(e,t){var i=!e._context.staticPlot,a=e._fullLayout._paper.selectAll("."+r.cn.table).data(t.map((function(t){var r=o.unwrap(t).trace;return p(e,r)})),o.keyFun);a.exit().remove(),a.enter().append("g").classed(r.cn.table,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","all"),a.attr("width",(function(e){return e.width+e.size.l+e.size.r})).attr("height",(function(e){return e.height+e.size.t+e.size.b})).attr("transform",(function(e){return u(e.translateX,e.translateY)}));var l=a.selectAll("."+r.cn.tableControlView).data(o.repeat,o.keyFun),f=l.enter().append("g").classed(r.cn.tableControlView,!0).style("box-sizing","content-box");if(i){var v="onwheel"in document?"wheel":"mousewheel";f.on("mousemove",(function(t){l.filter((function(e){return t===e})).call(b,e)})).on(v,(function(t){if(!t.scrollbarState.wheeling){t.scrollbarState.wheeling=!0;var r=t.scrollY+n.event.deltaY;P(e,l,null,r)(t)||(n.event.stopPropagation(),n.event.preventDefault()),t.scrollbarState.wheeling=!1}})).call(b,e,!0)}l.attr("transform",(function(e){return u(e.size.l,e.size.t)}));var w=l.selectAll("."+r.cn.scrollBackground).data(o.repeat,o.keyFun);w.enter().append("rect").classed(r.cn.scrollBackground,!0).attr("fill","none"),w.attr("width",(function(e){return e.width})).attr("height",(function(e){return e.height})),l.each((function(t){s.setClipUrl(n.select(this),g(e,t),e)}));var k=l.selectAll("."+r.cn.yColumn).data((function(e){return e.columns}),o.keyFun);k.enter().append("g").classed(r.cn.yColumn,!0),k.exit().remove(),k.attr("transform",(function(e){return u(e.x,0)})),i&&k.call(n.behavior.drag().origin((function(t){return S(n.select(this),t,-r.uplift),c(this),t.calcdata.columnDragInProgress=!0,b(l.filter((function(e){return t.calcdata.key===e.key})),e),t})).on("drag",(function(e){var t=n.select(this),i=function(t){return(e===t?n.event.x:t.x)+t.columnWidth/2};e.x=Math.max(-r.overdrag,Math.min(e.calcdata.width+r.overdrag-e.columnWidth,n.event.x)),x(k).filter((function(t){return t.calcdata.key===e.calcdata.key})).sort((function(e,t){return i(e)-i(t)})).forEach((function(t,r){t.xIndex=r,t.x=e===t?t.x:t.xScale(t)})),k.filter((function(t){return e!==t})).transition().ease(r.transitionEase).duration(r.transitionDuration).attr("transform",(function(e){return u(e.x,0)})),t.call(h).attr("transform",u(e.x,-r.uplift))})).on("dragend",(function(t){var r=n.select(this),i=t.calcdata;t.x=t.xScale(t),t.calcdata.columnDragInProgress=!1,S(r,t,0),function(e,t,r){var n=t.gdColumnsOriginalOrder;t.gdColumns.sort((function(e,t){return r[n.indexOf(e)]-r[n.indexOf(t)]})),t.columnorder=r,e.emit("plotly_restyle")}(e,i,i.columns.map((function(e){return e.xIndex})))}))),k.each((function(t){s.setClipUrl(n.select(this),y(e,t),e)}));var T=k.selectAll("."+r.cn.columnBlock).data(d.splitToPanels,o.keyFun);T.enter().append("g").classed(r.cn.columnBlock,!0).attr("id",(function(e){return e.key})),T.style("cursor",(function(e){return e.dragHandle?"ew-resize":e.calcdata.scrollbarState.barWiggleRoom?"ns-resize":"default"}));var E=T.filter(M),L=T.filter(A);i&&L.call(n.behavior.drag().origin((function(e){return n.event.stopPropagation(),e})).on("drag",P(e,l,-1)).on("dragend",(function(){}))),_(e,l,E,T),_(e,l,L,T);var I=l.selectAll("."+r.cn.scrollAreaClip).data(o.repeat,o.keyFun);I.enter().append("clipPath").classed(r.cn.scrollAreaClip,!0).attr("id",(function(t){return g(e,t)}));var z=I.selectAll("."+r.cn.scrollAreaClipRect).data(o.repeat,o.keyFun);z.enter().append("rect").classed(r.cn.scrollAreaClipRect,!0).attr("x",-r.overdrag).attr("y",-r.uplift).attr("fill","none"),z.attr("width",(function(e){return e.width+2*r.overdrag})).attr("height",(function(e){return e.height+r.uplift})),k.selectAll("."+r.cn.columnBoundary).data(o.repeat,o.keyFun).enter().append("g").classed(r.cn.columnBoundary,!0);var O=k.selectAll("."+r.cn.columnBoundaryClippath).data(o.repeat,o.keyFun);O.enter().append("clipPath").classed(r.cn.columnBoundaryClippath,!0),O.attr("id",(function(t){return y(e,t)}));var R=O.selectAll("."+r.cn.columnBoundaryRect).data(o.repeat,o.keyFun);R.enter().append("rect").classed(r.cn.columnBoundaryRect,!0).attr("fill","none"),R.attr("width",(function(e){return e.columnWidth+2*m(e)})).attr("height",(function(e){return e.calcdata.height+2*m(e)+r.uplift})).attr("x",(function(e){return-m(e)})).attr("y",(function(e){return-m(e)})),C(null,L,l)}}}),sw=p({"src/traces/table/base_plot.js"(e){var t=_t().getModuleCalcData,r=ow(),n="table";e.name=n,e.plot=function(e){var i=t(e.calcdata,n)[0];i.length&&r(e,i)},e.clean=function(e,t,r,i){var a=i._has&&i._has(n),o=t._has&&t._has(n);a&&!o&&i._paperdiv.selectAll(".table").remove()}}}),lw=p({"src/traces/table/index.js"(e,t){t.exports={attributes:ew(),supplyDefaults:tw(),calc:rw(),plot:ow(),moduleType:"trace",name:"table",basePlotModule:sw(),categories:["noOpacity"],meta:{}}}}),cw=p({"lib/table.js"(e,t){t.exports=lw()}}),uw=p({"src/traces/carpet/axis_attributes.js"(e,t){var r=D(),n=V(),i=Ct(),a=Et().descriptionWithDates,o=Le().overrideAll,s=Ie().dash,l=R().extendFlat;t.exports={color:{valType:"color",editType:"calc"},smoothing:{valType:"number",dflt:1,min:0,max:1.3,editType:"calc"},title:{text:{valType:"string",dflt:"",editType:"calc"},font:r({editType:"calc"}),offset:{valType:"number",dflt:10,editType:"calc"},editType:"calc"},type:{valType:"enumerated",values:["-","linear","date","category"],dflt:"-",editType:"calc"},autotypenumbers:i.autotypenumbers,autorange:{valType:"enumerated",values:[!0,!1,"reversed"],dflt:!0,editType:"calc"},rangemode:{valType:"enumerated",values:["normal","tozero","nonnegative"],dflt:"normal",editType:"calc"},range:{valType:"info_array",editType:"calc",items:[{valType:"any",editType:"calc"},{valType:"any",editType:"calc"}]},fixedrange:{valType:"boolean",dflt:!1,editType:"calc"},cheatertype:{valType:"enumerated",values:["index","value"],dflt:"value",editType:"calc"},tickmode:{valType:"enumerated",values:["linear","array"],dflt:"array",editType:"calc"},nticks:{valType:"integer",min:0,dflt:0,editType:"calc"},tickvals:{valType:"data_array",editType:"calc"},ticktext:{valType:"data_array",editType:"calc"},showticklabels:{valType:"enumerated",values:["start","end","both","none"],dflt:"start",editType:"calc"},labelalias:l({},i.labelalias,{editType:"calc"}),tickfont:r({editType:"calc"}),tickangle:{valType:"angle",dflt:"auto",editType:"calc"},tickprefix:{valType:"string",dflt:"",editType:"calc"},showtickprefix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},ticksuffix:{valType:"string",dflt:"",editType:"calc"},showticksuffix:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},showexponent:{valType:"enumerated",values:["all","first","last","none"],dflt:"all",editType:"calc"},exponentformat:{valType:"enumerated",values:["none","e","E","power","SI","B"],dflt:"B",editType:"calc"},minexponent:{valType:"number",dflt:3,min:0,editType:"calc"},separatethousands:{valType:"boolean",dflt:!1,editType:"calc"},tickformat:{valType:"string",dflt:"",editType:"calc",description:a("tick label")},tickformatstops:o(i.tickformatstops,"calc","from-root"),categoryorder:{valType:"enumerated",values:["trace","category ascending","category descending","array"],dflt:"trace",editType:"calc"},categoryarray:{valType:"data_array",editType:"calc"},labelpadding:{valType:"integer",dflt:10,editType:"calc"},labelprefix:{valType:"string",editType:"calc"},labelsuffix:{valType:"string",dflt:"",editType:"calc"},showline:{valType:"boolean",dflt:!1,editType:"calc"},linecolor:{valType:"color",dflt:n.defaultLine,editType:"calc"},linewidth:{valType:"number",min:0,dflt:1,editType:"calc"},gridcolor:{valType:"color",editType:"calc"},gridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},griddash:l({},s,{editType:"calc"}),showgrid:{valType:"boolean",dflt:!0,editType:"calc"},minorgridcount:{valType:"integer",min:0,dflt:0,editType:"calc"},minorgridwidth:{valType:"number",min:0,dflt:1,editType:"calc"},minorgriddash:l({},s,{editType:"calc"}),minorgridcolor:{valType:"color",dflt:n.lightLine,editType:"calc"},startline:{valType:"boolean",editType:"calc"},startlinecolor:{valType:"color",editType:"calc"},startlinewidth:{valType:"number",dflt:1,editType:"calc"},endline:{valType:"boolean",editType:"calc"},endlinewidth:{valType:"number",dflt:1,editType:"calc"},endlinecolor:{valType:"color",editType:"calc"},tick0:{valType:"number",min:0,dflt:0,editType:"calc"},dtick:{valType:"number",min:0,dflt:1,editType:"calc"},arraytick0:{valType:"integer",min:0,dflt:0,editType:"calc"},arraydtick:{valType:"integer",min:1,dflt:1,editType:"calc"},editType:"calc"}}}),hw=p({"src/traces/carpet/attributes.js"(e,t){var r=D(),n=uw(),i=V(),a=r({editType:"calc"}),o=wn().zorder;a.family.dflt='"Open Sans", verdana, arial, sans-serif',a.size.dflt=12,a.color.dflt=i.defaultLine,t.exports={carpet:{valType:"string",editType:"calc"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},y:{valType:"data_array",editType:"calc+clearAxisTypes"},a:{valType:"data_array",editType:"calc"},a0:{valType:"number",dflt:0,editType:"calc"},da:{valType:"number",dflt:1,editType:"calc"},b:{valType:"data_array",editType:"calc"},b0:{valType:"number",dflt:0,editType:"calc"},db:{valType:"number",dflt:1,editType:"calc"},cheaterslope:{valType:"number",dflt:1,editType:"calc"},aaxis:n,baxis:n,font:a,color:{valType:"color",dflt:i.defaultLine,editType:"plot"},zorder:o}}}),pw=p({"src/traces/carpet/xy_defaults.js"(e,t){var r=st().isArray1D;t.exports=function(e,t,n){var i=n("x"),a=i&&i.length,o=n("y"),s=o&&o.length;if(!a&&!s)return!1;if(t._cheater=!i,a&&!r(i)||s&&!r(o))t._length=null;else{var l=a?i.length:1/0;s&&(l=Math.min(l,o.length)),t.a&&t.a.length&&(l=Math.min(l,t.a.length)),t.b&&t.b.length&&(l=Math.min(l,t.b.length)),t._length=l}return!0}}}),dw=p({"src/traces/carpet/axis_defaults.js"(e,t){var r=hw(),n=q().addOpacity,i=Ve(),a=st(),o=Rt(),s=Bt(),l=Nt(),c=bi(),u=er(),h=tr();t.exports=function(e,t,p){var d=p.letter,f=p.font||{},m=r[d+"axis"];function g(r,n){return a.coerce(e,t,m,r,n)}function y(r,n){return a.coerce2(e,t,m,r,n)}p.name&&(t._name=p.name,t._id=p.name),g("autotypenumbers",p.autotypenumbersDflt);var v=g("type");"-"===v&&(p.data&&function(e,t){if("-"===e.type){var r=e._id.charAt(0),n=e[r+"calendar"];e.type=h(t,n,{autotypenumbers:e.autotypenumbers})}}(t,p.data),"-"===t.type?t.type="linear":v=e.type=t.type),g("smoothing"),g("cheatertype"),g("showticklabels"),g("labelprefix",d+" = "),g("labelsuffix"),g("showtickprefix"),g("showticksuffix"),g("separatethousands"),g("tickformat"),g("exponentformat"),g("minexponent"),g("showexponent"),g("categoryorder"),g("tickmode"),g("tickvals"),g("ticktext"),g("tick0"),g("dtick"),"array"===t.tickmode&&(g("arraytick0"),g("arraydtick")),g("labelpadding"),t._hovertitle=d,"date"===v&&i.getComponentMethod("calendars","handleDefaults")(e,t,"calendar",p.calendar),u(t,p.fullLayout),t.c2p=a.identity;var x=g("color",p.dfltColor),b=x===e.color?x:f.color;g("title.text")&&(a.coerceFont(g,"title.font",f,{overrideDflt:{size:a.bigFont(f.size),color:b}}),g("title.offset")),g("tickangle"),g("autorange",!t.isValidRange(e.range))&&g("rangemode"),g("range"),t.cleanRange(),g("fixedrange"),o(e,t,g,v),l(e,t,g,v,p),s(e,t,g,v,p),c(e,t,g,{data:p.data,dataAttr:d});var _=y("gridcolor",n(x,.3)),w=y("gridwidth"),k=y("griddash"),T=g("showgrid");T||(delete t.gridcolor,delete t.gridwidth,delete t.griddash);var S=y("startlinecolor",x),A=y("startlinewidth",w);g("startline",t.showgrid||!!S||!!A)||(delete t.startlinecolor,delete t.startlinewidth);var M=y("endlinecolor",x),E=y("endlinewidth",w);return g("endline",t.showgrid||!!M||!!E)||(delete t.endlinecolor,delete t.endlinewidth),T?(g("minorgridcount"),g("minorgridwidth",w),g("minorgriddash",k),g("minorgridcolor",n(_,.06)),t.minorgridcount||(delete t.minorgridwidth,delete t.minorgriddash,delete t.minorgridcolor)):(delete t.gridcolor,delete t.gridwidth,delete t.griddash),"none"===t.showticklabels&&(delete t.tickfont,delete t.tickangle,delete t.showexponent,delete t.exponentformat,delete t.minexponent,delete t.tickformat,delete t.showticksuffix,delete t.showtickprefix),t.showticksuffix||delete t.ticksuffix,t.showtickprefix||delete t.tickprefix,g("tickmode"),t}}}),fw=p({"src/traces/carpet/ab_defaults.js"(e,t){var r=dw(),n=gt();t.exports=function(e,t,i,a,o){a("a")||(a("da"),a("a0")),a("b")||(a("db"),a("b0")),function(e,t,i,a){["aaxis","baxis"].forEach((function(o){var s=o.charAt(0),l=e[o]||{},c=n.newContainer(t,o),u={noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,tickfont:"x",id:s+"axis",letter:s,font:t.font,name:o,data:e[s],calendar:t.calendar,dfltColor:a,bgColor:i.paper_bgcolor,autotypenumbersDflt:i.autotypenumbers,fullLayout:i};r(l,c,u),c._categories=c._categories||[],e[o]||"-"===l.type||(e[o]={type:l.type})}))}(e,t,i,o)}}}),mw=p({"src/traces/carpet/defaults.js"(e,t){var r=st(),n=pw(),i=fw(),a=hw(),o=V();t.exports=function(e,t,s,l){function c(n,i){return r.coerce(e,t,a,n,i)}t._clipPathId="clip"+t.uid+"carpet";var u=c("color",o.defaultLine);r.coerceFont(c,"font",l.font),c("carpet"),i(e,t,l,c,u),t.a&&t.b?(t.a.length<3&&(t.aaxis.smoothing=0),t.b.length<3&&(t.baxis.smoothing=0),n(e,t,c)||(t.visible=!1),t._cheater&&c("cheaterslope"),c("zorder")):t.visible=!1}}}),gw=p({"src/traces/carpet/map_1d_array.js"(e,t){var r=st().isArrayOrTypedArray;t.exports=function(e,t,n){var i;for(r(e)?e.length>t.length&&(e=e.slice(0,t.length)):e=[],i=0;i<t.length;i++)e[i]=n(t[i]);return e}}}),yw=p({"src/traces/carpet/makepath.js"(e,t){t.exports=function(e,t,r){if(0===e.length)return"";var n,i=[],a=r?3:1;for(n=0;n<e.length;n+=a)i.push(e[n]+","+t[n]),r&&n<e.length-a&&(i.push("C"),i.push([e[n+1]+","+t[n+1],e[n+2]+","+t[n+2]+" "].join(" ")));return i.join(r?"":"L")}}}),vw=p({"src/traces/carpet/orient_text.js"(e,t){t.exports=function(e,t,r,n,i,a){var o=i[0]*e.dpdx(t),s=i[1]*e.dpdy(r),l=1,c=1;if(a){var u=Math.sqrt(i[0]*i[0]+i[1]*i[1]),h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),p=(i[0]*a[0]+i[1]*a[1])/u/h;c=Math.max(0,p)}var d=180*Math.atan2(s,o)/Math.PI;return d<-90?(d+=180,l=-l):d>90&&(d-=180,l=-l),{angle:d,flip:l,p:e.c2p(n,t,r),offsetMultplier:c}}}}),xw=p({"src/traces/carpet/plot.js"(e,t){var r=v(),n=Jt(),i=gw(),a=yw(),o=vw(),s=At(),l=st(),c=l.strRotate,u=l.strTranslate,h=St();function p(e,t,o,s,l,c,u){var h="const-"+l+"-lines",p=o.selectAll("."+h).data(c);p.enter().append("path").classed(h,!0).style("vector-effect",u?"none":"non-scaling-stroke"),p.each((function(o){var s=o,l=s.x,c=s.y,u=i([],l,e.c2p),h=i([],c,t.c2p),p="M"+a(u,h,s.smoothing);r.select(this).attr("d",p).style("stroke-width",s.width).style("stroke",s.color).style("stroke-dasharray",n.dashStyle(s.dash,s.width)).style("fill","none")})),p.exit().remove()}function d(e,t,i,a,l,h,p,d){var f=h.selectAll("text."+d).data(p);f.enter().append("text").classed(d,!0);var m=0,g={};return f.each((function(l,h){var p;if("auto"===l.axis.tickangle)p=o(a,t,i,l.xy,l.dxy);else{var d=(l.axis.tickangle+180)*Math.PI/180;p=o(a,t,i,l.xy,[Math.cos(d),Math.sin(d)])}h||(g={angle:p.angle,flip:p.flip});var f=(l.endAnchor?-1:1)*p.flip,y=r.select(this).attr({"text-anchor":f>0?"start":"end","data-notex":1}).call(n.font,l.font).text(l.text).call(s.convertToTspans,e),v=n.bBox(this);y.attr("transform",u(p.p[0],p.p[1])+c(p.angle)+u(l.axis.labelpadding*f,.3*v.height)),m=Math.max(m,v.width+l.axis.labelpadding)})),f.exit().remove(),g.maxExtent=m,g}t.exports=function(e,t,n,s){var c=e._context.staticPlot,u=t.xaxis,h=t.yaxis,f=e._fullLayout._clips;l.makeTraceGroups(s,n,"trace").each((function(t){var n=r.select(this),s=t[0],m=s.trace,y=m.aaxis,v=m.baxis,x=l.ensureSingle(n,"g","minorlayer"),b=l.ensureSingle(n,"g","majorlayer"),_=l.ensureSingle(n,"g","boundarylayer"),w=l.ensureSingle(n,"g","labellayer");n.style("opacity",m.opacity),p(u,h,b,0,"a",y._gridlines,!0),p(u,h,b,0,"b",v._gridlines,!0),p(u,h,x,0,"a",y._minorgridlines,!0),p(u,h,x,0,"b",v._minorgridlines,!0),p(u,h,_,0,"a-boundary",y._boundarylines,c),p(u,h,_,0,"b-boundary",v._boundarylines,c);var k=d(e,u,h,m,0,w,y._labels,"a-label"),T=d(e,u,h,m,0,w,v._labels,"b-label");!function(e,t,r,n,i,a,s,c){var u,h,p,d,f=l.aggNums(Math.min,null,r.a),m=l.aggNums(Math.max,null,r.a),y=l.aggNums(Math.min,null,r.b),v=l.aggNums(Math.max,null,r.b);u=.5*(f+m),h=y,p=r.ab2xy(u,h,!0),d=r.dxyda_rough(u,h),void 0===s.angle&&l.extendFlat(s,o(r,i,a,p,r.dxydb_rough(u,h))),g(e,t,r,0,p,d,r.aaxis,i,a,s,"a-title"),u=f,h=.5*(y+v),p=r.ab2xy(u,h,!0),d=r.dxydb_rough(u,h),void 0===c.angle&&l.extendFlat(c,o(r,i,a,p,r.dxyda_rough(u,h))),g(e,t,r,0,p,d,r.baxis,i,a,c,"b-title")}(e,w,m,0,u,h,k,T),function(e,t,r,n,o){var s,c,u,h,p=r.select("#"+e._clipPathId);p.size()||(p=r.append("clipPath").classed("carpetclip",!0));var d=l.ensureSingle(p,"path","carpetboundary"),f=t.clipsegments,m=[];for(h=0;h<f.length;h++)s=f[h],c=i([],s.x,n.c2p),u=i([],s.y,o.c2p),m.push(a(c,u,s.bicubic));var g="M"+m.join("L")+"Z";p.attr("id",e._clipPathId),d.attr("d",g)}(m,s,f,u,h)}))};var f=h.LINE_SPACING,m=(1-h.MID_SHIFT)/f+1;function g(e,t,i,a,l,h,p,d,g,y,v){var x=[];p.title.text&&x.push(p.title.text);var b=t.selectAll("text."+v).data(x),_=y.maxExtent;b.enter().append("text").classed(v,!0),b.each((function(){var t=o(i,d,g,l,h);-1===["start","both"].indexOf(p.showticklabels)&&(_=0);var a=p.title.font.size;_+=a+p.title.offset;var v=(y.angle+(y.flip<0?180:0)-t.angle+450)%360,x=v>90&&v<270,b=r.select(this);b.text(p.title.text).call(s.convertToTspans,e),x&&(_=(-s.lineCount(b)+m)*f*a-_),b.attr("transform",u(t.p[0],t.p[1])+c(t.angle)+u(0,_)).attr("text-anchor","middle").call(n.font,p.title.font)})),b.exit().remove()}}}),bw=p({"src/traces/carpet/cheater_basis.js"(e,t){var r=st().isArrayOrTypedArray;t.exports=function(e,t,n){var i,a,o,s,l,c,u=[],h=r(e)?e.length:e,p=r(t)?t.length:t,d=r(e)?e:null,f=r(t)?t:null;d&&(o=(d.length-1)/(d[d.length-1]-d[0])/(h-1)),f&&(s=(f.length-1)/(f[f.length-1]-f[0])/(p-1));var m=1/0,g=-1/0;for(a=0;a<p;a++)for(u[a]=[],l=f?(f[a]-f[0])*s:a/(p-1),i=0;i<h;i++)c=(d?(d[i]-d[0])*o:i/(h-1))-l*n,m=Math.min(c,m),g=Math.max(c,g),u[a][i]=c;var y=1/(g-m),v=-m*y;for(a=0;a<p;a++)for(i=0;i<h;i++)u[a][i]=y*u[a][i]+v;return u}}}),_w=p({"src/traces/carpet/array_minmax.js"(e,t){var r=st().isArrayOrTypedArray;function n(e,t){if(!r(e)||t>=10)return null;for(var i=1/0,a=-1/0,o=e.length,s=0;s<o;s++){var l=e[s];if(r(l)){var c=n(l,t+1);c&&(i=Math.min(c[0],i),a=Math.max(c[1],a))}else i=Math.min(l,i),a=Math.max(l,a)}return[i,a]}t.exports=function(e){return n(e,0)}}}),ww=p({"src/traces/carpet/calc_gridlines.js"(e,t){var r=nr(),n=R().extendFlat;t.exports=function(e,t,i){var a,o,s,l,c,u,h,p,d,f,m,g,y,v,x=e["_"+t],b=e[t+"axis"],_=b._gridlines=[],w=b._minorgridlines=[],k=b._boundarylines=[],T=e["_"+i],S=e[i+"axis"];"array"===b.tickmode&&(b.tickvals=x.slice());var A=e._xctrl,M=e._yctrl,E=A[0].length,C=A.length,P=e._a.length,L=e._b.length;r.prepTicks(b),"array"===b.tickmode&&delete b.tickvals;var I=b.smoothing?3:1;function z(r){var n,a,o,s,l,c,u,h,d,f,m,g,y=[],v=[],x={};if("b"===t)for(a=e.b2j(r),o=Math.floor(Math.max(0,Math.min(L-2,a))),s=a-o,x.length=L,x.crossLength=P,x.xy=function(t){return e.evalxy([],t,a)},x.dxy=function(t,r){return e.dxydi([],t,o,r,s)},n=0;n<P;n++)c=Math.min(P-2,n),u=n-c,h=e.evalxy([],n,a),S.smoothing&&n>0&&(d=e.dxydi([],n-1,o,0,s),y.push(l[0]+d[0]/3),v.push(l[1]+d[1]/3),f=e.dxydi([],n-1,o,1,s),y.push(h[0]-f[0]/3),v.push(h[1]-f[1]/3)),y.push(h[0]),v.push(h[1]),l=h;else for(n=e.a2i(r),c=Math.floor(Math.max(0,Math.min(P-2,n))),u=n-c,x.length=P,x.crossLength=L,x.xy=function(t){return e.evalxy([],n,t)},x.dxy=function(t,r){return e.dxydj([],c,t,u,r)},a=0;a<L;a++)o=Math.min(L-2,a),s=a-o,h=e.evalxy([],n,a),S.smoothing&&a>0&&(m=e.dxydj([],c,a-1,u,0),y.push(l[0]+m[0]/3),v.push(l[1]+m[1]/3),g=e.dxydj([],c,a-1,u,1),y.push(h[0]-g[0]/3),v.push(h[1]-g[1]/3)),y.push(h[0]),v.push(h[1]),l=h;return x.axisLetter=t,x.axis=b,x.crossAxis=S,x.value=r,x.constvar=i,x.index=p,x.x=y,x.y=v,x.smoothing=S.smoothing,x}function O(r){var n,a,o,s,l,c=[],u=[],h={};if(h.length=x.length,h.crossLength=T.length,"b"===t)for(o=Math.max(0,Math.min(L-2,r)),l=Math.min(1,Math.max(0,r-o)),h.xy=function(t){return e.evalxy([],t,r)},h.dxy=function(t,r){return e.dxydi([],t,o,r,l)},n=0;n<E;n++)c[n]=A[r*I][n],u[n]=M[r*I][n];else for(a=Math.max(0,Math.min(P-2,r)),s=Math.min(1,Math.max(0,r-a)),h.xy=function(t){return e.evalxy([],r,t)},h.dxy=function(t,r){return e.dxydj([],a,t,s,r)},n=0;n<C;n++)c[n]=A[n][r*I],u[n]=M[n][r*I];return h.axisLetter=t,h.axis=b,h.crossAxis=S,h.value=x[r],h.constvar=i,h.index=r,h.x=c,h.y=u,h.smoothing=S.smoothing,h}if("array"===b.tickmode){for(l=5e-15,u=(c=[Math.floor((x.length-1-b.arraytick0)/b.arraydtick*(1+l)),Math.ceil(-b.arraytick0/b.arraydtick/(1+l))].sort((function(e,t){return e-t})))[0]-1,h=c[1]+1,p=u;p<h;p++)(o=b.arraytick0+b.arraydtick*p)<0||o>x.length-1||_.push(n(O(o),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(p=u;p<h;p++)if(s=b.arraytick0+b.arraydtick*p,m=Math.min(s+b.arraydtick,x.length-1),!(s<0||s>x.length-1)&&!(m<0||m>x.length-1))for(g=x[s],y=x[m],a=0;a<b.minorgridcount;a++)(v=m-s)<=0||(f=g+(y-g)*(a+1)/(b.minorgridcount+1)*(b.arraydtick/v))<x[0]||f>x[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(O(0),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(O(x.length-1),{color:b.endlinecolor,width:b.endlinewidth}))}else{for(l=5e-15,u=(c=[Math.floor((x[x.length-1]-b.tick0)/b.dtick*(1+l)),Math.ceil((x[0]-b.tick0)/b.dtick/(1+l))].sort((function(e,t){return e-t})))[0],h=c[1],p=u;p<=h;p++)d=b.tick0+b.dtick*p,_.push(n(z(d),{color:b.gridcolor,width:b.gridwidth,dash:b.griddash}));for(p=u-1;p<h+1;p++)for(d=b.tick0+b.dtick*p,a=0;a<b.minorgridcount;a++)(f=d+b.dtick*(a+1)/(b.minorgridcount+1))<x[0]||f>x[x.length-1]||w.push(n(z(f),{color:b.minorgridcolor,width:b.minorgridwidth,dash:b.minorgriddash}));b.startline&&k.push(n(z(x[0]),{color:b.startlinecolor,width:b.startlinewidth})),b.endline&&k.push(n(z(x[x.length-1]),{color:b.endlinecolor,width:b.endlinewidth}))}}}}),kw=p({"src/traces/carpet/calc_labels.js"(e,t){var r=nr(),n=R().extendFlat;t.exports=function(e,t){var i,a,o,s=t._labels=[],l=t._gridlines;for(i=0;i<l.length;i++)o=l[i],-1!==["start","both"].indexOf(t.showticklabels)&&(a=r.tickText(t,o.value),n(a,{prefix:void 0,suffix:void 0,endAnchor:!0,xy:o.xy(0),dxy:o.dxy(0,0),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a)),-1!==["end","both"].indexOf(t.showticklabels)&&(a=r.tickText(t,o.value),n(a,{endAnchor:!1,xy:o.xy(o.crossLength-1),dxy:o.dxy(o.crossLength-2,1),axis:o.axis,length:o.crossAxis.length,font:o.axis.tickfont,isFirst:0===i,isLast:i===l.length-1}),s.push(a))}}}),Tw=p({"src/traces/carpet/calc_clippath.js"(e,t){t.exports=function(e,t,r,n){var i,a,o,s=[],l=!!r.smoothing,c=!!n.smoothing,u=e[0].length-1,h=e.length-1;for(i=0,a=[],o=[];i<=u;i++)a[i]=e[0][i],o[i]=t[0][i];for(s.push({x:a,y:o,bicubic:l}),i=0,a=[],o=[];i<=h;i++)a[i]=e[i][u],o[i]=t[i][u];for(s.push({x:a,y:o,bicubic:c}),i=u,a=[],o=[];i>=0;i--)a[u-i]=e[h][i],o[u-i]=t[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=e[i][0],o[h-i]=t[i][0];return s.push({x:a,y:o,bicubic:c}),s}}}),Sw=p({"src/traces/carpet/smooth_fill_2d_array.js"(e,t){var r=st();t.exports=function(e,t,n){var i,a,o,s=[],l=[],c=e[0].length,u=e.length;function h(t,r){var n,i=0,a=0;return t>0&&void 0!==(n=e[r][t-1])&&(a++,i+=n),t<c-1&&void 0!==(n=e[r][t+1])&&(a++,i+=n),r>0&&void 0!==(n=e[r-1][t])&&(a++,i+=n),r<u-1&&void 0!==(n=e[r+1][t])&&(a++,i+=n),i/Math.max(1,a)}var p,d,f,m,g,y,v,x,b,_,w,k=0;for(i=0;i<c;i++)for(a=0;a<u;a++)void 0===e[a][i]&&(s.push(i),l.push(a),e[a][i]=h(i,a)),k=Math.max(k,Math.abs(e[a][i]));if(!s.length)return e;var T=0,S=0,A=s.length;do{for(T=0,o=0;o<A;o++){i=s[o],a=l[o];var M,E,C,P,L,I,z=0,O=0;0===i?(C=t[L=Math.min(c-1,2)],P=t[1],M=e[a][L],O+=(E=e[a][1])+(E-M)*(t[0]-P)/(P-C),z++):i===c-1&&(C=t[L=Math.max(0,c-3)],P=t[c-2],M=e[a][L],O+=(E=e[a][c-2])+(E-M)*(t[c-1]-P)/(P-C),z++),(0===i||i===c-1)&&a>0&&a<u-1&&(p=n[a+1]-n[a],O+=((d=n[a]-n[a-1])*e[a+1][i]+p*e[a-1][i])/(d+p),z++),0===a?(C=n[I=Math.min(u-1,2)],P=n[1],M=e[I][i],O+=(E=e[1][i])+(E-M)*(n[0]-P)/(P-C),z++):a===u-1&&(C=n[I=Math.max(0,u-3)],P=n[u-2],M=e[I][i],O+=(E=e[u-2][i])+(E-M)*(n[u-1]-P)/(P-C),z++),(0===a||a===u-1)&&i>0&&i<c-1&&(p=t[i+1]-t[i],O+=((d=t[i]-t[i-1])*e[a][i+1]+p*e[a][i-1])/(d+p),z++),z?O/=z:(f=t[i+1]-t[i],m=t[i]-t[i-1],x=(g=n[a+1]-n[a])*(y=n[a]-n[a-1])*(g+y),O=((v=f*m*(f+m))*(y*e[a+1][i]+g*e[a-1][i])+x*(m*e[a][i+1]+f*e[a][i-1]))/(x*(m+f)+v*(y+g))),T+=(_=(b=O-e[a][i])/k)*_,w=z?0:.85,e[a][i]+=b*(1+w)}T=Math.sqrt(T)}while(S++<100&&T>1e-5);return r.log("Smoother converged to",T,"after",S,"iterations"),e}}}),Aw=p({"src/traces/carpet/constants.js"(e,t){t.exports={RELATIVE_CULL_TOLERANCE:1e-6}}}),Mw=p({"src/traces/carpet/catmull_rom.js"(e,t){t.exports=function(e,t,r,n){var i=e[0]-t[0],a=e[1]-t[1],o=r[0]-t[0],s=r[1]-t[1],l=Math.pow(i*i+a*a,.25),c=Math.pow(o*o+s*s,.25),u=(c*c*i-l*l*o)*n,h=(c*c*a-l*l*s)*n,p=c*(l+c)*3,d=l*(l+c)*3;return[[t[0]+(p&&u/p),t[1]+(p&&h/p)],[t[0]-(d&&u/d),t[1]-(d&&h/d)]]}}}),Ew=p({"src/traces/carpet/compute_control_points.js"(e,t){var r=Mw(),n=st().ensureArray;function i(e,t,r){var n=-.5*r[0]+1.5*t[0],i=-.5*r[1]+1.5*t[1];return[(2*n+e[0])/3,(2*i+e[1])/3]}t.exports=function(e,t,a,o,s,l){var c,u,h,p,d,f,m,g,y,v,x=a[0].length,b=a.length,_=s?3*x-2:x,w=l?3*b-2:b;for(e=n(e,w),t=n(t,w),h=0;h<w;h++)e[h]=n(e[h],_),t[h]=n(t[h],_);for(u=0,p=0;u<b;u++,p+=l?3:1)for(d=e[p],f=t[p],m=a[u],g=o[u],c=0,h=0;c<x;c++,h+=s?3:1)d[h]=m[c],f[h]=g[c];if(s)for(u=0,p=0;u<b;u++,p+=l?3:1){for(c=1,h=3;c<x-1;c++,h+=3)y=r([a[u][c-1],o[u][c-1]],[a[u][c],o[u][c]],[a[u][c+1],o[u][c+1]],s),e[p][h-1]=y[0][0],t[p][h-1]=y[0][1],e[p][h+1]=y[1][0],t[p][h+1]=y[1][1];v=i([e[p][0],t[p][0]],[e[p][2],t[p][2]],[e[p][3],t[p][3]]),e[p][1]=v[0],t[p][1]=v[1],v=i([e[p][_-1],t[p][_-1]],[e[p][_-3],t[p][_-3]],[e[p][_-4],t[p][_-4]]),e[p][_-2]=v[0],t[p][_-2]=v[1]}if(l)for(h=0;h<_;h++){for(p=3;p<w-3;p+=3)y=r([e[p-3][h],t[p-3][h]],[e[p][h],t[p][h]],[e[p+3][h],t[p+3][h]],l),e[p-1][h]=y[0][0],t[p-1][h]=y[0][1],e[p+1][h]=y[1][0],t[p+1][h]=y[1][1];v=i([e[0][h],t[0][h]],[e[2][h],t[2][h]],[e[3][h],t[3][h]]),e[1][h]=v[0],t[1][h]=v[1],v=i([e[w-1][h],t[w-1][h]],[e[w-3][h],t[w-3][h]],[e[w-4][h],t[w-4][h]]),e[w-2][h]=v[0],t[w-2][h]=v[1]}if(s&&l)for(p=1;p<w;p+=(p+1)%3===0?2:1){for(h=3;h<_-3;h+=3)y=r([e[p][h-3],t[p][h-3]],[e[p][h],t[p][h]],[e[p][h+3],t[p][h+3]],s),e[p][h-1]=.5*(e[p][h-1]+y[0][0]),t[p][h-1]=.5*(t[p][h-1]+y[0][1]),e[p][h+1]=.5*(e[p][h+1]+y[1][0]),t[p][h+1]=.5*(t[p][h+1]+y[1][1]);v=i([e[p][0],t[p][0]],[e[p][2],t[p][2]],[e[p][3],t[p][3]]),e[p][1]=.5*(e[p][1]+v[0]),t[p][1]=.5*(t[p][1]+v[1]),v=i([e[p][_-1],t[p][_-1]],[e[p][_-3],t[p][_-3]],[e[p][_-4],t[p][_-4]]),e[p][_-2]=.5*(e[p][_-2]+v[0]),t[p][_-2]=.5*(t[p][_-2]+v[1])}return[e,t]}}}),Cw=p({"src/traces/carpet/create_spline_evaluator.js"(e,t){t.exports=function(e,t,r,n,i){var a=t-2,o=r-2;return n&&i?function(t,r,n){var i,s,l,c,u,h;t||(t=[]);var p=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-d));p*=3,d*=3;var g=f*f,y=g*f,v=1-f,x=v*v,b=x*v,_=m*m,w=_*m,k=1-m,T=k*k,S=T*k;for(h=0;h<e.length;h++)i=b*(u=e[h])[d][p]+3*(x*f*u[d][p+1]+v*g*u[d][p+2])+y*u[d][p+3],s=b*u[d+1][p]+3*(x*f*u[d+1][p+1]+v*g*u[d+1][p+2])+y*u[d+1][p+3],l=b*u[d+2][p]+3*(x*f*u[d+2][p+1]+v*g*u[d+2][p+2])+y*u[d+2][p+3],c=b*u[d+3][p]+3*(x*f*u[d+3][p+1]+v*g*u[d+3][p+2])+y*u[d+3][p+3],t[h]=S*i+3*(T*m*s+k*_*l)+w*c;return t}:n?function(t,r,n){t||(t=[]);var i,s,l,c,u,h,p=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-d));p*=3;var g=f*f,y=g*f,v=1-f,x=v*v,b=x*v,_=1-m;for(u=0;u<e.length;u++)i=_*(h=e[u])[d][p]+m*h[d+1][p],s=_*h[d][p+1]+m*h[d+1][p+1],l=_*h[d][p+2]+m*h[d+1][p+1],c=_*h[d][p+3]+m*h[d+1][p+1],t[u]=b*i+3*(x*f*s+v*g*l)+y*c;return t}:i?function(t,r,n){t||(t=[]);var i,s,l,c,u,h,p=Math.max(0,Math.min(Math.floor(r),a)),d=Math.max(0,Math.min(Math.floor(n),o)),f=Math.max(0,Math.min(1,r-p)),m=Math.max(0,Math.min(1,n-d));d*=3;var g=m*m,y=g*m,v=1-m,x=v*v,b=x*v,_=1-f;for(u=0;u<e.length;u++)i=_*(h=e[u])[d][p]+f*h[d][p+1],s=_*h[d+1][p]+f*h[d+1][p+1],l=_*h[d+2][p]+f*h[d+2][p+1],c=_*h[d+3][p]+f*h[d+3][p+1],t[u]=b*i+3*(x*m*s+v*g*l)+y*c;return t}:function(t,r,n){t||(t=[]);var i,s,l,c,u=Math.max(0,Math.min(Math.floor(r),a)),h=Math.max(0,Math.min(Math.floor(n),o)),p=Math.max(0,Math.min(1,r-u)),d=Math.max(0,Math.min(1,n-h)),f=1-d,m=1-p;for(l=0;l<e.length;l++)i=m*(c=e[l])[h][u]+p*c[h][u+1],s=m*c[h+1][u]+p*c[h+1][u+1],t[l]=f*i+d*s;return t}}}}),Pw=p({"src/traces/carpet/create_i_derivative_evaluator.js"(e,t){t.exports=function(e,t,r){return t&&r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3,n*=3;var p=i*i,d=1-i,f=d*d,m=d*i*2,g=-3*f,y=3*(f-m),v=3*(m-p),x=3*p,b=a*a,_=b*a,w=1-a,k=w*w,T=k*w;for(h=0;h<e.length;h++)o=g*(u=e[h])[n][r]+y*u[n][r+1]+v*u[n][r+2]+x*u[n][r+3],s=g*u[n+1][r]+y*u[n+1][r+1]+v*u[n+1][r+2]+x*u[n+1][r+3],l=g*u[n+2][r]+y*u[n+2][r+1]+v*u[n+2][r+2]+x*u[n+2][r+3],c=g*u[n+3][r]+y*u[n+3][r+1]+v*u[n+3][r+2]+x*u[n+3][r+3],t[h]=T*o+3*(k*a*s+w*b*l)+_*c;return t}:t?function(t,r,n,i,a){var o,s,l,c;t||(t=[]),r*=3;var u=i*i,h=1-i,p=h*h,d=h*i*2,f=-3*p,m=3*(p-d),g=3*(d-u),y=3*u,v=1-a;for(l=0;l<e.length;l++)o=f*(c=e[l])[n][r]+m*c[n][r+1]+g*c[n][r+2]+y*c[n][r+3],s=f*c[n+1][r]+m*c[n+1][r+1]+g*c[n+1][r+2]+y*c[n+1][r+3],t[l]=v*o+a*s;return t}:r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),n*=3;var p=a*a,d=p*a,f=1-a,m=f*f,g=m*f;for(u=0;u<e.length;u++)o=(h=e[u])[n][r+1]-h[n][r],s=h[n+1][r+1]-h[n+1][r],l=h[n+2][r+1]-h[n+2][r],c=h[n+3][r+1]-h[n+3][r],t[u]=g*o+3*(m*a*s+f*p*l)+d*c;return t}:function(t,r,n,i,a){var o,s,l,c;t||(t=[]);var u=1-a;for(l=0;l<e.length;l++)o=(c=e[l])[n][r+1]-c[n][r],s=c[n+1][r+1]-c[n+1][r],t[l]=u*o+a*s;return t}}}}),Lw=p({"src/traces/carpet/create_j_derivative_evaluator.js"(e,t){t.exports=function(e,t,r){return t&&r?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3,n*=3;var p=i*i,d=p*i,f=1-i,m=f*f,g=m*f,y=a*a,v=1-a,x=v*v,b=v*a*2,_=-3*x,w=3*(x-b),k=3*(b-y),T=3*y;for(h=0;h<e.length;h++)o=_*(u=e[h])[n][r]+w*u[n+1][r]+k*u[n+2][r]+T*u[n+3][r],s=_*u[n][r+1]+w*u[n+1][r+1]+k*u[n+2][r+1]+T*u[n+3][r+1],l=_*u[n][r+2]+w*u[n+1][r+2]+k*u[n+2][r+2]+T*u[n+3][r+2],c=_*u[n][r+3]+w*u[n+1][r+3]+k*u[n+2][r+3]+T*u[n+3][r+3],t[h]=g*o+3*(m*i*s+f*p*l)+d*c;return t}:t?function(t,r,n,i,a){var o,s,l,c,u,h;t||(t=[]),r*=3;var p=a*a,d=p*a,f=1-a,m=f*f,g=m*f;for(u=0;u<e.length;u++)o=(h=e[u])[n+1][r]-h[n][r],s=h[n+1][r+1]-h[n][r+1],l=h[n+1][r+2]-h[n][r+2],c=h[n+1][r+3]-h[n][r+3],t[u]=g*o+3*(m*a*s+f*p*l)+d*c;return t}:r?function(t,r,n,i,a){var o,s,l,c;t||(t=[]),n*=3;var u=1-i,h=a*a,p=1-a,d=p*p,f=p*a*2,m=-3*d,g=3*(d-f),y=3*(f-h),v=3*h;for(l=0;l<e.length;l++)o=m*(c=e[l])[n][r]+g*c[n+1][r]+y*c[n+2][r]+v*c[n+3][r],s=m*c[n][r+1]+g*c[n+1][r+1]+y*c[n+2][r+1]+v*c[n+3][r+1],t[l]=u*o+i*s;return t}:function(t,r,n,i,a){var o,s,l,c;t||(t=[]);var u=1-i;for(l=0;l<e.length;l++)o=(c=e[l])[n+1][r]-c[n][r],s=c[n+1][r+1]-c[n][r+1],t[l]=u*o+i*s;return t}}}}),Iw=p({"src/traces/carpet/set_convert.js"(e,t){var r=Aw(),n=Ge().findBin,i=Ew(),a=Cw(),o=Pw(),s=Lw();t.exports=function(e){var t=e._a,l=e._b,c=t.length,u=l.length,h=e.aaxis,p=e.baxis,d=t[0],f=t[c-1],m=l[0],g=l[u-1],y=t[t.length-1]-t[0],v=l[l.length-1]-l[0],x=y*r.RELATIVE_CULL_TOLERANCE,b=v*r.RELATIVE_CULL_TOLERANCE;d-=x,f+=x,m-=b,g+=b,e.isVisible=function(e,t){return e>d&&e<f&&t>m&&t<g},e.isOccluded=function(e,t){return e<d||e>f||t<m||t>g},e.setScale=function(){var t=e._x,r=e._y,n=i(e._xctrl,e._yctrl,t,r,h.smoothing,p.smoothing);e._xctrl=n[0],e._yctrl=n[1],e.evalxy=a([e._xctrl,e._yctrl],c,u,h.smoothing,p.smoothing),e.dxydi=o([e._xctrl,e._yctrl],h.smoothing,p.smoothing),e.dxydj=s([e._xctrl,e._yctrl],h.smoothing,p.smoothing)},e.i2a=function(e){var r=Math.max(0,Math.floor(e[0]),c-2),n=e[0]-r;return(1-n)*t[r]+n*t[r+1]},e.j2b=function(e){var t=Math.max(0,Math.floor(e[1]),c-2),r=e[1]-t;return(1-r)*l[t]+r*l[t+1]},e.ij2ab=function(t){return[e.i2a(t[0]),e.j2b(t[1])]},e.a2i=function(e){var r=Math.max(0,Math.min(n(e,t),c-2)),i=t[r],a=t[r+1];return Math.max(0,Math.min(c-1,r+(e-i)/(a-i)))},e.b2j=function(e){var t=Math.max(0,Math.min(n(e,l),u-2)),r=l[t],i=l[t+1];return Math.max(0,Math.min(u-1,t+(e-r)/(i-r)))},e.ab2ij=function(t){return[e.a2i(t[0]),e.b2j(t[1])]},e.i2c=function(t,r){return e.evalxy([],t,r)},e.ab2xy=function(r,n,i){if(!i&&(r<t[0]||r>t[c-1]|n<l[0]||n>l[u-1]))return[!1,!1];var a=e.a2i(r),o=e.b2j(n),s=e.evalxy([],a,o);if(i){var h,p,d,f,m=0,g=0,y=[];r<t[0]?(h=0,p=0,m=(r-t[0])/(t[1]-t[0])):r>t[c-1]?(h=c-2,p=1,m=(r-t[c-1])/(t[c-1]-t[c-2])):p=a-(h=Math.max(0,Math.min(c-2,Math.floor(a)))),n<l[0]?(d=0,f=0,g=(n-l[0])/(l[1]-l[0])):n>l[u-1]?(d=u-2,f=1,g=(n-l[u-1])/(l[u-1]-l[u-2])):f=o-(d=Math.max(0,Math.min(u-2,Math.floor(o)))),m&&(e.dxydi(y,h,d,p,f),s[0]+=y[0]*m,s[1]+=y[1]*m),g&&(e.dxydj(y,h,d,p,f),s[0]+=y[0]*g,s[1]+=y[1]*g)}return s},e.c2p=function(e,t,r){return[t.c2p(e[0]),r.c2p(e[1])]},e.p2x=function(e,t,r){return[t.p2c(e[0]),r.p2c(e[1])]},e.dadi=function(e){var r=Math.max(0,Math.min(t.length-2,e));return t[r+1]-t[r]},e.dbdj=function(e){var t=Math.max(0,Math.min(l.length-2,e));return l[t+1]-l[t]},e.dxyda=function(t,r,n,i){var a=e.dxydi(null,t,r,n,i),o=e.dadi(t,n);return[a[0]/o,a[1]/o]},e.dxydb=function(t,r,n,i){var a=e.dxydj(null,t,r,n,i),o=e.dbdj(r,i);return[a[0]/o,a[1]/o]},e.dxyda_rough=function(t,r,n){var i=y*(n||.1),a=e.ab2xy(t+i,r,!0),o=e.ab2xy(t-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dxydb_rough=function(t,r,n){var i=v*(n||.1),a=e.ab2xy(t,r+i,!0),o=e.ab2xy(t,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},e.dpdx=function(e){return e._m},e.dpdy=function(e){return e._m}}}}),zw=p({"src/traces/carpet/calc.js"(e,t){var r=nr(),n=st().isArray1D,i=bw(),a=_w(),o=ww(),s=kw(),l=Tw(),c=Io(),u=Sw(),h=Lo(),p=Iw();t.exports=function(e,t){var d=r.getFromId(e,t.xaxis),f=r.getFromId(e,t.yaxis),m=t.aaxis,g=t.baxis,y=t.x,v=t.y,x=[];y&&n(y)&&x.push("x"),v&&n(v)&&x.push("y"),x.length&&h(t,m,g,"a","b",x);var b=t._a=t._a||t.a,_=t._b=t._b||t.b;y=t._x||t.x,v=t._y||t.y;var w={};if(t._cheater){var k="index"===m.cheatertype?b.length:b,T="index"===g.cheatertype?_.length:_;y=i(k,T,t.cheaterslope)}t._x=y=c(y),t._y=v=c(v),u(y,b,_),u(v,b,_),p(t),t.setScale();var S=a(y),A=a(v),M=.5*(S[1]-S[0]),E=.5*(S[1]+S[0]),C=.5*(A[1]-A[0]),P=.5*(A[1]+A[0]),L=1.3;return S=[E-M*L,E+M*L],A=[P-C*L,P+C*L],t._extremes[d._id]=r.findExtremes(d,S,{padded:!0}),t._extremes[f._id]=r.findExtremes(f,A,{padded:!0}),o(t,"a","b"),o(t,"b","a"),s(t,m),s(t,g),w.clipsegments=l(t._xctrl,t._yctrl,m,g),w.x=y,w.y=v,w.a=b,w.b=_,[w]}}}),Ow=p({"src/traces/carpet/index.js"(e,t){t.exports={attributes:hw(),supplyDefaults:mw(),plot:xw(),calc:zw(),animatable:!0,isContainer:!0,moduleType:"trace",name:"carpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","carpetAxis","notLegendIsolatable","noMultiCategory","noHover","noSortingByValue"],meta:{}}}}),Rw=p({"lib/carpet.js"(e,t){t.exports=Ow()}}),Dw=p({"src/traces/scattercarpet/attributes.js"(e,t){var r=_n(),n=wn(),i=N(),a=Oe().hovertemplateAttrs,o=Oe().texttemplateAttrs,s=Lt(),l=R().extendFlat,c=n.marker,u=n.line,h=c.line;t.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),texttemplate:o({editType:"plot"},{keys:["a","b","text"]}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:u.dash,backoff:u.backoff,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:l({},n.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:r(),marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,angle:c.angle,angleref:c.angleref,standoff:c.standoff,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:h.width,editType:"calc"},s("marker.line")),gradient:c.gradient,editType:"calc"},s("marker")),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron,hovertemplate:a(),zorder:n.zorder}}}),jw=p({"src/traces/scattercarpet/defaults.js"(e,t){var r=st(),n=bn(),i=$t(),a=Wn(),o=$n(),s=Zn(),l=Xn(),c=Yn(),u=Dw();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}d("carpet"),t.xaxis="x",t.yaxis="y";var f=d("a"),m=d("b"),g=Math.min(f.length,m.length);if(g){t._length=g,d("text"),d("texttemplate"),d("hovertext"),d("mode",g<n.PTS_LINESONLY?"lines+markers":"lines"),i.hasMarkers(t)&&a(e,t,h,p,d,{gradient:!0}),i.hasLines(t)&&(o(e,t,h,p,d,{backoff:!0}),s(e,t,d),d("connectgaps")),i.hasText(t)&&l(e,t,p,d);var y=[];(i.hasMarkers(t)||i.hasText(t))&&(d("marker.maxdisplayed"),y.push("points")),d("fill"),"none"!==t.fill&&(c(e,t,h,d),i.hasLines(t)||s(e,t,d)),"tonext"!==t.fill&&"toself"!==t.fill||y.push("fills"),"fills"!==d("hoveron",y.join("+")||"points")&&d("hovertemplate"),d("zorder"),r.coerceSelectionMarkerOpacity(t,d)}else t.visible=!1}}}),Fw=p({"src/traces/scattercarpet/format_labels.js"(e,t){t.exports=function(e,t){var r={},n=t._carpet,i=n.ab2ij([e.a,e.b]),a=Math.floor(i[0]),o=i[0]-a,s=Math.floor(i[1]),l=i[1]-s,c=n.evalxy([],a,s,o,l);return r.yLabel=c[1].toFixed(3),r}}}),Bw=p({"src/traces/carpet/lookup_carpetid.js"(e,t){t.exports=function(e,t){for(var r,n=e._fullData.length,i=0;i<n;i++){var a=e._fullData[i];if(a.index!==t.index&&"carpet"===a.type&&(r||(r=a),a.carpet===t.carpet))return a}return r}}}),Nw=p({"src/traces/scattercarpet/calc.js"(e,t){var r=k(),n=ri(),i=ni(),a=ii(),o=ai().calcMarkerSize,s=Bw();t.exports=function(e,t){var l=t._carpetTrace=s(e,t);if(l&&l.visible&&"legendonly"!==l.visible){var c;t.xaxis=l.xaxis,t.yaxis=l.yaxis;var u,h,p=t._length,d=new Array(p),f=!1;for(c=0;c<p;c++)if(u=t.a[c],h=t.b[c],r(u)&&r(h)){var m=l.ab2xy(+u,+h,!0),g=l.isVisible(+u,+h);g||(f=!0),d[c]={x:m[0],y:m[1],a:u,b:h,vis:g}}else d[c]={x:!1,y:!1};return t._needsCull=f,d[0].carpet=l,d[0].trace=t,o(t,p),n(e,t),i(d,t),a(d,t),d}}}}),Uw=p({"src/traces/scattercarpet/plot.js"(e,t){var r=hi(),n=nr(),i=Jt();t.exports=function(e,t,a,o){var s,l,c,u=a[0][0].carpet,h=n.getFromId(e,u.xaxis||"x"),p=n.getFromId(e,u.yaxis||"y"),d={xaxis:h,yaxis:p,plot:t.plot};for(s=0;s<a.length;s++)(l=a[s][0].trace)._xA=h,l._yA=p;for(r(e,d,a,o),s=0;s<a.length;s++)l=a[s][0].trace,c=o.selectAll("g.trace"+l.uid+" .js-line"),i.setClipUrl(c,a[s][0].carpet._clipPathId,e)}}}),Vw=p({"src/traces/scattercarpet/hover.js"(e,t){var r=gi(),n=st().fillText;t.exports=function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/e.ya._length,c=e.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),u),o}var p=s.cd[s.index];s.a=p.a,s.b=p.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,f=d._carpet,m=d._module.formatLabels(p,d);s.yLabel=m.yLabel,delete s.text;var g=[];if(!d.hovertemplate){var y=(p.hi||d.hoverinfo).split("+");-1!==y.indexOf("all")&&(y=["a","b","text"]),-1!==y.indexOf("a")&&v(f.aaxis,p.a),-1!==y.indexOf("b")&&v(f.baxis,p.b),g.push("y: "+s.yLabel),-1!==y.indexOf("text")&&n(p,d,g),s.extraText=g.join("<br>")}return o}function v(e,t){var r;r=e.labelprefix&&e.labelprefix.length>0?e.labelprefix.replace(/ = $/,""):e._hovertitle,g.push(r+": "+t.toFixed(3)+e.labelsuffix)}}}}),qw=p({"src/traces/scattercarpet/event_data.js"(e,t){t.exports=function(e,t,r,n,i){var a=n[i];return e.a=a.a,e.b=a.b,e.y=a.y,e}}}),Hw=p({"src/traces/scattercarpet/index.js"(e,t){t.exports={attributes:Dw(),supplyDefaults:jw(),colorbar:pi(),formatLabels:Fw(),calc:Nw(),plot:Uw(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Vw(),selectPoints:yi(),eventData:qw(),moduleType:"trace",name:"scattercarpet",basePlotModule:Ai(),categories:["svg","carpet","symbols","showLegend","carpetDependent","zoomScale"],meta:{}}}}),Gw=p({"lib/scattercarpet.js"(e,t){t.exports=Hw()}}),Ww=p({"src/traces/contourcarpet/attributes.js"(e,t){var r=bo(),n=ss(),i=Lt(),a=R().extendFlat,o=n.contours;t.exports=a({carpet:{valType:"string",editType:"calc"},z:r.z,a:r.x,a0:r.x0,da:r.dx,b:r.y,b0:r.y0,db:r.dy,text:r.text,hovertext:r.hovertext,transpose:r.transpose,atype:r.xtype,btype:r.ytype,fillcolor:n.fillcolor,autocontour:n.autocontour,ncontours:n.ncontours,contours:{type:o.type,start:o.start,end:o.end,size:o.size,coloring:{valType:"enumerated",values:["fill","lines","none"],dflt:"fill",editType:"calc"},showlines:o.showlines,showlabels:o.showlabels,labelfont:o.labelfont,labelformat:o.labelformat,operation:o.operation,value:o.value,editType:"calc",impliedEdits:{autocontour:!1}},line:{color:n.line.color,width:n.line.width,dash:n.line.dash,smoothing:n.line.smoothing,editType:"plot"},zorder:n.zorder},i("",{cLetter:"z",autoColorDflt:!1}))}}),$w=p({"src/traces/contourcarpet/defaults.js"(e,t){var r=st(),n=_o(),i=Ww(),a=Ps(),o=cs(),s=hs();t.exports=function(e,t,l,c){function u(n,a){return r.coerce(e,t,i,n,a)}if(u("carpet"),e.a&&e.b){if(!n(e,t,u,c,"a","b"))return void(t.visible=!1);u("text"),"constraint"===u("contours.type")?a(e,t,u,c,l,{hasHover:!1}):(o(e,t,u,(function(n){return r.coerce2(e,t,i,n)})),s(e,t,u,c,{hasHover:!1}))}else t._defaultColor=l,t._length=null;u("zorder")}}}),Zw=p({"src/traces/contourcarpet/calc.js"(e,t){var r=Gt(),n=st(),i=Lo(),a=Io(),o=zo(),s=Oo(),l=Ro(),c=$w(),u=Bw(),h=ds();t.exports=function(e,t){var p=t._carpetTrace=u(e,t);if(p&&p.visible&&"legendonly"!==p.visible){if(!t.a||!t.b){var d=e.data[p.index],f=e.data[t.index];f.a||(f.a=d.a),f.b||(f.b=d.b),c(f,t,t._defaultColor,e._fullLayout)}var m=function(e,t){var c,u,h,p,d,f,m,g=t._carpetTrace,y=g.aaxis,v=g.baxis;y._minDtick=0,v._minDtick=0,n.isArray1D(t.z)&&i(t,y,v,"a","b",["z"]),c=t._a=t._a||t.a,p=t._b=t._b||t.b,c=c?y.makeCalcdata(t,"_a"):[],p=p?v.makeCalcdata(t,"_b"):[],u=t.a0||0,h=t.da||1,d=t.b0||0,f=t.db||1,m=t._z=a(t._z||t.z,t.transpose),t._emptypoints=s(m),o(m,t._emptypoints);var x=n.maxRowLength(m),b="scaled"===t.xtype?"":c,_=l(t,b,u,h,x,y),w="scaled"===t.ytype?"":p,k=l(t,w,d,f,m.length,v),T={a:_,b:k,z:m};return"levels"===t.contours.type&&"none"!==t.contours.coloring&&r(e,t,{vals:m,containerStr:"",cLetter:"z"}),[T]}(e,t);return h(t,t._z),m}}}}),Xw=p({"src/traces/carpet/axis_aligned_line.js"(e,t){var r=st().isArrayOrTypedArray;t.exports=function(e,t,n,i){var a,o,s,l,c,u,h,p,d,f,m,g,y,v=r(n)?"a":"b",x=("a"===v?e.aaxis:e.baxis).smoothing,b="a"===v?e.a2i:e.b2j,_="a"===v?n:i,w="a"===v?i:n,k="a"===v?t.a.length:t.b.length,T="a"===v?t.b.length:t.a.length,S=Math.floor("a"===v?e.b2j(w):e.a2i(w)),A="a"===v?function(t){return e.evalxy([],t,S)}:function(t){return e.evalxy([],S,t)};x&&(s=Math.max(0,Math.min(T-2,S)),l=S-s,o="a"===v?function(t,r){return e.dxydi([],t,s,r,l)}:function(t,r){return e.dxydj([],s,t,l,r)});var M=b(_[0]),E=b(_[1]),C=M<E?1:-1,P=1e-8*(E-M),L=C>0?Math.floor:Math.ceil,I=C>0?Math.ceil:Math.floor,z=C>0?Math.min:Math.max,O=C>0?Math.max:Math.min,R=L(M+P),D=I(E-P),j=[[h=A(M)]];for(a=R;a*C<D*C;a+=C)c=[],m=O(M,a),y=(g=z(E,a+C))-m,u=Math.max(0,Math.min(k-2,Math.floor(.5*(m+g)))),p=A(g),x&&(d=o(u,m-u),f=o(u,g-u),c.push([h[0]+d[0]/3*y,h[1]+d[1]/3*y]),c.push([p[0]-f[0]/3*y,p[1]-f[1]/3*y])),c.push(p),j.push(c),h=p;return j}}}),Yw=p({"src/traces/contourcarpet/plot.js"(e,t){var r=v(),n=gw(),i=yw(),a=Jt(),o=st(),s=ys(),l=vs(),c=ks(),u=gs(),h=_s(),p=bs(),d=ws(),f=Bw(),m=Xw();function g(e,t,r){var n=e.getPointAtLength(t),i=e.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function y(e){var t=Math.sqrt(e[0]*e[0]+e[1]*e[1]);return[e[0]/t,e[1]/t]}function x(e,t){var r=Math.abs(e[0]*t[0]+e[1]*t[1]);return Math.sqrt(1-r*r)/r}t.exports=function(e,t,v,b){var _=t.xaxis,w=t.yaxis;o.makeTraceGroups(b,v,"contour").each((function(v){var b=r.select(this),k=v[0],T=k.trace,S=T._carpetTrace=f(e,T),A=e.calcdata[S.index][0];if(S.visible&&"legendonly"!==S.visible){var M=k.a,E=k.b,C=T.contours,P=p(C,t,k),L="constraint"===C.type,I=C._operation,z=L?"="===I?"lines":"fill":C.coloring,O=[[M[0],E[E.length-1]],[M[M.length-1],E[E.length-1]],[M[M.length-1],E[0]],[M[0],E[0]]];s(P);var R=1e-8*(M[M.length-1]-M[0]),D=1e-8*(E[E.length-1]-E[0]);l(P,R,D);var j,F,B,N,U=P;"constraint"===C.type&&(U=h(P,I)),function(e,t){var r,n,i,a,o,s,l,c,u;for(r=0;r<e.length;r++){for(o=(a=e[r]).pedgepaths=[],s=a.ppaths=[],n=0;n<a.edgepaths.length;n++){for(u=a.edgepaths[n],l=[],i=0;i<u.length;i++)l[i]=t(u[i]);o.push(l)}for(n=0;n<a.paths.length;n++){for(u=a.paths[n],c=[],i=0;i<u.length;i++)c[i]=t(u[i]);s.push(c)}}}(P,H);var V=[];for(N=A.clipsegments.length-1;N>=0;N--)j=A.clipsegments[N],F=n([],j.x,_.c2p),B=n([],j.y,w.c2p),F.reverse(),B.reverse(),V.push(i(F,B,j.bicubic));var q="M"+V.join("L")+"Z";!function(e,t,r,a,s,l){var c,u,h,p,d=o.ensureSingle(e,"g","contourbg").selectAll("path").data("fill"!==l||s?[]:[0]);d.enter().append("path"),d.exit().remove();var f=[];for(p=0;p<t.length;p++)c=t[p],u=n([],c.x,r.c2p),h=n([],c.y,a.c2p),f.push(i(u,h,c.bicubic));d.attr("d","M"+f.join("L")+"Z").style("stroke","none")}(b,A.clipsegments,_,w,L,z),function(e,t,n,i,s,l,c,u,h,p,f){var g="fill"===p;g&&d(s,e.contours);var y=o.ensureSingle(t,"g","contourfill").selectAll("path").data(g?s:[]);y.enter().append("path"),y.exit().remove(),y.each((function(e){var t=(e.prefixBoundary?f:"")+function(e,t,r,n,i,s,l,c){var u,h,p,d,f,g,y,v="",x=t.edgepaths.map((function(e,t){return t})),b=!0,_=1e-4*Math.abs(r[0][0]-r[2][0]),w=1e-4*Math.abs(r[0][1]-r[2][1]);function k(e){return Math.abs(e[1]-r[0][1])<w}function T(e){return Math.abs(e[1]-r[2][1])<w}function S(e){return Math.abs(e[0]-r[0][0])<_}function A(e){return Math.abs(e[0]-r[2][0])<_}function M(e,t){var r,n,a,o,u="";for(k(e)&&!A(e)||T(e)&&!S(e)?(o=i.aaxis,a=m(i,s,[e[0],t[0]],.5*(e[1]+t[1]))):(o=i.baxis,a=m(i,s,.5*(e[0]+t[0]),[e[1],t[1]])),r=1;r<a.length;r++)for(u+=o.smoothing?"C":"L",n=0;n<a[r].length;n++){var h=a[r][n];u+=[l.c2p(h[0]),c.c2p(h[1])]+" "}return u}for(u=0,h=null;x.length;){var E=t.edgepaths[u][0];for(h&&(v+=M(h,E)),y=a.smoothopen(t.edgepaths[u].map(n),t.smoothing),v+=b?y:y.replace(/^M/,"L"),x.splice(x.indexOf(u),1),h=t.edgepaths[u][t.edgepaths[u].length-1],f=-1,d=0;d<4;d++){if(!h){o.log("Missing end?",u,t);break}for(k(h)&&!A(h)?p=r[1]:S(h)?p=r[0]:T(h)?p=r[3]:A(h)&&(p=r[2]),g=0;g<t.edgepaths.length;g++){var C=t.edgepaths[g][0];Math.abs(h[0]-p[0])<_?Math.abs(h[0]-C[0])<_&&(C[1]-h[1])*(p[1]-C[1])>=0&&(p=C,f=g):Math.abs(h[1]-p[1])<w?Math.abs(h[1]-C[1])<w&&(C[0]-h[0])*(p[0]-C[0])>=0&&(p=C,f=g):o.log("endpt to newendpt is not vert. or horz.",h,p,C)}if(f>=0)break;v+=M(h,p),h=p}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}u=f,(b=-1===x.indexOf(u))&&(u=x[0],v+=M(h,p)+"Z",h=null)}for(u=0;u<t.paths.length;u++)v+=a.smoothclosed(t.paths[u].map(n),t.smoothing);return v}(0,e,l,c,u,h,n,i);t?r.select(this).attr("d",t).style("stroke","none"):r.select(this).remove()}))}(T,b,_,w,U,O,H,S,A,z,q),function(e,t,n,i,s,l,h){var p=n._context.staticPlot,d=o.ensureSingle(e,"g","contourlines"),f=!1!==s.showlines,m=s.showlabels,v=f&&m,b=c.createLines(d,f||m,t,p),_=c.createLineClip(d,v,n,i.trace.uid),w=e.selectAll("g.contourlabels").data(m?[0]:[]);if(w.exit().remove(),w.enter().append("g").classed("contourlabels",!0),m){var k=l.xaxis,T=l.yaxis,S=k._length,A=T._length,M=[[[0,0],[S,0],[S,A],[0,A]]],E=[];o.clearLocationCache();var C=c.labelFormatter(n,i),P=a.tester.append("text").attr("data-notex",1).call(a.font,s.labelfont),L={left:0,right:S,center:S/2,top:0,bottom:A,middle:A/2},I=Math.sqrt(S*S+A*A),z=u.LABELDISTANCE*I/Math.max(1,t.length/u.LABELINCREASE);b.each((function(e){var t=c.calcTextOpts(e.level,C,P,n);r.select(this).selectAll("path").each((function(r){var n=this,i=o.getVisibleSegment(n,L,t.height/2);if(i&&(function(e,t,r,n,i,a){for(var o,s=0;s<r.pedgepaths.length;s++)t===r.pedgepaths[s]&&(o=r.edgepaths[s]);if(o){var l=i.a[0],c=i.a[i.a.length-1],u=i.b[0],h=i.b[i.b.length-1],p=g(e,0,1),d=g(e,n.total,n.total-1),f=v(o[0],p),m=n.total-v(o[o.length-1],d);n.min<f&&(n.min=f),n.max>m&&(n.max=m),n.len=n.max-n.min}function v(e,t){var r,n=0,o=.1;return(Math.abs(e[0]-l)<o||Math.abs(e[0]-c)<o)&&(r=y(i.dxydb_rough(e[0],e[1],o)),n=Math.max(n,a*x(t,r)/2)),(Math.abs(e[1]-u)<o||Math.abs(e[1]-h)<o)&&(r=y(i.dxyda_rough(e[0],e[1],o)),n=Math.max(n,a*x(t,r)/2)),n}}(n,r,e,i,h,t.height),!(i.len<(t.width+t.height)*u.LABELMIN)))for(var a=Math.min(Math.ceil(i.len/z),u.LABELMAX),s=0;s<a;s++){var l=c.findBestTextLocation(n,i,t,E,L);if(!l)break;c.addLabelData(l,t,E,M)}}))})),P.remove(),c.drawLabels(w,E,n,_,v?M:null)}m&&!f&&b.remove()}(b,P,e,k,C,t,S),a.setClipUrl(b,S._clipPathId,e)}function H(e){var t=S.ab2xy(e[0],e[1],!0);return[_.c2p(t[0]),w.c2p(t[1])]}}))}}}),Kw=p({"src/traces/contourcarpet/index.js"(e,t){t.exports={attributes:Ww(),supplyDefaults:$w(),colorbar:As(),calc:Zw(),plot:Yw(),style:Ss(),moduleType:"trace",name:"contourcarpet",basePlotModule:Ai(),categories:["cartesian","svg","carpet","contour","symbols","showLegend","hasLines","carpetDependent","noHover","noSortingByValue"],meta:{}}}}),Jw=p({"lib/contourcarpet.js"(e,t){t.exports=Kw()}}),Qw=p({"src/traces/ohlc/attributes.js"(e,t){var r=st().extendFlat,n=wn(),i=Et().axisHoverFormat,a=Ie().dash,o=B(),s=Tl(),l=s.INCREASING.COLOR,c=s.DECREASING.COLOR,u=n.line;function h(e){return{line:{color:r({},u.color,{dflt:e}),width:u.width,dash:a,editType:"style"},editType:"style"}}t.exports={xperiod:n.xperiod,xperiod0:n.xperiod0,xperiodalignment:n.xperiodalignment,xhoverformat:i("x"),yhoverformat:i("y"),x:{valType:"data_array",editType:"calc+clearAxisTypes"},open:{valType:"data_array",editType:"calc"},high:{valType:"data_array",editType:"calc"},low:{valType:"data_array",editType:"calc"},close:{valType:"data_array",editType:"calc"},line:{width:r({},u.width,{}),dash:r({},a,{}),editType:"style"},increasing:h(l),decreasing:h(c),text:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"calc"},tickwidth:{valType:"number",min:0,max:.5,dflt:.3,editType:"calc"},hoverlabel:r({},o.hoverlabel,{split:{valType:"boolean",dflt:!1,editType:"style"}}),zorder:n.zorder}}}),ek=p({"src/traces/ohlc/ohlc_defaults.js"(e,t){var r=Ve(),n=st();t.exports=function(e,t,i,a){var o=i("x"),s=i("open"),l=i("high"),c=i("low"),u=i("close");if(i("hoverlabel.split"),r.getComponentMethod("calendars","handleTraceDefaults")(e,t,["x"],a),s&&l&&c&&u){var h=Math.min(s.length,l.length,c.length,u.length);return o&&(h=Math.min(h,n.minRowLength(o))),t._length=h,h}}}}),tk=p({"src/traces/ohlc/defaults.js"(e,t){var r=st(),n=ek(),i=Hn(),a=Qw();function o(e,t,r,n){r(n+".line.color"),r(n+".line.width",t.line.width),r(n+".line.dash",t.line.dash)}t.exports=function(e,t,s,l){function c(n,i){return r.coerce(e,t,a,n,i)}n(e,t,c,l)?(i(e,t,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),c("line.dash"),o(0,t,c,"increasing"),o(0,t,c,"decreasing"),c("text"),c("hovertext"),c("tickwidth"),l._requestRangeslider[t.xaxis]=!0,c("zorder")):t.visible=!1}}}),rk=p({"src/traces/ohlc/calc.js"(e,t){var r=st(),n=r._,i=nr(),a=ti(),o=T().BADNUM;function s(e,t,r,n){return{o:e,h:t,l:r,c:n}}function l(e,t,a,s,l,c){for(var u=l.makeCalcdata(t,"open"),h=l.makeCalcdata(t,"high"),p=l.makeCalcdata(t,"low"),d=l.makeCalcdata(t,"close"),f=r.isArrayOrTypedArray(t.text),m=r.isArrayOrTypedArray(t.hovertext),g=!0,y=null,v=!!t.xperiodalignment,x=[],b=0;b<s.length;b++){var _=s[b],w=u[b],k=h[b],T=p[b],S=d[b];if(_!==o&&w!==o&&k!==o&&T!==o&&S!==o){S===w?null!==y&&S!==y&&(g=S>y):g=S>w,y=S;var A=c(w,k,T,S);A.pos=_,A.yc=(w+S)/2,A.i=b,A.dir=g?"increasing":"decreasing",A.x=A.pos,A.y=[T,k],v&&(A.orig_p=a[b]),f&&(A.tx=t.text[b]),m&&(A.htx=t.hovertext[b]),x.push(A)}else x.push({pos:_,empty:!0})}return t._extremes[l._id]=i.findExtremes(l,r.concat(p,h),{padded:!0}),x.length&&(x[0].t={labels:{open:n(e,"open:")+" ",high:n(e,"high:")+" ",low:n(e,"low:")+" ",close:n(e,"close:")+" "}}),x}t.exports={calc:function(e,t){var n=i.getFromId(e,t.xaxis),o=i.getFromId(e,t.yaxis),c=function(e,t,n){var i=n._minDiff;if(!i){var o,s=e._fullData,l=[];for(i=1/0,o=0;o<s.length;o++){var c=s[o];if("ohlc"===c.type&&!0===c.visible&&c.xaxis===t._id){l.push(c);var u=t.makeCalcdata(c,"x");c._origX=u;var h=a(n,t,"x",u).vals;c._xcalc=h;var p=r.distinctVals(h).minDiff;p&&isFinite(p)&&(i=Math.min(i,p))}}for(i===1/0&&(i=1),o=0;o<l.length;o++)l[o]._minDiff=i}return i*n.tickwidth}(e,n,t),u=t._minDiff;t._minDiff=null;var h=t._origX;t._origX=null;var p=t._xcalc;t._xcalc=null;var d=l(e,t,h,p,o,s);return t._extremes[n._id]=i.findExtremes(n,p,{vpad:u/2}),d.length?(r.extendFlat(d[0].t,{wHover:u/2,tickLen:c}),d):[{t:{empty:!0}}]},calcCommon:l}}}),nk=p({"src/traces/ohlc/plot.js"(e,t){var r=v(),n=st();t.exports=function(e,t,i,a){var o=t.yaxis,s=t.xaxis,l=!!s.rangebreaks;n.makeTraceGroups(a,i,"trace ohlc").each((function(e){var t=r.select(this),i=e[0],a=i.t;if(!0!==i.trace.visible||a.empty)t.remove();else{var c=a.tickLen,u=t.selectAll("path").data(n.identity);u.enter().append("path"),u.exit().remove(),u.attr("d",(function(e){if(e.empty)return"M0,0Z";var t=s.c2p(e.pos-c,!0),r=s.c2p(e.pos+c,!0),n=l?(t+r)/2:s.c2p(e.pos,!0);return"M"+t+","+o.c2p(e.o,!0)+"H"+n+"M"+n+","+o.c2p(e.h,!0)+"V"+o.c2p(e.l,!0)+"M"+r+","+o.c2p(e.c,!0)+"H"+n}))}}))}}}),ik=p({"src/traces/ohlc/style.js"(e,t){var r=v(),n=Jt(),i=q();t.exports=function(e,t,a){var o=a||r.select(e).selectAll("g.ohlclayer").selectAll("g.trace");o.style("opacity",(function(e){return e[0].trace.opacity})),o.each((function(e){var t=e[0].trace;r.select(this).selectAll("path").each((function(e){if(!e.empty){var a=t[e.dir].line;r.select(this).style("fill","none").call(i.stroke,a.color).call(n.dashLine,a.dash,a.width).style("opacity",t.selectedpoints&&!e.selected?.3:1)}}))}))}}}),ak=p({"src/traces/ohlc/hover.js"(e,t){var r=nr(),n=st(),i=zr(),a=q(),o=st().fillText,s=Tl(),l={increasing:s.INCREASING.SYMBOL,decreasing:s.DECREASING.SYMBOL};function c(e,t,r,n){var o,s,l=e.cd,c=e.xa,u=l[0].trace,h=l[0].t,p=u.type,d="ohlc"===p?"l":"min",f="ohlc"===p?"h":"max",m=h.bPos||0,g=h.bdPos||h.tickLen,y=h.wHover,v=Math.min(1,g/Math.abs(c.r2c(c.range[1])-c.r2c(c.range[0])));function x(e){var r=function(e){return e.pos+m-t}(e);return i.inbox(r-y,r+y,o)}function b(e){var t=e[d],n=e[f];return t===n||i.inbox(t-r,n-r,o)}function _(e){return(x(e)+b(e))/2}o=e.maxHoverDistance-v,s=e.maxSpikeDistance-v;var w=i.getDistanceFunction(n,x,b,_);if(i.getClosest(l,w,e),!1===e.index)return null;var k=l[e.index];if(k.empty)return null;var T=u[k.dir],S=T.line.color;return a.opacity(S)&&T.line.width?e.color=S:e.color=T.fillcolor,e.x0=c.c2p(k.pos+m-g,!0),e.x1=c.c2p(k.pos+m+g,!0),e.xLabelVal=void 0!==k.orig_p?k.orig_p:k.pos,e.spikeDistance=_(k)*s/o,e.xSpike=c.c2p(k.pos,!0),e}function u(e,t,i,a){var o=e.cd,s=e.ya,l=o[0].trace,u=o[0].t,h=[],p=c(e,t,i,a);if(!p)return[];var d=o[p.index].hi||l.hoverinfo,f=d.split("+");if("all"!==d&&-1===f.indexOf("y"))return[];for(var m=["high","open","close","low"],g={},y=0;y<m.length;y++){var v,x=m[y],b=l[x][p.index],_=s.c2p(b,!0);b in g?(v=g[b]).yLabel+="<br>"+u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat):((v=n.extendFlat({},p)).y0=v.y1=_,v.yLabelVal=b,v.yLabel=u.labels[x]+r.hoverLabelText(s,b,l.yhoverformat),v.name="",h.push(v),g[b]=v)}return h}function h(e,t,n,i){var a=e.cd,s=e.ya,u=a[0].trace,h=a[0].t,p=c(e,t,n,i);if(!p)return[];var d=a[p.index],f=p.index=d.i,m=d.dir;function g(e){return h.labels[e]+r.hoverLabelText(s,u[e][f],u.yhoverformat)}var y=d.hi||u.hoverinfo,v=y.split("+"),x="all"===y,b=x||-1!==v.indexOf("y"),_=x||-1!==v.indexOf("text"),w=b?[g("open"),g("high"),g("low"),g("close")+" "+l[m]]:[];return _&&o(d,u,w),p.extraText=w.join("<br>"),p.y0=p.y1=s.c2p(d.yc,!0),[p]}t.exports={hoverPoints:function(e,t,r,n){return e.cd[0].trace.hoverlabel.split?u(e,t,r,n):h(e,t,r,n)},hoverSplit:u,hoverOnPoints:h}}}),ok=p({"src/traces/ohlc/select.js"(e,t){t.exports=function(e,t){var r,n=e.cd,i=e.xaxis,a=e.yaxis,o=[],s=n[0].t.bPos||0;if(!1===t)for(r=0;r<n.length;r++)n[r].selected=0;else for(r=0;r<n.length;r++){var l=n[r];t.contains([i.c2p(l.pos+s),a.c2p(l.yc)],null,l.i,e)?(o.push({pointNumber:l.i,x:i.c2d(l.pos),y:a.c2d(l.yc)}),l.selected=1):l.selected=0}return o}}}),sk=p({"src/traces/ohlc/index.js"(e,t){t.exports={moduleType:"trace",name:"ohlc",basePlotModule:Ai(),categories:["cartesian","svg","showLegend"],meta:{},attributes:Qw(),supplyDefaults:tk(),calc:rk().calc,plot:nk(),style:ik(),hoverPoints:ak().hoverPoints,selectPoints:ok()}}}),lk=p({"lib/ohlc.js"(e,t){t.exports=sk()}}),ck=p({"src/traces/candlestick/attributes.js"(e,t){var r=st().extendFlat,n=Et().axisHoverFormat,i=Qw(),a=oo();function o(e){return{line:{color:r({},a.line.color,{dflt:e}),width:a.line.width,editType:"style"},fillcolor:a.fillcolor,editType:"style"}}t.exports={xperiod:i.xperiod,xperiod0:i.xperiod0,xperiodalignment:i.xperiodalignment,xhoverformat:n("x"),yhoverformat:n("y"),x:i.x,open:i.open,high:i.high,low:i.low,close:i.close,line:{width:r({},a.line.width,{}),editType:"style"},increasing:o(i.increasing.line.color.dflt),decreasing:o(i.decreasing.line.color.dflt),text:i.text,hovertext:i.hovertext,whiskerwidth:r({},a.whiskerwidth,{dflt:0}),hoverlabel:i.hoverlabel,zorder:a.zorder}}}),uk=p({"src/traces/candlestick/defaults.js"(e,t){var r=st(),n=q(),i=ek(),a=Hn(),o=ck();function s(e,t,r,i){var a=r(i+".line.color");r(i+".line.width",t.line.width),r(i+".fillcolor",n.addOpacity(a,.5))}t.exports=function(e,t,n,l){function c(n,i){return r.coerce(e,t,o,n,i)}i(e,t,c,l)?(a(e,t,l,c,{x:!0}),c("xhoverformat"),c("yhoverformat"),c("line.width"),s(0,t,c,"increasing"),s(0,t,c,"decreasing"),c("text"),c("hovertext"),c("whiskerwidth"),l._requestRangeslider[t.xaxis]=!0,c("zorder")):t.visible=!1}}}),hk=p({"src/traces/candlestick/calc.js"(e,t){var r=st(),n=nr(),i=ti(),a=rk().calcCommon;function o(e,t,r,n){return{min:r,q1:Math.min(e,n),med:n,q3:Math.max(e,n),max:t}}t.exports=function(e,t){var s=e._fullLayout,l=n.getFromId(e,t.xaxis),c=n.getFromId(e,t.yaxis),u=l.makeCalcdata(t,"x"),h=i(t,l,"x",u).vals,p=a(e,t,u,h,c,o);return p.length?(r.extendFlat(p[0].t,{num:s._numBoxes,dPos:r.distinctVals(h).minDiff/2,posLetter:"x",valLetter:"y"}),s._numBoxes++,p):[{t:{empty:!0}}]}}}),pk=p({"src/traces/candlestick/index.js"(e,t){t.exports={moduleType:"trace",name:"candlestick",basePlotModule:Ai(),categories:["cartesian","svg","showLegend","candlestick","boxLayout"],meta:{},attributes:ck(),layoutAttributes:so(),supplyLayoutDefaults:co().supplyLayoutDefaults,crossTraceCalc:ho().crossTraceCalc,supplyDefaults:uk(),calc:hk(),plot:po().plot,layerName:"boxlayer",style:fo().style,hoverPoints:ak().hoverPoints,selectPoints:ok()}}}),dk=p({"lib/candlestick.js"(e,t){t.exports=pk()}}),fk=p({"src/plots/polar/set_convert.js"(e,t){var r=st(),n=er(),i=r.deg2rad,a=r.rad2deg;t.exports=function(e,t,o){switch(n(e,o),e._id){case"x":case"radialaxis":!function(e,t){var r=t._subplot;e.setGeometry=function(){var t=e._rl[0],n=e._rl[1],i=r.innerRadius,a=(r.radius-i)/(n-t),o=i/a,s=t>n?function(e){return e<=0}:function(e){return e>=0};e.c2g=function(r){var n=e.c2l(r)-t;return(s(n)?n:0)+o},e.g2c=function(r){return e.l2c(r+t-o)},e.g2p=function(e){return e*a},e.c2p=function(t){return e.g2p(e.c2g(t))}}}(e,t);break;case"angularaxis":!function(e,t){var n=e.type;if("linear"===n){var o=e.d2c,s=e.c2d;e.d2c=function(e,t){return function(e,t){return"degrees"===t?i(e):e}(o(e),t)},e.c2d=function(e,t){return s(function(e,t){return"degrees"===t?a(e):e}(e,t))}}e.makeCalcdata=function(t,r){var n,i,a=t[r],o=t._length,s=function(r){return e.d2c(r,t.thetaunit)};if(a)for(n=new Array(o),i=0;i<o;i++)n[i]=s(a[i]);else{var l=r+"0",c="d"+r,u=l in t?s(t[l]):0,h=t[c]?s(t[c]):(e.period||2*Math.PI)/o;for(n=new Array(o),i=0;i<o;i++)n[i]=u+i*h}return n},e.setGeometry=function(){var o,s,l,c,u=t.sector,h=u.map(i),p={clockwise:-1,counterclockwise:1}[e.direction],d=i(e.rotation),f=function(e){return p*e+d},m=function(e){return(e-d)/p};switch(n){case"linear":s=o=r.identity,c=i,l=a,e.range=r.isFullCircle(h)?[u[0],u[0]+360]:h.map(m).map(a);break;case"category":var g=e._categories.length,y=e.period?Math.max(e.period,g):g;0===y&&(y=1),s=c=function(e){return 2*e*Math.PI/y},o=l=function(e){return e*y/Math.PI/2},e.range=[0,y]}e.c2g=function(e){return f(s(e))},e.g2c=function(e){return o(m(e))},e.t2g=function(e){return f(c(e))},e.g2t=function(e){return l(m(e))}}}(e,t)}}}}),mk=p({"src/plots/polar/constants.js"(e,t){t.exports={attr:"subplot",name:"polar",axisNames:["angularaxis","radialaxis"],axisName2dataArray:{angularaxis:"theta",radialaxis:"r"},layerNames:["draglayer","plotbg","backplot","angular-grid","radial-grid","frontplot","angular-line","radial-line","angular-axis","radial-axis"],radialDragBoxSize:50,angularDragBoxSize:30,cornerLen:25,cornerHalfWidth:2,MINDRAG:8,MINZOOM:20,OFFEDGE:20}}}),gk=p({"src/plots/polar/helpers.js"(e,t){var r=st(),n=fn().tester,i=r.findIndexOfMin,a=r.isAngleInsideSector,o=r.angleDelta,s=r.angleDist;function l(e,t,r,n){var i,a,o=n[0],s=n[1],l=u(Math.sin(t)-Math.sin(e)),c=u(Math.cos(t)-Math.cos(e)),h=Math.tan(r),p=u(1/h),d=l/c,f=s-d*o;return p?l&&c?a=h*(i=f/(h-d)):c?(i=s*p,a=s):(i=o,a=o*h):l&&c?(i=0,a=f):c?(i=0,a=s):i=a=NaN,[i,a]}function c(e,t,n,o){return r.isFullCircle([t,n])?function(e,t){var r,n=t.length,i=new Array(n+1);for(r=0;r<n;r++){var a=t[r];i[r]=[e*Math.cos(a),e*Math.sin(a)]}return i[r]=i[0].slice(),i}(e,o):function(e,t,n,o){var c,u,h=o.length,p=[];function d(t){return[e*Math.cos(t),e*Math.sin(t)]}function f(e,t,r){return l(e,t,r,d(e))}function m(e){return r.mod(e,h)}function g(e){return a(e,[t,n])}var y=i(o,(function(e){return g(e)?s(e,t):1/0})),v=f(o[y],o[m(y-1)],t);for(p.push(v),c=y,u=0;u<h;c++,u++){var x=o[m(c)];if(!g(x))break;p.push(d(x))}var b=i(o,(function(e){return g(e)?s(e,n):1/0})),_=f(o[b],o[m(b+1)],n);return p.push(_),p.push([0,0]),p.push(p[0].slice()),p}(e,t,n,o)}function u(e){return Math.abs(e)>1e-10?e:0}function h(e,t,r){t=t||0,r=r||0;for(var n=e.length,i=new Array(n),a=0;a<n;a++){var o=e[a];i[a]=[t+o[0],r-o[1]]}return i}t.exports={isPtInsidePolygon:function(e,t,r,i,o){if(!a(t,i))return!1;var s,l;r[0]<r[1]?(s=r[0],l=r[1]):(s=r[1],l=r[0]);var u=n(c(s,i[0],i[1],o)),h=n(c(l,i[0],i[1],o)),p=[e*Math.cos(t),e*Math.sin(t)];return h.contains(p)&&!u.contains(p)},findPolygonOffset:function(e,t,r,n){for(var i=1/0,a=1/0,o=c(e,t,r,n),s=0;s<o.length;s++){var l=o[s];i=Math.min(i,l[0]),a=Math.min(a,-l[1])}return[i,a]},findEnclosingVertexAngles:function(e,t){var n=i(t,(function(t){var r=o(t,e);return r>0?r:1/0})),a=r.mod(n+1,t.length);return[t[n],t[a]]},findIntersectionXY:l,findXYatLength:function(e,t,r,n){var i=-t*r,a=t*t+1,o=2*(t*i-r),s=i*i+r*r-e*e,l=Math.sqrt(o*o-4*a*s),c=(-o+l)/(2*a),u=(-o-l)/(2*a);return[[c,t*c+i+n],[u,t*u+i+n]]},clampTiny:u,pathPolygon:function(e,t,r,n,i,a){return"M"+h(c(e,t,r,n),i,a).join("L")},pathPolygonAnnulus:function(e,t,r,n,i,a,o){var s,l;e<t?(s=e,l=t):(s=t,l=e);var u=h(c(s,r,n,i),a,o);return"M"+h(c(l,r,n,i),a,o).reverse().join("L")+"M"+u.join("L")}}}}),yk=p({"src/plots/smith/helpers.js"(e,t){function r(e){return e<0?-1:e>0?1:0}function n(e){var t=e[0],r=e[1];if(!isFinite(t)||!isFinite(r))return[1,0];var n=(t+1)*(t+1)+r*r;return[(t*t+r*r-1)/n,2*r/n]}function i(e,t){var r=t[0],n=t[1];return[r*e.radius+e.cx,-n*e.radius+e.cy]}function a(e,t){return t*e.radius}t.exports={smith:n,reactanceArc:function(e,t,r,o){var s=i(e,n([r,t])),l=s[0],c=s[1],u=i(e,n([o,t])),h=u[0],p=u[1];if(0===t)return["M"+l+","+c,"L"+h+","+p].join(" ");var d=a(e,1/Math.abs(t));return["M"+l+","+c,"A"+d+","+d+" 0 0,"+(t<0?1:0)+" "+h+","+p].join(" ")},resistanceArc:function(e,t,o,s){var l=a(e,1/(t+1)),c=i(e,n([t,o])),u=c[0],h=c[1],p=i(e,n([t,s])),d=p[0],f=p[1];if(r(o)!==r(s)){var m=i(e,n([t,0]));return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(0<o?0:1)+" "+m[0]+","+m[1],"A"+l+","+l+" 0 0,"+(s<0?0:1)+d+","+f].join(" ")}return["M"+u+","+h,"A"+l+","+l+" 0 0,"+(s<o?0:1)+" "+d+","+f].join(" ")},smithTransform:i}}}),vk=p({"src/plots/polar/polar.js"(e,t){var r=v(),n=O(),i=Ve(),a=st(),o=a.strRotate,s=a.strTranslate,l=q(),c=Jt(),u=kt(),h=nr(),p=er(),d=fk(),f=rr().doAutoRange,m=En(),g=hr(),y=zr(),x=Qt(),b=Mn().prepSelect,_=Mn().selectOnClick,w=Mn().clearOutline,k=pr(),T=Rr(),S=rn().redrawReglTraces,A=St().MID_SHIFT,M=mk(),E=gk(),C=yk(),P=C.smith,L=C.reactanceArc,I=C.resistanceArc,z=C.smithTransform,R=a._,D=a.mod,j=a.deg2rad,F=a.rad2deg;function B(e,t,r){this.isSmith=r||!1,this.id=t,this.gd=e,this._hasClipOnAxisFalse=null,this.vangles=null,this.radialAxisAngle=null,this.traceHash={},this.layers={},this.clipPaths={},this.clipIds={},this.viewInitial={};var n=e._fullLayout,i="clip"+n._uid+t;this.clipIds.forTraces=i+"-for-traces",this.clipPaths.forTraces=n._clips.append("clipPath").attr("id",this.clipIds.forTraces),this.clipPaths.forTraces.append("path"),this.framework=n["_"+(r?"smith":"polar")+"layer"].append("g").attr("class",t),this.getHole=function(e){return this.isSmith?0:e.hole},this.getSector=function(e){return this.isSmith?[0,360]:e.sector},this.getRadial=function(e){return this.isSmith?e.realaxis:e.radialaxis},this.getAngular=function(e){return this.isSmith?e.imaginaryaxis:e.angularaxis},r||(this.radialTickLayout=null,this.angularTickLayout=null)}var N=B.prototype;function U(e){var t=e.ticks+String(e.ticklen)+String(e.showticklabels);return"side"in e&&(t+=e.side),t}function V(e,t){return t[a.findIndexOfMin(t,(function(t){return a.angleDist(e,t)}))]}function H(e,t,r){return t?(e.attr("display",null),e.attr(r)):e&&e.attr("display","none"),e}t.exports=function(e,t,r){return new B(e,t,r)},N.plot=function(e,t){for(var r=this,n=t[r.id],i=!1,a=0;a<e.length;a++)if(!1===e[a][0].trace.cliponaxis){i=!0;break}r._hasClipOnAxisFalse=i,r.updateLayers(t,n),r.updateLayout(t,n),u.generalUpdatePerTraceModule(r.gd,r,e,n),r.updateFx(t,n),r.isSmith&&(delete n.realaxis.range,delete n.imaginaryaxis.range)},N.updateLayers=function(e,t){var n=this,i=n.isSmith,a=n.layers,o=n.getRadial(t),s=n.getAngular(t),l=M.layerNames,c=l.indexOf("frontplot"),u=l.slice(0,c),h="below traces"===s.layer,p="below traces"===o.layer;h&&u.push("angular-line"),p&&u.push("radial-line"),h&&u.push("angular-axis"),p&&u.push("radial-axis"),u.push("frontplot"),h||u.push("angular-line"),p||u.push("radial-line"),h||u.push("angular-axis"),p||u.push("radial-axis");var d=(i?"smith":"polar")+"sublayer",f=n.framework.selectAll("."+d).data(u,String);f.enter().append("g").attr("class",(function(e){return d+" "+e})).each((function(e){var t=a[e]=r.select(this);switch(e){case"frontplot":i||t.append("g").classed("barlayer",!0),t.append("g").classed("scatterlayer",!0);break;case"backplot":t.append("g").classed("maplayer",!0);break;case"plotbg":a.bg=t.append("path");break;case"radial-grid":case"angular-grid":t.style("fill","none");break;case"radial-line":t.append("line").style("fill","none");break;case"angular-line":t.append("path").style("fill","none")}})),f.order()},N.updateLayout=function(e,t){var r=this,n=r.layers,i=e._size,a=r.getRadial(t),o=r.getAngular(t),u=t.domain.x,h=t.domain.y;r.xOffset=i.l+i.w*u[0],r.yOffset=i.t+i.h*(1-h[1]);var p=r.xLength=i.w*(u[1]-u[0]),d=r.yLength=i.h*(h[1]-h[0]),f=r.getSector(t);r.sectorInRad=f.map(j);var m,g,y,v,x,b=r.sectorBBox=function(e){var t,r,n,i,a=e[0],o=e[1],s=o-a,l=D(a,360),c=l+s,u=Math.cos(j(l)),h=Math.sin(j(l)),p=Math.cos(j(c)),d=Math.sin(j(c));return i=l<=90&&c>=90||l>90&&c>=450?1:h<=0&&d<=0?0:Math.max(h,d),t=l<=180&&c>=180||l>180&&c>=540?-1:u>=0&&p>=0?0:Math.min(u,p),r=l<=270&&c>=270||l>270&&c>=630?-1:h>=0&&d>=0?0:Math.min(h,d),n=c>=360?1:u<=0&&p<=0?0:Math.max(u,p),[t,r,n,i]}(f),_=b[2]-b[0],w=b[3]-b[1],k=d/p,T=Math.abs(w/_);k>T?(m=p,x=(d-(g=p*T))/i.h/2,y=[u[0],u[1]],v=[h[0]+x,h[1]-x]):(g=d,x=(p-(m=d/T))/i.w/2,y=[u[0]+x,u[1]-x],v=[h[0],h[1]]),r.xLength2=m,r.yLength2=g,r.xDomain2=y,r.yDomain2=v;var S,A=r.xOffset2=i.l+i.w*y[0],M=r.yOffset2=i.t+i.h*(1-v[1]),E=r.radius=m/_,C=r.innerRadius=r.getHole(t)*E,P=r.cx=A-E*b[0],L=r.cy=M+E*b[3],I=r.cxx=P-A,z=r.cyy=L-M,O=a.side;"counterclockwise"===O?(S=O,O="top"):"clockwise"===O&&(S=O,O="bottom"),r.radialAxis=r.mockAxis(e,t,a,{_id:"x",side:O,_trueSide:S,domain:[C/i.w,E/i.w]}),r.angularAxis=r.mockAxis(e,t,o,{side:"right",domain:[0,Math.PI],autorange:!1}),r.doAutoRange(e,t),r.updateAngularAxis(e,t),r.updateRadialAxis(e,t),r.updateRadialAxisTitle(e,t),r.xaxis=r.mockCartesianAxis(e,t,{_id:"x",domain:y}),r.yaxis=r.mockCartesianAxis(e,t,{_id:"y",domain:v});var R=r.pathSubplot();r.clipPaths.forTraces.select("path").attr("d",R).attr("transform",s(I,z)),n.frontplot.attr("transform",s(A,M)).call(c.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.forTraces,r.gd),n.bg.attr("d",R).attr("transform",s(P,L)).call(l.fill,t.bgcolor)},N.mockAxis=function(e,t,r,n){var i=a.extendFlat({},r,n);return d(i,t,e),i},N.mockCartesianAxis=function(e,t,r){var n=this,i=n.isSmith,o=r._id,s=a.extendFlat({type:"linear"},r);p(s,e);var l={x:[0,2],y:[1,3]};return s.setRange=function(){var e=n.sectorBBox,r=l[o],i=n.radialAxis._rl,a=(i[1]-i[0])/(1-n.getHole(t));s.range=[e[r[0]]*a,e[r[1]]*a]},s.isPtWithinRange="x"!==o||i?function(){return!0}:function(e){return n.isPtInside(e)},s.setRange(),s.setScale(),s},N.doAutoRange=function(e,t){var r=this,n=r.gd,i=r.radialAxis,a=r.getRadial(t);f(n,i);var o=i.range;if(a.range=o.slice(),a._input.range=o.slice(),i._rl=[i.r2l(o[0],null,"gregorian"),i.r2l(o[1],null,"gregorian")],void 0!==i.minallowed){var s=i.r2l(i.minallowed);i._rl[0]>i._rl[1]?i._rl[1]=Math.max(i._rl[1],s):i._rl[0]=Math.max(i._rl[0],s)}if(void 0!==i.maxallowed){var l=i.r2l(i.maxallowed);i._rl[0]<i._rl[1]?i._rl[1]=Math.min(i._rl[1],l):i._rl[0]=Math.min(i._rl[0],l)}},N.updateRadialAxis=function(e,t){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,p=r.cx,d=r.cy,f=r.getRadial(t),m=D(r.getSector(t)[0],360),g=r.radialAxis,y=u<c,v=r.isSmith;v||(r.fillViewInitialKey("radialaxis.angle",f.angle),r.fillViewInitialKey("radialaxis.range",g.range.slice()),g.setGeometry()),"auto"===g.tickangle&&m>90&&m<=270&&(g.tickangle=180);var x=v?function(e){var t=z(r,P([e.x,0]));return s(t[0]-p,t[1]-d)}:function(e){return s(g.l2p(e.x)+u,0)},b=v?function(e){return I(r,e.x,-1/0,1/0)}:function(e){return r.pathArc(g.r2p(e.x)+u)},_=U(f);if(r.radialTickLayout!==_&&(i["radial-axis"].selectAll(".xtick").remove(),r.radialTickLayout=_),y){g.setScale();var w=0,k=v?(g.tickvals||[]).filter((function(e){return e>=0})).map((function(e){return h.tickText(g,e,!0,!1)})):h.calcTicks(g),T=v?k:h.clipEnds(g,k),S=h.getTickSigns(g)[2];v&&(("top"===g.ticks&&"bottom"===g.side||"bottom"===g.ticks&&"top"===g.side)&&(S=-S),"top"===g.ticks&&"top"===g.side&&(w=-g.ticklen),"bottom"===g.ticks&&"bottom"===g.side&&(w=g.ticklen)),h.drawTicks(n,g,{vals:k,layer:i["radial-axis"],path:h.makeTickPath(g,0,S),transFn:x,crisp:!1}),h.drawGrid(n,g,{vals:T,layer:i["radial-grid"],path:b,transFn:a.noop,crisp:!1}),h.drawLabels(n,g,{vals:k,layer:i["radial-axis"],transFn:x,labelFns:h.makeLabelFns(g,w)})}var A=r.radialAxisAngle=r.vangles?F(V(j(f.angle),r.vangles)):f.angle,M=s(p,d),E=M+o(-A);H(i["radial-axis"],y&&(f.showticklabels||f.ticks),{transform:E}),H(i["radial-grid"],y&&f.showgrid,{transform:v?"":M}),H(i["radial-line"].select("line"),y&&f.showline,{x1:v?-c:u,y1:0,x2:c,y2:0,transform:E}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateRadialAxisTitle=function(e,t,r){if(!this.isSmith){var n=this,i=n.gd,a=n.radius,o=n.cx,s=n.cy,l=n.getRadial(t),u=n.id+"title",h=0;if(l.title){var p=c.bBox(n.layers["radial-axis"].node()).height,d=l.title.font.size,f=l.side;h="top"===f?d:"counterclockwise"===f?-(p+.4*d):p+.8*d}var m=void 0!==r?r:n.radialAxisAngle,g=j(m),y=Math.cos(g),v=Math.sin(g),b=o+a/2*y+h*v,_=s-a/2*v+h*y;n.layers["radial-axis-title"]=x.draw(i,u,{propContainer:l,propName:n.id+".radialaxis.title",placeholder:R(i,"Click to enter radial axis title"),attributes:{x:b,y:_,"text-anchor":"middle"},transform:{rotate:-m}})}},N.updateAngularAxis=function(e,t){var r=this,n=r.gd,i=r.layers,c=r.radius,u=r.innerRadius,p=r.cx,d=r.cy,f=r.getAngular(t),m=r.angularAxis,g=r.isSmith;g||(r.fillViewInitialKey("angularaxis.rotation",f.rotation),m.setGeometry(),m.setScale());var y=g?function(e){var t=z(r,P([0,e.x]));return Math.atan2(t[0]-p,t[1]-d)-Math.PI/2}:function(e){return m.t2g(e.x)};"linear"===m.type&&"radians"===m.thetaunit&&(m.tick0=F(m.tick0),m.dtick=F(m.dtick));var v=function(e){return s(p+c*Math.cos(e),d-c*Math.sin(e))},x=g?function(e){var t=z(r,P([0,e.x]));return s(t[0],t[1])}:function(e){return v(y(e))},b=g?function(e){var t=z(r,P([0,e.x])),n=Math.atan2(t[0]-p,t[1]-d)-Math.PI/2;return s(t[0],t[1])+o(-F(n))}:function(e){var t=y(e);return v(t)+o(-F(t))},_=g?function(e){return L(r,e.x,0,1/0)}:function(e){var t=y(e),r=Math.cos(t),n=Math.sin(t);return"M"+[p+u*r,d-u*n]+"L"+[p+c*r,d-c*n]},w=h.makeLabelFns(m,0).labelStandoff,k={xFn:function(e){var t=y(e);return Math.cos(t)*w},yFn:function(e){var t=y(e),r=Math.sin(t)>0?.2:1;return-Math.sin(t)*(w+e.fontSize*r)+Math.abs(Math.cos(t))*(e.fontSize*A)},anchorFn:function(e){var t=y(e),r=Math.cos(t);return Math.abs(r)<.1?"middle":r>0?"start":"end"},heightFn:function(e,t,r){var n=y(e);return-.5*(1+Math.sin(n))*r}},T=U(f);r.angularTickLayout!==T&&(i["angular-axis"].selectAll("."+m._id+"tick").remove(),r.angularTickLayout=T);var S,M=g?[1/0].concat(m.tickvals||[]).map((function(e){return h.tickText(m,e,!0,!1)})):h.calcTicks(m);if(g&&(M[0].text="\u221e",M[0].fontSize*=1.75),"linear"===t.gridshape?(S=M.map(y),a.angleDelta(S[0],S[1])<0&&(S=S.slice().reverse())):S=null,r.vangles=S,"category"===m.type&&(M=M.filter((function(e){return a.isAngleInsideSector(y(e),r.sectorInRad)}))),m.visible){var E="inside"===m.ticks?-1:1,C=(m.linewidth||1)/2;h.drawTicks(n,m,{vals:M,layer:i["angular-axis"],path:"M"+E*C+",0h"+E*m.ticklen,transFn:b,crisp:!1}),h.drawGrid(n,m,{vals:M,layer:i["angular-grid"],path:_,transFn:a.noop,crisp:!1}),h.drawLabels(n,m,{vals:M,layer:i["angular-axis"],repositionOnUpdate:!0,transFn:x,labelFns:k})}H(i["angular-line"].select("path"),f.showline,{d:r.pathSubplot(),transform:s(p,d)}).attr("stroke-width",f.linewidth).call(l.stroke,f.linecolor)},N.updateFx=function(e,t){this.gd._context.staticPlot||(!this.isSmith&&(this.updateAngularDrag(e),this.updateRadialDrag(e,t,0),this.updateRadialDrag(e,t,1)),this.updateHoverAndMainDrag(e))},N.updateHoverAndMainDrag=function(e){var t,o,l=this,c=l.isSmith,u=l.gd,h=l.layers,p=e._zoomlayer,d=M.MINZOOM,f=M.OFFEDGE,v=l.radius,x=l.innerRadius,k=l.cx,T=l.cy,S=l.cxx,A=l.cyy,C=l.sectorInRad,P=l.vangles,L=l.radialAxis,I=E.clampTiny,z=E.findXYatLength,O=E.findEnclosingVertexAngles,R=M.cornerHalfWidth,D=M.cornerLen/2,j=m.makeDragger(h,"path","maindrag",!1===e.dragmode?"none":"crosshair");r.select(j).attr("d",l.pathSubplot()).attr("transform",s(k,T)),j.onmousemove=function(e){y.hover(u,e,l.id),u._fullLayout._lasthover=j,u._fullLayout._hoversubplot=l.id},j.onmouseout=function(e){u._dragging||g.unhover(u,e)};var F,B,N,U,V,q,H,G,W,$={element:j,gd:u,subplot:l.id,plotinfo:{id:l.id,xaxis:l.xaxis,yaxis:l.yaxis},xaxes:[l.xaxis],yaxes:[l.yaxis]};function Z(e,t){return Math.sqrt(e*e+t*t)}function X(e,t){return Z(e-S,t-A)}function Y(e,t){return Math.atan2(A-t,e-S)}function K(e,t){return[e*Math.cos(t),e*Math.sin(-t)]}function J(e,t){if(0===e)return l.pathSector(2*R);var r=D/e,n=t-r,i=t+r,a=Math.max(0,Math.min(e,v)),o=a-R,s=a+R;return"M"+K(o,n)+"A"+[o,o]+" 0,0,0 "+K(o,i)+"L"+K(s,i)+"A"+[s,s]+" 0,0,1 "+K(s,n)+"Z"}function Q(e,t,r){if(0===e)return l.pathSector(2*R);var n,i,a=K(e,t),o=K(e,r),s=I((a[0]+o[0])/2),c=I((a[1]+o[1])/2);if(s&&c){var u=c/s,h=-1/u,p=z(R,u,s,c);n=z(D,h,p[0][0],p[0][1]),i=z(D,h,p[1][0],p[1][1])}else{var d,f;c?(d=D,f=R):(d=R,f=D),n=[[s-d,c-f],[s+d,c-f]],i=[[s-d,c+f],[s+d,c+f]]}return"M"+n.join("L")+"L"+i.reverse().join("L")+"Z"}function ee(e,t){return t=Math.max(Math.min(t,v),x),e<f?e=0:v-e<f?e=v:t<f?t=0:v-t<f&&(t=v),Math.abs(t-e)>d?(e<t?(N=e,U=t):(N=t,U=e),!0):(N=null,U=null,!1)}function te(e,t){e=e||V,t=t||"M0,0Z",G.attr("d",e),W.attr("d",t),m.transitionZoombox(G,W,q,H),q=!0;var r={};oe(r),u.emit("plotly_relayouting",r)}function re(e,r){var n,i,a=F+(e*=t),s=B+(r*=o),c=X(F,B),u=Math.min(X(a,s),v),h=Y(F,B);ee(c,u)&&(n=V+l.pathSector(U),N&&(n+=l.pathSector(N)),i=J(N,h)+J(U,h)),te(n,i)}function ne(e,t,r,n){var i=E.findIntersectionXY(r,n,r,[e-S,A-t]);return Z(i[0],i[1])}function ie(e,t){var r,n,i=F+e,a=B+t,o=Y(F,B),s=Y(i,a),c=O(o,P),u=O(s,P);ee(ne(F,B,c[0],c[1]),Math.min(ne(i,a,u[0],u[1]),v))&&(r=V+l.pathSector(U),N&&(r+=l.pathSector(N)),n=[Q(N,c[0],c[1]),Q(U,c[0],c[1])].join(" ")),te(r,n)}function ae(){if(m.removeZoombox(u),null!==N&&null!==U){var e={};oe(e),m.showDoubleClickNotifier(u),i.call("_guiRelayout",u,e)}}function oe(e){var t=L._rl,r=(t[1]-t[0])/(1-x/v)/v,n=[t[0]+(N-x)*r,t[0]+(U-x)*r];e[l.id+".radialaxis.range"]=n}function se(e,t){var r=u._fullLayout.clickmode;if(m.removeZoombox(u),2===e){var n={};for(var a in l.viewInitial)n[l.id+"."+a]=l.viewInitial[a];u.emit("plotly_doubleclick",null),i.call("_guiRelayout",u,n)}r.indexOf("select")>-1&&1===e&&_(t,u,[l.xaxis],[l.yaxis],l.id,$),r.indexOf("event")>-1&&y.click(u,t,l.id)}$.prepFn=function(e,r,i){var s=u._fullLayout.dragmode,h=j.getBoundingClientRect();u._fullLayout._calcInverseTransform(u);var d=u._fullLayout._invTransform;t=u._fullLayout._invScaleX,o=u._fullLayout._invScaleY;var f=a.apply3DTransform(d)(r-h.left,i-h.top);if(F=f[0],B=f[1],P){var g=E.findPolygonOffset(v,C[0],C[1],P);F+=S+g[0],B+=A+g[1]}switch(s){case"zoom":$.clickFn=se,c||($.moveFn=P?ie:re,$.doneFn=ae,function(){N=null,U=null,V=l.pathSubplot(),q=!1;var e=u._fullLayout[l.id];H=n(e.bgcolor).getLuminance(),(G=m.makeZoombox(p,H,k,T,V)).attr("fill-rule","evenodd"),W=m.makeCorners(p,k,T),w(u)}());break;case"select":case"lasso":b(e,r,i,$,s)}},g.init($)},N.updateRadialDrag=function(e,t,n){var l=this,c=l.gd,u=l.layers,h=l.radius,p=l.innerRadius,d=l.cx,f=l.cy,y=l.radialAxis,v=M.radialDragBoxSize,x=v/2;if(y.visible){var b,_,k,A=j(l.radialAxisAngle),E=y._rl,C=E[0],P=E[1],L=E[n],I=.75*(E[1]-E[0])/(1-l.getHole(t))/h;n?(b=d+(h+x)*Math.cos(A),_=f-(h+x)*Math.sin(A),k="radialdrag"):(b=d+(p-x)*Math.cos(A),_=f-(p-x)*Math.sin(A),k="radialdrag-inner");var z,O,R,D=m.makeRectDragger(u,k,"crosshair",-x,-x,v,v),B={element:D,gd:c};!1===e.dragmode&&(B.dragmode=!1),H(r.select(D),y.visible&&p<h,{transform:s(b,_)}),B.prepFn=function(){z=null,O=null,R=null,B.moveFn=N,B.doneFn=U,w(c)},B.clampFn=function(e,t){return Math.sqrt(e*e+t*t)<M.MINDRAG&&(e=0,t=0),[e,t]},g.init(B)}function N(e,t){if(z)z(e,t);else{var r=[e,-t],i=[Math.cos(A),Math.sin(A)],o=Math.abs(a.dot(r,i)/Math.sqrt(a.dot(r,r)));isNaN(o)||(z=o<.5?q:G)}var s={};!function(e){null!==O?e[l.id+".radialaxis.angle"]=O:null!==R&&(e[l.id+".radialaxis.range["+n+"]"]=R)}(s),c.emit("plotly_relayouting",s)}function U(){null!==O?i.call("_guiRelayout",c,l.id+".radialaxis.angle",O):null!==R&&i.call("_guiRelayout",c,l.id+".radialaxis.range["+n+"]",R)}function q(e,t){if(0!==n){var r=b+e,i=_+t;O=Math.atan2(f-i,r-d),l.vangles&&(O=V(O,l.vangles)),O=F(O);var a=s(d,f)+o(-O);u["radial-axis"].attr("transform",a),u["radial-line"].select("line").attr("transform",a);var c=l.gd._fullLayout,h=c[l.id];l.updateRadialAxisTitle(c,h,O)}}function G(e,t){var r=a.dot([e,-t],[Math.cos(A),Math.sin(A)]);if(R=L-I*r,I>0===(n?R>C:R<P)){var o=c._fullLayout,s=o[l.id];y.range[n]=R,y._rl[n]=R,l.updateRadialAxis(o,s),l.xaxis.setRange(),l.xaxis.setScale(),l.yaxis.setRange(),l.yaxis.setScale();var u=!1;for(var h in l.traceHash){var p=l.traceHash[h],d=a.filterVisible(p);p[0][0].trace._module.plot(c,l,d,s),i.traceIs(h,"gl")&&d.length&&(u=!0)}u&&(T(c),S(c))}else R=null}},N.updateAngularDrag=function(e){var t=this,n=t.gd,l=t.layers,u=t.radius,h=t.angularAxis,p=t.cx,d=t.cy,f=t.cxx,y=t.cyy,v=M.angularDragBoxSize,x=m.makeDragger(l,"path","angulardrag",!1===e.dragmode?"none":"move"),b={element:x,gd:n};function _(e,t){return Math.atan2(y+v-t,e-f-v)}!1===e.dragmode?b.dragmode=!1:r.select(x).attr("d",t.pathAnnulus(u,u+v)).attr("transform",s(p,d)).call(k,"move");var A,E,C,P,L,I,z=l.frontplot.select(".scatterlayer").selectAll(".trace"),O=z.selectAll(".point"),R=z.selectAll(".textpoint");function D(u,m){var g=t.gd._fullLayout,v=g[t.id],x=_(A+u*e._invScaleX,E+m*e._invScaleY),b=F(x-I);if(P=C+b,l.frontplot.attr("transform",s(t.xOffset2,t.yOffset2)+o([-b,f,y])),t.vangles){L=t.radialAxisAngle+b;var w=s(p,d)+o(-b),k=s(p,d)+o(-L);l.bg.attr("transform",w),l["radial-grid"].attr("transform",w),l["radial-axis"].attr("transform",k),l["radial-line"].select("line").attr("transform",k),t.updateRadialAxisTitle(g,v,L)}else t.clipPaths.forTraces.select("path").attr("transform",s(f,y)+o(b));O.each((function(){var e=r.select(this),t=c.getTranslate(e);e.attr("transform",s(t.x,t.y)+o([b]))})),R.each((function(){var e=r.select(this),t=e.select("text"),n=c.getTranslate(e);e.attr("transform",o([b,t.attr("x"),t.attr("y")])+s(n.x,n.y))})),h.rotation=a.modHalf(P,360),t.updateAngularAxis(g,v),t._hasClipOnAxisFalse&&!a.isFullCircle(t.sectorInRad)&&z.call(c.hideOutsideRangePoints,t);var M=!1;for(var D in t.traceHash)if(i.traceIs(D,"gl")){var B=t.traceHash[D],N=a.filterVisible(B);B[0][0].trace._module.plot(n,t,N,v),N.length&&(M=!0)}M&&(T(n),S(n));var U={};j(U),n.emit("plotly_relayouting",U)}function j(e){e[t.id+".angularaxis.rotation"]=P,t.vangles&&(e[t.id+".radialaxis.angle"]=L)}function B(){R.select("text").attr("transform",null);var e={};j(e),i.call("_guiRelayout",n,e)}b.prepFn=function(r,i,o){var s=e[t.id];C=s.angularaxis.rotation;var l=x.getBoundingClientRect();A=i-l.left,E=o-l.top,n._fullLayout._calcInverseTransform(n);var c=a.apply3DTransform(e._invTransform)(A,E);A=c[0],E=c[1],I=_(A,E),b.moveFn=D,b.doneFn=B,w(n)},t.vangles&&!a.isFullCircle(t.sectorInRad)&&(b.prepFn=a.noop,k(r.select(x),null)),g.init(b)},N.isPtInside=function(e){if(this.isSmith)return!0;var t=this.sectorInRad,r=this.vangles,n=this.angularAxis.c2g(e.theta),i=this.radialAxis,o=i.c2l(e.r),s=i._rl;return(r?E.isPtInsidePolygon:a.isPtInsideSector)(o,n,s,t,r)},N.pathArc=function(e){var t=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathArc)(e,t[0],t[1],r)},N.pathSector=function(e){var t=this.sectorInRad,r=this.vangles;return(r?E.pathPolygon:a.pathSector)(e,t[0],t[1],r)},N.pathAnnulus=function(e,t){var r=this.sectorInRad,n=this.vangles;return(n?E.pathPolygonAnnulus:a.pathAnnulus)(e,t,r[0],r[1],n)},N.pathSubplot=function(){var e=this.innerRadius,t=this.radius;return e?this.pathAnnulus(e,t):this.pathSector(t)},N.fillViewInitialKey=function(e,t){e in this.viewInitial||(this.viewInitial[e]=t)}}}),xk=p({"src/plots/polar/layout_attributes.js"(e,t){var r=V(),n=Ct(),i=ka().attributes,a=st().extendFlat,o=Le().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({tickmode:n.minor.tickmode,nticks:n.nticks,tick0:n.tick0,dtick:n.dtick,tickvals:n.tickvals,ticktext:n.ticktext,ticks:n.ticks,ticklen:n.ticklen,tickwidth:n.tickwidth,tickcolor:n.tickcolor,ticklabelstep:n.ticklabelstep,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,showexponent:n.showexponent,exponentformat:n.exponentformat,minexponent:n.minexponent,separatethousands:n.separatethousands,tickfont:n.tickfont,tickangle:n.tickangle,tickformat:n.tickformat,tickformatstops:n.tickformatstops,layer:n.layer},"plot","from-root"),c={visible:a({},n.visible,{dflt:!0}),type:a({},n.type,{values:["-","linear","log","date","category"]}),autotypenumbers:n.autotypenumbers,autorangeoptions:{minallowed:n.autorangeoptions.minallowed,maxallowed:n.autorangeoptions.maxallowed,clipmin:n.autorangeoptions.clipmin,clipmax:n.autorangeoptions.clipmax,include:n.autorangeoptions.include,editType:"plot"},autorange:a({},n.autorange,{editType:"plot"}),rangemode:{valType:"enumerated",values:["tozero","nonnegative","normal"],dflt:"tozero",editType:"calc"},minallowed:a({},n.minallowed,{editType:"plot"}),maxallowed:a({},n.maxallowed,{editType:"plot"}),range:a({},n.range,{items:[{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}},{valType:"any",editType:"plot",impliedEdits:{"^autorange":!1}}],editType:"plot"}),categoryorder:n.categoryorder,categoryarray:n.categoryarray,angle:{valType:"angle",editType:"plot"},autotickangles:n.autotickangles,side:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"clockwise",editType:"plot"},title:{text:a({},n.title.text,{editType:"plot",dflt:""}),font:a({},n.title.font,{editType:"plot"}),editType:"plot"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(c,s,l);var u={visible:a({},n.visible,{dflt:!0}),type:{valType:"enumerated",values:["-","linear","category"],dflt:"-",editType:"calc",_noTemplating:!0},autotypenumbers:n.autotypenumbers,categoryorder:n.categoryorder,categoryarray:n.categoryarray,thetaunit:{valType:"enumerated",values:["radians","degrees"],dflt:"degrees",editType:"calc"},period:{valType:"number",editType:"calc",min:0},direction:{valType:"enumerated",values:["counterclockwise","clockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"angle",editType:"calc"},hoverformat:n.hoverformat,uirevision:{valType:"any",editType:"none"},editType:"calc"};a(u,s,l),t.exports={domain:i({name:"polar",editType:"plot"}),sector:{valType:"info_array",items:[{valType:"number",editType:"plot"},{valType:"number",editType:"plot"}],dflt:[0,360],editType:"plot"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"plot"},bgcolor:{valType:"color",editType:"plot",dflt:r.background},radialaxis:c,angularaxis:u,gridshape:{valType:"enumerated",values:["circular","linear"],dflt:"circular",editType:"plot"},uirevision:{valType:"any",editType:"none"},editType:"calc"}}}),bk=p({"src/plots/polar/layout_defaults.js"(e,t){var r=st(),n=q(),i=gt(),a=qs(),o=_t().getSubplotData,s=Rt(),l=Dt(),c=Bt(),u=Nt(),h=bi(),p=_i(),d=ir(),f=tr(),m=xk(),g=fk(),y=mk(),v=y.axisNames;function x(e,t,a,f){var x=a("bgcolor");f.bgColor=n.combine(x,f.paper_bgcolor);var _=a("sector");a("hole");var w,k=o(f.fullData,y.name,f.id),T=f.layoutOut;function S(e,t){return a(w+"."+e,t)}for(var A=0;A<v.length;A++){w=v[A],r.isPlainObject(e[w])||(e[w]={});var M=e[w],E=i.newContainer(t,w);E._id=E._name=w,E._attr=f.id+"."+w,E._traceIndices=k.map((function(e){return e.index}));var C=y.axisName2dataArray[w],P=b(M,E,S,k,C,f);h(M,E,S,{axData:k,dataAttr:C});var L=S("visible");switch(g(E,t,T),S("uirevision",t.uirevision),E._m=1,w){case"radialaxis":S("minallowed"),S("maxallowed");var I,z=S("range"),O=E.getAutorangeDflt(z),R=S("autorange",O);!z||(null!==z[0]||null!==z[1])&&(null!==z[0]&&null!==z[1]||"reversed"!==R&&!0!==R)&&(null===z[0]||"min"!==R&&"max reversed"!==R)&&(null===z[1]||"max"!==R&&"min reversed"!==R)||(z=void 0,delete E.range,E.autorange=!0,I=!0),I||(R=S("autorange",O=E.getAutorangeDflt(z))),M.autorange=R,R&&(d(S,R,z),"linear"!==P&&"-"!==P||S("rangemode"),E.isReversed()&&(E._m=-1)),E.cleanRange("range",{dfltRange:[0,1]});break;case"angularaxis":if("date"===P){r.log("Polar plots do not support date angular axes yet.");for(var D=0;D<k.length;D++)k[D].visible=!1;P=M.type=E.type="linear"}S("linear"===P?"thetaunit":"period");var j=S("direction");S("rotation",{counterclockwise:0,clockwise:90}[j])}if(u(M,E,S,E.type,{tickSuffixDflt:"degrees"===E.thetaunit?"\xb0":void 0}),L){var F,B,N,U,V,q,H,G,W,$,Z=f.font||{};B=(F=S("color"))===M.color?F:Z.color,N=Z.size,U=Z.family,V=Z.weight,q=Z.style,H=Z.variant,G=Z.textcase,W=Z.lineposition,$=Z.shadow,s(M,E,S,E.type),c(M,E,S,E.type,{font:{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:$,color:B,size:N,family:U},noAutotickangles:"angularaxis"===w,noTicklabelshift:!0,noTicklabelstandoff:!0}),l(M,E,S,{outerTicks:!0}),p(M,E,S,{dfltColor:F,bgColor:f.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:m[w]}),S("layer"),"radialaxis"===w&&(S("side"),S("angle",_[0]),S("title.text"),r.coerceFont(S,"title.font",{weight:V,style:q,variant:H,textcase:G,lineposition:W,shadow:$,color:B,size:r.bigFont(N),family:U}))}"category"!==P&&S("hoverformat"),E._input=M}"category"===t.angularaxis.type&&a("gridshape")}function b(e,t,r,n,i,a){var o=r("autotypenumbers",a.autotypenumbersDflt);if("-"===r("type")){for(var s,l=0;l<n.length;l++)if(n[l].visible){s=n[l];break}s&&s[i]&&(t.type=f(s[i],"gregorian",{noMultiCategory:!0,autotypenumbers:o})),"-"===t.type?t.type="linear":e.type=t.type}return t.type}t.exports=function(e,t,r){a(e,t,r,{type:y.name,attributes:m,handleDefaults:x,font:t.font,autotypenumbersDflt:t.autotypenumbers,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}}}),_k=p({"src/plots/polar/index.js"(e,t){var r=_t().getSubplotCalcData,n=st().counterRegex,i=vk(),a=mk(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},t.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:xk(),supplyLayoutDefaults:bk(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=t[l]._subplot;u||(u=i(e,l),t[l]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var i=n._subplots[s]||[],a=n._has&&n._has("gl"),o=t._has&&t._has("gl"),l=a&&!o,c=0;c<i.length;c++){var u=i[c],h=n[u]._subplot;if(!t[u]&&h)for(var p in h.framework.remove(),h.layers["radial-axis-title"].remove(),h.clipPaths)h.clipPaths[p].remove();l&&h._scene&&(h._scene.destroy(),h._scene=null)}},toSVG:Ai().toSVG}}}),wk=p({"src/traces/scatterpolar/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=R().extendFlat,a=_n(),o=wn(),s=N(),l=o.line;t.exports={mode:o.mode,r:{valType:"data_array",editType:"calc+clearAxisTypes"},theta:{valType:"data_array",editType:"calc+clearAxisTypes"},r0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dr:{valType:"number",dflt:1,editType:"calc"},theta0:{valType:"any",dflt:0,editType:"calc+clearAxisTypes"},dtheta:{valType:"number",editType:"calc"},thetaunit:{valType:"enumerated",values:["radians","degrees","gradians"],dflt:"degrees",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["r","theta","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["r","theta","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}}),kk=p({"src/traces/scatterpolar/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Zn(),s=Xn(),l=Yn(),c=bn().PTS_LINESONLY,u=wk();function h(e,t,n,i){var a,o=i("r"),s=i("theta");if(r.isTypedArray(o)&&(t.r=o=Array.from(o)),r.isTypedArray(s)&&(t.theta=s=Array.from(s)),o)s?a=Math.min(o.length,s.length):(a=o.length,i("theta0"),i("dtheta"));else{if(!s)return 0;a=t.theta.length,i("r0"),i("dr")}return t._length=a,a}t.exports={handleRThetaDefaults:h,supplyDefaults:function(e,t,p,d){function f(n,i){return r.coerce(e,t,u,n,i)}var m=h(0,t,0,f);if(m){f("thetaunit"),f("mode",m<c?"lines+markers":"lines"),f("text"),f("hovertext"),"fills"!==t.hoveron&&f("hovertemplate"),n.hasMarkers(t)&&i(e,t,p,d,f,{gradient:!0}),n.hasLines(t)&&(a(e,t,p,d,f,{backoff:!0}),o(e,t,f),f("connectgaps")),n.hasText(t)&&(f("texttemplate"),s(e,t,d,f));var g=[];(n.hasMarkers(t)||n.hasText(t))&&(f("cliponaxis"),f("marker.maxdisplayed"),g.push("points")),f("fill"),"none"!==t.fill&&(l(e,t,p,f),n.hasLines(t)||o(e,t,f)),"tonext"!==t.fill&&"toself"!==t.fill||g.push("fills"),f("hoveron",g.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,f)}else t.visible=!1}}}}),Tk=p({"src/traces/scatterpolar/format_labels.js"(e,t){var r=st(),n=nr();t.exports=function(e,t,i){var a,o,s={},l=i[t.subplot]._subplot;l?(a=l.radialAxis,o=l.angularAxis):(a=(l=i[t.subplot]).radialaxis,o=l.angularaxis);var c=a.c2l(e.r);s.rLabel=n.tickText(a,c,!0).text;var u="degrees"===o.thetaunit?r.rad2deg(e.theta):e.theta;return s.thetaLabel=n.tickText(o,u,!0).text,s}}}),Sk=p({"src/traces/scatterpolar/calc.js"(e,t){var r=k(),n=T().BADNUM,i=nr(),a=ri(),o=ni(),s=ii(),l=ai().calcMarkerSize;t.exports=function(e,t){for(var c=e._fullLayout,u=t.subplot,h=c[u].radialaxis,p=c[u].angularaxis,d=h.makeCalcdata(t,"r"),f=p.makeCalcdata(t,"theta"),m=t._length,g=new Array(m),y=0;y<m;y++){var v=d[y],x=f[y],b=g[y]={};r(v)&&r(x)?(b.r=v,b.theta=x):b.r=n}var _=l(t,m);return t._extremes.x=i.findExtremes(h,d,{ppad:_}),a(e,t),o(g,t),s(g,t),g}}}),Ak=p({"src/traces/scatterpolar/plot.js"(e,t){var r=hi(),n=T().BADNUM;t.exports=function(e,t,i){for(var a=t.layers.frontplot.select("g.scatterlayer"),o=t.xaxis,s=t.yaxis,l={xaxis:o,yaxis:s,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},c=t.radialAxis,u=t.angularAxis,h=0;h<i.length;h++)for(var p=i[h],d=0;d<p.length;d++){0===d&&(p[0].trace._xA=o,p[0].trace._yA=s);var f=p[d],m=f.r;if(m===n)f.x=f.y=n;else{var g=c.c2g(m),y=u.c2g(f.theta);f.x=g*Math.cos(y),f.y=g*Math.sin(y)}}r(e,l,i,a)}}}),Mk=p({"src/traces/scatterpolar/hover.js"(e,t){var r=gi();function n(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="r",a._hovertitle="\u03b8";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.rLabel=s.rLabel,n.thetaLabel=s.thetaLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["r","theta","text"]),-1!==h.indexOf("r")&&u(i,n.rLabel),-1!==h.indexOf("theta")&&u(a,n.thetaLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),Ek=p({"src/traces/scatterpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:_k(),categories:["polar","symbols","showLegend","scatter-like"],attributes:wk(),supplyDefaults:kk().supplyDefaults,colorbar:pi(),formatLabels:Tk(),calc:Sk(),plot:Ak(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:Mk().hoverPoints,selectPoints:yi(),meta:{}}}}),Ck=p({"lib/scatterpolar.js"(e,t){t.exports=Ek()}}),Pk=p({"src/traces/scatterpolargl/attributes.js"(e,t){var r=wk(),n=Og(),i=Oe().texttemplateAttrs;t.exports={mode:r.mode,r:r.r,theta:r.theta,r0:r.r0,dr:r.dr,theta0:r.theta0,dtheta:r.dtheta,thetaunit:r.thetaunit,text:r.text,texttemplate:i({editType:"plot"},{keys:["r","theta","text"]}),hovertext:r.hovertext,hovertemplate:r.hovertemplate,line:{color:n.line.color,width:n.line.width,dash:n.line.dash,editType:"calc"},connectgaps:n.connectgaps,marker:n.marker,fill:n.fill,fillcolor:n.fillcolor,textposition:n.textposition,textfont:n.textfont,hoverinfo:r.hoverinfo,selected:r.selected,unselected:r.unselected}}}),Lk=p({"src/traces/scatterpolargl/defaults.js"(e,t){var r=st(),n=$t(),i=kk().handleRThetaDefaults,a=Wn(),o=$n(),s=Xn(),l=Yn(),c=bn().PTS_LINESONLY,u=Pk();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}var f=i(e,t,p,d);f?(d("thetaunit"),d("mode",f<c?"lines+markers":"lines"),d("text"),d("hovertext"),"fills"!==t.hoveron&&d("hovertemplate"),n.hasMarkers(t)&&a(e,t,h,p,d,{noAngleRef:!0,noStandOff:!0}),n.hasLines(t)&&(o(e,t,h,p,d),d("connectgaps")),n.hasText(t)&&(d("texttemplate"),s(e,t,p,d,{noFontShadow:!0,noFontLineposition:!0,noFontTextcase:!0})),d("fill"),"none"!==t.fill&&l(e,t,h,d),r.coerceSelectionMarkerOpacity(t,d)):t.visible=!1}}}),Ik=p({"src/traces/scatterpolargl/format_labels.js"(e,t){var r=Tk();t.exports=function(e,t,n){var i=e.i;return"r"in e||(e.r=t._r[i]),"theta"in e||(e.theta=t._theta[i]),r(e,t,n)}}}),zk=p({"src/traces/scatterpolargl/calc.js"(e,t){var r=ri(),n=ai().calcMarkerSize,i=ny(),a=nr(),o=zg().TOO_MANY_POINTS;t.exports=function(e,t){var s=e._fullLayout,l=t.subplot,c=s[l].radialaxis,u=s[l].angularaxis,h=t._r=c.makeCalcdata(t,"r"),p=t._theta=u.makeCalcdata(t,"theta"),d=t._length,f={};d<h.length&&(h=h.slice(0,d)),d<p.length&&(p=p.slice(0,d)),f.r=h,f.theta=p,r(e,t);var m,g=f.opts=i.style(e,t);return d<o?m=n(t,d):g.marker&&(m=2*(g.marker.sizeAvg||Math.max(g.marker.size,3))),t._extremes.x=a.findExtremes(c,h,{ppad:m}),[{x:!1,y:!1,t:f,trace:t}]}}}),Ok=p({"src/traces/scatterpolargl/hover.js"(e,t){var r=Ig(),n=Mk().makeHoverPointText;t.exports={hoverPoints:function(e,t,i,a){var o=e.cd[0].t,s=o.r,l=o.theta,c=r.hoverPoints(e,t,i,a);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var h=e.subplot,p=u.cd[u.index],d=u.trace;if(p.r=s[u.index],p.theta=l[u.index],h.isPtInside(p))return u.xLabelVal=void 0,u.yLabelVal=void 0,n(p,d,h,u),c}}}}}),Rk=p({"src/traces/scatterpolargl/base_index.js"(e,t){t.exports={moduleType:"trace",name:"scatterpolargl",basePlotModule:_k(),categories:["gl","regl","polar","symbols","showLegend","scatter-like"],attributes:Pk(),supplyDefaults:Lk(),colorbar:pi(),formatLabels:Ik(),calc:zk(),hoverPoints:Ok().hoverPoints,selectPoints:sy(),meta:{}}}}),Dk=p({"src/traces/scatterpolargl/plot.js"(e,t){var r=$g(),n=k(),i=hx(),a=iy(),o=ny(),s=st(),l=zg().TOO_MANY_POINTS;t.exports=function(e,t,c){if(c.length){var u=t.radialAxis,h=t.angularAxis,p=a(e,t);return c.forEach((function(i){if(i&&i[0]&&i[0].trace){var a,c=i[0],d=c.trace,f=c.t,m=d._length,g=f.r,y=f.theta,v=f.opts,x=g.slice(),b=y.slice();for(a=0;a<g.length;a++)t.isPtInside({r:g[a],theta:y[a]})||(x[a]=NaN,b[a]=NaN);var _=new Array(2*m),w=Array(m),k=Array(m);for(a=0;a<m;a++){var T,S,A=x[a];if(n(A)){var M=u.c2g(A),E=h.c2g(b[a],d.thetaunit);T=M*Math.cos(E),S=M*Math.sin(E)}else T=S=NaN;w[a]=_[2*a]=T,k[a]=_[2*a+1]=S}f.tree=r(_),v.marker&&m>=l&&(v.marker.cluster=f.tree),v.marker&&(v.markerSel.positions=v.markerUnsel.positions=v.marker.positions=_),v.line&&_.length>1&&s.extendFlat(v.line,o.linePositions(e,d,_)),v.text&&(s.extendFlat(v.text,{positions:_},o.textPosition(e,d,v.text,v.marker)),s.extendFlat(v.textSel,{positions:_},o.textPosition(e,d,v.text,v.markerSel)),s.extendFlat(v.textUnsel,{positions:_},o.textPosition(e,d,v.text,v.markerUnsel))),v.fill&&!p.fill2d&&(p.fill2d=!0),v.marker&&!p.scatter2d&&(p.scatter2d=!0),v.line&&!p.line2d&&(p.line2d=!0),v.text&&!p.glText&&(p.glText=!0),p.lineOptions.push(v.line),p.fillOptions.push(v.fill),p.markerOptions.push(v.marker),p.markerSelectedOptions.push(v.markerSel),p.markerUnselectedOptions.push(v.markerUnsel),p.textOptions.push(v.text),p.textSelectedOptions.push(v.textSel),p.textUnselectedOptions.push(v.textUnsel),p.selectBatch.push([]),p.unselectBatch.push([]),f.x=w,f.y=k,f.rawx=w,f.rawy=k,f.r=g,f.theta=y,f.positions=_,f._scene=p,f.index=p.count,p.count++}})),i(e,t,c)}},t.exports.reglPrecompiled={}}}),jk=p({"src/traces/scatterpolargl/index.js"(e,t){var r=Rk();r.plot=Dk(),t.exports=r}}),Fk=p({"lib/scatterpolargl.js"(e,t){t.exports=jk()}}),Bk=p({"src/traces/barpolar/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=R().extendFlat,i=wk(),a=Ha();t.exports={r:i.r,theta:i.theta,r0:i.r0,dr:i.dr,theta0:i.theta0,dtheta:i.dtheta,thetaunit:i.thetaunit,base:n({},a.base,{}),offset:n({},a.offset,{}),width:n({},a.width,{}),text:n({},a.text,{}),hovertext:n({},a.hovertext,{}),marker:function(){var e=n({},a.marker);return delete e.cornerradius,e}(),hoverinfo:i.hoverinfo,hovertemplate:r(),selected:a.selected,unselected:a.unselected}}}),Nk=p({"src/traces/barpolar/layout_attributes.js"(e,t){t.exports={barmode:{valType:"enumerated",values:["stack","overlay"],dflt:"stack",editType:"calc"},bargap:{valType:"number",dflt:.1,min:0,max:1,editType:"calc"}}}}),Uk=p({"src/traces/barpolar/defaults.js"(e,t){var r=st(),n=kk().handleRThetaDefaults,i=Wa(),a=Bk();t.exports=function(e,t,o,s){function l(n,i){return r.coerce(e,t,a,n,i)}n(e,t,s,l)?(l("thetaunit"),l("base"),l("offset"),l("width"),l("text"),l("hovertext"),l("hovertemplate"),i(e,t,l,o,s),r.coerceSelectionMarkerOpacity(t,l)):t.visible=!1}}}),Vk=p({"src/traces/barpolar/layout_defaults.js"(e,t){var r=st(),n=Nk();t.exports=function(e,t,i){var a,o={};function s(i,o){return r.coerce(e[a]||{},t[a],n,i,o)}for(var l=0;l<i.length;l++){var c=i[l];"barpolar"===c.type&&!0===c.visible&&(o[a=c.subplot]||(s("barmode"),s("bargap"),o[a]=1))}}}}),qk=p({"src/traces/barpolar/calc.js"(e,t){var r=Mt().hasColorscale,n=Gt(),i=st().isArrayOrTypedArray,a=Xa(),o=si().setGroupPositions,s=ii(),l=Ve().traceIs,c=st().extendFlat;t.exports={calc:function(e,t){for(var o=e._fullLayout,l=t.subplot,c=o[l].radialaxis,u=o[l].angularaxis,h=c.makeCalcdata(t,"r"),p=u.makeCalcdata(t,"theta"),d=t._length,f=new Array(d),m=h,g=p,y=0;y<d;y++)f[y]={p:g[y],s:m[y]};function v(e){var r=t[e];void 0!==r&&(t["_"+e]=i(r)?u.makeCalcdata(t,e):u.d2c(r,t.thetaunit))}return"linear"===u.type&&(v("width"),v("offset")),r(t,"marker")&&n(e,t,{vals:t.marker.color,containerStr:"marker",cLetter:"c"}),r(t,"marker.line")&&n(e,t,{vals:t.marker.line.color,containerStr:"marker.line",cLetter:"c"}),a(f,t),s(f,t),f},crossTraceCalc:function(e,t,r){for(var n=e.calcdata,i=[],a=0;a<n.length;a++){var s=n[a],u=s[0].trace;!0===u.visible&&l(u,"bar")&&u.subplot===r&&i.push(s)}var h=c({},t.radialaxis,{_id:"x"}),p=t.angularaxis;o(e,p,h,i,{mode:t.barmode,norm:t.barnorm,gap:t.bargap,groupgap:t.bargroupgap})}}}}),Hk=p({"src/traces/barpolar/plot.js"(e,t){var r=v(),n=k(),i=st(),a=Jt(),o=gk();t.exports=function(e,t,s){var l=e._context.staticPlot,c=t.xaxis,u=t.yaxis,h=t.radialAxis,p=t.angularAxis,d=function(e){var t=e.cxx,r=e.cyy;return e.vangles?function(n,a,s,l){var c,u;i.angleDelta(s,l)>0?(c=s,u=l):(c=l,u=s);var h=[o.findEnclosingVertexAngles(c,e.vangles)[0],(c+u)/2,o.findEnclosingVertexAngles(u,e.vangles)[1]];return o.pathPolygonAnnulus(n,a,c,u,h,t,r)}:function(e,n,a,o){return i.pathAnnulus(e,n,a,o,t,r)}}(t),f=t.layers.frontplot.select("g.barlayer");i.makeTraceGroups(f,s,"trace bars").each((function(){var o=r.select(this),s=i.ensureSingle(o,"g","points").selectAll("g.point").data(i.identity);s.enter().append("g").style("vector-effect",l?"none":"non-scaling-stroke").style("stroke-miterlimit",2).classed("point",!0),s.exit().remove(),s.each((function(e){var t,a=r.select(this),o=e.rp0=h.c2p(e.s0),s=e.rp1=h.c2p(e.s1),l=e.thetag0=p.c2g(e.p0),f=e.thetag1=p.c2g(e.p1);if(n(o)&&n(s)&&n(l)&&n(f)&&o!==s&&l!==f){var m=h.c2g(e.s1),g=(l+f)/2;e.ct=[c.c2p(m*Math.cos(g)),u.c2p(m*Math.sin(g))],t=d(o,s,l,f)}else t="M0,0Z";i.ensureSingle(a,"path").attr("d",t)})),a.setClipUrl(o,t._hasClipOnAxisFalse?t.clipIds.forTraces:null,e)}))}}}),Gk=p({"src/traces/barpolar/hover.js"(e,t){var r=zr(),n=st(),i=to().getTraceColor,a=n.fillText,o=Mk().makeHoverPointText,s=gk().isPtInsidePolygon;t.exports=function(e,t,l){var c=e.cd,u=c[0].trace,h=e.subplot,p=h.radialAxis,d=h.angularAxis,f=h.vangles,m=f?s:n.isPtInsideSector,g=e.maxHoverDistance,y=d._period||2*Math.PI,v=Math.abs(p.g2p(Math.sqrt(t*t+l*l))),x=Math.atan2(l,t);if(p.range[0]>p.range[1]&&(x+=Math.PI),r.getClosest(c,(function(e){return m(v,x,[e.rp0,e.rp1],[e.thetag0,e.thetag1],f)?g+Math.min(1,Math.abs(e.thetag1-e.thetag0)/y)-1+(e.rp1-v)/(e.rp1-e.rp0)-1:1/0}),e),!1!==e.index){var b=c[e.index];e.x0=e.x1=b.ct[0],e.y0=e.y1=b.ct[1];var _=n.extendFlat({},b,{r:b.s,theta:b.p});return a(b,u,e),o(_,u,h,e),e.hovertemplate=u.hovertemplate,e.color=i(u,b),e.xLabelVal=e.yLabelVal=void 0,b.s<0&&(e.idealAlign="left"),[e]}}}}),Wk=p({"src/traces/barpolar/index.js"(e,t){t.exports={moduleType:"trace",name:"barpolar",basePlotModule:_k(),categories:["polar","bar","showLegend"],attributes:Bk(),layoutAttributes:Nk(),supplyDefaults:Uk(),supplyLayoutDefaults:Vk(),calc:qk().calc,crossTraceCalc:qk().crossTraceCalc,plot:Hk(),colorbar:pi(),formatLabels:Tk(),style:Qa().style,styleOnSelect:Qa().styleOnSelect,hoverPoints:Gk(),selectPoints:no(),meta:{}}}}),$k=p({"lib/barpolar.js"(e,t){t.exports=Wk()}}),Zk=p({"src/plots/smith/constants.js"(e,t){t.exports={attr:"subplot",name:"smith",axisNames:["realaxis","imaginaryaxis"],axisName2dataArray:{imaginaryaxis:"imag",realaxis:"real"}}}}),Xk=p({"src/plots/smith/layout_attributes.js"(e,t){var r=V(),n=Ct(),i=ka().attributes,a=st().extendFlat,o=Le().overrideAll,s=o({color:n.color,showline:a({},n.showline,{dflt:!0}),linecolor:n.linecolor,linewidth:n.linewidth,showgrid:a({},n.showgrid,{dflt:!0}),gridcolor:n.gridcolor,gridwidth:n.gridwidth,griddash:n.griddash},"plot","from-root"),l=o({ticklen:n.ticklen,tickwidth:a({},n.tickwidth,{dflt:2}),tickcolor:n.tickcolor,showticklabels:n.showticklabels,labelalias:n.labelalias,showtickprefix:n.showtickprefix,tickprefix:n.tickprefix,showticksuffix:n.showticksuffix,ticksuffix:n.ticksuffix,tickfont:n.tickfont,tickformat:n.tickformat,hoverformat:n.hoverformat,layer:n.layer},"plot","from-root"),c=a({visible:a({},n.visible,{dflt:!0}),tickvals:{dflt:[.2,.5,1,2,5],valType:"data_array",editType:"plot"},tickangle:a({},n.tickangle,{dflt:90}),ticks:{valType:"enumerated",values:["top","bottom",""],editType:"ticks"},side:{valType:"enumerated",values:["top","bottom"],dflt:"top",editType:"plot"},editType:"calc"},s,l),u=a({visible:a({},n.visible,{dflt:!0}),tickvals:{valType:"data_array",editType:"plot"},ticks:n.ticks,editType:"calc"},s,l);t.exports={domain:i({name:"smith",editType:"plot"}),bgcolor:{valType:"color",editType:"plot",dflt:r.background},realaxis:c,imaginaryaxis:u,editType:"calc"}}}),Yk=p({"src/plots/smith/layout_defaults.js"(e,t){var r=st(),n=q(),i=gt(),a=qs(),o=_t().getSubplotData,s=Nt(),l=Bt(),c=_i(),u=er(),h=Xk(),p=Zk(),d=p.axisNames,f=function(e,t){var r={};return function(n){var i=t?t(n):n;if(i in r)return r[i];var a=e(n);return r[i]=a,a}}((function(e){return r.isTypedArray(e)&&(e=Array.from(e)),e.slice().reverse().map((function(e){return-e})).concat([0]).concat(e)}),String);function m(e,t,a,m){var g=a("bgcolor");m.bgColor=n.combine(g,m.paper_bgcolor);var y,v=o(m.fullData,p.name,m.id),x=m.layoutOut;function b(e,t){return a(y+"."+e,t)}for(var _=0;_<d.length;_++){y=d[_],r.isPlainObject(e[y])||(e[y]={});var w=e[y],k=i.newContainer(t,y);k._id=k._name=y,k._attr=m.id+"."+y,k._traceIndices=v.map((function(e){return e.index}));var T=b("visible");if(k.type="linear",u(k,x),s(w,k,b,k.type),T){var S,A,M,E,C="realaxis"===y;C&&b("side"),C?b("tickvals"):b("tickvals",f(t.realaxis.tickvals||h.realaxis.tickvals.dflt)),r.isTypedArray(k.tickvals)&&(k.tickvals=Array.from(k.tickvals));var P=m.font||{};T&&(A=(S=b("color"))===w.color?S:P.color,M=P.size,E=P.family),l(w,k,b,k.type,{noAutotickangles:!0,noTicklabelshift:!0,noTicklabelstandoff:!0,noTicklabelstep:!0,noAng:!C,noExp:!0,font:{color:A,size:M,family:E}}),r.coerce2(e,t,h,y+".ticklen"),r.coerce2(e,t,h,y+".tickwidth"),r.coerce2(e,t,h,y+".tickcolor",t.color),b("ticks")||(delete t[y].ticklen,delete t[y].tickwidth,delete t[y].tickcolor),c(w,k,b,{dfltColor:S,bgColor:m.bgColor,blend:60,showLine:!0,showGrid:!0,noZeroLine:!0,attributes:h[y]}),b("layer")}b("hoverformat"),delete k.type,k._input=w}}t.exports=function(e,t,r){a(e,t,r,{noUirevision:!0,type:p.name,attributes:h,handleDefaults:m,font:t.font,paper_bgcolor:t.paper_bgcolor,fullData:r,layoutOut:t})}}}),Kk=p({"src/plots/smith/index.js"(e,t){var r=_t().getSubplotCalcData,n=st().counterRegex,i=vk(),a=Zk(),o=a.attr,s=a.name,l=n(s),c={};c[o]={valType:"subplotid",dflt:s,editType:"calc"},t.exports={attr:o,name:s,idRoot:s,idRegex:l,attrRegex:l,attributes:c,layoutAttributes:Xk(),supplyLayoutDefaults:Yk(),plot:function(e){for(var t=e._fullLayout,n=e.calcdata,a=t._subplots[s],o=0;o<a.length;o++){var l=a[o],c=r(n,s,l),u=t[l]._subplot;u||(u=i(e,l,!0),t[l]._subplot=u),u.plot(c,t,e._promises)}},clean:function(e,t,r,n){for(var i=n._subplots[s]||[],a=0;a<i.length;a++){var o=i[a],l=n[o]._subplot;if(!t[o]&&l)for(var c in l.framework.remove(),l.clipPaths)l.clipPaths[c].remove()}},toSVG:Ai().toSVG}}}),Jk=p({"src/traces/scattersmith/attributes.js"(e,t){var r=Oe().hovertemplateAttrs,n=Oe().texttemplateAttrs,i=R().extendFlat,a=_n(),o=wn(),s=N(),l=o.line;t.exports={mode:o.mode,real:{valType:"data_array",editType:"calc+clearAxisTypes"},imag:{valType:"data_array",editType:"calc+clearAxisTypes"},text:o.text,texttemplate:n({editType:"plot"},{keys:["real","imag","text"]}),hovertext:o.hovertext,line:{color:l.color,width:l.width,dash:l.dash,backoff:l.backoff,shape:i({},l.shape,{values:["linear","spline"]}),smoothing:l.smoothing,editType:"calc"},connectgaps:o.connectgaps,marker:o.marker,cliponaxis:i({},o.cliponaxis,{dflt:!1}),textposition:o.textposition,textfont:o.textfont,fill:i({},o.fill,{values:["none","toself","tonext"],dflt:"none"}),fillcolor:a(),hoverinfo:i({},s.hoverinfo,{flags:["real","imag","text","name"]}),hoveron:o.hoveron,hovertemplate:r(),selected:o.selected,unselected:o.unselected}}}),Qk=p({"src/traces/scattersmith/defaults.js"(e,t){var r=st(),n=$t(),i=Wn(),a=$n(),o=Zn(),s=Xn(),l=Yn(),c=bn().PTS_LINESONLY,u=Jk();t.exports=function(e,t,h,p){function d(n,i){return r.coerce(e,t,u,n,i)}var f=function(e,t,n,i){var a,o=i("real"),s=i("imag");return o&&s&&(a=Math.min(o.length,s.length)),r.isTypedArray(o)&&(t.real=o=Array.from(o)),r.isTypedArray(s)&&(t.imag=s=Array.from(s)),t._length=a,a}(0,t,0,d);if(f){d("mode",f<c?"lines+markers":"lines"),d("text"),d("hovertext"),"fills"!==t.hoveron&&d("hovertemplate"),n.hasMarkers(t)&&i(e,t,h,p,d,{gradient:!0}),n.hasLines(t)&&(a(e,t,h,p,d,{backoff:!0}),o(e,t,d),d("connectgaps")),n.hasText(t)&&(d("texttemplate"),s(e,t,p,d));var m=[];(n.hasMarkers(t)||n.hasText(t))&&(d("cliponaxis"),d("marker.maxdisplayed"),m.push("points")),d("fill"),"none"!==t.fill&&(l(e,t,h,d),n.hasLines(t)||o(e,t,d)),"tonext"!==t.fill&&"toself"!==t.fill||m.push("fills"),d("hoveron",m.join("+")||"points"),r.coerceSelectionMarkerOpacity(t,d)}else t.visible=!1}}}),eT=p({"src/traces/scattersmith/format_labels.js"(e,t){var r=nr();t.exports=function(e,t,n){var i={},a=n[t.subplot]._subplot;return i.realLabel=r.tickText(a.radialAxis,e.real,!0).text,i.imagLabel=r.tickText(a.angularAxis,e.imag,!0).text,i}}}),tT=p({"src/traces/scattersmith/calc.js"(e,t){var r=k(),n=T().BADNUM,i=ri(),a=ni(),o=ii(),s=ai().calcMarkerSize;t.exports=function(e,t){for(var l=e._fullLayout,c=t.subplot,u=l[c].realaxis,h=l[c].imaginaryaxis,p=u.makeCalcdata(t,"real"),d=h.makeCalcdata(t,"imag"),f=t._length,m=new Array(f),g=0;g<f;g++){var y=p[g],v=d[g],x=m[g]={};r(y)&&r(v)?(x.real=y,x.imag=v):x.real=n}return s(t,f),i(e,t),a(m,t),o(m,t),m}}}),rT=p({"src/traces/scattersmith/plot.js"(e,t){var r=hi(),n=T().BADNUM,i=yk().smith;t.exports=function(e,t,a){for(var o=t.layers.frontplot.select("g.scatterlayer"),s=t.xaxis,l=t.yaxis,c={xaxis:s,yaxis:l,plot:t.framework,layerClipId:t._hasClipOnAxisFalse?t.clipIds.forTraces:null},u=0;u<a.length;u++)for(var h=a[u],p=0;p<h.length;p++){0===p&&(h[0].trace._xA=s,h[0].trace._yA=l);var d=h[p],f=d.real;if(f===n)d.x=d.y=n;else{var m=i([f,d.imag]);d.x=m[0],d.y=m[1]}}r(e,c,a,o)}}}),nT=p({"src/traces/scattersmith/hover.js"(e,t){var r=gi();function n(e,t,r,n){var i=r.radialAxis,a=r.angularAxis;i._hovertitle="real",a._hovertitle="imag";var o={};o[t.subplot]={_subplot:r};var s=t._module.formatLabels(e,t,o);n.realLabel=s.realLabel,n.imagLabel=s.imagLabel;var l=e.hi||t.hoverinfo,c=[];function u(e,t){c.push(e._hovertitle+": "+t)}if(!t.hovertemplate){var h=l.split("+");-1!==h.indexOf("all")&&(h=["real","imag","text"]),-1!==h.indexOf("real")&&u(i,n.realLabel),-1!==h.indexOf("imag")&&u(a,n.imagLabel),-1!==h.indexOf("text")&&n.text&&(c.push(n.text),delete n.text),n.extraText=c.join("<br>")}}t.exports={hoverPoints:function(e,t,i,a){var o=r(e,t,i,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=e.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtInside(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,n(c,u,l,s),s.hovertemplate=u.hovertemplate,o}},makeHoverPointText:n}}}),iT=p({"src/traces/scattersmith/index.js"(e,t){t.exports={moduleType:"trace",name:"scattersmith",basePlotModule:Kk(),categories:["smith","symbols","showLegend","scatter-like"],attributes:Jk(),supplyDefaults:Qk(),colorbar:pi(),formatLabels:eT(),calc:tT(),plot:rT(),style:fi().style,styleOnSelect:fi().styleOnSelect,hoverPoints:nT().hoverPoints,selectPoints:yi(),meta:{}}}}),aT=p({"lib/scattersmith.js"(e,t){t.exports=iT()}}),oT=p({"node_modules/world-calendars/dist/main.js"(e,t){var r=uy();function n(){this.regionalOptions=[],this.regionalOptions[""]={invalidCalendar:"Calendar {0} not found",invalidDate:"Invalid {0} date",invalidMonth:"Invalid {0} month",invalidYear:"Invalid {0} year",differentCalendars:"Cannot mix {0} and {1} dates"},this.local=this.regionalOptions[""],this.calendars={},this._localCals={}}function i(e,t,r,n){if(this._calendar=e,this._year=t,this._month=r,this._day=n,0===this._calendar._validateLevel&&!this._calendar.isValid(this._year,this._month,this._day))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(e,t){return"000000".substring(0,t-(e=""+e).length)+e}function o(){this.shortYearCutoff="+10"}function s(e){this.local=this.regionalOptions[e]||this.regionalOptions[""]}r(n.prototype,{instance:function(e,t){e=(e||"gregorian").toLowerCase(),t=t||"";var r=this._localCals[e+"-"+t];if(!r&&this.calendars[e]&&(r=new this.calendars[e](t),this._localCals[e+"-"+t]=r),!r)throw(this.local.invalidCalendar||this.regionalOptions[""].invalidCalendar).replace(/\{0\}/,e);return r},newDate:function(e,t,r,n,i){return(n=(null!=e&&e.year?e.calendar():"string"===typeof n?this.instance(n,i):n)||this.instance()).newDate(e,t,r)},substituteDigits:function(e){return function(t){return(t+"").replace(/[0-9]/g,(function(t){return e[t]}))}},substituteChineseDigits:function(e,t){return function(r){for(var n="",i=0;r>0;){var a=r%10;n=(0===a?"":e[a]+t[i])+n,i++,r=Math.floor(r/10)}return 0===n.indexOf(e[1]+t[1])&&(n=n.substr(1)),n||e[0]}}}),r(i.prototype,{newDate:function(e,t,r){return this._calendar.newDate(null==e?this:e,t,r)},year:function(e){return 0===arguments.length?this._year:this.set(e,"y")},month:function(e){return 0===arguments.length?this._month:this.set(e,"m")},day:function(e){return 0===arguments.length?this._day:this.set(e,"d")},date:function(e,t,r){if(!this._calendar.isValid(e,t,r))throw(l.local.invalidDate||l.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name);return this._year=e,this._month=t,this._day=r,this},leapYear:function(){return this._calendar.leapYear(this)},epoch:function(){return this._calendar.epoch(this)},formatYear:function(){return this._calendar.formatYear(this)},monthOfYear:function(){return this._calendar.monthOfYear(this)},weekOfYear:function(){return this._calendar.weekOfYear(this)},daysInYear:function(){return this._calendar.daysInYear(this)},dayOfYear:function(){return this._calendar.dayOfYear(this)},daysInMonth:function(){return this._calendar.daysInMonth(this)},dayOfWeek:function(){return this._calendar.dayOfWeek(this)},weekDay:function(){return this._calendar.weekDay(this)},extraInfo:function(){return this._calendar.extraInfo(this)},add:function(e,t){return this._calendar.add(this,e,t)},set:function(e,t){return this._calendar.set(this,e,t)},compareTo:function(e){if(this._calendar.name!==e._calendar.name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this._calendar.local.name).replace(/\{1\}/,e._calendar.local.name);var t=this._year!==e._year?this._year-e._year:this._month!==e._month?this.monthOfYear()-e.monthOfYear():this._day-e._day;return 0===t?0:t<0?-1:1},calendar:function(){return this._calendar},toJD:function(){return this._calendar.toJD(this)},fromJD:function(e){return this._calendar.fromJD(e)},toJSDate:function(){return this._calendar.toJSDate(this)},fromJSDate:function(e){return this._calendar.fromJSDate(e)},toString:function(){return(this.year()<0?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),r(o.prototype,{_validateLevel:0,newDate:function(e,t,r){return null==e?this.today():(e.year&&(this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),r=e.day(),t=e.month(),e=e.year()),new i(this,e,t,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(t.year()<0?"-":"")+a(Math.abs(t.year()),4)},monthsInYear:function(e){return this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear),12},monthOfYear:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return(r.month()+this.monthsInYear(r)-this.firstMonth)%this.monthsInYear(r)+this.minMonth},fromMonthOfYear:function(e,t){var r=(t+this.firstMonth-2*this.minMonth)%this.monthsInYear(e)+this.minMonth;return this._validate(e,r,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth),r},daysInYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return this.leapYear(t)?366:365},dayOfYear:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return n.toJD()-this.newDate(n.year(),this.fromMonthOfYear(n.year(),this.minMonth),this.minDay).toJD()+1},daysInWeek:function(){return 7},dayOfWeek:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(e,t,r){return this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),{}},add:function(e,t,r){return this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate),this._correctAdd(e,this._add(e,t,r),t,r)},_add:function(e,t,r){if(this._validateLevel++,"d"===r||"w"===r){var n=e.toJD()+t*("w"===r?this.daysInWeek():1),i=e.calendar().fromJD(n);return this._validateLevel--,[i.year(),i.month(),i.day()]}try{var a=e.year()+("y"===r?t:0),o=e.monthOfYear()+("m"===r?t:0);i=e.day(),"y"===r?(e.month()!==this.fromMonthOfYear(a,o)&&(o=this.newDate(a,e.month(),this.minDay).monthOfYear()),o=Math.min(o,this.monthsInYear(a)),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o)))):"m"===r&&(function(e){for(;o<e.minMonth;)a--,o+=e.monthsInYear(a);for(var t=e.monthsInYear(a);o>t-1+e.minMonth;)a++,o-=t,t=e.monthsInYear(a)}(this),i=Math.min(i,this.daysInMonth(a,this.fromMonthOfYear(a,o))));var s=[a,this.fromMonthOfYear(a,o),i];return this._validateLevel--,s}catch(l){throw this._validateLevel--,l}},_correctAdd:function(e,t,r,n){if(!this.hasYearZero&&("y"===n||"m"===n)&&(0===t[0]||e.year()>0!==t[0]>0)){var i={y:[1,1,"y"],m:[1,this.monthsInYear(-1),"m"],w:[this.daysInWeek(),this.daysInYear(-1),"d"],d:[1,this.daysInYear(-1),"d"]}[n],a=r<0?-1:1;t=this._add(e,r*i[0]+a*i[1],i[2])}return e.date(t[0],t[1],t[2])},set:function(e,t,r){this._validate(e,this.minMonth,this.minDay,l.local.invalidDate||l.regionalOptions[""].invalidDate);var n="y"===r?t:e.year(),i="m"===r?t:e.month(),a="d"===r?t:e.day();return"y"!==r&&"m"!==r||(a=Math.min(a,this.daysInMonth(n,i))),e.date(n,i,a)},isValid:function(e,t,r){this._validateLevel++;var n=this.hasYearZero||0!==e;if(n){var i=this.newDate(e,t,this.minDay);n=t>=this.minMonth&&t-this.minMonth<this.monthsInYear(i)&&r>=this.minDay&&r-this.minDay<this.daysInMonth(i)}return this._validateLevel--,n},toJSDate:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);return l.instance().fromJD(this.toJD(n)).toJSDate()},fromJSDate:function(e){return this.fromJD(l.instance().fromJSDate(e).toJD())},_validate:function(e,t,r,n){if(e.year){if(0===this._validateLevel&&this.name!==e.calendar().name)throw(l.local.differentCalendars||l.regionalOptions[""].differentCalendars).replace(/\{0\}/,this.local.name).replace(/\{1\}/,e.calendar().local.name);return e}try{if(this._validateLevel++,1===this._validateLevel&&!this.isValid(e,t,r))throw n.replace(/\{0\}/,this.local.name);var i=this.newDate(e,t,r);return this._validateLevel--,i}catch(a){throw this._validateLevel--,a}}}),s.prototype=new o,r(s.prototype,{name:"Gregorian",jdEpoch:1721425.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Gregorian",epochs:["BCE","CE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(e){var t=this._validate(e,this.minMonth,this.minDay,l.local.invalidYear||l.regionalOptions[""].invalidYear);return(e=t.year()+(t.year()<0?1:0))%4===0&&(e%100!==0||e%400===0)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(e,t){var r=this._validate(e,t,this.minDay,l.local.invalidMonth||l.regionalOptions[""].invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate);e=n.year(),t=n.month(),r=n.day(),e<0&&e++,t<3&&(t+=12,e--);var i=Math.floor(e/100),a=2-i+Math.floor(i/4);return Math.floor(365.25*(e+4716))+Math.floor(30.6001*(t+1))+r+a-1524.5},fromJD:function(e){var t=Math.floor(e+.5),r=Math.floor((t-1867216.25)/36524.25),n=1524+(r=t+1+r-Math.floor(r/4)),i=Math.floor((n-122.1)/365.25),a=Math.floor(365.25*i),o=Math.floor((n-a)/30.6001),s=n-a-Math.floor(30.6001*o),l=o-(o>13.5?13:1),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(e,t,r){var n=this._validate(e,t,r,l.local.invalidDate||l.regionalOptions[""].invalidDate),i=new Date(n.year(),n.month()-1,n.day());return i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.setHours(i.getHours()>12?i.getHours()+2:0),i},fromJSDate:function(e){return this.newDate(e.getFullYear(),e.getMonth()+1,e.getDate())}});var l=t.exports=new n;l.cdate=i,l.baseCalendar=o,l.calendars.gregorian=s}}),sT=p({"node_modules/world-calendars/dist/plus.js"(){var e=uy(),t=oT();e(t.regionalOptions[""],{invalidArguments:"Invalid arguments",invalidFormat:"Cannot format a date from another calendar",missingNumberAt:"Missing number at position {0}",unknownNameAt:"Unknown name at position {0}",unexpectedLiteralAt:"Unexpected literal at position {0}",unexpectedText:"Additional text found at end"}),t.local=t.regionalOptions[""],e(t.cdate.prototype,{formatDate:function(e,t){return"string"!==typeof e&&(t=e,e=""),this._calendar.formatDate(e||"",this,t)}}),e(t.baseCalendar.prototype,{UNIX_EPOCH:t.instance().newDate(1970,1,1).toJD(),SECS_PER_DAY:86400,TICKS_EPOCH:t.instance().jdEpoch,TICKS_PER_DAY:864e9,ATOM:"yyyy-mm-dd",COOKIE:"D, dd M yyyy",FULL:"DD, MM d, yyyy",ISO_8601:"yyyy-mm-dd",JULIAN:"J",RFC_822:"D, d M yy",RFC_850:"DD, dd-M-yy",RFC_1036:"D, d M yy",RFC_1123:"D, d M yyyy",RFC_2822:"D, d M yyyy",RSS:"D, d M yy",TICKS:"!",TIMESTAMP:"@",W3C:"yyyy-mm-dd",formatDate:function(e,r,n){if("string"!==typeof e&&(n=r,r=e,e=""),!r)return"";if(r.calendar()!==this)throw t.local.invalidFormat||t.regionalOptions[""].invalidFormat;e=e||this.local.dateFormat;for(var i,a=(n=n||{}).dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.monthNumbers||this.local.monthNumbers,l=n.monthNamesShort||this.local.monthNamesShort,c=n.monthNames||this.local.monthNames,u=(n.calculateWeek||this.local.calculateWeek,function(t,r){for(var n=1;x+n<e.length&&e.charAt(x+n)===t;)n++;return x+=n-1,Math.floor(n/(r||1))>1}),h=function(e,t,r,n){var i=""+t;if(u(e,n))for(;i.length<r;)i="0"+i;return i},p=function(e,t,r,n){return u(e)?n[t]:r[t]},d=this,f=function(e,t){return t?"function"===typeof c?c.call(d,e):c[e.month()-d.minMonth]:"function"===typeof l?l.call(d,e):l[e.month()-d.minMonth]},m=this.local.digits,g=function(e){return n.localNumbers&&m?m(e):e},y="",v=!1,x=0;x<e.length;x++)if(v)"'"!==e.charAt(x)||u("'")?y+=e.charAt(x):v=!1;else switch(e.charAt(x)){case"d":y+=g(h("d",r.day(),2));break;case"D":y+=p("D",r.dayOfWeek(),a,o);break;case"o":y+=h("o",r.dayOfYear(),3);break;case"w":y+=h("w",r.weekOfYear(),2);break;case"m":y+=(i=r,"function"===typeof s?s.call(d,i,u("m")):g(h("m",i.month(),2)));break;case"M":y+=f(r,u("M"));break;case"y":y+=u("y",2)?r.year():(r.year()%100<10?"0":"")+r.year()%100;break;case"Y":u("Y",2),y+=r.formatYear();break;case"J":y+=r.toJD();break;case"@":y+=(r.toJD()-this.UNIX_EPOCH)*this.SECS_PER_DAY;break;case"!":y+=(r.toJD()-this.TICKS_EPOCH)*this.TICKS_PER_DAY;break;case"'":u("'")?y+="'":v=!0;break;default:y+=e.charAt(x)}return y},parseDate:function(e,r,n){if(null==r)throw t.local.invalidArguments||t.regionalOptions[""].invalidArguments;if(""===(r="object"===typeof r?r.toString():r+""))return null;e=e||this.local.dateFormat;var i=(n=n||{}).shortYearCutoff||this.shortYearCutoff;i="string"!==typeof i?i:this.today().year()%100+parseInt(i,10);for(var a=n.dayNamesShort||this.local.dayNamesShort,o=n.dayNames||this.local.dayNames,s=n.parseMonth||this.local.parseMonth,l=n.monthNumbers||this.local.monthNumbers,c=n.monthNamesShort||this.local.monthNamesShort,u=n.monthNames||this.local.monthNames,h=-1,p=-1,d=-1,f=-1,m=-1,g=!1,y=!1,v=function(t,r){for(var n=1;A+n<e.length&&e.charAt(A+n)===t;)n++;return A+=n-1,Math.floor(n/(r||1))>1},x=function(e,n){var i=v(e,n),a=[2,3,i?4:2,i?4:2,10,11,20]["oyYJ@!".indexOf(e)+1],o=new RegExp("^-?\\d{1,"+a+"}"),s=r.substring(S).match(o);if(!s)throw(t.local.missingNumberAt||t.regionalOptions[""].missingNumberAt).replace(/\{0\}/,S);return S+=s[0].length,parseInt(s[0],10)},b=this,_=function(){if("function"===typeof l){v("m");var e=l.call(b,r.substring(S));return S+=e.length,e}return x("m")},w=function(e,n,i,a){for(var o=v(e,a)?i:n,s=0;s<o.length;s++)if(r.substr(S,o[s].length).toLowerCase()===o[s].toLowerCase())return S+=o[s].length,s+b.minMonth;throw(t.local.unknownNameAt||t.regionalOptions[""].unknownNameAt).replace(/\{0\}/,S)},k=function(){if("function"===typeof u){var e=v("M")?u.call(b,r.substring(S)):c.call(b,r.substring(S));return S+=e.length,e}return w("M",c,u)},T=function(){if(r.charAt(S)!==e.charAt(A))throw(t.local.unexpectedLiteralAt||t.regionalOptions[""].unexpectedLiteralAt).replace(/\{0\}/,S);S++},S=0,A=0;A<e.length;A++)if(y)"'"!==e.charAt(A)||v("'")?T():y=!1;else switch(e.charAt(A)){case"d":f=x("d");break;case"D":w("D",a,o);break;case"o":m=x("o");break;case"w":x("w");break;case"m":d=_();break;case"M":d=k();break;case"y":var M=A;g=!v("y",2),A=M,p=x("y",2);break;case"Y":p=x("Y",2);break;case"J":h=x("J")+.5,"."===r.charAt(S)&&(S++,x("J"));break;case"@":h=x("@")/this.SECS_PER_DAY+this.UNIX_EPOCH;break;case"!":h=x("!")/this.TICKS_PER_DAY+this.TICKS_EPOCH;break;case"*":S=r.length;break;case"'":v("'")?T():y=!0;break;default:T()}if(S<r.length)throw t.local.unexpectedText||t.regionalOptions[""].unexpectedText;if(-1===p?p=this.today().year():p<100&&g&&(p+=-1===i?1900:this.today().year()-this.today().year()%100-(p<=i?0:100)),"string"===typeof d&&(d=s.call(this,p,d)),m>-1){d=1,f=m;for(var E=this.daysInMonth(p,d);f>E;E=this.daysInMonth(p,d))d++,f-=E}return h>-1?this.fromJD(h):this.newDate(p,d,f)},determineDate:function(e,t,r,n,i){r&&"object"!==typeof r&&(i=n,n=r,r=null),"string"!==typeof n&&(i=n,n="");var a=this;return t=t?t.newDate():null,e=null==e?t:"string"===typeof e?function(e){try{return a.parseDate(n,e,i)}catch(l){}for(var t=((e=e.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(e);s;)t.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(e);return t}(e):"number"===typeof e?isNaN(e)||e===1/0||e===-1/0?t:a.today().add(e,"d"):a.newDate(e)}})}}),lT=p({"node_modules/world-calendars/dist/calendars/chinese.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Chinese",jdEpoch:1721425.5,hasYearZero:!1,minMonth:0,firstMonth:0,minDay:1,regionalOptions:{"":{name:"Chinese",epochs:["BEC","EC"],monthNumbers:function(e,t){if("string"===typeof e){var r=e.match(a);return r?r[0]:""}var n=this._validateYear(e),i=e.month(),o=""+this.toChineseMonth(n,i);return t&&o.length<2&&(o="0"+o),this.isIntercalaryMonth(n,i)&&(o+="i"),o},monthNames:function(e){if("string"===typeof e){var t=e.match(o);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},monthNamesShort:function(e){if("string"===typeof e){var t=e.match(s);return t?t[0]:""}var r=this._validateYear(e),n=e.month(),i=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][this.toChineseMonth(r,n)-1];return this.isIntercalaryMonth(r,n)&&(i="\u95f0"+i),i},parseMonth:function(e,t){e=this._validateYear(e);var r,n=parseInt(t);if(isNaN(n))"\u95f0"===t[0]&&(r=!0,t=t.substring(1)),"\u6708"===t[t.length-1]&&(t=t.substring(0,t.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(t);else{var i=t[t.length-1];r="i"===i||"I"===i}return this.toMonthIndex(e,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(e,t){if(e.year&&(e=e.year()),"number"!==typeof e||e<1888||e>2111)throw t.replace(/\{0\}/,this.local.name);return e},toMonthIndex:function(t,r,n){var i=this.intercalaryMonth(t);if(n&&r!==i||r<1||r>12)throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return i?!n&&r<=i?r-1:r:r-1},toChineseMonth:function(t,r){t.year&&(r=(t=t.year()).month());var n=this.intercalaryMonth(t);if(r<0||r>(n?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?r<n?r+1:r:r+1},intercalaryMonth:function(e){return e=this._validateYear(e),l[e-l[0]]>>13},isIntercalaryMonth:function(e,t){e.year&&(t=(e=e.year()).month());var r=this.intercalaryMonth(e);return!!r&&r===t},leapYear:function(e){return 0!==this.intercalaryMonth(e)},weekOfYear:function(t,n,i){var a,o=this._validateYear(t,e.local.invalidyear),s=c[o-c[0]],l=s>>9&4095,u=s>>5&15,h=31&s;(a=r.newDate(l,u,h)).add(4-(a.dayOfWeek()||7),"d");var p=this.toJD(t,n,i)-a.toJD();return 1+Math.floor(p/7)},monthsInYear:function(e){return this.leapYear(e)?13:12},daysInMonth:function(t,r){t.year&&(r=t.month(),t=t.year()),t=this._validateYear(t);var n=l[t-l[0]];if(r>(n>>13?12:11))throw e.local.invalidMonth.replace(/\{0\}/,this.local.name);return n&1<<12-r?30:29},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,s,i,e.local.invalidDate);t=this._validateYear(a.year()),n=a.month(),i=a.day();var o=this.isIntercalaryMonth(t,n),s=this.toChineseMonth(t,n),u=function(e,t,r,n,i){var a,o,s;if("object"===typeof e)o=e,a=t||{};else{var u;if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Lunar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Lunar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=30))throw new Error("Lunar day outside range 1 - 30");"object"===typeof n?(u=!1,a=n):(u=!!n,a=i||{}),o={year:e,month:t,day:r,isIntercalary:u}}s=o.day-1;var h,p=l[o.year-l[0]],d=p>>13;h=d&&(o.month>d||o.isIntercalary)?o.month:o.month-1;for(var f=0;f<h;f++)s+=p&1<<12-f?30:29;var m=c[o.year-c[0]],g=new Date(m>>9&4095,(m>>5&15)-1,(31&m)+s);return a.year=g.getFullYear(),a.month=1+g.getMonth(),a.day=g.getDate(),a}(t,s,i,o);return r.toJD(u.year,u.month,u.day)},fromJD:function(e){var t=r.fromJD(e),n=function(e,t,r,n){var i,a;if("object"===typeof e)i=e,a=t||{};else{if(!("number"===typeof e&&e>=1888&&e<=2111))throw new Error("Solar year outside range 1888-2111");if(!("number"===typeof t&&t>=1&&t<=12))throw new Error("Solar month outside range 1 - 12");if(!("number"===typeof r&&r>=1&&r<=31))throw new Error("Solar day outside range 1 - 31");i={year:e,month:t,day:r},a=n||{}}var o=c[i.year-c[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=c[a.year-c[0]];var u,h=new Date(o>>9&4095,(o>>5&15)-1,31&o),p=new Date(i.year,i.month-1,i.day);u=Math.round((p-h)/864e5);var d,f=l[a.year-l[0]];for(d=0;d<13;d++){var m=f&1<<12-d?30:29;if(u<m)break;u-=m}var g=f>>13;return!g||d<g?(a.isIntercalary=!1,a.month=1+d):d===g?(a.isIntercalary=!0,a.month=d):(a.isIntercalary=!1,a.month=d),a.day=1+u,a}(t.year(),t.month(),t.day()),i=this.toMonthIndex(n.year,n.month,n.isIntercalary);return this.newDate(n.year,i,n.day)},fromString:function(e){var t=e.match(i),r=this._validateYear(+t[1]),n=+t[2],a=!!t[3],o=this.toMonthIndex(r,n,a),s=+t[4];return this.newDate(r,o,s)},add:function(e,t,r){var i=e.year(),a=e.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,e,t,r);if("y"===r){var c=l.year(),u=l.month(),h=this.isIntercalaryMonth(c,s),p=o&&h?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);p!==u&&l.month(p)}return l}});var i=/^\s*(-?\d\d\d\d|\d\d)[-/](\d?\d)([iI]?)[-/](\d?\d)/m,a=/^\d?\d[iI]?/m,o=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,s=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;e.calendars.chinese=n;var l=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],c=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]}}),cT=p({"node_modules/world-calendars/dist/calendars/coptic.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Coptic",jdEpoch:1825029.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()+(r.year()<0?1:0))%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),e.calendars.coptic=r}}),uT=p({"node_modules/world-calendars/dist/calendars/discworld.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),400},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,r,n){return(this._validate(t,r,n,e.local.invalidDate).day()+1)%8},weekDay:function(e,t,r){var n=this.dayOfWeek(e,t,r);return n>=2&&n<=6},extraInfo:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);return{century:n[Math.floor((a.year()-1)/100)+1]||""}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year()+(i.year()<0?1:0),r=i.month(),(n=i.day())+(r>1?16:0)+(r>2?32*(r-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e+.5)-Math.floor(this.jdEpoch)-1;var t=Math.floor(e/400)+1;e-=400*(t-1),e+=e>15?16:0;var r=Math.floor(e/32)+1,n=e-32*(r-1)+1;return this.newDate(t<=0?t-1:t,r,n)}});var n={20:"Fruitbat",21:"Anchovy"};e.calendars.discworld=r}}),hT=p({"node_modules/world-calendars/dist/calendars/ethiopian.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Ethiopian",jdEpoch:1724220.5,daysPerMonth:[30,30,30,30,30,30,30,30,30,30,30,30,5],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Ethiopian",epochs:["BEE","EE"],monthNames:["Meskerem","Tikemet","Hidar","Tahesas","Tir","Yekatit","Megabit","Miazia","Genbot","Sene","Hamle","Nehase","Pagume"],monthNamesShort:["Mes","Tik","Hid","Tah","Tir","Yek","Meg","Mia","Gen","Sen","Ham","Neh","Pag"],dayNames:["Ehud","Segno","Maksegno","Irob","Hamus","Arb","Kidame"],dayNamesShort:["Ehu","Seg","Mak","Iro","Ham","Arb","Kid"],dayNamesMin:["Eh","Se","Ma","Ir","Ha","Ar","Ki"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()+(r.year()<0?1:0))%4===3||t%4===-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear),13},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(13===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return(t=i.year())<0&&t++,i.day()+30*(i.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(e){var t=Math.floor(e)+.5-this.jdEpoch,r=Math.floor((t-Math.floor((t+366)/1461))/365)+1;r<=0&&r--,t=Math.floor(e)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(t/30)+1,i=t-30*(n-1)+1;return this.newDate(r,n,i)}}),e.calendars.ethiopian=r}}),pT=p({"node_modules/world-calendars/dist/calendars/hebrew.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Hebrew",jdEpoch:347995.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29,29],hasYearZero:!1,minMonth:1,firstMonth:7,minDay:1,regionalOptions:{"":{name:"Hebrew",epochs:["BAM","AM"],monthNames:["Nisan","Iyar","Sivan","Tammuz","Av","Elul","Tishrei","Cheshvan","Kislev","Tevet","Shevat","Adar","Adar II"],monthNamesShort:["Nis","Iya","Siv","Tam","Av","Elu","Tis","Che","Kis","Tev","She","Ada","Ad2"],dayNames:["Yom Rishon","Yom Sheni","Yom Shlishi","Yom Revi'i","Yom Chamishi","Yom Shishi","Yom Shabbat"],dayNamesShort:["Ris","She","Shl","Rev","Cha","Shi","Sha"],dayNamesMin:["Ri","She","Shl","Re","Ch","Shi","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return this._leapYear(r.year())},_leapYear:function(e){return n(7*(e=e<0?e+1:e)+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),this._leapYear(t.year?t.year():t)?13:12},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){return t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),this.toJD(-1===t?1:t+1,7,1)-this.toJD(t,7,1)},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),12===r&&this.leapYear(t)||8===r&&5===n(this.daysInYear(t),10)?30:9===r&&3===n(this.daysInYear(t),10)?29:this.daysPerMonth[r-1]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},extraInfo:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return{yearType:(this.leapYear(i)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(i)%10-3]}},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=t<=0?t+1:t,o=this.jdEpoch+this._delay1(a)+this._delay2(a)+n+1;if(r<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(s=1;s<r;s++)o+=this.daysInMonth(t,s)}else for(s=7;s<r;s++)o+=this.daysInMonth(t,s);return o},_delay1:function(e){var t=Math.floor((235*e-234)/19),r=12084+13753*t,i=29*t+Math.floor(r/25920);return n(3*(i+1),7)<3&&i++,i},_delay2:function(e){var t=this._delay1(e-1),r=this._delay1(e);return this._delay1(e+1)-r===356?2:r-t===382?1:0},fromJD:function(e){e=Math.floor(e)+.5;for(var t=Math.floor(98496*(e-this.jdEpoch)/35975351)-1;e>=this.toJD(-1===t?1:t+1,7,1);)t++;for(var r=e<this.toJD(t,1,1)?7:1;e>this.toJD(t,r,this.daysInMonth(t,r));)r++;var n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.hebrew=r}}),dT=p({"node_modules/world-calendars/dist/calendars/islamic.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year()+14)%30<11},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){return this.leapYear(e)?355:354},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),t=t<=0?t+1:t,(n=i.day())+Math.ceil(29.5*(r-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(e){e=Math.floor(e)+.5;var t=Math.floor((30*(e-this.jdEpoch)+10646)/10631);t=t<=0?t-1:t;var r=Math.min(12,Math.ceil((e-29-this.toJD(t,1,1))/29.5)+1),n=e-this.toJD(t,r,1)+1;return this.newDate(t,r,n)}}),e.calendars.islamic=r}}),fT=p({"node_modules/world-calendars/dist/calendars/julian.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Julian",jdEpoch:1721423.5,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Julian",epochs:["BC","AD"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"mm/dd/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return(t=r.year()<0?r.year()+1:r.year())%4===0},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(4-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return t=i.year(),r=i.month(),n=i.day(),t<0&&t++,r<=2&&(t--,r+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(r+1))+n-1524.5},fromJD:function(e){var t=Math.floor(e+.5)+1524,r=Math.floor((t-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((t-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=t-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),e.calendars.julian=r}}),mT=p({"node_modules/world-calendars/dist/calendars/mayan.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}function i(e,t){return n(e-1,t)+1}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Mayan",jdEpoch:584282.5,hasYearZero:!0,minMonth:0,firstMonth:0,minDay:0,regionalOptions:{"":{name:"Mayan",epochs:["",""],monthNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],monthNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17"],dayNames:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesShort:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],dayNamesMin:["0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"],digits:null,dateFormat:"YYYY.m.d",firstDay:0,isRTL:!1,haabMonths:["Pop","Uo","Zip","Zotz","Tzec","Xul","Yaxkin","Mol","Chen","Yax","Zac","Ceh","Mac","Kankin","Muan","Pax","Kayab","Cumku","Uayeb"],tzolkinMonths:["Imix","Ik","Akbal","Kan","Chicchan","Cimi","Manik","Lamat","Muluc","Oc","Chuen","Eb","Ben","Ix","Men","Cib","Caban","Etznab","Cauac","Ahau"]}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year();var r=Math.floor(t/400);return t%=400,t+=t<0?400:0,r+"."+Math.floor(t/20)+"."+t%20},forYear:function(e){if((e=e.split(".")).length<3)throw"Invalid Mayan year";for(var t=0,r=0;r<e.length;r++){var n=parseInt(e[r],10);if(Math.abs(n)>19||r>0&&n<0)throw"Invalid Mayan year";t=20*t+n}return t},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),18},weekOfYear:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,e.local.invalidYear),360},daysInMonth:function(t,r){return this._validate(t,r,this.minDay,e.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate).day()},weekDay:function(t,r,n){return this._validate(t,r,n,e.local.invalidDate),!0},extraInfo:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate).toJD(),a=this._toHaab(i),o=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[o[0]-1],tzolkinDay:o[0],tzolkinTrecena:o[1]}},_toHaab:function(e){var t=n(8+(e-=this.jdEpoch)+340,365);return[Math.floor(t/20)+1,n(t,20)]},_toTzolkin:function(e){return[i(20+(e-=this.jdEpoch),20),i(e+4,13)]},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);return i.day()+20*i.month()+360*i.year()+this.jdEpoch},fromJD:function(e){e=Math.floor(e)+.5-this.jdEpoch;var t=Math.floor(e/360);e%=360,e+=e<0?360:0;var r=Math.floor(e/20),n=e%20;return this.newDate(t,r,n)}}),e.calendars.mayan=r}}),gT=p({"node_modules/world-calendars/dist/calendars/nanakshahi.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar;var n=e.instance("gregorian");t(r.prototype,{name:"Nanakshahi",jdEpoch:2257673.5,daysPerMonth:[31,31,31,31,31,30,30,30,30,30,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Nanakshahi",epochs:["BN","AN"],monthNames:["Chet","Vaisakh","Jeth","Harh","Sawan","Bhadon","Assu","Katak","Maghar","Poh","Magh","Phagun"],monthNamesShort:["Che","Vai","Jet","Har","Saw","Bha","Ass","Kat","Mgr","Poh","Mgh","Pha"],dayNames:["Somvaar","Mangalvar","Budhvaar","Veervaar","Shukarvaar","Sanicharvaar","Etvaar"],dayNamesShort:["Som","Mangal","Budh","Veer","Shukar","Sanichar","Et"],dayNamesMin:["So","Ma","Bu","Ve","Sh","Sa","Et"],digits:null,dateFormat:"dd-mm-yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear||e.regionalOptions[""].invalidYear);return n.leapYear(r.year()+(r.year()<1?1:0)+1469)},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(1-(n.dayOfWeek()||7),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidMonth);(t=a.year())<0&&t++;for(var o=a.day(),s=1;s<a.month();s++)o+=this.daysPerMonth[s-1];return o+n.toJD(t+1468,3,13)},fromJD:function(e){e=Math.floor(e+.5);for(var t=Math.floor((e-(this.jdEpoch-1))/366);e>=this.toJD(t+1,1,1);)t++;for(var r=e-Math.floor(this.toJD(t,1,1)+.5)+1,n=1;r>this.daysInMonth(t,n);)r-=this.daysInMonth(t,n),n++;return this.newDate(t,n,r)}}),e.calendars.nanakshahi=r}}),yT=p({"node_modules/world-calendars/dist/calendars/nepali.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Nepali",jdEpoch:1700709.5,daysPerMonth:[31,31,32,32,31,30,30,29,30,29,30,30],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,daysPerYear:365,regionalOptions:{"":{name:"Nepali",epochs:["BBS","ABS"],monthNames:["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Paush","Mangh","Falgun","Chaitra"],monthNamesShort:["Bai","Je","As","Shra","Bha","Ash","Kar","Mang","Pau","Ma","Fal","Chai"],dayNames:["Aaitabaar","Sombaar","Manglbaar","Budhabaar","Bihibaar","Shukrabaar","Shanibaar"],dayNamesShort:["Aaita","Som","Mangl","Budha","Bihi","Shukra","Shani"],dayNamesMin:["Aai","So","Man","Bu","Bi","Shu","Sha"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:1,isRTL:!1}},leapYear:function(e){return this.daysInYear(e)!==this.daysPerYear},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(t){if(t=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear).year(),"undefined"===typeof this.NEPALI_CALENDAR_DATA[t])return this.daysPerYear;for(var r=0,n=this.minMonth;n<=12;n++)r+=this.NEPALI_CALENDAR_DATA[t][n];return r},daysInMonth:function(t,r){return t.year&&(r=t.month(),t=t.year()),this._validate(t,r,this.minDay,e.local.invalidMonth),"undefined"===typeof this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[r-1]:this.NEPALI_CALENDAR_DATA[t][r]},weekDay:function(e,t,r){return 6!==this.dayOfWeek(e,t,r)},toJD:function(t,r,n){var i=this._validate(t,r,n,e.local.invalidDate);t=i.year(),r=i.month(),n=i.day();var a=e.instance(),o=0,s=r,l=t;this._createMissingCalendarData(t);var c=t-(s>9||9===s&&n>=this.NEPALI_CALENDAR_DATA[l][0]?56:57);for(9!==r&&(o=n,s--);9!==s;)s<=0&&(s=12,l--),o+=this.NEPALI_CALENDAR_DATA[l][s],s--;return 9===r?(o+=n-this.NEPALI_CALENDAR_DATA[l][0])<0&&(o+=a.daysInYear(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var r=e.instance().fromJD(t),n=r.year(),i=r.dayOfYear(),a=n+56;this._createMissingCalendarData(a);for(var o=9,s=this.NEPALI_CALENDAR_DATA[a][0],l=this.NEPALI_CALENDAR_DATA[a][o]-s+1;i>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-i);return this.newDate(a,o,c)},_createMissingCalendarData:function(e){var t=this.daysPerMonth.slice(0);t.unshift(17);for(var r=e-1;r<e+2;r++)"undefined"===typeof this.NEPALI_CALENDAR_DATA[r]&&(this.NEPALI_CALENDAR_DATA[r]=t)},NEPALI_CALENDAR_DATA:{1970:[18,31,31,32,31,31,31,30,29,30,29,30,30],1971:[18,31,31,32,31,32,30,30,29,30,29,30,30],1972:[17,31,32,31,32,31,30,30,30,29,29,30,30],1973:[19,30,32,31,32,31,30,30,30,29,30,29,31],1974:[19,31,31,32,30,31,31,30,29,30,29,30,30],1975:[18,31,31,32,32,30,31,30,29,30,29,30,30],1976:[17,31,32,31,32,31,30,30,30,29,29,30,31],1977:[18,31,32,31,32,31,31,29,30,29,30,29,31],1978:[18,31,31,32,31,31,31,30,29,30,29,30,30],1979:[18,31,31,32,32,31,30,30,29,30,29,30,30],1980:[17,31,32,31,32,31,30,30,30,29,29,30,31],1981:[18,31,31,31,32,31,31,29,30,30,29,30,30],1982:[18,31,31,32,31,31,31,30,29,30,29,30,30],1983:[18,31,31,32,32,31,30,30,29,30,29,30,30],1984:[17,31,32,31,32,31,30,30,30,29,29,30,31],1985:[18,31,31,31,32,31,31,29,30,30,29,30,30],1986:[18,31,31,32,31,31,31,30,29,30,29,30,30],1987:[18,31,32,31,32,31,30,30,29,30,29,30,30],1988:[17,31,32,31,32,31,30,30,30,29,29,30,31],1989:[18,31,31,31,32,31,31,30,29,30,29,30,30],1990:[18,31,31,32,31,31,31,30,29,30,29,30,30],1991:[18,31,32,31,32,31,30,30,29,30,29,30,30],1992:[17,31,32,31,32,31,30,30,30,29,30,29,31],1993:[18,31,31,31,32,31,31,30,29,30,29,30,30],1994:[18,31,31,32,31,31,31,30,29,30,29,30,30],1995:[17,31,32,31,32,31,30,30,30,29,29,30,30],1996:[17,31,32,31,32,31,30,30,30,29,30,29,31],1997:[18,31,31,32,31,31,31,30,29,30,29,30,30],1998:[18,31,31,32,31,31,31,30,29,30,29,30,30],1999:[17,31,32,31,32,31,30,30,30,29,29,30,31],2e3:[17,30,32,31,32,31,30,30,30,29,30,29,31],2001:[18,31,31,32,31,31,31,30,29,30,29,30,30],2002:[18,31,31,32,32,31,30,30,29,30,29,30,30],2003:[17,31,32,31,32,31,30,30,30,29,29,30,31],2004:[17,30,32,31,32,31,30,30,30,29,30,29,31],2005:[18,31,31,32,31,31,31,30,29,30,29,30,30],2006:[18,31,31,32,32,31,30,30,29,30,29,30,30],2007:[17,31,32,31,32,31,30,30,30,29,29,30,31],2008:[17,31,31,31,32,31,31,29,30,30,29,29,31],2009:[18,31,31,32,31,31,31,30,29,30,29,30,30],2010:[18,31,31,32,32,31,30,30,29,30,29,30,30],2011:[17,31,32,31,32,31,30,30,30,29,29,30,31],2012:[17,31,31,31,32,31,31,29,30,30,29,30,30],2013:[18,31,31,32,31,31,31,30,29,30,29,30,30],2014:[18,31,31,32,32,31,30,30,29,30,29,30,30],2015:[17,31,32,31,32,31,30,30,30,29,29,30,31],2016:[17,31,31,31,32,31,31,29,30,30,29,30,30],2017:[18,31,31,32,31,31,31,30,29,30,29,30,30],2018:[18,31,32,31,32,31,30,30,29,30,29,30,30],2019:[17,31,32,31,32,31,30,30,30,29,30,29,31],2020:[17,31,31,31,32,31,31,30,29,30,29,30,30],2021:[18,31,31,32,31,31,31,30,29,30,29,30,30],2022:[17,31,32,31,32,31,30,30,30,29,29,30,30],2023:[17,31,32,31,32,31,30,30,30,29,30,29,31],2024:[17,31,31,31,32,31,31,30,29,30,29,30,30],2025:[18,31,31,32,31,31,31,30,29,30,29,30,30],2026:[17,31,32,31,32,31,30,30,30,29,29,30,31],2027:[17,30,32,31,32,31,30,30,30,29,30,29,31],2028:[17,31,31,32,31,31,31,30,29,30,29,30,30],2029:[18,31,31,32,31,32,30,30,29,30,29,30,30],2030:[17,31,32,31,32,31,30,30,30,30,30,30,31],2031:[17,31,32,31,32,31,31,31,31,31,31,31,31],2032:[17,32,32,32,32,32,32,32,32,32,32,32,32],2033:[18,31,31,32,32,31,30,30,29,30,29,30,30],2034:[17,31,32,31,32,31,30,30,30,29,29,30,31],2035:[17,30,32,31,32,31,31,29,30,30,29,29,31],2036:[17,31,31,32,31,31,31,30,29,30,29,30,30],2037:[18,31,31,32,32,31,30,30,29,30,29,30,30],2038:[17,31,32,31,32,31,30,30,30,29,29,30,31],2039:[17,31,31,31,32,31,31,29,30,30,29,30,30],2040:[17,31,31,32,31,31,31,30,29,30,29,30,30],2041:[18,31,31,32,32,31,30,30,29,30,29,30,30],2042:[17,31,32,31,32,31,30,30,30,29,29,30,31],2043:[17,31,31,31,32,31,31,29,30,30,29,30,30],2044:[17,31,31,32,31,31,31,30,29,30,29,30,30],2045:[18,31,32,31,32,31,30,30,29,30,29,30,30],2046:[17,31,32,31,32,31,30,30,30,29,29,30,31],2047:[17,31,31,31,32,31,31,30,29,30,29,30,30],2048:[17,31,31,32,31,31,31,30,29,30,29,30,30],2049:[17,31,32,31,32,31,30,30,30,29,29,30,30],2050:[17,31,32,31,32,31,30,30,30,29,30,29,31],2051:[17,31,31,31,32,31,31,30,29,30,29,30,30],2052:[17,31,31,32,31,31,31,30,29,30,29,30,30],2053:[17,31,32,31,32,31,30,30,30,29,29,30,30],2054:[17,31,32,31,32,31,30,30,30,29,30,29,31],2055:[17,31,31,32,31,31,31,30,29,30,30,29,30],2056:[17,31,31,32,31,32,30,30,29,30,29,30,30],2057:[17,31,32,31,32,31,30,30,30,29,29,30,31],2058:[17,30,32,31,32,31,30,30,30,29,30,29,31],2059:[17,31,31,32,31,31,31,30,29,30,29,30,30],2060:[17,31,31,32,32,31,30,30,29,30,29,30,30],2061:[17,31,32,31,32,31,30,30,30,29,29,30,31],2062:[17,30,32,31,32,31,31,29,30,29,30,29,31],2063:[17,31,31,32,31,31,31,30,29,30,29,30,30],2064:[17,31,31,32,32,31,30,30,29,30,29,30,30],2065:[17,31,32,31,32,31,30,30,30,29,29,30,31],2066:[17,31,31,31,32,31,31,29,30,30,29,29,31],2067:[17,31,31,32,31,31,31,30,29,30,29,30,30],2068:[17,31,31,32,32,31,30,30,29,30,29,30,30],2069:[17,31,32,31,32,31,30,30,30,29,29,30,31],2070:[17,31,31,31,32,31,31,29,30,30,29,30,30],2071:[17,31,31,32,31,31,31,30,29,30,29,30,30],2072:[17,31,32,31,32,31,30,30,29,30,29,30,30],2073:[17,31,32,31,32,31,30,30,30,29,29,30,31],2074:[17,31,31,31,32,31,31,30,29,30,29,30,30],2075:[17,31,31,32,31,31,31,30,29,30,29,30,30],2076:[16,31,32,31,32,31,30,30,30,29,29,30,30],2077:[17,31,32,31,32,31,30,30,30,29,30,29,31],2078:[17,31,31,31,32,31,31,30,29,30,29,30,30],2079:[17,31,31,32,31,31,31,30,29,30,29,30,30],2080:[16,31,32,31,32,31,30,30,30,29,29,30,30],2081:[17,31,31,32,32,31,30,30,30,29,30,30,30],2082:[17,31,32,31,32,31,30,30,30,29,30,30,30],2083:[17,31,31,32,31,31,30,30,30,29,30,30,30],2084:[17,31,31,32,31,31,30,30,30,29,30,30,30],2085:[17,31,32,31,32,31,31,30,30,29,30,30,30],2086:[17,31,32,31,32,31,30,30,30,29,30,30,30],2087:[16,31,31,32,31,31,31,30,30,29,30,30,30],2088:[16,30,31,32,32,30,31,30,30,29,30,30,30],2089:[17,31,32,31,32,31,30,30,30,29,30,30,30],2090:[17,31,32,31,32,31,30,30,30,29,30,30,30],2091:[16,31,31,32,31,31,31,30,30,29,30,30,30],2092:[16,31,31,32,32,31,30,30,30,29,30,30,30],2093:[17,31,32,31,32,31,30,30,30,29,30,30,30],2094:[17,31,31,32,31,31,30,30,30,29,30,30,30],2095:[17,31,31,32,31,31,31,30,29,30,30,30,30],2096:[17,30,31,32,32,31,30,30,29,30,29,30,30],2097:[17,31,32,31,32,31,30,30,30,29,30,30,30],2098:[17,31,31,32,31,31,31,29,30,29,30,30,31],2099:[17,31,31,32,31,31,31,30,29,29,30,30,30],2100:[17,31,32,31,32,30,31,30,29,30,29,30,30]}}),e.calendars.nepali=r}}),vT=p({"node_modules/world-calendars/dist/calendars/persian.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}function n(e,t){return e-t*Math.floor(e/t)}r.prototype=new e.baseCalendar,t(r.prototype,{name:"Persian",jdEpoch:1948320.5,daysPerMonth:[31,31,31,31,31,31,30,30,30,30,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Persian",epochs:["BP","AP"],monthNames:["Farvardin","Ordibehesht","Khordad","Tir","Mordad","Shahrivar","Mehr","Aban","Azar","Day","Bahman","Esfand"],monthNamesShort:["Far","Ord","Kho","Tir","Mor","Sha","Meh","Aba","Aza","Day","Bah","Esf"],dayNames:["Yekshambe","Doshambe","Seshambe","Ch\xe6harshambe","Panjshambe","Jom'e","Shambe"],dayNamesShort:["Yek","Do","Se","Ch\xe6","Panj","Jom","Sha"],dayNamesMin:["Ye","Do","Se","Ch","Pa","Jo","Sh"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return 682*((r.year()-(r.year()>0?474:473))%2820+474+38)%2816<682},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-(n.dayOfWeek()+1)%7,"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(12===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate);t=a.year(),r=a.month(),i=a.day();var o=t-(t>=0?474:473),s=474+n(o,2820);return i+(r<=7?31*(r-1):30*(r-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(e){var t=(e=Math.floor(e)+.5)-this.toJD(475,1,1),r=Math.floor(t/1029983),i=n(t,1029983),a=2820;if(1029982!==i){var o=Math.floor(i/366),s=n(i,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=e-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=e-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),e.calendars.persian=r,e.calendars.jalali=r}}),xT=p({"node_modules/world-calendars/dist/calendars/taiwan.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Taiwan",jdEpoch:2419402.5,yearsOffset:1911,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Taiwan",epochs:["BROC","ROC"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},leapYear:function(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,t.month(),t.day())},_t2gYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)},_g2tYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)}}),e.calendars.taiwan=n}}),bT=p({"node_modules/world-calendars/dist/calendars/thai.js"(){var e=oT(),t=uy(),r=e.instance();function n(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}n.prototype=new e.baseCalendar,t(n.prototype,{name:"Thai",jdEpoch:1523098.5,yearsOffset:543,daysPerMonth:[31,28,31,30,31,30,31,31,30,31,30,31],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Thai",epochs:["BBE","BE"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var n=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(n.year()),r.leapYear(t)},weekOfYear:function(t,n,i){var a=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return t=this._t2gYear(a.year()),r.weekOfYear(t,a.month(),a.day())},daysInMonth:function(t,r){var n=this._validate(t,r,this.minDay,e.local.invalidMonth);return this.daysPerMonth[n.month()-1]+(2===n.month()&&this.leapYear(n.year())?1:0)},weekDay:function(e,t,r){return(this.dayOfWeek(e,t,r)||7)<6},toJD:function(t,n,i){var a=this._validate(t,n,i,e.local.invalidDate);return t=this._t2gYear(a.year()),r.toJD(t,a.month(),a.day())},fromJD:function(e){var t=r.fromJD(e),n=this._g2tYear(t.year());return this.newDate(n,t.month(),t.day())},_t2gYear:function(e){return e-this.yearsOffset-(e>=1&&e<=this.yearsOffset?1:0)},_g2tYear:function(e){return e+this.yearsOffset+(e>=-this.yearsOffset&&e<=-1?1:0)}}),e.calendars.thai=n}}),_T=p({"node_modules/world-calendars/dist/calendars/ummalqura.js"(){var e=oT(),t=uy();function r(e){this.local=this.regionalOptions[e||""]||this.regionalOptions[""]}r.prototype=new e.baseCalendar,t(r.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var r=this._validate(t,this.minMonth,this.minDay,e.local.invalidYear);return 355===this.daysInYear(r.year())},weekOfYear:function(e,t,r){var n=this.newDate(e,t,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/7)+1},daysInYear:function(e){for(var t=0,r=1;r<=12;r++)t+=this.daysInMonth(e,r);return t},daysInMonth:function(t,r){for(var i=this._validate(t,r,this.minDay,e.local.invalidMonth).toJD()-24e5+.5,a=0,o=0;o<n.length;o++){if(n[o]>i)return n[a]-n[a-1];a++}return 30},weekDay:function(e,t,r){return 5!==this.dayOfWeek(e,t,r)},toJD:function(t,r,i){var a=this._validate(t,r,i,e.local.invalidDate),o=12*(a.year()-1)+a.month()-15292;return a.day()+n[o-1]-1+24e5-.5},fromJD:function(e){for(var t=e-24e5+.5,r=0,i=0;i<n.length&&!(n[i]>t);i++)r++;var a=r+15292,o=Math.floor((a-1)/12),s=o+1,l=a-12*o,c=t-n[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,r,n){var i=e.baseCalendar.prototype.isValid.apply(this,arguments);return i&&(i=(t=null!=t.year?t.year:t)>=1276&&t<=1500),i},_validate:function(t,r,n,i){var a=e.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw i.replace(/\{0\}/,this.local.name);return a}}),e.calendars.ummalqura=r;var n=[20,50,79,109,138,168,197,227,256,286,315,345,374,404,433,463,492,522,551,581,611,641,670,700,729,759,788,818,847,877,906,936,965,995,1024,1054,1083,1113,1142,1172,1201,1231,1260,1290,1320,1350,1379,1409,1438,1468,1497,1527,1556,1586,1615,1645,1674,1704,1733,1763,1792,1822,1851,1881,1910,1940,1969,1999,2028,2058,2087,2117,2146,2176,2205,2235,2264,2294,2323,2353,2383,2413,2442,2472,2501,2531,2560,2590,2619,2649,2678,2708,2737,2767,2796,2826,2855,2885,2914,2944,2973,3003,3032,3062,3091,3121,3150,3180,3209,3239,3268,3298,3327,3357,3386,3416,3446,3476,3505,3535,3564,3594,3623,3653,3682,3712,3741,3771,3800,3830,3859,3889,3918,3948,3977,4007,4036,4066,4095,4125,4155,4185,4214,4244,4273,4303,4332,4362,4391,4421,4450,4480,4509,4539,4568,4598,4627,4657,4686,4716,4745,4775,4804,4834,4863,4893,4922,4952,4981,5011,5040,5070,5099,5129,5158,5188,5218,5248,5277,5307,5336,5366,5395,5425,5454,5484,5513,5543,5572,5602,5631,5661,5690,5720,5749,5779,5808,5838,5867,5897,5926,5956,5985,6015,6044,6074,6103,6133,6162,6192,6221,6251,6281,6311,6340,6370,6399,6429,6458,6488,6517,6547,6576,6606,6635,6665,6694,6724,6753,6783,6812,6842,6871,6901,6930,6960,6989,7019,7048,7078,7107,7137,7166,7196,7225,7255,7284,7314,7344,7374,7403,7433,7462,7492,7521,7551,7580,7610,7639,7669,7698,7728,7757,7787,7816,7846,7875,7905,7934,7964,7993,8023,8053,8083,8112,8142,8171,8201,8230,8260,8289,8319,8348,8378,8407,8437,8466,8496,8525,8555,8584,8614,8643,8673,8702,8732,8761,8791,8821,8850,8880,8909,8938,8968,8997,9027,9056,9086,9115,9145,9175,9205,9234,9264,9293,9322,9352,9381,9410,9440,9470,9499,9529,9559,9589,9618,9648,9677,9706,9736,9765,9794,9824,9853,9883,9913,9943,9972,10002,10032,10061,10090,10120,10149,10178,10208,10237,10267,10297,10326,10356,10386,10415,10445,10474,10504,10533,10562,10592,10621,10651,10680,10710,10740,10770,10799,10829,10858,10888,10917,10947,10976,11005,11035,11064,11094,11124,11153,11183,11213,11242,11272,11301,11331,11360,11389,11419,11448,11478,11507,11537,11567,11596,11626,11655,11685,11715,11744,11774,11803,11832,11862,11891,11921,11950,11980,12010,12039,12069,12099,12128,12158,12187,12216,12246,12275,12304,12334,12364,12393,12423,12453,12483,12512,12542,12571,12600,12630,12659,12688,12718,12747,12777,12807,12837,12866,12896,12926,12955,12984,13014,13043,13072,13102,13131,13161,13191,13220,13250,13280,13310,13339,13368,13398,13427,13456,13486,13515,13545,13574,13604,13634,13664,13693,13723,13752,13782,13811,13840,13870,13899,13929,13958,13988,14018,14047,14077,14107,14136,14166,14195,14224,14254,14283,14313,14342,14372,14401,14431,14461,14490,14520,14550,14579,14609,14638,14667,14697,14726,14756,14785,14815,14844,14874,14904,14933,14963,14993,15021,15051,15081,15110,15140,15169,15199,15228,15258,15287,15317,15347,15377,15406,15436,15465,15494,15524,15553,15582,15612,15641,15671,15701,15731,15760,15790,15820,15849,15878,15908,15937,15966,15996,16025,16055,16085,16114,16144,16174,16204,16233,16262,16292,16321,16350,16380,16409,16439,16468,16498,16528,16558,16587,16617,16646,16676,16705,16734,16764,16793,16823,16852,16882,16912,16941,16971,17001,17030,17060,17089,17118,17148,17177,17207,17236,17266,17295,17325,17355,17384,17414,17444,17473,17502,17532,17561,17591,17620,17650,17679,17709,17738,17768,17798,17827,17857,17886,17916,17945,17975,18004,18034,18063,18093,18122,18152,18181,18211,18241,18270,18300,18330,18359,18388,18418,18447,18476,18506,18535,18565,18595,18625,18654,18684,18714,18743,18772,18802,18831,18860,18890,18919,18949,18979,19008,19038,19068,19098,19127,19156,19186,19215,19244,19274,19303,19333,19362,19392,19422,19452,19481,19511,19540,19570,19599,19628,19658,19687,19717,19746,19776,19806,19836,19865,19895,19924,19954,19983,20012,20042,20071,20101,20130,20160,20190,20219,20249,20279,20308,20338,20367,20396,20426,20455,20485,20514,20544,20573,20603,20633,20662,20692,20721,20751,20780,20810,20839,20869,20898,20928,20957,20987,21016,21046,21076,21105,21135,21164,21194,21223,21253,21282,21312,21341,21371,21400,21430,21459,21489,21519,21548,21578,21607,21637,21666,21696,21725,21754,21784,21813,21843,21873,21902,21932,21962,21991,22021,22050,22080,22109,22138,22168,22197,22227,22256,22286,22316,22346,22375,22405,22434,22464,22493,22522,22552,22581,22611,22640,22670,22700,22730,22759,22789,22818,22848,22877,22906,22936,22965,22994,23024,23054,23083,23113,23143,23173,23202,23232,23261,23290,23320,23349,23379,23408,23438,23467,23497,23527,23556,23586,23616,23645,23674,23704,23733,23763,23792,23822,23851,23881,23910,23940,23970,23999,24029,24058,24088,24117,24147,24176,24206,24235,24265,24294,24324,24353,24383,24413,24442,24472,24501,24531,24560,24590,24619,24648,24678,24707,24737,24767,24796,24826,24856,24885,24915,24944,24974,25003,25032,25062,25091,25121,25150,25180,25210,25240,25269,25299,25328,25358,25387,25416,25446,25475,25505,25534,25564,25594,25624,25653,25683,25712,25742,25771,25800,25830,25859,25888,25918,25948,25977,26007,26037,26067,26096,26126,26155,26184,26214,26243,26272,26302,26332,26361,26391,26421,26451,26480,26510,26539,26568,26598,26627,26656,26686,26715,26745,26775,26805,26834,26864,26893,26923,26952,26982,27011,27041,27070,27099,27129,27159,27188,27218,27248,27277,27307,27336,27366,27395,27425,27454,27484,27513,27542,27572,27602,27631,27661,27691,27720,27750,27779,27809,27838,27868,27897,27926,27956,27985,28015,28045,28074,28104,28134,28163,28193,28222,28252,28281,28310,28340,28369,28399,28428,28458,28488,28517,28547,28577,28607,28636,28665,28695,28724,28754,28783,28813,28843,28872,28901,28931,28960,28990,29019,29049,29078,29108,29137,29167,29196,29226,29255,29285,29315,29345,29375,29404,29434,29463,29492,29522,29551,29580,29610,29640,29669,29699,29729,29759,29788,29818,29847,29876,29906,29935,29964,29994,30023,30053,30082,30112,30141,30171,30200,30230,30259,30289,30318,30348,30378,30408,30437,30467,30496,30526,30555,30585,30614,30644,30673,30703,30732,30762,30791,30821,30850,30880,30909,30939,30968,30998,31027,31057,31086,31116,31145,31175,31204,31234,31263,31293,31322,31352,31381,31411,31441,31471,31500,31530,31559,31589,31618,31648,31676,31706,31736,31766,31795,31825,31854,31884,31913,31943,31972,32002,32031,32061,32090,32120,32150,32180,32209,32239,32268,32298,32327,32357,32386,32416,32445,32475,32504,32534,32563,32593,32622,32652,32681,32711,32740,32770,32799,32829,32858,32888,32917,32947,32976,33006,33035,33065,33094,33124,33153,33183,33213,33243,33272,33302,33331,33361,33390,33420,33450,33479,33509,33539,33568,33598,33627,33657,33686,33716,33745,33775,33804,33834,33863,33893,33922,33952,33981,34011,34040,34069,34099,34128,34158,34187,34217,34247,34277,34306,34336,34365,34395,34424,34454,34483,34512,34542,34571,34601,34631,34660,34690,34719,34749,34778,34808,34837,34867,34896,34926,34955,34985,35015,35044,35074,35103,35133,35162,35192,35222,35251,35280,35310,35340,35370,35399,35429,35458,35488,35517,35547,35576,35605,35635,35665,35694,35723,35753,35782,35811,35841,35871,35901,35930,35960,35989,36019,36048,36078,36107,36136,36166,36195,36225,36254,36284,36314,36343,36373,36403,36433,36462,36492,36521,36551,36580,36610,36639,36669,36698,36728,36757,36786,36816,36845,36875,36904,36934,36963,36993,37022,37052,37081,37111,37141,37170,37200,37229,37259,37288,37318,37347,37377,37406,37436,37465,37495,37524,37554,37584,37613,37643,37672,37701,37731,37760,37790,37819,37849,37878,37908,37938,37967,37997,38027,38056,38085,38115,38144,38174,38203,38233,38262,38292,38322,38351,38381,38410,38440,38469,38499,38528,38558,38587,38617,38646,38676,38705,38735,38764,38794,38823,38853,38882,38912,38941,38971,39001,39030,39059,39089,39118,39148,39178,39208,39237,39267,39297,39326,39355,39385,39414,39444,39473,39503,39532,39562,39592,39621,39650,39680,39709,39739,39768,39798,39827,39857,39886,39916,39946,39975,40005,40035,40064,40094,40123,40153,40182,40212,40241,40271,40300,40330,40359,40389,40418,40448,40477,40507,40536,40566,40595,40625,40655,40685,40714,40744,40773,40803,40832,40862,40892,40921,40951,40980,41009,41039,41068,41098,41127,41157,41186,41216,41245,41275,41304,41334,41364,41393,41422,41452,41481,41511,41540,41570,41599,41629,41658,41688,41718,41748,41777,41807,41836,41865,41894,41924,41953,41983,42012,42042,42072,42102,42131,42161,42190,42220,42249,42279,42308,42337,42367,42397,42426,42456,42485,42515,42545,42574,42604,42633,42662,42692,42721,42751,42780,42810,42839,42869,42899,42929,42958,42988,43017,43046,43076,43105,43135,43164,43194,43223,43253,43283,43312,43342,43371,43401,43430,43460,43489,43519,43548,43578,43607,43637,43666,43696,43726,43755,43785,43814,43844,43873,43903,43932,43962,43991,44021,44050,44080,44109,44139,44169,44198,44228,44258,44287,44317,44346,44375,44405,44434,44464,44493,44523,44553,44582,44612,44641,44671,44700,44730,44759,44788,44818,44847,44877,44906,44936,44966,44996,45025,45055,45084,45114,45143,45172,45202,45231,45261,45290,45320,45350,45380,45409,45439,45468,45498,45527,45556,45586,45615,45644,45674,45704,45733,45763,45793,45823,45852,45882,45911,45940,45970,45999,46028,46058,46088,46117,46147,46177,46206,46236,46265,46295,46324,46354,46383,46413,46442,46472,46501,46531,46560,46590,46620,46649,46679,46708,46738,46767,46797,46826,46856,46885,46915,46944,46974,47003,47033,47063,47092,47122,47151,47181,47210,47240,47269,47298,47328,47357,47387,47417,47446,47476,47506,47535,47565,47594,47624,47653,47682,47712,47741,47771,47800,47830,47860,47890,47919,47949,47978,48008,48037,48066,48096,48125,48155,48184,48214,48244,48273,48303,48333,48362,48392,48421,48450,48480,48509,48538,48568,48598,48627,48657,48687,48717,48746,48776,48805,48834,48864,48893,48922,48952,48982,49011,49041,49071,49100,49130,49160,49189,49218,49248,49277,49306,49336,49365,49395,49425,49455,49484,49514,49543,49573,49602,49632,49661,49690,49720,49749,49779,49809,49838,49868,49898,49927,49957,49986,50016,50045,50075,50104,50133,50163,50192,50222,50252,50281,50311,50340,50370,50400,50429,50459,50488,50518,50547,50576,50606,50635,50665,50694,50724,50754,50784,50813,50843,50872,50902,50931,50960,50990,51019,51049,51078,51108,51138,51167,51197,51227,51256,51286,51315,51345,51374,51403,51433,51462,51492,51522,51552,51582,51611,51641,51670,51699,51729,51758,51787,51816,51846,51876,51906,51936,51965,51995,52025,52054,52083,52113,52142,52171,52200,52230,52260,52290,52319,52349,52379,52408,52438,52467,52497,52526,52555,52585,52614,52644,52673,52703,52733,52762,52792,52822,52851,52881,52910,52939,52969,52998,53028,53057,53087,53116,53146,53176,53205,53235,53264,53294,53324,53353,53383,53412,53441,53471,53500,53530,53559,53589,53619,53648,53678,53708,53737,53767,53796,53825,53855,53884,53913,53943,53973,54003,54032,54062,54092,54121,54151,54180,54209,54239,54268,54297,54327,54357,54387,54416,54446,54476,54505,54535,54564,54593,54623,54652,54681,54711,54741,54770,54800,54830,54859,54889,54919,54948,54977,55007,55036,55066,55095,55125,55154,55184,55213,55243,55273,55302,55332,55361,55391,55420,55450,55479,55508,55538,55567,55597,55627,55657,55686,55716,55745,55775,55804,55834,55863,55892,55922,55951,55981,56011,56040,56070,56100,56129,56159,56188,56218,56247,56276,56306,56335,56365,56394,56424,56454,56483,56513,56543,56572,56601,56631,56660,56690,56719,56749,56778,56808,56837,56867,56897,56926,56956,56985,57015,57044,57074,57103,57133,57162,57192,57221,57251,57280,57310,57340,57369,57399,57429,57458,57487,57517,57546,57576,57605,57634,57664,57694,57723,57753,57783,57813,57842,57871,57901,57930,57959,57989,58018,58048,58077,58107,58137,58167,58196,58226,58255,58285,58314,58343,58373,58402,58432,58461,58491,58521,58551,58580,58610,58639,58669,58698,58727,58757,58786,58816,58845,58875,58905,58934,58964,58994,59023,59053,59082,59111,59141,59170,59200,59229,59259,59288,59318,59348,59377,59407,59436,59466,59495,59525,59554,59584,59613,59643,59672,59702,59731,59761,59791,59820,59850,59879,59909,59939,59968,59997,60027,60056,60086,60115,60145,60174,60204,60234,60264,60293,60323,60352,60381,60411,60440,60469,60499,60528,60558,60588,60618,60648,60677,60707,60736,60765,60795,60824,60853,60883,60912,60942,60972,61002,61031,61061,61090,61120,61149,61179,61208,61237,61267,61296,61326,61356,61385,61415,61445,61474,61504,61533,61563,61592,61621,61651,61680,61710,61739,61769,61799,61828,61858,61888,61917,61947,61976,62006,62035,62064,62094,62123,62153,62182,62212,62242,62271,62301,62331,62360,62390,62419,62448,62478,62507,62537,62566,62596,62625,62655,62685,62715,62744,62774,62803,62832,62862,62891,62921,62950,62980,63009,63039,63069,63099,63128,63157,63187,63216,63246,63275,63305,63334,63363,63393,63423,63453,63482,63512,63541,63571,63600,63630,63659,63689,63718,63747,63777,63807,63836,63866,63895,63925,63955,63984,64014,64043,64073,64102,64131,64161,64190,64220,64249,64279,64309,64339,64368,64398,64427,64457,64486,64515,64545,64574,64603,64633,64663,64692,64722,64752,64782,64811,64841,64870,64899,64929,64958,64987,65017,65047,65076,65106,65136,65166,65195,65225,65254,65283,65313,65342,65371,65401,65431,65460,65490,65520,65549,65579,65608,65638,65667,65697,65726,65755,65785,65815,65844,65874,65903,65933,65963,65992,66022,66051,66081,66110,66140,66169,66199,66228,66258,66287,66317,66346,66376,66405,66435,66465,66494,66524,66553,66583,66612,66641,66671,66700,66730,66760,66789,66819,66849,66878,66908,66937,66967,66996,67025,67055,67084,67114,67143,67173,67203,67233,67262,67292,67321,67351,67380,67409,67439,67468,67497,67527,67557,67587,67617,67646,67676,67705,67735,67764,67793,67823,67852,67882,67911,67941,67971,68e3,68030,68060,68089,68119,68148,68177,68207,68236,68266,68295,68325,68354,68384,68414,68443,68473,68502,68532,68561,68591,68620,68650,68679,68708,68738,68768,68797,68827,68857,68886,68916,68946,68975,69004,69034,69063,69092,69122,69152,69181,69211,69240,69270,69300,69330,69359,69388,69418,69447,69476,69506,69535,69565,69595,69624,69654,69684,69713,69743,69772,69802,69831,69861,69890,69919,69949,69978,70008,70038,70067,70097,70126,70156,70186,70215,70245,70274,70303,70333,70362,70392,70421,70451,70481,70510,70540,70570,70599,70629,70658,70687,70717,70746,70776,70805,70835,70864,70894,70924,70954,70983,71013,71042,71071,71101,71130,71159,71189,71218,71248,71278,71308,71337,71367,71397,71426,71455,71485,71514,71543,71573,71602,71632,71662,71691,71721,71751,71781,71810,71839,71869,71898,71927,71957,71986,72016,72046,72075,72105,72135,72164,72194,72223,72253,72282,72311,72341,72370,72400,72429,72459,72489,72518,72548,72577,72607,72637,72666,72695,72725,72754,72784,72813,72843,72872,72902,72931,72961,72991,73020,73050,73080,73109,73139,73168,73197,73227,73256,73286,73315,73345,73375,73404,73434,73464,73493,73523,73552,73581,73611,73640,73669,73699,73729,73758,73788,73818,73848,73877,73907,73936,73965,73995,74024,74053,74083,74113,74142,74172,74202,74231,74261,74291,74320,74349,74379,74408,74437,74467,74497,74526,74556,74586,74615,74645,74675,74704,74733,74763,74792,74822,74851,74881,74910,74940,74969,74999,75029,75058,75088,75117,75147,75176,75206,75235,75264,75294,75323,75353,75383,75412,75442,75472,75501,75531,75560,75590,75619,75648,75678,75707,75737,75766,75796,75826,75856,75885,75915,75944,75974,76003,76032,76062,76091,76121,76150,76180,76210,76239,76269,76299,76328,76358,76387,76416,76446,76475,76505,76534,76564,76593,76623,76653,76682,76712,76741,76771,76801,76830,76859,76889,76918,76948,76977,77007,77036,77066,77096,77125,77155,77185,77214,77243,77273,77302,77332,77361,77390,77420,77450,77479,77509,77539,77569,77598,77627,77657,77686,77715,77745,77774,77804,77833,77863,77893,77923,77952,77982,78011,78041,78070,78099,78129,78158,78188,78217,78247,78277,78307,78336,78366,78395,78425,78454,78483,78513,78542,78572,78601,78631,78661,78690,78720,78750,78779,78808,78838,78867,78897,78926,78956,78985,79015,79044,79074,79104,79133,79163,79192,79222,79251,79281,79310,79340,79369,79399,79428,79458,79487,79517,79546,79576,79606,79635,79665,79695,79724,79753,79783,79812,79841,79871,79900,79930,79960,79990]}}),wT=p({"src/components/calendars/calendars.js"(e,t){t.exports=oT(),sT(),lT(),cT(),uT(),hT(),pT(),dT(),fT(),mT(),gT(),yT(),vT(),xT(),bT(),_T()}}),kT=p({"src/components/calendars/index.js"(e,t){var r=wT(),n=st(),i=T(),a=i.EPOCHJD,o=i.ONEDAY,s={valType:"enumerated",values:n.sortObjectKeys(r.calendars),editType:"calc",dflt:"gregorian"},l=function(e,t,r,i){var a={};return a[r]=s,n.coerce(e,t,a,r,i)},c="##",u={d:{0:"dd","-":"d"},e:{0:"d","-":"d"},a:{0:"D","-":"D"},A:{0:"DD","-":"DD"},j:{0:"oo","-":"o"},W:{0:"ww","-":"w"},m:{0:"mm","-":"m"},b:{0:"M","-":"M"},B:{0:"MM","-":"MM"},y:{0:"yy","-":"yy"},Y:{0:"yyyy","-":"yyyy"},U:c,w:c,c:{0:"D M d %X yyyy","-":"D M d %X yyyy"},x:{0:"mm/dd/yyyy","-":"mm/dd/yyyy"}},h={};function p(e){var t=h[e];return t||(t=h[e]=r.instance(e))}function d(e){return n.extendFlat({},s,{description:e})}function f(e){return"Sets the calendar system to use with `"+e+"` date data."}var m={xcalendar:d(f("x"))},g=n.extendFlat({},m,{ycalendar:d(f("y"))}),y=n.extendFlat({},g,{zcalendar:d(f("z"))}),v=d(["Sets the calendar system to use for `range` and `tick0`","if this is a date axis. This does not set the calendar for","interpreting data on this axis, that's specified in the trace","or via the global `layout.calendar`"].join(" "));t.exports={moduleType:"component",name:"calendars",schema:{traces:{scatter:g,bar:g,box:g,heatmap:g,contour:g,histogram:g,histogram2d:g,histogram2dcontour:g,scatter3d:y,surface:y,mesh3d:y,scattergl:g,ohlc:m,candlestick:m},layout:{calendar:d(["Sets the default calendar system to use for interpreting and","displaying dates throughout the plot."].join(" "))},subplots:{xaxis:{calendar:v},yaxis:{calendar:v},scene:{xaxis:{calendar:v},yaxis:{calendar:v},zaxis:{calendar:v}},polar:{radialaxis:{calendar:v}}}},layoutAttributes:s,handleDefaults:l,handleTraceDefaults:function(e,t,r,n){for(var i=0;i<r.length;i++)l(e,t,r[i]+"calendar",n.calendar)},CANONICAL_SUNDAY:{chinese:"2000-01-02",coptic:"2000-01-03",discworld:"2000-01-03",ethiopian:"2000-01-05",hebrew:"5000-01-01",islamic:"1000-01-02",julian:"2000-01-03",mayan:"5000-01-01",nanakshahi:"1000-01-05",nepali:"2000-01-05",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-04",thai:"2000-01-04",ummalqura:"1400-01-06"},CANONICAL_TICK:{chinese:"2000-01-01",coptic:"2000-01-01",discworld:"2000-01-01",ethiopian:"2000-01-01",hebrew:"5000-01-01",islamic:"1000-01-01",julian:"2000-01-01",mayan:"5000-01-01",nanakshahi:"1000-01-01",nepali:"2000-01-01",persian:"1000-01-01",jalali:"1000-01-01",taiwan:"1000-01-01",thai:"2000-01-01",ummalqura:"1400-01-01"},DFLTRANGE:{chinese:["2000-01-01","2001-01-01"],coptic:["1700-01-01","1701-01-01"],discworld:["1800-01-01","1801-01-01"],ethiopian:["2000-01-01","2001-01-01"],hebrew:["5700-01-01","5701-01-01"],islamic:["1400-01-01","1401-01-01"],julian:["2000-01-01","2001-01-01"],mayan:["5200-01-01","5201-01-01"],nanakshahi:["0500-01-01","0501-01-01"],nepali:["2000-01-01","2001-01-01"],persian:["1400-01-01","1401-01-01"],jalali:["1400-01-01","1401-01-01"],taiwan:["0100-01-01","0101-01-01"],thai:["2500-01-01","2501-01-01"],ummalqura:["1400-01-01","1401-01-01"]},getCal:p,worldCalFmt:function(e,t,r){for(var n,i,s,l,h,d=Math.floor((t+.05)/o)+a,f=p(r).fromJD(d),m=0;-1!==(m=e.indexOf("%",m));)"0"===(n=e.charAt(m+1))||"-"===n||"_"===n?(s=3,i=e.charAt(m+2),"_"===n&&(n="-")):(i=n,n="0",s=2),(l=u[i])?(h=l===c?c:f.formatDate(l[n]),e=e.substr(0,m)+h+e.substr(m+s),m+=h.length):m+=s;return e}}}}),TT=p({"lib/calendars.js"(e,t){t.exports=kT()}}),ST=p({"lib/index.js"(e,t){var r=Va();r.register([ao(),xo(),Ho(),Qo(),as(),Cs(),zs(),$s(),al(),bl(),Ol(),Cu(),Nu(),Wd(),uf(),wf(),If(),cm(),mm(),Tm(),Cm(),Om(),Nm(),Gm(),_g(),Lg(),dx(),Lx(),eb(),lb(),Mb(),zb(),Vb(),c_(),m_(),T_(),G_(),Q_(),cw(),Rw(),Gw(),Jw(),lk(),dk(),Ck(),Fk(),$k(),aT(),TT()]),t.exports=r}});return ST()})();return window.Plotly=e,e},e.exports?e.exports=r():t.moduleName=r()},173:(e,t,r)=>{e.exports=r(497)()},191:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler");Symbol.for("react.provider");var s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),f=Symbol.for("react.view_transition"),m=Symbol.for("react.client.reference");function g(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case i:case o:case a:case u:case h:case f:return e;default:switch(e=e&&e.$$typeof){case l:case c:case d:case p:case s:return e;default:return t}}case n:return t}}}t.Hy=function(e){return"string"===typeof e||"function"===typeof e||e===i||e===o||e===a||e===u||e===h||"object"===typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===l||e.$$typeof===s||e.$$typeof===c||e.$$typeof===m||void 0!==e.getModuleId)}},218:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},219:(e,t,r)=>{"use strict";var n=r(763),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return n.isMemo(e)?o:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,f=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(f){var i=d(r);i&&i!==f&&e(t,i,n)}var o=u(r);h&&(o=o.concat(h(r)));for(var s=l(t),m=l(r),g=0;g<o.length;++g){var y=o[g];if(!a[y]&&(!n||!n[y])&&(!m||!m[y])&&(!s||!s[y])){var v=p(r,y);try{c(t,y,v)}catch(x){}}}}return t}},288:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.iterator;var f={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,g={};function y(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||f}function v(){}function x(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||f}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=y.prototype;var b=x.prototype=new v;b.constructor=x,m(b,y.prototype),b.isPureReactComponent=!0;var _=Array.isArray,w={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function T(e,t,n,i,a,o){return n=o.ref,{$$typeof:r,type:e,key:t,ref:void 0!==n?n:null,props:o}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var A=/\/+/g;function M(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function E(){}function C(e,t,i,a,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l,c,u=!1;if(null===e)u=!0;else switch(s){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case r:case n:u=!0;break;case p:return C((u=e._init)(e._payload),t,i,a,o)}}if(u)return o=o(e),u=""===a?"."+M(e,0):a,_(o)?(i="",null!=u&&(i=u.replace(A,"$&/")+"/"),C(o,t,i,"",(function(e){return e}))):null!=o&&(S(o)&&(l=o,c=i+(null==o.key||e&&e.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+u,o=T(l.type,c,void 0,0,0,l.props)),t.push(o)),1;u=0;var h,f=""===a?".":a+":";if(_(e))for(var m=0;m<e.length;m++)u+=C(a=e[m],t,i,s=f+M(a,m),o);else if("function"===typeof(m=null===(h=e)||"object"!==typeof h?null:"function"===typeof(h=d&&h[d]||h["@@iterator"])?h:null))for(e=m.call(e),m=0;!(a=e.next()).done;)u+=C(a=a.value,t,i,s=f+M(a,m++),o);else if("object"===s){if("function"===typeof e.then)return C(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(E,E):(e.status="pending",e.then((function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)}),(function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)}))),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,i,a,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return u}function P(e,t,r){if(null==e)return e;var n=[],i=0;return C(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function L(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var I="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function z(){}t.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=o,t.PureComponent=x,t.StrictMode=a,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,t.act=function(){throw Error("act(...) is not supported in production builds of React.")},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cloneElement=function(e,t,r){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var n=m({},e.props),i=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(i=""+t.key),t)!k.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(n[a]=t[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];n.children=o}return T(e.type,i,void 0,0,0,n)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:s,_context:e},e},t.createElement=function(e,t,r){var n,i={},a=null;if(null!=t)for(n in void 0!==t.key&&(a=""+t.key),t)k.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(i[n]=t[n]);var o=arguments.length-2;if(1===o)i.children=r;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];i.children=s}if(e&&e.defaultProps)for(n in o=e.defaultProps)void 0===i[n]&&(i[n]=o[n]);return T(e,a,void 0,0,0,i)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:p,_payload:{_status:-1,_result:e},_init:L}},t.memo=function(e,t){return{$$typeof:h,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=w.T,r={};w.T=r;try{var n=e(),i=w.S;null!==i&&i(r,n),"object"===typeof n&&null!==n&&"function"===typeof n.then&&n.then(z,I)}catch(a){I(a)}finally{w.T=t}},t.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},t.use=function(e){return w.H.use(e)},t.useActionState=function(e,t,r){return w.H.useActionState(e,t,r)},t.useCallback=function(e,t){return w.H.useCallback(e,t)},t.useContext=function(e){return w.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},t.useEffect=function(e,t){return w.H.useEffect(e,t)},t.useId=function(){return w.H.useId()},t.useImperativeHandle=function(e,t,r){return w.H.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return w.H.useMemo(e,t)},t.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},t.useReducer=function(e,t,r){return w.H.useReducer(e,t,r)},t.useRef=function(e){return w.H.useRef(e)},t.useState=function(e){return w.H.useState(e)},t.useSyncExternalStore=function(e,t,r){return w.H.useSyncExternalStore(e,t,r)},t.useTransition=function(){return w.H.useTransition()},t.version="19.0.0"},391:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(4)},408:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)},i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return a(t,e),t},s=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r};Object.defineProperty(t,"__esModule",{value:!0});var l=o(r(43)),c=r(880),u=r(744),h=[1,3,5],p=[(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(-").concat(h[2],"rem) scale(0.5)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-0"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(-").concat(h[1],"rem) scale(0.6)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-1"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(-".concat(h[0],"rem) scale(0.75)}\n 75% {transform: translateX(-").concat(h[0],"rem) scale(0.75)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-2"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 75% {transform: translateX(").concat(h[0],"rem) scale(0.75)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-3"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-4"),(0,u.createAnimation)("PropagateLoader","25% {transform: translateX(".concat(h[0],"rem) scale(0.75)}\n 50% {transform: translateX(").concat(h[1],"rem) scale(0.6)}\n 75% {transform: translateX(").concat(h[2],"rem) scale(0.5)}\n 95% {transform: translateX(0rem) scale(1)}"),"propogate-5")];t.default=function(e){var t=e.loading,r=void 0===t||t,i=e.color,a=void 0===i?"#000000":i,o=e.speedMultiplier,u=void 0===o?1:o,h=e.cssOverride,d=void 0===h?{}:h,f=e.size,m=void 0===f?15:f,g=s(e,["loading","color","speedMultiplier","cssOverride","size"]),y=(0,c.parseLengthAndUnit)(m),v=y.value,x=y.unit,b=n({display:"inherit",position:"relative"},d),_=function(e){return{position:"absolute",fontSize:"".concat(v/3).concat(x),width:"".concat(v).concat(x),height:"".concat(v).concat(x),background:a,borderRadius:"50%",animation:"".concat(p[e]," ").concat(1.5/u,"s infinite"),animationFillMode:"forwards"}};return r?l.createElement("span",n({style:b},g),l.createElement("span",{style:_(0)}),l.createElement("span",{style:_(1)}),l.createElement("span",{style:_(2)}),l.createElement("span",{style:_(3)}),l.createElement("span",{style:_(4)}),l.createElement("span",{style:_(5)})):null}},497:(e,t,r)=>{"use strict";var n=r(218);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},537:(e,t,r)=>{"use strict";t.A=void 0;var n=a(r(805)),i=a(r(96));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)(i.default);t.A=o},579:(e,t,r)=>{"use strict";e.exports=r(799)},672:(e,t,r)=>{"use strict";var n=r(43);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var o={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},s=Symbol.for("react.portal");var l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,t.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(i(299));return function(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}(e,t,null,r)},t.flushSync=function(e){var t=l.T,r=o.p;try{if(l.T=null,o.p=2,e)return e()}finally{l.T=t,o.p=r,o.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,o.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&o.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var r=t.as,n=c(r,t.crossOrigin),i="string"===typeof t.integrity?t.integrity:void 0,a="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===r?o.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:n,integrity:i,fetchPriority:a}):"script"===r&&o.d.X(e,{crossOrigin:n,integrity:i,fetchPriority:a,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var r=c(t.as,t.crossOrigin);o.d.M(e,{crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&o.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var r=t.as,n=c(r,t.crossOrigin);o.d.L(e,r,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var r=c(t.as,t.crossOrigin);o.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else o.d.m(e)},t.requestFormReset=function(e){o.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,r){return l.H.useFormState(e,t,r)},t.useFormStatus=function(){return l.H.useHostTransitionStatus()},t.version="19.0.0"},744:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAnimation=void 0;t.createAnimation=function(e,t,r){var n="react-spinners-".concat(e,"-").concat(r);if("undefined"==typeof window||!window.document)return n;var i=document.createElement("style");document.head.appendChild(i);var a=i.sheet,o="\n @keyframes ".concat(n," {\n ").concat(t,"\n }\n ");return a&&a.insertRule(o,0),n}},763:(e,t,r)=>{"use strict";e.exports=r(983)},799:(e,t)=>{"use strict";var r=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(e,t,n){var i=null;if(void 0!==n&&(i=""+n),void 0!==t.key&&(i=""+t.key),"key"in t)for(var a in n={},t)"key"!==a&&(n[a]=t[a]);else n=t;return t=n.ref,{$$typeof:r,type:e,key:i,ref:void 0!==t?t:null,props:n}}t.Fragment=n,t.jsx=i,t.jsxs=i},805:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=function(t){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}(i,t);var r=function(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=h(e);if(t){var a=h(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}(this,r)}}(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=r.call(this,e)).p=Promise.resolve(),t.resizeHandler=null,t.handlers={},t.syncWindowResize=t.syncWindowResize.bind(u(t)),t.syncEventHandlers=t.syncEventHandlers.bind(u(t)),t.attachUpdateEvents=t.attachUpdateEvents.bind(u(t)),t.getRef=t.getRef.bind(u(t)),t.handleUpdate=t.handleUpdate.bind(u(t)),t.figureCallback=t.figureCallback.bind(u(t)),t.updatePlotly=t.updatePlotly.bind(u(t)),t}return function(e,t,r){t&&l(e.prototype,t);r&&l(e,r);Object.defineProperty(e,"prototype",{writable:!1})}(i,[{key:"updatePlotly",value:function(t,r,n){var i=this;this.p=this.p.then((function(){if(!i.unmounting){if(!i.el)throw new Error("Missing element reference");return e.react(i.el,{data:i.props.data,layout:i.props.layout,config:i.props.config,frames:i.props.frames})}})).then((function(){i.unmounting||(i.syncWindowResize(t),i.syncEventHandlers(),i.figureCallback(r),n&&i.attachUpdateEvents())})).catch((function(e){i.props.onError&&i.props.onError(e)}))}},{key:"componentDidMount",value:function(){this.unmounting=!1,this.updatePlotly(!0,this.props.onInitialized,!0)}},{key:"componentDidUpdate",value:function(e){this.unmounting=!1;var t=e.frames&&e.frames.length?e.frames.length:0,r=this.props.frames&&this.props.frames.length?this.props.frames.length:0,n=!(e.layout===this.props.layout&&e.data===this.props.data&&e.config===this.props.config&&r===t),i=void 0!==e.revision,a=e.revision!==this.props.revision;(n||i&&(!i||a))&&this.updatePlotly(!1,this.props.onUpdate,!1)}},{key:"componentWillUnmount",value:function(){this.unmounting=!0,this.figureCallback(this.props.onPurge),this.resizeHandler&&f&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.removeUpdateEvents(),e.purge(this.el)}},{key:"attachUpdateEvents",value:function(){var e=this;this.el&&this.el.removeListener&&d.forEach((function(t){e.el.on(t,e.handleUpdate)}))}},{key:"removeUpdateEvents",value:function(){var e=this;this.el&&this.el.removeListener&&d.forEach((function(t){e.el.removeListener(t,e.handleUpdate)}))}},{key:"handleUpdate",value:function(){this.figureCallback(this.props.onUpdate)}},{key:"figureCallback",value:function(e){if("function"===typeof e){var t=this.el;e({data:t.data,layout:t.layout,frames:this.el._transitionData?this.el._transitionData._frames:null},this.el)}}},{key:"syncWindowResize",value:function(t){var r=this;f&&(this.props.useResizeHandler&&!this.resizeHandler?(this.resizeHandler=function(){return e.Plots.resize(r.el)},window.addEventListener("resize",this.resizeHandler),t&&this.resizeHandler()):!this.props.useResizeHandler&&this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null))}},{key:"getRef",value:function(e){this.el=e,this.props.debug&&f&&(window.gd=this.el)}},{key:"syncEventHandlers",value:function(){var e=this;p.forEach((function(t){var r=e.props["on"+t],n=e.handlers[t],i=Boolean(n);r&&!i?e.addEventHandler(t,r):!r&&i?e.removeEventHandler(t):r&&i&&r!==n&&(e.removeEventHandler(t),e.addEventHandler(t,r))}))}},{key:"addEventHandler",value:function(e,t){this.handlers[e]=t,this.el.on(this.getPlotlyEventName(e),this.handlers[e])}},{key:"removeEventHandler",value:function(e){this.el.removeListener(this.getPlotlyEventName(e),this.handlers[e]),delete this.handlers[e]}},{key:"getPlotlyEventName",value:function(e){return"plotly_"+e.toLowerCase()}},{key:"render",value:function(){return a.default.createElement("div",{id:this.props.divId,style:this.props.style,ref:this.getRef,className:this.props.className})}}]),i}(a.Component);return t.propTypes={data:o.default.arrayOf(o.default.object),config:o.default.object,layout:o.default.object,frames:o.default.arrayOf(o.default.object),revision:o.default.number,onInitialized:o.default.func,onPurge:o.default.func,onError:o.default.func,onUpdate:o.default.func,debug:o.default.bool,style:o.default.object,className:o.default.string,useResizeHandler:o.default.bool,divId:o.default.string},p.forEach((function(e){t.propTypes["on"+e]=o.default.func})),t.defaultProps={debug:!1,useResizeHandler:!1,data:[],style:{position:"relative",display:"inline-block"}},t};var i,a=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!==typeof e)return{default:e};var r=s(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(i,o,l):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(43)),o=(i=r(173))&&i.__esModule?i:{default:i};function s(e){if("function"!==typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(s=function(e){return e?r:t})(e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var p=["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"],d=["plotly_restyle","plotly_redraw","plotly_relayout","plotly_relayouting","plotly_doubleclick","plotly_animated","plotly_sunburstclick"],f="undefined"!==typeof window},853:(e,t,r)=>{"use strict";e.exports=r(896)},880:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseLengthAndUnit=n,t.cssValue=function(e){var t=n(e);return"".concat(t.value).concat(t.unit)};var r={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function n(e){if("number"===typeof e)return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();t=n.includes(".")?parseFloat(n):parseInt(n,10);var i=(e.match(/[^0-9]*$/)||"").toString();return r[i]?{value:t,unit:i}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}},896:(e,t)=>{"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<a(i,t)))break e;e[n]=t,e[r]=i,r=n}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,o=i>>>1;n<o;){var s=2*(n+1)-1,l=e[s],c=s+1,u=e[c];if(0>a(l,r))c<i&&0>a(u,l)?(e[n]=u,e[c]=r,n=c):(e[n]=l,e[s]=r,n=s);else{if(!(c<i&&0>a(u,r)))break e;e[n]=u,e[c]=r,n=c}}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var s=Date,l=s.now();t.unstable_now=function(){return s.now()-l}}var c=[],u=[],h=1,p=null,d=3,f=!1,m=!1,g=!1,y="function"===typeof setTimeout?setTimeout:null,v="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function b(e){for(var t=n(u);null!==t;){if(null===t.callback)i(u);else{if(!(t.startTime<=e))break;i(u),t.sortIndex=t.expirationTime,r(c,t)}t=n(u)}}function _(e){if(g=!1,b(e),!m)if(null!==n(c))m=!0,L();else{var t=n(u);null!==t&&I(_,t.startTime-e)}}var w,k=!1,T=-1,S=5,A=-1;function M(){return!(t.unstable_now()-A<S)}function E(){if(k){var e=t.unstable_now();A=e;var r=!0;try{e:{m=!1,g&&(g=!1,v(T),T=-1),f=!0;var a=d;try{t:{for(b(e),p=n(c);null!==p&&!(p.expirationTime>e&&M());){var o=p.callback;if("function"===typeof o){p.callback=null,d=p.priorityLevel;var s=o(p.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof s){p.callback=s,b(e),r=!0;break t}p===n(c)&&i(c),b(e)}else i(c);p=n(c)}if(null!==p)r=!0;else{var l=n(u);null!==l&&I(_,l.startTime-e),r=!1}}break e}finally{p=null,d=a,f=!1}r=void 0}}finally{r?w():k=!1}}}if("function"===typeof x)w=function(){x(E)};else if("undefined"!==typeof MessageChannel){var C=new MessageChannel,P=C.port2;C.port1.onmessage=E,w=function(){P.postMessage(null)}}else w=function(){y(E,0)};function L(){k||(k=!0,w())}function I(e,r){T=y((function(){e(t.unstable_now())}),r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){m||f||(m=!0,L())},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var r=d;d=t;try{return e()}finally{d=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=d;d=e;try{return t()}finally{d=r}},t.unstable_scheduleCallback=function(e,i,a){var o=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?o+a:o:a=o,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:h++,callback:i,priorityLevel:e,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(e.sortIndex=a,r(u,e),null===n(c)&&e===n(u)&&(g?(v(T),T=-1):g=!0,I(_,a-o))):(e.sortIndex=s,r(c,e),m||f||(m=!0,L())),e},t.unstable_shouldYield=M,t.unstable_wrapCallback=function(e){var t=d;return function(){var r=d;d=t;try{return e.apply(this,arguments)}finally{d=r}}}},950:(e,t,r)=>{"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(672)},983:(e,t)=>{"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,f=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,x=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function _(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case u:case h:case a:case s:case o:case d:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case l:return e;default:return t}}case i:return t}}}function w(e){return _(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=n,t.ForwardRef=p,t.Fragment=a,t.Lazy=g,t.Memo=m,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=d,t.isAsyncMode=function(e){return w(e)||_(e)===u},t.isConcurrentMode=w,t.isContextConsumer=function(e){return _(e)===c},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===p},t.isFragment=function(e){return _(e)===a},t.isLazy=function(e){return _(e)===g},t.isMemo=function(e){return _(e)===m},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===s},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===d},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===a||e===h||e===s||e===o||e===d||e===f||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===x||e.$$typeof===b||e.$$typeof===y)},t.typeOf=_}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.m=e,r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(n,i){if(1&i&&(n=this(n)),8&i)return n;if("object"===typeof n&&n){if(4&i&&n.__esModule)return n;if(16&i&&"function"===typeof n.then)return n}var a=Object.create(null);r.r(a);var o={};e=e||[null,t({}),t([]),t(t)];for(var s=2&i&&n;"object"==typeof s&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach((e=>o[e]=()=>n[e]));return o.default=()=>n,r.d(a,o),a}})(),r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+e+".ec6f47ad.chunk.js",r.miniCssF=e=>{},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="backstory:";r.l=(n,i,a,o)=>{if(e[n])e[n].push(i);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var h=c[u];if(h.getAttribute("src")==n||h.getAttribute("data-webpack")==t+a){s=h;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,r.nc&&s.setAttribute("nonce",r.nc),s.setAttribute("data-webpack",t+a),s.src=n),e[n]=[i];var p=(t,r)=>{s.onerror=s.onload=null,clearTimeout(d);var i=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(r))),t)return t(r)},d=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}}})(),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.p="/",(()=>{var e={792:0};r.f.j=(t,n)=>{var i=r.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else{var a=new Promise(((r,n)=>i=e[t]=[r,n]));n.push(i[2]=a);var o=r.p+r.u(t),s=new Error;r.l(o,(n=>{if(r.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var a=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+a+": "+o+")",s.name="ChunkLoadError",s.type=a,s.request=o,i[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var i,a,o=n[0],s=n[1],l=n[2],c=0;if(o.some((t=>0!==e[t]))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(l)l(r)}for(t&&t(n);c<o.length;c++)a=o[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0},n=self.webpackChunkbackstory=self.webpackChunkbackstory||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=r(43),t=r.t(e,2),n=r(391);const i=e.createContext(null);function a(){return e.useContext(i)}const o="function"===typeof Symbol&&Symbol.for?Symbol.for("mui.nested"):"__THEME_NESTED__";var s=r(579);const l=function(t){const{children:r,theme:n}=t,l=a(),c=e.useMemo((()=>{const e=null===l?{...n}:function(e,t){if("function"===typeof t)return t(e);return{...e,...t}}(l,n);return null!=e&&(e[o]=null!==l),e}),[n,l]);return(0,s.jsx)(i.Provider,{value:c,children:r})};var c=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(hy){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)})),this.tags=[],this.ctr=0},e}(),u=Math.abs,h=String.fromCharCode,p=Object.assign;function d(e){return e.trim()}function f(e,t,r){return e.replace(t,r)}function m(e,t){return e.indexOf(t)}function g(e,t){return 0|e.charCodeAt(t)}function y(e,t,r){return e.slice(t,r)}function v(e){return e.length}function x(e){return e.length}function b(e,t){return t.push(e),e}var _=1,w=1,k=0,T=0,S=0,A="";function M(e,t,r,n,i,a,o){return{value:e,root:t,parent:r,type:n,props:i,children:a,line:_,column:w,length:o,return:""}}function E(e,t){return p(M("",null,null,"",null,null,0),e,{length:-e.length},t)}function C(){return S=T<k?g(A,T++):0,w++,10===S&&(w=1,_++),S}function P(){return g(A,T)}function L(){return T}function I(e,t){return y(A,e,t)}function z(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function O(e){return _=w=1,k=v(A=e),T=0,[]}function R(e){return A="",e}function D(e){return d(I(T-1,B(91===e?e+2:40===e?e+1:e)))}function j(e){for(;(S=P())&&S<33;)C();return z(e)>2||z(S)>3?"":" "}function F(e,t){for(;--t&&C()&&!(S<48||S>102||S>57&&S<65||S>70&&S<97););return I(e,L()+(t<6&&32==P()&&32==C()))}function B(e){for(;C();)switch(S){case e:return T;case 34:case 39:34!==e&&39!==e&&B(S);break;case 40:41===e&&B(e);break;case 92:C()}return T}function N(e,t){for(;C()&&e+S!==57&&(e+S!==84||47!==P()););return"/*"+I(t,T-1)+"*"+h(47===e?e:C())}function U(e){for(;!z(P());)C();return I(e,T)}var V="-ms-",q="-moz-",H="-webkit-",G="comm",W="rule",$="decl",Z="@keyframes";function X(e,t){for(var r="",n=x(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Y(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case $:return e.return=e.return||e.value;case G:return"";case Z:return e.return=e.value+"{"+X(e.children,n)+"}";case W:e.value=e.props.join(",")}return v(r=X(e.children,n))?e.return=e.value+"{"+r+"}":""}function K(e){return R(J("",null,null,null,[""],e=O(e),0,[0],e))}function J(e,t,r,n,i,a,o,s,l){for(var c=0,u=0,p=o,d=0,y=0,x=0,k=1,M=1,E=1,I=0,z="",O=i,R=a,B=n,V=z;M;)switch(x=I,I=C()){case 40:if(108!=x&&58==g(V,p-1)){-1!=m(V+=f(D(I),"&","&\f"),"&\f")&&(E=-1);break}case 34:case 39:case 91:V+=D(I);break;case 9:case 10:case 13:case 32:V+=j(x);break;case 92:V+=F(L()-1,7);continue;case 47:switch(P()){case 42:case 47:b(ee(N(C(),L()),t,r),l);break;default:V+="/"}break;case 123*k:s[c++]=v(V)*E;case 125*k:case 59:case 0:switch(I){case 0:case 125:M=0;case 59+u:-1==E&&(V=f(V,/\f/g,"")),y>0&&v(V)-p&&b(y>32?te(V+";",n,r,p-1):te(f(V," ","")+";",n,r,p-2),l);break;case 59:V+=";";default:if(b(B=Q(V,t,r,c,u,i,s,z,O=[],R=[],p),a),123===I)if(0===u)J(V,t,B,B,O,a,p,s,R);else switch(99===d&&110===g(V,3)?100:d){case 100:case 108:case 109:case 115:J(e,B,B,n&&b(Q(e,B,B,0,0,i,s,z,i,O=[],p),R),i,R,p,s,n?O:R);break;default:J(V,B,B,B,[""],R,0,s,R)}}c=u=y=0,k=E=1,z=V="",p=o;break;case 58:p=1+v(V),y=x;default:if(k<1)if(123==I)--k;else if(125==I&&0==k++&&125==(S=T>0?g(A,--T):0,w--,10===S&&(w=1,_--),S))continue;switch(V+=h(I),I*k){case 38:E=u>0?1:(V+="\f",-1);break;case 44:s[c++]=(v(V)-1)*E,E=1;break;case 64:45===P()&&(V+=D(C())),d=P(),u=p=v(z=V+=U(L())),I++;break;case 45:45===x&&2==v(V)&&(k=0)}}return a}function Q(e,t,r,n,i,a,o,s,l,c,h){for(var p=i-1,m=0===i?a:[""],g=x(m),v=0,b=0,_=0;v<n;++v)for(var w=0,k=y(e,p+1,p=u(b=o[v])),T=e;w<g;++w)(T=d(b>0?m[w]+" "+k:f(k,/&\f/g,m[w])))&&(l[_++]=T);return M(e,t,r,0===i?W:s,l,c,h)}function ee(e,t,r){return M(e,t,r,G,h(S),y(e,2,-2),0)}function te(e,t,r,n){return M(e,t,r,$,y(e,0,n),y(e,n+1,-1),n)}var re=function(e,t,r){for(var n=0,i=0;n=i,i=P(),38===n&&12===i&&(t[r]=1),!z(i);)C();return I(e,T)},ne=function(e,t){return R(function(e,t){var r=-1,n=44;do{switch(z(n)){case 0:38===n&&12===P()&&(t[r]=1),e[r]+=re(T-1,t,r);break;case 2:e[r]+=D(n);break;case 4:if(44===n){e[++r]=58===P()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=h(n)}}while(n=C());return e}(O(e),t))},ie=new WeakMap,ae=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ie.get(r))&&!n){ie.set(e,!0);for(var i=[],a=ne(t,i),o=r.props,s=0,l=0;s<a.length;s++)for(var c=0;c<o.length;c++,l++)e.props[l]=i[s]?a[s].replace(/&\f/g,o[c]):o[c]+" "+a[s]}}},oe=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function se(e,t){switch(function(e,t){return 45^g(e,0)?(((t<<2^g(e,0))<<2^g(e,1))<<2^g(e,2))<<2^g(e,3):0}(e,t)){case 5103:return H+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return H+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+q+e+V+e+e;case 6828:case 4268:return H+e+V+e+e;case 6165:return H+e+V+"flex-"+e+e;case 5187:return H+e+f(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+V+"flex-$1$2")+e;case 5443:return H+e+V+"flex-item-"+f(e,/flex-|-self/,"")+e;case 4675:return H+e+V+"flex-line-pack"+f(e,/align-content|flex-|-self/,"")+e;case 5548:return H+e+V+f(e,"shrink","negative")+e;case 5292:return H+e+V+f(e,"basis","preferred-size")+e;case 6060:return H+"box-"+f(e,"-grow","")+H+e+V+f(e,"grow","positive")+e;case 4554:return H+f(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return f(f(f(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return f(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return f(f(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+V+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H+e+e;case 4095:case 3583:case 4068:case 2532:return f(e,/(.+)-inline(.+)/,H+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(v(e)-1-t>6)switch(g(e,t+1)){case 109:if(45!==g(e,t+4))break;case 102:return f(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+q+(108==g(e,t+3)?"$3":"$2-$3"))+e;case 115:return~m(e,"stretch")?se(f(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==g(e,t+1))break;case 6444:switch(g(e,v(e)-3-(~m(e,"!important")&&10))){case 107:return f(e,":",":"+H)+e;case 101:return f(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(45===g(e,14)?"inline-":"")+"box$3$1"+H+"$2$3$1"+V+"$2box$3")+e}break;case 5936:switch(g(e,t+11)){case 114:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+V+f(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H+e+V+e+e}return e}var le=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case $:e.return=se(e.value,e.length);break;case Z:return X([E(e,{value:f(e.value,"@","@"+H)})],n);case W:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return X([E(e,{props:[f(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return X([E(e,{props:[f(t,/:(plac\w+)/,":"+H+"input-$1")]}),E(e,{props:[f(t,/:(plac\w+)/,":-moz-$1")]}),E(e,{props:[f(t,/:(plac\w+)/,V+"input-$1")]})],n)}return""}))}}],ce=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n,i,a=e.stylisPlugins||le,o={},s=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)o[t[r]]=!0;s.push(e)}));var l,u,h=[Y,(u=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&u(e)})],p=function(e){var t=x(e);return function(r,n,i,a){for(var o="",s=0;s<t;s++)o+=e[s](r,n,i,a)||"";return o}}([ae,oe].concat(a,h));i=function(e,t,r,n){l=r,X(K(e?e+"{"+t.styles+"}":t.styles),p),n&&(d.inserted[t.name]=!0)};var d={key:t,sheet:new c({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:i};return d.sheet.hydrate(s),d};function ue(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")})),n}var he=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},pe=function(e,t,r){he(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}};var de={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function fe(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}var me=/[A-Z]|^ms/g,ge=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ye=function(e){return 45===e.charCodeAt(1)},ve=function(e){return null!=e&&"boolean"!==typeof e},xe=fe((function(e){return ye(e)?e:e.replace(me,"-$&").toLowerCase()})),be=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(ge,(function(e,t,r){return we={name:t,styles:r,next:we},t}))}return 1===de[e]||ye(e)||"number"!==typeof t||0===t?t:t+"px"};function _e(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var i=r;if(1===i.anim)return we={name:i.name,styles:i.styles,next:we},i.name;var a=r;if(void 0!==a.styles){var o=a.next;if(void 0!==o)for(;void 0!==o;)we={name:o.name,styles:o.styles,next:we},o=o.next;return a.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=_e(e,t,r[i])+";";else for(var a in r){var o=r[a];if("object"!==typeof o){var s=o;null!=t&&void 0!==t[s]?n+=a+"{"+t[s]+"}":ve(s)&&(n+=xe(a)+":"+be(a,s)+";")}else if(!Array.isArray(o)||"string"!==typeof o[0]||null!=t&&void 0!==t[o[0]]){var l=_e(e,t,o);switch(a){case"animation":case"animationName":n+=xe(a)+":"+l+";";break;default:n+=a+"{"+l+"}"}}else for(var c=0;c<o.length;c++)ve(o[c])&&(n+=xe(a)+":"+be(a,o[c])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=we,l=r(e);return we=s,_e(e,t,l)}}var c=r;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var we,ke=/label:\s*([^\s;{]+)\s*(;|$)/g;function Te(e,t,r){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";we=void 0;var a=e[0];null==a||void 0===a.raw?(n=!1,i+=_e(r,t,a)):i+=a[0];for(var o=1;o<e.length;o++){if(i+=_e(r,t,e[o]),n)i+=a[o]}ke.lastIndex=0;for(var s,l="";null!==(s=ke.exec(i));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+l;return{name:c,styles:i,next:we}}var Se=!!t.useInsertionEffect&&t.useInsertionEffect,Ae=Se||function(e){return e()},Me=Se||e.useLayoutEffect,Ee=e.createContext("undefined"!==typeof HTMLElement?ce({key:"css"}):null),Ce=(Ee.Provider,function(t){return(0,e.forwardRef)((function(r,n){var i=(0,e.useContext)(Ee);return t(r,i,n)}))}),Pe=e.createContext({});var Le={}.hasOwnProperty,Ie="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",ze=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return he(t,r,n),Ae((function(){return pe(t,r,n)})),null},Oe=Ce((function(t,r,n){var i=t.css;"string"===typeof i&&void 0!==r.registered[i]&&(i=r.registered[i]);var a=t[Ie],o=[i],s="";"string"===typeof t.className?s=ue(r.registered,o,t.className):null!=t.className&&(s=t.className+" ");var l=Te(o,void 0,e.useContext(Pe));s+=r.key+"-"+l.name;var c={};for(var u in t)Le.call(t,u)&&"css"!==u&&u!==Ie&&(c[u]=t[u]);return c.className=s,n&&(c.ref=n),e.createElement(e.Fragment,null,e.createElement(ze,{cache:r,serialized:l,isStringTag:"string"===typeof a}),e.createElement(a,c))}));const Re=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const r=e.useContext(Pe);return r&&(n=r,0!==Object.keys(n).length)?r:t;var n},De=e.createContext();const je=()=>e.useContext(De)??!1,Fe=function(e){let{value:t,...r}=e;return(0,s.jsx)(De.Provider,{value:t??!0,...r})};function Be(e,t){const r={...t};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const i=n;if("components"===i||"slots"===i)r[i]={...e[i],...r[i]};else if("componentsProps"===i||"slotProps"===i){const n=e[i],a=t[i];if(a)if(n){r[i]={...a};for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const t=e;r[i][t]=Be(n[t],a[t])}}else r[i]=a;else r[i]=n||{}}else void 0===r[i]&&(r[i]=e[i])}return r}const Ne=e.createContext(void 0);function Ue(t){let{props:r,name:n}=t;return function(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const i=t.components[r];return i.defaultProps?Be(i.defaultProps,n):i.styleOverrides||i.variants?n:Be(i,n)}({props:r,name:n,theme:{components:e.useContext(Ne)}})}const Ve=function(e){let{value:t,children:r}=e;return(0,s.jsx)(Ne.Provider,{value:t,children:r})},qe={};function He(t,r,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.useMemo((()=>{const e=t&&r[t]||r;if("function"===typeof n){const a=n(e),o=t?{...r,[t]:a}:a;return i?()=>o:o}return t?{...r,[t]:n}:{...r,...n}}),[t,r,n,i])}const Ge=function(e){const{children:t,theme:r,themeId:n}=e,i=Re(qe),o=a()||qe,c=He(n,i,r),u=He(n,o,r,!0),h="rtl"===(n?c[n]:c).direction;return(0,s.jsx)(l,{theme:u,children:(0,s.jsx)(Pe.Provider,{value:c,children:(0,s.jsx)(Fe,{value:h,children:(0,s.jsx)(Ve,{value:n?c[n].components:c.components,children:t})})})})},We="$$material";function $e(e){let{theme:t,...r}=e;const n=We in t?t[We]:void 0;return(0,s.jsx)(Ge,{...r,themeId:n?We:void 0,theme:n||t})}function Ze(e){const t=new URL(`https://mui.com/production-error/?code=${e}`);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return n.forEach((e=>t.searchParams.append("args[]",e))),`Minified MUI error #${e}; visit ${t} for the full message.`}function Xe(e){if("string"!==typeof e)throw new Error(Ze(7));return e.charAt(0).toUpperCase()+e.slice(1)}var Ye=r(191);function Ke(e){if("object"!==typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Je(t){if(e.isValidElement(t)||(0,Ye.Hy)(t)||!Ke(t))return t;const r={};return Object.keys(t).forEach((e=>{r[e]=Je(t[e])})),r}function Qe(t,r){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0};const i=n.clone?{...t}:t;return Ke(t)&&Ke(r)&&Object.keys(r).forEach((a=>{e.isValidElement(r[a])||(0,Ye.Hy)(r[a])?i[a]=r[a]:Ke(r[a])&&Object.prototype.hasOwnProperty.call(t,a)&&Ke(t[a])?i[a]=Qe(t[a],r[a],n):n.clone?i[a]=Ke(r[a])?Je(r[a]):r[a]:i[a]=r[a]})),i}const et=function(e,t){return t?Qe(e,t,{clone:!1}):e};const tt={xs:0,sm:600,md:900,lg:1200,xl:1536},rt={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${tt[e]}px)`},nt={containerQueries:e=>({up:t=>{let r="number"===typeof t?t:tt[t]||t;return"number"===typeof r&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function it(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const e=n.breakpoints||rt;return t.reduce(((n,i,a)=>(n[e.up(e.keys[a])]=r(t[a]),n)),{})}if("object"===typeof t){const e=n.breakpoints||rt;return Object.keys(t).reduce(((i,a)=>{if(o=e.keys,"@"===(s=a)||s.startsWith("@")&&(o.some((e=>s.startsWith(`@${e}`)))||s.match(/^@\d/))){const e=function(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,i]=r,a=Number.isNaN(+n)?n||0:+n;return e.containerQueries(i).up(a)}(n.containerQueries?n:nt,a);e&&(i[e]=r(t[a],a))}else if(Object.keys(e.values||tt).includes(a)){i[e.up(a)]=r(t[a],a)}else{const e=a;i[e]=t[e]}var o,s;return i}),{})}return r(t)}function at(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.keys?.reduce(((t,r)=>(t[e.up(r)]={},t)),{});return t||{}}function ot(e,t){return e.reduce(((e,t)=>{const r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function st(e){let{values:t,breakpoints:r,base:n}=e;const i=n||function(e,t){if("object"!==typeof e)return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach(((t,n)=>{n<e.length&&(r[t]=!0)})):n.forEach((t=>{null!=e[t]&&(r[t]=!0)})),r}(t,r),a=Object.keys(i);if(0===a.length)return t;let o;return a.reduce(((e,r,n)=>(Array.isArray(t)?(e[r]=null!=t[n]?t[n]:t[o],o=n):"object"===typeof t?(e[r]=null!=t[r]?t[r]:t[o],o=r):e[r]=t,e)),{})}function lt(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){const r=`vars.${t}`.split(".").reduce(((e,t)=>e&&e[t]?e[t]:null),e);if(null!=r)return r}return t.split(".").reduce(((e,t)=>e&&null!=e[t]?e[t]:null),e)}function ct(e,t,r){let n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||i:lt(e,r)||i,t&&(n=t(n,i,e)),n}const ut=function(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:i}=e,a=e=>{if(null==e[t])return null;const a=e[t],o=lt(e.theme,n)||{};return it(e,a,(e=>{let n=ct(o,i,e);return e===n&&"string"===typeof e&&(n=ct(o,i,`${t}${"default"===e?"":Xe(e)}`,e)),!1===r?n:{[r]:n}}))};return a.propTypes={},a.filterProps=[t],a};const ht={m:"margin",p:"padding"},pt={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},dt={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},ft=function(e){const t={};return r=>(void 0===t[r]&&(t[r]=e(r)),t[r])}((e=>{if(e.length>2){if(!dt[e])return[e];e=dt[e]}const[t,r]=e.split(""),n=ht[t],i=pt[r]||"";return Array.isArray(i)?i.map((e=>n+e)):[n+i]})),mt=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],gt=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],yt=[...mt,...gt];function vt(e,t,r,n){const i=lt(e,t,!0)??r;return"number"===typeof i||"string"===typeof i?e=>"string"===typeof e?e:"string"===typeof i?i.startsWith("var(")&&0===e?0:i.startsWith("var(")&&1===e?i:`calc(${e} * ${i})`:i*e:Array.isArray(i)?e=>{if("string"===typeof e)return e;const t=Math.abs(e);const r=i[t];return e>=0?r:"number"===typeof r?-r:"string"===typeof r&&r.startsWith("var(")?`calc(-1 * ${r})`:`-${r}`}:"function"===typeof i?i:()=>{}}function xt(e){return vt(e,"spacing",8)}function bt(e,t){return"string"===typeof t||null==t?t:e(t)}function _t(e,t,r,n){if(!t.includes(r))return null;const i=function(e,t){return r=>e.reduce(((e,n)=>(e[n]=bt(t,r),e)),{})}(ft(r),n);return it(e,e[r],i)}function wt(e,t){const r=xt(e.theme);return Object.keys(e).map((n=>_t(e,t,n,r))).reduce(et,{})}function kt(e){return wt(e,mt)}function Tt(e){return wt(e,gt)}function St(e){return wt(e,yt)}kt.propTypes={},kt.filterProps=mt,Tt.propTypes={},Tt.filterProps=gt,St.propTypes={},St.filterProps=yt;const At=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.reduce(((e,t)=>(t.filterProps.forEach((r=>{e[r]=t})),e)),{}),i=e=>Object.keys(e).reduce(((t,r)=>n[r]?et(t,n[r](e)):t),{});return i.propTypes={},i.filterProps=t.reduce(((e,t)=>e.concat(t.filterProps)),[]),i};function Mt(e){return"number"!==typeof e?e:`${e}px solid`}function Et(e,t){return ut({prop:e,themeKey:"borders",transform:t})}const Ct=Et("border",Mt),Pt=Et("borderTop",Mt),Lt=Et("borderRight",Mt),It=Et("borderBottom",Mt),zt=Et("borderLeft",Mt),Ot=Et("borderColor"),Rt=Et("borderTopColor"),Dt=Et("borderRightColor"),jt=Et("borderBottomColor"),Ft=Et("borderLeftColor"),Bt=Et("outline",Mt),Nt=Et("outlineColor"),Ut=e=>{if(void 0!==e.borderRadius&&null!==e.borderRadius){const t=vt(e.theme,"shape.borderRadius",4),r=e=>({borderRadius:bt(t,e)});return it(e,e.borderRadius,r)}return null};Ut.propTypes={},Ut.filterProps=["borderRadius"];At(Ct,Pt,Lt,It,zt,Ot,Rt,Dt,jt,Ft,Ut,Bt,Nt);const Vt=e=>{if(void 0!==e.gap&&null!==e.gap){const t=vt(e.theme,"spacing",8),r=e=>({gap:bt(t,e)});return it(e,e.gap,r)}return null};Vt.propTypes={},Vt.filterProps=["gap"];const qt=e=>{if(void 0!==e.columnGap&&null!==e.columnGap){const t=vt(e.theme,"spacing",8),r=e=>({columnGap:bt(t,e)});return it(e,e.columnGap,r)}return null};qt.propTypes={},qt.filterProps=["columnGap"];const Ht=e=>{if(void 0!==e.rowGap&&null!==e.rowGap){const t=vt(e.theme,"spacing",8),r=e=>({rowGap:bt(t,e)});return it(e,e.rowGap,r)}return null};Ht.propTypes={},Ht.filterProps=["rowGap"];At(Vt,qt,Ht,ut({prop:"gridColumn"}),ut({prop:"gridRow"}),ut({prop:"gridAutoFlow"}),ut({prop:"gridAutoColumns"}),ut({prop:"gridAutoRows"}),ut({prop:"gridTemplateColumns"}),ut({prop:"gridTemplateRows"}),ut({prop:"gridTemplateAreas"}),ut({prop:"gridArea"}));function Gt(e,t){return"grey"===t?t:e}At(ut({prop:"color",themeKey:"palette",transform:Gt}),ut({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Gt}),ut({prop:"backgroundColor",themeKey:"palette",transform:Gt}));function Wt(e){return e<=1&&0!==e?100*e+"%":e}const $t=ut({prop:"width",transform:Wt}),Zt=e=>{if(void 0!==e.maxWidth&&null!==e.maxWidth){const t=t=>{const r=e.theme?.breakpoints?.values?.[t]||tt[t];return r?"px"!==e.theme?.breakpoints?.unit?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Wt(t)}};return it(e,e.maxWidth,t)}return null};Zt.filterProps=["maxWidth"];const Xt=ut({prop:"minWidth",transform:Wt}),Yt=ut({prop:"height",transform:Wt}),Kt=ut({prop:"maxHeight",transform:Wt}),Jt=ut({prop:"minHeight",transform:Wt}),Qt=(ut({prop:"size",cssProperty:"width",transform:Wt}),ut({prop:"size",cssProperty:"height",transform:Wt}),At($t,Zt,Xt,Yt,Kt,Jt,ut({prop:"boxSizing"})),{border:{themeKey:"borders",transform:Mt},borderTop:{themeKey:"borders",transform:Mt},borderRight:{themeKey:"borders",transform:Mt},borderBottom:{themeKey:"borders",transform:Mt},borderLeft:{themeKey:"borders",transform:Mt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Mt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ut},color:{themeKey:"palette",transform:Gt},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Gt},backgroundColor:{themeKey:"palette",transform:Gt},p:{style:Tt},pt:{style:Tt},pr:{style:Tt},pb:{style:Tt},pl:{style:Tt},px:{style:Tt},py:{style:Tt},padding:{style:Tt},paddingTop:{style:Tt},paddingRight:{style:Tt},paddingBottom:{style:Tt},paddingLeft:{style:Tt},paddingX:{style:Tt},paddingY:{style:Tt},paddingInline:{style:Tt},paddingInlineStart:{style:Tt},paddingInlineEnd:{style:Tt},paddingBlock:{style:Tt},paddingBlockStart:{style:Tt},paddingBlockEnd:{style:Tt},m:{style:kt},mt:{style:kt},mr:{style:kt},mb:{style:kt},ml:{style:kt},mx:{style:kt},my:{style:kt},margin:{style:kt},marginTop:{style:kt},marginRight:{style:kt},marginBottom:{style:kt},marginLeft:{style:kt},marginX:{style:kt},marginY:{style:kt},marginInline:{style:kt},marginInlineStart:{style:kt},marginInlineEnd:{style:kt},marginBlock:{style:kt},marginBlockStart:{style:kt},marginBlockEnd:{style:kt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Vt},rowGap:{style:Ht},columnGap:{style:qt},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Wt},maxWidth:{style:Zt},minWidth:{transform:Wt},height:{transform:Wt},maxHeight:{transform:Wt},minHeight:{transform:Wt},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}});const er=function(){function e(e,t,r,n){const i={[e]:t,theme:r},a=n[e];if(!a)return{[e]:t};const{cssProperty:o=e,themeKey:s,transform:l,style:c}=a;if(null==t)return null;if("typography"===s&&"inherit"===t)return{[e]:t};const u=lt(r,s)||{};if(c)return c(i);return it(i,t,(t=>{let r=ct(u,l,t);return t===r&&"string"===typeof t&&(r=ct(u,l,`${e}${"default"===t?"":Xe(t)}`,t)),!1===o?r:{[o]:r}}))}return function t(r){const{sx:n,theme:i={}}=r||{};if(!n)return null;const a=i.unstable_sxConfig??Qt;function o(r){let n=r;if("function"===typeof r)n=r(i);else if("object"!==typeof r)return r;if(!n)return null;const o=at(i.breakpoints),s=Object.keys(o);let l=o;return Object.keys(n).forEach((r=>{const o=(s=n[r],c=i,"function"===typeof s?s(c):s);var s,c;if(null!==o&&void 0!==o)if("object"===typeof o)if(a[r])l=et(l,e(r,o,i,a));else{const e=it({theme:i},o,(e=>({[r]:e})));!function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.reduce(((e,t)=>e.concat(Object.keys(t))),[]),i=new Set(n);return t.every((e=>i.size===Object.keys(e).length))}(e,o)?l=et(l,e):l[r]=t({sx:o,theme:i})}else l=et(l,e(r,o,i,a))})),function(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter((e=>e.startsWith("@container"))).sort(((e,t)=>{const r=/min-width:\s*([0-9.]+)/;return+(e.match(r)?.[1]||0)-+(t.match(r)?.[1]||0)}));return r.length?r.reduce(((e,r)=>{const n=t[r];return delete e[r],e[r]=n,e}),{...t}):t}(i,ot(s,l))}return Array.isArray(n)?n.map(o):o(n)}}();er.filterProps=["sx"];const tr=er;r(219);var rr=function(t,r){var n=arguments;if(null==r||!Le.call(r,"css"))return e.createElement.apply(void 0,n);var i=n.length,a=new Array(i);a[0]=Oe,a[1]=function(e,t){var r={};for(var n in t)Le.call(t,n)&&(r[n]=t[n]);return r[Ie]=e,r}(t,r);for(var o=2;o<i;o++)a[o]=n[o];return e.createElement.apply(null,a)};!function(e){var t;t||(t=e.JSX||(e.JSX={}))}(rr||(rr={}));var nr=Ce((function(t,r){var n=Te([t.styles],void 0,e.useContext(Pe)),i=e.useRef();return Me((function(){var e=r.key+"-global",t=new r.sheet.constructor({key:e,nonce:r.sheet.nonce,container:r.sheet.container,speedy:r.sheet.isSpeedy}),a=!1,o=document.querySelector('style[data-emotion="'+e+" "+n.name+'"]');return r.sheet.tags.length&&(t.before=r.sheet.tags[0]),null!==o&&(a=!0,o.setAttribute("data-emotion",e),t.hydrate([o])),i.current=[t,a],function(){t.flush()}}),[r]),Me((function(){var e=i.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==n.next&&pe(r,n.next,!0),t.tags.length){var a=t.tags[t.tags.length-1].nextElementSibling;t.before=a,t.flush()}r.insert("",n,t,!1)}}),[r,n.name]),null}));function ir(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Te(t)}function ar(){var e=ir.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function or(e){const{styles:t,defaultTheme:r={}}=e,n="function"===typeof t?e=>{return t(void 0===(n=e)||null===n||0===Object.keys(n).length?r:e);var n}:t;return(0,s.jsx)(nr,{styles:n})}const sr="undefined"!==typeof window?e.useLayoutEffect:e.useEffect,lr="mode",cr="color-scheme",ur="data-color-scheme";function hr(){}const pr=e=>{let{key:t,storageWindow:r}=e;return r||"undefined"===typeof window||(r=window),{get(e){if("undefined"===typeof window)return;if(!r)return e;let n;try{n=r.localStorage.getItem(t)}catch{}return n||e},set:e=>{if(r)try{r.localStorage.setItem(t,e)}catch{}},subscribe:e=>{if(!r)return hr;const n=r=>{const n=r.newValue;r.key===t&&e(n)};return r.addEventListener("storage",n),()=>{r.removeEventListener("storage",n)}}}};function dr(){}function fr(e){if("undefined"!==typeof window&&"function"===typeof window.matchMedia&&"system"===e){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}}function mr(e,t){return"light"===e.mode||"system"===e.mode&&"light"===e.systemMode?t("light"):"dark"===e.mode||"system"===e.mode&&"dark"===e.systemMode?t("dark"):void 0}function gr(t){const{defaultMode:r="light",defaultLightColorScheme:n,defaultDarkColorScheme:i,supportedColorSchemes:a=[],modeStorageKey:o=lr,colorSchemeStorageKey:s=cr,storageWindow:l=("undefined"===typeof window?void 0:window),storageManager:c=pr,noSsr:u=!1}=t,h=a.join(","),p=a.length>1,d=e.useMemo((()=>c?.({key:o,storageWindow:l})),[c,o,l]),f=e.useMemo((()=>c?.({key:`${s}-light`,storageWindow:l})),[c,s,l]),m=e.useMemo((()=>c?.({key:`${s}-dark`,storageWindow:l})),[c,s,l]),[g,y]=e.useState((()=>{const e=d?.get(r)||r,t=f?.get(n)||n,a=m?.get(i)||i;return{mode:e,systemMode:fr(e),lightColorScheme:t,darkColorScheme:a}})),[v,x]=e.useState(u||!p);e.useEffect((()=>{x(!0)}),[]);const b=function(e){return mr(e,(t=>"light"===t?e.lightColorScheme:"dark"===t?e.darkColorScheme:void 0))}(g),_=e.useCallback((e=>{y((t=>{if(e===t.mode)return t;const n=e??r;return d?.set(n),{...t,mode:n,systemMode:fr(n)}}))}),[d,r]),w=e.useCallback((e=>{e?"string"===typeof e?e&&!h.includes(e)?console.error(`\`${e}\` does not exist in \`theme.colorSchemes\`.`):y((t=>{const r={...t};return mr(t,(t=>{"light"===t&&(f?.set(e),r.lightColorScheme=e),"dark"===t&&(m?.set(e),r.darkColorScheme=e)})),r})):y((t=>{const r={...t},a=null===e.light?n:e.light,o=null===e.dark?i:e.dark;return a&&(h.includes(a)?(r.lightColorScheme=a,f?.set(a)):console.error(`\`${a}\` does not exist in \`theme.colorSchemes\`.`)),o&&(h.includes(o)?(r.darkColorScheme=o,m?.set(o)):console.error(`\`${o}\` does not exist in \`theme.colorSchemes\`.`)),r})):y((e=>(f?.set(n),m?.set(i),{...e,lightColorScheme:n,darkColorScheme:i})))}),[h,f,m,n,i]),k=e.useCallback((e=>{"system"===g.mode&&y((t=>{const r=e?.matches?"dark":"light";return t.systemMode===r?t:{...t,systemMode:r}}))}),[g.mode]),T=e.useRef(k);return T.current=k,e.useEffect((()=>{if("function"!==typeof window.matchMedia||!p)return;const e=function(){return T.current(...arguments)},t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(e),e(t),()=>{t.removeListener(e)}}),[p]),e.useEffect((()=>{if(p){const e=d?.subscribe((e=>{e&&!["light","dark","system"].includes(e)||_(e||r)}))||dr,t=f?.subscribe((e=>{e&&!h.match(e)||w({light:e})}))||dr,n=m?.subscribe((e=>{e&&!h.match(e)||w({dark:e})}))||dr;return()=>{e(),t(),n()}}}),[w,_,h,r,l,p,d,f,m]),{...g,mode:v?g.mode:void 0,systemMode:v?g.systemMode:void 0,colorScheme:v?b:void 0,setMode:_,setColorScheme:w}}const yr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MIN_SAFE_INTEGER,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.MAX_SAFE_INTEGER;return Math.max(t,Math.min(e,r))};function vr(e){return yr(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:1)}function xr(e){if(e.type)return e;if("#"===e.charAt(0))return xr(function(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&1===r[0].length&&(r=r.map((e=>e+e))),r?`rgb${4===r.length?"a":""}(${r.map(((e,t)=>t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3)).join(", ")})`:""}(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(Ze(9,e));let n,i=e.substring(t+1,e.length-1);if("color"===r){if(i=i.split(" "),n=i.shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(n))throw new Error(Ze(10,n))}else i=i.split(",");return i=i.map((e=>parseFloat(e))),{type:r,values:i,colorSpace:n}}const br=(e,t)=>{try{return(e=>{const t=xr(e);return t.values.slice(0,3).map(((e,r)=>t.type.includes("hsl")&&0!==r?`${e}%`:e)).join(" ")})(e)}catch(r){return e}};function _r(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map(((e,t)=>t<3?parseInt(e,10):e)):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),n=t.includes("color")?`${r} ${n.join(" ")}`:`${n.join(", ")}`,`${t}(${n})`}function wr(e){e=xr(e);const{values:t}=e,r=t[0],n=t[1]/100,i=t[2]/100,a=n*Math.min(i,1-i),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-a*Math.max(Math.min(t-3,9-t,1),-1)};let s="rgb";const l=[Math.round(255*o(0)),Math.round(255*o(8)),Math.round(255*o(4))];return"hsla"===e.type&&(s+="a",l.push(t[3])),_r({type:s,values:l})}function kr(e){let t="hsl"===(e=xr(e)).type||"hsla"===e.type?xr(wr(e)).values:e.values;return t=t.map((t=>("color"!==e.type&&(t/=255),t<=.03928?t/12.92:((t+.055)/1.055)**2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Tr(e,t){return e=xr(e),t=vr(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]=`/${t}`:e.values[3]=t,_r(e)}function Sr(e,t,r){try{return Tr(e,t)}catch(n){return e}}function Ar(e,t){if(e=xr(e),t=vr(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return _r(e)}function Mr(e,t,r){try{return Ar(e,t)}catch(n){return e}}function Er(e,t){if(e=xr(e),t=vr(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return _r(e)}function Cr(e,t,r){try{return Er(e,t)}catch(n){return e}}function Pr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return kr(e)>.5?Ar(e,t):Er(e,t)}function Lr(e,t,r){try{return Pr(e,t)}catch(n){return e}}const Ir={black:"#000",white:"#fff"},zr={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Or={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Rr={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},Dr={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},jr={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Fr={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Br={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function Nr(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Ir.white,default:Ir.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const Ur=Nr();function Vr(){return{text:{primary:Ir.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Ir.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const qr=Vr();function Hr(e,t,r,n){const i=n.light||n,a=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=Er(e.main,i):"dark"===t&&(e.dark=Ar(e.main,a)))}function Gr(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,...i}=e,a=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:jr[200],light:jr[50],dark:jr[400]}:{main:jr[700],light:jr[400],dark:jr[800]}}(t),o=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Or[200],light:Or[50],dark:Or[400]}:{main:Or[500],light:Or[300],dark:Or[700]}}(t),s=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Rr[500],light:Rr[300],dark:Rr[700]}:{main:Rr[700],light:Rr[400],dark:Rr[800]}}(t),l=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Fr[400],light:Fr[300],dark:Fr[700]}:{main:Fr[700],light:Fr[500],dark:Fr[900]}}(t),c=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Br[400],light:Br[300],dark:Br[700]}:{main:Br[800],light:Br[500],dark:Br[900]}}(t),u=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:Dr[400],light:Dr[300],dark:Dr[700]}:{main:"#ed6c02",light:Dr[500],dark:Dr[900]}}(t);function h(e){const t=function(e,t){const r=kr(e),n=kr(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,qr.text.primary)>=r?qr.text.primary:Ur.text.primary;return t}const p=e=>{let{color:t,name:r,mainShade:i=500,lightShade:a=300,darkShade:o=700}=e;if(t={...t},!t.main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error(Ze(11,r?` (${r})`:"",i));if("string"!==typeof t.main)throw new Error(Ze(12,r?` (${r})`:"",JSON.stringify(t.main)));return Hr(t,"light",a,n),Hr(t,"dark",o,n),t.contrastText||(t.contrastText=h(t.main)),t};let d;"light"===t?d=Nr():"dark"===t&&(d=Vr());return Qe({common:{...Ir},mode:t,primary:p({color:a,name:"primary"}),secondary:p({color:o,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:s,name:"error"}),warning:p({color:u,name:"warning"}),info:p({color:l,name:"info"}),success:p({color:c,name:"success"}),grey:zr,contrastThreshold:r,getContrastText:h,augmentColor:p,tonalOffset:n,...d},i)}function Wr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";function t(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];if(!n.length)return"";const a=n[0];return"string"!==typeof a||a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, ${a}`:`, var(--${e?`${e}-`:""}${a}${t(...n.slice(1))})`}return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];return`var(--${e?`${e}-`:""}${r}${t(...i)})`}}function $r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xt({spacing:e});if(e.mui)return e;const r=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return(0===r.length?[1]:r).map((e=>{const r=t(e);return"number"===typeof r?`${r}px`:r})).join(" ")};return r.mui=!0,r}function Zr(e){const t={};return Object.entries(e).forEach((e=>{const[r,n]=e;"object"===typeof n&&(t[r]=`${n.fontStyle?`${n.fontStyle} `:""}${n.fontVariant?`${n.fontVariant} `:""}${n.fontWeight?`${n.fontWeight} `:""}${n.fontStretch?`${n.fontStretch} `:""}${n.fontSize||""}${n.lineHeight?`/${n.lineHeight} `:""}${n.fontFamily||""}`)})),t}const Xr=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=e;t.forEach(((e,a)=>{a===t.length-1?Array.isArray(i)?i[Number(e)]=r:i&&"object"===typeof i&&(i[e]=r):i&&"object"===typeof i&&(i[e]||(i[e]=n.includes(e)?[]:{}),i=i[e])}))};function Yr(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},i={},a={},o={};var s,l;return s=(e,t,s)=>{if(("string"===typeof t||"number"===typeof t)&&(!n||!n(e,t))){const n=`--${r?`${r}-`:""}${e.join("-")}`,l=((e,t)=>"number"===typeof t?["lineHeight","fontWeight","opacity","zIndex"].some((t=>e.includes(t)))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t)(e,t);Object.assign(i,{[n]:l}),Xr(a,e,`var(${n})`,s),Xr(o,e,`var(${n}, ${l})`,s)}},l=e=>"vars"===e[0],function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];Object.entries(t).forEach((t=>{let[i,a]=t;(!l||l&&!l([...r,i]))&&void 0!==a&&null!==a&&("object"===typeof a&&Object.keys(a).length>0?e(a,[...r,i],Array.isArray(a)?[...n,i]:n):s([...r,i],a,n))}))}(e),{css:i,vars:a,varsWithDefaults:o}}const Kr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{getSelector:r=g,disableCssColorScheme:n,colorSchemeSelector:i}=t,{colorSchemes:a={},components:o,defaultColorScheme:s="light",...l}=e,{vars:c,css:u,varsWithDefaults:h}=Yr(l,t);let p=h;const d={},{[s]:f,...m}=a;if(Object.entries(m||{}).forEach((e=>{let[r,n]=e;const{vars:i,css:a,varsWithDefaults:o}=Yr(n,t);p=Qe(p,o),d[r]={css:a,vars:i}})),f){const{css:e,vars:r,varsWithDefaults:n}=Yr(f,t);p=Qe(p,n),d[s]={css:e,vars:r}}function g(t,r){let n=i;if("class"===i&&(n=".%s"),"data"===i&&(n="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(n=`[${i}="%s"]`),t){if("media"===n){if(e.defaultColorScheme===t)return":root";const n=a[t]?.palette?.mode||t;return{[`@media (prefers-color-scheme: ${n})`]:{":root":r}}}if(n)return e.defaultColorScheme===t?`:root, ${n.replace("%s",String(t))}`:n.replace("%s",String(t))}return":root"}return{vars:p,generateThemeVars:()=>{let e={...c};return Object.entries(d).forEach((t=>{let[,{vars:r}]=t;e=Qe(e,r)})),e},generateStyleSheets:()=>{const t=[],i=e.defaultColorScheme||"light";function o(e,r){Object.keys(r).length&&t.push("string"===typeof e?{[e]:{...r}}:e)}o(r(void 0,{...u}),u);const{[i]:s,...l}=d;if(s){const{css:e}=s,t=a[i]?.palette?.mode,l=!n&&t?{colorScheme:t,...e}:{...e};o(r(i,{...l}),l)}return Object.entries(l).forEach((e=>{let[t,{css:i}]=e;const s=a[t]?.palette?.mode,l=!n&&s?{colorScheme:s,...i}:{...i};o(r(t,{...l}),l)})),t}}};function Jr(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...i}=e,a=(e=>{const t=Object.keys(e).map((t=>({key:t,val:e[t]})))||[];return t.sort(((e,t)=>e.val-t.val)),t.reduce(((e,t)=>({...e,[t.key]:t.val})),{})})(t),o=Object.keys(a);function s(e){return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${r})`}function l(e){return`@media (max-width:${("number"===typeof t[e]?t[e]:e)-n/100}${r})`}function c(e,i){const a=o.indexOf(i);return`@media (min-width:${"number"===typeof t[e]?t[e]:e}${r}) and (max-width:${(-1!==a&&"number"===typeof t[o[a]]?t[o[a]]:i)-n/100}${r})`}return{keys:o,values:a,up:s,down:l,between:c,only:function(e){return o.indexOf(e)+1<o.length?c(e,o[o.indexOf(e)+1]):s(e)},not:function(e){const t=o.indexOf(e);return 0===t?s(o[1]):t===o.length-1?l(o[t]):c(e,o[o.indexOf(e)+1]).replace("@media","@media not all and")},unit:r,...i}}const Qr={borderRadius:4};function en(e,t){const r=this;if(r.vars){if(!r.colorSchemes?.[e]||"function"!==typeof r.getColorSchemeSelector)return{};let n=r.getColorSchemeSelector(e);return"&"===n?t:((n.includes("data-")||n.includes("."))&&(n=`*:where(${n.replace(/\s*&$/,"")}) &`),{[n]:t})}return r.palette.mode===e?t:{}}const tn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t={},palette:r={},spacing:n,shape:i={},...a}=e;let o=Qe({breakpoints:Jr(t),direction:"ltr",components:{},palette:{mode:"light",...r},spacing:$r(n),shape:{...Qr,...i}},a);o=function(e){const t=(e,t)=>e.replace("@media",t?`@container ${t}`:"@container");function r(r,n){r.up=function(){return t(e.breakpoints.up(...arguments),n)},r.down=function(){return t(e.breakpoints.down(...arguments),n)},r.between=function(){return t(e.breakpoints.between(...arguments),n)},r.only=function(){return t(e.breakpoints.only(...arguments),n)},r.not=function(){const r=t(e.breakpoints.not(...arguments),n);return r.includes("not all and")?r.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):r}}const n={},i=e=>(r(n,e),n);return r(i),{...e,containerQueries:i}}(o),o.applyStyles=en;for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return o=l.reduce(((e,t)=>Qe(e,t)),o),o.unstable_sxConfig={...Qt,...a?.unstable_sxConfig},o.unstable_sx=function(e){return tr({sx:e,theme:this})},o};const rn={textTransform:"uppercase"},nn='"Roboto", "Helvetica", "Arial", sans-serif';function an(e,t){const{fontFamily:r=nn,fontSize:n=14,fontWeightLight:i=300,fontWeightRegular:a=400,fontWeightMedium:o=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:c,pxToRem:u,...h}="function"===typeof t?t(e):t;const p=n/14,d=u||(e=>e/l*p+"rem"),f=(e,t,n,i,a)=>{return{fontFamily:r,fontWeight:e,fontSize:d(t),lineHeight:n,...r===nn?{letterSpacing:(o=i/t,Math.round(1e5*o)/1e5)+"em"}:{},...a,...c};var o},m={h1:f(i,96,1.167,-1.5),h2:f(i,60,1.2,-.5),h3:f(a,48,1.167,0),h4:f(a,34,1.235,.25),h5:f(a,24,1.334,0),h6:f(o,20,1.6,.15),subtitle1:f(a,16,1.75,.15),subtitle2:f(o,14,1.57,.1),body1:f(a,16,1.5,.15),body2:f(a,14,1.43,.15),button:f(o,14,1.75,.4,rn),caption:f(a,12,1.66,.4),overline:f(a,12,2.66,1,rn),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Qe({htmlFontSize:l,pxToRem:d,fontFamily:r,fontSize:n,fontWeightLight:i,fontWeightRegular:a,fontWeightMedium:o,fontWeightBold:s,...m},h,{clone:!1})}function on(){return[`${arguments.length<=0?void 0:arguments[0]}px ${arguments.length<=1?void 0:arguments[1]}px ${arguments.length<=2?void 0:arguments[2]}px ${arguments.length<=3?void 0:arguments[3]}px rgba(0,0,0,0.2)`,`${arguments.length<=4?void 0:arguments[4]}px ${arguments.length<=5?void 0:arguments[5]}px ${arguments.length<=6?void 0:arguments[6]}px ${arguments.length<=7?void 0:arguments[7]}px rgba(0,0,0,0.14)`,`${arguments.length<=8?void 0:arguments[8]}px ${arguments.length<=9?void 0:arguments[9]}px ${arguments.length<=10?void 0:arguments[10]}px ${arguments.length<=11?void 0:arguments[11]}px rgba(0,0,0,0.12)`].join(",")}const sn=["none",on(0,2,1,-1,0,1,1,0,0,1,3,0),on(0,3,1,-2,0,2,2,0,0,1,5,0),on(0,3,3,-2,0,3,4,0,0,1,8,0),on(0,2,4,-1,0,4,5,0,0,1,10,0),on(0,3,5,-1,0,5,8,0,0,1,14,0),on(0,3,5,-1,0,6,10,0,0,1,18,0),on(0,4,5,-2,0,7,10,1,0,2,16,1),on(0,5,5,-3,0,8,10,1,0,3,14,2),on(0,5,6,-3,0,9,12,1,0,3,16,2),on(0,6,6,-3,0,10,14,1,0,4,18,3),on(0,6,7,-4,0,11,15,1,0,4,20,3),on(0,7,8,-4,0,12,17,2,0,5,22,4),on(0,7,8,-4,0,13,19,2,0,5,24,4),on(0,7,9,-4,0,14,21,2,0,5,26,4),on(0,8,9,-5,0,15,22,2,0,6,28,5),on(0,8,10,-5,0,16,24,2,0,6,30,5),on(0,8,11,-5,0,17,26,2,0,6,32,5),on(0,9,11,-5,0,18,28,2,0,7,34,6),on(0,9,12,-6,0,19,29,2,0,7,36,6),on(0,10,13,-6,0,20,31,3,0,8,38,7),on(0,10,13,-6,0,21,33,3,0,8,40,7),on(0,10,14,-6,0,22,35,3,0,8,42,7),on(0,11,14,-7,0,23,36,3,0,9,44,8),on(0,11,15,-7,0,24,38,3,0,9,46,8)],ln={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},cn={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function un(e){return`${Math.round(e)}ms`}function hn(e){if(!e)return 0;const t=e/36;return Math.min(Math.round(10*(4+15*t**.25+t/5)),3e3)}function pn(e){const t={...ln,...e.easing},r={...cn,...e.duration};return{getAutoHeightDuration:hn,create:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{duration:i=r.standard,easing:a=t.easeInOut,delay:o=0,...s}=n;return(Array.isArray(e)?e:[e]).map((e=>`${e} ${"string"===typeof i?i:un(i)} ${a} ${"string"===typeof o?o:un(o)}`)).join(",")},...e,easing:t,duration:r}}const dn={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function fn(){const e={...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return function e(t){const r=Object.entries(t);for(let i=0;i<r.length;i++){const[a,o]=r[i];!Ke(n=o)&&"undefined"!==typeof n&&"string"!==typeof n&&"boolean"!==typeof n&&"number"!==typeof n&&!Array.isArray(n)||a.startsWith("unstable_")?delete t[a]:Ke(o)&&(t[a]={...o},e(t[a]))}var n}(e),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';\n\nconst theme = ${JSON.stringify(e,null,2)};\n\ntheme.breakpoints = createBreakpoints(theme.breakpoints || {});\ntheme.transitions = createTransitions(theme.transitions || {});\n\nexport default theme;`}const mn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{breakpoints:t,mixins:r={},spacing:n,palette:i={},transitions:a={},typography:o={},shape:s,...l}=e;if(e.vars&&void 0===e.generateThemeVars)throw new Error(Ze(20));const c=Gr(i),u=tn(e);let h=Qe(u,{mixins:(p=u.breakpoints,d=r,{toolbar:{minHeight:56,[p.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[p.up("sm")]:{minHeight:64}},...d}),palette:c,shadows:sn.slice(),typography:an(c,o),transitions:pn(a),zIndex:{...dn}});var p,d;h=Qe(h,l);for(var f=arguments.length,m=new Array(f>1?f-1:0),g=1;g<f;g++)m[g-1]=arguments[g];return h=m.reduce(((e,t)=>Qe(e,t)),h),h.unstable_sxConfig={...Qt,...l?.unstable_sxConfig},h.unstable_sx=function(e){return tr({sx:e,theme:this})},h.toRuntimeSource=fn,h};function gn(e){let t;return t=e<1?5.11916*e**2:4.5*Math.log(e+1)+2,Math.round(10*t)/1e3}const yn=[...Array(25)].map(((e,t)=>{if(0===t)return"none";const r=gn(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`}));function vn(e){return{inputPlaceholder:"dark"===e?.5:.42,inputUnderline:"dark"===e?.7:.42,switchTrackDisabled:"dark"===e?.2:.12,switchTrack:"dark"===e?.3:.38}}function xn(e){return"dark"===e?yn:[]}function bn(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||"palette"===e[0]&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const _n=e=>[...[...Array(25)].map(((t,r)=>`--${e?`${e}-`:""}overlays-${r}`)),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],wn=e=>(t,r)=>{const n=e.rootSelector||":root",i=e.colorSchemeSelector;let a=i;if("class"===i&&(a=".%s"),"data"===i&&(a="[data-%s]"),i?.startsWith("data-")&&!i.includes("%s")&&(a=`[${i}="%s"]`),e.defaultColorScheme===t){if("dark"===t){const i={};return _n(e.cssVarPrefix).forEach((e=>{i[e]=r[e],delete r[e]})),"media"===a?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:i}}:a?{[a.replace("%s",t)]:i,[`${n}, ${a.replace("%s",t)}`]:r}:{[n]:{...r,...i}}}if(a&&"media"!==a)return`${n}, ${a.replace("%s",String(t))}`}else if(t){if("media"===a)return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(a)return a.replace("%s",String(t))}return n};function kn(e,t,r){!e[t]&&r&&(e[t]=r)}function Tn(e){return"string"===typeof e&&e.startsWith("hsl")?wr(e):e}function Sn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=br(Tn(e[t])))}const An=e=>{try{return e()}catch(t){}};function Mn(e,t,r,n){if(!t)return;t=!0===t?{}:t;const i="dark"===n?"dark":"light";if(!r)return void(e[n]=function(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...i}=e,a=Gr(t);return{palette:a,opacity:{...vn(a.mode),...r},overlays:n||xn(a.mode),...i}}({...t,palette:{mode:i,...t?.palette}}));const{palette:a,...o}=mn({...r,palette:{mode:i,...t?.palette}});return e[n]={...t,palette:a,opacity:{...vn(i),...t?.opacity},overlays:t?.overlays||xn(i)},o}function En(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{colorSchemes:t={light:!0},defaultColorScheme:r,disableCssColorScheme:n=!1,cssVarPrefix:i="mui",shouldSkipGeneratingVar:a=bn,colorSchemeSelector:o=(t.light&&t.dark?"media":void 0),rootSelector:s=":root",...l}=e,c=Object.keys(t)[0],u=r||(t.light&&"light"!==c?"light":c),h=function(){return Wr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"mui")}(i),{[u]:p,light:d,dark:f,...m}=t,g={...m};let y=p;if(("dark"===u&&!("dark"in t)||"light"===u&&!("light"in t))&&(y=!0),!y)throw new Error(Ze(21,u));const v=Mn(g,y,l,u);d&&!g.light&&Mn(g,d,void 0,"light"),f&&!g.dark&&Mn(g,f,void 0,"dark");let x={defaultColorScheme:u,...v,cssVarPrefix:i,colorSchemeSelector:o,rootSelector:s,getCssVar:h,colorSchemes:g,font:{...Zr(v.typography),...v.font},spacing:(b=l.spacing,"number"===typeof b?`${b}px`:"string"===typeof b||"function"===typeof b||Array.isArray(b)?b:"8px")};var b;Object.keys(x.colorSchemes).forEach((e=>{const t=x.colorSchemes[e].palette,r=e=>{const r=e.split("-"),n=r[1],i=r[2];return h(e,t[n][i])};var n;if("light"===t.mode&&(kn(t.common,"background","#fff"),kn(t.common,"onBackground","#000")),"dark"===t.mode&&(kn(t.common,"background","#000"),kn(t.common,"onBackground","#fff")),n=t,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"].forEach((e=>{n[e]||(n[e]={})})),"light"===t.mode){kn(t.Alert,"errorColor",Mr(t.error.light,.6)),kn(t.Alert,"infoColor",Mr(t.info.light,.6)),kn(t.Alert,"successColor",Mr(t.success.light,.6)),kn(t.Alert,"warningColor",Mr(t.warning.light,.6)),kn(t.Alert,"errorFilledBg",r("palette-error-main")),kn(t.Alert,"infoFilledBg",r("palette-info-main")),kn(t.Alert,"successFilledBg",r("palette-success-main")),kn(t.Alert,"warningFilledBg",r("palette-warning-main")),kn(t.Alert,"errorFilledColor",An((()=>t.getContrastText(t.error.main)))),kn(t.Alert,"infoFilledColor",An((()=>t.getContrastText(t.info.main)))),kn(t.Alert,"successFilledColor",An((()=>t.getContrastText(t.success.main)))),kn(t.Alert,"warningFilledColor",An((()=>t.getContrastText(t.warning.main)))),kn(t.Alert,"errorStandardBg",Cr(t.error.light,.9)),kn(t.Alert,"infoStandardBg",Cr(t.info.light,.9)),kn(t.Alert,"successStandardBg",Cr(t.success.light,.9)),kn(t.Alert,"warningStandardBg",Cr(t.warning.light,.9)),kn(t.Alert,"errorIconColor",r("palette-error-main")),kn(t.Alert,"infoIconColor",r("palette-info-main")),kn(t.Alert,"successIconColor",r("palette-success-main")),kn(t.Alert,"warningIconColor",r("palette-warning-main")),kn(t.AppBar,"defaultBg",r("palette-grey-100")),kn(t.Avatar,"defaultBg",r("palette-grey-400")),kn(t.Button,"inheritContainedBg",r("palette-grey-300")),kn(t.Button,"inheritContainedHoverBg",r("palette-grey-A100")),kn(t.Chip,"defaultBorder",r("palette-grey-400")),kn(t.Chip,"defaultAvatarColor",r("palette-grey-700")),kn(t.Chip,"defaultIconColor",r("palette-grey-700")),kn(t.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),kn(t.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),kn(t.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),kn(t.LinearProgress,"primaryBg",Cr(t.primary.main,.62)),kn(t.LinearProgress,"secondaryBg",Cr(t.secondary.main,.62)),kn(t.LinearProgress,"errorBg",Cr(t.error.main,.62)),kn(t.LinearProgress,"infoBg",Cr(t.info.main,.62)),kn(t.LinearProgress,"successBg",Cr(t.success.main,.62)),kn(t.LinearProgress,"warningBg",Cr(t.warning.main,.62)),kn(t.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.11)`),kn(t.Slider,"primaryTrack",Cr(t.primary.main,.62)),kn(t.Slider,"secondaryTrack",Cr(t.secondary.main,.62)),kn(t.Slider,"errorTrack",Cr(t.error.main,.62)),kn(t.Slider,"infoTrack",Cr(t.info.main,.62)),kn(t.Slider,"successTrack",Cr(t.success.main,.62)),kn(t.Slider,"warningTrack",Cr(t.warning.main,.62));const e=Lr(t.background.default,.8);kn(t.SnackbarContent,"bg",e),kn(t.SnackbarContent,"color",An((()=>t.getContrastText(e)))),kn(t.SpeedDialAction,"fabHoverBg",Lr(t.background.paper,.15)),kn(t.StepConnector,"border",r("palette-grey-400")),kn(t.StepContent,"border",r("palette-grey-400")),kn(t.Switch,"defaultColor",r("palette-common-white")),kn(t.Switch,"defaultDisabledColor",r("palette-grey-100")),kn(t.Switch,"primaryDisabledColor",Cr(t.primary.main,.62)),kn(t.Switch,"secondaryDisabledColor",Cr(t.secondary.main,.62)),kn(t.Switch,"errorDisabledColor",Cr(t.error.main,.62)),kn(t.Switch,"infoDisabledColor",Cr(t.info.main,.62)),kn(t.Switch,"successDisabledColor",Cr(t.success.main,.62)),kn(t.Switch,"warningDisabledColor",Cr(t.warning.main,.62)),kn(t.TableCell,"border",Cr(Sr(t.divider,1),.88)),kn(t.Tooltip,"bg",Sr(t.grey[700],.92))}if("dark"===t.mode){kn(t.Alert,"errorColor",Cr(t.error.light,.6)),kn(t.Alert,"infoColor",Cr(t.info.light,.6)),kn(t.Alert,"successColor",Cr(t.success.light,.6)),kn(t.Alert,"warningColor",Cr(t.warning.light,.6)),kn(t.Alert,"errorFilledBg",r("palette-error-dark")),kn(t.Alert,"infoFilledBg",r("palette-info-dark")),kn(t.Alert,"successFilledBg",r("palette-success-dark")),kn(t.Alert,"warningFilledBg",r("palette-warning-dark")),kn(t.Alert,"errorFilledColor",An((()=>t.getContrastText(t.error.dark)))),kn(t.Alert,"infoFilledColor",An((()=>t.getContrastText(t.info.dark)))),kn(t.Alert,"successFilledColor",An((()=>t.getContrastText(t.success.dark)))),kn(t.Alert,"warningFilledColor",An((()=>t.getContrastText(t.warning.dark)))),kn(t.Alert,"errorStandardBg",Mr(t.error.light,.9)),kn(t.Alert,"infoStandardBg",Mr(t.info.light,.9)),kn(t.Alert,"successStandardBg",Mr(t.success.light,.9)),kn(t.Alert,"warningStandardBg",Mr(t.warning.light,.9)),kn(t.Alert,"errorIconColor",r("palette-error-main")),kn(t.Alert,"infoIconColor",r("palette-info-main")),kn(t.Alert,"successIconColor",r("palette-success-main")),kn(t.Alert,"warningIconColor",r("palette-warning-main")),kn(t.AppBar,"defaultBg",r("palette-grey-900")),kn(t.AppBar,"darkBg",r("palette-background-paper")),kn(t.AppBar,"darkColor",r("palette-text-primary")),kn(t.Avatar,"defaultBg",r("palette-grey-600")),kn(t.Button,"inheritContainedBg",r("palette-grey-800")),kn(t.Button,"inheritContainedHoverBg",r("palette-grey-700")),kn(t.Chip,"defaultBorder",r("palette-grey-700")),kn(t.Chip,"defaultAvatarColor",r("palette-grey-300")),kn(t.Chip,"defaultIconColor",r("palette-grey-300")),kn(t.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),kn(t.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),kn(t.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),kn(t.LinearProgress,"primaryBg",Mr(t.primary.main,.5)),kn(t.LinearProgress,"secondaryBg",Mr(t.secondary.main,.5)),kn(t.LinearProgress,"errorBg",Mr(t.error.main,.5)),kn(t.LinearProgress,"infoBg",Mr(t.info.main,.5)),kn(t.LinearProgress,"successBg",Mr(t.success.main,.5)),kn(t.LinearProgress,"warningBg",Mr(t.warning.main,.5)),kn(t.Skeleton,"bg",`rgba(${r("palette-text-primaryChannel")} / 0.13)`),kn(t.Slider,"primaryTrack",Mr(t.primary.main,.5)),kn(t.Slider,"secondaryTrack",Mr(t.secondary.main,.5)),kn(t.Slider,"errorTrack",Mr(t.error.main,.5)),kn(t.Slider,"infoTrack",Mr(t.info.main,.5)),kn(t.Slider,"successTrack",Mr(t.success.main,.5)),kn(t.Slider,"warningTrack",Mr(t.warning.main,.5));const e=Lr(t.background.default,.98);kn(t.SnackbarContent,"bg",e),kn(t.SnackbarContent,"color",An((()=>t.getContrastText(e)))),kn(t.SpeedDialAction,"fabHoverBg",Lr(t.background.paper,.15)),kn(t.StepConnector,"border",r("palette-grey-600")),kn(t.StepContent,"border",r("palette-grey-600")),kn(t.Switch,"defaultColor",r("palette-grey-300")),kn(t.Switch,"defaultDisabledColor",r("palette-grey-600")),kn(t.Switch,"primaryDisabledColor",Mr(t.primary.main,.55)),kn(t.Switch,"secondaryDisabledColor",Mr(t.secondary.main,.55)),kn(t.Switch,"errorDisabledColor",Mr(t.error.main,.55)),kn(t.Switch,"infoDisabledColor",Mr(t.info.main,.55)),kn(t.Switch,"successDisabledColor",Mr(t.success.main,.55)),kn(t.Switch,"warningDisabledColor",Mr(t.warning.main,.55)),kn(t.TableCell,"border",Mr(Sr(t.divider,1),.68)),kn(t.Tooltip,"bg",Sr(t.grey[700],.92))}Sn(t.background,"default"),Sn(t.background,"paper"),Sn(t.common,"background"),Sn(t.common,"onBackground"),Sn(t,"divider"),Object.keys(t).forEach((e=>{const r=t[e];"tonalOffset"!==e&&r&&"object"===typeof r&&(r.main&&kn(t[e],"mainChannel",br(Tn(r.main))),r.light&&kn(t[e],"lightChannel",br(Tn(r.light))),r.dark&&kn(t[e],"darkChannel",br(Tn(r.dark))),r.contrastText&&kn(t[e],"contrastTextChannel",br(Tn(r.contrastText))),"text"===e&&(Sn(t[e],"primary"),Sn(t[e],"secondary")),"action"===e&&(r.active&&Sn(t[e],"active"),r.selected&&Sn(t[e],"selected")))}))}));for(var _=arguments.length,w=new Array(_>1?_-1:0),k=1;k<_;k++)w[k-1]=arguments[k];x=w.reduce(((e,t)=>Qe(e,t)),x);const T={prefix:i,disableCssColorScheme:n,shouldSkipGeneratingVar:a,getSelector:wn(x)},{vars:S,generateThemeVars:A,generateStyleSheets:M}=Kr(x,T);return x.vars=S,Object.entries(x.colorSchemes[x.defaultColorScheme]).forEach((e=>{let[t,r]=e;x[t]=r})),x.generateThemeVars=A,x.generateStyleSheets=M,x.generateSpacing=function(){return $r(l.spacing,xt(this))},x.getColorSchemeSelector=function(e){return function(t){return"media"===e?`@media (prefers-color-scheme: ${t})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${t}"] &`:"class"===e?`.${t} &`:"data"===e?`[data-${t}] &`:`${e.replace("%s",t)} &`:"&"}}(o),x.spacing=x.generateSpacing(),x.shouldSkipGeneratingVar=a,x.unstable_sxConfig={...Qt,...l?.unstable_sxConfig},x.unstable_sx=function(e){return tr({sx:e,theme:this})},x.toRuntimeSource=fn,x}function Cn(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...!0!==r&&r,palette:Gr({...!0===r?{}:r.palette,mode:t})})}function Pn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{palette:t,cssVariables:r=!1,colorSchemes:n=(t?void 0:{light:!0}),defaultColorScheme:i=t?.mode,...a}=e,o=i||"light",s=n?.[o],l={...n,...t?{[o]:{..."boolean"!==typeof s&&s,palette:t}}:void 0};for(var c=arguments.length,u=new Array(c>1?c-1:0),h=1;h<c;h++)u[h-1]=arguments[h];if(!1===r){if(!("colorSchemes"in e))return mn(e,...u);let r=t;"palette"in e||l[o]&&(!0!==l[o]?r=l[o].palette:"dark"===o&&(r={mode:"dark"}));const n=mn({...e,palette:r},...u);return n.defaultColorScheme=o,n.colorSchemes=l,"light"===n.palette.mode&&(n.colorSchemes.light={...!0!==l.light&&l.light,palette:n.palette},Cn(n,"dark",l.dark)),"dark"===n.palette.mode&&(n.colorSchemes.dark={...!0!==l.dark&&l.dark,palette:n.palette},Cn(n,"light",l.light)),n}return t||"light"in l||"light"!==o||(l.light=!0),En({...a,colorSchemes:l,defaultColorScheme:o,..."boolean"!==typeof r&&r},...u)}const Ln={attribute:"data-mui-color-scheme",colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:In,useColorScheme:zn,getInitColorSchemeScript:On}=function(t){const{themeId:r,theme:n={},modeStorageKey:i=lr,colorSchemeStorageKey:o=cr,disableTransitionOnChange:l=!1,defaultColorScheme:c,resolveTheme:u}=t,h={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},p=e.createContext(void 0),d={},f={},m="string"===typeof c?c:c.light,g="string"===typeof c?c:c.dark;return{CssVarsProvider:function(t){const{children:h,theme:m,modeStorageKey:g=i,colorSchemeStorageKey:y=o,disableTransitionOnChange:v=l,storageManager:x,storageWindow:b=("undefined"===typeof window?void 0:window),documentNode:_=("undefined"===typeof document?void 0:document),colorSchemeNode:w=("undefined"===typeof document?void 0:document.documentElement),disableNestedContext:k=!1,disableStyleSheetGeneration:T=!1,defaultMode:S="system",forceThemeRerender:A=!1,noSsr:M}=t,E=e.useRef(!1),C=a(),P=e.useContext(p),L=!!P&&!k,I=e.useMemo((()=>m||("function"===typeof n?n():n)),[m]),z=I[r],O=z||I,{colorSchemes:R=d,components:D=f,cssVarPrefix:j}=O,F=Object.keys(R).filter((e=>!!R[e])).join(","),B=e.useMemo((()=>F.split(",")),[F]),N="string"===typeof c?c:c.light,U="string"===typeof c?c:c.dark,V=R[N]&&R[U]?S:R[O.defaultColorScheme]?.palette?.mode||O.palette?.mode,{mode:q,setMode:H,systemMode:G,lightColorScheme:W,darkColorScheme:$,colorScheme:Z,setColorScheme:X}=gr({supportedColorSchemes:B,defaultLightColorScheme:N,defaultDarkColorScheme:U,modeStorageKey:g,colorSchemeStorageKey:y,defaultMode:V,storageManager:x,storageWindow:b,noSsr:M});let Y=q,K=Z;L&&(Y=P.mode,K=P.colorScheme);let J=K||O.defaultColorScheme;O.vars&&!A&&(J=O.defaultColorScheme);const Q=e.useMemo((()=>{const e=O.generateThemeVars?.()||O.vars,t={...O,components:D,colorSchemes:R,cssVarPrefix:j,vars:e};if("function"===typeof t.generateSpacing&&(t.spacing=t.generateSpacing()),J){const e=R[J];e&&"object"===typeof e&&Object.keys(e).forEach((r=>{e[r]&&"object"===typeof e[r]?t[r]={...t[r],...e[r]}:t[r]=e[r]}))}return u?u(t):t}),[O,J,D,R,j]),ee=O.colorSchemeSelector;sr((()=>{if(K&&w&&ee&&"media"!==ee){const e=ee;let t=ee;if("class"===e&&(t=".%s"),"data"===e&&(t="[data-%s]"),e?.startsWith("data-")&&!e.includes("%s")&&(t=`[${e}="%s"]`),t.startsWith("."))w.classList.remove(...B.map((e=>t.substring(1).replace("%s",e)))),w.classList.add(t.substring(1).replace("%s",K));else{const e=t.replace("%s",K).match(/\[([^\]]+)\]/);if(e){const[t,r]=e[1].split("=");r||B.forEach((e=>{w.removeAttribute(t.replace(K,e))})),w.setAttribute(t,r?r.replace(/"|'/g,""):"")}else w.setAttribute(t,K)}}}),[K,ee,w,B]),e.useEffect((()=>{let e;if(v&&E.current&&_){const t=_.createElement("style");t.appendChild(_.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),_.head.appendChild(t),window.getComputedStyle(_.body),e=setTimeout((()=>{_.head.removeChild(t)}),1)}return()=>{clearTimeout(e)}}),[K,v,_]),e.useEffect((()=>(E.current=!0,()=>{E.current=!1})),[]);const te=e.useMemo((()=>({allColorSchemes:B,colorScheme:K,darkColorScheme:$,lightColorScheme:W,mode:Y,setColorScheme:X,setMode:H,systemMode:G})),[B,K,$,W,Y,X,H,G,Q.colorSchemeSelector]);let re=!0;(T||!1===O.cssVariables||L&&C?.cssVarPrefix===j)&&(re=!1);const ne=(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(Ge,{themeId:z?r:void 0,theme:Q,children:h}),re&&(0,s.jsx)(or,{styles:Q.generateStyleSheets?.()||[]})]});return L?ne:(0,s.jsx)(p.Provider,{value:te,children:ne})},useColorScheme:()=>e.useContext(p)||h,getInitColorSchemeScript:e=>function(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:i=lr,colorSchemeStorageKey:a=cr,attribute:o=ur,colorSchemeNode:l="document.documentElement",nonce:c}=e||{};let u="",h=o;if("class"===o&&(h=".%s"),"data"===o&&(h="[data-%s]"),h.startsWith(".")){const e=h.substring(1);u+=`${l}.classList.remove('${e}'.replace('%s', light), '${e}'.replace('%s', dark));\n ${l}.classList.add('${e}'.replace('%s', colorScheme));`}const p=h.match(/\[([^\]]+)\]/);if(p){const[e,t]=p[1].split("=");t||(u+=`${l}.removeAttribute('${e}'.replace('%s', light));\n ${l}.removeAttribute('${e}'.replace('%s', dark));`),u+=`\n ${l}.setAttribute('${e}'.replace('%s', colorScheme), ${t?`${t}.replace('%s', colorScheme)`:'""'});`}else u+=`${l}.setAttribute('${h}', colorScheme);`;return(0,s.jsx)("script",{suppressHydrationWarning:!0,nonce:"undefined"===typeof window?c:"",dangerouslySetInnerHTML:{__html:`(function() {\ntry {\n let colorScheme = '';\n const mode = localStorage.getItem('${i}') || '${t}';\n const dark = localStorage.getItem('${a}-dark') || '${n}';\n const light = localStorage.getItem('${a}-light') || '${r}';\n if (mode === 'system') {\n // handle system mode\n const mql = window.matchMedia('(prefers-color-scheme: dark)');\n if (mql.matches) {\n colorScheme = dark\n } else {\n colorScheme = light\n }\n }\n if (mode === 'light') {\n colorScheme = light;\n }\n if (mode === 'dark') {\n colorScheme = dark;\n }\n if (colorScheme) {\n ${u}\n }\n} catch(e){}})();`}},"mui-color-scheme-init")}({colorSchemeStorageKey:o,defaultLightColorScheme:m,defaultDarkColorScheme:g,modeStorageKey:i,...e})}}({themeId:We,theme:()=>Pn({cssVariables:!0}),colorSchemeStorageKey:Ln.colorSchemeStorageKey,modeStorageKey:Ln.modeStorageKey,defaultColorScheme:{light:Ln.defaultLightColorScheme,dark:Ln.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:an(e.palette,e.typography)};return t.unstable_sx=function(e){return tr({sx:e,theme:this})},t}});const Rn=In;function Dn(e){let{theme:t,...r}=e;if("function"===typeof t)return(0,s.jsx)($e,{theme:t,...r});const n=We in t?t[We]:t;return"colorSchemes"in n?(0,s.jsx)(Rn,{theme:t,...r}):"vars"in n?(0,s.jsx)($e,{theme:t,...r}):(0,s.jsx)($e,{theme:{...t,vars:null},...r})}const jn=Pn({palette:{primary:{main:"#1A2536",contrastText:"#D3CDBF"},secondary:{main:"#4A7A7D",contrastText:"#FFFFFF"},text:{primary:"#2E2E2E",secondary:"#1A2536"},background:{default:"#D3CDBF",paper:"#FFFFFF"},action:{active:"#D4A017",hover:"rgba(212, 160, 23, 0.1)"},custom:{highlight:"#D4A017",contrast:"#2E2E2E"}},typography:{fontFamily:"'Roboto', sans-serif",h1:{fontSize:"2rem",fontWeight:500,color:"#2E2E2E"},body1:{fontSize:"1rem",color:"#2E2E2E"}},components:{MuiLink:{styleOverrides:{root:{color:"#4A7A7D",textDecoration:"none","&:hover":{color:"#D4A017",textDecoration:"underline"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none","&:hover":{backgroundColor:"rgba(212, 160, 23, 0.2)"}}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:"#1A2536"}}}}});function Fn(e){const{theme:t,name:r,props:n}=e;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?Be(t.components[r].defaultProps,n):n}function Bn(t,r,n,i,a){const[o,s]=e.useState((()=>a&&n?n(t).matches:i?i(t).matches:r));return sr((()=>{if(!n)return;const e=n(t),r=()=>{s(e.matches)};return r(),e.addEventListener("change",r),()=>{e.removeEventListener("change",r)}}),[t,n]),o}const Nn={...t}.useSyncExternalStore;function Un(t,r,n,i,a){const o=e.useCallback((()=>r),[r]),s=e.useMemo((()=>{if(a&&n)return()=>n(t).matches;if(null!==i){const{matches:e}=i(t);return()=>e}return o}),[o,t,i,a,n]),[l,c]=e.useMemo((()=>{if(null===n)return[o,()=>()=>{}];const e=n(t);return[()=>e.matches,t=>(e.addEventListener("change",t),()=>{e.removeEventListener("change",t)})]}),[o,n,t]);return Nn(c,l,s)}function Vn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t}=e;return function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Re();n&&t&&(n=n[t]||n);const i="undefined"!==typeof window&&"undefined"!==typeof window.matchMedia,{defaultMatches:a=!1,matchMedia:o=(i?window.matchMedia:null),ssrMatchMedia:s=null,noSsr:l=!1}=Fn({name:"MuiUseMediaQuery",props:r,theme:n});let c="function"===typeof e?e(n):e;c=c.replace(/^@media( ?)/m,"");return(void 0!==Nn?Un:Bn)(c,a,o,s,l)}}Vn();const qn=Vn({themeId:We});function Hn(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(r=Hn(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}const Gn=function(){for(var e,t,r=0,n="",i=arguments.length;r<i;r++)(e=arguments[r])&&(t=Hn(e))&&(n&&(n+=" "),n+=t);return n};function Wn(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;const n={};for(const i in e){const a=e[i];let o="",s=!0;for(let e=0;e<a.length;e+=1){const n=a[e];n&&(o+=(!0===s?"":" ")+t(n),s=!1,r&&r[n]&&(o+=" "+r[n]))}n[i]=o}return n}function $n(){return $n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$n.apply(null,arguments)}var Zn=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Xn=fe((function(e){return Zn.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),Yn=function(e){return"theme"!==e},Kn=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?Xn:Yn},Jn=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},Qn=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return he(t,r,n),Ae((function(){return pe(t,r,n)})),null},ei=function t(r,n){var i,a,o=r.__emotion_real===r,s=o&&r.__emotion_base||r;void 0!==n&&(i=n.label,a=n.target);var l=Jn(r,n,o),c=l||Kn(s),u=!c("as");return function(){var h=arguments,p=o&&void 0!==r.__emotion_styles?r.__emotion_styles.slice(0):[];if(void 0!==i&&p.push("label:"+i+";"),null==h[0]||void 0===h[0].raw)p.push.apply(p,h);else{var d=h[0];p.push(d[0]);for(var f=h.length,m=1;m<f;m++)p.push(h[m],d[m])}var g=Ce((function(t,r,n){var i=u&&t.as||s,o="",h=[],d=t;if(null==t.theme){for(var f in d={},t)d[f]=t[f];d.theme=e.useContext(Pe)}"string"===typeof t.className?o=ue(r.registered,h,t.className):null!=t.className&&(o=t.className+" ");var m=Te(p.concat(h),r.registered,d);o+=r.key+"-"+m.name,void 0!==a&&(o+=" "+a);var g=u&&void 0===l?Kn(i):c,y={};for(var v in t)u&&"as"===v||g(v)&&(y[v]=t[v]);return y.className=o,n&&(y.ref=n),e.createElement(e.Fragment,null,e.createElement(Qn,{cache:r,serialized:m,isStringTag:"string"===typeof i}),e.createElement(i,y))}));return g.displayName=void 0!==i?i:"Styled("+("string"===typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=r.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=p,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+a}}),g.withComponent=function(e,r){return t(e,$n({},n,r,{shouldForwardProp:Jn(g,r,!0)})).apply(void 0,p)},g}}.bind(null);function ti(e,t){return ei(e,t)}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){ei[e]=ei(e)}));const ri=[];function ni(e){return ri[0]=e,Te(ri)}function ii(e){const{variants:t,...r}=e,n={variants:t,style:ni(r),isProcessed:!0};return n.style===r||t&&t.forEach((e=>{"function"!==typeof e.style&&(e.style=ni(e.style))})),n}const ai=tn();function oi(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}function si(e){return e?(t,r)=>r[e]:null}function li(e,t){const r="function"===typeof t?t(e):t;if(Array.isArray(r))return r.flatMap((t=>li(e,t)));if(Array.isArray(r?.variants)){let t;if(r.isProcessed)t=r.style;else{const{variants:e,...n}=r;t=n}return ci(e,r.variants,[t])}return r?.isProcessed?r.style:r}function ci(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e:for(let i=0;i<t.length;i+=1){const a=t[i];if("function"===typeof a.props){if(r??={...e,...e.ownerState,ownerState:e.ownerState},!a.props(r))continue}else for(const t in a.props)if(e[t]!==a.props[t]&&e.ownerState?.[t]!==a.props[t])continue e;"function"===typeof a.style?(r??={...e,...e.ownerState,ownerState:e.ownerState},n.push(a.style(r))):n.push(a.style)}return n}function ui(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:t,defaultTheme:r=ai,rootShouldForwardProp:n=oi,slotShouldForwardProp:i=oi}=e;function a(e){!function(e,t,r){e.theme=function(e){for(const t in e)return!1;return!0}(e.theme)?r:e.theme[t]||e.theme}(e,t,r)}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}(e,(e=>e.filter((e=>e!==tr))));const{name:r,slot:o,skipVariantsResolver:s,skipSx:l,overridesResolver:c=si(pi(o)),...u}=t,h=void 0!==s?s:o&&"Root"!==o&&"root"!==o||!1,p=l||!1;let d=oi;"Root"===o||"root"===o?d=n:o?d=i:function(e){return"string"===typeof e&&e.charCodeAt(0)>96}(e)&&(d=void 0);const f=ti(e,{shouldForwardProp:d,label:hi(r,o),...u}),m=e=>{if("function"===typeof e&&e.__emotion_real!==e)return function(t){return li(t,e)};if(Ke(e)){const t=ii(e);return t.variants?function(e){return li(e,t)}:t.style}return e},g=function(){const t=[];for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];const s=i.map(m),l=[];if(t.push(a),r&&c&&l.push((function(e){const t=e.theme,n=t.components?.[r]?.styleOverrides;if(!n)return null;const i={};for(const r in n)i[r]=li(e,n[r]);return c(e,i)})),r&&!h&&l.push((function(e){const t=e.theme,n=t?.components?.[r]?.variants;return n?ci(e,n):null})),p||l.push(tr),Array.isArray(s[0])){const e=s.shift(),r=new Array(t.length).fill(""),n=new Array(l.length).fill("");let i;i=[...r,...e,...n],i.raw=[...r,...e.raw,...n],t.unshift(i)}const u=[...t,...s,...l],d=f(...u);return e.muiName&&(d.muiName=e.muiName),d};return f.withConfig&&(g.withConfig=f.withConfig),g}}function hi(e,t){}function pi(e){return e?e.charAt(0).toLowerCase()+e.slice(1):e}const di=Pn();const fi=function(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e},mi=e=>fi(e)&&"classes"!==e,gi=ui({themeId:We,defaultTheme:di,rootShouldForwardProp:mi});function yi(e){return Ue(e)}const vi=tn();const xi=function(){return Re(arguments.length>0&&void 0!==arguments[0]?arguments[0]:vi)};function bi(){const e=xi(di);return e[We]||e}const _i={theme:void 0};const wi=function(e){let t,r;return function(n){let i=t;return void 0!==i&&n.theme===r||(_i.theme=n.theme,i=ii(e(_i)),t=i,r=n.theme),i}},ki=e=>e,Ti=(()=>{let e=ki;return{configure(t){e=t},generate:t=>e(t),reset(){e=ki}}})(),Si={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ai(e,t){const r=Si[t];return r?`${arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui"}-${r}`:`${Ti.generate(e)}-${t}`}function Mi(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui";const n={};return t.forEach((t=>{n[t]=Ai(e,t,r)})),n}function Ei(e){return Ai("MuiPaper",e)}Mi("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const Ci=gi("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,"elevation"===r.variant&&t[`elevation${r.elevation}`]]}})(wi((e=>{let{theme:t}=e;return{backgroundColor:(t.vars||t).palette.background.paper,color:(t.vars||t).palette.text.primary,transition:t.transitions.create("box-shadow"),variants:[{props:e=>{let{ownerState:t}=e;return!t.square},style:{borderRadius:t.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(t.vars||t).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}}))),Pi=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiPaper"}),n=bi(),{className:i,component:a="div",elevation:o=1,square:l=!1,variant:c="elevation",...u}=r,h={...r,component:a,elevation:o,square:l,variant:c},p=(e=>{const{square:t,elevation:r,variant:n,classes:i}=e;return Wn({root:["root",n,!t&&"rounded","elevation"===n&&`elevation${r}`]},Ei,i)})(h);return(0,s.jsx)(Ci,{as:a,ownerState:h,className:Gn(p.root,i),ref:t,...u,style:{..."elevation"===c&&{"--Paper-shadow":(n.vars||n).shadows[o],...n.vars&&{"--Paper-overlay":n.vars.overlays?.[o]},...!n.vars&&"dark"===n.palette.mode&&{"--Paper-overlay":`linear-gradient(${Tr("#fff",gn(o))}, ${Tr("#fff",gn(o))})`}},...u.style}})}));function Li(e){return Ai("MuiCard",e)}Mi("MuiCard",["root"]);const Ii=gi(Pi,{name:"MuiCard",slot:"Root",overridesResolver:(e,t)=>t.root})({overflow:"hidden"}),zi=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCard"}),{className:n,raised:i=!1,...a}=r,o={...r,raised:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Li,t)})(o);return(0,s.jsx)(Ii,{className:Gn(l.root,n),elevation:i?8:void 0,ref:t,ownerState:o,...a})})),Oi=Xe;function Ri(e){return Ai("MuiSvgIcon",e)}Mi("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Di=gi("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"inherit"!==r.color&&t[`color${Oi(r.color)}`],t[`fontSize${Oi(r.fontSize)}`]]}})(wi((e=>{let{theme:t}=e;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:t.transitions?.create?.("fill",{duration:(t.vars??t).transitions?.duration?.shorter}),variants:[{props:e=>!e.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:t.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:t.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:t.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((t.vars??t).palette).filter((e=>{let[,t]=e;return t&&t.main})).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars??t).palette?.[r]?.main}}})),{props:{color:"action"},style:{color:(t.vars??t).palette?.action?.active}},{props:{color:"disabled"},style:{color:(t.vars??t).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}}))),ji=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSvgIcon"}),{children:i,className:a,color:o="inherit",component:l="svg",fontSize:c="medium",htmlColor:u,inheritViewBox:h=!1,titleAccess:p,viewBox:d="0 0 24 24",...f}=n,m=e.isValidElement(i)&&"svg"===i.type,g={...n,color:o,component:l,fontSize:c,instanceFontSize:t.fontSize,inheritViewBox:h,viewBox:d,hasSvgAsChild:m},y={};h||(y.viewBox=d);const v=(e=>{const{color:t,fontSize:r,classes:n}=e;return Wn({root:["root","inherit"!==t&&`color${Oi(t)}`,`fontSize${Oi(r)}`]},Ri,n)})(g);return(0,s.jsxs)(Di,{as:l,className:Gn(v.root,a),focusable:"false",color:u,"aria-hidden":!p||void 0,role:p?"img":void 0,ref:r,...y,...f,...m&&i.props,ownerState:g,children:[m?i.props.children:i,p?(0,s.jsx)("title",{children:p}):null]})}));ji.muiName="SvgIcon";const Fi=ji;function Bi(t,r){function n(e,r){return(0,s.jsx)(Fi,{"data-testid":void 0,ref:r,...e,children:t})}return n.muiName=Fi.muiName,e.memo(e.forwardRef(n))}const Ni=Bi((0,s.jsx)("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"}));function Ui(e){return Ai("MuiAvatar",e)}Mi("MuiAvatar",["root","colorDefault","circular","rounded","square","img","fallback"]);function Vi(e,t){"function"===typeof e?e(t):e&&(e.current=t)}function qi(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return e.useMemo((()=>r.every((e=>null==e))?null:e=>{r.forEach((t=>{Vi(t,e)}))}),r)}const Hi=function(e){return"string"===typeof e};const Gi=function(e,t,r){return void 0===e||Hi(e)?t:{...t,ownerState:{...t.ownerState,...r}}};const Wi=function(e,t,r){return"function"===typeof e?e(t,r):e};const $i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(void 0===e)return{};const r={};return Object.keys(e).filter((r=>r.match(/^on[A-Z]/)&&"function"===typeof e[r]&&!t.includes(r))).forEach((t=>{r[t]=e[t]})),r};const Zi=function(e){if(void 0===e)return{};const t={};return Object.keys(e).filter((t=>!(t.match(/^on[A-Z]/)&&"function"===typeof e[t]))).forEach((r=>{t[r]=e[r]})),t};const Xi=function(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:i,className:a}=e;if(!t){const e=Gn(r?.className,a,i?.className,n?.className),t={...r?.style,...i?.style,...n?.style},o={...r,...i,...n};return e.length>0&&(o.className=e),Object.keys(t).length>0&&(o.style=t),{props:o,internalRef:void 0}}const o=$i({...i,...n}),s=Zi(n),l=Zi(i),c=t(o),u=Gn(c?.className,r?.className,a,i?.className,n?.className),h={...c?.style,...r?.style,...i?.style,...n?.style},p={...c,...r,...l,...s};return u.length>0&&(p.className=u),Object.keys(h).length>0&&(p.style=h),{props:p,internalRef:c.ref}};function Yi(e,t){const{className:r,elementType:n,ownerState:i,externalForwardedProps:a,internalForwardedProps:o,shouldForwardComponentProp:s=!1,...l}=t,{component:c,slots:u={[e]:void 0},slotProps:h={[e]:void 0},...p}=a,d=u[e]||n,f=Wi(h[e],i),{props:{component:m,...g},internalRef:y}=Xi({className:r,...l,externalForwardedProps:"root"===e?p:void 0,externalSlotProps:f}),v=qi(y,f?.ref,t.ref),x="root"===e?m||c:m;return[d,Gi(d,{..."root"===e&&!c&&!u[e]&&o,..."root"!==e&&!u[e]&&o,...g,...x&&!s&&{as:x},...x&&s&&{component:x},ref:v},i)]}const Ki=gi("div",{name:"MuiAvatar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],r.colorDefault&&t.colorDefault]}})(wi((e=>{let{theme:t}=e;return{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:40,height:40,fontFamily:t.typography.fontFamily,fontSize:t.typography.pxToRem(20),lineHeight:1,borderRadius:"50%",overflow:"hidden",userSelect:"none",variants:[{props:{variant:"rounded"},style:{borderRadius:(t.vars||t).shape.borderRadius}},{props:{variant:"square"},style:{borderRadius:0}},{props:{colorDefault:!0},style:{color:(t.vars||t).palette.background.default,...t.vars?{backgroundColor:t.vars.palette.Avatar.defaultBg}:{backgroundColor:t.palette.grey[400],...t.applyStyles("dark",{backgroundColor:t.palette.grey[600]})}}}]}}))),Ji=gi("img",{name:"MuiAvatar",slot:"Img",overridesResolver:(e,t)=>t.img})({width:"100%",height:"100%",textAlign:"center",objectFit:"cover",color:"transparent",textIndent:1e4}),Qi=gi(Ni,{name:"MuiAvatar",slot:"Fallback",overridesResolver:(e,t)=>t.fallback})({width:"75%",height:"75%"});const ea=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAvatar"}),{alt:i,children:a,className:o,component:l="div",slots:c={},slotProps:u={},imgProps:h,sizes:p,src:d,srcSet:f,variant:m="circular",...g}=n;let y=null;const v={...n,component:l,variant:m},x=function(t){let{crossOrigin:r,referrerPolicy:n,src:i,srcSet:a}=t;const[o,s]=e.useState(!1);return e.useEffect((()=>{if(!i&&!a)return;s(!1);let e=!0;const t=new Image;return t.onload=()=>{e&&s("loaded")},t.onerror=()=>{e&&s("error")},t.crossOrigin=r,t.referrerPolicy=n,t.src=i,a&&(t.srcset=a),()=>{e=!1}}),[r,n,i,a]),o}({...h,..."function"===typeof u.img?u.img(v):u.img,src:d,srcSet:f}),b=d||f,_=b&&"error"!==x;v.colorDefault=!_,delete v.ownerState;const w=(e=>{const{classes:t,variant:r,colorDefault:n}=e;return Wn({root:["root",r,n&&"colorDefault"],img:["img"],fallback:["fallback"]},Ui,t)})(v),[k,T]=Yi("img",{className:w.img,elementType:Ji,externalForwardedProps:{slots:c,slotProps:{img:{...h,...u.img}}},additionalProps:{alt:i,src:d,srcSet:f,sizes:p},ownerState:v});return y=_?(0,s.jsx)(k,{...T}):a||0===a?a:b&&i?i[0]:(0,s.jsx)(Qi,{ownerState:v,className:w.fallback}),(0,s.jsx)(Ki,{as:l,className:Gn(w.root,o),ref:r,...g,ownerState:v,children:y})}));const ta=function(e){const{elementType:t,externalSlotProps:r,ownerState:n,skipResolvingSlotProps:i=!1,...a}=e,o=i?{}:Wi(r,n),{props:s,internalRef:l}=Xi({...a,externalSlotProps:o}),c=qi(l,o?.ref,e.additionalProps?.ref);return Gi(t,{...s,ref:c},n)};function ra(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:166;function n(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];clearTimeout(t),t=setTimeout((()=>{e.apply(this,i)}),r)}return n.clear=()=>{clearTimeout(t)},n}const na=ra;function ia(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}const aa=sr;function oa(e){return e&&e.ownerDocument||document}function sa(e){return oa(e).defaultView||window}const la=sa,ca={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};const ua=Bi((0,s.jsx)("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),ha=Bi((0,s.jsx)("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function pa(e){try{return e.matches(":focus-visible")}catch(t){0}return!1}const da=qi;const fa=function(t){const r=e.useRef(t);return sr((()=>{r.current=t})),e.useRef((function(){return(0,r.current)(...arguments)})).current},ma=fa,ga={};function ya(t,r){const n=e.useRef(ga);return n.current===ga&&(n.current=t(r)),n}class va{static create(){return new va}static use(){const t=ya(va.create).current,[r,n]=e.useState(!1);return t.shouldMount=r,t.setShouldMount=n,e.useEffect(t.mountEffect,[r]),t}constructor(){this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}mount(){return this.mounted||(this.mounted=function(){let e,t;const r=new Promise(((r,n)=>{e=r,t=n}));return r.resolve=e,r.reject=t,r}(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}mountEffect=()=>{this.shouldMount&&!this.didMount&&null!==this.ref.current&&(this.didMount=!0,this.mounted.resolve())};start(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.mount().then((()=>this.ref.current?.start(...t)))}stop(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.mount().then((()=>this.ref.current?.stop(...t)))}pulsate(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.mount().then((()=>this.ref.current?.pulsate(...t)))}}function xa(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}function ba(e,t){return ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ba(e,t)}function _a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ba(e,t)}const wa=e.createContext(null);function ka(t,r){var n=Object.create(null);return t&&e.Children.map(t,(function(e){return e})).forEach((function(t){n[t.key]=function(t){return r&&(0,e.isValidElement)(t)?r(t):t}(t)})),n}function Ta(e,t,r){return null!=r[t]?r[t]:e.props[t]}function Sa(t,r,n){var i=ka(t.children),a=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,i=Object.create(null),a=[];for(var o in e)o in t?a.length&&(i[o]=a,a=[]):a.push(o);var s={};for(var l in t){if(i[l])for(n=0;n<i[l].length;n++){var c=i[l][n];s[i[l][n]]=r(c)}s[l]=r(l)}for(n=0;n<a.length;n++)s[a[n]]=r(a[n]);return s}(r,i);return Object.keys(a).forEach((function(o){var s=a[o];if((0,e.isValidElement)(s)){var l=o in r,c=o in i,u=r[o],h=(0,e.isValidElement)(u)&&!u.props.in;!c||l&&!h?c||!l||h?c&&l&&(0,e.isValidElement)(u)&&(a[o]=(0,e.cloneElement)(s,{onExited:n.bind(null,s),in:u.props.in,exit:Ta(s,"exit",t),enter:Ta(s,"enter",t)})):a[o]=(0,e.cloneElement)(s,{in:!1}):a[o]=(0,e.cloneElement)(s,{onExited:n.bind(null,s),in:!0,exit:Ta(s,"exit",t),enter:Ta(s,"enter",t)})}})),a}var Aa=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},Ma=function(t){function r(e,r){var n,i=(n=t.call(this,e,r)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n));return n.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},n}_a(r,t);var n=r.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},r.getDerivedStateFromProps=function(t,r){var n,i,a=r.children,o=r.handleExited;return{children:r.firstRender?(n=t,i=o,ka(n.children,(function(t){return(0,e.cloneElement)(t,{onExited:i.bind(null,t),in:!0,appear:Ta(t,"appear",n),enter:Ta(t,"enter",n),exit:Ta(t,"exit",n)})}))):Sa(t,a,o),firstRender:!1}},n.handleExited=function(e,t){var r=ka(this.props.children);e.key in r||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var r=$n({},t.children);return delete r[e.key],{children:r}})))},n.render=function(){var t=this.props,r=t.component,n=t.childFactory,i=xa(t,["component","childFactory"]),a=this.state.contextValue,o=Aa(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===r?e.createElement(wa.Provider,{value:a},o):e.createElement(wa.Provider,{value:a},e.createElement(r,i,o))},r}(e.Component);Ma.propTypes={},Ma.defaultProps={component:"div",childFactory:function(e){return e}};const Ea=Ma,Ca=[];class Pa{static create(){return new Pa}currentId=null;start(e,t){this.clear(),this.currentId=setTimeout((()=>{this.currentId=null,t()}),e)}clear=()=>{null!==this.currentId&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function La(){const t=ya(Pa.create).current;var r;return r=t.disposeEffect,e.useEffect(r,Ca),t}const Ia=function(t){const{className:r,classes:n,pulsate:i=!1,rippleX:a,rippleY:o,rippleSize:l,in:c,onExited:u,timeout:h}=t,[p,d]=e.useState(!1),f=Gn(r,n.ripple,n.rippleVisible,i&&n.ripplePulsate),m={width:l,height:l,top:-l/2+o,left:-l/2+a},g=Gn(n.child,p&&n.childLeaving,i&&n.childPulsate);return c||p||d(!0),e.useEffect((()=>{if(!c&&null!=u){const e=setTimeout(u,h);return()=>{clearTimeout(e)}}}),[u,c,h]),(0,s.jsx)("span",{className:f,style:m,children:(0,s.jsx)("span",{className:g})})};const za=Mi("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Oa=ar`
0% {
transform: scale(0);
opacity: 0.1;
}
100% {
transform: scale(1);
opacity: 0.3;
}
`,Ra=ar`
0% {
opacity: 1;
}
100% {
opacity: 0;
}
`,Da=ar`
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
`,ja=gi("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Fa=gi(Ia,{name:"MuiTouchRipple",slot:"Ripple"})`
opacity: 0;
position: absolute;
&.${za.rippleVisible} {
opacity: 0.3;
transform: scale(1);
animation-name: ${Oa};
animation-duration: ${550}ms;
animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}};
}
&.${za.ripplePulsate} {
animation-duration: ${e=>{let{theme:t}=e;return t.transitions.duration.shorter}}ms;
}
& .${za.child} {
opacity: 1;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
background-color: currentColor;
}
& .${za.childLeaving} {
opacity: 0;
animation-name: ${Ra};
animation-duration: ${550}ms;
animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}};
}
& .${za.childPulsate} {
position: absolute;
/* @noflip */
left: 0px;
top: 0;
animation-name: ${Da};
animation-duration: 2500ms;
animation-timing-function: ${e=>{let{theme:t}=e;return t.transitions.easing.easeInOut}};
animation-iteration-count: infinite;
animation-delay: 200ms;
}
`,Ba=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTouchRipple"}),{center:i=!1,classes:a={},className:o,...l}=n,[c,u]=e.useState([]),h=e.useRef(0),p=e.useRef(null);e.useEffect((()=>{p.current&&(p.current(),p.current=null)}),[c]);const d=e.useRef(!1),f=La(),m=e.useRef(null),g=e.useRef(null),y=e.useCallback((e=>{const{pulsate:t,rippleX:r,rippleY:n,rippleSize:i,cb:o}=e;u((e=>[...e,(0,s.jsx)(Fa,{classes:{ripple:Gn(a.ripple,za.ripple),rippleVisible:Gn(a.rippleVisible,za.rippleVisible),ripplePulsate:Gn(a.ripplePulsate,za.ripplePulsate),child:Gn(a.child,za.child),childLeaving:Gn(a.childLeaving,za.childLeaving),childPulsate:Gn(a.childPulsate,za.childPulsate)},timeout:550,pulsate:t,rippleX:r,rippleY:n,rippleSize:i},h.current)])),h.current+=1,p.current=o}),[a]),v=e.useCallback((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{};const{pulsate:n=!1,center:a=i||t.pulsate,fakeElement:o=!1}=t;if("mousedown"===e?.type&&d.current)return void(d.current=!1);"touchstart"===e?.type&&(d.current=!0);const s=o?null:g.current,l=s?s.getBoundingClientRect():{width:0,height:0,left:0,top:0};let c,u,h;if(a||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)c=Math.round(l.width/2),u=Math.round(l.height/2);else{const{clientX:t,clientY:r}=e.touches&&e.touches.length>0?e.touches[0]:e;c=Math.round(t-l.left),u=Math.round(r-l.top)}if(a)h=Math.sqrt((2*l.width**2+l.height**2)/3),h%2===0&&(h+=1);else{const e=2*Math.max(Math.abs((s?s.clientWidth:0)-c),c)+2,t=2*Math.max(Math.abs((s?s.clientHeight:0)-u),u)+2;h=Math.sqrt(e**2+t**2)}e?.touches?null===m.current&&(m.current=()=>{y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})},f.start(80,(()=>{m.current&&(m.current(),m.current=null)}))):y({pulsate:n,rippleX:c,rippleY:u,rippleSize:h,cb:r})}),[i,y,f]),x=e.useCallback((()=>{v({},{pulsate:!0})}),[v]),b=e.useCallback(((e,t)=>{if(f.clear(),"touchend"===e?.type&&m.current)return m.current(),m.current=null,void f.start(0,(()=>{b(e,t)}));m.current=null,u((e=>e.length>0?e.slice(1):e)),p.current=t}),[f]);return e.useImperativeHandle(r,(()=>({pulsate:x,start:v,stop:b})),[x,v,b]),(0,s.jsx)(ja,{className:Gn(za.root,a.root,o),ref:g,...l,children:(0,s.jsx)(Ea,{component:null,exit:!0,children:c})})}));function Na(e){return Ai("MuiButtonBase",e)}const Ua=Mi("MuiButtonBase",["root","disabled","focusVisible"]),Va=gi("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Ua.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}});function qa(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return ma((i=>(r&&r(i),n||e[t](i),!0)))}const Ha=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiButtonBase"}),{action:i,centerRipple:a=!1,children:o,className:l,component:c="button",disabled:u=!1,disableRipple:h=!1,disableTouchRipple:p=!1,focusRipple:d=!1,focusVisibleClassName:f,LinkComponent:m="a",onBlur:g,onClick:y,onContextMenu:v,onDragLeave:x,onFocus:b,onFocusVisible:_,onKeyDown:w,onKeyUp:k,onMouseDown:T,onMouseLeave:S,onMouseUp:A,onTouchEnd:M,onTouchMove:E,onTouchStart:C,tabIndex:P=0,TouchRippleProps:L,touchRippleRef:I,type:z,...O}=n,R=e.useRef(null),D=va.use(),j=da(D.ref,I),[F,B]=e.useState(!1);u&&F&&B(!1),e.useImperativeHandle(i,(()=>({focusVisible:()=>{B(!0),R.current.focus()}})),[]);const N=D.shouldMount&&!h&&!u;e.useEffect((()=>{F&&d&&!h&&D.pulsate()}),[h,d,F,D]);const U=qa(D,"start",T,p),V=qa(D,"stop",v,p),q=qa(D,"stop",x,p),H=qa(D,"stop",A,p),G=qa(D,"stop",(e=>{F&&e.preventDefault(),S&&S(e)}),p),W=qa(D,"start",C,p),$=qa(D,"stop",M,p),Z=qa(D,"stop",E,p),X=qa(D,"stop",(e=>{pa(e.target)||B(!1),g&&g(e)}),!1),Y=ma((e=>{R.current||(R.current=e.currentTarget),pa(e.target)&&(B(!0),_&&_(e)),b&&b(e)})),K=()=>{const e=R.current;return c&&"button"!==c&&!("A"===e.tagName&&e.href)},J=ma((e=>{d&&!e.repeat&&F&&" "===e.key&&D.stop(e,(()=>{D.start(e)})),e.target===e.currentTarget&&K()&&" "===e.key&&e.preventDefault(),w&&w(e),e.target===e.currentTarget&&K()&&"Enter"===e.key&&!u&&(e.preventDefault(),y&&y(e))})),Q=ma((e=>{d&&" "===e.key&&F&&!e.defaultPrevented&&D.stop(e,(()=>{D.pulsate(e)})),k&&k(e),y&&e.target===e.currentTarget&&K()&&" "===e.key&&!e.defaultPrevented&&y(e)}));let ee=c;"button"===ee&&(O.href||O.to)&&(ee=m);const te={};"button"===ee?(te.type=void 0===z?"button":z,te.disabled=u):(O.href||O.to||(te.role="button"),u&&(te["aria-disabled"]=u));const re=da(r,R),ne={...n,centerRipple:a,component:c,disabled:u,disableRipple:h,disableTouchRipple:p,focusRipple:d,tabIndex:P,focusVisible:F},ie=(e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:i}=e,a=Wn({root:["root",t&&"disabled",r&&"focusVisible"]},Na,i);return r&&n&&(a.root+=` ${n}`),a})(ne);return(0,s.jsxs)(Va,{as:ee,className:Gn(ie.root,l),ownerState:ne,onBlur:X,onClick:y,onContextMenu:V,onFocus:Y,onKeyDown:J,onKeyUp:Q,onMouseDown:U,onMouseLeave:G,onMouseUp:H,onDragLeave:q,onTouchEnd:$,onTouchMove:Z,onTouchStart:W,ref:re,tabIndex:u?-1:P,type:z,...te,...O,children:[o,N?(0,s.jsx)(Ba,{ref:j,center:a,...L}):null]})}));function Ga(e){return Ai("MuiTabScrollButton",e)}const Wa=Mi("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),$a=gi(Ha,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Wa.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),Za=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTabScrollButton"}),{className:n,slots:i={},slotProps:a={},direction:o,orientation:l,disabled:c,...u}=r,h=je(),p={isRtl:h,...r},d=(e=>{const{classes:t,orientation:r,disabled:n}=e;return Wn({root:["root",r,n&&"disabled"]},Ga,t)})(p),f=i.StartScrollButtonIcon??ua,m=i.EndScrollButtonIcon??ha,g=ta({elementType:f,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p}),y=ta({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p});return(0,s.jsx)($a,{component:"div",className:Gn(d.root,n),ref:t,role:null,ownerState:p,tabIndex:null,...u,style:{...u.style,..."vertical"===l&&{"--TabScrollButton-svgRotate":`rotate(${h?-90:90}deg)`}},children:"left"===o?(0,s.jsx)(f,{...g}):(0,s.jsx)(m,{...y})})}));function Xa(e){return Ai("MuiTabs",e)}const Ya=Mi("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),Ka=oa,Ja=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,Qa=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,eo=(e,t,r)=>{let n=!1,i=r(e,t);for(;i;){if(i===e.firstChild){if(n)return;n=!0}const t=i.disabled||"true"===i.getAttribute("aria-disabled");if(i.hasAttribute("tabindex")&&!t)return void i.focus();i=r(e,i)}},to=gi("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Ya.scrollButtons}`]:t.scrollButtons},{[`& .${Ya.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(wi((e=>{let{theme:t}=e;return{overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:e=>{let{ownerState:t}=e;return t.vertical},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.scrollButtonsHideMobile},style:{[`& .${Ya.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}}}]}}))),ro=gi("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:e=>{let{ownerState:t}=e;return t.fixed},style:{overflowX:"hidden",width:"100%"}},{props:e=>{let{ownerState:t}=e;return t.hideScrollbar},style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:e=>{let{ownerState:t}=e;return t.scrollableX},style:{overflowX:"auto",overflowY:"hidden"}},{props:e=>{let{ownerState:t}=e;return t.scrollableY},style:{overflowY:"auto",overflowX:"hidden"}}]}),no=gi("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.list,t.flexContainer,r.vertical&&t.flexContainerVertical,r.centered&&t.centered]}})({display:"flex",variants:[{props:e=>{let{ownerState:t}=e;return t.vertical},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.centered},style:{justifyContent:"center"}}]}),io=gi("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(wi((e=>{let{theme:t}=e;return{position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(t.vars||t).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(t.vars||t).palette.secondary.main}},{props:e=>{let{ownerState:t}=e;return t.vertical},style:{height:"100%",width:2,right:0}}]}}))),ao=gi((function(t){const{onChange:r,...n}=t,i=e.useRef(),a=e.useRef(null),o=()=>{i.current=a.current.offsetHeight-a.current.clientHeight};return aa((()=>{const e=na((()=>{const e=i.current;o(),e!==i.current&&r(i.current)})),t=la(a.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[r]),e.useEffect((()=>{o(),r(i.current)}),[r]),(0,s.jsx)("div",{style:ca,...n,ref:a})}))({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),oo={};const so=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTabs"}),i=bi(),a=je(),{"aria-label":o,"aria-labelledby":l,action:c,centered:u=!1,children:h,className:p,component:d="div",allowScrollButtonsMobile:f=!1,indicatorColor:m="primary",onChange:g,orientation:y="horizontal",ScrollButtonComponent:v,scrollButtons:x="auto",selectionFollowsFocus:b,slots:_={},slotProps:w={},TabIndicatorProps:k={},TabScrollButtonProps:T={},textColor:S="primary",value:A,variant:M="standard",visibleScrollbar:E=!1,...C}=n,P="scrollable"===M,L="vertical"===y,I=L?"scrollTop":"scrollLeft",z=L?"top":"left",O=L?"bottom":"right",R=L?"clientHeight":"clientWidth",D=L?"height":"width",j={...n,component:d,allowScrollButtonsMobile:f,indicatorColor:m,orientation:y,vertical:L,scrollButtons:x,textColor:S,variant:M,visibleScrollbar:E,fixed:!P,hideScrollbar:P&&!E,scrollableX:P&&!L,scrollableY:P&&L,centered:u&&!P,scrollButtonsHideMobile:!f},F=(e=>{const{vertical:t,fixed:r,hideScrollbar:n,scrollableX:i,scrollableY:a,centered:o,scrollButtonsHideMobile:s,classes:l}=e;return Wn({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",i&&"scrollableX",a&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",o&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[i&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},Xa,l)})(j),B=ta({elementType:_.StartScrollButtonIcon,externalSlotProps:w.startScrollButtonIcon,ownerState:j}),N=ta({elementType:_.EndScrollButtonIcon,externalSlotProps:w.endScrollButtonIcon,ownerState:j});const[U,V]=e.useState(!1),[q,H]=e.useState(oo),[G,W]=e.useState(!1),[$,Z]=e.useState(!1),[X,Y]=e.useState(!1),[K,J]=e.useState({overflow:"hidden",scrollbarWidth:0}),Q=new Map,ee=e.useRef(null),te=e.useRef(null),re={slots:_,slotProps:{indicator:k,scrollButton:T,...w}},ne=()=>{const e=ee.current;let t,r;if(e){const r=e.getBoundingClientRect();t={clientWidth:e.clientWidth,scrollLeft:e.scrollLeft,scrollTop:e.scrollTop,scrollWidth:e.scrollWidth,top:r.top,bottom:r.bottom,left:r.left,right:r.right}}if(e&&!1!==A){const e=te.current.children;if(e.length>0){const t=e[Q.get(A)];0,r=t?t.getBoundingClientRect():null}}return{tabsMeta:t,tabMeta:r}},ie=ma((()=>{const{tabsMeta:e,tabMeta:t}=ne();let r,n=0;L?(r="top",t&&e&&(n=t.top-e.top+e.scrollTop)):(r=a?"right":"left",t&&e&&(n=(a?-1:1)*(t[r]-e[r]+e.scrollLeft)));const i={[r]:n,[D]:t?t[D]:0};if("number"!==typeof q[r]||"number"!==typeof q[D])H(i);else{const e=Math.abs(q[r]-i[r]),t=Math.abs(q[D]-i[D]);(e>=1||t>=1)&&H(i)}})),ae=function(e){let{animation:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t?function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:()=>{};const{ease:a=ia,duration:o=300}=n;let s=null;const l=t[e];let c=!1;const u=()=>{c=!0},h=n=>{if(c)return void i(new Error("Animation cancelled"));null===s&&(s=n);const u=Math.min(1,(n-s)/o);t[e]=a(u)*(r-l)+l,u>=1?requestAnimationFrame((()=>{i(null)})):requestAnimationFrame(h)};l===r?i(new Error("Element already at target position")):requestAnimationFrame(h)}(I,ee.current,e,{duration:i.transitions.duration.standard}):ee.current[I]=e},oe=e=>{let t=ee.current[I];t+=L?e:e*(a?-1:1),ae(t)},se=()=>{const e=ee.current[R];let t=0;const r=Array.from(te.current.children);for(let n=0;n<r.length;n+=1){const i=r[n];if(t+i[R]>e){0===n&&(t=e);break}t+=i[R]}return t},le=()=>{oe(-1*se())},ce=()=>{oe(se())},[ue,{onChange:he,...pe}]=Yi("scrollbar",{className:Gn(F.scrollableX,F.hideScrollbar),elementType:ao,shouldForwardComponentProp:!0,externalForwardedProps:re,ownerState:j}),de=e.useCallback((e=>{he?.(e),J({overflow:null,scrollbarWidth:e})}),[he]),[fe,me]=Yi("scrollButtons",{className:Gn(F.scrollButtons,T.className),elementType:Za,externalForwardedProps:re,ownerState:j,additionalProps:{orientation:y,slots:{StartScrollButtonIcon:_.startScrollButtonIcon||_.StartScrollButtonIcon,EndScrollButtonIcon:_.endScrollButtonIcon||_.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:B,endScrollButtonIcon:N}}}),ge=ma((e=>{const{tabsMeta:t,tabMeta:r}=ne();if(r&&t)if(r[z]<t[z]){const n=t[I]+(r[z]-t[z]);ae(n,{animation:e})}else if(r[O]>t[O]){const n=t[I]+(r[O]-t[O]);ae(n,{animation:e})}})),ye=ma((()=>{P&&!1!==x&&Y(!X)}));e.useEffect((()=>{const e=na((()=>{ee.current&&ie()}));let t;const r=r=>{r.forEach((e=>{e.removedNodes.forEach((e=>{t?.unobserve(e)})),e.addedNodes.forEach((e=>{t?.observe(e)}))})),e(),ye()},n=la(ee.current);let i;return n.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(t=new ResizeObserver(e),Array.from(te.current.children).forEach((e=>{t.observe(e)}))),"undefined"!==typeof MutationObserver&&(i=new MutationObserver(r),i.observe(te.current,{childList:!0})),()=>{e.clear(),n.removeEventListener("resize",e),i?.disconnect(),t?.disconnect()}}),[ie,ye]),e.useEffect((()=>{const e=Array.from(te.current.children),t=e.length;if("undefined"!==typeof IntersectionObserver&&t>0&&P&&!1!==x){const r=e[0],n=e[t-1],i={root:ee.current,threshold:.99},a=new IntersectionObserver((e=>{W(!e[0].isIntersecting)}),i);a.observe(r);const o=new IntersectionObserver((e=>{Z(!e[0].isIntersecting)}),i);return o.observe(n),()=>{a.disconnect(),o.disconnect()}}}),[P,x,X,h?.length]),e.useEffect((()=>{V(!0)}),[]),e.useEffect((()=>{ie()})),e.useEffect((()=>{ge(oo!==q)}),[ge,q]),e.useImperativeHandle(c,(()=>({updateIndicator:ie,updateScrollButtons:ye})),[ie,ye]);const[ve,xe]=Yi("indicator",{className:Gn(F.indicator,k.className),elementType:io,externalForwardedProps:re,ownerState:j,additionalProps:{style:q}}),be=(0,s.jsx)(ve,{...xe});let _e=0;const we=e.Children.map(h,(t=>{if(!e.isValidElement(t))return null;const r=void 0===t.props.value?_e:t.props.value;Q.set(r,_e);const n=r===A;return _e+=1,e.cloneElement(t,{fullWidth:"fullWidth"===M,indicator:n&&!U&&be,selected:n,selectionFollowsFocus:b,onChange:g,textColor:S,value:r,...1!==_e||!1!==A||t.props.tabIndex?{}:{tabIndex:0}})})),ke=(()=>{const e={};e.scrollbarSizeListener=P?(0,s.jsx)(ue,{...pe,onChange:de}):null;const t=P&&("auto"===x&&(G||$)||!0===x);return e.scrollButtonStart=t?(0,s.jsx)(fe,{direction:a?"right":"left",onClick:le,disabled:!G,...me}):null,e.scrollButtonEnd=t?(0,s.jsx)(fe,{direction:a?"left":"right",onClick:ce,disabled:!$,...me}):null,e})(),[Te,Se]=Yi("root",{ref:r,className:Gn(F.root,p),elementType:to,externalForwardedProps:{...re,...C,component:d},ownerState:j}),[Ae,Me]=Yi("scroller",{ref:ee,className:F.scroller,elementType:ro,externalForwardedProps:re,ownerState:j,additionalProps:{style:{overflow:K.overflow,[L?"margin"+(a?"Left":"Right"):"marginBottom"]:E?void 0:-K.scrollbarWidth}}}),[Ee,Ce]=Yi("list",{ref:te,className:Gn(F.list,F.flexContainer),elementType:no,externalForwardedProps:re,ownerState:j,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{if(e.altKey||e.shiftKey||e.ctrlKey||e.metaKey)return;const t=te.current,r=Ka(t).activeElement;if("tab"!==r.getAttribute("role"))return;let n="horizontal"===y?"ArrowLeft":"ArrowUp",i="horizontal"===y?"ArrowRight":"ArrowDown";switch("horizontal"===y&&a&&(n="ArrowRight",i="ArrowLeft"),e.key){case n:e.preventDefault(),eo(t,r,Qa);break;case i:e.preventDefault(),eo(t,r,Ja);break;case"Home":e.preventDefault(),eo(t,null,Ja);break;case"End":e.preventDefault(),eo(t,null,Qa)}})(t),e.onKeyDown?.(t)}})});return(0,s.jsxs)(Te,{...Se,children:[ke.scrollButtonStart,ke.scrollbarSizeListener,(0,s.jsxs)(Ae,{...Me,children:[(0,s.jsx)(Ee,{"aria-label":o,"aria-labelledby":l,"aria-orientation":"vertical"===y?"vertical":null,role:"tablist",...Ce,children:we}),U&&be]}),ke.scrollButtonEnd]})}));function lo(e){return Ai("MuiTab",e)}const co=Mi("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),uo=gi(Ha,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.label&&r.icon&&t.labelIcon,t[`textColor${Oi(r.textColor)}`],r.fullWidth&&t.fullWidth,r.wrapped&&t.wrapped,{[`& .${co.iconWrapper}`]:t.iconWrapper},{[`& .${co.icon}`]:t.icon}]}})(wi((e=>{let{theme:t}=e;return{...t.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:e=>{let{ownerState:t}=e;return t.label&&("top"===t.iconPosition||"bottom"===t.iconPosition)},style:{flexDirection:"column"}},{props:e=>{let{ownerState:t}=e;return t.label&&"top"!==t.iconPosition&&"bottom"!==t.iconPosition},style:{flexDirection:"row"}},{props:e=>{let{ownerState:t}=e;return t.icon&&t.label},style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"top"===r},style:{[`& > .${co.icon}`]:{marginBottom:6}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"bottom"===r},style:{[`& > .${co.icon}`]:{marginTop:6}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"start"===r},style:{[`& > .${co.icon}`]:{marginRight:t.spacing(1)}}},{props:e=>{let{ownerState:t,iconPosition:r}=e;return t.icon&&t.label&&"end"===r},style:{[`& > .${co.icon}`]:{marginLeft:t.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${co.selected}`]:{opacity:1},[`&.${co.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${co.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${co.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(t.vars||t).palette.text.secondary,[`&.${co.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${co.disabled}`]:{color:(t.vars||t).palette.text.disabled}}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:e=>{let{ownerState:t}=e;return t.wrapped},style:{fontSize:t.typography.pxToRem(12)}}]}}))),ho=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTab"}),{className:i,disabled:a=!1,disableFocusRipple:o=!1,fullWidth:l,icon:c,iconPosition:u="top",indicator:h,label:p,onChange:d,onClick:f,onFocus:m,selected:g,selectionFollowsFocus:y,textColor:v="inherit",value:x,wrapped:b=!1,..._}=n,w={...n,disabled:a,disableFocusRipple:o,selected:g,icon:!!c,iconPosition:u,label:!!p,fullWidth:l,textColor:v,wrapped:b},k=(e=>{const{classes:t,textColor:r,fullWidth:n,wrapped:i,icon:a,label:o,selected:s,disabled:l}=e;return Wn({root:["root",a&&o&&"labelIcon",`textColor${Oi(r)}`,n&&"fullWidth",i&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]},lo,t)})(w),T=c&&p&&e.isValidElement(c)?e.cloneElement(c,{className:Gn(k.icon,c.props.className)}):c;return(0,s.jsxs)(uo,{focusRipple:!o,className:Gn(k.root,i),ref:r,role:"tab","aria-selected":g,disabled:a,onClick:e=>{!g&&d&&d(e,x),f&&f(e)},onFocus:e=>{y&&!g&&d&&d(e,x),m&&m(e)},ownerState:w,tabIndex:g?0:-1,..._,children:["top"===u||"start"===u?(0,s.jsxs)(e.Fragment,{children:[T,p]}):(0,s.jsxs)(e.Fragment,{children:[p,T]}),h]})}));function po(t){return parseInt(e.version,10)>=19?t?.props?.ref||null:t?.ref||null}var fo=r(950);const mo=!1;var go="unmounted",yo="exited",vo="entering",xo="entered",bo="exiting",_o=function(t){function r(e,r){var n;n=t.call(this,e,r)||this;var i,a=r&&!r.isMounting?e.enter:e.appear;return n.appearStatus=null,e.in?a?(i=yo,n.appearStatus=vo):i=xo:i=e.unmountOnExit||e.mountOnEnter?go:yo,n.state={status:i},n.nextCallback=null,n}_a(r,t),r.getDerivedStateFromProps=function(e,t){return e.in&&t.status===go?{status:yo}:null};var n=r.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==vo&&r!==xo&&(t=vo):r!==vo&&r!==xo||(t=bo)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!==typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===vo){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:fo.findDOMNode(this);r&&function(e){e.scrollTop}(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===yo&&this.setState({status:go})},n.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,i=this.props.nodeRef?[n]:[fo.findDOMNode(this),n],a=i[0],o=i[1],s=this.getTimeouts(),l=n?s.appear:s.enter;!e&&!r||mo?this.safeSetState({status:xo},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,o),this.safeSetState({status:vo},(function(){t.props.onEntering(a,o),t.onTransitionEnd(l,(function(){t.safeSetState({status:xo},(function(){t.props.onEntered(a,o)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:fo.findDOMNode(this);t&&!mo?(this.props.onExit(n),this.safeSetState({status:bo},(function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,(function(){e.safeSetState({status:yo},(function(){e.props.onExited(n)}))}))}))):this.safeSetState({status:yo},(function(){e.props.onExited(n)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:fo.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(r&&!n){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],a=i[0],o=i[1];this.props.addEndListener(a,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var t=this.state.status;if(t===go)return null;var r=this.props,n=r.children,i=(r.in,r.mountOnEnter,r.unmountOnExit,r.appear,r.enter,r.exit,r.timeout,r.addEndListener,r.onEnter,r.onEntering,r.onEntered,r.onExit,r.onExiting,r.onExited,r.nodeRef,xa(r,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return e.createElement(wa.Provider,{value:null},"function"===typeof n?n(t,i):e.cloneElement(e.Children.only(n),i))},r}(e.Component);function wo(){}_o.contextType=wa,_o.propTypes={},_o.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:wo,onEntering:wo,onEntered:wo,onExit:wo,onExiting:wo,onExited:wo},_o.UNMOUNTED=go,_o.EXITED=yo,_o.ENTERING=vo,_o.ENTERED=xo,_o.EXITING=bo;const ko=_o,To=e=>e.scrollTop;function So(e,t){const{timeout:r,easing:n,style:i={}}=e;return{duration:i.transitionDuration??("number"===typeof r?r:r[t.mode]||0),easing:i.transitionTimingFunction??("object"===typeof n?n[t.mode]:n),delay:i.transitionDelay}}function Ao(e){return`scale(${e}, ${e**2})`}const Mo={entering:{opacity:1,transform:Ao(1)},entered:{opacity:1,transform:"none"}},Eo="undefined"!==typeof navigator&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Co=e.forwardRef((function(t,r){const{addEndListener:n,appear:i=!0,children:a,easing:o,in:l,onEnter:c,onEntered:u,onEntering:h,onExit:p,onExited:d,onExiting:f,style:m,timeout:g="auto",TransitionComponent:y=ko,...v}=t,x=La(),b=e.useRef(),_=bi(),w=e.useRef(null),k=da(w,po(a),r),T=e=>t=>{if(e){const r=w.current;void 0===t?e(r):e(r,t)}},S=T(h),A=T(((e,t)=>{To(e);const{duration:r,delay:n,easing:i}=So({style:m,timeout:g,easing:o},{mode:"enter"});let a;"auto"===g?(a=_.transitions.getAutoHeightDuration(e.clientHeight),b.current=a):a=r,e.style.transition=[_.transitions.create("opacity",{duration:a,delay:n}),_.transitions.create("transform",{duration:Eo?a:.666*a,delay:n,easing:i})].join(","),c&&c(e,t)})),M=T(u),E=T(f),C=T((e=>{const{duration:t,delay:r,easing:n}=So({style:m,timeout:g,easing:o},{mode:"exit"});let i;"auto"===g?(i=_.transitions.getAutoHeightDuration(e.clientHeight),b.current=i):i=t,e.style.transition=[_.transitions.create("opacity",{duration:i,delay:r}),_.transitions.create("transform",{duration:Eo?i:.666*i,delay:Eo?r:r||.333*i,easing:n})].join(","),e.style.opacity=0,e.style.transform=Ao(.75),p&&p(e)})),P=T(d);return(0,s.jsx)(y,{appear:i,in:l,nodeRef:w,onEnter:A,onEntered:M,onEntering:S,onExit:C,onExited:P,onExiting:E,addEndListener:e=>{"auto"===g&&x.start(b.current||0,e),n&&n(w.current,e)},timeout:"auto"===g?null:g,...v,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(a,{style:{opacity:0,transform:Ao(.75),visibility:"exited"!==t||l?void 0:"hidden",...Mo[t],...m,...a.props.style},ref:k,...i})}})}));Co&&(Co.muiSupportAuto=!0);const Po=Co;function Lo(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Io(e){return e instanceof Lo(e).Element||e instanceof Element}function zo(e){return e instanceof Lo(e).HTMLElement||e instanceof HTMLElement}function Oo(e){return"undefined"!==typeof ShadowRoot&&(e instanceof Lo(e).ShadowRoot||e instanceof ShadowRoot)}var Ro=Math.max,Do=Math.min,jo=Math.round;function Fo(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Bo(){return!/^((?!chrome|android).)*safari/i.test(Fo())}function No(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=!1);var n=e.getBoundingClientRect(),i=1,a=1;t&&zo(e)&&(i=e.offsetWidth>0&&jo(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&jo(n.height)/e.offsetHeight||1);var o=(Io(e)?Lo(e):window).visualViewport,s=!Bo()&&r,l=(n.left+(s&&o?o.offsetLeft:0))/i,c=(n.top+(s&&o?o.offsetTop:0))/a,u=n.width/i,h=n.height/a;return{width:u,height:h,top:c,right:l+u,bottom:c+h,left:l,x:l,y:c}}function Uo(e){var t=Lo(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Vo(e){return e?(e.nodeName||"").toLowerCase():null}function qo(e){return((Io(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ho(e){return No(qo(e)).left+Uo(e).scrollLeft}function Go(e){return Lo(e).getComputedStyle(e)}function Wo(e){var t=Go(e),r=t.overflow,n=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function $o(e,t,r){void 0===r&&(r=!1);var n=zo(t),i=zo(t)&&function(e){var t=e.getBoundingClientRect(),r=jo(t.width)/e.offsetWidth||1,n=jo(t.height)/e.offsetHeight||1;return 1!==r||1!==n}(t),a=qo(t),o=No(e,i,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&(("body"!==Vo(t)||Wo(a))&&(s=function(e){return e!==Lo(e)&&zo(e)?{scrollLeft:(t=e).scrollLeft,scrollTop:t.scrollTop}:Uo(e);var t}(t)),zo(t)?((l=No(t,!0)).x+=t.clientLeft,l.y+=t.clientTop):a&&(l.x=Ho(a))),{x:o.left+s.scrollLeft-l.x,y:o.top+s.scrollTop-l.y,width:o.width,height:o.height}}function Zo(e){var t=No(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Xo(e){return"html"===Vo(e)?e:e.assignedSlot||e.parentNode||(Oo(e)?e.host:null)||qo(e)}function Yo(e){return["html","body","#document"].indexOf(Vo(e))>=0?e.ownerDocument.body:zo(e)&&Wo(e)?e:Yo(Xo(e))}function Ko(e,t){var r;void 0===t&&(t=[]);var n=Yo(e),i=n===(null==(r=e.ownerDocument)?void 0:r.body),a=Lo(n),o=i?[a].concat(a.visualViewport||[],Wo(n)?n:[]):n,s=t.concat(o);return i?s:s.concat(Ko(Xo(o)))}function Jo(e){return["table","td","th"].indexOf(Vo(e))>=0}function Qo(e){return zo(e)&&"fixed"!==Go(e).position?e.offsetParent:null}function es(e){for(var t=Lo(e),r=Qo(e);r&&Jo(r)&&"static"===Go(r).position;)r=Qo(r);return r&&("html"===Vo(r)||"body"===Vo(r)&&"static"===Go(r).position)?t:r||function(e){var t=/firefox/i.test(Fo());if(/Trident/i.test(Fo())&&zo(e)&&"fixed"===Go(e).position)return null;var r=Xo(e);for(Oo(r)&&(r=r.host);zo(r)&&["html","body"].indexOf(Vo(r))<0;){var n=Go(r);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return r;r=r.parentNode}return null}(e)||t}var ts="top",rs="bottom",ns="right",is="left",as="auto",os=[ts,rs,ns,is],ss="start",ls="end",cs="viewport",us="popper",hs=os.reduce((function(e,t){return e.concat([t+"-"+ss,t+"-"+ls])}),[]),ps=[].concat(os,[as]).reduce((function(e,t){return e.concat([t,t+"-"+ss,t+"-"+ls])}),[]),ds=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function fs(e){var t=new Map,r=new Set,n=[];function i(e){r.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!r.has(e)){var n=t.get(e);n&&i(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){r.has(e.name)||i(e)})),n}function ms(e){var t;return function(){return t||(t=new Promise((function(r){Promise.resolve().then((function(){t=void 0,r(e())}))}))),t}}var gs={placement:"bottom",modifiers:[],strategy:"absolute"};function ys(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return!t.some((function(e){return!(e&&"function"===typeof e.getBoundingClientRect)}))}function vs(e){void 0===e&&(e={});var t=e,r=t.defaultModifiers,n=void 0===r?[]:r,i=t.defaultOptions,a=void 0===i?gs:i;return function(e,t,r){void 0===r&&(r=a);var i={placement:"bottom",orderedModifiers:[],options:Object.assign({},gs,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},o=[],s=!1,l={state:i,setOptions:function(r){var s="function"===typeof r?r(i.options):r;c(),i.options=Object.assign({},a,i.options,s),i.scrollParents={reference:Io(e)?Ko(e):e.contextElement?Ko(e.contextElement):[],popper:Ko(t)};var u=function(e){var t=fs(e);return ds.reduce((function(e,r){return e.concat(t.filter((function(e){return e.phase===r})))}),[])}(function(e){var t=e.reduce((function(e,t){var r=e[t.name];return e[t.name]=r?Object.assign({},r,t,{options:Object.assign({},r.options,t.options),data:Object.assign({},r.data,t.data)}):t,e}),{});return Object.keys(t).map((function(e){return t[e]}))}([].concat(n,i.options.modifiers)));return i.orderedModifiers=u.filter((function(e){return e.enabled})),i.orderedModifiers.forEach((function(e){var t=e.name,r=e.options,n=void 0===r?{}:r,a=e.effect;if("function"===typeof a){var s=a({state:i,name:t,instance:l,options:n}),c=function(){};o.push(s||c)}})),l.update()},forceUpdate:function(){if(!s){var e=i.elements,t=e.reference,r=e.popper;if(ys(t,r)){i.rects={reference:$o(t,es(r),"fixed"===i.options.strategy),popper:Zo(r)},i.reset=!1,i.placement=i.options.placement,i.orderedModifiers.forEach((function(e){return i.modifiersData[e.name]=Object.assign({},e.data)}));for(var n=0;n<i.orderedModifiers.length;n++)if(!0!==i.reset){var a=i.orderedModifiers[n],o=a.fn,c=a.options,u=void 0===c?{}:c,h=a.name;"function"===typeof o&&(i=o({state:i,options:u,name:h,instance:l})||i)}else i.reset=!1,n=-1}}},update:ms((function(){return new Promise((function(e){l.forceUpdate(),e(i)}))})),destroy:function(){c(),s=!0}};if(!ys(e,t))return l;function c(){o.forEach((function(e){return e()})),o=[]}return l.setOptions(r).then((function(e){!s&&r.onFirstUpdate&&r.onFirstUpdate(e)})),l}}var xs={passive:!0};function bs(e){return e.split("-")[0]}function _s(e){return e.split("-")[1]}function ws(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ks(e){var t,r=e.reference,n=e.element,i=e.placement,a=i?bs(i):null,o=i?_s(i):null,s=r.x+r.width/2-n.width/2,l=r.y+r.height/2-n.height/2;switch(a){case ts:t={x:s,y:r.y-n.height};break;case rs:t={x:s,y:r.y+r.height};break;case ns:t={x:r.x+r.width,y:l};break;case is:t={x:r.x-n.width,y:l};break;default:t={x:r.x,y:r.y}}var c=a?ws(a):null;if(null!=c){var u="y"===c?"height":"width";switch(o){case ss:t[c]=t[c]-(r[u]/2-n[u]/2);break;case ls:t[c]=t[c]+(r[u]/2-n[u]/2)}}return t}var Ts={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ss(e){var t,r=e.popper,n=e.popperRect,i=e.placement,a=e.variation,o=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,h=e.isFixed,p=o.x,d=void 0===p?0:p,f=o.y,m=void 0===f?0:f,g="function"===typeof u?u({x:d,y:m}):{x:d,y:m};d=g.x,m=g.y;var y=o.hasOwnProperty("x"),v=o.hasOwnProperty("y"),x=is,b=ts,_=window;if(c){var w=es(r),k="clientHeight",T="clientWidth";if(w===Lo(r)&&"static"!==Go(w=qo(r)).position&&"absolute"===s&&(k="scrollHeight",T="scrollWidth"),i===ts||(i===is||i===ns)&&a===ls)b=rs,m-=(h&&w===_&&_.visualViewport?_.visualViewport.height:w[k])-n.height,m*=l?1:-1;if(i===is||(i===ts||i===rs)&&a===ls)x=ns,d-=(h&&w===_&&_.visualViewport?_.visualViewport.width:w[T])-n.width,d*=l?1:-1}var S,A=Object.assign({position:s},c&&Ts),M=!0===u?function(e,t){var r=e.x,n=e.y,i=t.devicePixelRatio||1;return{x:jo(r*i)/i||0,y:jo(n*i)/i||0}}({x:d,y:m},Lo(r)):{x:d,y:m};return d=M.x,m=M.y,l?Object.assign({},A,((S={})[b]=v?"0":"",S[x]=y?"0":"",S.transform=(_.devicePixelRatio||1)<=1?"translate("+d+"px, "+m+"px)":"translate3d("+d+"px, "+m+"px, 0)",S)):Object.assign({},A,((t={})[b]=v?m+"px":"",t[x]=y?d+"px":"",t.transform="",t))}var As={left:"right",right:"left",bottom:"top",top:"bottom"};function Ms(e){return e.replace(/left|right|bottom|top/g,(function(e){return As[e]}))}var Es={start:"end",end:"start"};function Cs(e){return e.replace(/start|end/g,(function(e){return Es[e]}))}function Ps(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&Oo(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ls(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function Is(e,t,r){return t===cs?Ls(function(e,t){var r=Lo(e),n=qo(e),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;var c=Bo();(c||!c&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:a,height:o,x:s+Ho(e),y:l}}(e,r)):Io(t)?function(e,t){var r=No(e,!1,"fixed"===t);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}(t,r):Ls(function(e){var t,r=qo(e),n=Uo(e),i=null==(t=e.ownerDocument)?void 0:t.body,a=Ro(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Ro(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+Ho(e),l=-n.scrollTop;return"rtl"===Go(i||r).direction&&(s+=Ro(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:l}}(qo(e)))}function zs(e,t,r,n){var i="clippingParents"===t?function(e){var t=Ko(Xo(e)),r=["absolute","fixed"].indexOf(Go(e).position)>=0&&zo(e)?es(e):e;return Io(r)?t.filter((function(e){return Io(e)&&Ps(e,r)&&"body"!==Vo(e)})):[]}(e):[].concat(t),a=[].concat(i,[r]),o=a[0],s=a.reduce((function(t,r){var i=Is(e,r,n);return t.top=Ro(i.top,t.top),t.right=Do(i.right,t.right),t.bottom=Do(i.bottom,t.bottom),t.left=Ro(i.left,t.left),t}),Is(e,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Os(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Rs(e,t){return t.reduce((function(t,r){return t[r]=e,t}),{})}function Ds(e,t){void 0===t&&(t={});var r=t,n=r.placement,i=void 0===n?e.placement:n,a=r.strategy,o=void 0===a?e.strategy:a,s=r.boundary,l=void 0===s?"clippingParents":s,c=r.rootBoundary,u=void 0===c?cs:c,h=r.elementContext,p=void 0===h?us:h,d=r.altBoundary,f=void 0!==d&&d,m=r.padding,g=void 0===m?0:m,y=Os("number"!==typeof g?g:Rs(g,os)),v=p===us?"reference":us,x=e.rects.popper,b=e.elements[f?v:p],_=zs(Io(b)?b:b.contextElement||qo(e.elements.popper),l,u,o),w=No(e.elements.reference),k=ks({reference:w,element:x,strategy:"absolute",placement:i}),T=Ls(Object.assign({},x,k)),S=p===us?T:w,A={top:_.top-S.top+y.top,bottom:S.bottom-_.bottom+y.bottom,left:_.left-S.left+y.left,right:S.right-_.right+y.right},M=e.modifiersData.offset;if(p===us&&M){var E=M[i];Object.keys(A).forEach((function(e){var t=[ns,rs].indexOf(e)>=0?1:-1,r=[ts,rs].indexOf(e)>=0?"y":"x";A[e]+=E[r]*t}))}return A}function js(e,t,r){return Ro(e,Do(t,r))}function Fs(e,t,r){return void 0===r&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function Bs(e){return[ts,ns,rs,is].some((function(t){return e[t]>=0}))}var Ns=vs({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,r=e.instance,n=e.options,i=n.scroll,a=void 0===i||i,o=n.resize,s=void 0===o||o,l=Lo(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach((function(e){e.addEventListener("scroll",r.update,xs)})),s&&l.addEventListener("resize",r.update,xs),function(){a&&c.forEach((function(e){e.removeEventListener("scroll",r.update,xs)})),s&&l.removeEventListener("resize",r.update,xs)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,r=e.name;t.modifiersData[r]=ks({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,r=e.options,n=r.gpuAcceleration,i=void 0===n||n,a=r.adaptive,o=void 0===a||a,s=r.roundOffsets,l=void 0===s||s,c={placement:bs(t.placement),variation:_s(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ss(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ss(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},i=t.elements[e];zo(i)&&Vo(i)&&(Object.assign(i.style,r),Object.keys(n).forEach((function(e){var t=n[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],i=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:r[e]).reduce((function(e,t){return e[t]="",e}),{});zo(n)&&Vo(n)&&(Object.assign(n.style,a),Object.keys(i).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.offset,a=void 0===i?[0,0]:i,o=ps.reduce((function(e,r){return e[r]=function(e,t,r){var n=bs(e),i=[is,ts].indexOf(n)>=0?-1:1,a="function"===typeof r?r(Object.assign({},t,{placement:e})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[is,ns].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}(r,t.rects,a),e}),{}),s=o[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0===o||o,l=r.fallbackPlacements,c=r.padding,u=r.boundary,h=r.rootBoundary,p=r.altBoundary,d=r.flipVariations,f=void 0===d||d,m=r.allowedAutoPlacements,g=t.options.placement,y=bs(g),v=l||(y===g||!f?[Ms(g)]:function(e){if(bs(e)===as)return[];var t=Ms(e);return[Cs(e),t,Cs(t)]}(g)),x=[g].concat(v).reduce((function(e,r){return e.concat(bs(r)===as?function(e,t){void 0===t&&(t={});var r=t,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,c=void 0===l?ps:l,u=_s(n),h=u?s?hs:hs.filter((function(e){return _s(e)===u})):os,p=h.filter((function(e){return c.indexOf(e)>=0}));0===p.length&&(p=h);var d=p.reduce((function(t,r){return t[r]=Ds(e,{placement:r,boundary:i,rootBoundary:a,padding:o})[bs(r)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}(t,{placement:r,boundary:u,rootBoundary:h,padding:c,flipVariations:f,allowedAutoPlacements:m}):r)}),[]),b=t.rects.reference,_=t.rects.popper,w=new Map,k=!0,T=x[0],S=0;S<x.length;S++){var A=x[S],M=bs(A),E=_s(A)===ss,C=[ts,rs].indexOf(M)>=0,P=C?"width":"height",L=Ds(t,{placement:A,boundary:u,rootBoundary:h,altBoundary:p,padding:c}),I=C?E?ns:is:E?rs:ts;b[P]>_[P]&&(I=Ms(I));var z=Ms(I),O=[];if(a&&O.push(L[M]<=0),s&&O.push(L[I]<=0,L[z]<=0),O.every((function(e){return e}))){T=A,k=!1;break}w.set(A,O)}if(k)for(var R=function(e){var t=x.find((function(t){var r=w.get(t);if(r)return r.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},D=f?3:1;D>0;D--){if("break"===R(D))break}t.placement!==T&&(t.modifiersData[n]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,r=e.options,n=e.name,i=r.mainAxis,a=void 0===i||i,o=r.altAxis,s=void 0!==o&&o,l=r.boundary,c=r.rootBoundary,u=r.altBoundary,h=r.padding,p=r.tether,d=void 0===p||p,f=r.tetherOffset,m=void 0===f?0:f,g=Ds(t,{boundary:l,rootBoundary:c,padding:h,altBoundary:u}),y=bs(t.placement),v=_s(t.placement),x=!v,b=ws(y),_="x"===b?"y":"x",w=t.modifiersData.popperOffsets,k=t.rects.reference,T=t.rects.popper,S="function"===typeof m?m(Object.assign({},t.rects,{placement:t.placement})):m,A="number"===typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),M=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(w){if(a){var C,P="y"===b?ts:is,L="y"===b?rs:ns,I="y"===b?"height":"width",z=w[b],O=z+g[P],R=z-g[L],D=d?-T[I]/2:0,j=v===ss?k[I]:T[I],F=v===ss?-T[I]:-k[I],B=t.elements.arrow,N=d&&B?Zo(B):{width:0,height:0},U=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=U[P],q=U[L],H=js(0,k[I],N[I]),G=x?k[I]/2-D-H-V-A.mainAxis:j-H-V-A.mainAxis,W=x?-k[I]/2+D+H+q+A.mainAxis:F+H+q+A.mainAxis,$=t.elements.arrow&&es(t.elements.arrow),Z=$?"y"===b?$.clientTop||0:$.clientLeft||0:0,X=null!=(C=null==M?void 0:M[b])?C:0,Y=z+W-X,K=js(d?Do(O,z+G-X-Z):O,z,d?Ro(R,Y):R);w[b]=K,E[b]=K-z}if(s){var J,Q="x"===b?ts:is,ee="x"===b?rs:ns,te=w[_],re="y"===_?"height":"width",ne=te+g[Q],ie=te-g[ee],ae=-1!==[ts,is].indexOf(y),oe=null!=(J=null==M?void 0:M[_])?J:0,se=ae?ne:te-k[re]-T[re]-oe+A.altAxis,le=ae?te+k[re]+T[re]-oe-A.altAxis:ie,ce=d&&ae?function(e,t,r){var n=js(e,t,r);return n>r?r:n}(se,te,le):js(d?se:ne,te,d?le:ie);w[_]=ce,E[_]=ce-te}t.modifiersData[n]=E}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,r=e.state,n=e.name,i=e.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bs(r.placement),l=ws(s),c=[is,ns].indexOf(s)>=0?"height":"width";if(a&&o){var u=function(e,t){return Os("number"!==typeof(e="function"===typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Rs(e,os))}(i.padding,r),h=Zo(a),p="y"===l?ts:is,d="y"===l?rs:ns,f=r.rects.reference[c]+r.rects.reference[l]-o[l]-r.rects.popper[c],m=o[l]-r.rects.reference[l],g=es(a),y=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,x=u[p],b=y-h[c]-u[d],_=y/2-h[c]/2+v,w=js(x,_,b),k=l;r.modifiersData[n]=((t={})[k]=w,t.centerOffset=w-_,t)}},effect:function(e){var t=e.state,r=e.options.element,n=void 0===r?"[data-popper-arrow]":r;null!=n&&("string"!==typeof n||(n=t.elements.popper.querySelector(n)))&&Ps(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,r=e.name,n=t.rects.reference,i=t.rects.popper,a=t.modifiersData.preventOverflow,o=Ds(t,{elementContext:"reference"}),s=Ds(t,{altBoundary:!0}),l=Fs(o,n),c=Fs(s,i,a),u=Bs(l),h=Bs(c);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":h})}}]});const Us=e.forwardRef((function(t,r){const{children:n,container:i,disablePortal:a=!1}=t,[o,s]=e.useState(null),l=qi(e.isValidElement(n)?po(n):null,r);if(sr((()=>{a||s(function(e){return"function"===typeof e?e():e}(i)||document.body)}),[i,a]),sr((()=>{if(o&&!a)return Vi(r,o),()=>{Vi(r,null)}}),[r,o,a]),a){if(e.isValidElement(n)){const t={ref:l};return e.cloneElement(n,t)}return n}return o?fo.createPortal(n,o):o}));function Vs(e){return Ai("MuiPopper",e)}Mi("MuiPopper",["root"]);function qs(e){return"function"===typeof e?e():e}function Hs(e){return void 0!==e.nodeType}const Gs={},Ws=e.forwardRef((function(t,r){const{anchorEl:n,children:i,direction:a,disablePortal:o,modifiers:l,open:c,placement:u,popperOptions:h,popperRef:p,slotProps:d={},slots:f={},TransitionProps:m,ownerState:g,...y}=t,v=e.useRef(null),x=qi(v,r),b=e.useRef(null),_=qi(b,p),w=e.useRef(_);sr((()=>{w.current=_}),[_]),e.useImperativeHandle(p,(()=>b.current),[]);const k=function(e,t){if("ltr"===t)return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}(u,a),[T,S]=e.useState(k),[A,M]=e.useState(qs(n));e.useEffect((()=>{b.current&&b.current.forceUpdate()})),e.useEffect((()=>{n&&M(qs(n))}),[n]),sr((()=>{if(!A||!c)return;let e=[{name:"preventOverflow",options:{altBoundary:o}},{name:"flip",options:{altBoundary:o}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:e=>{let{state:t}=e;S(t.placement)}}];null!=l&&(e=e.concat(l)),h&&null!=h.modifiers&&(e=e.concat(h.modifiers));const t=Ns(A,v.current,{placement:k,...h,modifiers:e});return w.current(t),()=>{t.destroy(),w.current(null)}}),[A,o,l,c,h,k]);const E={placement:T};null!==m&&(E.TransitionProps=m);const C=(e=>{const{classes:t}=e;return Wn({root:["root"]},Vs,t)})(t),P=f.root??"div",L=ta({elementType:P,externalSlotProps:d.root,externalForwardedProps:y,additionalProps:{role:"tooltip",ref:x},ownerState:t,className:C.root});return(0,s.jsx)(P,{...L,children:"function"===typeof i?i(E):i})})),$s=gi(e.forwardRef((function(t,r){const{anchorEl:n,children:i,container:a,direction:o="ltr",disablePortal:l=!1,keepMounted:c=!1,modifiers:u,open:h,placement:p="bottom",popperOptions:d=Gs,popperRef:f,style:m,transition:g=!1,slotProps:y={},slots:v={},...x}=t,[b,_]=e.useState(!0);if(!c&&!h&&(!g||b))return null;let w;if(a)w=a;else if(n){const e=qs(n);w=e&&Hs(e)?oa(e).body:oa(null).body}const k=h||!c||g&&!b?void 0:"none",T=g?{in:h,onEnter:()=>{_(!1)},onExited:()=>{_(!0)}}:void 0;return(0,s.jsx)(Us,{disablePortal:l,container:w,children:(0,s.jsx)(Ws,{anchorEl:n,direction:o,disablePortal:l,modifiers:u,ref:r,open:g?!b:h,placement:p,popperOptions:d,popperRef:f,slotProps:y,slots:v,...x,style:{position:"fixed",top:0,left:0,display:k,...m},TransitionProps:T,children:i})})})),{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Zs=e.forwardRef((function(e,t){const r=je(),n=yi({props:e,name:"MuiPopper"}),{anchorEl:i,component:a,components:o,componentsProps:l,container:c,disablePortal:u,keepMounted:h,modifiers:p,open:d,placement:f,popperOptions:m,popperRef:g,transition:y,slots:v,slotProps:x,...b}=n,_=v?.root??o?.Root,w={anchorEl:i,container:c,disablePortal:u,keepMounted:h,modifiers:p,open:d,placement:f,popperOptions:m,popperRef:g,transition:y,...b};return(0,s.jsx)($s,{as:a,direction:r?"rtl":"ltr",slots:{root:_},slotProps:x??l,...w,ref:t})}));let Xs=0;const Ys={...t}.useId;function Ks(t){if(void 0!==Ys){const e=Ys();return t??e}return function(t){const[r,n]=e.useState(t),i=t||r;return e.useEffect((()=>{null==r&&(Xs+=1,n(`mui-${Xs}`))}),[r]),i}(t)}const Js=Ks;function Qs(t){let{controlled:r,default:n,name:i,state:a="value"}=t;const{current:o}=e.useRef(void 0!==r),[s,l]=e.useState(n);return[o?r:s,e.useCallback((e=>{o||l(e)}),[])]}const el=Qs;function tl(e){return Ai("MuiTooltip",e)}const rl=Mi("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);const nl=gi(Zs,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.tooltip,pointerEvents:"none",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInteractive},style:{pointerEvents:"auto"}},{props:e=>{let{open:t}=e;return!t},style:{pointerEvents:"none"}},{props:e=>{let{ownerState:t}=e;return t.arrow},style:{[`&[data-popper-placement*="bottom"] .${rl.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${rl.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${rl.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${rl.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!t.isRtl},style:{[`&[data-popper-placement*="right"] .${rl.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!!t.isRtl},style:{[`&[data-popper-placement*="right"] .${rl.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!t.isRtl},style:{[`&[data-popper-placement*="left"] .${rl.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:e=>{let{ownerState:t}=e;return t.arrow&&!!t.isRtl},style:{[`&[data-popper-placement*="left"] .${rl.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}}))),il=gi("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Oi(r.placement.split("-")[0])}`]]}})(wi((e=>{let{theme:t}=e;return{backgroundColor:t.vars?t.vars.palette.Tooltip.bg:Tr(t.palette.grey[700],.92),borderRadius:(t.vars||t).shape.borderRadius,color:(t.vars||t).palette.common.white,fontFamily:t.typography.fontFamily,padding:"4px 8px",fontSize:t.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:t.typography.fontWeightMedium,[`.${rl.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${rl.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${rl.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:e=>{let{ownerState:t}=e;return t.arrow},style:{position:"relative",margin:0}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{padding:"8px 16px",fontSize:t.typography.pxToRem(14),lineHeight:(r=16/14,Math.round(1e5*r)/1e5)+"em",fontWeight:t.typography.fontWeightRegular}},{props:e=>{let{ownerState:t}=e;return!t.isRtl},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:e=>{let{ownerState:t}=e;return!t.isRtl&&t.touch},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:e=>{let{ownerState:t}=e;return!!t.isRtl},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:e=>{let{ownerState:t}=e;return!!t.isRtl&&t.touch},style:{[`.${rl.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${rl.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{[`.${rl.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:e=>{let{ownerState:t}=e;return t.touch},style:{[`.${rl.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]};var r}))),al=gi("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(wi((e=>{let{theme:t}=e;return{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t.vars?t.vars.palette.Tooltip.bg:Tr(t.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}})));let ol=!1;const sl=new Pa;let ll={x:0,y:0};function cl(e,t){return function(r){for(var n=arguments.length,i=new Array(n>1?n-1:0),a=1;a<n;a++)i[a-1]=arguments[a];t&&t(r,...i),e(r,...i)}}const ul=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTooltip"}),{arrow:i=!1,children:a,classes:o,components:l={},componentsProps:c={},describeChild:u=!1,disableFocusListener:h=!1,disableHoverListener:p=!1,disableInteractive:d=!1,disableTouchListener:f=!1,enterDelay:m=100,enterNextDelay:g=0,enterTouchDelay:y=700,followCursor:v=!1,id:x,leaveDelay:b=0,leaveTouchDelay:_=1500,onClose:w,onOpen:k,open:T,placement:S="bottom",PopperComponent:A,PopperProps:M={},slotProps:E={},slots:C={},title:P,TransitionComponent:L,TransitionProps:I,...z}=n,O=e.isValidElement(a)?a:(0,s.jsx)("span",{children:a}),R=bi(),D=je(),[j,F]=e.useState(),[B,N]=e.useState(null),U=e.useRef(!1),V=d||v,q=La(),H=La(),G=La(),W=La(),[$,Z]=el({controlled:T,default:!1,name:"Tooltip",state:"open"});let X=$;const Y=Js(x),K=e.useRef(),J=ma((()=>{void 0!==K.current&&(document.body.style.WebkitUserSelect=K.current,K.current=void 0),W.clear()}));e.useEffect((()=>J),[J]);const Q=e=>{sl.clear(),ol=!0,Z(!0),k&&!X&&k(e)},ee=ma((e=>{sl.start(800+b,(()=>{ol=!1})),Z(!1),w&&X&&w(e),q.start(R.transitions.duration.shortest,(()=>{U.current=!1}))})),te=e=>{U.current&&"touchstart"!==e.type||(j&&j.removeAttribute("title"),H.clear(),G.clear(),m||ol&&g?H.start(ol?g:m,(()=>{Q(e)})):Q(e))},re=e=>{H.clear(),G.start(b,(()=>{ee(e)}))},[,ne]=e.useState(!1),ie=e=>{pa(e.target)||(ne(!1),re(e))},ae=e=>{j||F(e.currentTarget),pa(e.target)&&(ne(!0),te(e))},oe=e=>{U.current=!0;const t=O.props;t.onTouchStart&&t.onTouchStart(e)},se=e=>{oe(e),G.clear(),q.clear(),J(),K.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",W.start(y,(()=>{document.body.style.WebkitUserSelect=K.current,te(e)}))},le=e=>{O.props.onTouchEnd&&O.props.onTouchEnd(e),J(),G.start(_,(()=>{ee(e)}))};e.useEffect((()=>{if(X)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){"Escape"===e.key&&ee(e)}}),[ee,X]);const ce=da(po(O),F,r);P||0===P||(X=!1);const ue=e.useRef(),he={},pe="string"===typeof P;u?(he.title=X||!pe||p?null:P,he["aria-describedby"]=X?Y:null):(he["aria-label"]=pe?P:null,he["aria-labelledby"]=X&&!pe?Y:null);const de={...he,...z,...O.props,className:Gn(z.className,O.props.className),onTouchStart:oe,ref:ce,...v?{onMouseMove:e=>{const t=O.props;t.onMouseMove&&t.onMouseMove(e),ll={x:e.clientX,y:e.clientY},ue.current&&ue.current.update()}}:{}};const fe={};f||(de.onTouchStart=se,de.onTouchEnd=le),p||(de.onMouseOver=cl(te,de.onMouseOver),de.onMouseLeave=cl(re,de.onMouseLeave),V||(fe.onMouseOver=te,fe.onMouseLeave=re)),h||(de.onFocus=cl(ae,de.onFocus),de.onBlur=cl(ie,de.onBlur),V||(fe.onFocus=ae,fe.onBlur=ie));const me={...n,isRtl:D,arrow:i,disableInteractive:V,placement:S,PopperComponentProp:A,touch:U.current},ge="function"===typeof E.popper?E.popper(me):E.popper,ye=e.useMemo((()=>{let e=[{name:"arrow",enabled:Boolean(B),options:{element:B,padding:4}}];return M.popperOptions?.modifiers&&(e=e.concat(M.popperOptions.modifiers)),ge?.popperOptions?.modifiers&&(e=e.concat(ge.popperOptions.modifiers)),{...M.popperOptions,...ge?.popperOptions,modifiers:e}}),[B,M.popperOptions,ge?.popperOptions]),ve=(e=>{const{classes:t,disableInteractive:r,arrow:n,touch:i,placement:a}=e;return Wn({popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",i&&"touch",`tooltipPlacement${Oi(a.split("-")[0])}`],arrow:["arrow"]},tl,t)})(me),xe="function"===typeof E.transition?E.transition(me):E.transition,be={slots:{popper:l.Popper,transition:l.Transition??L,tooltip:l.Tooltip,arrow:l.Arrow,...C},slotProps:{arrow:E.arrow??c.arrow,popper:{...M,...ge??c.popper},tooltip:E.tooltip??c.tooltip,transition:{...I,...xe??c.transition}}},[_e,we]=Yi("popper",{elementType:nl,externalForwardedProps:be,ownerState:me,className:Gn(ve.popper,M?.className)}),[ke,Te]=Yi("transition",{elementType:Po,externalForwardedProps:be,ownerState:me}),[Se,Ae]=Yi("tooltip",{elementType:il,className:ve.tooltip,externalForwardedProps:be,ownerState:me}),[Me,Ee]=Yi("arrow",{elementType:al,className:ve.arrow,externalForwardedProps:be,ownerState:me,ref:N});return(0,s.jsxs)(e.Fragment,{children:[e.cloneElement(O,de),(0,s.jsx)(_e,{as:A??Zs,placement:S,anchorEl:v?{getBoundingClientRect:()=>({top:ll.y,left:ll.x,right:ll.x,bottom:ll.y,width:0,height:0})}:j,popperRef:ue,open:!!j&&X,id:Y,transition:!0,...fe,...we,popperOptions:ye,children:e=>{let{TransitionProps:t}=e;return(0,s.jsx)(ke,{timeout:R.transitions.duration.shorter,...t,...Te,children:(0,s.jsxs)(Se,{...Ae,children:[P,i?(0,s.jsx)(Me,{...Ee}):null]})})}})]})}));function hl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=>{let[,r]=t;return r&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!function(e){return"string"===typeof e.main}(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||"string"!==typeof e[r])return!1;return!0}(r,e)}}function pl(e){return Ai("MuiAppBar",e)}Mi("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const dl=(e,t)=>e?`${e?.replace(")","")}, ${t})`:t,fl=gi(Pi,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`position${Oi(r.position)}`],t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(t.vars||t).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[100],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[100]),...t.applyStyles("dark",{"--AppBar-background":t.vars?t.vars.palette.AppBar.defaultBg:t.palette.grey[900],"--AppBar-color":t.vars?t.vars.palette.text.primary:t.palette.getContrastText(t.palette.grey[900])})}},...Object.entries(t.palette).filter(hl(["contrastText"])).map((e=>{let[r]=e;return{props:{color:r},style:{"--AppBar-background":(t.vars??t).palette[r].main,"--AppBar-color":(t.vars??t).palette[r].contrastText}}})),{props:e=>!0===e.enableColorOnDark&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>!1===e.enableColorOnDark&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundColor:t.vars?dl(t.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:t.vars?dl(t.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...t.applyStyles("dark",{backgroundImage:"none"})}}]}}))),ml=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAppBar"}),{className:n,color:i="primary",enableColorOnDark:a=!1,position:o="fixed",...l}=r,c={...r,color:i,position:o,enableColorOnDark:a},u=(e=>{const{color:t,position:r,classes:n}=e;return Wn({root:["root",`color${Oi(t)}`,`position${Oi(r)}`]},pl,n)})(c);return(0,s.jsx)(fl,{square:!0,component:"header",ownerState:c,elevation:4,className:Gn(u.root,n,"fixed"===o&&"mui-fixed"),ref:t,...l})})),gl=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function yl(e){const t=[],r=[];return Array.from(e.querySelectorAll(gl)).forEach(((e,n)=>{const i=function(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?"true"===e.contentEditable||("AUDIO"===e.nodeName||"VIDEO"===e.nodeName||"DETAILS"===e.nodeName)&&null===e.getAttribute("tabindex")?0:e.tabIndex:t}(e);-1!==i&&function(e){return!(e.disabled||"INPUT"===e.tagName&&"hidden"===e.type||function(e){if("INPUT"!==e.tagName||"radio"!==e.type)return!1;if(!e.name)return!1;const t=t=>e.ownerDocument.querySelector(`input[type="radio"]${t}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}(e))}(e)&&(0===i?t.push(e):r.push({documentOrder:n,tabIndex:i,node:e}))})),r.sort(((e,t)=>e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex)).map((e=>e.node)).concat(t)}function vl(){return!0}const xl=function(t){const{children:r,disableAutoFocus:n=!1,disableEnforceFocus:i=!1,disableRestoreFocus:a=!1,getTabbable:o=yl,isEnabled:l=vl,open:c}=t,u=e.useRef(!1),h=e.useRef(null),p=e.useRef(null),d=e.useRef(null),f=e.useRef(null),m=e.useRef(!1),g=e.useRef(null),y=qi(po(r),g),v=e.useRef(null);e.useEffect((()=>{c&&g.current&&(m.current=!n)}),[n,c]),e.useEffect((()=>{if(!c||!g.current)return;const e=oa(g.current);return g.current.contains(e.activeElement)||(g.current.hasAttribute("tabIndex")||g.current.setAttribute("tabIndex","-1"),m.current&&g.current.focus()),()=>{a||(d.current&&d.current.focus&&(u.current=!0,d.current.focus()),d.current=null)}}),[c]),e.useEffect((()=>{if(!c||!g.current)return;const e=oa(g.current),t=t=>{v.current=t,!i&&l()&&"Tab"===t.key&&e.activeElement===g.current&&t.shiftKey&&(u.current=!0,p.current&&p.current.focus())},r=()=>{const t=g.current;if(null===t)return;if(!e.hasFocus()||!l()||u.current)return void(u.current=!1);if(t.contains(e.activeElement))return;if(i&&e.activeElement!==h.current&&e.activeElement!==p.current)return;if(e.activeElement!==f.current)f.current=null;else if(null!==f.current)return;if(!m.current)return;let r=[];if(e.activeElement!==h.current&&e.activeElement!==p.current||(r=o(g.current)),r.length>0){const e=Boolean(v.current?.shiftKey&&"Tab"===v.current?.key),t=r[0],n=r[r.length-1];"string"!==typeof t&&"string"!==typeof n&&(e?n.focus():t.focus())}else t.focus()};e.addEventListener("focusin",r),e.addEventListener("keydown",t,!0);const n=setInterval((()=>{e.activeElement&&"BODY"===e.activeElement.tagName&&r()}),50);return()=>{clearInterval(n),e.removeEventListener("focusin",r),e.removeEventListener("keydown",t,!0)}}),[n,i,a,l,c,o]);const x=e=>{null===d.current&&(d.current=e.relatedTarget),m.current=!0};return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:h,"data-testid":"sentinelStart"}),e.cloneElement(r,{ref:y,onFocus:e=>{null===d.current&&(d.current=e.relatedTarget),m.current=!0,f.current=e.target;const t=r.props.onFocus;t&&t(e)}}),(0,s.jsx)("div",{tabIndex:c?0:-1,onFocus:x,ref:p,"data-testid":"sentinelEnd"})]})},bl={entering:{opacity:1},entered:{opacity:1}},_l=e.forwardRef((function(t,r){const n=bi(),i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:a,appear:o=!0,children:l,easing:c,in:u,onEnter:h,onEntered:p,onEntering:d,onExit:f,onExited:m,onExiting:g,style:y,timeout:v=i,TransitionComponent:x=ko,...b}=t,_=e.useRef(null),w=da(_,po(l),r),k=e=>t=>{if(e){const r=_.current;void 0===t?e(r):e(r,t)}},T=k(d),S=k(((e,t)=>{To(e);const r=So({style:y,timeout:v,easing:c},{mode:"enter"});e.style.webkitTransition=n.transitions.create("opacity",r),e.style.transition=n.transitions.create("opacity",r),h&&h(e,t)})),A=k(p),M=k(g),E=k((e=>{const t=So({style:y,timeout:v,easing:c},{mode:"exit"});e.style.webkitTransition=n.transitions.create("opacity",t),e.style.transition=n.transitions.create("opacity",t),f&&f(e)})),C=k(m);return(0,s.jsx)(x,{appear:o,in:u,nodeRef:_,onEnter:S,onEntered:A,onEntering:T,onExit:E,onExited:C,onExiting:M,addEndListener:e=>{a&&a(_.current,e)},timeout:v,...b,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(l,{style:{opacity:0,visibility:"exited"!==t||u?void 0:"hidden",...bl[t],...y,...l.props.style},ref:w,...i})}})}));function wl(e){return Ai("MuiBackdrop",e)}Mi("MuiBackdrop",["root","invisible"]);const kl=gi("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Tl=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiBackdrop"}),{children:n,className:i,component:a="div",invisible:o=!1,open:l,components:c={},componentsProps:u={},slotProps:h={},slots:p={},TransitionComponent:d,transitionDuration:f,...m}=r,g={...r,component:a,invisible:o},y=(e=>{const{classes:t,invisible:r}=e;return Wn({root:["root",r&&"invisible"]},wl,t)})(g),v={slots:{transition:d,root:c.Root,...p},slotProps:{...u,...h}},[x,b]=Yi("root",{elementType:kl,externalForwardedProps:v,className:Gn(y.root,i),ownerState:g}),[_,w]=Yi("transition",{elementType:_l,externalForwardedProps:v,ownerState:g});return(0,s.jsx)(_,{in:l,timeout:f,...m,...w,children:(0,s.jsx)(x,{"aria-hidden":!0,...b,classes:y,ref:t,children:n})})}));function Sl(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.reduce(((e,t)=>null==t?e:function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n),t.apply(this,n)}),(()=>{}))}function Al(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function Ml(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function El(e){return parseInt(sa(e).getComputedStyle(e).paddingRight,10)||0}function Cl(e,t,r,n,i){const a=[t,r,...n];[].forEach.call(e.children,(e=>{const t=!a.includes(e),r=!function(e){const t=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),r="INPUT"===e.tagName&&"hidden"===e.getAttribute("type");return t||r}(e);t&&r&&Ml(e,i)}))}function Pl(e,t){let r=-1;return e.some(((e,n)=>!!t(e)&&(r=n,!0))),r}function Ll(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(function(e){const t=oa(e);return t.body===e?sa(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}(n)){const e=Al(sa(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${El(n)+e}px`;const t=oa(n).querySelectorAll(".mui-fixed");[].forEach.call(t,(t=>{r.push({value:t.style.paddingRight,property:"padding-right",el:t}),t.style.paddingRight=`${El(t)+e}px`}))}let e;if(n.parentNode instanceof DocumentFragment)e=oa(n).body;else{const t=n.parentElement,r=sa(n);e="HTML"===t?.nodeName&&"scroll"===r.getComputedStyle(t).overflowY?t:n}r.push({value:e.style.overflow,property:"overflow",el:e},{value:e.style.overflowX,property:"overflow-x",el:e},{value:e.style.overflowY,property:"overflow-y",el:e}),e.style.overflow="hidden"}return()=>{r.forEach((e=>{let{value:t,el:r,property:n}=e;t?r.style.setProperty(n,t):r.style.removeProperty(n)}))}}const Il=()=>{},zl=new class{constructor(){this.modals=[],this.containers=[]}add(e,t){let r=this.modals.indexOf(e);if(-1!==r)return r;r=this.modals.length,this.modals.push(e),e.modalRef&&Ml(e.modalRef,!1);const n=function(e){const t=[];return[].forEach.call(e.children,(e=>{"true"===e.getAttribute("aria-hidden")&&t.push(e)})),t}(t);Cl(t,e.mount,e.modalRef,n,!0);const i=Pl(this.containers,(e=>e.container===t));return-1!==i?(this.containers[i].modals.push(e),r):(this.containers.push({modals:[e],container:t,restore:null,hiddenSiblings:n}),r)}mount(e,t){const r=Pl(this.containers,(t=>t.modals.includes(e))),n=this.containers[r];n.restore||(n.restore=Ll(n,t))}remove(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const r=this.modals.indexOf(e);if(-1===r)return r;const n=Pl(this.containers,(t=>t.modals.includes(e))),i=this.containers[n];if(i.modals.splice(i.modals.indexOf(e),1),this.modals.splice(r,1),0===i.modals.length)i.restore&&i.restore(),e.modalRef&&Ml(e.modalRef,t),Cl(i.container,e.mount,e.modalRef,i.hiddenSiblings,!1),this.containers.splice(n,1);else{const e=i.modals[i.modals.length-1];e.modalRef&&Ml(e.modalRef,!1)}return r}isTopModal(e){return this.modals.length>0&&this.modals[this.modals.length-1]===e}};const Ol=function(t){const{container:r,disableEscapeKeyDown:n=!1,disableScrollLock:i=!1,closeAfterTransition:a=!1,onTransitionEnter:o,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:h}=t,p=e.useRef({}),d=e.useRef(null),f=e.useRef(null),m=qi(f,h),[g,y]=e.useState(!u),v=function(e){return!!e&&e.props.hasOwnProperty("in")}(l);let x=!0;"false"!==t["aria-hidden"]&&!1!==t["aria-hidden"]||(x=!1);const b=()=>(p.current.modalRef=f.current,p.current.mount=d.current,p.current),_=()=>{zl.mount(b(),{disableScrollLock:i}),f.current&&(f.current.scrollTop=0)},w=fa((()=>{const e=function(e){return"function"===typeof e?e():e}(r)||oa(d.current).body;zl.add(b(),e),f.current&&_()})),k=()=>zl.isTopModal(b()),T=fa((e=>{d.current=e,e&&(u&&k()?_():f.current&&Ml(f.current,x))})),S=e.useCallback((()=>{zl.remove(b(),x)}),[x]);e.useEffect((()=>()=>{S()}),[S]),e.useEffect((()=>{u?w():v&&a||S()}),[u,S,v,a,w]);const A=e=>t=>{e.onKeyDown?.(t),"Escape"===t.key&&229!==t.which&&k()&&(n||(t.stopPropagation(),c&&c(t,"escapeKeyDown")))},M=e=>t=>{e.onClick?.(t),t.target===t.currentTarget&&c&&c(t,"backdropClick")};return{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=$i(t);delete r.onTransitionEnter,delete r.onTransitionExited;const n={...r,...e};return{role:"presentation",...n,onKeyDown:A(n),ref:m}},getBackdropProps:function(){const e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{"aria-hidden":!0,...e,onClick:M(e),open:u}},getTransitionProps:()=>({onEnter:Sl((()=>{y(!1),o&&o()}),l?.props.onEnter??Il),onExited:Sl((()=>{y(!0),s&&s(),a&&S()}),l?.props.onExited??Il)}),rootRef:m,portalRef:T,isTopModal:k,exited:g,hasTransition:v}};function Rl(e){return Ai("MuiModal",e)}Mi("MuiModal",["root","hidden","backdrop"]);const Dl=gi("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(wi((e=>{let{theme:t}=e;return{position:"fixed",zIndex:(t.vars||t).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:e=>{let{ownerState:t}=e;return!t.open&&t.exited},style:{visibility:"hidden"}}]}}))),jl=gi(Tl,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),Fl=e.forwardRef((function(t,r){const n=yi({name:"MuiModal",props:t}),{BackdropComponent:i=jl,BackdropProps:a,classes:o,className:l,closeAfterTransition:c=!1,children:u,container:h,component:p,components:d={},componentsProps:f={},disableAutoFocus:m=!1,disableEnforceFocus:g=!1,disableEscapeKeyDown:y=!1,disablePortal:v=!1,disableRestoreFocus:x=!1,disableScrollLock:b=!1,hideBackdrop:_=!1,keepMounted:w=!1,onClose:k,onTransitionEnter:T,onTransitionExited:S,open:A,slotProps:M={},slots:E={},theme:C,...P}=n,L={...n,closeAfterTransition:c,disableAutoFocus:m,disableEnforceFocus:g,disableEscapeKeyDown:y,disablePortal:v,disableRestoreFocus:x,disableScrollLock:b,hideBackdrop:_,keepMounted:w},{getRootProps:I,getBackdropProps:z,getTransitionProps:O,portalRef:R,isTopModal:D,exited:j,hasTransition:F}=Ol({...L,rootRef:r}),B={...L,exited:j},N=(e=>{const{open:t,exited:r,classes:n}=e;return Wn({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},Rl,n)})(B),U={};if(void 0===u.props.tabIndex&&(U.tabIndex="-1"),F){const{onEnter:e,onExited:t}=O();U.onEnter=e,U.onExited=t}const V={slots:{root:d.Root,backdrop:d.Backdrop,...E},slotProps:{...f,...M}},[q,H]=Yi("root",{ref:r,elementType:Dl,externalForwardedProps:{...V,...P,component:p},getSlotProps:I,ownerState:B,className:Gn(l,N?.root,!B.open&&B.exited&&N?.hidden)}),[G,W]=Yi("backdrop",{ref:a?.ref,elementType:i,externalForwardedProps:V,shouldForwardComponentProp:!0,additionalProps:a,getSlotProps:e=>z({...e,onClick:t=>{e?.onClick&&e.onClick(t)}}),className:Gn(a?.className,N?.backdrop),ownerState:B});return w||A||F&&!j?(0,s.jsx)(Us,{ref:R,container:h,disablePortal:v,children:(0,s.jsxs)(q,{...H,children:[!_&&i?(0,s.jsx)(G,{...W}):null,(0,s.jsx)(xl,{disableEnforceFocus:g,disableAutoFocus:m,disableRestoreFocus:x,isEnabled:D,open:A,children:e.cloneElement(u,U)})]})}):null}));function Bl(e,t,r){var n;const i=function(e,t,r){const n=t.getBoundingClientRect(),i=r&&r.getBoundingClientRect(),a=la(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const e=a.getComputedStyle(t);o=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("transform")}let s=0,l=0;if(o&&"none"!==o&&"string"===typeof o){const e=o.split("(")[1].split(")")[0].split(",");s=parseInt(e[4],10),l=parseInt(e[5],10)}return"left"===e?i?`translateX(${i.right+s-n.left}px)`:`translateX(${a.innerWidth+s-n.left}px)`:"right"===e?i?`translateX(-${n.right-i.left-s}px)`:`translateX(-${n.left+n.width-s}px)`:"up"===e?i?`translateY(${i.bottom+l-n.top}px)`:`translateY(${a.innerHeight+l-n.top}px)`:i?`translateY(-${n.top-i.top+n.height-l}px)`:`translateY(-${n.top+n.height-l}px)`}(e,t,"function"===typeof(n=r)?n():n);i&&(t.style.webkitTransform=i,t.style.transform=i)}const Nl=e.forwardRef((function(t,r){const n=bi(),i={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:l=!0,children:c,container:u,direction:h="down",easing:p=i,in:d,onEnter:f,onEntered:m,onEntering:g,onExit:y,onExited:v,onExiting:x,style:b,timeout:_=a,TransitionComponent:w=ko,...k}=t,T=e.useRef(null),S=da(po(c),T,r),A=e=>t=>{e&&(void 0===t?e(T.current):e(T.current,t))},M=A(((e,t)=>{Bl(h,e,u),To(e),f&&f(e,t)})),E=A(((e,t)=>{const r=So({timeout:_,style:b,easing:p},{mode:"enter"});e.style.webkitTransition=n.transitions.create("-webkit-transform",{...r}),e.style.transition=n.transitions.create("transform",{...r}),e.style.webkitTransform="none",e.style.transform="none",g&&g(e,t)})),C=A(m),P=A(x),L=A((e=>{const t=So({timeout:_,style:b,easing:p},{mode:"exit"});e.style.webkitTransition=n.transitions.create("-webkit-transform",t),e.style.transition=n.transitions.create("transform",t),Bl(h,e,u),y&&y(e)})),I=A((e=>{e.style.webkitTransition="",e.style.transition="",v&&v(e)})),z=e.useCallback((()=>{T.current&&Bl(h,T.current,u)}),[h,u]);return e.useEffect((()=>{if(d||"down"===h||"right"===h)return;const e=na((()=>{T.current&&Bl(h,T.current,u)})),t=la(T.current);return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[h,d,u]),e.useEffect((()=>{d||z()}),[d,z]),(0,s.jsx)(w,{nodeRef:T,onEnter:M,onEntered:C,onEntering:E,onExit:L,onExited:I,onExiting:P,addEndListener:e=>{o&&o(T.current,e)},appear:l,in:d,timeout:_,...k,children:(t,r)=>{let{ownerState:n,...i}=r;return e.cloneElement(c,{ref:S,style:{visibility:"exited"!==t||d?void 0:"hidden",...b,...c.props.style},...i})}})}));function Ul(e){return Ai("MuiDrawer",e)}Mi("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);function Vl(e,t){if(!e)return t;function r(e,t){const r={};return Object.keys(t).forEach((n=>{(function(e,t){const r=e.charCodeAt(2);return"o"===e[0]&&"n"===e[1]&&r>=65&&r<=90&&"function"===typeof t})(n,t[n])&&"function"===typeof e[n]&&(r[n]=function(){e[n](...arguments),t[n](...arguments)})})),r}if("function"===typeof e||"function"===typeof t)return n=>{const i="function"===typeof t?t(n):t,a="function"===typeof e?e({...n,...i}):e,o=Gn(n?.className,i?.className,a?.className),s=r(a,i);return{...i,...a,...s,...!!o&&{className:o},...i?.style&&a?.style&&{style:{...i.style,...a.style}},...i?.sx&&a?.sx&&{sx:[...Array.isArray(i.sx)?i.sx:[i.sx],...Array.isArray(a.sx)?a.sx:[a.sx]]}}};const n=t,i=r(e,n),a=Gn(n?.className,e?.className);return{...t,...e,...i,...!!a&&{className:a},...n?.style&&e?.style&&{style:{...n.style,...e.style}},...n?.sx&&e?.sx&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}const ql=(e,t)=>{const{ownerState:r}=e;return[t.root,("permanent"===r.variant||"persistent"===r.variant)&&t.docked,t.modal]},Hl=gi(Fl,{name:"MuiDrawer",slot:"Root",overridesResolver:ql})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.drawer}}))),Gl=gi("div",{shouldForwardProp:mi,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ql})({flex:"0 0 auto"}),Wl=gi(Pi,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`paperAnchor${Oi(r.anchor)}`],"temporary"!==r.variant&&t[`paperAnchorDocked${Oi(r.anchor)}`]]}})(wi((e=>{let{theme:t}=e;return{overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(t.vars||t).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:e=>{let{ownerState:t}=e;return"left"===t.anchor&&"temporary"!==t.variant},style:{borderRight:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"top"===t.anchor&&"temporary"!==t.variant},style:{borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"right"===t.anchor&&"temporary"!==t.variant},style:{borderLeft:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return"bottom"===t.anchor&&"temporary"!==t.variant},style:{borderTop:`1px solid ${(t.vars||t).palette.divider}`}}]}}))),$l={left:"right",right:"left",top:"down",bottom:"up"};const Zl=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDrawer"}),i=bi(),a=je(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:l="left",BackdropProps:c,children:u,className:h,elevation:p=16,hideBackdrop:d=!1,ModalProps:{BackdropProps:f,...m}={},onClose:g,open:y=!1,PaperProps:v={},SlideProps:x,TransitionComponent:b,transitionDuration:_=o,variant:w="temporary",slots:k={},slotProps:T={},...S}=n,A=e.useRef(!1);e.useEffect((()=>{A.current=!0}),[]);const M=function(e,t){let{direction:r}=e;return"rtl"===r&&function(e){return["left","right"].includes(e)}(t)?$l[t]:t}({direction:a?"rtl":"ltr"},l),E=l,C={...n,anchor:E,elevation:p,open:y,variant:w,...S},P=(e=>{const{classes:t,anchor:r,variant:n}=e;return Wn({root:["root",`anchor${Oi(r)}`],docked:[("permanent"===n||"persistent"===n)&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${Oi(r)}`,"temporary"!==n&&`paperAnchorDocked${Oi(r)}`]},Ul,t)})(C),L={slots:{transition:b,...k},slotProps:{paper:v,transition:x,...T,backdrop:Vl(T.backdrop||{...c,...f},{transitionDuration:_})}},[I,z]=Yi("root",{ref:r,elementType:Hl,className:Gn(P.root,P.modal,h),shouldForwardComponentProp:!0,ownerState:C,externalForwardedProps:{...L,...S,...m},additionalProps:{open:y,onClose:g,hideBackdrop:d,slots:{backdrop:L.slots.backdrop},slotProps:{backdrop:L.slotProps.backdrop}}}),[O,R]=Yi("paper",{elementType:Wl,shouldForwardComponentProp:!0,className:Gn(P.paper,v.className),ownerState:C,externalForwardedProps:L,additionalProps:{elevation:"temporary"===w?p:0,square:!0}}),[D,j]=Yi("docked",{elementType:Gl,ref:r,className:Gn(P.root,P.docked,h),ownerState:C,externalForwardedProps:L,additionalProps:S}),[F,B]=Yi("transition",{elementType:Nl,ownerState:C,externalForwardedProps:L,additionalProps:{in:y,direction:$l[M],timeout:_,appear:A.current}}),N=(0,s.jsx)(O,{...R,children:u});if("permanent"===w)return(0,s.jsx)(D,{...j,children:N});const U=(0,s.jsx)(F,{...B,children:N});return"persistent"===w?(0,s.jsx)(D,{...j,children:U}):(0,s.jsx)(I,{...z,children:U})}));function Xl(e){return Ai("MuiToolbar",e)}Mi("MuiToolbar",["root","gutters","regular","dense"]);const Yl=gi("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableGutters&&t.gutters,t[r.variant]]}})(wi((e=>{let{theme:t}=e;return{position:"relative",display:"flex",alignItems:"center",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableGutters},style:{paddingLeft:t.spacing(2),paddingRight:t.spacing(2),[t.breakpoints.up("sm")]:{paddingLeft:t.spacing(3),paddingRight:t.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:t.mixins.toolbar}]}}))),Kl=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiToolbar"}),{className:n,component:i="div",disableGutters:a=!1,variant:o="regular",...l}=r,c={...r,component:i,disableGutters:a,variant:o},u=(e=>{const{classes:t,disableGutters:r,variant:n}=e;return Wn({root:["root",!r&&"gutters",n]},Xl,t)})(c);return(0,s.jsx)(Yl,{as:i,className:Gn(u.root,n),ref:t,ownerState:c,...l})})),Jl=Bi((0,s.jsx)("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}));function Ql(e){return Ai("MuiCircularProgress",e)}Mi("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const ec=44,tc=ar`
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
`,rc=ar`
0% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 100px, 200px;
stroke-dashoffset: -15px;
}
100% {
stroke-dasharray: 1px, 200px;
stroke-dashoffset: -126px;
}
`,nc="string"!==typeof tc?ir`
animation: ${tc} 1.4s linear infinite;
`:null,ic="string"!==typeof rc?ir`
animation: ${rc} 1.4s ease-in-out infinite;
`:null,ac=gi("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("transform")}},{props:{variant:"indeterminate"},style:nc||{animation:`${tc} 1.4s linear infinite`}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}}))]}}))),oc=gi("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),sc=gi("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${Oi(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(wi((e=>{let{theme:t}=e;return{stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:t.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:e=>{let{ownerState:t}=e;return"indeterminate"===t.variant&&!t.disableShrink},style:ic||{animation:`${rc} 1.4s ease-in-out infinite`}}]}}))),lc=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCircularProgress"}),{className:n,color:i="primary",disableShrink:a=!1,size:o=40,style:l,thickness:c=3.6,value:u=0,variant:h="indeterminate",...p}=r,d={...r,color:i,disableShrink:a,size:o,thickness:c,value:u,variant:h},f=(e=>{const{classes:t,variant:r,color:n,disableShrink:i}=e;return Wn({root:["root",r,`color${Oi(n)}`],svg:["svg"],circle:["circle",`circle${Oi(r)}`,i&&"circleDisableShrink"]},Ql,t)})(d),m={},g={},y={};if("determinate"===h){const e=2*Math.PI*((ec-c)/2);m.strokeDasharray=e.toFixed(3),y["aria-valuenow"]=Math.round(u),m.strokeDashoffset=`${((100-u)/100*e).toFixed(3)}px`,g.transform="rotate(-90deg)"}return(0,s.jsx)(ac,{className:Gn(f.root,n),style:{width:o,height:o,...g,...l},ownerState:d,ref:t,role:"progressbar",...y,...p,children:(0,s.jsx)(oc,{className:f.svg,ownerState:d,viewBox:"22 22 44 44",children:(0,s.jsx)(sc,{className:f.circle,style:m,ownerState:d,cx:ec,cy:ec,r:(ec-c)/2,fill:"none",strokeWidth:c})})})}));function cc(e){return Ai("MuiIconButton",e)}const uc=Mi("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),hc=gi(Ha,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,"default"!==r.color&&t[`color${Oi(r.color)}`],r.edge&&t[`edge${Oi(r.edge)}`],t[`size${Oi(r.size)}`]]}})(wi((e=>{let{theme:t}=e;return{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(t.vars||t).palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),variants:[{props:e=>!e.disableRipple,style:{"--IconButton-hoverBg":t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.action.active,t.palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]}})),wi((e=>{let{theme:t}=e;return{variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{"--IconButton-hoverBg":t.vars?`rgba(${(t.vars||t).palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr((t.vars||t).palette[r].main,t.palette.action.hoverOpacity)}}})),{props:{size:"small"},style:{padding:5,fontSize:t.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:t.typography.pxToRem(28)}}],[`&.${uc.disabled}`]:{backgroundColor:"transparent",color:(t.vars||t).palette.action.disabled},[`&.${uc.loading}`]:{color:"transparent"}}}))),pc=gi("span",{name:"MuiIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(t.vars||t).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]}})),dc=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiIconButton"}),{edge:n=!1,children:i,className:a,color:o="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:h,loading:p=null,loadingIndicator:d,...f}=r,m=Js(h),g=d??(0,s.jsx)(lc,{"aria-labelledby":m,color:"inherit",size:16}),y={...r,edge:n,color:o,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:g,size:u},v=(e=>{const{classes:t,disabled:r,color:n,edge:i,size:a,loading:o}=e;return Wn({root:["root",o&&"loading",r&&"disabled","default"!==n&&`color${Oi(n)}`,i&&`edge${Oi(i)}`,`size${Oi(a)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},cc,t)})(y);return(0,s.jsxs)(hc,{id:p?m:h,className:Gn(v.root,a),centerRipple:!0,focusRipple:!c,disabled:l||p,ref:t,...f,ownerState:y,children:["boolean"===typeof p&&(0,s.jsx)("span",{className:v.loadingWrapper,style:{display:"contents"},children:(0,s.jsx)(pc,{className:v.loadingIndicator,ownerState:y,children:p&&g})}),i]})}));function fc(e){const{sx:t,...r}=e,{systemProps:n,otherProps:i}=(e=>{const t={systemProps:{},otherProps:{}},r=e?.theme?.unstable_sxConfig??Qt;return Object.keys(e).forEach((n=>{r[n]?t.systemProps[n]=e[n]:t.otherProps[n]=e[n]})),t})(r);let a;return a=Array.isArray(t)?[n,...t]:"function"===typeof t?function(){const e=t(...arguments);return Ke(e)?{...n,...e}:n}:{...n,...t},{...i,sx:a}}const mc=Mi("MuiBox",["root"]),gc=Pn(),yc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{themeId:r,defaultTheme:n,defaultClassName:i="MuiBox-root",generateClassName:a}=t,o=ti("div",{shouldForwardProp:e=>"theme"!==e&&"sx"!==e&&"as"!==e})(tr);return e.forwardRef((function(e,t){const l=xi(n),{className:c,component:u="div",...h}=fc(e);return(0,s.jsx)(o,{as:u,ref:t,className:Gn(c,a?a(i):i),theme:r&&l[r]||l,...h})}))}({themeId:We,defaultTheme:gc,defaultClassName:mc.root,generateClassName:Ti.generate});const vc=function(e){let{styles:t,themeId:r,defaultTheme:n={}}=e;const i=xi(n),a="function"===typeof t?t(r&&i[r]||i):t;return(0,s.jsx)(or,{styles:a})};const xc=function(e){return(0,s.jsx)(vc,{...e,defaultTheme:di,themeId:We})};function bc(e){return function(t){return(0,s.jsx)(xc,{styles:"function"===typeof e?r=>e({theme:r,...t}):e})}}const _c="function"===typeof bc({}),wc=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),kc=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),Tc=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r={};t&&e.colorSchemes&&"function"===typeof e.getColorSchemeSelector&&Object.entries(e.colorSchemes).forEach((t=>{let[n,i]=t;const a=e.getColorSchemeSelector(n);a.startsWith("@")?r[a]={":root":{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={colorScheme:i.palette?.mode}}));let n={html:wc(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...kc(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...r};const i=e.components?.MuiCssBaseline?.styleOverrides;return i&&(n=[n,i]),n},Sc="mui-ecs",Ac=bc(_c?e=>{let{theme:t,enableColorScheme:r}=e;return Tc(t,r)}:e=>{let{theme:t}=e;return(e=>{const t=Tc(e,!1),r=Array.isArray(t)?t[0]:t;return!e.vars&&r&&(r.html[`:root:has(${Sc})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach((t=>{let[n,i]=t;const a=e.getColorSchemeSelector(n);a.startsWith("@")?r[a]={[`:root:not(:has(.${Sc}))`]:{colorScheme:i.palette?.mode}}:r[a.replace(/\s*&/,"")]={[`&:not(:has(.${Sc}))`]:{colorScheme:i.palette?.mode}}})),t})(t)});const Mc=function(t){const r=yi({props:t,name:"MuiCssBaseline"}),{children:n,enableColorScheme:i=!1}=r;return(0,s.jsxs)(e.Fragment,{children:[_c&&(0,s.jsx)(Ac,{enableColorScheme:i}),!_c&&!i&&(0,s.jsx)("span",{className:Sc,style:{display:"none"}}),n]})},Ec=Bi((0,s.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}));function Cc(e){return Ai("MuiDivider",e)}Mi("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]);const Pc=gi("div",{name:"MuiDivider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.absolute&&t.absolute,t[r.variant],r.light&&t.light,"vertical"===r.orientation&&t.vertical,r.flexItem&&t.flexItem,r.children&&t.withChildren,r.children&&"vertical"===r.orientation&&t.withChildrenVertical,"right"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignRight,"left"===r.textAlign&&"vertical"!==r.orientation&&t.textAlignLeft]}})(wi((e=>{let{theme:t}=e;return{margin:0,flexShrink:0,borderWidth:0,borderStyle:"solid",borderColor:(t.vars||t).palette.divider,borderBottomWidth:"thin",variants:[{props:{absolute:!0},style:{position:"absolute",bottom:0,left:0,width:"100%"}},{props:{light:!0},style:{borderColor:t.vars?`rgba(${t.vars.palette.dividerChannel} / 0.08)`:Tr(t.palette.divider,.08)}},{props:{variant:"inset"},style:{marginLeft:72}},{props:{variant:"middle",orientation:"horizontal"},style:{marginLeft:t.spacing(2),marginRight:t.spacing(2)}},{props:{variant:"middle",orientation:"vertical"},style:{marginTop:t.spacing(1),marginBottom:t.spacing(1)}},{props:{orientation:"vertical"},style:{height:"100%",borderBottomWidth:0,borderRightWidth:"thin"}},{props:{flexItem:!0},style:{alignSelf:"stretch",height:"auto"}},{props:e=>{let{ownerState:t}=e;return!!t.children},style:{display:"flex",textAlign:"center",border:0,borderTopStyle:"solid",borderLeftStyle:"solid","&::before, &::after":{content:'""',alignSelf:"center"}}},{props:e=>{let{ownerState:t}=e;return t.children&&"vertical"!==t.orientation},style:{"&::before, &::after":{width:"100%",borderTop:`thin solid ${(t.vars||t).palette.divider}`,borderTopStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"vertical"===t.orientation&&t.children},style:{flexDirection:"column","&::before, &::after":{height:"100%",borderLeft:`thin solid ${(t.vars||t).palette.divider}`,borderLeftStyle:"inherit"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"90%"},"&::after":{width:"10%"}}},{props:e=>{let{ownerState:t}=e;return"left"===t.textAlign&&"vertical"!==t.orientation},style:{"&::before":{width:"10%"},"&::after":{width:"90%"}}}]}}))),Lc=gi("span",{name:"MuiDivider",slot:"Wrapper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.wrapper,"vertical"===r.orientation&&t.wrapperVertical]}})(wi((e=>{let{theme:t}=e;return{display:"inline-block",paddingLeft:`calc(${t.spacing(1)} * 1.2)`,paddingRight:`calc(${t.spacing(1)} * 1.2)`,whiteSpace:"nowrap",variants:[{props:{orientation:"vertical"},style:{paddingTop:`calc(${t.spacing(1)} * 1.2)`,paddingBottom:`calc(${t.spacing(1)} * 1.2)`}}]}}))),Ic=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDivider"}),{absolute:n=!1,children:i,className:a,orientation:o="horizontal",component:l=(i||"vertical"===o?"div":"hr"),flexItem:c=!1,light:u=!1,role:h=("hr"!==l?"separator":void 0),textAlign:p="center",variant:d="fullWidth",...f}=r,m={...r,absolute:n,component:l,flexItem:c,light:u,orientation:o,role:h,textAlign:p,variant:d},g=(e=>{const{absolute:t,children:r,classes:n,flexItem:i,light:a,orientation:o,textAlign:s,variant:l}=e;return Wn({root:["root",t&&"absolute",l,a&&"light","vertical"===o&&"vertical",i&&"flexItem",r&&"withChildren",r&&"vertical"===o&&"withChildrenVertical","right"===s&&"vertical"!==o&&"textAlignRight","left"===s&&"vertical"!==o&&"textAlignLeft"],wrapper:["wrapper","vertical"===o&&"wrapperVertical"]},Cc,n)})(m);return(0,s.jsx)(Pc,{as:l,className:Gn(g.root,a),role:h,ref:t,ownerState:m,"aria-orientation":"separator"!==h||"hr"===l&&"vertical"!==o?void 0:o,...f,children:i?(0,s.jsx)(Lc,{className:g.wrapper,ownerState:m,children:i}):null})}));Ic&&(Ic.muiSkipListHighlight=!0);const zc=Ic,Oc=ui();const Rc=tn(),Dc=Oc("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root});function jc(e){return function(e){let{props:t,name:r,defaultTheme:n,themeId:i}=e,a=xi(n);return i&&(a=a[i]||a),Fn({theme:a,name:r,props:t})}({props:e,name:"MuiStack",defaultTheme:Rc})}function Fc(t,r){const n=e.Children.toArray(t).filter(Boolean);return n.reduce(((t,i,a)=>(t.push(i),a<n.length-1&&t.push(e.cloneElement(r,{key:`separator-${a}`})),t)),[])}const Bc=e=>{let{ownerState:t,theme:r}=e,n={display:"flex",flexDirection:"column",...it({theme:r},st({values:t.direction,breakpoints:r.breakpoints.values}),(e=>({flexDirection:e})))};if(t.spacing){const e=xt(r),i=Object.keys(r.breakpoints.values).reduce(((e,r)=>(("object"===typeof t.spacing&&null!=t.spacing[r]||"object"===typeof t.direction&&null!=t.direction[r])&&(e[r]=!0),e)),{}),a=st({values:t.direction,base:i}),o=st({values:t.spacing,base:i});"object"===typeof a&&Object.keys(a).forEach(((e,t,r)=>{if(!a[e]){const n=t>0?a[r[t-1]]:"column";a[e]=n}}));n=Qe(n,it({theme:r},o,((r,n)=>{return t.useFlexGap?{gap:bt(e,r)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${i=n?a[n]:t.direction,{row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"}[i]}`]:bt(e,r)}};var i})))}return n=function(e){const t=at(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];const a=[t,...n].reduce(((e,t)=>Qe(e,t)),{});return ot(Object.keys(t),a)}(r.breakpoints,n),n};const Nc=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{createStyledComponent:r=Dc,useThemeProps:n=jc,componentName:i="MuiStack"}=t,a=r(Bc);return e.forwardRef((function(e,t){const r=fc(n(e)),{component:o="div",direction:l="column",spacing:c=0,divider:u,children:h,className:p,useFlexGap:d=!1,...f}=r,m={direction:l,spacing:c,useFlexGap:d},g=Wn({root:["root"]},(e=>Ai(i,e)),{});return(0,s.jsx)(a,{as:o,ownerState:m,ref:t,className:Gn(g.root,p),...f,children:u?Fc(h,u):h})}))}({createStyledComponent:gi("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>yi({props:e,name:"MuiStack"})}),Uc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};const Vc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(e,t)=>e===t;return e.length===t.length&&e.every(((e,n)=>r(e,t[n])))};function qc(e,t,r,n,i){return 1===r?Math.min(e+t,i):Math.max(e-t,n)}function Hc(e,t){return e-t}function Gc(e,t){const{index:r}=e.reduce(((e,r,n)=>{const i=Math.abs(t-r);return null===e||i<e.distance||i===e.distance?{distance:i,index:n}:e}),null)??{};return r}function Wc(e,t){if(void 0!==t.current&&e.changedTouches){const r=e;for(let e=0;e<r.changedTouches.length;e+=1){const n=r.changedTouches[e];if(n.identifier===t.current)return{x:n.clientX,y:n.clientY}}return!1}return{x:e.clientX,y:e.clientY}}function $c(e,t,r){return 100*(e-t)/(r-t)}function Zc(e,t,r){const n=Math.round((e-r)/t)*t+r;return Number(n.toFixed(function(e){if(Math.abs(e)<1){const t=e.toExponential().split("e-"),r=t[0].split(".")[1];return(r?r.length:0)+parseInt(t[1],10)}const t=e.toString().split(".")[1];return t?t.length:0}(t)))}function Xc(e){let{values:t,newValue:r,index:n}=e;const i=t.slice();return i[n]=r,i.sort(Hc)}function Yc(e){let{sliderRef:t,activeIndex:r,setActive:n}=e;const i=oa(t.current);t.current?.contains(i.activeElement)&&Number(i?.activeElement?.getAttribute("data-index"))===r||t.current?.querySelector(`[type="range"][data-index="${r}"]`).focus(),n&&n(r)}function Kc(e,t){return"number"===typeof e&&"number"===typeof t?e===t:"object"===typeof e&&"object"===typeof t&&Vc(e,t)}const Jc={horizontal:{offset:e=>({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},Qc=e=>e;let eu;function tu(){return void 0===eu&&(eu="undefined"===typeof CSS||"function"!==typeof CSS.supports||CSS.supports("touch-action","none")),eu}const ru=function(e){return"string"===typeof e},nu=e=>!e||!ru(e);function iu(e){return Ai("MuiSlider",e)}const au=Mi("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]);function ou(e){return e}const su=gi("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Oi(r.color)}`],"medium"!==r.size&&t[`size${Oi(r.size)}`],r.marked&&t.marked,"vertical"===r.orientation&&t.vertical,"inverted"===r.track&&t.trackInverted,!1===r.track&&t.trackFalse]}})(wi((e=>{let{theme:t}=e;return{borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent","@media print":{colorAdjust:"exact"},[`&.${au.disabled}`]:{pointerEvents:"none",cursor:"default",color:(t.vars||t).palette.grey[400]},[`&.${au.dragging}`]:{[`& .${au.thumb}, & .${au.track}`]:{transition:"none"}},variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),{props:{orientation:"horizontal"},style:{height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}}},{props:{orientation:"horizontal",size:"small"},style:{height:2}},{props:{orientation:"horizontal",marked:!0},style:{marginBottom:20}},{props:{orientation:"vertical"},style:{height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}}},{props:{orientation:"vertical",size:"small"},style:{width:2}},{props:{orientation:"vertical",marked:!0},style:{marginRight:44}}]}}))),lu=gi("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38,variants:[{props:{orientation:"horizontal"},style:{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:"inverted"},style:{opacity:1}}]}),cu=gi("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(wi((e=>{let{theme:t}=e;return{display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:t.transitions.create(["left","width","bottom","height"],{duration:t.transitions.duration.shortest}),variants:[{props:{size:"small"},style:{border:"none"}},{props:{orientation:"horizontal"},style:{height:"inherit",top:"50%",transform:"translateY(-50%)"}},{props:{orientation:"vertical"},style:{width:"inherit",left:"50%",transform:"translateX(-50%)"}},{props:{track:!1},style:{display:"none"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r,track:"inverted"},style:{...t.vars?{backgroundColor:t.vars.palette.Slider[`${r}Track`],borderColor:t.vars.palette.Slider[`${r}Track`]}:{backgroundColor:Er(t.palette[r].main,.62),borderColor:Er(t.palette[r].main,.62),...t.applyStyles("dark",{backgroundColor:Ar(t.palette[r].main,.5)}),...t.applyStyles("dark",{borderColor:Ar(t.palette[r].main,.5)})}}}}))]}}))),uu=gi("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Oi(r.color)}`],"medium"!==r.size&&t[`thumbSize${Oi(r.size)}`]]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:t.transitions.create(["box-shadow","left","bottom"],{duration:t.transitions.duration.shortest}),"&::before":{position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(t.vars||t).shadows[2]},"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&.${au.disabled}`]:{"&:hover":{boxShadow:"none"}},variants:[{props:{size:"small"},style:{width:12,height:12,"&::before":{boxShadow:"none"}}},{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-50%, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 50%)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&:hover, &.${au.focusVisible}`]:{...t.vars?{boxShadow:`0px 0px 0px 8px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 8px ${Tr(t.palette[r].main,.16)}`},"@media (hover: none)":{boxShadow:"none"}},[`&.${au.active}`]:{...t.vars?{boxShadow:`0px 0px 0px 14px rgba(${t.vars.palette[r].mainChannel} / 0.16)`}:{boxShadow:`0px 0px 0px 14px ${Tr(t.palette[r].main,.16)}`}}}}}))]}}))),hu=gi((function(t){const{children:r,className:n,value:i}=t,a=(e=>{const{open:t}=e;return{offset:Gn(t&&au.valueLabelOpen),circle:au.valueLabelCircle,label:au.valueLabelLabel}})(t);return r?e.cloneElement(r,{className:Gn(r.props.className)},(0,s.jsxs)(e.Fragment,{children:[r.props.children,(0,s.jsx)("span",{className:Gn(a.offset,n),"aria-hidden":!0,children:(0,s.jsx)("span",{className:a.circle,children:(0,s.jsx)("span",{className:a.label,children:i})})})]})):null}),{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(wi((e=>{let{theme:t}=e;return{zIndex:1,whiteSpace:"nowrap",...t.typography.body2,fontWeight:500,transition:t.transitions.create(["transform"],{duration:t.transitions.duration.shortest}),position:"absolute",backgroundColor:(t.vars||t).palette.grey[600],borderRadius:2,color:(t.vars||t).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem",variants:[{props:{orientation:"horizontal"},style:{transform:"translateY(-100%) scale(0)",top:"-10px",transformOrigin:"bottom center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"},[`&.${au.valueLabelOpen}`]:{transform:"translateY(-100%) scale(1)"}}},{props:{orientation:"vertical"},style:{transform:"translateY(-50%) scale(0)",right:"30px",top:"50%",transformOrigin:"right center","&::before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"},[`&.${au.valueLabelOpen}`]:{transform:"translateY(-50%) scale(1)"}}},{props:{size:"small"},style:{fontSize:t.typography.pxToRem(12),padding:"0.25rem 0.5rem"}},{props:{orientation:"vertical",size:"small"},style:{right:"20px"}}]}}))),pu=gi("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>fi(e)&&"markActive"!==e,overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor",variants:[{props:{orientation:"horizontal"},style:{top:"50%",transform:"translate(-1px, -50%)"}},{props:{orientation:"vertical"},style:{left:"50%",transform:"translate(-50%, 1px)"}},{props:{markActive:!0},style:{backgroundColor:(t.vars||t).palette.background.paper,opacity:.8}}]}}))),du=gi("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>fi(e)&&"markLabelActive"!==e,overridesResolver:(e,t)=>t.markLabel})(wi((e=>{let{theme:t}=e;return{...t.typography.body2,color:(t.vars||t).palette.text.secondary,position:"absolute",whiteSpace:"nowrap",variants:[{props:{orientation:"horizontal"},style:{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}}},{props:{orientation:"vertical"},style:{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}}},{props:{markLabelActive:!0},style:{color:(t.vars||t).palette.text.primary}}]}}))),fu=e=>{let{children:t}=e;return t},mu=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSlider"}),i=je(),{"aria-label":a,"aria-valuetext":o,"aria-labelledby":l,component:c="span",components:u={},componentsProps:h={},color:p="primary",classes:d,className:f,disableSwap:m=!1,disabled:g=!1,getAriaLabel:y,getAriaValueText:v,marks:x=!1,max:b=100,min:_=0,name:w,onChange:k,onChangeCommitted:T,orientation:S="horizontal",shiftStep:A=10,size:M="medium",step:E=1,scale:C=ou,slotProps:P,slots:L,tabIndex:I,track:z="normal",value:O,valueLabelDisplay:R="off",valueLabelFormat:D=ou,...j}=n,F={...n,isRtl:i,max:b,min:_,classes:d,disabled:g,disableSwap:m,orientation:S,marks:x,color:p,size:M,step:E,shiftStep:A,scale:C,track:z,valueLabelDisplay:R,valueLabelFormat:D},{axisProps:B,getRootProps:N,getHiddenInputProps:U,getThumbProps:V,open:q,active:H,axis:G,focusedThumbIndex:W,range:$,dragging:Z,marks:X,values:Y,trackOffset:K,trackLeap:J,getThumbStyle:Q}=function(t){const{"aria-labelledby":r,defaultValue:n,disabled:i=!1,disableSwap:a=!1,isRtl:o=!1,marks:s=!1,max:l=100,min:c=0,name:u,onChange:h,onChangeCommitted:p,orientation:d="horizontal",rootRef:f,scale:m=Qc,step:g=1,shiftStep:y=10,tabIndex:v,value:x}=t,b=e.useRef(void 0),[_,w]=e.useState(-1),[k,T]=e.useState(-1),[S,A]=e.useState(!1),M=e.useRef(0),E=e.useRef(null),[C,P]=Qs({controlled:x,default:n??c,name:"Slider"}),L=h&&((e,t,r)=>{const n=e.nativeEvent||e,i=new n.constructor(n.type,n);Object.defineProperty(i,"target",{writable:!0,value:{value:t,name:u}}),E.current=t,h(i,t,r)}),I=Array.isArray(C);let z=I?C.slice().sort(Hc):[C];z=z.map((e=>null==e?c:yr(e,c,l)));const O=!0===s&&null!==g?[...Array(Math.floor((l-c)/g)+1)].map(((e,t)=>({value:c+g*t}))):s||[],R=O.map((e=>e.value)),[D,j]=e.useState(-1),F=e.useRef(null),B=qi(f,F),N=e=>t=>{const r=Number(t.currentTarget.getAttribute("data-index"));pa(t.target)&&j(r),T(r),e?.onFocus?.(t)},U=e=>t=>{pa(t.target)||j(-1),T(-1),e?.onBlur?.(t)},V=(e,t)=>{const r=Number(e.currentTarget.getAttribute("data-index")),n=z[r],i=R.indexOf(n);let o=t;if(O&&null==g){const e=R[R.length-1];o=o>=e?e:o<=R[0]?R[0]:o<n?R[i-1]:R[i+1]}if(o=yr(o,c,l),I){a&&(o=yr(o,z[r-1]||-1/0,z[r+1]||1/0));const e=o;o=Xc({values:z,newValue:o,index:r});let t=r;a||(t=o.indexOf(e)),Yc({sliderRef:F,activeIndex:t})}P(o),j(r),L&&!Kc(o,C)&&L(e,o,r),p&&p(e,E.current??o)},q=e=>t=>{if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(t.key)){t.preventDefault();const e=Number(t.currentTarget.getAttribute("data-index")),r=z[e];let n=null;if(null!=g){const e=t.shiftKey?y:g;switch(t.key){case"ArrowUp":n=qc(r,e,1,c,l);break;case"ArrowRight":n=qc(r,e,o?-1:1,c,l);break;case"ArrowDown":n=qc(r,e,-1,c,l);break;case"ArrowLeft":n=qc(r,e,o?1:-1,c,l);break;case"PageUp":n=qc(r,y,1,c,l);break;case"PageDown":n=qc(r,y,-1,c,l);break;case"Home":n=c;break;case"End":n=l}}else if(O){const e=R[R.length-1],i=R.indexOf(r),a=[o?"ArrowLeft":"ArrowRight","ArrowUp","PageUp","End"];[o?"ArrowRight":"ArrowLeft","ArrowDown","PageDown","Home"].includes(t.key)?n=0===i?R[0]:R[i-1]:a.includes(t.key)&&(n=i===R.length-1?e:R[i+1])}null!=n&&V(t,n)}e?.onKeyDown?.(t)};sr((()=>{i&&F.current.contains(document.activeElement)&&document.activeElement?.blur()}),[i]),i&&-1!==_&&w(-1),i&&-1!==D&&j(-1);const H=e.useRef(void 0);let G=d;o&&"horizontal"===d&&(G+="-reverse");const W=e=>{let{finger:t,move:r=!1}=e;const{current:n}=F,{width:i,height:o,bottom:s,left:u}=n.getBoundingClientRect();let h,p;if(h=G.startsWith("vertical")?(s-t.y)/o:(t.x-u)/i,G.includes("-reverse")&&(h=1-h),p=function(e,t,r){return(r-t)*e+t}(h,c,l),g)p=Zc(p,g,c);else{const e=Gc(R,p);p=R[e]}p=yr(p,c,l);let d=0;if(I){d=r?H.current:Gc(z,p),a&&(p=yr(p,z[d-1]||-1/0,z[d+1]||1/0));const e=p;p=Xc({values:z,newValue:p,index:d}),a&&r||(d=p.indexOf(e),H.current=d)}return{newValue:p,activeIndex:d}},$=fa((e=>{const t=Wc(e,b);if(!t)return;if(M.current+=1,"mousemove"===e.type&&0===e.buttons)return void Z(e);const{newValue:r,activeIndex:n}=W({finger:t,move:!0});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(r),!S&&M.current>2&&A(!0),L&&!Kc(r,C)&&L(e,r,n)})),Z=fa((e=>{const t=Wc(e,b);if(A(!1),!t)return;const{newValue:r}=W({finger:t,move:!0});w(-1),"touchend"===e.type&&T(-1),p&&p(e,E.current??r),b.current=void 0,Y()})),X=fa((e=>{if(i)return;tu()||e.preventDefault();const t=e.changedTouches[0];null!=t&&(b.current=t.identifier);const r=Wc(e,b);if(!1!==r){const{newValue:t,activeIndex:n}=W({finger:r});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(t),L&&!Kc(t,C)&&L(e,t,n)}M.current=0;const n=oa(F.current);n.addEventListener("touchmove",$,{passive:!0}),n.addEventListener("touchend",Z,{passive:!0})})),Y=e.useCallback((()=>{const e=oa(F.current);e.removeEventListener("mousemove",$),e.removeEventListener("mouseup",Z),e.removeEventListener("touchmove",$),e.removeEventListener("touchend",Z)}),[Z,$]);e.useEffect((()=>{const{current:e}=F;return e.addEventListener("touchstart",X,{passive:tu()}),()=>{e.removeEventListener("touchstart",X),Y()}}),[Y,X]),e.useEffect((()=>{i&&Y()}),[i,Y]);const K=$c(I?z[0]:c,c,l),J=$c(z[z.length-1],c,l)-K,Q=e=>t=>{e.onMouseLeave?.(t),T(-1)};let ee;return"vertical"===d&&(ee=o?"vertical-rl":"vertical-lr"),{active:_,axis:G,axisProps:Jc,dragging:S,focusedThumbIndex:D,getHiddenInputProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=$i(e),a={onChange:(s=n||{},e=>{s.onChange?.(e),V(e,e.target.valueAsNumber)}),onFocus:N(n||{}),onBlur:U(n||{}),onKeyDown:q(n||{})};var s;const h={...n,...a};return{tabIndex:v,"aria-labelledby":r,"aria-orientation":d,"aria-valuemax":m(l),"aria-valuemin":m(c),name:u,type:"range",min:t.min,max:t.max,step:null===t.step&&t.marks?"any":t.step??void 0,disabled:i,...e,...h,style:{...Uc,direction:o?"rtl":"ltr",width:"100%",height:"100%",writingMode:ee}}},getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=$i(e),r={onMouseDown:(n=t||{},e=>{if(n.onMouseDown?.(e),i)return;if(e.defaultPrevented)return;if(0!==e.button)return;e.preventDefault();const t=Wc(e,b);if(!1!==t){const{newValue:r,activeIndex:n}=W({finger:t});Yc({sliderRef:F,activeIndex:n,setActive:w}),P(r),L&&!Kc(r,C)&&L(e,r,n)}M.current=0;const r=oa(F.current);r.addEventListener("mousemove",$,{passive:!0}),r.addEventListener("mouseup",Z)})};var n;const a={...t,...r};return{...e,ref:B,...a}},getThumbProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=$i(e),r={onMouseOver:(n=t||{},e=>{n.onMouseOver?.(e);const t=Number(e.currentTarget.getAttribute("data-index"));T(t)}),onMouseLeave:Q(t||{})};var n;return{...e,...t,...r}},marks:O,open:k,range:I,rootRef:B,trackLeap:J,trackOffset:K,values:z,getThumbStyle:e=>({pointerEvents:-1!==_&&_!==e?"none":void 0})}}({...F,rootRef:r});F.marked=X.length>0&&X.some((e=>e.label)),F.dragging=Z,F.focusedThumbIndex=W;const ee=(e=>{const{disabled:t,dragging:r,marked:n,orientation:i,track:a,classes:o,color:s,size:l}=e;return Wn({root:["root",t&&"disabled",r&&"dragging",n&&"marked","vertical"===i&&"vertical","inverted"===a&&"trackInverted",!1===a&&"trackFalse",s&&`color${Oi(s)}`,l&&`size${Oi(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Oi(l)}`,s&&`thumbColor${Oi(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]},iu,o)})(F),te=L?.root??u.Root??su,re=L?.rail??u.Rail??lu,ne=L?.track??u.Track??cu,ie=L?.thumb??u.Thumb??uu,ae=L?.valueLabel??u.ValueLabel??hu,oe=L?.mark??u.Mark??pu,se=L?.markLabel??u.MarkLabel??du,le=L?.input??u.Input??"input",ce=P?.root??h.root,ue=P?.rail??h.rail,he=P?.track??h.track,pe=P?.thumb??h.thumb,de=P?.valueLabel??h.valueLabel,fe=P?.mark??h.mark,me=P?.markLabel??h.markLabel,ge=P?.input??h.input,ye=ta({elementType:te,getSlotProps:N,externalSlotProps:ce,externalForwardedProps:j,additionalProps:{...nu(te)&&{as:c}},ownerState:{...F,...ce?.ownerState},className:[ee.root,f]}),ve=ta({elementType:re,externalSlotProps:ue,ownerState:F,className:ee.rail}),xe=ta({elementType:ne,externalSlotProps:he,additionalProps:{style:{...B[G].offset(K),...B[G].leap(J)}},ownerState:{...F,...he?.ownerState},className:ee.track}),be=ta({elementType:ie,getSlotProps:V,externalSlotProps:pe,ownerState:{...F,...pe?.ownerState},className:ee.thumb}),_e=ta({elementType:ae,externalSlotProps:de,ownerState:{...F,...de?.ownerState},className:ee.valueLabel}),we=ta({elementType:oe,externalSlotProps:fe,ownerState:F,className:ee.mark}),ke=ta({elementType:se,externalSlotProps:me,ownerState:F,className:ee.markLabel}),Te=ta({elementType:le,getSlotProps:U,externalSlotProps:ge,ownerState:F});return(0,s.jsxs)(te,{...ye,children:[(0,s.jsx)(re,{...ve}),(0,s.jsx)(ne,{...xe}),X.filter((e=>e.value>=_&&e.value<=b)).map(((t,r)=>{const n=$c(t.value,_,b),i=B[G].offset(n);let a;return a=!1===z?Y.includes(t.value):"normal"===z&&($?t.value>=Y[0]&&t.value<=Y[Y.length-1]:t.value<=Y[0])||"inverted"===z&&($?t.value<=Y[0]||t.value>=Y[Y.length-1]:t.value>=Y[0]),(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(oe,{"data-index":r,...we,...!ru(oe)&&{markActive:a},style:{...i,...we.style},className:Gn(we.className,a&&ee.markActive)}),null!=t.label?(0,s.jsx)(se,{"aria-hidden":!0,"data-index":r,...ke,...!ru(se)&&{markLabelActive:a},style:{...i,...ke.style},className:Gn(ee.markLabel,ke.className,a&&ee.markLabelActive),children:t.label}):null]},r)})),Y.map(((e,t)=>{const r=$c(e,_,b),n=B[G].offset(r),i="off"===R?fu:ae;return(0,s.jsx)(i,{...!ru(i)&&{valueLabelFormat:D,valueLabelDisplay:R,value:"function"===typeof D?D(C(e),t):D,index:t,open:q===t||H===t||"on"===R,disabled:g},..._e,children:(0,s.jsx)(ie,{"data-index":t,...be,className:Gn(ee.thumb,be.className,H===t&&ee.active,W===t&&ee.focusVisible),style:{...n,...Q(t),...be.style},children:(0,s.jsx)(le,{"data-index":t,"aria-label":y?y(t):a,"aria-valuenow":C(e),"aria-labelledby":l,"aria-valuetext":v?v(C(e),t):o,value:Y[t],...Te})})},t)}))]})})),gu=Bi((0,s.jsx)("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),yu=Bi((0,s.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),vu=Bi((0,s.jsx)("path",{d:"M6.99 11 3 15l3.99 4v-3H14v-2H6.99zM21 9l-3.99-4v3H10v2h7.01v3z"}));function xu(e){return Ai("MuiButton",e)}const bu=Mi("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]);const _u=e.createContext({});const wu=e.createContext(void 0),ku=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Tu=gi(Ha,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${Oi(r.color)}`],t[`size${Oi(r.size)}`],t[`${r.variant}Size${Oi(r.size)}`],"inherit"===r.color&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth,r.loading&&t.loading]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?t.palette.grey[300]:t.palette.grey[800],n="light"===t.palette.mode?t.palette.grey.A100:t.palette.grey[700];return{...t.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create(["background-color","box-shadow","border-color","color"],{duration:t.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${bu.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(t.vars||t).shadows[2],"&:hover":{boxShadow:(t.vars||t).shadows[4],"@media (hover: none)":{boxShadow:(t.vars||t).shadows[2]}},"&:active":{boxShadow:(t.vars||t).shadows[8]},[`&.${bu.focusVisible}`]:{boxShadow:(t.vars||t).shadows[6]},[`&.${bu.disabled}`]:{color:(t.vars||t).palette.action.disabled,boxShadow:(t.vars||t).shadows[0],backgroundColor:(t.vars||t).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${bu.disabled}`]:{border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{"--variant-textColor":(t.vars||t).palette[r].main,"--variant-outlinedColor":(t.vars||t).palette[r].main,"--variant-outlinedBorder":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.5)`:Tr(t.palette[r].main,.5),"--variant-containedColor":(t.vars||t).palette[r].contrastText,"--variant-containedBg":(t.vars||t).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(t.vars||t).palette[r].dark,"--variant-textBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity),"--variant-outlinedBorder":(t.vars||t).palette[r].main,"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity)}}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedBg:r,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":t.vars?t.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.text.primary,t.palette.action.hoverOpacity),"--variant-outlinedBg":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.text.primary,t.palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:t.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:t.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:t.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${bu.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${bu.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${bu.loading}`]:{color:"transparent"}}}]}}))),Su=gi("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.startIcon,r.loading&&t.startIconLoadingStart,t[`iconSize${Oi(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...ku]}})),Au=gi("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.endIcon,r.loading&&t.endIconLoadingEnd,t[`iconSize${Oi(r.size)}`]]}})((e=>{let{theme:t}=e;return{display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...ku]}})),Mu=gi("span",{name:"MuiButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})((e=>{let{theme:t}=e;return{display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(t.vars||t).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]}})),Eu=gi("span",{name:"MuiButton",slot:"LoadingIconPlaceholder",overridesResolver:(e,t)=>t.loadingIconPlaceholder})({display:"inline-block",width:"1em",height:"1em"}),Cu=e.forwardRef((function(t,r){const n=e.useContext(_u),i=e.useContext(wu),a=yi({props:Be(n,t),name:"MuiButton"}),{children:o,color:l="primary",component:c="button",className:u,disabled:h=!1,disableElevation:p=!1,disableFocusRipple:d=!1,endIcon:f,focusVisibleClassName:m,fullWidth:g=!1,id:y,loading:v=null,loadingIndicator:x,loadingPosition:b="center",size:_="medium",startIcon:w,type:k,variant:T="text",...S}=a,A=Js(y),M=x??(0,s.jsx)(lc,{"aria-labelledby":A,color:"inherit",size:16}),E={...a,color:l,component:c,disabled:h,disableElevation:p,disableFocusRipple:d,fullWidth:g,loading:v,loadingIndicator:M,loadingPosition:b,size:_,type:k,variant:T},C=(e=>{const{color:t,disableElevation:r,fullWidth:n,size:i,variant:a,loading:o,loadingPosition:s,classes:l}=e,c=Wn({root:["root",o&&"loading",a,`${a}${Oi(t)}`,`size${Oi(i)}`,`${a}Size${Oi(i)}`,`color${Oi(t)}`,r&&"disableElevation",n&&"fullWidth",o&&`loadingPosition${Oi(s)}`],startIcon:["icon","startIcon",`iconSize${Oi(i)}`],endIcon:["icon","endIcon",`iconSize${Oi(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},xu,l);return{...l,...c}})(E),P=(w||v&&"start"===b)&&(0,s.jsx)(Su,{className:C.startIcon,ownerState:E,children:w||(0,s.jsx)(Eu,{className:C.loadingIconPlaceholder,ownerState:E})}),L=(f||v&&"end"===b)&&(0,s.jsx)(Au,{className:C.endIcon,ownerState:E,children:f||(0,s.jsx)(Eu,{className:C.loadingIconPlaceholder,ownerState:E})}),I=i||"",z="boolean"===typeof v?(0,s.jsx)("span",{className:C.loadingWrapper,style:{display:"contents"},children:v&&(0,s.jsx)(Mu,{className:C.loadingIndicator,ownerState:E,children:M})}):null;return(0,s.jsxs)(Tu,{ownerState:E,className:Gn(n.className,C.root,u,I),component:c,disabled:h||v,focusRipple:!d,focusVisibleClassName:Gn(C.focusVisible,m),ref:r,type:k,id:v?A:y,...S,classes:C,children:[P,"end"!==b&&z,o,"end"===b&&z,L]})})),Pu=e=>{const{prompt:t,submitQuery:r}=e;let n=e.tunables;return"string"===typeof n&&(n=JSON.parse(n)),console.log(n),void 0===r?(0,s.jsx)(yc,{children:t}):(0,s.jsx)(Cu,{variant:"outlined",sx:{color:e=>e.palette.custom.highlight,borderColor:e=>e.palette.custom.highlight,m:1},size:"small",onClick:e=>{r(t,n)},children:t})};function Lu(e){return parseInt(e,10)||0}const Iu={visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"};function zu(e){return function(e){for(const t in e)return!1;return!0}(e)||0===e.outerHeightStyle&&!e.overflowing}const Ou=e.forwardRef((function(t,r){const{onChange:n,maxRows:i,minRows:a=1,style:o,value:l,...c}=t,{current:u}=e.useRef(null!=l),h=e.useRef(null),p=qi(r,h),d=e.useRef(null),f=e.useRef(null),m=e.useCallback((()=>{const e=h.current,r=f.current;if(!e||!r)return;const n=sa(e).getComputedStyle(e);if("0px"===n.width)return{outerHeightStyle:0,overflowing:!1};r.style.width=n.width,r.value=e.value||t.placeholder||"x","\n"===r.value.slice(-1)&&(r.value+=" ");const o=n.boxSizing,s=Lu(n.paddingBottom)+Lu(n.paddingTop),l=Lu(n.borderBottomWidth)+Lu(n.borderTopWidth),c=r.scrollHeight;r.value="x";const u=r.scrollHeight;let p=c;a&&(p=Math.max(Number(a)*u,p)),i&&(p=Math.min(Number(i)*u,p)),p=Math.max(p,u);return{outerHeightStyle:p+("border-box"===o?s+l:0),overflowing:Math.abs(p-c)<=1}}),[i,a,t.placeholder]),g=fa((()=>{const e=h.current,t=m();if(!e||!t||zu(t))return!1;const r=t.outerHeightStyle;return null!=d.current&&d.current!==r})),y=e.useCallback((()=>{const e=h.current,t=m();if(!e||!t||zu(t))return;const r=t.outerHeightStyle;d.current!==r&&(d.current=r,e.style.height=`${r}px`),e.style.overflow=t.overflowing?"hidden":""}),[m]),v=e.useRef(-1);sr((()=>{const e=ra(y),t=h?.current;if(!t)return;const r=sa(t);let n;return r.addEventListener("resize",e),"undefined"!==typeof ResizeObserver&&(n=new ResizeObserver((()=>{g()&&(n.unobserve(t),cancelAnimationFrame(v.current),y(),v.current=requestAnimationFrame((()=>{n.observe(t)})))})),n.observe(t)),()=>{e.clear(),cancelAnimationFrame(v.current),r.removeEventListener("resize",e),n&&n.disconnect()}}),[m,y,g]),sr((()=>{y()}));return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)("textarea",{value:l,onChange:e=>{u||y(),n&&n(e)},ref:p,rows:a,style:o,...c}),(0,s.jsx)("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:f,tabIndex:-1,style:{...Iu,...o,paddingTop:0,paddingBottom:0}})]})}));function Ru(e){let{props:t,states:r,muiFormControl:n}=e;return r.reduce(((e,r)=>(e[r]=t[r],n&&"undefined"===typeof t[r]&&(e[r]=n[r]),e)),{})}const Du=e.createContext(void 0);function ju(){return e.useContext(Du)}function Fu(e){return null!=e&&!(Array.isArray(e)&&0===e.length)}function Bu(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e&&(Fu(e.value)&&""!==e.value||t&&Fu(e.defaultValue)&&""!==e.defaultValue)}function Nu(e){return Ai("MuiInputBase",e)}const Uu=Mi("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Vu;const qu=(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,"small"===r.size&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${Oi(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},Hu=(e,t)=>{const{ownerState:r}=e;return[t.input,"small"===r.size&&t.inputSizeSmall,r.multiline&&t.inputMultiline,"search"===r.type&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},Gu=gi("div",{name:"MuiInputBase",slot:"Root",overridesResolver:qu})(wi((e=>{let{theme:t}=e;return{...t.typography.body1,color:(t.vars||t).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Uu.disabled}`]:{color:(t.vars||t).palette.text.disabled,cursor:"default"},variants:[{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"4px 0 5px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"100%"}}]}}))),Wu=gi("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n={color:"currentColor",...t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5},transition:t.transitions.create("opacity",{duration:t.transitions.duration.shorter})},i={opacity:"0 !important"},a=t.vars?{opacity:t.vars.opacity.inputPlaceholder}:{opacity:r?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Uu.formControl} &`]:{"&::-webkit-input-placeholder":i,"&::-moz-placeholder":i,"&::-ms-input-placeholder":i,"&:focus::-webkit-input-placeholder":a,"&:focus::-moz-placeholder":a,"&:focus::-ms-input-placeholder":a},[`&.${Uu.disabled}`]:{opacity:1,WebkitTextFillColor:(t.vars||t).palette.text.disabled},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableInjectingGlobalStyles},style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}}))),$u=bc({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),Zu=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:a,autoFocus:o,className:l,color:c,components:u={},componentsProps:h={},defaultValue:p,disabled:d,disableInjectingGlobalStyles:f,endAdornment:m,error:g,fullWidth:y=!1,id:v,inputComponent:x="input",inputProps:b={},inputRef:_,margin:w,maxRows:k,minRows:T,multiline:S=!1,name:A,onBlur:M,onChange:E,onClick:C,onFocus:P,onKeyDown:L,onKeyUp:I,placeholder:z,readOnly:O,renderSuffix:R,rows:D,size:j,slotProps:F={},slots:B={},startAdornment:N,type:U="text",value:V,...q}=n,H=null!=b.value?b.value:V,{current:G}=e.useRef(null!=H),W=e.useRef(),$=e.useCallback((e=>{0}),[]),Z=da(W,_,b.ref,$),[X,Y]=e.useState(!1),K=ju();const J=Ru({props:n,muiFormControl:K,states:["color","disabled","error","hiddenLabel","size","required","filled"]});J.focused=K?K.focused:X,e.useEffect((()=>{!K&&d&&X&&(Y(!1),M&&M())}),[K,d,X,M]);const Q=K&&K.onFilled,ee=K&&K.onEmpty,te=e.useCallback((e=>{Bu(e)?Q&&Q():ee&&ee()}),[Q,ee]);aa((()=>{G&&te({value:H})}),[H,te,G]);e.useEffect((()=>{te(W.current)}),[]);let re=x,ne=b;S&&"input"===re&&(ne=D?{type:void 0,minRows:D,maxRows:D,...ne}:{type:void 0,maxRows:k,minRows:T,...ne},re=Ou);e.useEffect((()=>{K&&K.setAdornedStart(Boolean(N))}),[K,N]);const ie={...n,color:J.color||"primary",disabled:J.disabled,endAdornment:m,error:J.error,focused:J.focused,formControl:K,fullWidth:y,hiddenLabel:J.hiddenLabel,multiline:S,size:J.size,startAdornment:N,type:U},ae=(e=>{const{classes:t,color:r,disabled:n,error:i,endAdornment:a,focused:o,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:h,size:p,startAdornment:d,type:f}=e;return Wn({root:["root",`color${Oi(r)}`,n&&"disabled",i&&"error",l&&"fullWidth",o&&"focused",s&&"formControl",p&&"medium"!==p&&`size${Oi(p)}`,u&&"multiline",d&&"adornedStart",a&&"adornedEnd",c&&"hiddenLabel",h&&"readOnly"],input:["input",n&&"disabled","search"===f&&"inputTypeSearch",u&&"inputMultiline","small"===p&&"inputSizeSmall",c&&"inputHiddenLabel",d&&"inputAdornedStart",a&&"inputAdornedEnd",h&&"readOnly"]},Nu,t)})(ie),oe=B.root||u.Root||Gu,se=F.root||h.root||{},le=B.input||u.Input||Wu;return ne={...ne,...F.input??h.input},(0,s.jsxs)(e.Fragment,{children:[!f&&"function"===typeof $u&&(Vu||(Vu=(0,s.jsx)($u,{}))),(0,s.jsxs)(oe,{...se,ref:r,onClick:e=>{W.current&&e.currentTarget===e.target&&W.current.focus(),C&&C(e)},...q,...!ru(oe)&&{ownerState:{...ie,...se.ownerState}},className:Gn(ae.root,se.className,l,O&&"MuiInputBase-readOnly"),children:[N,(0,s.jsx)(Du.Provider,{value:null,children:(0,s.jsx)(le,{"aria-invalid":J.error,"aria-describedby":i,autoComplete:a,autoFocus:o,defaultValue:p,disabled:J.disabled,id:v,onAnimationStart:e=>{te("mui-auto-fill-cancel"===e.animationName?W.current:{value:"x"})},name:A,placeholder:z,readOnly:O,required:J.required,rows:D,value:H,onKeyDown:L,onKeyUp:I,type:U,...ne,...!ru(le)&&{as:re,ownerState:{...ie,...ne.ownerState}},ref:Z,className:Gn(ae.input,ne.className,O&&"MuiInputBase-readOnly"),onBlur:e=>{M&&M(e),b.onBlur&&b.onBlur(e),K&&K.onBlur?K.onBlur(e):Y(!1)},onChange:function(e){if(!G){const t=e.target||W.current;if(null==t)throw new Error(Ze(1));te({value:t.value})}for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];b.onChange&&b.onChange(e,...r),E&&E(e,...r)},onFocus:e=>{P&&P(e),b.onFocus&&b.onFocus(e),K&&K.onFocus?K.onFocus(e):Y(!0)}})}),m,R?R({...J,startAdornment:N}):null]})]})}));function Xu(e){return Ai("MuiInput",e)}const Yu={...Uu,...Mi("MuiInput",["root","underline","input"])},Ku=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...qu(e,t),!r.disableUnderline&&t.underline]}})(wi((e=>{let{theme:t}=e;let r="light"===t.palette.mode?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return t.vars&&(r=`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`),{position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{"label + &":{marginTop:16}}},{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Yu.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Yu.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Yu.disabled}, .${Yu.error}):before`]:{borderBottom:`2px solid ${(t.vars||t).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Yu.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r].main}`}}}}))]}}))),Ju=gi(Wu,{name:"MuiInput",slot:"Input",overridesResolver:Hu})({}),Qu=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,inputComponent:l="input",multiline:c=!1,slotProps:u,slots:h={},type:p="text",...d}=r,f=(e=>{const{classes:t,disableUnderline:r}=e,n=Wn({root:["root",!r&&"underline"],input:["input"]},Xu,t);return{...t,...n}})(r),m={root:{ownerState:{disableUnderline:n}}},g=u??a?Qe(u??a,m):m,y=h.root??i.Root??Ku,v=h.input??i.Input??Ju;return(0,s.jsx)(Zu,{slots:{root:y,input:v},slotProps:g,fullWidth:o,inputComponent:l,multiline:c,ref:t,type:p,...d,classes:f})}));Qu.muiName="Input";const eh=Qu;function th(e){return Ai("MuiFilledInput",e)}const rh={...Uu,...Mi("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},nh=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...qu(e,t),!r.disableUnderline&&t.underline]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode,n=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",o=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),"&:hover":{backgroundColor:t.vars?t.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i}},[`&.${rh.focused}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.bg:i},[`&.${rh.disabled}`]:{backgroundColor:t.vars?t.vars.palette.FilledInput.disabledBg:o},variants:[{props:e=>{let{ownerState:t}=e;return!t.disableUnderline},style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${rh.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${rh.error}`]:{"&::before, &::after":{borderBottomColor:(t.vars||t).palette.error.main}},"&::before":{borderBottom:`1px solid ${t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / ${t.vars.opacity.inputUnderline})`:n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:t.transitions.create("border-bottom-color",{duration:t.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${rh.disabled}, .${rh.error}):before`]:{borderBottom:`1px solid ${(t.vars||t).palette.text.primary}`},[`&.${rh.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{disableUnderline:!1,color:r},style:{"&::after":{borderBottom:`2px solid ${(t.vars||t).palette[r]?.main}`}}}})),{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:12}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:12}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"25px 12px 8px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.multiline&&t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}}]}}))),ih=gi(Wu,{name:"MuiFilledInput",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;return{paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel},style:{paddingTop:16,paddingBottom:17}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}},{props:e=>{let{ownerState:t}=e;return t.hiddenLabel&&"small"===t.size},style:{paddingTop:8,paddingBottom:9}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}}))),ah=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFilledInput"}),{disableUnderline:n=!1,components:i={},componentsProps:a,fullWidth:o=!1,hiddenLabel:l,inputComponent:c="input",multiline:u=!1,slotProps:h,slots:p={},type:d="text",...f}=r,m={...r,disableUnderline:n,fullWidth:o,inputComponent:c,multiline:u,type:d},g=(e=>{const{classes:t,disableUnderline:r,startAdornment:n,endAdornment:i,size:a,hiddenLabel:o,multiline:s}=e,l=Wn({root:["root",!r&&"underline",n&&"adornedStart",i&&"adornedEnd","small"===a&&`size${Oi(a)}`,o&&"hiddenLabel",s&&"multiline"],input:["input"]},th,t);return{...t,...l}})(r),y={root:{ownerState:m},input:{ownerState:m}},v=h??a?Qe(y,h??a):y,x=p.root??i.Root??nh,b=p.input??i.Input??ih;return(0,s.jsx)(Zu,{slots:{root:x,input:b},slotProps:v,fullWidth:o,inputComponent:c,multiline:u,ref:t,type:d,...f,classes:g})}));ah.muiName="Input";const oh=ah;var sh;const lh=gi("fieldset",{shouldForwardProp:mi})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),ch=gi("legend",{shouldForwardProp:mi})(wi((e=>{let{theme:t}=e;return{float:"unset",width:"auto",overflow:"hidden",variants:[{props:e=>{let{ownerState:t}=e;return!t.withLabel},style:{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})}},{props:e=>{let{ownerState:t}=e;return t.withLabel},style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:e=>{let{ownerState:t}=e;return t.withLabel&&t.notched},style:{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})}}]}})));function uh(e){return Ai("MuiOutlinedInput",e)}const hh={...Uu,...Mi("MuiOutlinedInput",["root","notchedOutline","input"])},ph=gi(Gu,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiOutlinedInput",slot:"Root",overridesResolver:qu})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(t.vars||t).shape.borderRadius,[`&:hover .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.text.primary},"@media (hover: none)":{[`&:hover .${hh.notchedOutline}`]:{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}},[`&.${hh.focused} .${hh.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${hh.focused} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${hh.error} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.error.main},[`&.${hh.disabled} .${hh.notchedOutline}`]:{borderColor:(t.vars||t).palette.action.disabled}}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:14}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:14}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:"16.5px 14px"}},{props:e=>{let{ownerState:t,size:r}=e;return t.multiline&&"small"===r},style:{padding:"8.5px 14px"}}]}}))),dh=gi((function(e){const{children:t,classes:r,className:n,label:i,notched:a,...o}=e,l=null!=i&&""!==i,c={...e,notched:a,withLabel:l};return(0,s.jsx)(lh,{"aria-hidden":!0,className:n,ownerState:c,...o,children:(0,s.jsx)(ch,{ownerState:c,children:l?(0,s.jsx)("span",{children:i}):sh||(sh=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"}))})})}),{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:t.vars?`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.23)`:r}}))),fh=gi(Wu,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Hu})(wi((e=>{let{theme:t}=e;return{padding:"16.5px 14px",...!t.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:"light"===t.palette.mode?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:"light"===t.palette.mode?null:"#fff",caretColor:"light"===t.palette.mode?null:"#fff",borderRadius:"inherit"}},...t.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[t.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:e=>{let{ownerState:t}=e;return t.multiline},style:{padding:0}},{props:e=>{let{ownerState:t}=e;return t.startAdornment},style:{paddingLeft:0}},{props:e=>{let{ownerState:t}=e;return t.endAdornment},style:{paddingRight:0}}]}}))),mh=e.forwardRef((function(t,r){var n;const i=yi({props:t,name:"MuiOutlinedInput"}),{components:a={},fullWidth:o=!1,inputComponent:l="input",label:c,multiline:u=!1,notched:h,slots:p={},type:d="text",...f}=i,m=(e=>{const{classes:t}=e,r=Wn({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},uh,t);return{...t,...r}})(i),g=ju(),y=Ru({props:i,muiFormControl:g,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),v={...i,color:y.color||"primary",disabled:y.disabled,error:y.error,focused:y.focused,formControl:g,fullWidth:o,hiddenLabel:y.hiddenLabel,multiline:u,size:y.size,type:d},x=p.root??a.Root??ph,b=p.input??a.Input??fh;return(0,s.jsx)(Zu,{slots:{root:x,input:b},renderSuffix:t=>(0,s.jsx)(dh,{ownerState:v,className:m.notchedOutline,label:null!=c&&""!==c&&y.required?n||(n=(0,s.jsxs)(e.Fragment,{children:[c,"\u2009","*"]})):c,notched:"undefined"!==typeof h?h:Boolean(t.startAdornment||t.filled||t.focused)}),fullWidth:o,inputComponent:l,multiline:u,ref:r,type:d,...f,classes:{...m,notchedOutline:null}})}));mh.muiName="Input";const gh=mh;function yh(e){return Ai("MuiFormLabel",e)}const vh=Mi("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),xh=gi("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,"secondary"===r.color&&t.colorSecondary,r.filled&&t.filled]}})(wi((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${vh.focused}`]:{color:(t.vars||t).palette[r].main}}}})),{props:{},style:{[`&.${vh.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${vh.error}`]:{color:(t.vars||t).palette.error.main}}}]}}))),bh=gi("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(wi((e=>{let{theme:t}=e;return{[`&.${vh.error}`]:{color:(t.vars||t).palette.error.main}}}))),_h=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFormLabel"}),{children:n,className:i,color:a,component:o="label",disabled:l,error:c,filled:u,focused:h,required:p,...d}=r,f=Ru({props:r,muiFormControl:ju(),states:["color","required","focused","disabled","error","filled"]}),m={...r,color:f.color||"primary",component:o,disabled:f.disabled,error:f.error,filled:f.filled,focused:f.focused,required:f.required},g=(e=>{const{classes:t,color:r,focused:n,disabled:i,error:a,filled:o,required:s}=e;return Wn({root:["root",`color${Oi(r)}`,i&&"disabled",a&&"error",o&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",a&&"error"]},yh,t)})(m);return(0,s.jsxs)(xh,{as:o,ownerState:m,className:Gn(g.root,i),ref:t,...d,children:[n,f.required&&(0,s.jsxs)(bh,{ownerState:m,"aria-hidden":!0,className:g.asterisk,children:["\u2009","*"]})]})}));function wh(e){return Ai("MuiInputLabel",e)}Mi("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kh=gi(_h,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${vh.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,"small"===r.size&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,r.focused&&t.focused,t[r.variant]]}})(wi((e=>{let{theme:t}=e;return{display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:e=>{let{ownerState:t}=e;return t.formControl},style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:e=>{let{ownerState:t}=e;return t.shrink},style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:e=>{let{ownerState:t}=e;return!t.disableAnimation},style:{transition:t.transitions.create(["color","transform","max-width"],{duration:t.transitions.duration.shorter,easing:t.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"filled"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:e=>{let{variant:t,ownerState:r,size:n}=e;return"filled"===t&&r.shrink&&"small"===n},style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:e=>{let{variant:t,ownerState:r}=e;return"outlined"===t&&r.shrink},style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}}))),Th=e.forwardRef((function(e,t){const r=yi({name:"MuiInputLabel",props:e}),{disableAnimation:n=!1,margin:i,shrink:a,variant:o,className:l,...c}=r,u=ju();let h=a;"undefined"===typeof h&&u&&(h=u.filled||u.focused||u.adornedStart);const p=Ru({props:r,muiFormControl:u,states:["size","variant","required","focused"]}),d={...r,disableAnimation:n,formControl:u,shrink:h,size:p.size,variant:p.variant,required:p.required,focused:p.focused},f=(e=>{const{classes:t,formControl:r,size:n,shrink:i,disableAnimation:a,variant:o,required:s}=e,l=Wn({root:["root",r&&"formControl",!a&&"animated",i&&"shrink",n&&"medium"!==n&&`size${Oi(n)}`,o],asterisk:[s&&"asterisk"]},wh,t);return{...t,...l}})(d);return(0,s.jsx)(kh,{"data-shrink":h,ref:t,className:Gn(f.root,l),...c,ownerState:d,classes:f})}));const Sh=function(t,r){return e.isValidElement(t)&&-1!==r.indexOf(t.type.muiName??t.type?._payload?.value?.muiName)};function Ah(e){return Ai("MuiFormControl",e)}Mi("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Mh=gi("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`margin${Oi(r.margin)}`],r.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),Eh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiFormControl"}),{children:i,className:a,color:o="primary",component:l="div",disabled:c=!1,error:u=!1,focused:h,fullWidth:p=!1,hiddenLabel:d=!1,margin:f="none",required:m=!1,size:g="medium",variant:y="outlined",...v}=n,x={...n,color:o,component:l,disabled:c,error:u,fullWidth:p,hiddenLabel:d,margin:f,required:m,size:g,variant:y},b=(e=>{const{classes:t,margin:r,fullWidth:n}=e;return Wn({root:["root","none"!==r&&`margin${Oi(r)}`,n&&"fullWidth"]},Ah,t)})(x),[_,w]=e.useState((()=>{let t=!1;return i&&e.Children.forEach(i,(e=>{if(!Sh(e,["Input","Select"]))return;const r=Sh(e,["Select"])?e.props.input:e;r&&r.props.startAdornment&&(t=!0)})),t})),[k,T]=e.useState((()=>{let t=!1;return i&&e.Children.forEach(i,(e=>{Sh(e,["Input","Select"])&&(Bu(e.props,!0)||Bu(e.props.inputProps,!0))&&(t=!0)})),t})),[S,A]=e.useState(!1);c&&S&&A(!1);const M=void 0===h||c?S:h;let E;e.useRef(!1);const C=e.useCallback((()=>{T(!0)}),[]),P=e.useCallback((()=>{T(!1)}),[]),L=e.useMemo((()=>({adornedStart:_,setAdornedStart:w,color:o,disabled:c,error:u,filled:k,focused:M,fullWidth:p,hiddenLabel:d,size:g,onBlur:()=>{A(!1)},onFocus:()=>{A(!0)},onEmpty:P,onFilled:C,registerEffect:E,required:m,variant:y})),[_,o,c,u,k,M,p,d,E,P,C,m,g,y]);return(0,s.jsx)(Du.Provider,{value:L,children:(0,s.jsx)(Mh,{as:l,ownerState:x,className:Gn(b.root,a),ref:r,...v,children:i})})}));function Ch(e){return Ai("MuiFormHelperText",e)}const Ph=Mi("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Lh;const Ih=gi("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size&&t[`size${Oi(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(wi((e=>{let{theme:t}=e;return{color:(t.vars||t).palette.text.secondary,...t.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${Ph.disabled}`]:{color:(t.vars||t).palette.text.disabled},[`&.${Ph.error}`]:{color:(t.vars||t).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:e=>{let{ownerState:t}=e;return t.contained},style:{marginLeft:14,marginRight:14}}]}}))),zh=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiFormHelperText"}),{children:n,className:i,component:a="p",disabled:o,error:l,filled:c,focused:u,margin:h,required:p,variant:d,...f}=r,m=Ru({props:r,muiFormControl:ju(),states:["variant","size","disabled","error","filled","focused","required"]}),g={...r,component:a,contained:"filled"===m.variant||"outlined"===m.variant,variant:m.variant,size:m.size,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required};delete g.ownerState;const y=(e=>{const{classes:t,contained:r,size:n,disabled:i,error:a,filled:o,focused:s,required:l}=e;return Wn({root:["root",i&&"disabled",a&&"error",n&&`size${Oi(n)}`,r&&"contained",s&&"focused",o&&"filled",l&&"required"]},Ch,t)})(g);return(0,s.jsx)(Ih,{as:a,className:Gn(y.root,i),ref:t,...f,ownerState:g,children:" "===n?Lh||(Lh=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):n})}));const Oh=e.createContext({});function Rh(e){return Ai("MuiList",e)}Mi("MuiList",["root","padding","dense","subheader"]);const Dh=gi("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:e=>{let{ownerState:t}=e;return!t.disablePadding},style:{paddingTop:8,paddingBottom:8}},{props:e=>{let{ownerState:t}=e;return t.subheader},style:{paddingTop:0}}]}),jh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiList"}),{children:i,className:a,component:o="ul",dense:l=!1,disablePadding:c=!1,subheader:u,...h}=n,p=e.useMemo((()=>({dense:l})),[l]),d={...n,component:o,dense:l,disablePadding:c},f=(e=>{const{classes:t,disablePadding:r,dense:n,subheader:i}=e;return Wn({root:["root",!r&&"padding",n&&"dense",i&&"subheader"]},Rh,t)})(d);return(0,s.jsx)(Oh.Provider,{value:p,children:(0,s.jsxs)(Dh,{as:o,className:Gn(f.root,a),ref:r,ownerState:d,...h,children:[u,i]})})})),Fh=Al;function Bh(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function Nh(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function Uh(e,t){if(void 0===t)return!0;let r=e.innerText;return void 0===r&&(r=e.textContent),r=r.trim().toLowerCase(),0!==r.length&&(t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join("")))}function Vh(e,t,r,n,i,a){let o=!1,s=i(e,t,!!t&&r);for(;s;){if(s===e.firstChild){if(o)return!1;o=!0}const t=!n&&(s.disabled||"true"===s.getAttribute("aria-disabled"));if(s.hasAttribute("tabindex")&&Uh(s,a)&&!t)return s.focus(),!0;s=i(e,s,r)}return!1}const qh=e.forwardRef((function(t,r){const{actions:n,autoFocus:i=!1,autoFocusItem:a=!1,children:o,className:l,disabledItemsFocusable:c=!1,disableListWrap:u=!1,onKeyDown:h,variant:p="selectedMenu",...d}=t,f=e.useRef(null),m=e.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});aa((()=>{i&&f.current.focus()}),[i]),e.useImperativeHandle(n,(()=>({adjustStyleForScrollbar:(e,t)=>{let{direction:r}=t;const n=!f.current.style.width;if(e.clientHeight<f.current.clientHeight&&n){const t=`${Fh(la(e))}px`;f.current.style["rtl"===r?"paddingLeft":"paddingRight"]=t,f.current.style.width=`calc(100% + ${t})`}return f.current}})),[]);const g=da(f,r);let y=-1;e.Children.forEach(o,((t,r)=>{e.isValidElement(t)?(t.props.disabled||("selectedMenu"===p&&t.props.selected||-1===y)&&(y=r),y===r&&(t.props.disabled||t.props.muiSkipListHighlight||t.type.muiSkipListHighlight)&&(y+=1,y>=o.length&&(y=-1))):y===r&&(y+=1,y>=o.length&&(y=-1))}));const v=e.Children.map(o,((t,r)=>{if(r===y){const r={};return a&&(r.autoFocus=!0),void 0===t.props.tabIndex&&"selectedMenu"===p&&(r.tabIndex=0),e.cloneElement(t,r)}return t}));return(0,s.jsx)(jh,{role:"menu",ref:g,className:l,onKeyDown:e=>{const t=f.current,r=e.key;if(e.ctrlKey||e.metaKey||e.altKey)return void(h&&h(e));const n=Ka(t).activeElement;if("ArrowDown"===r)e.preventDefault(),Vh(t,n,u,c,Bh);else if("ArrowUp"===r)e.preventDefault(),Vh(t,n,u,c,Nh);else if("Home"===r)e.preventDefault(),Vh(t,null,u,c,Bh);else if("End"===r)e.preventDefault(),Vh(t,null,u,c,Nh);else if(1===r.length){const i=m.current,a=r.toLowerCase(),o=performance.now();i.keys.length>0&&(o-i.lastTime>500?(i.keys=[],i.repeating=!0,i.previousKeyMatched=!0):i.repeating&&a!==i.keys[0]&&(i.repeating=!1)),i.lastTime=o,i.keys.push(a);const s=n&&!i.repeating&&Uh(n,i);i.previousKeyMatched&&(s||Vh(t,n,!1,c,Bh,i))?e.preventDefault():i.previousKeyMatched=!1}h&&h(e)},tabIndex:i?0:-1,...d,children:v})}));function Hh(e){return Ai("MuiPopover",e)}Mi("MuiPopover",["root","paper"]);function Gh(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.height/2:"bottom"===t&&(r=e.height),r}function Wh(e,t){let r=0;return"number"===typeof t?r=t:"center"===t?r=e.width/2:"right"===t&&(r=e.width),r}function $h(e){return[e.horizontal,e.vertical].map((e=>"number"===typeof e?`${e}px`:e)).join(" ")}function Zh(e){return"function"===typeof e?e():e}const Xh=gi(Fl,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Yh=gi(Pi,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Kh=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiPopover"}),{action:i,anchorEl:a,anchorOrigin:o={vertical:"top",horizontal:"left"},anchorPosition:l,anchorReference:c="anchorEl",children:u,className:h,container:p,elevation:d=8,marginThreshold:f=16,open:m,PaperProps:g={},slots:y={},slotProps:v={},transformOrigin:x={vertical:"top",horizontal:"left"},TransitionComponent:b,transitionDuration:_="auto",TransitionProps:w={},disableScrollLock:k=!1,...T}=n,S=e.useRef(),A={...n,anchorOrigin:o,anchorReference:c,elevation:d,marginThreshold:f,transformOrigin:x,TransitionComponent:b,transitionDuration:_,TransitionProps:w},M=(e=>{const{classes:t}=e;return Wn({root:["root"],paper:["paper"]},Hh,t)})(A),E=e.useCallback((()=>{if("anchorPosition"===c)return l;const e=Zh(a),t=(e&&1===e.nodeType?e:Ka(S.current).body).getBoundingClientRect();return{top:t.top+Gh(t,o.vertical),left:t.left+Wh(t,o.horizontal)}}),[a,o.horizontal,o.vertical,l,c]),C=e.useCallback((e=>({vertical:Gh(e,x.vertical),horizontal:Wh(e,x.horizontal)})),[x.horizontal,x.vertical]),P=e.useCallback((e=>{const t={width:e.offsetWidth,height:e.offsetHeight},r=C(t);if("none"===c)return{top:null,left:null,transformOrigin:$h(r)};const n=E();let i=n.top-r.vertical,o=n.left-r.horizontal;const s=i+t.height,l=o+t.width,u=la(Zh(a)),h=u.innerHeight-f,p=u.innerWidth-f;if(null!==f&&i<f){const e=i-f;i-=e,r.vertical+=e}else if(null!==f&&s>h){const e=s-h;i-=e,r.vertical+=e}if(null!==f&&o<f){const e=o-f;o-=e,r.horizontal+=e}else if(l>p){const e=l-p;o-=e,r.horizontal+=e}return{top:`${Math.round(i)}px`,left:`${Math.round(o)}px`,transformOrigin:$h(r)}}),[a,c,E,C,f]),[L,I]=e.useState(m),z=e.useCallback((()=>{const e=S.current;if(!e)return;const t=P(e);null!==t.top&&e.style.setProperty("top",t.top),null!==t.left&&(e.style.left=t.left),e.style.transformOrigin=t.transformOrigin,I(!0)}),[P]);e.useEffect((()=>(k&&window.addEventListener("scroll",z),()=>window.removeEventListener("scroll",z))),[a,k,z]);e.useEffect((()=>{m&&z()})),e.useImperativeHandle(i,(()=>m?{updatePosition:()=>{z()}}:null),[m,z]),e.useEffect((()=>{if(!m)return;const e=na((()=>{z()})),t=la(Zh(a));return t.addEventListener("resize",e),()=>{e.clear(),t.removeEventListener("resize",e)}}),[a,m,z]);let O=_;const R={slots:{transition:b,...y},slotProps:{transition:w,paper:g,...v}},[D,j]=Yi("transition",{elementType:Po,externalForwardedProps:R,ownerState:A,getSlotProps:e=>({...e,onEntering:(t,r)=>{e.onEntering?.(t,r),z()},onExited:t=>{e.onExited?.(t),I(!1)}}),additionalProps:{appear:!0,in:m}});"auto"!==_||D.muiSupportAuto||(O=void 0);const F=p||(a?Ka(Zh(a)).body:void 0),[B,{slots:N,slotProps:U,...V}]=Yi("root",{ref:r,elementType:Xh,externalForwardedProps:{...R,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:y.backdrop},slotProps:{backdrop:Vl("function"===typeof v.backdrop?v.backdrop(A):v.backdrop,{invisible:!0})},container:F,open:m},ownerState:A,className:Gn(M.root,h)}),[q,H]=Yi("paper",{ref:S,className:M.paper,elementType:Yh,externalForwardedProps:R,shouldForwardComponentProp:!0,additionalProps:{elevation:d,style:L?void 0:{opacity:0}},ownerState:A});return(0,s.jsx)(B,{...V,...!ru(B)&&{slots:N,slotProps:U,disableScrollLock:k},children:(0,s.jsx)(D,{...j,timeout:O,children:(0,s.jsx)(q,{...H,children:u})})})}));function Jh(e){return Ai("MuiMenu",e)}Mi("MuiMenu",["root","paper","list"]);const Qh={vertical:"top",horizontal:"right"},ep={vertical:"top",horizontal:"left"},tp=gi(Kh,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),rp=gi(Yh,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),np=gi(qh,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),ip=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiMenu"}),{autoFocus:i=!0,children:a,className:o,disableAutoFocusItem:l=!1,MenuListProps:c={},onClose:u,open:h,PaperProps:p={},PopoverClasses:d,transitionDuration:f="auto",TransitionProps:{onEntering:m,...g}={},variant:y="selectedMenu",slots:v={},slotProps:x={},...b}=n,_=je(),w={...n,autoFocus:i,disableAutoFocusItem:l,MenuListProps:c,onEntering:m,PaperProps:p,transitionDuration:f,TransitionProps:g,variant:y},k=(e=>{const{classes:t}=e;return Wn({root:["root"],paper:["paper"],list:["list"]},Jh,t)})(w),T=i&&!l&&h,S=e.useRef(null);let A=-1;e.Children.map(a,((t,r)=>{e.isValidElement(t)&&(t.props.disabled||("selectedMenu"===y&&t.props.selected||-1===A)&&(A=r))}));const M={slots:v,slotProps:{list:c,transition:g,paper:p,...x}},E=ta({elementType:v.root,externalSlotProps:x.root,ownerState:w,className:[k.root,o]}),[C,P]=Yi("paper",{className:k.paper,elementType:rp,externalForwardedProps:M,shouldForwardComponentProp:!0,ownerState:w}),[L,I]=Yi("list",{className:Gn(k.list,c.className),elementType:np,shouldForwardComponentProp:!0,externalForwardedProps:M,getSlotProps:e=>({...e,onKeyDown:t=>{(e=>{"Tab"===e.key&&(e.preventDefault(),u&&u(e,"tabKeyDown"))})(t),e.onKeyDown?.(t)}}),ownerState:w}),z="function"===typeof M.slotProps.transition?M.slotProps.transition(w):M.slotProps.transition;return(0,s.jsx)(tp,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:_?"right":"left"},transformOrigin:_?Qh:ep,slots:{root:v.root,paper:C,backdrop:v.backdrop,...v.transition&&{transition:v.transition}},slotProps:{root:E,paper:P,backdrop:"function"===typeof x.backdrop?x.backdrop(w):x.backdrop,transition:{...z,onEntering:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];((e,t)=>{S.current&&S.current.adjustStyleForScrollbar(e,{direction:_?"rtl":"ltr"}),m&&m(e,t)})(...t),z?.onEntering?.(...t)}}},open:h,ref:r,transitionDuration:f,ownerState:w,...b,classes:d,children:(0,s.jsx)(L,{actions:S,autoFocus:i&&(-1===A||l),autoFocusItem:T,variant:y,...I,children:a})})}));function ap(e){return Ai("MuiNativeSelect",e)}const op=Mi("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),sp=gi("select")((e=>{let{theme:t}=e;return{MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${op.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},variants:[{props:e=>{let{ownerState:t}=e;return"filled"!==t.variant&&"outlined"!==t.variant},style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}}]}})),lp=gi(sp,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:mi,overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${op.multiple}`]:t.multiple}]}})({}),cp=gi("svg")((e=>{let{theme:t}=e;return{position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${op.disabled}`]:{color:(t.vars||t).palette.action.disabled},variants:[{props:e=>{let{ownerState:t}=e;return t.open},style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]}})),up=gi(cp,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${Oi(r.variant)}`],r.open&&t.iconOpen]}})({}),hp=e.forwardRef((function(t,r){const{className:n,disabled:i,error:a,IconComponent:o,inputRef:l,variant:c="standard",...u}=t,h={...t,disabled:i,variant:c,error:a},p=(e=>{const{classes:t,variant:r,disabled:n,multiple:i,open:a,error:o}=e;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"]},ap,t)})(h);return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(lp,{ownerState:h,className:Gn(p.select,n),disabled:i,ref:l||r,...u}),t.multiple?null:(0,s.jsx)(up,{as:o,ownerState:h,className:p.icon})]})}));function pp(e){return Ai("MuiSelect",e)}const dp=Mi("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var fp;const mp=gi(sp,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`&.${dp.select}`]:t.select},{[`&.${dp.select}`]:t[r.variant]},{[`&.${dp.error}`]:t.error},{[`&.${dp.multiple}`]:t.multiple}]}})({[`&.${dp.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),gp=gi(cp,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${Oi(r.variant)}`],r.open&&t.iconOpen]}})({}),yp=gi("input",{shouldForwardProp:e=>fi(e)&&"classes"!==e,name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function vp(e,t){return"object"===typeof t&&null!==t?e===t:String(e)===String(t)}function xp(e){return null==e||"string"===typeof e&&!e.trim()}const bp=e.forwardRef((function(t,r){const{"aria-describedby":n,"aria-label":i,autoFocus:a,autoWidth:o,children:l,className:c,defaultOpen:u,defaultValue:h,disabled:p,displayEmpty:d,error:f=!1,IconComponent:m,inputRef:g,labelId:y,MenuProps:v={},multiple:x,name:b,onBlur:_,onChange:w,onClose:k,onFocus:T,onOpen:S,open:A,readOnly:M,renderValue:E,required:C,SelectDisplayProps:P={},tabIndex:L,type:I,value:z,variant:O="standard",...R}=t,[D,j]=el({controlled:z,default:h,name:"Select"}),[F,B]=el({controlled:A,default:u,name:"Select"}),N=e.useRef(null),U=e.useRef(null),[V,q]=e.useState(null),{current:H}=e.useRef(null!=A),[G,W]=e.useState(),$=da(r,g),Z=e.useCallback((e=>{U.current=e,e&&q(e)}),[]),X=V?.parentNode;e.useImperativeHandle($,(()=>({focus:()=>{U.current.focus()},node:N.current,value:D})),[D]),e.useEffect((()=>{u&&F&&V&&!H&&(W(o?null:X.clientWidth),U.current.focus())}),[V,o]),e.useEffect((()=>{a&&U.current.focus()}),[a]),e.useEffect((()=>{if(!y)return;const e=Ka(U.current).getElementById(y);if(e){const t=()=>{getSelection().isCollapsed&&U.current.focus()};return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}}),[y]);const Y=(e,t)=>{e?S&&S(t):k&&k(t),H||(W(o?null:X.clientWidth),B(e))},K=e.Children.toArray(l),J=e=>t=>{let r;if(t.currentTarget.hasAttribute("tabindex")){if(x){r=Array.isArray(D)?D.slice():[];const t=D.indexOf(e.props.value);-1===t?r.push(e.props.value):r.splice(t,1)}else r=e.props.value;if(e.props.onClick&&e.props.onClick(t),D!==r&&(j(r),w)){const n=t.nativeEvent||t,i=new n.constructor(n.type,n);Object.defineProperty(i,"target",{writable:!0,value:{value:r,name:b}}),w(i,e)}x||Y(!1,t)}},Q=null!==V&&F;let ee,te;delete R["aria-invalid"];const re=[];let ne=!1,ie=!1;(Bu({value:D})||d)&&(E?ee=E(D):ne=!0);const ae=K.map((t=>{if(!e.isValidElement(t))return null;let r;if(x){if(!Array.isArray(D))throw new Error(Ze(2));r=D.some((e=>vp(e,t.props.value))),r&&ne&&re.push(t.props.children)}else r=vp(D,t.props.value),r&&ne&&(te=t.props.children);return r&&(ie=!0),e.cloneElement(t,{"aria-selected":r?"true":"false",onClick:J(t),onKeyUp:e=>{" "===e.key&&e.preventDefault(),t.props.onKeyUp&&t.props.onKeyUp(e)},role:"option",selected:r,value:void 0,"data-value":t.props.value})}));ne&&(ee=x?0===re.length?null:re.reduce(((e,t,r)=>(e.push(t),r<re.length-1&&e.push(", "),e)),[]):te);let oe,se=G;!o&&H&&V&&(se=X.clientWidth),oe="undefined"!==typeof L?L:p?null:0;const le=P.id||(b?`mui-component-select-${b}`:void 0),ce={...t,variant:O,value:D,open:Q,error:f},ue=(e=>{const{classes:t,variant:r,disabled:n,multiple:i,open:a,error:o}=e;return Wn({select:["select",r,n&&"disabled",i&&"multiple",o&&"error"],icon:["icon",`icon${Oi(r)}`,a&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]},pp,t)})(ce),he={...v.PaperProps,...v.slotProps?.paper},pe=Ks();return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(mp,{as:"div",ref:Z,tabIndex:oe,role:"combobox","aria-controls":Q?pe:void 0,"aria-disabled":p?"true":void 0,"aria-expanded":Q?"true":"false","aria-haspopup":"listbox","aria-label":i,"aria-labelledby":[y,le].filter(Boolean).join(" ")||void 0,"aria-describedby":n,"aria-required":C?"true":void 0,"aria-invalid":f?"true":void 0,onKeyDown:e=>{if(!M){[" ","ArrowUp","ArrowDown","Enter"].includes(e.key)&&(e.preventDefault(),Y(!0,e))}},onMouseDown:p||M?null:e=>{0===e.button&&(e.preventDefault(),U.current.focus(),Y(!0,e))},onBlur:e=>{!Q&&_&&(Object.defineProperty(e,"target",{writable:!0,value:{value:D,name:b}}),_(e))},onFocus:T,...P,ownerState:ce,className:Gn(P.className,ue.select,c),id:le,children:xp(ee)?fp||(fp=(0,s.jsx)("span",{className:"notranslate","aria-hidden":!0,children:"\u200b"})):ee}),(0,s.jsx)(yp,{"aria-invalid":f,value:Array.isArray(D)?D.join(","):D,name:b,ref:N,"aria-hidden":!0,onChange:e=>{const t=K.find((t=>t.props.value===e.target.value));void 0!==t&&(j(t.props.value),w&&w(e,t))},tabIndex:-1,disabled:p,className:ue.nativeInput,autoFocus:a,required:C,...R,ownerState:ce}),(0,s.jsx)(gp,{as:m,className:ue.icon,ownerState:ce}),(0,s.jsx)(ip,{id:`menu-${b||""}`,anchorEl:X,open:Q,onClose:e=>{Y(!1,e)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},...v,slotProps:{...v.slotProps,list:{"aria-labelledby":y,role:"listbox","aria-multiselectable":x?"true":void 0,disableListWrap:!0,id:pe,...v.MenuListProps},paper:{...he,style:{minWidth:se,...null!=he?he.style:null}}},children:ae})]})})),_p=Bi((0,s.jsx)("path",{d:"M7 10l5 5 5-5z"})),wp={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>mi(e)&&"variant"!==e,slot:"Root"},kp=gi(eh,wp)(""),Tp=gi(gh,wp)(""),Sp=gi(oh,wp)(""),Ap=e.forwardRef((function(t,r){const n=yi({name:"MuiSelect",props:t}),{autoWidth:i=!1,children:a,classes:o={},className:l,defaultOpen:c=!1,displayEmpty:u=!1,IconComponent:h=_p,id:p,input:d,inputProps:f,label:m,labelId:g,MenuProps:y,multiple:v=!1,native:x=!1,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:T,variant:S="outlined",...A}=n,M=x?hp:bp,E=Ru({props:n,muiFormControl:ju(),states:["variant","error"]}),C=E.variant||S,P={...n,variant:C,classes:o},L=(e=>{const{classes:t}=e,r=Wn({root:["root"]},pp,t);return{...t,...r}})(P),{root:I,...z}=L,O=d||{standard:(0,s.jsx)(kp,{ownerState:P}),outlined:(0,s.jsx)(Tp,{label:m,ownerState:P}),filled:(0,s.jsx)(Sp,{ownerState:P})}[C],R=da(r,po(O));return(0,s.jsx)(e.Fragment,{children:e.cloneElement(O,{inputComponent:M,inputProps:{children:a,error:E.error,IconComponent:h,variant:C,type:void 0,multiple:v,...x?{id:p}:{autoWidth:i,defaultOpen:c,displayEmpty:u,labelId:g,MenuProps:y,onClose:b,onOpen:_,open:w,renderValue:k,SelectDisplayProps:{id:p,...T}},...f,classes:f?Qe(z,f.classes):z,...d?d.props.inputProps:{}},...(v&&x||u)&&"outlined"===C?{notched:!0}:{},ref:R,className:Gn(O.props.className,l,L.root),...!d&&{variant:C},...A})})}));Ap.muiName="Select";const Mp=Ap;function Ep(e){return Ai("MuiTextField",e)}Mi("MuiTextField",["root"]);const Cp={standard:eh,filled:oh,outlined:gh},Pp=gi(Eh,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Lp=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTextField"}),{autoComplete:n,autoFocus:i=!1,children:a,className:o,color:l="primary",defaultValue:c,disabled:u=!1,error:h=!1,FormHelperTextProps:p,fullWidth:d=!1,helperText:f,id:m,InputLabelProps:g,inputProps:y,InputProps:v,inputRef:x,label:b,maxRows:_,minRows:w,multiline:k=!1,name:T,onBlur:S,onChange:A,onFocus:M,placeholder:E,required:C=!1,rows:P,select:L=!1,SelectProps:I,slots:z={},slotProps:O={},type:R,value:D,variant:j="outlined",...F}=r,B={...r,autoFocus:i,color:l,disabled:u,error:h,fullWidth:d,multiline:k,required:C,select:L,variant:j},N=(e=>{const{classes:t}=e;return Wn({root:["root"]},Ep,t)})(B);const U=Ks(m),V=f&&U?`${U}-helper-text`:void 0,q=b&&U?`${U}-label`:void 0,H=Cp[j],G={slots:z,slotProps:{input:v,inputLabel:g,htmlInput:y,formHelperText:p,select:I,...O}},W={},$=G.slotProps.inputLabel;"outlined"===j&&($&&"undefined"!==typeof $.shrink&&(W.notched=$.shrink),W.label=b),L&&(I&&I.native||(W.id=void 0),W["aria-describedby"]=void 0);const[Z,X]=Yi("root",{elementType:Pp,shouldForwardComponentProp:!0,externalForwardedProps:{...G,...F},ownerState:B,className:Gn(N.root,o),ref:t,additionalProps:{disabled:u,error:h,fullWidth:d,required:C,color:l,variant:j}}),[Y,K]=Yi("input",{elementType:H,externalForwardedProps:G,additionalProps:W,ownerState:B}),[J,Q]=Yi("inputLabel",{elementType:Th,externalForwardedProps:G,ownerState:B}),[ee,te]=Yi("htmlInput",{elementType:"input",externalForwardedProps:G,ownerState:B}),[re,ne]=Yi("formHelperText",{elementType:zh,externalForwardedProps:G,ownerState:B}),[ie,ae]=Yi("select",{elementType:Mp,externalForwardedProps:G,ownerState:B}),oe=(0,s.jsx)(Y,{"aria-describedby":V,autoComplete:n,autoFocus:i,defaultValue:c,fullWidth:d,multiline:k,name:T,rows:P,maxRows:_,minRows:w,type:R,value:D,id:U,inputRef:x,onBlur:S,onChange:A,onFocus:M,placeholder:E,inputProps:te,slots:{input:z.htmlInput?ee:void 0},...K});return(0,s.jsxs)(Z,{...X,children:[null!=b&&""!==b&&(0,s.jsx)(J,{htmlFor:U,id:q,...Q,children:b}),L?(0,s.jsx)(ie,{"aria-describedby":V,id:U,labelId:q,value:D,input:oe,...ae,children:a}):oe,f&&(0,s.jsx)(re,{id:V,...ne,children:f})]})}));function Ip(e){return Ai("MuiTypography",e)}Mi("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const zp={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Op=fc,Rp=gi("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],"inherit"!==r.align&&t[`align${Oi(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(wi((e=>{let{theme:t}=e;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter((e=>{let[t,r]=e;return"inherit"!==t&&r&&"object"===typeof r})).map((e=>{let[t,r]=e;return{props:{variant:t},style:r}})),...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{color:r},style:{color:(t.vars||t).palette[r].main}}})),...Object.entries(t.palette?.text||{}).filter((e=>{let[,t]=e;return"string"===typeof t})).map((e=>{let[r]=e;return{props:{color:`text${Oi(r)}`},style:{color:(t.vars||t).palette.text[r]}}})),{props:e=>{let{ownerState:t}=e;return"inherit"!==t.align},style:{textAlign:"var(--Typography-textAlign)"}},{props:e=>{let{ownerState:t}=e;return t.noWrap},style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:e=>{let{ownerState:t}=e;return t.gutterBottom},style:{marginBottom:"0.35em"}},{props:e=>{let{ownerState:t}=e;return t.paragraph},style:{marginBottom:16}}]}}))),Dp={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},jp=e.forwardRef((function(e,t){const{color:r,...n}=yi({props:e,name:"MuiTypography"}),i=Op({...n,...!zp[r]&&{color:r}}),{align:a="inherit",className:o,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:h=!1,variant:p="body1",variantMapping:d=Dp,...f}=i,m={...i,align:a,color:r,className:o,component:l,gutterBottom:c,noWrap:u,paragraph:h,variant:p,variantMapping:d},g=l||(h?"p":d[p]||Dp[p])||"span",y=(e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:i,variant:a,classes:o}=e;return Wn({root:["root",a,"inherit"!==e.align&&`align${Oi(t)}`,r&&"gutterBottom",n&&"noWrap",i&&"paragraph"]},Ip,o)})(m);return(0,s.jsx)(Rp,{as:g,ref:t,className:Gn(y.root,o),...f,ownerState:m,style:{..."inherit"!==a&&{"--Typography-textAlign":a},...f.style}})})),Fp=Bi((0,s.jsx)("path",{d:"M2.01 21 23 12 2.01 3 2 10l15 2-15 2z"}));var Bp=r(408),Np=r.n(Bp);function Up(e){return Ai("MuiCollapse",e)}Mi("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const Vp=gi("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],"entered"===r.state&&t.entered,"exited"===r.state&&!r.in&&"0px"===r.collapsedSize&&t.hidden]}})(wi((e=>{let{theme:t}=e;return{height:0,overflow:"hidden",transition:t.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:t.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:e=>{let{ownerState:t}=e;return"exited"===t.state&&!t.in&&"0px"===t.collapsedSize},style:{visibility:"hidden"}}]}}))),qp=gi("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(e,t)=>t.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Hp=gi("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(e,t)=>t.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Gp=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiCollapse"}),{addEndListener:i,children:a,className:o,collapsedSize:l="0px",component:c,easing:u,in:h,onEnter:p,onEntered:d,onEntering:f,onExit:m,onExited:g,onExiting:y,orientation:v="vertical",style:x,timeout:b=cn.standard,TransitionComponent:_=ko,...w}=n,k={...n,orientation:v,collapsedSize:l},T=(e=>{const{orientation:t,classes:r}=e;return Wn({root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]},Up,r)})(k),S=bi(),A=La(),M=e.useRef(null),E=e.useRef(),C="number"===typeof l?`${l}px`:l,P="horizontal"===v,L=P?"width":"height",I=e.useRef(null),z=da(r,I),O=e=>t=>{if(e){const r=I.current;void 0===t?e(r):e(r,t)}},R=()=>M.current?M.current[P?"clientWidth":"clientHeight"]:0,D=O(((e,t)=>{M.current&&P&&(M.current.style.position="absolute"),e.style[L]=C,p&&p(e,t)})),j=O(((e,t)=>{const r=R();M.current&&P&&(M.current.style.position="");const{duration:n,easing:i}=So({style:x,timeout:b,easing:u},{mode:"enter"});if("auto"===b){const t=S.transitions.getAutoHeightDuration(r);e.style.transitionDuration=`${t}ms`,E.current=t}else e.style.transitionDuration="string"===typeof n?n:`${n}ms`;e.style[L]=`${r}px`,e.style.transitionTimingFunction=i,f&&f(e,t)})),F=O(((e,t)=>{e.style[L]="auto",d&&d(e,t)})),B=O((e=>{e.style[L]=`${R()}px`,m&&m(e)})),N=O(g),U=O((e=>{const t=R(),{duration:r,easing:n}=So({style:x,timeout:b,easing:u},{mode:"exit"});if("auto"===b){const r=S.transitions.getAutoHeightDuration(t);e.style.transitionDuration=`${r}ms`,E.current=r}else e.style.transitionDuration="string"===typeof r?r:`${r}ms`;e.style[L]=C,e.style.transitionTimingFunction=n,y&&y(e)}));return(0,s.jsx)(_,{in:h,onEnter:D,onEntered:F,onEntering:j,onExit:B,onExited:N,onExiting:U,addEndListener:e=>{"auto"===b&&A.start(E.current||0,e),i&&i(I.current,e)},nodeRef:I,timeout:"auto"===b?null:b,...w,children:(e,t)=>{let{ownerState:r,...n}=t;return(0,s.jsx)(Vp,{as:c,className:Gn(T.root,o,{entered:T.entered,exited:!h&&"0px"===C&&T.hidden}[e]),style:{[P?"minWidth":"minHeight"]:C,...x},ref:z,ownerState:{...k,state:e},...n,children:(0,s.jsx)(qp,{ownerState:{...k,state:e},className:T.wrapper,ref:M,children:(0,s.jsx)(Hp,{ownerState:{...k,state:e},className:T.wrapperInner,children:a})})})}})}));Gp&&(Gp.muiSupportAuto=!0);const Wp=Gp;const $p=e.createContext({});function Zp(e){return Ai("MuiAccordion",e)}const Xp=Mi("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),Yp=gi(Pi,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Xp.region}`]:t.region},t.root,!r.square&&t.rounded,!r.disableGutters&&t.gutters]}})(wi((e=>{let{theme:t}=e;const r={duration:t.transitions.duration.shortest};return{position:"relative",transition:t.transitions.create(["margin"],r),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(t.vars||t).palette.divider,transition:t.transitions.create(["opacity","background-color"],r)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${Xp.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${Xp.disabled}`]:{backgroundColor:(t.vars||t).palette.action.disabledBackground}}})),wi((e=>{let{theme:t}=e;return{variants:[{props:e=>!e.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(t.vars||t).shape.borderRadius,borderTopRightRadius:(t.vars||t).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(t.vars||t).shape.borderRadius,borderBottomRightRadius:(t.vars||t).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:e=>!e.disableGutters,style:{[`&.${Xp.expanded}`]:{margin:"16px 0"}}}]}}))),Kp=gi("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(e,t)=>t.heading})({all:"unset"}),Jp=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAccordion"}),{children:i,className:a,defaultExpanded:o=!1,disabled:l=!1,disableGutters:c=!1,expanded:u,onChange:h,square:p=!1,slots:d={},slotProps:f={},TransitionComponent:m,TransitionProps:g,...y}=n,[v,x]=el({controlled:u,default:o,name:"Accordion",state:"expanded"}),b=e.useCallback((e=>{x(!v),h&&h(e,!v)}),[v,h,x]),[_,...w]=e.Children.toArray(i),k=e.useMemo((()=>({expanded:v,disabled:l,disableGutters:c,toggle:b})),[v,l,c,b]),T={...n,square:p,disabled:l,disableGutters:c,expanded:v},S=(e=>{const{classes:t,square:r,expanded:n,disabled:i,disableGutters:a}=e;return Wn({root:["root",!r&&"rounded",n&&"expanded",i&&"disabled",!a&&"gutters"],heading:["heading"],region:["region"]},Zp,t)})(T),A={slots:{transition:m,...d},slotProps:{transition:g,...f}},[M,E]=Yi("root",{elementType:Yp,externalForwardedProps:{...A,...y},className:Gn(S.root,a),shouldForwardComponentProp:!0,ownerState:T,ref:r,additionalProps:{square:p}}),[C,P]=Yi("heading",{elementType:Kp,externalForwardedProps:A,className:S.heading,ownerState:T}),[L,I]=Yi("transition",{elementType:Wp,externalForwardedProps:A,ownerState:T});return(0,s.jsxs)(M,{...E,children:[(0,s.jsx)(C,{...P,children:(0,s.jsx)($p.Provider,{value:k,children:_})}),(0,s.jsx)(L,{in:v,timeout:"auto",...I,children:(0,s.jsx)("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region",className:S.region,children:w})})]})}));function Qp(e){return Ai("MuiAccordionSummary",e)}const ed=Mi("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),td=gi(Ha,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;const r={duration:t.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:t.spacing(0,2),transition:t.transitions.create(["min-height","background-color"],r),[`&.${ed.focusVisible}`]:{backgroundColor:(t.vars||t).palette.action.focus},[`&.${ed.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity},[`&:hover:not(.${ed.disabled})`]:{cursor:"pointer"},variants:[{props:e=>!e.disableGutters,style:{[`&.${ed.expanded}`]:{minHeight:64}}}]}}))),rd=gi("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(e,t)=>t.content})(wi((e=>{let{theme:t}=e;return{display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:e=>!e.disableGutters,style:{transition:t.transitions.create(["margin"],{duration:t.transitions.duration.shortest}),[`&.${ed.expanded}`]:{margin:"20px 0"}}}]}}))),nd=gi("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(e,t)=>t.expandIconWrapper})(wi((e=>{let{theme:t}=e;return{display:"flex",color:(t.vars||t).palette.action.active,transform:"rotate(0deg)",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),[`&.${ed.expanded}`]:{transform:"rotate(180deg)"}}}))),id=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiAccordionSummary"}),{children:i,className:a,expandIcon:o,focusVisibleClassName:l,onClick:c,slots:u,slotProps:h,...p}=n,{disabled:d=!1,disableGutters:f,expanded:m,toggle:g}=e.useContext($p),y={...n,expanded:m,disabled:d,disableGutters:f},v=(e=>{const{classes:t,expanded:r,disabled:n,disableGutters:i}=e;return Wn({root:["root",r&&"expanded",n&&"disabled",!i&&"gutters"],focusVisible:["focusVisible"],content:["content",r&&"expanded",!i&&"contentGutters"],expandIconWrapper:["expandIconWrapper",r&&"expanded"]},Qp,t)})(y),x={slots:u,slotProps:h},[b,_]=Yi("root",{ref:r,shouldForwardComponentProp:!0,className:Gn(v.root,a),elementType:td,externalForwardedProps:{...x,...p},ownerState:y,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:d,"aria-expanded":m,focusVisibleClassName:Gn(v.focusVisible,l)},getSlotProps:e=>({...e,onClick:t=>{e.onClick?.(t),(e=>{g&&g(e),c&&c(e)})(t)}})}),[w,k]=Yi("content",{className:v.content,elementType:rd,externalForwardedProps:x,ownerState:y}),[T,S]=Yi("expandIconWrapper",{className:v.expandIconWrapper,elementType:nd,externalForwardedProps:x,ownerState:y});return(0,s.jsxs)(b,{..._,children:[(0,s.jsx)(w,{...k,children:i}),o&&(0,s.jsx)(T,{...S,children:o})]})}));function ad(e){return Ai("MuiAccordionDetails",e)}Mi("MuiAccordionDetails",["root"]);const od=gi("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;return{padding:t.spacing(1,2,2)}}))),sd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAccordionDetails"}),{className:n,...i}=r,a=r,o=(e=>{const{classes:t}=e;return Wn({root:["root"]},ad,t)})(a);return(0,s.jsx)(od,{className:Gn(o.root,n),ref:t,ownerState:a,...i})}));const ld=e.createContext();function cd(e){return Ai("MuiTable",e)}Mi("MuiTable",["root","stickyHeader"]);const ud=gi("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.stickyHeader&&t.stickyHeader]}})(wi((e=>{let{theme:t}=e;return{display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...t.typography.body2,padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:e=>{let{ownerState:t}=e;return t.stickyHeader},style:{borderCollapse:"separate"}}]}}))),hd="table",pd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTable"}),{className:i,component:a=hd,padding:o="normal",size:l="medium",stickyHeader:c=!1,...u}=n,h={...n,component:a,padding:o,size:l,stickyHeader:c},p=(e=>{const{classes:t,stickyHeader:r}=e;return Wn({root:["root",r&&"stickyHeader"]},cd,t)})(h),d=e.useMemo((()=>({padding:o,size:l,stickyHeader:c})),[o,l,c]);return(0,s.jsx)(ld.Provider,{value:d,children:(0,s.jsx)(ud,{as:a,role:a===hd?null:"table",ref:r,className:Gn(p.root,i),ownerState:h,...u})})}));const dd=e.createContext();function fd(e){return Ai("MuiTableBody",e)}Mi("MuiTableBody",["root"]);const md=gi("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),gd={variant:"body"},yd="tbody",vd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableBody"}),{className:n,component:i=yd,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},fd,t)})(o);return(0,s.jsx)(dd.Provider,{value:gd,children:(0,s.jsx)(md,{className:Gn(l.root,n),as:i,ref:t,role:i===yd?null:"rowgroup",ownerState:o,...a})})}));function xd(e){return Ai("MuiTableCell",e)}const bd=Mi("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),_d=gi("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`size${Oi(r.size)}`],"normal"!==r.padding&&t[`padding${Oi(r.padding)}`],"inherit"!==r.align&&t[`align${Oi(r.align)}`],r.stickyHeader&&t.stickyHeader]}})(wi((e=>{let{theme:t}=e;return{...t.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid\n ${"light"===t.palette.mode?Er(Tr(t.palette.divider,1),.88):Ar(Tr(t.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(t.vars||t).palette.text.primary}},{props:{variant:"footer"},style:{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${bd.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:e=>{let{ownerState:t}=e;return t.stickyHeader},style:{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default}}]}}))),wd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTableCell"}),{align:i="inherit",className:a,component:o,padding:l,scope:c,size:u,sortDirection:h,variant:p,...d}=n,f=e.useContext(ld),m=e.useContext(dd),g=m&&"head"===m.variant;let y;y=o||(g?"th":"td");let v=c;"td"===y?v=void 0:!v&&g&&(v="col");const x=p||m&&m.variant,b={...n,align:i,component:y,padding:l||(f&&f.padding?f.padding:"normal"),size:u||(f&&f.size?f.size:"medium"),sortDirection:h,stickyHeader:"head"===x&&f&&f.stickyHeader,variant:x},_=(e=>{const{classes:t,variant:r,align:n,padding:i,size:a,stickyHeader:o}=e;return Wn({root:["root",r,o&&"stickyHeader","inherit"!==n&&`align${Oi(n)}`,"normal"!==i&&`padding${Oi(i)}`,`size${Oi(a)}`]},xd,t)})(b);let w=null;return h&&(w="asc"===h?"ascending":"descending"),(0,s.jsx)(_d,{as:y,ref:r,className:Gn(_.root,a),"aria-sort":w,scope:v,ownerState:b,...d})}));function kd(e){return Ai("MuiTableContainer",e)}Mi("MuiTableContainer",["root"]);const Td=gi("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(e,t)=>t.root})({width:"100%",overflowX:"auto"}),Sd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableContainer"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},kd,t)})(o);return(0,s.jsx)(Td,{ref:t,as:i,className:Gn(l.root,n),ownerState:o,...a})}));function Ad(e){return Ai("MuiTableHead",e)}Mi("MuiTableHead",["root"]);const Md=gi("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),Ed={variant:"head"},Cd="thead",Pd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableHead"}),{className:n,component:i=Cd,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Ad,t)})(o);return(0,s.jsx)(dd.Provider,{value:Ed,children:(0,s.jsx)(Md,{as:i,className:Gn(l.root,n),ref:t,role:i===Cd?null:"rowgroup",ownerState:o,...a})})}));function Ld(e){return Ai("MuiTableRow",e)}const Id=Mi("MuiTableRow",["root","selected","hover","head","footer"]),zd=gi("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.head&&t.head,r.footer&&t.footer]}})(wi((e=>{let{theme:t}=e;return{color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Id.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Id.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:Tr(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:Tr(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}}}))),Od="tr",Rd=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiTableRow"}),{className:i,component:a=Od,hover:o=!1,selected:l=!1,...c}=n,u=e.useContext(dd),h={...n,component:a,hover:o,selected:l,head:u&&"head"===u.variant,footer:u&&"footer"===u.variant},p=(e=>{const{classes:t,selected:r,hover:n,head:i,footer:a}=e;return Wn({root:["root",r&&"selected",n&&"hover",i&&"head",a&&"footer"]},Ld,t)})(h);return(0,s.jsx)(zd,{as:a,ref:r,className:Gn(p.root,i),role:a===Od?null:"row",ownerState:h,...c})}));function Dd(e){return Ai("MuiCardContent",e)}Mi("MuiCardContent",["root"]);const jd=gi("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:16,"&:last-child":{paddingBottom:24}}),Fd=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCardContent"}),{className:n,component:i="div",...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},Dd,t)})(o);return(0,s.jsx)(jd,{as:i,className:Gn(l.root,n),ownerState:o,ref:t,...a})}));function Bd(e){return Ai("MuiCardActions",e)}Mi("MuiCardActions",["root","spacing"]);const Nd=gi("div",{name:"MuiCardActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,variants:[{props:{disableSpacing:!1},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Ud=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiCardActions"}),{disableSpacing:n=!1,className:i,...a}=r,o={...r,disableSpacing:n},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},Bd,t)})(o);return(0,s.jsx)(Nd,{className:Gn(l.root,i),ownerState:o,ref:t,...a})})),Vd=Bi((0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),qd=gi((e=>{const{expand:t,...r}=e;return(0,s.jsx)(dc,{...r})}))((e=>{let{theme:t}=e;return{marginLeft:"auto",transition:t.transitions.create("transform",{duration:t.transitions.duration.shortest}),variants:[{props:e=>{let{expand:t}=e;return!t},style:{transform:"rotate(0deg)"}},{props:e=>{let{expand:t}=e;return!!t},style:{transform:"rotate(180deg)"}}]}}));var Hd={},Gd=(0,e.createContext)(Hd),Wd=(e,t)=>$n({},e,t),$d=(0,e.createContext)((()=>{}));function Zd(){return(0,e.useContext)($d)}$d.displayName="JVR.DispatchShowTools";var Xd=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(Gd.Provider,{value:t,children:(0,s.jsx)($d.Provider,{value:r,children:n})})};Xd.displayName="JVR.ShowTools";var Yd={},Kd=(0,e.createContext)(Yd),Jd=(e,t)=>$n({},e,t),Qd=()=>(0,e.useContext)(Kd),ef=(0,e.createContext)((()=>{}));ef.displayName="JVR.DispatchExpands";var tf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(Kd.Provider,{value:t,children:(0,s.jsx)(ef.Provider,{value:r,children:n})})};tf.displayName="JVR.Expands";var rf={Str:{as:"span","data-type":"string",style:{color:"var(--w-rjv-type-string-color, #cb4b16)"},className:"w-rjv-type",children:"string"},Url:{as:"a",style:{color:"var(--w-rjv-type-url-color, #0969da)"},"data-type":"url",className:"w-rjv-type",children:"url"},Undefined:{style:{color:"var(--w-rjv-type-undefined-color, #586e75)"},as:"span","data-type":"undefined",className:"w-rjv-type",children:"undefined"},Null:{style:{color:"var(--w-rjv-type-null-color, #d33682)"},as:"span","data-type":"null",className:"w-rjv-type",children:"null"},Map:{style:{color:"var(--w-rjv-type-map-color, #268bd2)",marginRight:3},as:"span","data-type":"map",className:"w-rjv-type",children:"Map"},Nan:{style:{color:"var(--w-rjv-type-nan-color, #859900)"},as:"span","data-type":"nan",className:"w-rjv-type",children:"NaN"},Bigint:{style:{color:"var(--w-rjv-type-bigint-color, #268bd2)"},as:"span","data-type":"bigint",className:"w-rjv-type",children:"bigint"},Int:{style:{color:"var(--w-rjv-type-int-color, #268bd2)"},as:"span","data-type":"int",className:"w-rjv-type",children:"int"},Set:{style:{color:"var(--w-rjv-type-set-color, #268bd2)",marginRight:3},as:"span","data-type":"set",className:"w-rjv-type",children:"Set"},Float:{style:{color:"var(--w-rjv-type-float-color, #859900)"},as:"span","data-type":"float",className:"w-rjv-type",children:"float"},True:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},False:{style:{color:"var(--w-rjv-type-boolean-color, #2aa198)"},as:"span","data-type":"bool",className:"w-rjv-type",children:"bool"},Date:{style:{color:"var(--w-rjv-type-date-color, #268bd2)"},as:"span","data-type":"date",className:"w-rjv-type",children:"date"}},nf=(0,e.createContext)(rf),af=(e,t)=>$n({},e,t),of=()=>(0,e.useContext)(nf),sf=(0,e.createContext)((()=>{}));function lf(e){var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(nf.Provider,{value:t,children:(0,s.jsx)(sf.Provider,{value:r,children:n})})}sf.displayName="JVR.DispatchTypes",lf.displayName="JVR.Types";var cf=["style"];function uf(e){var{style:t}=e,r=xa(e,cf),n=$n({cursor:"pointer",height:"1em",width:"1em",userSelect:"none",display:"inline-flex"},t);return(0,s.jsx)("svg",$n({viewBox:"0 0 24 24",fill:"var(--w-rjv-arrow-color, currentColor)",style:n},r,{children:(0,s.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})}))}uf.displayName="JVR.TriangleArrow";var hf={Arrow:{as:"span",className:"w-rjv-arrow",style:{transform:"rotate(0deg)",transition:"all 0.3s"},children:(0,s.jsx)(uf,{})},Colon:{as:"span",style:{color:"var(--w-rjv-colon-color, var(--w-rjv-color))",marginLeft:0,marginRight:2},className:"w-rjv-colon",children:":"},Quote:{as:"span",style:{color:"var(--w-rjv-quotes-color, #236a7c)"},className:"w-rjv-quotes",children:'"'},ValueQuote:{as:"span",style:{color:"var(--w-rjv-quotes-string-color, #cb4b16)"},className:"w-rjv-quotes",children:'"'},BracketsLeft:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-start",children:"["},BracketsRight:{as:"span",style:{color:"var(--w-rjv-brackets-color, #236a7c)"},className:"w-rjv-brackets-end",children:"]"},BraceLeft:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-start",children:"{"},BraceRight:{as:"span",style:{color:"var(--w-rjv-curlybraces-color, #236a7c)"},className:"w-rjv-curlybraces-end",children:"}"}},pf=(0,e.createContext)(hf),df=(e,t)=>$n({},e,t),ff=()=>(0,e.useContext)(pf),mf=(0,e.createContext)((()=>{}));mf.displayName="JVR.DispatchSymbols";var gf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(pf.Provider,{value:t,children:(0,s.jsx)(mf.Provider,{value:r,children:n})})};gf.displayName="JVR.Symbols";var yf={Copied:{className:"w-rjv-copied",style:{height:"1em",width:"1em",cursor:"pointer",verticalAlign:"middle",marginLeft:5}},CountInfo:{as:"span",className:"w-rjv-object-size",style:{color:"var(--w-rjv-info-color, #0000004d)",paddingLeft:8,fontStyle:"italic"}},CountInfoExtra:{as:"span",className:"w-rjv-object-extra",style:{paddingLeft:8}},Ellipsis:{as:"span",style:{cursor:"pointer",color:"var(--w-rjv-ellipsis-color, #cb4b16)",userSelect:"none"},className:"w-rjv-ellipsis",children:"..."},Row:{as:"div",className:"w-rjv-line"},KeyName:{as:"span",className:"w-rjv-object-key"}},vf=(0,e.createContext)(yf),xf=(e,t)=>$n({},e,t),bf=()=>(0,e.useContext)(vf),_f=(0,e.createContext)((()=>{}));_f.displayName="JVR.DispatchSection";var wf=e=>{var{initial:t,dispatch:r,children:n}=e;return(0,s.jsx)(vf.Provider,{value:t,children:(0,s.jsx)(_f.Provider,{value:r,children:n})})};wf.displayName="JVR.Section";var kf={objectSortKeys:!1,indentWidth:15},Tf=(0,e.createContext)(kf);Tf.displayName="JVR.Context";var Sf=(0,e.createContext)((()=>{}));function Af(e,t){return $n({},e,t)}Sf.displayName="JVR.DispatchContext";var Mf=()=>(0,e.useContext)(Tf),Ef=t=>{var{children:r,initialState:n,initialTypes:i}=t,[a,o]=(0,e.useReducer)(Af,Object.assign({},kf,n)),[l,c]=(0,e.useReducer)(Wd,Hd),[u,h]=(0,e.useReducer)(Jd,Yd),[p,d]=(0,e.useReducer)(af,rf),[f,m]=(0,e.useReducer)(df,hf),[g,y]=(0,e.useReducer)(xf,yf);return(0,e.useEffect)((()=>o($n({},n))),[n]),(0,s.jsx)(Tf.Provider,{value:a,children:(0,s.jsx)(Sf.Provider,{value:o,children:(0,s.jsx)(Xd,{initial:l,dispatch:c,children:(0,s.jsx)(tf,{initial:u,dispatch:h,children:(0,s.jsx)(lf,{initial:$n({},p,i),dispatch:d,children:(0,s.jsx)(gf,{initial:f,dispatch:m,children:(0,s.jsx)(wf,{initial:g,dispatch:y,children:r})})})})})})})};Ef.displayName="JVR.Provider";var Cf=["isNumber","value","parentValue","keyName","keys"],Pf=["as","render"],Lf=["as","render"],If=["as","render"],zf=["as","style","render"],Of=["as","render"],Rf=["as","render"],Df=["as","render"],jf=["as","render"],Ff=e=>{var{Quote:t={}}=ff(),{isNumber:r,value:n,parentValue:i,keyName:a,keys:o}=e,l=xa(e,Cf);if(r)return null;var{as:c,render:u}=t,h=c||"span",p=$n({},l,xa(t,Pf)),d=u&&"function"===typeof u&&u(p,{value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])});return d||(0,s.jsx)(h,$n({},p))};Ff.displayName="JVR.Quote";var Bf=e=>{var{ValueQuote:t={}}=ff(),r=$n({},(function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e),e)),{as:n,render:i}=t,a=n||"span",o=$n({},r,xa(t,Lf)),l=i&&"function"===typeof i&&i(o,{});return l||(0,s.jsx)(a,$n({},o))};Bf.displayName="JVR.ValueQuote";var Nf=e=>{var{value:t,parentValue:r,keyName:n,keys:i}=e,{Colon:a={}}=ff(),{as:o,render:l}=a,c=xa(a,If),u=o||"span",h=l&&"function"===typeof l&&l(c,{value:t,parentValue:r,keyName:n,keys:i||(n?[n]:[])});return h||(0,s.jsx)(u,$n({},c))};Nf.displayName="JVR.Colon";var Uf=e=>{var{Arrow:t={}}=ff(),r=Qd(),{expandKey:n,style:i,value:a,parentValue:o,keyName:l,keys:c}=e,u=!!r[n],{as:h,style:p,render:d}=t,f=xa(t,zf),m=h||"span",g=d&&"function"===typeof d,y=$n({},f,{"data-expanded":u,style:$n({},p,i)}),v=g&&d(y,{value:a,parentValue:o,keyName:l,keys:c||(l?[l]:[])});return v||(0,s.jsx)(m,$n({},f,{style:$n({},p,i)}))};Uf.displayName="JVR.Arrow";var Vf=e=>{var{isBrackets:t,value:r,parentValue:n,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:l={}}=ff(),c={value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:u,render:h}=o,p=xa(o,Of),d=u||"span",f=h&&"function"===typeof h&&h(p,c);return f||(0,s.jsx)(d,$n({},p))}var{as:m,render:g}=l,y=xa(l,Rf),v=m||"span",x=g&&"function"===typeof g&&g(y,c);return x||(0,s.jsx)(v,$n({},y))};Vf.displayName="JVR.BracketsOpen";var qf=e=>{var{isBrackets:t,isVisiable:r,value:n,parentValue:i,keyName:a,keys:o}=e,l={value:n,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!r)return null;var{BracketsRight:c={},BraceRight:u={}}=ff();if(t){var{as:h,render:p}=c,d=xa(c,Df),f=h||"span",m=p&&"function"===typeof p&&p(d,l);return m||(0,s.jsx)(f,$n({},d))}var{as:g,render:y}=u,v=xa(u,jf),x=g||"span",b=y&&"function"===typeof y&&y(v,l);return b||(0,s.jsx)(x,$n({},v))};qf.displayName="JVR.BracketsClose";var Hf=e=>{var t,{value:r,expandKey:n,level:i,keys:a=[]}=e,o=Qd(),l=Array.isArray(r),{collapsed:c,shouldExpandNodeInitially:u}=Mf(),h=r instanceof Set,p="boolean"===typeof c?c:"number"===typeof c&&i>c,d=null!=(t=o[n])?t:p,f=Object.keys(r).length;if(void 0===o[n]&&u&&u(d,{value:r,keys:a,level:i}))return null;if(d||0===f)return null;return(0,s.jsx)("div",{style:{paddingLeft:4},children:(0,s.jsx)(qf,{isBrackets:l||h,isVisiable:!0})})};Hf.displayName="JVR.NestedClose";var Gf=["as","render"],Wf=["as","render"],$f=["as","render"],Zf=["as","render"],Xf=["as","render"],Yf=["as","render"],Kf=["as","render"],Jf=["as","render"],Qf=["as","render"],em=["as","render"],tm=["as","render"],rm=["as","render"],nm=["as","render"],im=e=>{if(void 0===e)return"0n";if("string"===typeof e)try{e=BigInt(e)}catch(hy){return"0n"}return e?e.toString()+"n":"0n"},am=e=>{var{value:t,keyName:r}=e,{Set:n={},displayDataTypes:i}=of();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=n,l=xa(n,Gf),c=o&&"function"===typeof o&&o(l,{type:"type",value:t,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,$n({},l))};am.displayName="JVR.SetComp";var om=e=>{var{value:t,keyName:r}=e,{Map:n={},displayDataTypes:i}=of();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=n,l=xa(n,Wf),c=o&&"function"===typeof o&&o(l,{type:"type",value:t,keyName:r});if(c)return c;var u=a||"span";return(0,s.jsx)(u,$n({},l))};om.displayName="JVR.MapComp";var sm={opacity:.75,paddingRight:4},lm=t=>{var{children:r="",keyName:n}=t,{Str:i={},displayDataTypes:a}=of(),{shortenTextAfterLength:o=30,stringEllipsis:l="..."}=Mf(),{as:c,render:u}=i,h=xa(i,$f),p=r,[d,f]=(0,e.useState)(o&&p.length>o);(0,e.useEffect)((()=>f(o&&p.length>o)),[o]);var m=c||"span",g=$n({},sm,i.style||{});o>0&&(h.style=$n({},h.style,{cursor:p.length<=o?"initial":"pointer"}),p.length>o&&(h.onClick=()=>{f(!d)}));var y=d?""+p.slice(0,o)+l:p,v=u&&"function"===typeof u,x=v&&u($n({},h,{style:g}),{type:"type",value:r,keyName:n}),b=d?"w-rjv-value w-rjv-value-short":"w-rjv-value",_=v&&u($n({},h,{children:y,className:b}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(x||(0,s.jsx)(m,$n({},h,{style:g}))),_||(0,s.jsxs)(e.Fragment,{children:[(0,s.jsx)(Bf,{}),(0,s.jsx)(m,$n({},h,{className:b,children:y})),(0,s.jsx)(Bf,{})]})]})};lm.displayName="JVR.TypeString";var cm=t=>{var{children:r,keyName:n}=t,{True:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Zf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};cm.displayName="JVR.TypeTrue";var um=t=>{var{children:r,keyName:n}=t,{False:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Xf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};um.displayName="JVR.TypeFalse";var hm=t=>{var{children:r,keyName:n}=t,{Float:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Yf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};hm.displayName="JVR.TypeFloat";var pm=t=>{var{children:r,keyName:n}=t,{Int:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Kf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:null==r?void 0:r.toString()}))]})};pm.displayName="JVR.TypeInt";var dm=t=>{var{children:r,keyName:n}=t,{Bigint:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Jf),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:im(null==r?void 0:r.toString())}))]})};dm.displayName="JVR.TypeFloat";var fm=t=>{var{children:r,keyName:n}=t,{Url:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,Qf),u=o||"span",h=$n({},sm,i.style),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:null==r?void 0:r.href,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f||(0,s.jsxs)("a",$n({href:null==r?void 0:r.href,target:"_blank"},c,{className:"w-rjv-value",children:[(0,s.jsx)(Bf,{}),null==r?void 0:r.href,(0,s.jsx)(Bf,{})]}))]})};fm.displayName="JVR.TypeUrl";var mm=t=>{var{children:r,keyName:n}=t,{Date:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,em),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=r instanceof Date?r.toLocaleString():r,m=p&&l($n({},c,{children:f,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),m||(0,s.jsx)(u,$n({},c,{className:"w-rjv-value",children:f}))]})};mm.displayName="JVR.TypeDate";var gm=t=>{var{children:r,keyName:n}=t,{Undefined:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,tm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};gm.displayName="JVR.TypeUndefined";var ym=t=>{var{children:r,keyName:n}=t,{Null:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,rm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:r,className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};ym.displayName="JVR.TypeNull";var vm=t=>{var{children:r,keyName:n}=t,{Nan:i={},displayDataTypes:a}=of(),{as:o,render:l}=i,c=xa(i,nm),u=o||"span",h=$n({},sm,i.style||{}),p=l&&"function"===typeof l,d=p&&l($n({},c,{style:h}),{type:"type",value:r,keyName:n}),f=p&&l($n({},c,{children:null==r?void 0:r.toString(),className:"w-rjv-value"}),{type:"value",value:r,keyName:n});return(0,s.jsxs)(e.Fragment,{children:[a&&(d||(0,s.jsx)(u,$n({},c,{style:h}))),f]})};vm.displayName="JVR.TypeNan";var xm=e=>{var t,{value:r,keyName:n}=e,i={keyName:n};return r instanceof URL?(0,s.jsx)(fm,$n({},i,{children:r})):"string"===typeof r?(0,s.jsx)(lm,$n({},i,{children:r})):!0===r?(0,s.jsx)(cm,$n({},i,{children:r})):!1===r?(0,s.jsx)(um,$n({},i,{children:r})):null===r?(0,s.jsx)(ym,$n({},i,{children:r})):void 0===r?(0,s.jsx)(gm,$n({},i,{children:r})):r instanceof Date?(0,s.jsx)(mm,$n({},i,{children:r})):"number"===typeof r&&isNaN(r)?(0,s.jsx)(vm,$n({},i,{children:r})):"number"===typeof r&&(t=r,Number(t)===t&&t%1!==0||isNaN(t))?(0,s.jsx)(hm,$n({},i,{children:r})):"bigint"===typeof r?(0,s.jsx)(dm,$n({},i,{children:r})):"number"===typeof r?(0,s.jsx)(pm,$n({},i,{children:r})):null};function bm(t,r,n){var i=(0,e.useContext)(mf),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}function _m(t,r,n){var i=(0,e.useContext)(sf),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}function wm(t,r,n){var i=(0,e.useContext)(_f),a=[t.className,r.className].filter(Boolean).join(" "),o=$n({},t,r,{className:a,style:$n({},t.style,r.style),children:r.children||t.children});(0,e.useEffect)((()=>i({[n]:o})),[r])}xm.displayName="JVR.Value";var km=["as","render"],Tm=e=>{var{KeyName:t={}}=bf();return wm(t,e,"KeyName"),null};Tm.displayName="JVR.KeyName";var Sm=e=>{var{children:t,value:r,parentValue:n,keyName:i,keys:a}=e,o={color:"number"===typeof t?"var(--w-rjv-key-number, #268bd2)":"var(--w-rjv-key-string, #002b36)"},{KeyName:l={}}=bf(),{as:c,render:u}=l,h=xa(l,km);h.style=$n({},h.style,o);var p=c||"span",d=u&&"function"===typeof u&&u($n({},h,{children:t}),{value:r,parentValue:n,keyName:i,keys:a||(i?[i]:[])});return d||(0,s.jsx)(p,$n({},h,{children:t}))};Sm.displayName="JVR.KeyNameComp";var Am=["children","value","parentValue","keyName","keys"],Mm=["as","render","children"],Em=e=>{var{Row:t={}}=bf();return wm(t,e,"Row"),null};Em.displayName="JVR.Row";var Cm=e=>{var{children:t,value:r,parentValue:n,keyName:i,keys:a}=e,o=xa(e,Am),{Row:l={}}=bf(),{as:c,render:u}=l,h=xa(l,Mm),p=c||"div",d=u&&"function"===typeof u&&u($n({},o,h,{children:t}),{value:r,keyName:i,parentValue:n,keys:a});return d||(0,s.jsx)(p,$n({},o,h,{children:t}))};function Pm(t){var{value:r,highlightUpdates:n,highlightContainer:i}=t,a=function(t){var r=(0,e.useRef)();return(0,e.useEffect)((()=>{r.current=t})),r.current}(r),o=(0,e.useMemo)((()=>!(!n||void 0===a)&&(typeof r!==typeof a||("number"===typeof r?(!isNaN(r)||!isNaN(a))&&r!==a:Array.isArray(r)!==Array.isArray(a)||"object"!==typeof r&&"function"!==typeof r&&(r!==a||void 0)))),[n,r]);(0,e.useEffect)((()=>{i&&i.current&&o&&"animate"in i.current&&i.current.animate([{backgroundColor:"var(--w-rjv-update-color, #ebcb8b)"},{backgroundColor:""}],{duration:1e3,easing:"ease-in"})}),[o,r,i])}Cm.displayName="JVR.RowComp";var Lm=["keyName","value","parentValue","expandKey","keys"],Im=["as","render"],zm=t=>{var{keyName:r,value:n,parentValue:i,expandKey:a,keys:o}=t,l=xa(t,Lm),{onCopied:c,enableClipboard:u}=Mf(),h=(0,e.useContext)(Gd)[a],[p,d]=(0,e.useState)(!1),{Copied:f={}}=bf();if(!1===u||!h)return null;var m={style:{display:"inline-flex"},fill:p?"var(--w-rjv-copied-success-color, #28a745)":"var(--w-rjv-copied-color, currentColor)",onClick:e=>{e.stopPropagation();var t="";t="number"===typeof n&&n===1/0?"Infinity":"number"===typeof n&&isNaN(n)?"NaN":"bigint"===typeof n?im(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,((e,t)=>"bigint"===typeof t?im(t):t),2),c&&c(t,n),d(!0),(navigator.clipboard||{writeText:e=>new Promise(((t,r)=>{var n=document.createElement("textarea");n.style.position="absolute",n.style.opacity="0",n.style.left="-99999999px",n.value=e,document.body.appendChild(n),n.select(),document.execCommand("copy")?t():r(),n.remove()}))}).writeText(t).then((()=>{var e=setTimeout((()=>{d(!1),clearTimeout(e)}),3e3)})).catch((e=>{}))}},{render:g}=f,y=xa(f,Im),v=$n({},y,l,m,{style:$n({},y.style,l.style,m.style)}),x=g&&"function"===typeof g&&g($n({},v,{"data-copied":p}),{value:n,keyName:r,keys:o,parentValue:i});return x||(p?(0,s.jsx)("svg",$n({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})):(0,s.jsx)("svg",$n({viewBox:"0 0 32 36"},v,{children:(0,s.jsx)("path",{d:"M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z"})})))};function Om(){var t=(0,e.useRef)(null);return null===t.current&&(t.current="custom-id-"+Math.random().toString(36).substr(2,9)),t.current}zm.displayName="JVR.Copied";var Rm=e=>{var t,{value:r,expandKey:n="",level:i,keys:a=[]}=e,o=Qd(),{objectSortKeys:l,indentWidth:c,collapsed:u,shouldExpandNodeInitially:h}=Mf(),p=Array.isArray(r),d="boolean"===typeof u?u:"number"===typeof u&&i>u,f=null!=(t=o[n])?t:d;if(void 0===o[n]&&h&&h(f,{value:r,keys:a,level:i}))return null;if(f)return null;var m=p?Object.entries(r).map((e=>[Number(e[0]),e[1]])):Object.entries(r);l&&(m=!0===l?m.sort(((e,t)=>{var[r]=e,[n]=t;return"string"===typeof r&&"string"===typeof n?r.localeCompare(n):0})):m.sort(((e,t)=>{var[r,n]=e,[i,a]=t;return"string"===typeof r&&"string"===typeof i?l(r,i,n,a):0})));var g={borderLeft:"var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",paddingLeft:c,marginLeft:6};return(0,s.jsx)("div",{className:"w-rjv-wrap",style:g,children:m.map(((e,t)=>{var[n,o]=e;return(0,s.jsx)(jm,{parentValue:r,keyName:n,keys:[...a,n],value:o,level:i},t)}))})};Rm.displayName="JVR.KeyValues";var Dm=t=>{var{keyName:r,parentValue:n,keys:i,value:a}=t,{highlightUpdates:o}=Mf(),l="number"===typeof r,c=(0,e.useRef)(null);Pm({value:a,highlightUpdates:o,highlightContainer:c});var u={keyName:r,value:a,keys:i,parentValue:n};return(0,s.jsxs)(e.Fragment,{children:[(0,s.jsxs)("span",{ref:c,children:[(0,s.jsx)(Ff,$n({isNumber:l,"data-placement":"left"},u)),(0,s.jsx)(Sm,$n({},u,{children:r})),(0,s.jsx)(Ff,$n({isNumber:l,"data-placement":"right"},u))]}),(0,s.jsx)(Nf,$n({},u))]})};Dm.displayName="JVR.KayName";var jm=e=>{var{keyName:t,value:r,parentValue:n,level:i=0,keys:a=[]}=e,o=Zd(),l=Om(),c=Array.isArray(r),u=r instanceof Set,h=r instanceof Map,p=r instanceof Date,d=r instanceof URL;if(r&&"object"===typeof r&&!c&&!u&&!h&&!p&&!d||c||u||h){var f=u?Array.from(r):h?Object.fromEntries(r):r;return(0,s.jsx)(Km,{keyName:t,value:f,parentValue:n,initialValue:r,keys:a,level:i+1})}var m={onMouseEnter:()=>o({[l]:!0}),onMouseLeave:()=>o({[l]:!1})};return(0,s.jsxs)(Cm,$n({className:"w-rjv-line",value:r,keyName:t,keys:a,parentValue:n},m,{children:[(0,s.jsx)(Dm,{keyName:t,value:r,keys:a,parentValue:n}),(0,s.jsx)(xm,{keyName:t,value:r}),(0,s.jsx)(zm,{keyName:t,value:r,keys:a,parentValue:n,expandKey:l})]}))};jm.displayName="JVR.KeyValuesItem";var Fm=["value","keyName"],Bm=["as","render"],Nm=e=>{var{CountInfoExtra:t={}}=bf();return wm(t,e,"CountInfoExtra"),null};Nm.displayName="JVR.CountInfoExtra";var Um=e=>{var{value:t={},keyName:r}=e,n=xa(e,Fm),{CountInfoExtra:i={}}=bf(),{as:a,render:o}=i,l=xa(i,Bm);if(!o&&!l.children)return null;var c=a||"span",u=o&&"function"===typeof o,h=$n({},l,n),p=u&&o(h,{value:t,keyName:r});return p||(0,s.jsx)(c,$n({},h))};Um.displayName="JVR.CountInfoExtraComps";var Vm=["value","keyName"],qm=["as","render"],Hm=e=>{var{CountInfo:t={}}=bf();return wm(t,e,"CountInfo"),null};Hm.displayName="JVR.CountInfo";var Gm=e=>{var{value:t={},keyName:r}=e,n=xa(e,Vm),{displayObjectSize:i}=Mf(),{CountInfo:a={}}=bf();if(!i)return null;var{as:o,render:l}=a,c=xa(a,qm),u=o||"span";c.style=$n({},c.style,e.style);var h=Object.keys(t).length;c.children||(c.children=h+" item"+(1===h?"":"s"));var p=$n({},c,n),d=l&&"function"===typeof l&&l($n({},p,{"data-length":h}),{value:t,keyName:r});return d||(0,s.jsx)(u,$n({},p))};Gm.displayName="JVR.CountInfoComp";var Wm=["as","render"],$m=e=>{var{Ellipsis:t={}}=bf();return wm(t,e,"Ellipsis"),null};$m.displayName="JVR.Ellipsis";var Zm=e=>{var{isExpanded:t,value:r,keyName:n}=e,{Ellipsis:i={}}=bf(),{as:a,render:o}=i,l=xa(i,Wm),c=a||"span",u=o&&"function"===typeof o&&o($n({},l,{"data-expanded":t}),{value:r,keyName:n});return u||(!t||"object"===typeof r&&0==Object.keys(r).length?null:(0,s.jsx)(c,$n({},l)))};Zm.displayName="JVR.EllipsisComp";var Xm=t=>{var r,{keyName:n,expandKey:i,keys:a=[],initialValue:o,value:l,parentValue:c,level:u}=t,h=Qd(),p=(0,e.useContext)(ef),{onExpand:d,collapsed:f,shouldExpandNodeInitially:m}=Mf(),g=Array.isArray(l),y=l instanceof Set,v="boolean"===typeof f?f:"number"===typeof f&&u>f,x="object"===typeof l,b=null!=(r=h[i])?r:v,_=m&&m(b,{value:l,keys:a,level:u});void 0===h[i]&&void 0!==_&&(b=_);var w={transform:"rotate("+(b?"-90":"0")+"deg)",transition:"all 0.3s"},k=0!==Object.keys(l).length&&(g||y||x),T={style:{display:"inline-flex",alignItems:"center"}};k&&(T.onClick=()=>{var e={expand:!b,value:l,keyid:i,keyName:n};d&&d(e),p({[i]:e.expand})});var S={keyName:n,value:l,keys:a,parentValue:c};return(0,s.jsxs)("span",$n({},T,{children:[k&&(0,s.jsx)(Uf,$n({style:w,expandKey:i},S)),(n||"number"===typeof n)&&(0,s.jsx)(Dm,$n({},S)),(0,s.jsx)(am,{value:o,keyName:n}),(0,s.jsx)(om,{value:o,keyName:n}),(0,s.jsx)(Vf,$n({isBrackets:g||y},S)),(0,s.jsx)(Zm,{keyName:n,value:l,isExpanded:b}),(0,s.jsx)(qf,$n({isVisiable:b||!k,isBrackets:g||y},S)),(0,s.jsx)(Gm,{value:l,keyName:n}),(0,s.jsx)(Um,{value:l,keyName:n}),(0,s.jsx)(zm,{keyName:n,value:l,expandKey:i,parentValue:c,keys:a})]}))};Xm.displayName="JVR.NestedOpen";var Ym=["className","children","parentValue","keyid","level","value","initialValue","keys","keyName"],Km=(0,e.forwardRef)(((e,t)=>{var{className:r="",parentValue:n,level:i=1,value:a,initialValue:o,keys:l,keyName:c}=e,u=xa(e,Ym),h=Zd(),p=Om(),d=[r,"w-rjv-inner"].filter(Boolean).join(" "),f={onMouseEnter:()=>h({[p]:!0}),onMouseLeave:()=>h({[p]:!1})};return(0,s.jsxs)("div",$n({className:d,ref:t},u,f,{children:[(0,s.jsx)(Xm,{expandKey:p,value:a,level:i,keys:l,parentValue:n,keyName:c,initialValue:o}),(0,s.jsx)(Rm,{expandKey:p,value:a,level:i,keys:l,parentValue:n,keyName:c}),(0,s.jsx)(Hf,{expandKey:p,value:a,level:i,keys:l})]}))}));Km.displayName="JVR.Container";var Jm=e=>{var{BraceLeft:t={}}=ff();return bm(t,e,"BraceLeft"),null};Jm.displayName="JVR.BraceLeft";var Qm=e=>{var{BraceRight:t={}}=ff();return bm(t,e,"BraceRight"),null};Qm.displayName="JVR.BraceRight";var eg=e=>{var{BracketsLeft:t={}}=ff();return bm(t,e,"BracketsLeft"),null};eg.displayName="JVR.BracketsLeft";var tg=e=>{var{BracketsRight:t={}}=ff();return bm(t,e,"BracketsRight"),null};tg.displayName="JVR.BracketsRight";var rg=e=>{var{Arrow:t={}}=ff();return bm(t,e,"Arrow"),null};rg.displayName="JVR.Arrow";var ng=e=>{var{Colon:t={}}=ff();return bm(t,e,"Colon"),null};ng.displayName="JVR.Colon";var ig=e=>{var{Quote:t={}}=ff();return bm(t,e,"Quote"),null};ig.displayName="JVR.Quote";var ag=e=>{var{ValueQuote:t={}}=ff();return bm(t,e,"ValueQuote"),null};ag.displayName="JVR.ValueQuote";var og=e=>{var{Bigint:t={}}=of();return _m(t,e,"Bigint"),null};og.displayName="JVR.Bigint";var sg=e=>{var{Date:t={}}=of();return _m(t,e,"Date"),null};sg.displayName="JVR.Date";var lg=e=>{var{False:t={}}=of();return _m(t,e,"False"),null};lg.displayName="JVR.False";var cg=e=>{var{Float:t={}}=of();return _m(t,e,"Float"),null};cg.displayName="JVR.Float";var ug=e=>{var{Int:t={}}=of();return _m(t,e,"Int"),null};ug.displayName="JVR.Int";var hg=e=>{var{Map:t={}}=of();return _m(t,e,"Map"),null};hg.displayName="JVR.Map";var pg=e=>{var{Nan:t={}}=of();return _m(t,e,"Nan"),null};pg.displayName="JVR.Nan";var dg=e=>{var{Null:t={}}=of();return _m(t,e,"Null"),null};dg.displayName="JVR.Null";var fg=e=>{var{Set:t={}}=of();return _m(t,e,"Set"),null};fg.displayName="JVR.Set";var mg=e=>{var{Str:t={}}=of();return _m(t,e,"Str"),null};mg.displayName="JVR.StringText";var gg=e=>{var{True:t={}}=of();return _m(t,e,"True"),null};gg.displayName="JVR.True";var yg=e=>{var{Undefined:t={}}=of();return _m(t,e,"Undefined"),null};yg.displayName="JVR.Undefined";var vg=e=>{var{Url:t={}}=of();return _m(t,e,"Url"),null};vg.displayName="JVR.Url";var xg=e=>{var{Copied:t={}}=bf();return wm(t,e,"Copied"),null};xg.displayName="JVR.Copied";var bg=["className","style","value","children","collapsed","shouldExpandNodeInitially","indentWidth","displayObjectSize","shortenTextAfterLength","stringEllipsis","highlightUpdates","enableClipboard","displayDataTypes","objectSortKeys","onExpand","onCopied"],_g=(0,e.forwardRef)(((e,t)=>{var{className:r="",style:n,value:i,children:a,collapsed:o,shouldExpandNodeInitially:l,indentWidth:c=15,displayObjectSize:u=!0,shortenTextAfterLength:h=30,stringEllipsis:p,highlightUpdates:d=!0,enableClipboard:f=!0,displayDataTypes:m=!0,objectSortKeys:g=!1,onExpand:y,onCopied:v}=e,x=xa(e,bg),b=$n({lineHeight:1.4,fontFamily:"var(--w-rjv-font-family, Menlo, monospace)",color:"var(--w-rjv-color, #002b36)",backgroundColor:"var(--w-rjv-background-color, #00000000)",fontSize:13},n),_=["w-json-view-container","w-rjv",r].filter(Boolean).join(" ");return(0,s.jsxs)(Ef,{initialState:{value:i,objectSortKeys:g,indentWidth:c,shouldExpandNodeInitially:l,displayObjectSize:u,collapsed:o,enableClipboard:f,shortenTextAfterLength:h,stringEllipsis:p,highlightUpdates:d,onCopied:v,onExpand:y},initialTypes:{displayDataTypes:m},children:[(0,s.jsx)(Km,$n({value:i},x,{ref:t,className:_,style:b})),a]})}));_g.Bigint=og,_g.Date=sg,_g.False=lg,_g.Float=cg,_g.Int=ug,_g.Map=hg,_g.Nan=pg,_g.Null=dg,_g.Set=fg,_g.String=mg,_g.True=gg,_g.Undefined=yg,_g.Url=vg,_g.ValueQuote=ag,_g.Arrow=rg,_g.Colon=ng,_g.Quote=ig,_g.Ellipsis=$m,_g.BraceLeft=Jm,_g.BraceRight=Qm,_g.BracketsLeft=eg,_g.BracketsRight=tg,_g.Copied=xg,_g.CountInfo=Hm,_g.CountInfoExtra=Nm,_g.KeyName=Tm,_g.Row=Em,_g.displayName="JVR.JsonView";const wg=_g,kg=Bi((0,s.jsx)("path",{d:"M20.94 11c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"})),Tg=Bi((0,s.jsx)("path",{d:"M15 9H9v6h6zm-2 4h-2v-2h2zm8-2V9h-2V7c0-1.1-.9-2-2-2h-2V3h-2v2h-2V3H9v2H7c-1.1 0-2 .9-2 2v2H3v2h2v2H3v2h2v2c0 1.1.9 2 2 2h2v2h2v-2h2v2h2v-2h2c1.1 0 2-.9 2-2v-2h2v-2h-2v-2zm-4 6H7V7h10z"})),Sg=Bi([(0,s.jsx)("path",{d:"M13 8.57c-.79 0-1.43.64-1.43 1.43s.64 1.43 1.43 1.43 1.43-.64 1.43-1.43-.64-1.43-1.43-1.43"},"0"),(0,s.jsx)("path",{d:"M13 3C9.25 3 6.2 5.94 6.02 9.64L4.1 12.2c-.25.33-.01.8.4.8H6v3c0 1.1.9 2 2 2h1v3h7v-4.68c2.36-1.12 4-3.53 4-6.32 0-3.87-3.13-7-7-7m3 7c0 .13-.01.26-.02.39l.83.66c.08.06.1.16.05.25l-.8 1.39c-.05.09-.16.12-.24.09l-.99-.4c-.21.16-.43.29-.67.39L14 13.83c-.01.1-.1.17-.2.17h-1.6c-.1 0-.18-.07-.2-.17l-.15-1.06c-.25-.1-.47-.23-.68-.39l-.99.4c-.09.03-.2 0-.25-.09l-.8-1.39c-.05-.08-.03-.19.05-.25l.84-.66c-.01-.13-.02-.26-.02-.39s.02-.27.04-.39l-.85-.66c-.08-.06-.1-.16-.05-.26l.8-1.38c.05-.09.15-.12.24-.09l1 .4c.2-.15.43-.29.67-.39L12 6.17c.02-.1.1-.17.2-.17h1.6c.1 0 .18.07.2.17l.15 1.06c.24.1.46.23.67.39l1-.4c.09-.03.2 0 .24.09l.8 1.38c.05.09.03.2-.05.26l-.85.66c.03.12.04.25.04.39"},"1")]),Ag=Bi((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"})),Mg=Bi((0,s.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function Eg(e){const{role:t,isFullWidth:r,children:n,sx:i,className:a,title:o}=e,l=bi(),c="16px",u={padding:l.spacing(1,2),fontSize:"0.875rem",alignSelf:"flex-start",maxWidth:"100%",minWidth:"80%","& > *":{color:"inherit",overflow:"hidden",m:0},"& > :last-child":{mb:0,m:0,p:0}},h={user:{...u,backgroundColor:l.palette.background.default,border:`1px solid ${l.palette.custom.highlight}`,borderRadius:`${c} ${c} 0 ${c}`,alignSelf:"flex-end",color:l.palette.primary.main},assistant:{...u,backgroundColor:l.palette.primary.main,border:`1px solid ${l.palette.secondary.main}`,borderRadius:`${c} ${c} ${c} 0`,color:l.palette.primary.contrastText},system:{...u,backgroundColor:"#EDEAE0",border:`1px dashed ${l.palette.custom.highlight}`,borderRadius:c,maxWidth:r?"100%":"90%",alignSelf:"center",color:l.palette.text.primary,fontStyle:"italic"},info:{...u,backgroundColor:"#BFD8D8",border:`1px solid ${l.palette.secondary.main}`,borderRadius:c,color:l.palette.text.primary,opacity:.95},status:{...u,backgroundColor:"rgba(74, 122, 125, 0.15)",border:`1px solid ${l.palette.secondary.light}`,borderRadius:"4px",maxWidth:r?"100%":"75%",alignSelf:"center",color:l.palette.secondary.dark,fontWeight:500,fontSize:"0.95rem",padding:"8px 12px",opacity:.9,transition:"opacity 0.3s ease-in-out"},error:{...u,backgroundColor:"#F8E7E7",border:"1px solid #D83A3A",borderRadius:c,maxWidth:r?"100%":"90%",alignSelf:"center",color:"#8B2525",padding:"10px 16px",boxShadow:"0 1px 3px rgba(216, 58, 58, 0.15)"},content:{...u,backgroundColor:"#F5F2EA",border:`1px solid ${l.palette.custom.highlight}`,borderRadius:0,maxWidth:"100%",alignSelf:"center",color:l.palette.text.primary,padding:"8px 8px",marginBottom:"0px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.05)",fontSize:"0.9rem",lineHeight:"1.3",fontFamily:l.typography.fontFamily},thinking:{...u},streaming:{...u},processing:{...u}};h.thinking=h.status,h.streaming=h.assistant,h.processing=h.status;const p={searching:(0,s.jsx)(Tg,{}),thinking:(0,s.jsx)(Sg,{}),tooling:(0,s.jsx)(kg,{}),processing:(0,s.jsx)(kg,{}),error:(0,s.jsx)(Ag,{color:"error"}),info:(0,s.jsx)(Mg,{color:"info"})};return"content"===t&&o?(0,s.jsxs)(Jp,{defaultExpanded:!0,className:a,sx:{...h[t],...i},children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),slotProps:{content:{sx:{fontWeight:"bold",fontSize:"1.1rem",m:0,p:0,display:"flex",justifyItems:"center"}}},children:o}),(0,s.jsx)(sd,{sx:{mt:0,mb:0,p:0,pl:2,pr:2},children:n})]}):(0,s.jsxs)(yc,{className:a,sx:{...void 0!==h[t]?h[t]:h.status,gap:1,display:"flex",...i,flexDirection:"row"},children:[void 0!==p[t]&&p[t],(0,s.jsx)(yc,{sx:{p:0,m:0,gap:0,display:"flex",flexGrow:1,flexDirection:"column"},children:n})]})}function Cg(){return Cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cg.apply(this,arguments)}const Pg=["children","options"],Lg="0",Ig="1",zg="2",Og="3",Rg="4",Dg="5",jg="6",Fg="7",Bg="8",Ng="9",Ug="10",Vg="11",qg="12",Hg="13",Gg="14",Wg="15",$g="16",Zg="17",Xg="18",Yg="19",Kg="20",Jg="21",Qg="22",ey="23",ty="24",ry="25",ny="27",iy="28",ay="29",oy="30",sy="31",ly="32",cy="33";var uy,hy;(hy=uy||(uy={}))[hy.MAX=0]="MAX",hy[hy.HIGH=1]="HIGH",hy[hy.MED=2]="MED",hy[hy.LOW=3]="LOW",hy[hy.MIN=4]="MIN";const py=["allowFullScreen","allowTransparency","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","charSet","classId","colSpan","contentEditable","contextMenu","crossOrigin","encType","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","hrefLang","inputMode","keyParams","keyType","marginHeight","marginWidth","maxLength","mediaGroup","minLength","noValidate","radioGroup","readOnly","rowSpan","spellCheck","srcDoc","srcLang","srcSet","tabIndex","useMap"].reduce(((e,t)=>(e[t.toLowerCase()]=t,e)),{class:"className",for:"htmlFor"}),dy={amp:"&",apos:"'",gt:">",lt:"<",nbsp:"\xa0",quot:"\u201c"},fy=["style","script"],my=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,gy=/mailto:/i,yy=/\n{2,}$/,vy=/^(\s*>[\s\S]*?)(?=\n\n|$)/,xy=/^ *> ?/gm,by=/^(?:\[!([^\]]*)\]\n)?([\s\S]*)/,_y=/^ {2,}\n/,wy=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,ky=/^(?: {1,3})?(`{3,}|~{3,}) *(\S+)? *([^\n]*?)?\n([\s\S]*?)(?:\1\n?|$)/,Ty=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,Sy=/^(`+)((?:\\`|[^`])+)\1/,Ay=/^(?:\n *)*\n/,My=/\r\n?/g,Ey=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,Cy=/^\[\^([^\]]+)]/,Py=/\f/g,Ly=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,Iy=/^\s*?\[(x|\s)\]/,zy=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Oy=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,Ry=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,Dy=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,jy=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,Fy=/^<!--[\s\S]*?(?:-->)/,By=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,Ny=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,Uy=/^\{.*\}$/,Vy=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,qy=/^<([^ >]+@[^ >]+)>/,Hy=/^<([^ >]+:\/[^ >]+)>/,Gy=/-([a-z])?/gi,Wy=/^(\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,$y=/^\[([^\]]*)\]:\s+<?([^\s>]+)>?\s*("([^"]*)")?/,Zy=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,Xy=/^\[([^\]]*)\] ?\[([^\]]*)\]/,Yy=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Ky=/\t/g,Jy=/(^ *\||\| *$)/g,Qy=/^ *:-+: *$/,ev=/^ *:-+ *$/,tv=/^ *-+: *$/,rv="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|\\\\\\1|[\\s\\S])+?)",nv=new RegExp(`^([*_])\\1${rv}\\1\\1(?!\\1)`),iv=new RegExp(`^([*_])${rv}\\1(?!\\1)`),av=new RegExp(`^(==)${rv}\\1`),ov=new RegExp(`^(~~)${rv}\\1`),sv=/^\\([^0-9A-Za-z\s])/,lv=/\\([^0-9A-Za-z\s])/g,cv=/^([\s\S](?:(?! |[0-9]\.)[^*_~\-\n<`\\\[!])*)/,uv=/^\n+/,hv=/^([ \t]*)/,pv=/\\([^\\])/g,dv=/(?:^|\n)( *)$/,fv="(?:\\d+\\.)",mv="(?:[*+-])";function gv(e){return"( *)("+(1===e?fv:mv)+") +"}const yv=gv(1),vv=gv(2);function xv(e){return new RegExp("^"+(1===e?yv:vv))}const bv=xv(1),_v=xv(2);function wv(e){return new RegExp("^"+(1===e?yv:vv)+"[^\\n]*(?:\\n(?!\\1"+(1===e?fv:mv)+" )[^\\n]*)*(\\n|$)","gm")}const kv=wv(1),Tv=wv(2);function Sv(e){const t=1===e?fv:mv;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Av=Sv(1),Mv=Sv(2);function Ev(e,t){const r=1===t,n=r?Av:Mv,i=r?kv:Tv,a=r?bv:_v;return{match:Bv((function(e,t){const r=dv.exec(t.prevCapture);return r&&(t.list||!t.inline&&!t.simple)?n.exec(e=r[1]+e):null})),order:1,parse(e,t,n){const o=r?+e[2]:void 0,s=e[0].replace(yy,"\n").match(i);let l=!1;return{items:s.map((function(e,r){const i=a.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),c=e.replace(o,"").replace(a,""),u=r===s.length-1,h=-1!==c.indexOf("\n\n")||u&&l;l=h;const p=n.inline,d=n.list;let f;n.list=!0,h?(n.inline=!1,f=zv(c)+"\n\n"):(n.inline=!0,f=zv(c));const m=t(f,n);return n.inline=p,n.list=d,m})),ordered:r,start:o}},render:(t,r,n)=>e(t.ordered?"ol":"ul",{key:n.key,start:t.type===Kg?t.start:void 0},t.items.map((function(t,i){return e("li",{key:i},r(t,n))})))}}const Cv=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*<?((?:\\([^)]*\\)|[^\\s\\\\]|\\\\.)*?)>?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),Pv=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Lv=[vy,ky,Ty,zy,Ry,Oy,Wy,Av,Mv],Iv=[...Lv,/^[^\n]+(?: \n|\n{2,})/,Dy,Fy,Ny];function zv(e){let t=e.length;for(;t>0&&e[t-1]<=" ";)t--;return e.slice(0,t)}function Ov(e){return e.replace(/[\xc0\xc1\xc2\xc3\xc4\xc5\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xc6]/g,"a").replace(/[\xe7\xc7]/g,"c").replace(/[\xf0\xd0]/g,"d").replace(/[\xc8\xc9\xca\xcb\xe9\xe8\xea\xeb]/g,"e").replace(/[\xcf\xef\xce\xee\xcd\xed\xcc\xec]/g,"i").replace(/[\xd1\xf1]/g,"n").replace(/[\xf8\xd8\u0153\u0152\xd5\xf5\xd4\xf4\xd3\xf3\xd2\xf2]/g,"o").replace(/[\xdc\xfc\xdb\xfb\xda\xfa\xd9\xf9]/g,"u").replace(/[\u0178\xff\xdd\xfd]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function Rv(e){return tv.test(e)?"right":Qy.test(e)?"center":ev.test(e)?"left":null}function Dv(e,t,r,n){const i=r.inTable;r.inTable=!0;let a=[[]],o="";function s(){if(!o)return;const e=a[a.length-1];e.push.apply(e,t(o,r)),o=""}return e.trim().split(/(`[^`]*`|\\\||\|)/).filter(Boolean).forEach(((e,t,r)=>{"|"===e.trim()&&(s(),n)?0!==t&&t!==r.length-1&&a.push([]):o+=e})),s(),r.inTable=i,a}function jv(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(Jy,"").split("|").map(Rv):[],i=e[3]?function(e,t,r){return e.trim().split("\n").map((function(e){return Dv(e,t,r,!0)}))}(e[3],t,r):[],a=Dv(e[1],t,r,!!i.length);return r.inline=!1,i.length?{align:n,cells:i,header:a,type:ry}:{children:a,type:Jg}}function Fv(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function Bv(e){return e.inline=1,e}function Nv(e){return Bv((function(t,r){return r.inline?e.exec(t):null}))}function Uv(e){return Bv((function(t,r){return r.inline||r.simple?e.exec(t):null}))}function Vv(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function qv(e){return Bv((function(t){return e.exec(t)}))}function Hv(e,t){if(t.inline||t.simple)return null;let r="";e.split("\n").every((e=>(e+="\n",!Lv.some((t=>t.test(e)))&&(r+=e,!!e.trim()))));const n=zv(r);return""==n?null:[r,,n]}function Gv(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return null}catch(e){return null}return e}function Wv(e){return e.replace(pv,"$1")}function $v(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function Zv(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function Xv(e,t,r){const n=r.inline||!1;r.inline=!1;const i=e(t,r);return r.inline=n,i}const Yv=(e,t,r)=>({children:$v(t,e[2],r)});function Kv(){return{}}function Jv(){return null}function Qv(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join(" ")}function ex(e,t,r){let n=e;const i=t.split(".");for(;i.length&&(n=n[i[0]],void 0!==n);)i.shift();return n||r}const tx=t=>{let{children:r="",options:n}=t,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(i[r]=e[r]);return i}(t,Pg);return e.cloneElement(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(e,t){const n=ex(r.overrides,`${e}.props`,{});for(var i=arguments.length,a=new Array(i>2?i-2:0),o=2;o<i;o++)a[o-2]=arguments[o];return r.createElement(function(e,t){const r=ex(t,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:ex(t,`${e}.component`,e):e}(e,r.overrides),Cg({},t,n,{className:Qv(null==t?void 0:t.className,n.className)||void 0}),...a)}function i(e){e=e.replace(Ly,"");let t=!1;r.forceInline?t=!0:r.forceBlock||(t=!1===Yy.test(e));const i=u(c(t?e:`${zv(e).replace(uv,"")}\n\n`,{inline:t}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===r.wrapper)return i;const a=r.wrapper||(t?"span":"div");let o;if(i.length>1||r.forceWrapper)o=i;else{if(1===i.length)return o=i[0],"string"==typeof o?n("span",{key:"outer"},o):o;o=null}return r.createElement(a,{key:"outer"},o)}function a(e,t){const n=t.match(my);return n?n.reduce((function(t,n){const a=n.indexOf("=");if(-1!==a){const o=function(e){return-1!==e.indexOf("-")&&null===e.match(By)&&(e=e.replace(Gy,(function(e,t){return t.toUpperCase()}))),e}(n.slice(0,a)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(n.slice(a+1).trim()),l=py[o]||o;if("ref"===l)return t;const c=t[l]=function(e,t,r,n){return"style"===t?r.split(/;\s?/).reduce((function(e,t){const r=t.slice(0,t.indexOf(":"));return e[r.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(r.length+1).trim(),e}),{}):"href"===t||"src"===t?n(r,e,t):(r.match(Uy)&&(r=r.slice(1,r.length-1)),"true"===r||"false"!==r&&r)}(e,o,s,r.sanitizer);"string"==typeof c&&(Dy.test(c)||Ny.test(c))&&(t[l]=i(c.trim()))}else"style"!==n&&(t[py[n]||n]=!0);return t}),{}):null}r.overrides=r.overrides||{},r.sanitizer=r.sanitizer||Gv,r.slugify=r.slugify||Ov,r.namedCodesToUnicode=r.namedCodesToUnicode?Cg({},dy,r.namedCodesToUnicode):dy,r.createElement=r.createElement||e.createElement;const o=[],s={},l={[Lg]:{match:Vv(vy),order:1,parse(e,t,r){const[,n,i]=e[0].replace(xy,"").match(by);return{alert:n,children:t(i,r)}},render(e,t,i){const a={key:i.key};return e.alert&&(a.className="markdown-alert-"+r.slugify(e.alert.toLowerCase(),Ov),e.children.unshift({attrs:{},children:[{type:ny,text:e.alert}],noInnerParse:!0,type:Vg,tag:"header"})),n("blockquote",a,t(e.children,i))}},[Ig]:{match:qv(_y),order:1,parse:Kv,render:(e,t,r)=>n("br",{key:r.key})},[zg]:{match:Vv(wy),order:1,parse:Kv,render:(e,t,r)=>n("hr",{key:r.key})},[Og]:{match:Vv(Ty),order:0,parse:e=>({lang:void 0,text:zv(e[0].replace(/^ {4}/gm,"")).replace(lv,"$1")}),render:(e,t,r)=>n("pre",{key:r.key},n("code",Cg({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},[Rg]:{match:Vv(ky),order:0,parse:e=>({attrs:a("code",e[3]||""),lang:e[2]||void 0,text:e[4].replace(lv,"$1"),type:Og})},[Dg]:{match:Uv(Sy),order:3,parse:e=>({text:e[2].replace(lv,"$1")}),render:(e,t,r)=>n("code",{key:r.key},e.text)},[jg]:{match:Vv(Ey),order:0,parse:e=>(o.push({footnote:e[2],identifier:e[1]}),{}),render:Jv},[Fg]:{match:Nv(Cy),order:1,parse:e=>({target:`#${r.slugify(e[1],Ov)}`,text:e[1]}),render:(e,t,i)=>n("a",{key:i.key,href:r.sanitizer(e.target,"a","href")},n("sup",{key:i.key},e.text))},[Bg]:{match:Nv(Iy),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,r)=>n("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},[Ng]:{match:Vv(r.enforceAtxHeadings?Oy:zy),order:1,parse:(e,t,n)=>({children:$v(t,e[2],n),id:r.slugify(e[2],Ov),level:e[1].length}),render:(e,t,r)=>n(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r))},[Ug]:{match:Vv(Ry),order:0,parse:(e,t,r)=>({children:$v(t,e[1],r),level:"="===e[2]?1:2,type:Ng})},[Vg]:{match:qv(Dy),order:1,parse(e,t,r){const[,n]=e[3].match(hv),i=new RegExp(`^${n}`,"gm"),o=e[3].replace(i,""),s=(l=o,Iv.some((e=>e.test(l)))?Xv:$v);var l;const c=e[1].toLowerCase(),u=-1!==fy.indexOf(c),h=(u?c:e[1]).trim(),p={attrs:a(h,e[2]),noInnerParse:u,tag:h};return r.inAnchor=r.inAnchor||"a"===c,u?p.text=e[3]:p.children=s(t,o,r),r.inAnchor=!1,p},render:(e,t,r)=>n(e.tag,Cg({key:r.key},e.attrs),e.text||(e.children?t(e.children,r):""))},[Hg]:{match:qv(Ny),order:1,parse(e){const t=e[1].trim();return{attrs:a(t,e[2]||""),tag:t}},render:(e,t,r)=>n(e.tag,Cg({},e.attrs,{key:r.key}))},[qg]:{match:qv(Fy),order:1,parse:()=>({}),render:Jv},[Gg]:{match:Uv(Pv),order:1,parse:e=>({alt:e[1],target:Wv(e[2]),title:e[3]}),render:(e,t,i)=>n("img",{key:i.key,alt:e.alt||void 0,title:e.title||void 0,src:r.sanitizer(e.target,"img","src")})},[Wg]:{match:Nv(Cv),order:3,parse:(e,t,r)=>({children:Zv(t,e[1],r),target:Wv(e[2]),title:e[3]}),render:(e,t,i)=>n("a",{key:i.key,href:r.sanitizer(e.target,"a","href"),title:e.title},t(e.children,i))},[$g]:{match:Nv(Hy),order:0,parse:e=>({children:[{text:e[1],type:ny}],target:e[1],type:Wg})},[Zg]:{match:Bv(((e,t)=>t.inAnchor||r.disableAutoLink?null:Nv(Vy)(e,t))),order:0,parse:e=>({children:[{text:e[1],type:ny}],target:e[1],title:void 0,type:Wg})},[Xg]:{match:Nv(qy),order:0,parse(e){let t=e[1],r=e[1];return gy.test(r)||(r="mailto:"+r),{children:[{text:t.replace("mailto:",""),type:ny}],target:r,type:Wg}}},[Kg]:Ev(n,1),[cy]:Ev(n,2),[Yg]:{match:Vv(Ay),order:3,parse:Kv,render:()=>"\n"},[Jg]:{match:Bv(Hv),order:3,parse:Yv,render:(e,t,r)=>n("p",{key:r.key},t(e.children,r))},[Qg]:{match:Nv($y),order:0,parse:e=>(s[e[1]]={target:e[2],title:e[4]},{}),render:Jv},[ey]:{match:Uv(Zy),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,i)=>s[e.ref]?n("img",{key:i.key,alt:e.alt,src:r.sanitizer(s[e.ref].target,"img","src"),title:s[e.ref].title}):null},[ty]:{match:Nv(Xy),order:0,parse:(e,t,r)=>({children:t(e[1],r),fallbackChildren:e[0],ref:e[2]}),render:(e,t,i)=>s[e.ref]?n("a",{key:i.key,href:r.sanitizer(s[e.ref].target,"a","href"),title:s[e.ref].title},t(e.children,i)):n("span",{key:i.key},e.fallbackChildren)},[ry]:{match:Vv(Wy),order:1,parse:jv,render(e,t,r){const i=e;return n("table",{key:r.key},n("thead",null,n("tr",null,i.header.map((function(e,a){return n("th",{key:a,style:Fv(i,a)},t(e,r))})))),n("tbody",null,i.cells.map((function(e,a){return n("tr",{key:a},e.map((function(e,a){return n("td",{key:a,style:Fv(i,a)},t(e,r))})))}))))}},[ny]:{match:qv(cv),order:4,parse:e=>({text:e[0].replace(jy,((e,t)=>r.namedCodesToUnicode[t]?r.namedCodesToUnicode[t]:e))}),render:e=>e.text},[iy]:{match:Uv(nv),order:2,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>n("strong",{key:r.key},t(e.children,r))},[ay]:{match:Uv(iv),order:3,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>n("em",{key:r.key},t(e.children,r))},[oy]:{match:Uv(sv),order:1,parse:e=>({text:e[1],type:ny})},[sy]:{match:Uv(av),order:3,parse:Yv,render:(e,t,r)=>n("mark",{key:r.key},t(e.children,r))},[ly]:{match:Uv(ov),order:3,parse:Yv,render:(e,t,r)=>n("del",{key:r.key},t(e.children,r))}};!0===r.disableParsingRawHTML&&(delete l[Vg],delete l[Hg]);const c=function(e){let t=Object.keys(e);function r(n,i){let a,o,s=[],l="",c="";for(i.prevCapture=i.prevCapture||"";n;){let u=0;for(;u<t.length;){if(l=t[u],a=e[l],i.inline&&!a.match.inline){u++;continue}const h=a.match(n,i);if(h){c=h[0],i.prevCapture+=c,n=n.substring(c.length),o=a.parse(h,r,i),null==o.type&&(o.type=l),s.push(o);break}u++}}return i.prevCapture="",s}return t.sort((function(t,r){let n=e[t].order,i=e[r].order;return n!==i?n-i:t<r?-1:1})),function(e,t){return r(function(e){return e.replace(My,"\n").replace(Py,"").replace(Ky," ")}(e),t)}}(l),u=(h=function(e,t){return function(r,n,i){const a=e[r.type].render;return t?t((()=>a(r,n,i)),r,n,i):a(r,n,i)}}(l,r.renderRule),function e(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Array.isArray(t)){const n=r.key,i=[];let a=!1;for(let o=0;o<t.length;o++){r.key=o;const n=e(t[o],r),s="string"==typeof n;s&&a?i[i.length-1]+=n:null!==n&&i.push(n),a=s}return r.key=n,i}return h(t,e,r)});var h;const p=i(t);return o.length?n("div",null,p,n("footer",{key:"footer"},o.map((function(e){return n("div",{id:r.slugify(e.identifier,Ov),key:e.identifier},e.identifier,u(c(e.footnote,{inline:!0})))})))):p}(r,n),i)};function rx(e){return Ai("MuiLink",e)}const nx=Mi("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),ix=e=>{let{theme:t,ownerState:r}=e;const n=r.color,i=lt(t,`palette.${n}.main`,!1)||lt(t,`palette.${n}`,!1)||r.color,a=lt(t,`palette.${n}.mainChannel`)||lt(t,`palette.${n}Channel`);return"vars"in t&&a?`rgba(${a} / 0.4)`:Tr(i,.4)},ax={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},ox=gi(jp,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`underline${Oi(r.underline)}`],"button"===r.component&&t.button]}})(wi((e=>{let{theme:t}=e;return{variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:e=>{let{underline:t,ownerState:r}=e;return"always"===t&&"inherit"!==r.color},style:{textDecorationColor:"var(--Link-underlineColor)"}},...Object.entries(t.palette).filter(hl()).map((e=>{let[r]=e;return{props:{underline:"always",color:r},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette[r].mainChannel} / 0.4)`:Tr(t.palette[r].main,.4)}}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.primaryChannel} / 0.4)`:Tr(t.palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":t.vars?`rgba(${t.vars.palette.text.secondaryChannel} / 0.4)`:Tr(t.palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(t.vars||t).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${nx.focusVisible}`]:{outline:"auto"}}}]}}))),sx=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiLink"}),i=bi(),{className:a,color:o="primary",component:l="a",onBlur:c,onFocus:u,TypographyClasses:h,underline:p="always",variant:d="inherit",sx:f,...m}=n,[g,y]=e.useState(!1),v={...n,color:o,component:l,focusVisible:g,underline:p,variant:d},x=(e=>{const{classes:t,component:r,focusVisible:n,underline:i}=e;return Wn({root:["root",`underline${Oi(i)}`,"button"===r&&"button",n&&"focusVisible"]},rx,t)})(v);return(0,s.jsx)(ox,{color:o,className:Gn(x.root,a),classes:h,component:l,onBlur:e=>{pa(e.target)||y(!1),c&&c(e)},onFocus:e=>{pa(e.target)&&y(!0),u&&u(e)},ref:r,ownerState:v,variant:d,...m,sx:[...void 0===ax[o]?[{color:o}]:[],...Array.isArray(f)?f:[f]],style:{...m.style,..."always"===p&&"inherit"!==o&&!ax[o]&&{"--Link-underlineColor":ix({theme:i,ownerState:v})}}})}));function lx(e){return Ai("MuiTableFooter",e)}Mi("MuiTableFooter",["root"]);const cx=gi("tfoot",{name:"MuiTableFooter",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-footer-group"}),ux={variant:"footer"},hx="tfoot",px=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiTableFooter"}),{className:n,component:i=hx,...a}=r,o={...r,component:i},l=(e=>{const{classes:t}=e;return Wn({root:["root"]},lx,t)})(o);return(0,s.jsx)(dd.Provider,{value:ux,children:(0,s.jsx)(cx,{as:i,className:Gn(l.root,n),ref:t,role:i===hx?null:"rowgroup",ownerState:o,...a})})}));var dx=function(){return dx=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},dx.apply(this,arguments)};function fx(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}var mx=function(e){return(0,s.jsx)(yc,dx({},e))},gx=function(e){var t=e.children;return(0,s.jsx)(mx,dx({component:"blockquote",dir:"auto",sx:{borderInlineStart:"3px solid",paddingInlineStart:"1.5rem",borderColor:"text.secondary",m:"0.25rem 0"}},{children:t}))},yx=function(e){return(0,s.jsx)(jp,dx({},e))},vx=function(e){var t=e.children,r=e.component,n=void 0===r?"p":r,i=e.variant,a=void 0===i?"body1":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},xx=function(e){return(0,s.jsx)(zc,dx({},e))},bx=function(e){var t=e.children,r=e.component,n=void 0===r?"h1":r,i=e.variant,a=void 0===i?"h1":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},_x=function(e){var t=e.children,r=e.component,n=void 0===r?"h2":r,i=e.variant,a=void 0===i?"h2":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},wx=function(e){var t=e.children,r=e.component,n=void 0===r?"h3":r,i=e.variant,a=void 0===i?"h3":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},kx=function(e){var t=e.children,r=e.component,n=void 0===r?"h4":r,i=e.variant,a=void 0===i?"h4":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},Tx=function(e){var t=e.children,r=e.component,n=void 0===r?"h5":r,i=e.variant,a=void 0===i?"h5":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},Sx=function(e){var t=e.children,r=e.component,n=void 0===r?"h6":r,i=e.variant,a=void 0===i?"h6":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},Ax=function(e){var t=e.children;return(0,s.jsx)("code",dx({style:{backgroundColor:"rgba(126, 125, 124, 0.1)",borderRadius:"0.25rem",padding:"0.25rem 0.5rem"}},{children:t}))},Mx=function(e){return(0,s.jsx)(sx,dx({},e))},Ex=function(e){var t=e.children,r=void 0===t?"":t,n=e.language,i=void 0===n?"tsx":n,a=e.Highlight,o=e.themes,l=e.theme,c=e.hideLineNumbers;return(0,s.jsx)(a,dx({code:r,language:i,theme:l||o.vsDark},{children:function(t){var r=t.style,n=t.tokens,i=t.getLineProps,a=t.getTokenProps;return(0,s.jsx)("pre",dx({style:dx(dx({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},r),e.styles)},{children:n.map((function(e,t){return(0,s.jsxs)("div",dx({},i({line:e}),{children:[!c&&(0,s.jsxs)("span",{children:[t+1," "]}),e.map((function(e,t){return(0,s.jsx)("span",dx({},a({token:e})),t)}))]}),t)}))}))}}))},Cx=function(e){var t=e.children,r=void 0===t?"":t,n=e.styles;return(0,s.jsx)("pre",dx({style:dx({borderRadius:"0.5rem",padding:"0.5rem 0.75rem",overflow:"auto"},n)},{children:r}))},Px=function(e){var t=e.children,r=e.Highlight,n=e.themes,i=e.theme,a=e.styles,o=e.hideLineNumbers;if(t&&t.props&&t.props.className&&t.props.className.startsWith("lang-")){var l=t.props.children,c=t.props.className?t.props.className.replace("lang-",""):"tsx";return r&&n?(0,s.jsx)(Ex,dx({Highlight:r,themes:n,language:c,theme:i,styles:a,hideLineNumbers:o},{children:l})):(0,s.jsx)(Cx,dx({styles:a},{children:l}))}return(0,s.jsx)(mx,dx({component:"pre",sx:{whiteSpace:"pre-wrap"}},{children:t}))},Lx=function(e){var t=e.children,r=e.component,n=void 0===r?"span":r,i=e.variant,a=void 0===i?"body1":i,o=fx(e,["children","component","variant"]);return(0,s.jsx)(yx,dx({component:n,variant:a},o,{children:t}))},Ix=function(e){return(0,s.jsx)(vd,dx({},e))},zx=function(e){return(0,s.jsx)(wd,dx({},e,{sx:dx({whiteSpace:"nowrap"},e.sx)}))},Ox=function(e){return(0,s.jsx)(px,dx({},e))},Rx=function(e){return(0,s.jsx)(Pd,dx({},e))},Dx=function(e){return(0,s.jsx)(Rd,dx({},e))},jx=function(e){return(0,s.jsx)(pd,dx({},e))},Fx=function(e){var t=e.children,r=e.sx,n=fx(e,["children","sx"]);return(0,s.jsx)(mx,dx({sx:r||function(e){var t=e.palette;return dx({overflow:"auto"},function(e){return{"::-webkit-scrollbar":{width:"8px",height:"6px"},"::-webkit-scrollbar-track":{background:"dark"===e.mode?e.background.default:e.background.paper,borderRadius:"8px",overflow:"hidden"},"::-webkit-scrollbar-thumb":{background:Ar(e.background.default,.05),borderRadius:"8px"}}}(t))}},{children:(0,s.jsx)(mx,dx({sx:{width:"100%",display:"table",tableLayout:"fixed"}},{children:(0,s.jsx)(jx,dx({},n,{children:t}))}))}))},Bx=function(e){var t=e.children,r=e.component,n=void 0===r?"ul":r,i=fx(e,["children","component"]);return(0,s.jsx)(yx,dx({component:n},i,{children:t}))},Nx=function(e){var t=e.children,r=e.component,n=void 0===r?"ol":r,i=fx(e,["children","component"]);return(0,s.jsx)(yx,dx({component:n},i,{children:t}))},Ux={a:Mx,blockquote:gx,code:Ax,h1:bx,h2:_x,h3:wx,h4:kx,h5:Tx,h6:Sx,hr:xx,ol:Nx,p:vx,pre:Px,span:Lx,table:Fx,tbody:Ix,td:zx,tfoot:Ox,th:zx,thead:Rx,tr:Dx,ul:Bx},Vx=function(e){var t,r=e.children,n=void 0===r?"":r,i=function(e){var t=e.options,r=e.overrides,n=function(e){var t=void 0===e?{}:e,r=t.hideLineNumbers,n=t.theme,i=t.styles,a=t.Highlight,o=t.themes;return dx(dx({},Ux),{pre:{component:Px,props:{theme:n,styles:i,Highlight:a,themes:o,hideLineNumbers:r}}})}(e);return t?t.overrides?t:dx(dx({},t),{overrides:n}):{overrides:r||n}}(e);return"options"in(t=e)&&"overrides"in t&&console.error("Cannot set both 'options' and 'overrides' in the MuiMarkdown component props."),(0,s.jsx)(tx,dx({options:i},{children:n||""}))};const qx=e=>{let{className:t,content:r,submitQuery:n,...i}=e;const a=bi();let o={overrides:{a:{component:sx,props:{sx:{wordBreak:"break-all",color:a.palette.secondary.main,textDecoration:"none","&:hover":{color:a.palette.custom.highlight,textDecoration:"underline"}}}},ChatQuery:void 0}};return n&&(o.overrides.ChatQuery={component:Pu,props:{submitQuery:n}}),(0,s.jsx)(Vx,{className:t,...o,children:r,...i})};var Hx=r(537);function Gx(e){return Ai("MuiFormControlLabel",e)}const Wx=Mi("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),$x=gi("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Wx.label}`]:t.label},t.root,t[`labelPlacement${Oi(r.labelPlacement)}`]]}})(wi((e=>{let{theme:t}=e;return{display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Wx.disabled}`]:{cursor:"default"},[`& .${Wx.label}`]:{[`&.${Wx.disabled}`]:{color:(t.vars||t).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:e=>{let{labelPlacement:t}=e;return"start"===t||"top"===t||"bottom"===t},style:{marginLeft:16}}]}}))),Zx=gi("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(wi((e=>{let{theme:t}=e;return{[`&.${Wx.error}`]:{color:(t.vars||t).palette.error.main}}}))),Xx=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiFormControlLabel"}),{checked:i,className:a,componentsProps:o={},control:l,disabled:c,disableTypography:u,inputRef:h,label:p,labelPlacement:d="end",name:f,onChange:m,required:g,slots:y={},slotProps:v={},value:x,...b}=n,_=ju(),w=c??l.props.disabled??_?.disabled,k=g??l.props.required,T={disabled:w,required:k};["checked","name","onChange","value","inputRef"].forEach((e=>{"undefined"===typeof l.props[e]&&"undefined"!==typeof n[e]&&(T[e]=n[e])}));const S=Ru({props:n,muiFormControl:_,states:["error"]}),A={...n,disabled:w,labelPlacement:d,required:k,error:S.error},M=(e=>{const{classes:t,disabled:r,labelPlacement:n,error:i,required:a}=e;return Wn({root:["root",r&&"disabled",`labelPlacement${Oi(n)}`,i&&"error",a&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",i&&"error"]},Gx,t)})(A),E={slots:y,slotProps:{...o,...v}},[C,P]=Yi("typography",{elementType:jp,externalForwardedProps:E,ownerState:A});let L=p;return null==L||L.type===jp||u||(L=(0,s.jsx)(C,{component:"span",...P,className:Gn(M.label,P?.className),children:L})),(0,s.jsxs)($x,{className:Gn(M.root,a),ownerState:A,ref:r,...b,children:[e.cloneElement(l,T),k?(0,s.jsxs)("div",{children:[L,(0,s.jsxs)(Zx,{ownerState:A,"aria-hidden":!0,className:M.asterisk,children:["\u2009","*"]})]}):L]})}));function Yx(e){return Ai("PrivateSwitchBase",e)}Mi("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Kx=gi(Ha)({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"start"===t&&"small"!==r.size},style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:e=>{let{edge:t,ownerState:r}=e;return"end"===t&&"small"!==r.size},style:{marginRight:-12}}]}),Jx=gi("input",{shouldForwardProp:mi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Qx=e.forwardRef((function(e,t){const{autoFocus:r,checked:n,checkedIcon:i,defaultChecked:a,disabled:o,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:h,inputProps:p,inputRef:d,name:f,onBlur:m,onChange:g,onFocus:y,readOnly:v,required:x=!1,tabIndex:b,type:_,value:w,slots:k={},slotProps:T={},...S}=e,[A,M]=el({controlled:n,default:Boolean(a),name:"SwitchBase",state:"checked"}),E=ju();let C=o;E&&"undefined"===typeof C&&(C=E.disabled);const P="checkbox"===_||"radio"===_,L={...e,checked:A,disabled:C,disableFocusRipple:l,edge:c},I=(e=>{const{classes:t,checked:r,disabled:n,edge:i}=e;return Wn({root:["root",r&&"checked",n&&"disabled",i&&`edge${Oi(i)}`],input:["input"]},Yx,t)})(L),z={slots:k,slotProps:{input:p,...T}},[O,R]=Yi("root",{ref:t,elementType:Kx,className:I.root,shouldForwardComponentProp:!0,externalForwardedProps:{...z,component:"span",...S},getSlotProps:e=>({...e,onFocus:t=>{e.onFocus?.(t),(e=>{y&&y(e),E&&E.onFocus&&E.onFocus(e)})(t)},onBlur:t=>{e.onBlur?.(t),(e=>{m&&m(e),E&&E.onBlur&&E.onBlur(e)})(t)}}),ownerState:L,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:C,role:void 0,tabIndex:null}}),[D,j]=Yi("input",{ref:d,elementType:Jx,className:I.input,externalForwardedProps:z,getSlotProps:e=>({...e,onChange:t=>{e.onChange?.(t),(e=>{if(e.nativeEvent.defaultPrevented)return;const t=e.target.checked;M(t),g&&g(e,t)})(t)}}),ownerState:L,additionalProps:{autoFocus:r,checked:n,defaultChecked:a,disabled:C,id:P?h:void 0,name:f,readOnly:v,required:x,tabIndex:b,type:_,..."checkbox"===_&&void 0===w?{}:{value:w}}});return(0,s.jsxs)(O,{...R,children:[(0,s.jsx)(D,{...j}),A?i:u]})}));function eb(e){return Ai("MuiSwitch",e)}const tb=Mi("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),rb=gi("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.edge&&t[`edge${Oi(r.edge)}`],t[`size${Oi(r.size)}`]]}})({display:"inline-flex",width:58,height:38,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${tb.thumb}`]:{width:16,height:16},[`& .${tb.switchBase}`]:{padding:4,[`&.${tb.checked}`]:{transform:"translateX(16px)"}}}}]}),nb=gi(Qx,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.switchBase,{[`& .${tb.input}`]:t.input},"default"!==r.color&&t[`color${Oi(r.color)}`]]}})(wi((e=>{let{theme:t}=e;return{position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${"light"===t.palette.mode?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${tb.checked}`]:{transform:"translateX(20px)"},[`&.${tb.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${"light"===t.palette.mode?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${tb.checked} + .${tb.track}`]:{opacity:.5},[`&.${tb.disabled} + .${tb.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:""+("light"===t.palette.mode?.12:.2)},[`& .${tb.input}`]:{left:"-100%",width:"300%"}}})),wi((e=>{let{theme:t}=e;return{"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[r]=e;return{props:{color:r},style:{[`&.${tb.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Tr(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${tb.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${"light"===t.palette.mode?Er(t.palette[r].main,.62):Ar(t.palette[r].main,.55)}`}},[`&.${tb.checked} + .${tb.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}}))]}}))),ib=gi("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(e,t)=>t.track})(wi((e=>{let{theme:t}=e;return{height:"100%",width:"100%",borderRadius:7,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${"light"===t.palette.mode?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:""+("light"===t.palette.mode?.38:.3)}}))),ab=gi("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(e,t)=>t.thumb})(wi((e=>{let{theme:t}=e;return{boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}}))),ob=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiSwitch"}),{className:n,color:i="primary",edge:a=!1,size:o="medium",sx:l,slots:c={},slotProps:u={},...h}=r,p={...r,color:i,edge:a,size:o},d=(e=>{const{classes:t,edge:r,size:n,color:i,checked:a,disabled:o}=e,s=Wn({root:["root",r&&`edge${Oi(r)}`,`size${Oi(n)}`],switchBase:["switchBase",`color${Oi(i)}`,a&&"checked",o&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},eb,t);return{...t,...s}})(p),f={slots:c,slotProps:u},[m,g]=Yi("root",{className:Gn(d.root,n),elementType:rb,externalForwardedProps:f,ownerState:p,additionalProps:{sx:l}}),[y,v]=Yi("thumb",{className:d.thumb,elementType:ab,externalForwardedProps:f,ownerState:p}),x=(0,s.jsx)(y,{...v}),[b,_]=Yi("track",{className:d.track,elementType:ib,externalForwardedProps:f,ownerState:p});return(0,s.jsxs)(m,{...g,children:[(0,s.jsx)(nb,{type:"checkbox",icon:x,checkedIcon:x,ref:t,ownerState:p,...h,classes:{...d,root:d.switchBase},slots:{...c.switchBase&&{root:c.switchBase},...c.input&&{input:c.input}},slotProps:{...u.switchBase&&{root:"function"===typeof u.switchBase?u.switchBase(p):u.switchBase},...u.input&&{input:"function"===typeof u.input?u.input(p):u.input}}}),(0,s.jsx)(b,{..._})]})})),sb=e=>{const t=Math.min(...e),r=Math.max(...e)-t;return 0===r?e.map((()=>.5)):e.map((e=>(e-t)/r))},lb={query:"\ud83d\udd0d",resume:"\ud83d\udcc4",projects:"\ud83d\udcc1",jobs:"\ud83d\udcc1","performance-reviews":"\ud83d\udcc4",news:"\ud83d\udcf0"},cb={query:"#D4A017",resume:"#4A7A7D",projects:"#1A2536",news:"#D3CDBF","performance-reviews":"#FFD0D0",jobs:"#F3aD8F"},ub={query:10},hb={query:"circle"},pb=t=>{const{setSnack:r,rag:n,inline:i,connectionBase:a,sessionId:o,sx:l}=t,[c,u]=(0,e.useState)(null),[h,p]=(0,e.useState)(""),[d,f]=(0,e.useState)(void 0),[m,g]=(0,e.useState)(void 0),[y,v]=(0,e.useState)(!0),x=(0,e.useRef)(null),[b,_]=(0,e.useState)(null);if((0,e.useEffect)((()=>{if(void 0!==m&&m.dimensions!==(y?3:2)||void 0===o)return;(async()=>{try{const e=await fetch(a+`/api/umap/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dimensions:y?2:3})}),t=await e.json();t.dimensions=y?2:3,g(t)}catch(e){console.error("Error obtaining collection information:",e),r("Unable to obtain collection information.","error")}})()}),[m,g,a,r,o,y]),(0,e.useEffect)((()=>{window.dispatchEvent(new Event("resize")),x.current&&Hx.A.Plots.resize(x.current)}),[]),(0,e.useEffect)((()=>{if(!m||!m.embeddings)return;if(0===m.embeddings.length)return;const e=[...m.embeddings],t=[...m.documents||[]],r=[...m.metadatas||[]],i=[...m.ids||[]];let a=e.every((e=>2===e.length)),o=e.every((e=>3===e.length));if(y&&!a||!y&&!o)return;if(y&&n&&n.umap_embedding_2d&&(r.unshift({doc_type:"query"}),t.unshift("Query"),e.unshift(n.umap_embedding_2d)),!y&&n&&n.umap_embedding_3d&&(r.unshift({doc_type:"query"}),t.unshift("Query"),e.unshift(n.umap_embedding_3d)),void 0!==d&&(r.unshift({doc_type:"query"}),t.unshift(d.query||""),y&&d.umap_embedding_2d&&e.unshift(d.umap_embedding_2d),!y&&d.umap_embedding_3d&&e.unshift(d.umap_embedding_3d)),a=e.every((e=>2===e.length)),o=e.every((e=>3===e.length)),!a&&!o)return void console.warn("Modified vectors are neither 2D nor 3D");const s=r.map((e=>e.doc_type||"unknown")),l=s.map(((e,t)=>(ub[e]||(ub[e]=5),n&&n.ids.includes(i[t])||d&&d.ids&&d.ids.includes(i[t])?ub[e]+5:ub[e]))),c=s.map((e=>(hb[e]||(hb[e]="circle"),hb[e]))),h=s.map((e=>(cb[e]||(cb[e]="#ff0000"),cb[e]))),p=r.map(((e,r)=>({doc:t[r],type:e.doc_type||"unknown"}))),f=sb(e.map((e=>e[0]))),g=sb(e.map((e=>e[1]))),v=o?sb(e.map((e=>e[2]))):void 0,x={x:f,y:g,mode:"markers",marker:{size:l,symbol:c,color:h,opacity:.8},customdata:p,type:null!==v&&void 0!==v&&v.length?"scatter3d":"scatter"};o&&(x.z=v),u({data:x,layout:{autosize:!0,paper_bgcolor:"#FFFFFF",plot_bgcolor:"#FFFFFF",font:{family:"Roboto, sans-serif",color:"#2E2E2E"},hovermode:"closest",scene:{bgcolor:"#FFFFFF",zaxis:{title:"Z",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"}},xaxis:{title:"X",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},yaxis:{title:"Y",gridcolor:"#cccccc",zerolinecolor:"#aaaaaa"},margin:{r:0,b:0,l:0,t:0}}})}),[m,d,n,y,u,r]),void 0===r)return console.error("setSnack function is undefined"),null;const w=async e=>{if(e.trim()){p("");try{const t=await fetch(`${a}/api/similarity/${o}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,dimensions:y?2:3})}),r=await t.json();f(r)}catch(t){console.error("Error obtaining query similarity information:",t),r("Unable to obtain query similarity information.","error")}}};return c&&void 0!==o?(0,s.jsxs)(yc,{className:"VectorVisualizer",sx:{display:"flex",position:"relative",flexDirection:"column",flexGrow:1,...l},children:[!i&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",flexGrow:1,minHeight:"2.5rem",justifyContent:"center",alignItems:"center",m:0,p:0,mb:1},children:(0,s.jsx)(jp,{variant:"h6",sx:{p:1,pt:0},children:"RAG Vector Visualization"})}),(0,s.jsx)(Xx,{sx:{display:"flex",position:"relative",width:"fit-content",ml:1,mb:"-2.5rem",zIndex:100,flexBasis:0,flexGrow:0},control:(0,s.jsx)(ob,{checked:!y}),onChange:()=>v(!y),label:"3D"}),(0,s.jsx)(Hx.A,{ref:x,onClick:e=>{const t=e.points[0];console.log("Point:",t);const r=t.customdata.type,n=t.customdata.doc,i=lb[r]||"\u2753";var a;_({visible:!0,background:t["marker.color"],color:(a=t["marker.color"],.299*parseInt(a.slice(1,3),16)+.587*parseInt(a.slice(3,5),16)+.114*parseInt(a.slice(5,7),16)>186?"#2E2E2E":"#FFFFFF"),content:`${i} ${r.toUpperCase()}\n${n}`})},data:[c.data],useResizeHandler:!0,config:{responsive:!0,displaylogo:!1,showSendToCloud:!1,staticPlot:!1},style:{display:"flex",flexGrow:1,minHeight:"240px",padding:0,margin:0,width:"100%",height:"100%"},layout:c.layout}),!i&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",flexGrow:1,mt:1,p:.5,color:(null===b||void 0===b?void 0:b.color)||"#2E2E2E",background:(null===b||void 0===b?void 0:b.background)||"#FFFFFF",whiteSpace:"pre-line",zIndex:1e3,overflow:"auto",maxHeight:"20vh",minHeight:"20vh",overflowWrap:"break-all",wordBreak:"break-all"},children:(0,s.jsx)(jp,{variant:"body2",sx:{p:1,pt:0},children:null===b||void 0===b?void 0:b.content})}),!i&&void 0!==d&&(0,s.jsx)(zi,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",mt:1,pb:0},children:(0,s.jsxs)(jp,{variant:"h6",sx:{p:1,pt:0,maxHeight:"5rem",overflow:"auto"},children:["Query: ",d.query]})}),!i&&(0,s.jsxs)(yc,{className:"Query",sx:{display:"flex",flexDirection:"row",p:1},children:[(0,s.jsx)(Lp,{variant:"outlined",fullWidth:!0,type:"text",value:h,onChange:e=>p(e.target.value),onKeyDown:e=>{"Enter"===e.key&&w(h)},placeholder:"Enter query to find related documents...",id:"QueryInput"}),(0,s.jsx)(ul,{title:"Send",children:(0,s.jsx)(Cu,{sx:{m:1},variant:"contained",onClick:()=>{w(h)},children:(0,s.jsx)(Fp,{})})})]})]}):(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,justifyContent:"center",alignItems:"center"},children:(0,s.jsx)("div",{children:"Loading visualization..."})})},db=Bi((0,s.jsx)("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),fb=Bi((0,s.jsx)("path",{d:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})),mb=t=>{let{content:r,sx:n}=t;const[i,a]=(0,e.useState)(!1);return(0,s.jsx)(ul,{title:"Copy to clipboard",placement:"top",arrow:!0,children:(0,s.jsx)(dc,{onClick:()=>{void 0!==r&&navigator.clipboard.writeText(r.trim()).then((()=>{a(!0),setTimeout((()=>a(!1)),2e3)}))},sx:{width:24,height:24,opacity:.75,bgcolor:"background.paper","&:hover":{bgcolor:"action.hover",opacity:1},...n},size:"small",color:i?"success":"default",children:i?(0,s.jsx)(fb,{sx:{width:16,height:16}}):(0,s.jsx)(db,{sx:{width:16,height:16}})})})},gb=e=>{const{rag:t,tools:r,eval_count:n,eval_duration:i,prompt_eval_count:a,prompt_eval_duration:o}=e.metadata||{},l=e.messageProps.message;return(0,s.jsxs)(s.Fragment,{children:[0!==o&&0!==i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(yc,{sx:{fontSize:"0.8rem",mb:1},children:"Below is the LLM performance of this query. Note that if tools are called, the entire context is processed for each separate tool request by the LLM. This can dramatically increase the total time for a response."}),(0,s.jsx)(Sd,{component:zi,className:"PromptStats",sx:{mb:1},children:(0,s.jsxs)(pd,{"aria-label":"prompt stats",size:"small",children:[(0,s.jsx)(Pd,{children:(0,s.jsxs)(Rd,{children:[(0,s.jsx)(wd,{}),(0,s.jsx)(wd,{align:"right",children:"Tokens"}),(0,s.jsx)(wd,{align:"right",children:"Time (s)"}),(0,s.jsx)(wd,{align:"right",children:"TPS"})]})}),(0,s.jsxs)(vd,{children:[(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Prompt"}),(0,s.jsx)(wd,{align:"right",children:a}),(0,s.jsx)(wd,{align:"right",children:Math.round(o/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round(a*10**9/o)})]},"prompt"),(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Response"}),(0,s.jsx)(wd,{align:"right",children:n}),(0,s.jsx)(wd,{align:"right",children:Math.round(i/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round(n*10**9/i)})]},"response"),(0,s.jsxs)(Rd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[(0,s.jsx)(wd,{component:"th",scope:"row",children:"Total"}),(0,s.jsx)(wd,{align:"right",children:a+n}),(0,s.jsx)(wd,{align:"right",children:Math.round((o+i)/10**7)/100}),(0,s.jsx)(wd,{align:"right",children:Math.round((a+n)*10**9/(o+i))})]},"total")]})]})})]}),void 0!==r&&r.tool_calls&&0!==r.tool_calls.length&&(0,s.jsxs)(Jp,{sx:{boxSizing:"border-box"},children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(yc,{sx:{fontSize:"0.8rem"},children:"Tools queried"})}),(0,s.jsx)(sd,{children:r.tool_calls.map(((e,t)=>(0,s.jsxs)(yc,{sx:{m:0,p:1,pt:0,display:"flex",flexDirection:"column",border:"1px solid #e0e0e0"},children:[0!==t&&(0,s.jsx)(zc,{}),(0,s.jsx)(yc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"column",mt:1,mb:1,fontWeight:"bold"},children:e.name}),(0,s.jsx)(wg,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:JSON.parse(e.content),style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(wg.String,{render:e=>{let{children:t,...r}=e;if("string"===typeof t&&t.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"flex",border:"none",...r.style},children:t})}})})]},t)))})]}),t.map((t=>(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsxs)(yc,{sx:{fontSize:"0.8rem"},children:["Top RAG ",t.ids.length," matches from '",t.name,"' collection against embedding vector of ",t.query_embedding.length," dimensions"]})}),(0,s.jsxs)(sd,{children:[(0,s.jsxs)(yc,{sx:{fontSize:"0.8rem"},children:["UMAP Vector Visualization of '",t.name,"' RAG"]}),(0,s.jsx)(pb,{inline:!0,...e.messageProps,...e.metadata,rag:t}),t.ids.map(((e,r)=>(0,s.jsxs)(yc,{children:[(0,s.jsx)(zc,{}),(0,s.jsxs)(yc,{sx:{whiteSpace:"nowrap",fontSize:"0.75rem",p:0,m:0,pt:.5},children:["Doc ID: ",t.ids[r]]}),(0,s.jsxs)(yc,{sx:{fontSize:"0.75rem",display:"flex",flexDirection:"row",mb:.5,mt:.5},children:[(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingRight:"1rem",minWidth:"10rem"},children:[(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Distance: ",Math.round(100*t.distances[r])/100]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Type: ",t.metadatas[r].doc_type]}),(0,s.jsxs)("div",{style:{whiteSpace:"nowrap"},children:["Chunk Len: ",t.documents[r].length]})]}),(0,s.jsx)("div",{style:{display:"flex",padding:"3px",flexGrow:1,border:"1px solid #E0E0E0",maxHeight:"5rem",overflow:"auto"},children:t.documents[r]})]})]},r)))]})]},t.name))),(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(yc,{sx:{fontSize:"0.8rem"},children:"Full Response Details"})}),(0,s.jsx)(sd,{children:(0,s.jsx)(wg,{displayDataTypes:!1,objectSortKeys:!0,collapsed:1,value:l,style:{fontSize:"0.8rem",maxHeight:"20rem",overflow:"auto"},children:(0,s.jsx)(wg.String,{render:e=>{let{children:t,...r}=e;if("string"===typeof t&&t.match("\n"))return(0,s.jsx)("pre",{...r,style:{display:"inline",border:"none",...r.style},children:t.trim()})}})})})]})]})},yb=t=>{const{message:r,submitQuery:n,isFullWidth:i,sx:a,className:o}=t,[l,c]=(0,e.useState)(!1),u=(0,e.useRef)(null),h=()=>{c(!l)};if(void 0===r)return(0,s.jsx)(s.Fragment,{});if(void 0===r.content)return console.info("Message content is undefined"),(0,s.jsx)(s.Fragment,{});const p=r.content.trim();return(0,s.jsxs)(Eg,{className:o||"Message",isFullWidth:i,role:r.role,title:r.title,sx:{display:"flex",flexDirection:"column",pb:r.metadata?0:"8px",m:0,mt:1,marginBottom:"0px !important",...a},children:[(0,s.jsx)(Fd,{ref:u,sx:{position:"relative",display:"flex",flexDirection:"column",overflowX:"auto",m:0,p:0,paddingBottom:"0px !important"},children:"user"!==r.role?(0,s.jsx)(qx,{className:"MessageContent",sx:{display:"flex",color:"text.secondary"},content:p,submitQuery:n}):(0,s.jsx)(jp,{className:"MessageContent",ref:u,variant:"body2",sx:{display:"flex",color:"text.secondary"},children:r.content})}),(0,s.jsxs)(Ud,{disableSpacing:!0,sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",p:0,m:0},children:[void 0===r.disableCopy&&["assistant","content"].includes(r.role)&&(0,s.jsx)(mb,{content:r.content}),r.metadata&&(0,s.jsxs)(yc,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,s.jsx)(Cu,{variant:"text",onClick:h,sx:{color:"darkgrey",p:0},children:"LLM information for this query"}),(0,s.jsx)(qd,{expand:l,onClick:h,"aria-expanded":l,"aria-label":"show more",children:(0,s.jsx)(Vd,{})})]})]}),r.metadata&&(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(Wp,{in:l,timeout:"auto",unmountOnExit:!0,children:(0,s.jsx)(Fd,{children:(0,s.jsx)(gb,{messageProps:t,metadata:r.metadata})})})})]})},vb=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.33,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const n=(0,e.useRef)(null),i=(0,e.useRef)(0),a=(0,e.useRef)(null);return(0,e.useEffect)((()=>{const e=n.current;if(!e)return;const o=e.scrollHeight;var s=!1;const l=n=>{if(!e)return;(void 0!==n?n:e.scrollHeight)-e.scrollTop-e.clientHeight<=e.clientHeight*t&&!s&&e.scrollTo({top:e.scrollHeight,behavior:r?"smooth":"auto"})},c=new ResizeObserver((()=>{n.current&&l(o)}));c.observe(e),Array.from(e.children).forEach((e=>{c.observe(e)}));const u=()=>{if(!e)return;a.current&&clearTimeout(a.current);const t=e.scrollTop;s=t<i.current,i.current=t,a.current=setTimeout((()=>{}),500)};return e.addEventListener("scroll",u),l(),()=>{c&&c.disconnect(),e&&e.removeEventListener("scroll",u),a.current&&clearTimeout(a.current)}}),[r,t]),n},xb=e=>{const{sx:t,children:r,autoscroll:n}=e,i=vb();return(0,s.jsx)(yc,{sx:{display:"flex",margin:"0 auto",flexGrow:1,overflow:"auto",backgroundColor:"#F5F5F5",...t},ref:void 0!==n&&!1!==n?i:void 0,children:r})};function bb(e){return Ai("MuiDialog",e)}const _b=Mi("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]);const wb=e.createContext({}),kb=gi(Tl,{name:"MuiDialog",slot:"Backdrop",overrides:(e,t)=>t.backdrop})({zIndex:-1}),Tb=gi(Fl,{name:"MuiDialog",slot:"Root",overridesResolver:(e,t)=>t.root})({"@media print":{position:"absolute !important"}}),Sb=gi("div",{name:"MuiDialog",slot:"Container",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.container,t[`scroll${Oi(r.scroll)}`]]}})({height:"100%","@media print":{height:"auto"},outline:0,variants:[{props:{scroll:"paper"},style:{display:"flex",justifyContent:"center",alignItems:"center"}},{props:{scroll:"body"},style:{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}}}]}),Ab=gi(Pi,{name:"MuiDialog",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.paper,t[`scrollPaper${Oi(r.scroll)}`],t[`paperWidth${Oi(String(r.maxWidth))}`],r.fullWidth&&t.paperFullWidth,r.fullScreen&&t.paperFullScreen]}})(wi((e=>{let{theme:t}=e;return{margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"},variants:[{props:{scroll:"paper"},style:{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"}},{props:{scroll:"body"},style:{display:"inline-block",verticalAlign:"middle",textAlign:"initial"}},{props:e=>{let{ownerState:t}=e;return!t.maxWidth},style:{maxWidth:"calc(100% - 64px)"}},{props:{maxWidth:"xs"},style:{maxWidth:"px"===t.breakpoints.unit?Math.max(t.breakpoints.values.xs,444):`max(${t.breakpoints.values.xs}${t.breakpoints.unit}, 444px)`,[`&.${_b.paperScrollBody}`]:{[t.breakpoints.down(Math.max(t.breakpoints.values.xs,444)+64)]:{maxWidth:"calc(100% - 64px)"}}}},...Object.keys(t.breakpoints.values).filter((e=>"xs"!==e)).map((e=>({props:{maxWidth:e},style:{maxWidth:`${t.breakpoints.values[e]}${t.breakpoints.unit}`,[`&.${_b.paperScrollBody}`]:{[t.breakpoints.down(t.breakpoints.values[e]+64)]:{maxWidth:"calc(100% - 64px)"}}}}))),{props:e=>{let{ownerState:t}=e;return t.fullWidth},style:{width:"calc(100% - 64px)"}},{props:e=>{let{ownerState:t}=e;return t.fullScreen},style:{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${_b.paperScrollBody}`]:{margin:0,maxWidth:"100%"}}}]}}))),Mb=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDialog"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{"aria-describedby":o,"aria-labelledby":l,"aria-modal":c=!0,BackdropComponent:u,BackdropProps:h,children:p,className:d,disableEscapeKeyDown:f=!1,fullScreen:m=!1,fullWidth:g=!1,maxWidth:y="sm",onClick:v,onClose:x,open:b,PaperComponent:_=Pi,PaperProps:w={},scroll:k="paper",slots:T={},slotProps:S={},TransitionComponent:A=_l,transitionDuration:M=a,TransitionProps:E,...C}=n,P={...n,disableEscapeKeyDown:f,fullScreen:m,fullWidth:g,maxWidth:y,scroll:k},L=(e=>{const{classes:t,scroll:r,maxWidth:n,fullWidth:i,fullScreen:a}=e;return Wn({root:["root"],container:["container",`scroll${Oi(r)}`],paper:["paper",`paperScroll${Oi(r)}`,`paperWidth${Oi(String(n))}`,i&&"paperFullWidth",a&&"paperFullScreen"]},bb,t)})(P),I=e.useRef(),z=Ks(l),O=e.useMemo((()=>({titleId:z})),[z]),R={slots:{transition:A,...T},slotProps:{transition:E,paper:w,backdrop:h,...S}},[D,j]=Yi("root",{elementType:Tb,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P,className:Gn(L.root,d),ref:r}),[F,B]=Yi("backdrop",{elementType:kb,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P}),[N,U]=Yi("paper",{elementType:Ab,shouldForwardComponentProp:!0,externalForwardedProps:R,ownerState:P,className:Gn(L.paper,w.className)}),[V,q]=Yi("container",{elementType:Sb,externalForwardedProps:R,ownerState:P,className:Gn(L.container)}),[H,G]=Yi("transition",{elementType:_l,externalForwardedProps:R,ownerState:P,additionalProps:{appear:!0,in:b,timeout:M,role:"presentation"}});return(0,s.jsx)(D,{closeAfterTransition:!0,slots:{backdrop:F},slotProps:{backdrop:{transitionDuration:M,as:u,...B}},disableEscapeKeyDown:f,onClose:x,open:b,onClick:e=>{v&&v(e),I.current&&(I.current=null,x&&x(e,"backdropClick"))},...j,...C,children:(0,s.jsx)(H,{...G,children:(0,s.jsx)(V,{onMouseDown:e=>{I.current=e.target===e.currentTarget},...q,children:(0,s.jsx)(N,{as:_,elevation:24,role:"dialog","aria-describedby":o,"aria-labelledby":z,"aria-modal":c,...U,children:(0,s.jsx)(wb.Provider,{value:O,children:p})})})})})}));function Eb(e){return Ai("MuiDialogTitle",e)}const Cb=Mi("MuiDialogTitle",["root"]),Pb=gi(jp,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),Lb=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiDialogTitle"}),{className:i,id:a,...o}=n,l=n,c=(e=>{const{classes:t}=e;return Wn({root:["root"]},Eb,t)})(l),{titleId:u=a}=e.useContext(wb);return(0,s.jsx)(Pb,{component:"h2",className:Gn(c.root,i),ownerState:l,ref:r,variant:"h6",id:a??u,...o})}));function Ib(e){return Ai("MuiDialogContent",e)}Mi("MuiDialogContent",["root","dividers"]);const zb=gi("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.dividers&&t.dividers]}})(wi((e=>{let{theme:t}=e;return{flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px",variants:[{props:e=>{let{ownerState:t}=e;return t.dividers},style:{padding:"16px 24px",borderTop:`1px solid ${(t.vars||t).palette.divider}`,borderBottom:`1px solid ${(t.vars||t).palette.divider}`}},{props:e=>{let{ownerState:t}=e;return!t.dividers},style:{[`.${Cb.root} + &`]:{paddingTop:0}}}]}}))),Ob=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogContent"}),{className:n,dividers:i=!1,...a}=r,o={...r,dividers:i},l=(e=>{const{classes:t,dividers:r}=e;return Wn({root:["root",r&&"dividers"]},Ib,t)})(o);return(0,s.jsx)(zb,{className:Gn(l.root,n),ownerState:o,ref:t,...a})}));function Rb(e){return Ai("MuiDialogContentText",e)}Mi("MuiDialogContentText",["root"]);const Db=gi(jp,{shouldForwardProp:e=>mi(e)||"classes"===e,name:"MuiDialogContentText",slot:"Root",overridesResolver:(e,t)=>t.root})({}),jb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogContentText"}),{children:n,className:i,...a}=r,o=(e=>{const{classes:t}=e,r=Wn({root:["root"]},Rb,t);return{...t,...r}})(a);return(0,s.jsx)(Db,{component:"p",variant:"body1",color:"textSecondary",ref:t,ownerState:a,className:Gn(o.root,i),...r,classes:o})}));function Fb(e){return Ai("MuiDialogActions",e)}Mi("MuiDialogActions",["root","spacing"]);const Bb=gi("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:e=>{let{ownerState:t}=e;return!t.disableSpacing},style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Nb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiDialogActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},Fb,t)})(o);return(0,s.jsx)(Bb,{className:Gn(l.root,n),ownerState:o,ref:t,...a})})),Ub=Bi((0,s.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8z"})),Vb=t=>{const{onDelete:r,disabled:n,label:i,color:a}=t,[o,l]=(0,e.useState)(!1),c=bi(),u=qn(c.breakpoints.down("md")),h=()=>{l(!1)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ul,{title:i?`Reset ${i}`:"Reset",children:(0,s.jsxs)("span",{style:{display:"flex"},children:[" ",(0,s.jsx)(dc,{"aria-label":"reset",onClick:()=>{l(!0)},color:a||"inherit",sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",disabled:n,children:(0,s.jsx)(Ub,{})})]})}),(0,s.jsxs)(Mb,{fullScreen:u,open:o,onClose:h,"aria-labelledby":"responsive-dialog-title",children:[(0,s.jsx)(Lb,{id:"responsive-dialog-title",children:"Confirm Reset"}),(0,s.jsx)(Ob,{children:(0,s.jsxs)(jb,{children:["This action will permanently reset ",i?i.toLocaleLowerCase():"all data"," without the ability to recover it. Are you sure you want to continue?"]})}),(0,s.jsxs)(Nb,{children:[(0,s.jsx)(Cu,{autoFocus:!0,onClick:h,children:"Cancel"}),(0,s.jsxs)(Cu,{onClick:()=>{r(),l(!1)},color:"error",variant:"contained",children:["Reset ",i||"Everything"]})]})]})]})},qb={role:"status",content:"Establishing connection with server..."},Hb=(0,e.forwardRef)(((t,r)=>{let{className:n,type:i,prompt:a,emptyPrompt:o,actionLabel:l,resetAction:c,multiline:u,resetLabel:h,connectionBase:p,sessionId:d,setSnack:f,defaultPrompts:m,hideDefaultPrompts:g,defaultQuery:y,preamble:v,hidePreamble:x,messageFilter:b,messages:_,sx:w,onResponse:k}=t;const[T,S]=(0,e.useState)(""),[A,M]=(0,e.useState)(0),[E,C]=(0,e.useState)(!1),[P,L]=(0,e.useState)(0),[I,z]=(0,e.useState)([]),[O,R]=(0,e.useState)([]),[D,j]=(0,e.useState)(void 0),F=(0,e.useRef)(null),[B,N]=(0,e.useState)(35),[U,V]=(0,e.useState)(430),[q,H]=(0,e.useState)({context_used:0,max_context:0}),[G,W]=(0,e.useState)(!1),[$,Z]=(0,e.useState)(!0),X=(0,e.useRef)([]),Y=vb();(0,e.useEffect)((()=>{X.current=I}),[I]);const K=(0,e.useCallback)((()=>{(async()=>{try{const e=await fetch(p+`/api/context-status/${d}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);const t=await e.json();H(t)}catch(e){console.error("Error getting context status:",e),f("Unable to obtain context status.","error")}})()}),[H,p,f,d,i]);(0,e.useEffect)((()=>{let e=[];e=void 0===b?I:b(I),0===e.length?R([...v||[],..._||[]]):R([...x?[]:v||[],..._||[],...e])}),[I,R,b,v,_,x]),(0,e.useEffect)((()=>{if(void 0===d)return void j(qb);(async()=>{try{const e=await fetch(p+`/api/history/${d}/${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);const{messages:t}=await e.json();if(void 0===t||0===t.length)console.log(`History returned for ${i} from server with 0 entries`),z([]),Z(!0);else{console.log(`History returned for ${i} from server with ${t.length} entries:`,t);z(t.flatMap((e=>[{role:"user",content:e.prompt||""},{...e,role:"assistant",content:e.response||""}]))),Z(!1)}j(void 0),K()}catch(e){console.error("Error generating session ID:",e),j({role:"error",content:"Unable to obtain history from server."}),setTimeout((()=>{j(void 0)}),5e3),f("Unable to obtain chat history.","error")}})()}),[z,R,K,p,f,i,d]);const J=()=>{F.current&&(clearInterval(F.current),F.current=null,L(0))};(0,e.useImperativeHandle)(r,(()=>({submitQuery:(e,t)=>{Q(e,t)}}))),(0,e.useEffect)((()=>{const e=Math.round(100*q.context_used/q.max_context);e>=90&&!G&&(f(`${e}% of context used. You may wish to start a new chat.`,"warning"),W(!0)),e<90&&G&&W(!1),M(e)}),[q,W,G,M,f]);const Q=async(e,t)=>{if((e=e.trim())||!y||a||(e=y.trim()),e){Z(!1),z([...X.current,{role:"user",origin:i,content:e,disableCopy:!0}]),await new Promise((e=>setTimeout(e,0))),S("");try{C(!0);const n=Date.now().toString();let a;j({role:"status",content:"Submitting request...",id:n,isProcessing:!0}),await new Promise((e=>setTimeout(e,0))),a=t?{options:t,prompt:e.trim()}:{prompt:e.trim()};const o=await fetch(p+`/api/chat/${d}/${i}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(a)}),s=500,l=Math.round(s/B+q.context_used/U);if(f(`Query sent. Response estimated in ${l}s.`,"info"),r=Math.round(l),F.current&&clearInterval(F.current),L(r),F.current=setInterval((()=>{L((e=>e<=1?(clearInterval(F.current),F.current=null,0):e-1))}),1e3),!o.ok)throw new Error(`Server responded with ${o.status}: ${o.statusText}`);if(!o.body)throw new Error("Response body is null");const c=o.body.getReader(),u=new TextDecoder;let h="";const m=async e=>{let t=JSON.parse(e);switch(t.status){case"done":console.log("Done processing:",t),k&&(t=k(t)),j(void 0);const e=t;z([...X.current,{...e,role:"assistant",origin:i,content:e.response||""}]),await new Promise((e=>setTimeout(e,0)));const r=t.metadata;if(r){const e=r.eval_count*10**9/r.eval_duration,t=r.prompt_eval_count*10**9/r.prompt_eval_duration;N(e||35),V(t||35),K()}break;case"error":j({role:"error",content:t.response}),setTimeout((()=>{j(void 0)}),5e3),await new Promise((e=>setTimeout(e,0)));break;default:j({role:t.status,content:t.response}),await new Promise((e=>setTimeout(e,0)))}};for(;;){const{done:e,value:t}=await c.read();if(e)break;h+=u.decode(t,{stream:!0});let r=h.split("\n");h=r.pop()||"";for(const n of r)if(n.trim())try{await m(n)}catch(hy){f("Error processing query","error"),console.error(hy)}}if(h.trim())try{await m(h)}catch(hy){f("Error processing query","error"),console.error(hy)}J(),C(!1)}catch(n){console.error("Fetch error:",n),f("Unable to process query","error"),j({role:"error",content:"Unable to process query"}),setTimeout((()=>{j(void 0)}),5e3),C(!1),J(),await new Promise((e=>setTimeout(e,0)))}var r}};return(0,s.jsxs)(yc,{className:n||"Conversation",ref:Y,sx:{p:1,mt:0,...w},children:[O.map(((e,t)=>(0,s.jsx)(yb,{sendQuery:Q,message:e,connectionBase:p,sessionId:d,setSnack:f},t))),void 0!==D&&(0,s.jsx)(yb,{sendQuery:Q,connectionBase:p,sessionId:d,setSnack:f,message:D}),(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",m:1},children:[(0,s.jsx)(Np(),{size:"10px",loading:E,"aria-label":"Loading Spinner","data-testid":"loader"}),!0===E&&P>0&&(0,s.jsxs)(yc,{sx:{pt:1,fontSize:"0.7rem",color:"darkgrey"},children:["Estimated response time: ",P,"s"]})]}),(0,s.jsxs)(yc,{className:"Query",sx:{display:"flex",flexDirection:"column",p:1},children:[a&&(0,s.jsx)(Lp,{variant:"outlined",disabled:E,fullWidth:!0,multiline:!!u,type:"text",value:T,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||Q(T)},placeholder:a,id:"QueryInput"}),(0,s.jsxs)(yc,{sx:{display:"flex",justifyContent:"center",flexDirection:"row"},children:[(0,s.jsx)(Vb,{label:h||"all data",disabled:void 0===d||void 0!==D||$,onDelete:()=>{(async()=>{try{const e=await fetch(p+`/api/reset/${d}/${i}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({reset:["history"]})});if(!e.ok)throw new Error(`Server responded with ${e.status}: ${e.statusText}`);if(!e.body)throw new Error("Response body is null");z([]),Z(!0)}catch(hy){f("Error resetting history","error"),console.error("Error resetting history:",hy)}})(),c&&c()}}),(0,s.jsx)(ul,{title:l||"Send",children:(0,s.jsx)("span",{style:{display:"flex",flexGrow:1},children:(0,s.jsxs)(Cu,{sx:{m:1,gap:1,flexGrow:1},variant:"contained",disabled:void 0===d||void 0!==D,onClick:()=>{Q(T)},children:[l,(0,s.jsx)(Fp,{})]})})})]},"jobActions")]}),($||!g)&&void 0!==m&&m.length&&(0,s.jsx)(yc,{sx:{display:"flex",flexDirection:"column"},children:m.map(((e,t)=>(0,s.jsx)(yc,{children:e},t)))}),(0,s.jsxs)(yc,{sx:{ml:"0.25rem",fontSize:"0.6rem",color:"darkgrey",display:"flex",flexShrink:1,flexDirection:"row",gap:1,mb:"auto",mt:1},children:["Context used: ",A,"% ",q.context_used,"/",q.max_context,A>=90?(0,s.jsx)(jp,{sx:{fontSize:"0.6rem",color:"red"},children:"WARNING: Context almost exhausted. You should start a new chat."}):A>=50?(0,s.jsx)(jp,{sx:{fontSize:"0.6rem",color:"orange"},children:"NOTE: Context is getting long. Queries will be slower, and the LLM may stop issuing tool calls."}):(0,s.jsx)(s.Fragment,{})]}),(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1}})]})})),Gb=t=>{let{sx:r,connectionBase:n,sessionId:i,setSnack:a}=t;const[o,l]=(0,e.useState)(!1),[c,u]=(0,e.useState)(!1),[h,p]=(0,e.useState)(!1),d=bi(),f=qn(d.breakpoints.down("md")),m=(0,e.useRef)(null),g=(0,e.useRef)(null),y=(0,e.useRef)(null),[v,x]=(0,e.useState)(0),[b,_]=(0,e.useState)(100),w=(e,t)=>{x(t)},k=(e,t)=>{_(t)},T=()=>{_(50)},S=e=>{var t;console.log(`handleJobQuery: ${e} -- `,m.current?" sending":"no handler"),null===(t=m.current)||void 0===t||t.submitQuery(e)},A=e=>{var t;console.log(`handleResumeQuery: ${e} -- `,g.current?" sending":"no handler"),null===(t=g.current)||void 0===t||t.submitQuery(e)},M=e=>{var t;console.log(`handleFactsQuery: ${e} -- `,y.current?" sending":"no handler"),null===(t=y.current)||void 0===t||t.submitQuery(e)},E=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterJobDescriptionMessages disabled"),e.length>1&&u(!0),e)),[l,u,c]),C=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterResumeMessages disabled"),e.length>3&&p(!0),e)),[u,h,p]),P=(0,e.useCallback)((e=>void 0===e||0===e.length?[]:(console.log("filterFactsMessages disabled"),e)),[p]),L=(0,e.useCallback)((e=>(console.log("onJobResponse",e),u(!0),e)),[]),I=(0,e.useCallback)((e=>(console.log("onResumeResponse",e),p(!0),e)),[p]),z=(0,e.useCallback)((e=>(console.log("onFactsResponse",e),e)),[]),O=(0,e.useCallback)((()=>{l(!1),u(!1),p(!1)}),[l,u,p]),R=(0,e.useCallback)((()=>{u(!1),p(!1)}),[u,p]),D=(0,e.useCallback)((()=>{p(!1)}),[p]),j=(0,e.useCallback)((e=>{console.log("renderJobDescriptionView");const t=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"What are the key skills necessary for this position?",tunables:{enable_tools:!1},submitQuery:S}),(0,s.jsx)(Pu,{prompt:"How much should this position pay (accounting for inflation)?",tunables:{enable_tools:!1},submitQuery:S})]})];return o?(0,s.jsx)(Hb,{ref:m,type:"job_description",actionLabel:"Send",prompt:"Ask a question about this job description...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:E,defaultPrompts:t,resetAction:O,onResponse:L,sessionId:i,connectionBase:n,setSnack:a}):(0,s.jsx)(Hb,{ref:m,type:"job_description",actionLabel:"Generate Resume",prompt:"Paste a job description, then click Generate...",multiline:!0,resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:E,resetAction:O,onResponse:L,sessionId:i,connectionBase:n,setSnack:a})}),[n,E,o,i,a,L,O,h,c]),F=(0,e.useCallback)((e=>{const t=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"Is this resume a good fit for the provided job description?",tunables:{enable_tools:!1},submitQuery:A}),(0,s.jsx)(Pu,{prompt:"Provide a more concise resume.",tunables:{enable_tools:!1},submitQuery:A})]})];return h?(0,s.jsx)(Hb,{ref:g,type:"resume",actionLabel:"Send",prompt:"Ask a question about this job resume...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:C,onResponse:I,resetAction:R,sessionId:i,connectionBase:n,setSnack:a,defaultPrompts:t}):(0,s.jsx)(Hb,{ref:g,type:"resume",actionLabel:"Fact Check",defaultQuery:"Fact check the resume.",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:C,onResponse:I,resetAction:R,sessionId:i,connectionBase:n,setSnack:a})}),[n,C,h,i,a,I,R,c]),B=(0,e.useCallback)((e=>{const t=[(0,s.jsx)(yc,{sx:{display:"flex",flexDirection:e?"column":"row"},children:(0,s.jsx)(Pu,{prompt:"Rewrite the resume to address any discrepancies.",tunables:{enable_tools:!1},submitQuery:M})})];return(0,s.jsx)(Hb,{ref:y,type:"fact_check",actionLabel:"Send",prompt:"Ask a question about any discrepencies...",resetLabel:"job description"+(h?", resume, and fact check":c?" and resume":""),messageFilter:P,defaultPrompts:t,resetAction:D,onResponse:z,sessionId:i,connectionBase:n,setSnack:a})}),[n,i,a,z,P,D,c,h]),N=(0,e.useCallback)((()=>{const e=c||h,t=c?(75+25*b/100)/(h?3:2):100,r=100-t*(h?2:1),n=[];n.push((0,s.jsx)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${t}%`,width:`${t}%`,maxWidth:`${t}%`,p:0,flexGrow:1},children:j(!1)},"JobDescription")),c&&n.push((0,s.jsxs)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${r}%`,width:`${r}%`,maxWidth:`${r}%`,p:0,flexGrow:1},children:[(0,s.jsx)(zc,{orientation:"vertical",flexItem:!0}),F(!1)]},"ResumeView")),h&&n.push((0,s.jsxs)(yc,{className:"ChatBox",sx:{display:"flex",flexDirection:"column",minWidth:`${t}%`,width:`${t}%`,maxWidth:`${t}%`,p:0,flexGrow:1},children:[(0,s.jsx)(zc,{orientation:"vertical",flexItem:!0}),B(!1)]},"FactCheckView"));let i=(0,s.jsx)(yc,{},"slider");return e&&(i=(0,s.jsx)(Pi,{sx:{p:2,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,s.jsxs)(Nc,{direction:"row",spacing:2,alignItems:"center",sx:{width:"60%"},children:[(0,s.jsx)(dc,{onClick:()=>_((e=>Math.max(0,e-10))),children:(0,s.jsx)(gu,{})}),(0,s.jsx)(mu,{value:b,onChange:k,"aria-label":"Split ratio",min:0,max:100}),(0,s.jsx)(dc,{onClick:()=>_((e=>Math.min(100,e+10))),children:(0,s.jsx)(yu,{})}),(0,s.jsx)(dc,{onClick:T,children:(0,s.jsx)(vu,{})})]})},"slider")),(0,s.jsxs)(yc,{sx:{p:0,m:0,display:"flex",flexGrow:1,flexDirection:"column"},children:[(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row",overflow:"hidden",p:0,m:0,margin:"0 auto",maxWidth:e?"100%":"1024px",width:e?"100%":"1024px",height:`calc(100vh - ${e?144:72}px)`,backgroundColor:"#F5F5F5"},children:n}),i]})}),[B,j,F,b,h,c]);return f?(0,s.jsxs)(yc,{sx:{p:0,m:0,display:"flex",flexGrow:1,margin:"0 auto",overflow:"hidden",height:"calc(100vh - 72px)",backgroundColor:"#F5F5F5",flexDirection:"column"},children:[(0,s.jsxs)(so,{value:v,onChange:w,variant:"fullWidth",sx:{bgcolor:"background.paper"},children:[(0,s.jsx)(ho,{value:0,label:"Job Description"}),c&&(0,s.jsx)(ho,{value:1,label:"Resume"}),h&&(0,s.jsx)(ho,{value:2,label:"Fact Check"})]}),(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:"column",flexGrow:1,p:0,width:"100%",...r},children:[(0,s.jsx)(yc,{sx:{display:0===v?"flex":"none"},children:j(!0)}),(0,s.jsx)(yc,{sx:{display:1===v?"flex":"none"},children:F(!0)}),(0,s.jsx)(yc,{sx:{display:2===v?"flex":"none"},children:B(!0)})]})]}):N()};const Wb=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{autoHideDuration:r=null,disableWindowBlurListener:n=!1,onClose:i,open:a,resumeHideDuration:o}=t,s=La();e.useEffect((()=>{if(a)return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)};function e(e){e.defaultPrevented||"Escape"===e.key&&i?.(e,"escapeKeyDown")}}),[a,i]);const l=fa(((e,t)=>{i?.(e,t)})),c=fa((e=>{i&&null!=e&&s.start(e,(()=>{l(null,"timeout")}))}));e.useEffect((()=>(a&&c(r),s.clear)),[a,r,c,s]);const u=s.clear,h=e.useCallback((()=>{null!=r&&c(null!=o?o:.5*r)}),[r,o,c]),p=e=>t=>{const r=e.onFocus;r?.(t),u()},d=e=>t=>{const r=e.onMouseEnter;r?.(t),u()},f=e=>t=>{const r=e.onMouseLeave;r?.(t),h()};return e.useEffect((()=>{if(!n&&a)return window.addEventListener("focus",h),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",u)}}),[n,a,h,u]),{getRootProps:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r={...$i(t),...$i(e)};return{role:"presentation",...e,...r,onBlur:(n=r,e=>{const t=n.onBlur;t?.(e),h()}),onFocus:p(r),onMouseEnter:d(r),onMouseLeave:f(r)};var n},onClickAway:e=>{i?.(e,"clickaway")}}};function $b(e){return e.substring(2).toLowerCase()}function Zb(t){const{children:r,disableReactTree:n=!1,mouseEvent:i="onClick",onClickAway:a,touchEvent:o="onTouchEnd"}=t,s=e.useRef(!1),l=e.useRef(null),c=e.useRef(!1),u=e.useRef(!1);e.useEffect((()=>(setTimeout((()=>{c.current=!0}),0),()=>{c.current=!1})),[]);const h=qi(po(r),l),p=fa((e=>{const t=u.current;u.current=!1;const r=oa(l.current);if(!c.current||!l.current||"clientX"in e&&function(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}(e,r))return;if(s.current)return void(s.current=!1);let i;i=e.composedPath?e.composedPath().includes(l.current):!r.documentElement.contains(e.target)||l.current.contains(e.target),i||!n&&t||a(e)})),d=e=>t=>{u.current=!0;const n=r.props[e];n&&n(t)},f={ref:h};return!1!==o&&(f[o]=d(o)),e.useEffect((()=>{if(!1!==o){const e=$b(o),t=oa(l.current),r=()=>{s.current=!0};return t.addEventListener(e,p),t.addEventListener("touchmove",r),()=>{t.removeEventListener(e,p),t.removeEventListener("touchmove",r)}}}),[p,o]),!1!==i&&(f[i]=d(i)),e.useEffect((()=>{if(!1!==i){const e=$b(i),t=oa(l.current);return t.addEventListener(e,p),()=>{t.removeEventListener(e,p)}}}),[p,i]),e.cloneElement(r,f)}function Xb(e){return Ai("MuiSnackbarContent",e)}Mi("MuiSnackbarContent",["root","message","action"]);const Yb=gi(Pi,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(e,t)=>t.root})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?.8:.98,n=Pr(t.palette.background.default,r);return{...t.typography.body2,color:t.vars?t.vars.palette.SnackbarContent.color:t.palette.getContrastText(n),backgroundColor:t.vars?t.vars.palette.SnackbarContent.bg:n,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(t.vars||t).shape.borderRadius,flexGrow:1,[t.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}}))),Kb=gi("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0"}),Jb=gi("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),Qb=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiSnackbarContent"}),{action:n,className:i,message:a,role:o="alert",...l}=r,c=r,u=(e=>{const{classes:t}=e;return Wn({root:["root"],action:["action"],message:["message"]},Xb,t)})(c);return(0,s.jsxs)(Yb,{role:o,square:!0,elevation:6,className:Gn(u.root,i),ownerState:c,ref:t,...l,children:[(0,s.jsx)(Kb,{className:u.message,ownerState:c,children:a}),n?(0,s.jsx)(Jb,{className:u.action,ownerState:c,children:n}):null]})}));function e_(e){return Ai("MuiSnackbar",e)}Mi("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const t_=gi("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`anchorOrigin${Oi(r.anchorOrigin.vertical)}${Oi(r.anchorOrigin.horizontal)}`]]}})(wi((e=>{let{theme:t}=e;return{zIndex:(t.vars||t).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:e=>{let{ownerState:t}=e;return"top"===t.anchorOrigin.vertical},style:{top:8,[t.breakpoints.up("sm")]:{top:24}}},{props:e=>{let{ownerState:t}=e;return"top"!==t.anchorOrigin.vertical},style:{bottom:8,[t.breakpoints.up("sm")]:{bottom:24}}},{props:e=>{let{ownerState:t}=e;return"left"===t.anchorOrigin.horizontal},style:{justifyContent:"flex-start",[t.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:e=>{let{ownerState:t}=e;return"right"===t.anchorOrigin.horizontal},style:{justifyContent:"flex-end",[t.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:e=>{let{ownerState:t}=e;return"center"===t.anchorOrigin.horizontal},style:{[t.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}}))),r_=e.forwardRef((function(t,r){const n=yi({props:t,name:"MuiSnackbar"}),i=bi(),a={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:o,anchorOrigin:{vertical:l,horizontal:c}={vertical:"bottom",horizontal:"left"},autoHideDuration:u=null,children:h,className:p,ClickAwayListenerProps:d,ContentProps:f,disableWindowBlurListener:m=!1,message:g,onBlur:y,onClose:v,onFocus:x,onMouseEnter:b,onMouseLeave:_,open:w,resumeHideDuration:k,slots:T={},slotProps:S={},TransitionComponent:A,transitionDuration:M=a,TransitionProps:{onEnter:E,onExited:C,...P}={},...L}=n,I={...n,anchorOrigin:{vertical:l,horizontal:c},autoHideDuration:u,disableWindowBlurListener:m,TransitionComponent:A,transitionDuration:M},z=(e=>{const{classes:t,anchorOrigin:r}=e;return Wn({root:["root",`anchorOrigin${Oi(r.vertical)}${Oi(r.horizontal)}`]},e_,t)})(I),{getRootProps:O,onClickAway:R}=Wb({...I}),[D,j]=e.useState(!0),F={slots:{transition:A,...T},slotProps:{content:f,clickAwayListener:d,transition:P,...S}},[B,N]=Yi("root",{ref:r,className:[z.root,p],elementType:t_,getSlotProps:O,externalForwardedProps:{...F,...L},ownerState:I}),[U,{ownerState:V,...q}]=Yi("clickAwayListener",{elementType:Zb,externalForwardedProps:F,getSlotProps:e=>({onClickAway:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.onClickAway?.(...r),R(...r)}}),ownerState:I}),[H,G]=Yi("content",{elementType:Qb,shouldForwardComponentProp:!0,externalForwardedProps:F,additionalProps:{message:g,action:o},ownerState:I}),[W,$]=Yi("transition",{elementType:Po,externalForwardedProps:F,getSlotProps:e=>({onEnter:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.onEnter?.(...r),((e,t)=>{j(!1),E&&E(e,t)})(...r)},onExited:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e.onExited?.(...r),(e=>{j(!0),C&&C(e)})(...r)}}),additionalProps:{appear:!0,in:w,timeout:M,direction:"top"===l?"down":"up"},ownerState:I});return!w&&D?null:(0,s.jsx)(U,{...q,...T.clickAwayListener&&{ownerState:V},children:(0,s.jsx)(B,{...N,children:(0,s.jsx)(W,{...$,children:h||(0,s.jsx)(H,{...G})})})})}));function n_(e){return Ai("MuiAlert",e)}const i_=Mi("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),a_=Bi((0,s.jsx)("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),o_=Bi((0,s.jsx)("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),s_=Bi((0,s.jsx)("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),l_=Bi((0,s.jsx)("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),c_=Bi((0,s.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),u_=gi(Pi,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${Oi(r.color||r.severity)}`]]}})(wi((e=>{let{theme:t}=e;const r="light"===t.palette.mode?Ar:Er,n="light"===t.palette.mode?Er:Ar;return{...t.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[i]=e;return{props:{colorSeverity:i,variant:"standard"},style:{color:t.vars?t.vars.palette.Alert[`${i}Color`]:r(t.palette[i].light,.6),backgroundColor:t.vars?t.vars.palette.Alert[`${i}StandardBg`]:n(t.palette[i].light,.9),[`& .${i_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${i}IconColor`]}:{color:t.palette[i].main}}}})),...Object.entries(t.palette).filter(hl(["light"])).map((e=>{let[n]=e;return{props:{colorSeverity:n,variant:"outlined"},style:{color:t.vars?t.vars.palette.Alert[`${n}Color`]:r(t.palette[n].light,.6),border:`1px solid ${(t.vars||t).palette[n].light}`,[`& .${i_.icon}`]:t.vars?{color:t.vars.palette.Alert[`${n}IconColor`]}:{color:t.palette[n].main}}}})),...Object.entries(t.palette).filter(hl(["dark"])).map((e=>{let[r]=e;return{props:{colorSeverity:r,variant:"filled"},style:{fontWeight:t.typography.fontWeightMedium,...t.vars?{color:t.vars.palette.Alert[`${r}FilledColor`],backgroundColor:t.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:"dark"===t.palette.mode?t.palette[r].dark:t.palette[r].main,color:t.palette.getContrastText(t.palette[r].main)}}}}))]}}))),h_=gi("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(e,t)=>t.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),p_=gi("div",{name:"MuiAlert",slot:"Message",overridesResolver:(e,t)=>t.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),d_=gi("div",{name:"MuiAlert",slot:"Action",overridesResolver:(e,t)=>t.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),f_={success:(0,s.jsx)(a_,{fontSize:"inherit"}),warning:(0,s.jsx)(o_,{fontSize:"inherit"}),error:(0,s.jsx)(s_,{fontSize:"inherit"}),info:(0,s.jsx)(l_,{fontSize:"inherit"})},m_=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAlert"}),{action:n,children:i,className:a,closeText:o="Close",color:l,components:c={},componentsProps:u={},icon:h,iconMapping:p=f_,onClose:d,role:f="alert",severity:m="success",slotProps:g={},slots:y={},variant:v="standard",...x}=r,b={...r,color:l,severity:m,variant:v,colorSeverity:l||m},_=(e=>{const{variant:t,color:r,severity:n,classes:i}=e;return Wn({root:["root",`color${Oi(r||n)}`,`${t}${Oi(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]},n_,i)})(b),w={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...y},slotProps:{...u,...g}},[k,T]=Yi("root",{ref:t,shouldForwardComponentProp:!0,className:Gn(_.root,a),elementType:u_,externalForwardedProps:{...w,...x},ownerState:b,additionalProps:{role:f,elevation:0}}),[S,A]=Yi("icon",{className:_.icon,elementType:h_,externalForwardedProps:w,ownerState:b}),[M,E]=Yi("message",{className:_.message,elementType:p_,externalForwardedProps:w,ownerState:b}),[C,P]=Yi("action",{className:_.action,elementType:d_,externalForwardedProps:w,ownerState:b}),[L,I]=Yi("closeButton",{elementType:dc,externalForwardedProps:w,ownerState:b}),[z,O]=Yi("closeIcon",{elementType:c_,externalForwardedProps:w,ownerState:b});return(0,s.jsxs)(k,{...T,children:[!1!==h?(0,s.jsx)(S,{...A,children:h||p[m]||f_[m]}):null,(0,s.jsx)(M,{...E,children:i}),null!=n?(0,s.jsx)(C,{...P,children:n}):null,null==n&&d?(0,s.jsx)(C,{...P,children:(0,s.jsx)(L,{size:"small","aria-label":o,title:o,color:"inherit",onClick:d,...I,children:(0,s.jsx)(z,{fontSize:"small",...O})})}):null]})})),g_=(0,e.forwardRef)(((t,r)=>{let{className:n,sx:i}=t;const[a,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(""),[u,h]=(0,e.useState)("success"),p=(0,e.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"success";setTimeout((()=>{c(e),h(t),o(!0)}))}),[c,h,o]);(0,e.useImperativeHandle)(r,(()=>({setSnack:(e,t)=>{p(e,t)}})));const d=(e,t)=>{"clickaway"!==t&&o(!1)};return(0,s.jsx)(r_,{className:n||"Snack",sx:{...i},open:a,autoHideDuration:"success"===u||"info"===u?1500:6e3,onClose:d,children:(0,s.jsx)(m_,{onClose:d,severity:u,variant:"filled",sx:{width:"100%"},children:l})})}));function y_(e){return Ai("MuiAccordionActions",e)}Mi("MuiAccordionActions",["root","spacing"]);const v_=gi("div",{name:"MuiAccordionActions",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableSpacing&&t.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",variants:[{props:e=>!e.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),x_=e.forwardRef((function(e,t){const r=yi({props:e,name:"MuiAccordionActions"}),{className:n,disableSpacing:i=!1,...a}=r,o={...r,disableSpacing:i},l=(e=>{const{classes:t,disableSpacing:r}=e;return Wn({root:["root",!r&&"spacing"]},y_,t)})(o);return(0,s.jsx)(v_,{className:Gn(l.root,n),ref:t,ownerState:o,...a})})),b_=t=>{let{systemInfo:r}=t;const[n,i]=(0,e.useState)([]),a=e=>e.replace(/\(R\)/g,"\xae").replace(/\(C\)/g,"\xa9").replace(/\(TM\)/g,"\u2122");return(0,e.useEffect)((()=>{if(void 0===r)return;const e=Object.entries(r).flatMap((e=>{let[t,r]=e;return Array.isArray(r)?r.map(((e,r)=>(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsxs)("div",{children:[a(t)," ",r]}),(0,s.jsxs)("div",{children:[a(e.name)," ",e.discrete?`w/ ${Math.round(e.memory/1073741824)}GB RAM`:"(integrated)"]})]},r))):(0,s.jsxs)("div",{className:"SystemInfoItem",children:[(0,s.jsx)("div",{children:a(t)}),(0,s.jsx)("div",{children:a(String(r))})]},t)}));i(e)}),[r]),(0,s.jsx)("div",{className:"SystemInfo",children:n})},__=t=>{let{sessionId:r,setSnack:n,connectionBase:i}=t;const[a,o]=(0,e.useState)(""),[l,c]=(0,e.useState)(void 0),[u,h]=(0,e.useState)([]),[p,d]=(0,e.useState)([]),[f,m]=(0,e.useState)(""),[g,y]=(0,e.useState)(5),[v,x]=(0,e.useState)(void 0);(0,e.useEffect)((()=>{if(void 0===v||f===v.system_prompt||!f.trim()||void 0===r)return;(async e=>{try{const t=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({system_prompt:e})}),a=await t.json();v.system_prompt=a.system_prompt,m(a.system_prompt),n("System prompt updated","success")}catch(t){console.error("Fetch error:",t),n("System prompt update failed","error")}})(f)}),[f,i,r,n,v]),(0,e.useEffect)((()=>{if(void 0===v||g===v.message_history_length||!g||void 0===r)return;(async e=>{try{const t=await fetch(i+`/api/tunables/${r}`,{method:"PUT",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({message_history_length:e})}),a=(await t.json()).message_history_length;a!==g&&(y(a),n("Message history length updated","success"))}catch(t){console.error("Fetch error:",t),n("Message history length update failed","error")}})(g)}),[g,y,i,r,n,v]);(0,e.useEffect)((()=>{void 0===l&&void 0!==r&&fetch(i+`/api/system-info/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>e.json())).then((e=>{c(e)})).catch((e=>{console.error("Error obtaining system information:",e),n("Unable to obtain system information.","error")}))}),[l,c,i,n,r]),(0,e.useEffect)((()=>{o(f.trim())}),[f,o]);(0,e.useEffect)((()=>{if(void 0!==v||void 0===r)return;(async()=>{const e=await fetch(i+`/api/tunables/${r}`,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}),t=await e.json();console.log("Server tunables: ",t),x(t),m(t.system_prompt),y(t.message_history_length),h(t.tools),d(t.rags)})()}),[r,i,x,m,y,v,h,d]);return(0,s.jsx)("div",{className:"Controls",children:(0,s.jsxs)(Jp,{children:[(0,s.jsx)(id,{expandIcon:(0,s.jsx)(Vd,{}),children:(0,s.jsx)(jp,{component:"span",children:"System Information"})}),(0,s.jsx)(sd,{children:"The server is running on the following hardware:"}),(0,s.jsx)(x_,{children:(0,s.jsx)(b_,{systemInfo:l})})]})})};function w_(e){const{className:t,active:r,children:n,sx:i,...a}=e;return(0,s.jsx)(yc,{className:t||"BackstoryTab",sx:{display:r?"flex":"none",...i},...a,children:n})}const k_=()=>{const[t,r]=(0,e.useState)(void 0),[n]=(0,e.useState)((i=window.location).host.match(/.*battle-linux.*/)?i.protocol+"//battle-linux.ketrenos.com:8912":i.protocol+"//"+i.host);var i;const[a,o]=(0,e.useState)(!1),[l,c]=(0,e.useState)(!1),[u,h]=(0,e.useState)(0),[p,d]=(0,e.useState)(""),f=qn("(min-width:650px)"),m=(0,e.useRef)(f),g=(0,e.useRef)(null),y=bi(),v=qn(y.breakpoints.down("md")),x=(0,e.useRef)(null);(0,e.useEffect)((()=>{m.current!==f&&(a&&o(!1),m.current=f)}),[f,o,a]);const b=(0,e.useCallback)(((e,t)=>{var r;null===(r=x.current)||void 0===r||r.setSnack(e,t)}),[x]);(0,e.useEffect)((()=>{if(""!==p)return;(async()=>{try{const e=await fetch("/docs/about.md",{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("/docs/about.md not found");const t=await e.text();d(t)}catch(e){console.error("Error obtaining About content information:",e),d("No information provided.")}})()}),[p,d]);const _=(e,t)=>{var r;console.log(`handleSubmitChatQuery: ${e} ${t||{}} -- `,g.current?" sending":"no handler"),null===(r=g.current)||void 0===r||r.submitQuery(e,t),h(0)},w=(0,e.useMemo)((()=>{const e=[{role:"content",title:"Welcome to Backstory",disableCopy:!0,content:"\n Backstory is a RAG enabled expert system with access to real-time data running self-hosted\n (no cloud) versions of industry leading Large and Small Language Models (LLM/SLMs).\n It was written by James Ketrenos in order to provide answers to\n questions potential employers may have about his work history.\n \n What would you like to know about James?\n "}],r=[(0,s.jsxs)(yc,{sx:{display:"flex",flexDirection:v?"column":"row"},children:[(0,s.jsx)(Pu,{prompt:"What is James Ketrenos' work history?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What programming languages has James used?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What are James' professional strengths?",tunables:{enable_tools:!1},submitQuery:_}),(0,s.jsx)(Pu,{prompt:"What are today's headlines on CNBC.com?",tunables:{enable_tools:!0,enable_rag:!1,enable_context:!1},submitQuery:_})]}),(0,s.jsx)(yc,{sx:{p:1},children:(0,s.jsx)(Vx,{children:"As with all LLM interactions, the results may not be 100% accurate. If you have questions about my career, I'd love to hear from you. You can send me an email at **james_backstory@ketrenos.com**."})})];return[{label:"",path:"",tabProps:{label:"Backstory",sx:{flexGrow:1,fontSize:"1rem"},icon:(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),iconPosition:"start"},children:(0,s.jsx)(xb,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},children:(0,s.jsx)(Hb,{ref:g,type:"chat",prompt:"What would you like to know about James?",resetLabel:"chat",sessionId:t,connectionBase:n,setSnack:b,preamble:e,defaultPrompts:r})})},{label:"Resume Builder",path:"resume-builder",children:(0,s.jsx)(Gb,{sx:{margin:"0 auto",height:"calc(100vh - 72px)",overflow:"auto",backgroundColor:"#F5F5F5",display:"flex",flexGrow:1},setSnack:b,connectionBase:n,sessionId:t})},{label:"Context Visualizer",path:"context-visualizer",children:(0,s.jsx)(xb,{sx:{maxWidth:"1024px",height:"calc(100vh - 72px)"},children:(0,s.jsx)(pb,{sx:{p:1},connectionBase:n,sessionId:t,setSnack:b})})},{label:"About",path:"about",children:(0,s.jsxs)(xb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:[(0,s.jsx)(yb,{sx:{display:"flex",flexDirection:"column",p:1,m:0,flexGrow:0},message:{role:"content",title:"About Backstory",content:p},submitQuery:_,connectionBase:n,sessionId:t,setSnack:b}),(0,s.jsx)(yc,{sx:{display:"flex",flexGrow:1,p:0,m:0}})]})},{path:"settings",tabProps:{sx:{flexShrink:1,flexGrow:0,fontSize:"1rem"},icon:(0,s.jsx)(Jl,{})},children:(0,s.jsx)(xb,{autoscroll:!1,sx:{maxWidth:"1024px",height:"calc(100vh - 72px)",flexDirection:"column",margin:"0 auto",p:1},children:void 0!==t&&(0,s.jsx)(__,{sessionId:t,setSnack:b,connectionBase:n})})}]}),[p,n,t,b,v]);(0,e.useEffect)((()=>{const e=new URL(window.location.href).pathname.split("/").filter(Boolean);if(e.length<1)console.log("No session id or path -- creating new session"),(async()=>{try{const e=await fetch(n+"/api/context",{method:"POST",headers:{"Content-Type":"application/json"}});if(!e.ok)throw Error("Server is temporarily down.");const t=await e.json();console.log(`Session created: ${t.id}`),r(t.id);const i=`/${t.id}`;window.history.replaceState({},"",i)}catch(e){console.error(e),b("Server is temporarily down","error")}})();else{const t=e.length<2?"":e[0],n=e.length<2?e[0]:e[1];let i=w.findIndex((e=>e.path===t));-1===i&&(console.log(`Invalid path "${t}" -- redirecting to default`),i=0),r(n),h(i)}}),[r,n,b,w]);const k=()=>{c(!0),o(!1)},T=(e,r)=>{if(r>w.length)return;h(r);const n=w[r].path;n?window.history.pushState({},"",`/${n}/${t}`):window.history.pushState({},"",`/${t}`),k()};(0,e.useEffect)((()=>{const e=()=>{const e=new URL(window.location.href).pathname.split("/").filter(Boolean),t=e.length<2?"":e[0],n=e.length<2?e[0]:e[1];let i=w.findIndex((e=>e.path===t));-1===i&&(console.log(`Invalid path "${t}" -- redirecting to default`),i=0),r(n),h(i)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)}),[r,w]);const S=gi("div")((()=>({minHeight:"72px",height:"72px"})));return(0,s.jsxs)(yc,{className:"App",sx:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)(Mc,{}),(0,s.jsx)(ml,{position:"fixed",sx:{zIndex:e=>e.zIndex.drawer+1,maxWidth:"100vw"},children:(0,s.jsx)(Kl,{children:(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[!f&&(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"row"},children:[(0,s.jsx)(dc,{sx:{display:"flex",margin:"auto 0px"},size:"large",edge:"start",color:"inherit",onClick:()=>{l||o(!a)},children:(0,s.jsx)(ul,{title:"Navigation",children:(0,s.jsx)(Ec,{})})}),(0,s.jsx)(ul,{title:"Backstory",children:(0,s.jsxs)(yc,{sx:{m:1,gap:1,display:"flex",flexDirection:"row",alignItems:"center",fontWeight:"bold",fontSize:"1.0rem",cursor:"pointer"},onClick:()=>{h(0),o(!1)},children:[(0,s.jsx)(ea,{sx:{width:24,height:24},variant:"rounded",alt:"Backstory logo",src:"/logo192.png"}),"BACKSTORY"]})})]}),!1===a&&f&&(0,s.jsx)(so,{sx:{display:"flex",flexGrow:1},value:u,indicatorColor:"secondary",textColor:"inherit",variant:"fullWidth",allowScrollButtonsMobile:!0,onChange:T,"aria-label":"Backstory navigation",children:w.map(((e,t)=>(0,s.jsx)(ho,{value:t,label:e.label,...e.tabProps},t)))})]})})}),(0,s.jsx)(S,{}),(0,s.jsxs)(yc,{sx:{display:"flex",flexGrow:1,flexDirection:"column"},children:[(0,s.jsx)(yc,{component:"nav","aria-label":"mailbox folders",children:(0,s.jsxs)(Zl,{container:window.document.body,variant:"temporary",open:a,onTransitionEnd:()=>{c(!1)},onClose:k,sx:{display:"block","& .MuiDrawer-paper":{boxSizing:"border-box"}},slotProps:{root:{keepMounted:!0}},children:[(0,s.jsx)(Kl,{}),(0,s.jsx)(zi,{className:"MenuCard",children:(0,s.jsx)(so,{sx:{display:"flex",flexGrow:1},orientation:"vertical",value:u,indicatorColor:"secondary",textColor:"inherit",variant:"scrollable",allowScrollButtonsMobile:!0,onChange:T,"aria-label":"Backstory navigation",children:w.map(((e,t)=>(0,s.jsx)(ho,{value:t,label:e.label,...e.tabProps},t)))})})]})}),w.map(((e,t)=>(0,s.jsx)(w_,{active:t===u,children:e.children},t)))]}),(0,s.jsx)(g_,{ref:x})]})},T_=e=>{e&&e instanceof Function&&r.e(453).then(r.bind(r,453)).then((t=>{let{getCLS:r,getFID:n,getFCP:i,getLCP:a,getTTFB:o}=t;r(e),n(e),i(e),a(e),o(e)}))};n.createRoot(document.getElementById("root")).render((0,s.jsx)(e.StrictMode,{children:(0,s.jsx)(Dn,{theme:jn,children:(0,s.jsx)(k_,{})})})),T_()})()})();
//# sourceMappingURL=main.6f07f748.js.map