var vG=Object.defineProperty;var yG=(e,t,n)=>t in e?vG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Bn=(e,t,n)=>(yG(e,typeof t!="symbol"?t+"":t,n),n);function zL(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function LE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w={exports:{}},fr={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Rv=Symbol.for("react.element"),xG=Symbol.for("react.portal"),bG=Symbol.for("react.fragment"),_G=Symbol.for("react.strict_mode"),wG=Symbol.for("react.profiler"),CG=Symbol.for("react.provider"),SG=Symbol.for("react.context"),EG=Symbol.for("react.forward_ref"),PG=Symbol.for("react.suspense"),IG=Symbol.for("react.memo"),TG=Symbol.for("react.lazy"),KM=Symbol.iterator;function kG(e){return e===null||typeof e!="object"?null:(e=KM&&e[KM]||e["@@iterator"],typeof e=="function"?e:null)}var $L={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},BL=Object.assign,VL={};function hp(e,t,n){this.props=e,this.context=t,this.refs=VL,this.updater=n||$L}hp.prototype.isReactComponent={};hp.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};hp.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function UL(){}UL.prototype=hp.prototype;function FE(e,t,n){this.props=e,this.context=t,this.refs=VL,this.updater=n||$L}var zE=FE.prototype=new UL;zE.constructor=FE;BL(zE,hp.prototype);zE.isPureReactComponent=!0;var WM=Array.isArray,jL=Object.prototype.hasOwnProperty,$E={current:null},HL={key:!0,ref:!0,__self:!0,__source:!0};function KL(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)jL.call(t,r)&&!HL.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,xe=oe[be];if(0>>1;bei(Ce,_e))kei(De,Ce)?(oe[be]=De,oe[ke]=_e,be=ke):(oe[be]=Ce,oe[Ee]=_e,be=Ee);else if(kei(De,_e))oe[be]=De,oe[ke]=_e,be=ke;else break e}}return he}function i(oe,he){var _e=oe.sortIndex-he.sortIndex;return _e!==0?_e:oe.id-he.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],p=1,m=null,v=3,x=!1,_=!1,P=!1,k=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(oe){for(var he=n(d);he!==null;){if(he.callback===null)r(d);else if(he.startTime<=oe)r(d),he.sortIndex=he.expirationTime,t(u,he);else break;he=n(d)}}function N(oe){if(P=!1,O(oe),!_)if(n(u)!==null)_=!0,ne(L);else{var he=n(d);he!==null&&se(N,he.startTime-oe)}}function L(oe,he){_=!1,P&&(P=!1,T(B),B=-1),x=!0;var _e=v;try{for(O(he),m=n(u);m!==null&&(!(m.expirationTime>he)||oe&&!ee());){var be=m.callback;if(typeof be=="function"){m.callback=null,v=m.priorityLevel;var xe=be(m.expirationTime<=he);he=e.unstable_now(),typeof xe=="function"?m.callback=xe:m===n(u)&&r(u),O(he)}else r(u);m=n(u)}if(m!==null)var Te=!0;else{var Ee=n(d);Ee!==null&&se(N,Ee.startTime-he),Te=!1}return Te}finally{m=null,v=_e,x=!1}}var F=!1,V=null,B=-1,H=5,G=-1;function ee(){return!(e.unstable_now()-Goe||125be?(oe.sortIndex=_e,t(d,oe),n(u)===null&&oe===n(d)&&(P?(T(B),B=-1):P=!0,se(N,_e-be))):(oe.sortIndex=xe,t(u,oe),_||x||(_=!0,ne(L))),oe},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(oe){var he=v;return function(){var _e=v;v=he;try{return oe.apply(this,arguments)}finally{v=_e}}}})(GL);(function(e){e.exports=GL})(WL);/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var qL=w.exports,Fa=WL.exports;function Jt(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),V2=Object.prototype.hasOwnProperty,OG=/^[: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]*$/,qM={},ZM={};function NG(e){return V2.call(ZM,e)?!0:V2.call(qM,e)?!1:OG.test(e)?ZM[e]=!0:(qM[e]=!0,!1)}function LG(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function FG(e,t,n,r){if(t===null||typeof t>"u"||LG(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function qo(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var vo={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vo[e]=new qo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];vo[t]=new qo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){vo[e]=new qo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vo[e]=new qo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){vo[e]=new qo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){vo[e]=new qo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){vo[e]=new qo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){vo[e]=new qo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){vo[e]=new qo(e,5,!1,e.toLowerCase(),null,!1,!1)});var VE=/[\-:]([a-z])/g;function UE(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(VE,UE);vo[t]=new qo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(VE,UE);vo[t]=new qo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(VE,UE);vo[t]=new qo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){vo[e]=new qo(e,1,!1,e.toLowerCase(),null,!1,!1)});vo.xlinkHref=new qo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){vo[e]=new qo(e,1,!1,e.toLowerCase(),null,!0,!0)});function jE(e,t,n,r){var i=vo.hasOwnProperty(t)?vo[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var u=` `+i[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{A4=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?eg(e):""}function zG(e){switch(e.tag){case 5:return eg(e.type);case 16:return eg("Lazy");case 13:return eg("Suspense");case 19:return eg("SuspenseList");case 0:case 2:case 15:return e=D4(e.type,!1),e;case 11:return e=D4(e.type.render,!1),e;case 1:return e=D4(e.type,!0),e;default:return""}}function K2(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case dh:return"Fragment";case ch:return"Portal";case U2:return"Profiler";case HE:return"StrictMode";case j2:return"Suspense";case H2:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case YL:return(e.displayName||"Context")+".Consumer";case XL:return(e._context.displayName||"Context")+".Provider";case KE:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case WE:return t=e.displayName||null,t!==null?t:K2(e.type)||"Memo";case qu:t=e._payload,e=e._init;try{return K2(e(t))}catch{}}return null}function $G(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K2(t);case 8:return t===HE?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function JL(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function BG(e){var t=JL(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Py(e){e._valueTracker||(e._valueTracker=BG(e))}function e8(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=JL(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function y1(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function W2(e,t){var n=t.checked;return mi({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function YM(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pc(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function t8(e,t){t=t.checked,t!=null&&jE(e,"checked",t,!1)}function G2(e,t){t8(e,t);var n=Pc(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?q2(e,t.type,n):t.hasOwnProperty("defaultValue")&&q2(e,t.type,Pc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function QM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function q2(e,t,n){(t!=="number"||y1(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var tg=Array.isArray;function Ph(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Iy.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $g(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hg={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},VG=["Webkit","ms","Moz","O"];Object.keys(hg).forEach(function(e){VG.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),hg[t]=hg[e]})});function o8(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||hg.hasOwnProperty(e)&&hg[e]?(""+t).trim():t+"px"}function a8(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=o8(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var UG=mi({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Y2(e,t){if(t){if(UG[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Jt(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Jt(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Jt(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Jt(62))}}function Q2(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 J2=null;function GE(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var eS=null,Ih=null,Th=null;function tR(e){if(e=Ov(e)){if(typeof eS!="function")throw Error(Jt(280));var t=e.stateNode;t&&(t=Zb(t),eS(e.stateNode,e.type,t))}}function s8(e){Ih?Th?Th.push(e):Th=[e]:Ih=e}function l8(){if(Ih){var e=Ih,t=Th;if(Th=Ih=null,tR(e),t)for(e=0;e>>=0,e===0?32:31-(JG(e)/eq|0)|0}var Ty=64,ky=4194304;function ng(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function w1(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=ng(a):(o&=s,o!==0&&(r=ng(o)))}else s=n&~i,s!==0?r=ng(s):o!==0&&(r=ng(o));if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Av(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$s(t),e[t]=n}function iq(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=mg),cR=String.fromCharCode(32),dR=!1;function T8(e,t){switch(e){case"keyup":return Aq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function k8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fh=!1;function Oq(e,t){switch(e){case"compositionend":return k8(t);case"keypress":return t.which!==32?null:(dR=!0,cR);case"textInput":return e=t.data,e===cR&&dR?null:e;default:return null}}function Nq(e,t){if(fh)return e==="compositionend"||!tP&&T8(e,t)?(e=P8(),Fx=QE=ec=null,fh=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=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=mR(n)}}function D8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?D8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function O8(){for(var e=window,t=y1();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=y1(e.document)}return t}function nP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Hq(e){var t=O8(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&D8(n.ownerDocument.documentElement,n)){if(r!==null&&nP(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=gR(n,o);var s=gR(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,hh=null,aS=null,vg=null,sS=!1;function vR(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;sS||hh==null||hh!==y1(r)||(r=hh,"selectionStart"in r&&nP(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),vg&&Kg(vg,r)||(vg=r,r=E1(aS,"onSelect"),0gh||(e.current=hS[gh],hS[gh]=null,gh--)}function Jr(e,t){gh++,hS[gh]=e.current,e.current=t}var Ic={},ko=Nc(Ic),fa=Nc(!1),Xd=Ic;function Vh(e,t){var n=e.type.contextTypes;if(!n)return Ic;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function ha(e){return e=e.childContextTypes,e!=null}function I1(){ni(fa),ni(ko)}function SR(e,t,n){if(ko.current!==Ic)throw Error(Jt(168));Jr(ko,t),Jr(fa,n)}function j8(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(Jt(108,$G(e)||"Unknown",i));return mi({},n,r)}function T1(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ic,Xd=ko.current,Jr(ko,e),Jr(fa,fa.current),!0}function ER(e,t,n){var r=e.stateNode;if(!r)throw Error(Jt(169));n?(e=j8(e,t,Xd),r.__reactInternalMemoizedMergedChildContext=e,ni(fa),ni(ko),Jr(ko,e)):ni(fa),Jr(fa,n)}var Ql=null,Xb=!1,G4=!1;function H8(e){Ql===null?Ql=[e]:Ql.push(e)}function nZ(e){Xb=!0,H8(e)}function Lc(){if(!G4&&Ql!==null){G4=!0;var e=0,t=Or;try{var n=Ql;for(Or=1;e>=s,i-=s,iu=1<<32-$s(t)+i|n<B?(H=V,V=null):H=V.sibling;var G=v(T,V,O[B],N);if(G===null){V===null&&(V=H);break}e&&V&&G.alternate===null&&t(T,V),M=o(G,M,B),F===null?L=G:F.sibling=G,F=G,V=H}if(B===O.length)return n(T,V),si&&bd(T,B),L;if(V===null){for(;BB?(H=V,V=null):H=V.sibling;var ee=v(T,V,G.value,N);if(ee===null){V===null&&(V=H);break}e&&V&&ee.alternate===null&&t(T,V),M=o(ee,M,B),F===null?L=ee:F.sibling=ee,F=ee,V=H}if(G.done)return n(T,V),si&&bd(T,B),L;if(V===null){for(;!G.done;B++,G=O.next())G=m(T,G.value,N),G!==null&&(M=o(G,M,B),F===null?L=G:F.sibling=G,F=G);return si&&bd(T,B),L}for(V=r(T,V);!G.done;B++,G=O.next())G=x(V,T,B,G.value,N),G!==null&&(e&&G.alternate!==null&&V.delete(G.key===null?B:G.key),M=o(G,M,B),F===null?L=G:F.sibling=G,F=G);return e&&V.forEach(function(X){return t(T,X)}),si&&bd(T,B),L}function k(T,M,O,N){if(typeof O=="object"&&O!==null&&O.type===dh&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case Ey:e:{for(var L=O.key,F=M;F!==null;){if(F.key===L){if(L=O.type,L===dh){if(F.tag===7){n(T,F.sibling),M=i(F,O.props.children),M.return=T,T=M;break e}}else if(F.elementType===L||typeof L=="object"&&L!==null&&L.$$typeof===qu&&AR(L)===F.type){n(T,F.sibling),M=i(F,O.props),M.ref=Am(T,F,O),M.return=T,T=M;break e}n(T,F);break}else t(T,F);F=F.sibling}O.type===dh?(M=jd(O.props.children,T.mode,N,O.key),M.return=T,T=M):(N=Kx(O.type,O.key,O.props,null,T.mode,N),N.ref=Am(T,M,O),N.return=T,T=N)}return s(T);case ch:e:{for(F=O.key;M!==null;){if(M.key===F)if(M.tag===4&&M.stateNode.containerInfo===O.containerInfo&&M.stateNode.implementation===O.implementation){n(T,M.sibling),M=i(M,O.children||[]),M.return=T,T=M;break e}else{n(T,M);break}else t(T,M);M=M.sibling}M=tC(O,T.mode,N),M.return=T,T=M}return s(T);case qu:return F=O._init,k(T,M,F(O._payload),N)}if(tg(O))return _(T,M,O,N);if(Im(O))return P(T,M,O,N);Ly(T,O)}return typeof O=="string"&&O!==""||typeof O=="number"?(O=""+O,M!==null&&M.tag===6?(n(T,M.sibling),M=i(M,O),M.return=T,T=M):(n(T,M),M=eC(O,T.mode,N),M.return=T,T=M),s(T)):n(T,M)}return k}var jh=Q8(!0),J8=Q8(!1),Nv={},ml=Nc(Nv),Zg=Nc(Nv),Xg=Nc(Nv);function Ad(e){if(e===Nv)throw Error(Jt(174));return e}function dP(e,t){switch(Jr(Xg,t),Jr(Zg,e),Jr(ml,Nv),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:X2(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=X2(t,e)}ni(ml),Jr(ml,t)}function Hh(){ni(ml),ni(Zg),ni(Xg)}function eF(e){Ad(Xg.current);var t=Ad(ml.current),n=X2(t,e.type);t!==n&&(Jr(Zg,e),Jr(ml,n))}function fP(e){Zg.current===e&&(ni(ml),ni(Zg))}var hi=Nc(0);function O1(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var q4=[];function hP(){for(var e=0;en?n:4,e(!0);var r=Z4.transition;Z4.transition={};try{e(!1),t()}finally{Or=n,Z4.transition=r}}function gF(){return hs().memoizedState}function aZ(e,t,n){var r=yc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vF(e))yF(t,n);else if(n=q8(e,t,n,r),n!==null){var i=Wo();Bs(n,e,r,i),xF(n,t,r)}}function sZ(e,t,n){var r=yc(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vF(e))yF(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,Us(a,s)){var u=t.interleaved;u===null?(i.next=i,uP(t)):(i.next=u.next,u.next=i),t.interleaved=i;return}}catch{}finally{}n=q8(e,t,i,r),n!==null&&(i=Wo(),Bs(n,e,r,i),xF(n,t,r))}}function vF(e){var t=e.alternate;return e===pi||t!==null&&t===pi}function yF(e,t){yg=N1=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function xF(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ZE(e,n)}}var L1={readContext:fs,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useInsertionEffect:So,useLayoutEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useMutableSource:So,useSyncExternalStore:So,useId:So,unstable_isNewReconciler:!1},lZ={readContext:fs,useCallback:function(e,t){return al().memoizedState=[e,t===void 0?null:t],e},useContext:fs,useEffect:OR,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Vx(4194308,4,dF.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vx(4194308,4,e,t)},useInsertionEffect:function(e,t){return Vx(4,2,e,t)},useMemo:function(e,t){var n=al();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=al();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=aZ.bind(null,pi,e),[r.memoizedState,e]},useRef:function(e){var t=al();return e={current:e},t.memoizedState=e},useState:DR,useDebugValue:yP,useDeferredValue:function(e){return al().memoizedState=e},useTransition:function(){var e=DR(!1),t=e[0];return e=oZ.bind(null,e[1]),al().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pi,i=al();if(si){if(n===void 0)throw Error(Jt(407));n=n()}else{if(n=t(),io===null)throw Error(Jt(349));(Qd&30)!==0||rF(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,OR(oF.bind(null,r,o,e),[e]),r.flags|=2048,Jg(9,iF.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=al(),t=io.identifierPrefix;if(si){var n=ou,r=iu;n=(r&~(1<<32-$s(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Yg++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[cl]=t,e[qg]=r,TF(e,t,!1,!1),t.stateNode=e;e:{switch(s=Q2(n,r),n){case"dialog":ei("cancel",e),ei("close",e),i=r;break;case"iframe":case"object":case"embed":ei("load",e),i=r;break;case"video":case"audio":for(i=0;iWh&&(t.flags|=128,r=!0,Dm(o,!1),t.lanes=4194304)}else{if(!r)if(e=O1(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Dm(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!si)return Eo(t),null}else 2*Ti()-o.renderingStartTime>Wh&&n!==1073741824&&(t.flags|=128,r=!0,Dm(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Ti(),t.sibling=null,n=hi.current,Jr(hi,r?n&1|2:n&1),t):(Eo(t),null);case 22:case 23:return SP(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(Ta&1073741824)!==0&&(Eo(t),t.subtreeFlags&6&&(t.flags|=8192)):Eo(t),null;case 24:return null;case 25:return null}throw Error(Jt(156,t.tag))}function gZ(e,t){switch(iP(t),t.tag){case 1:return ha(t.type)&&I1(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Hh(),ni(fa),ni(ko),hP(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return fP(t),null;case 13:if(ni(hi),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Jt(340));Uh()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ni(hi),null;case 4:return Hh(),null;case 10:return lP(t.type._context),null;case 22:case 23:return SP(),null;case 24:return null;default:return null}}var zy=!1,To=!1,vZ=typeof WeakSet=="function"?WeakSet:Set,In=null;function bh(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xi(e,t,r)}else n.current=null}function ES(e,t,n){try{n()}catch(r){xi(e,t,r)}}var jR=!1;function yZ(e,t){if(lS=C1,e=O8(),nP(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,d=0,p=0,m=e,v=null;t:for(;;){for(var x;m!==n||i!==0&&m.nodeType!==3||(a=s+i),m!==o||r!==0&&m.nodeType!==3||(u=s+r),m.nodeType===3&&(s+=m.nodeValue.length),(x=m.firstChild)!==null;)v=m,m=x;for(;;){if(m===e)break t;if(v===n&&++d===i&&(a=s),v===o&&++p===r&&(u=s),(x=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=x}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(uS={focusedElem:e,selectionRange:n},C1=!1,In=t;In!==null;)if(t=In,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,In=e;else for(;In!==null;){t=In;try{var _=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var P=_.memoizedProps,k=_.memoizedState,T=t.stateNode,M=T.getSnapshotBeforeUpdate(t.elementType===t.type?P:Ds(t.type,P),k);T.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var O=t.stateNode.containerInfo;O.nodeType===1?O.textContent="":O.nodeType===9&&O.documentElement&&O.removeChild(O.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Jt(163))}}catch(N){xi(t,t.return,N)}if(e=t.sibling,e!==null){e.return=t.return,In=e;break}In=t.return}return _=jR,jR=!1,_}function xg(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&ES(t,n,o)}i=i.next}while(i!==r)}}function Jb(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function PS(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function RF(e){var t=e.alternate;t!==null&&(e.alternate=null,RF(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[cl],delete t[qg],delete t[fS],delete t[eZ],delete t[tZ])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function AF(e){return e.tag===5||e.tag===3||e.tag===4}function HR(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AF(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function IS(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=P1));else if(r!==4&&(e=e.child,e!==null))for(IS(e,t,n),e=e.sibling;e!==null;)IS(e,t,n),e=e.sibling}function TS(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(TS(e,t,n),e=e.sibling;e!==null;)TS(e,t,n),e=e.sibling}var ho=null,Os=!1;function Vu(e,t,n){for(n=n.child;n!==null;)DF(e,t,n),n=n.sibling}function DF(e,t,n){if(pl&&typeof pl.onCommitFiberUnmount=="function")try{pl.onCommitFiberUnmount(Kb,n)}catch{}switch(n.tag){case 5:To||bh(n,t);case 6:var r=ho,i=Os;ho=null,Vu(e,t,n),ho=r,Os=i,ho!==null&&(Os?(e=ho,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ho.removeChild(n.stateNode));break;case 18:ho!==null&&(Os?(e=ho,n=n.stateNode,e.nodeType===8?W4(e.parentNode,n):e.nodeType===1&&W4(e,n),jg(e)):W4(ho,n.stateNode));break;case 4:r=ho,i=Os,ho=n.stateNode.containerInfo,Os=!0,Vu(e,t,n),ho=r,Os=i;break;case 0:case 11:case 14:case 15:if(!To&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&ES(n,t,s),i=i.next}while(i!==r)}Vu(e,t,n);break;case 1:if(!To&&(bh(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){xi(n,t,a)}Vu(e,t,n);break;case 21:Vu(e,t,n);break;case 22:n.mode&1?(To=(r=To)||n.memoizedState!==null,Vu(e,t,n),To=r):Vu(e,t,n);break;default:Vu(e,t,n)}}function KR(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vZ),t.forEach(function(r){var i=IZ.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function ks(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=Ti()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bZ(r/1960))-r,10e?16:e,tc===null)var r=!1;else{if(e=tc,tc=null,$1=0,(_r&6)!==0)throw Error(Jt(331));var i=_r;for(_r|=4,In=e.current;In!==null;){var o=In,s=o.child;if((In.flags&16)!==0){var a=o.deletions;if(a!==null){for(var u=0;uTi()-wP?Ud(e,0):_P|=n),pa(e,t)}function VF(e,t){t===0&&((e.mode&1)===0?t=1:(t=ky,ky<<=1,(ky&130023424)===0&&(ky=4194304)));var n=Wo();e=hu(e,t),e!==null&&(Av(e,t,n),pa(e,n))}function PZ(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VF(e,n)}function IZ(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Jt(314))}r!==null&&r.delete(t),VF(e,n)}var UF;UF=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||fa.current)ca=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ca=!1,pZ(e,t,n);ca=(e.flags&131072)!==0}else ca=!1,si&&(t.flags&1048576)!==0&&K8(t,M1,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ux(e,t),e=t.pendingProps;var i=Vh(t,ko.current);Mh(t,n),i=mP(null,t,r,e,i,n);var o=gP();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ha(r)?(o=!0,T1(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,cP(t),i.updater=Yb,t.stateNode=i,i._reactInternals=t,yS(t,r,e,n),t=_S(null,t,r,!0,o,n)):(t.tag=0,si&&o&&rP(t),Ho(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ux(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=kZ(r),e=Ds(r,e),i){case 0:t=bS(null,t,r,e,n);break e;case 1:t=BR(null,t,r,e,n);break e;case 11:t=zR(null,t,r,e,n);break e;case 14:t=$R(null,t,r,Ds(r.type,e),n);break e}throw Error(Jt(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ds(r,i),bS(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ds(r,i),BR(e,t,r,i,n);case 3:e:{if(EF(t),e===null)throw Error(Jt(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Z8(e,t),D1(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Kh(Error(Jt(423)),t),t=VR(e,t,r,n,i);break e}else if(r!==i){i=Kh(Error(Jt(424)),t),t=VR(e,t,r,n,i);break e}else for(ka=mc(t.stateNode.containerInfo.firstChild),Oa=t,si=!0,Ls=null,n=J8(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Uh(),r===i){t=pu(e,t,n);break e}Ho(e,t,r,n)}t=t.child}return t;case 5:return eF(t),e===null&&mS(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,cS(r,i)?s=null:o!==null&&cS(r,o)&&(t.flags|=32),SF(e,t),Ho(e,t,s,n),t.child;case 6:return e===null&&mS(t),null;case 13:return PF(e,t,n);case 4:return dP(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=jh(t,null,r,n):Ho(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ds(r,i),zR(e,t,r,i,n);case 7:return Ho(e,t,t.pendingProps,n),t.child;case 8:return Ho(e,t,t.pendingProps.children,n),t.child;case 12:return Ho(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,Jr(R1,r._currentValue),r._currentValue=s,o!==null)if(Us(o.value,s)){if(o.children===i.children&&!fa.current){t=pu(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(o.tag===1){u=su(-1,n&-n),u.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?u.next=u:(u.next=p.next,p.next=u),d.pending=u}}o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),gS(o.return,n,t),a.lanes|=n;break}u=u.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(Jt(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),gS(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Ho(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Mh(t,n),i=fs(i),r=r(i),t.flags|=1,Ho(e,t,r,n),t.child;case 14:return r=t.type,i=Ds(r,t.pendingProps),i=Ds(r.type,i),$R(e,t,r,i,n);case 15:return wF(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Ds(r,i),Ux(e,t),t.tag=1,ha(r)?(e=!0,T1(t)):e=!1,Mh(t,n),Y8(t,r,i),yS(t,r,i,n),_S(null,t,r,!0,e,n);case 19:return IF(e,t,n);case 22:return CF(e,t,n)}throw Error(Jt(156,t.tag))};function jF(e,t){return m8(e,t)}function TZ(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function as(e,t,n,r){return new TZ(e,t,n,r)}function PP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function kZ(e){if(typeof e=="function")return PP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===KE)return 11;if(e===WE)return 14}return 2}function xc(e,t){var n=e.alternate;return n===null?(n=as(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Kx(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")PP(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case dh:return jd(n.children,i,o,t);case HE:s=8,i|=8;break;case U2:return e=as(12,n,t,i|2),e.elementType=U2,e.lanes=o,e;case j2:return e=as(13,n,t,i),e.elementType=j2,e.lanes=o,e;case H2:return e=as(19,n,t,i),e.elementType=H2,e.lanes=o,e;case QL:return t_(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case XL:s=10;break e;case YL:s=9;break e;case KE:s=11;break e;case WE:s=14;break e;case qu:s=16,r=null;break e}throw Error(Jt(130,e==null?e:typeof e,""))}return t=as(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function jd(e,t,n,r){return e=as(7,e,r,t),e.lanes=n,e}function t_(e,t,n,r){return e=as(22,e,r,t),e.elementType=QL,e.lanes=n,e.stateNode={isHidden:!1},e}function eC(e,t,n){return e=as(6,e,null,t),e.lanes=n,e}function tC(e,t,n){return t=as(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function MZ(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=N4(0),this.expirationTimes=N4(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=N4(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function IP(e,t,n,r,i,o,s,a,u){return e=new MZ(e,t,n,a,u),t===1?(t=1,o===!0&&(t|=8)):t=0,o=as(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cP(o),e}function RZ(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=Ba})(Cl);const Tc=LE(Cl.exports),LZ=zL({__proto__:null,default:Tc},[Cl.exports]);var JR=Cl.exports;B2.createRoot=JR.createRoot,B2.hydrateRoot=JR.hydrateRoot;class gp{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const tv=typeof window>"u"||"Deno"in window;function ts(){}function FZ(e,t){return typeof e=="function"?e(t):e}function DS(e){return typeof e=="number"&&e>=0&&e!==1/0}function GF(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ig(e,t,n){return Lv(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function zZ(e,t,n){return Lv(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Xu(e,t,n){return Lv(e)?[{...t,queryKey:e},n]:[e||{},t]}function eA(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(Lv(s)){if(r){if(t.queryHash!==RP(s,t.options))return!1}else if(!U1(t.queryKey,s))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof i<"u"&&i!==t.state.fetchStatus||o&&!o(t))}function tA(e,t){const{exact:n,fetching:r,predicate:i,mutationKey:o}=e;if(Lv(o)){if(!t.options.mutationKey)return!1;if(n){if(Dd(t.options.mutationKey)!==Dd(o))return!1}else if(!U1(t.options.mutationKey,o))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||i&&!i(t))}function RP(e,t){return((t==null?void 0:t.queryKeyHashFn)||Dd)(e)}function Dd(e){return JSON.stringify(e,(t,n)=>NS(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function U1(e,t){return qF(e,t)}function qF(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!qF(e[n],t[n])):!1}function ZF(e,t){if(e===t)return e;const n=nA(e)&&nA(t);if(n||NS(e)&&NS(t)){const r=n?e.length:Object.keys(e).length,i=n?t:Object.keys(t),o=i.length,s=n?[]:{};let a=0;for(let u=0;u"u")return!0;const n=t.prototype;return!(!rA(n)||!n.hasOwnProperty("isPrototypeOf"))}function rA(e){return Object.prototype.toString.call(e)==="[object Object]"}function Lv(e){return Array.isArray(e)}function XF(e){return new Promise(t=>{setTimeout(t,e)})}function iA(e){XF(0).then(e)}function $Z(){if(typeof AbortController=="function")return new AbortController}function LS(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?ZF(e,t):t}class BZ extends gp{constructor(){super(),this.setup=t=>{if(!tv&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const j1=new BZ;class VZ extends gp{constructor(){super(),this.setup=t=>{if(!tv&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const H1=new VZ;function UZ(e){return Math.min(1e3*2**e,3e4)}function a_(e){return(e!=null?e:"online")==="online"?H1.isOnline():!0}class YF{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Wx(e){return e instanceof YF}function QF(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((k,T)=>{o=k,s=T}),u=k=>{r||(x(new YF(k)),e.abort==null||e.abort())},d=()=>{t=!0},p=()=>{t=!1},m=()=>!j1.isFocused()||e.networkMode!=="always"&&!H1.isOnline(),v=k=>{r||(r=!0,e.onSuccess==null||e.onSuccess(k),i==null||i(),o(k))},x=k=>{r||(r=!0,e.onError==null||e.onError(k),i==null||i(),s(k))},_=()=>new Promise(k=>{i=T=>{const M=r||!m();return M&&k(T),M},e.onPause==null||e.onPause()}).then(()=>{i=void 0,r||e.onContinue==null||e.onContinue()}),P=()=>{if(r)return;let k;try{k=e.fn()}catch(T){k=Promise.reject(T)}Promise.resolve(k).then(v).catch(T=>{var M,O;if(r)return;const N=(M=e.retry)!=null?M:3,L=(O=e.retryDelay)!=null?O:UZ,F=typeof L=="function"?L(n,T):L,V=N===!0||typeof N=="number"&&n{if(m())return _()}).then(()=>{t?x(T):P()})})};return a_(e.networkMode)?P():_().then(P),{promise:a,cancel:u,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:d,continueRetry:p}}const AP=console;function jZ(){let e=[],t=0,n=p=>{p()},r=p=>{p()};const i=p=>{let m;t++;try{m=p()}finally{t--,t||a()}return m},o=p=>{t?e.push(p):iA(()=>{n(p)})},s=p=>(...m)=>{o(()=>{p(...m)})},a=()=>{const p=e;e=[],p.length&&iA(()=>{r(()=>{p.forEach(m=>{n(m)})})})};return{batch:i,batchCalls:s,schedule:o,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p}}}const bi=jZ();class JF{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),DS(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:tv?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class HZ extends JF{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||AP,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||KZ(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=LS(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(ts).catch(ts):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!GF(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var o;return(o=this.retryer)==null||o.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const x=this.observers.find(_=>_.options.queryFn);x&&this.setOptions(x.options)}Array.isArray(this.options.queryKey);const s=$Z(),a={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>{if(s)return this.abortSignalConsumed=!0,s.signal}})};u(a);const d=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(a)):Promise.reject("Missing queryFn"),p={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:d};if(u(p),(r=this.options.behavior)==null||r.onFetch(p),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=p.fetchOptions)==null?void 0:i.meta)){var m;this.dispatch({type:"fetch",meta:(m=p.fetchOptions)==null?void 0:m.meta})}const v=x=>{if(Wx(x)&&x.silent||this.dispatch({type:"error",error:x}),!Wx(x)){var _,P;(_=(P=this.cache.config).onError)==null||_.call(P,x,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=QF({fn:p.fetchFn,abort:s==null?void 0:s.abort.bind(s),onSuccess:x=>{var _,P;if(typeof x>"u"){v(new Error("undefined"));return}this.setData(x),(_=(P=this.cache.config).onSuccess)==null||_.call(P,x,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:v,onFail:(x,_)=>{this.dispatch({type:"failed",failureCount:x,error:_})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var i,o;switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=t.meta)!=null?i:null,fetchStatus:a_(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(o=t.dataUpdatedAt)!=null?o:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Wx(s)&&s.revert&&this.revertState?{...this.revertState}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),bi.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function KZ(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class WZ extends gp{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var i;const o=n.queryKey,s=(i=n.queryHash)!=null?i:RP(o,n);let a=this.get(s);return a||(a=new HZ({cache:this,logger:t.getLogger(),queryKey:o,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){bi.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Xu(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(i=>eA(r,i))}findAll(t,n){const[r]=Xu(t,n);return Object.keys(r).length>0?this.queries.filter(i=>eA(r,i)):this.queries}notify(t){bi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){bi.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){bi.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class GZ extends JF{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||AP,this.observers=[],this.state=t.state||ez(),this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}get meta(){return this.options.meta}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var t,n;return(t=(n=this.retryer)==null?void 0:n.continue())!=null?t:this.execute()}async execute(){const t=()=>{var O;return this.retryer=QF({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(N,L)=>{this.dispatch({type:"failed",failureCount:N,error:L})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,o,s,a,u;if(!n){var d,p,m,v;this.dispatch({type:"loading",variables:this.options.variables}),await((d=(p=this.mutationCache.config).onMutate)==null?void 0:d.call(p,this.state.variables,this));const N=await((m=(v=this.options).onMutate)==null?void 0:m.call(v,this.state.variables));N!==this.state.context&&this.dispatch({type:"loading",context:N,variables:this.state.variables})}const O=await t();return await((r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this)),await((o=(s=this.options).onSuccess)==null?void 0:o.call(s,O,this.state.variables,this.state.context)),await((a=(u=this.options).onSettled)==null?void 0:a.call(u,O,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:O}),O}catch(O){try{var x,_,P,k,T,M;throw await((x=(_=this.mutationCache.config).onError)==null?void 0:x.call(_,O,this.state.variables,this.state.context,this)),await((P=(k=this.options).onError)==null?void 0:P.call(k,O,this.state.variables,this.state.context)),await((T=(M=this.options).onSettled)==null?void 0:T.call(M,void 0,O,this.state.variables,this.state.context)),O}finally{this.dispatch({type:"error",error:O})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!a_(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),bi.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function ez(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class qZ extends gp{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const i=new GZ({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){bi.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>tA(t,n))}findAll(t){return this.mutations.filter(n=>tA(t,n))}notify(t){bi.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){var t;return this.resuming=((t=this.resuming)!=null?t:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return bi.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(ts)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function ZZ(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,i,o,s;const a=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,u=(r=e.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,d=u==null?void 0:u.pageParam,p=(u==null?void 0:u.direction)==="forward",m=(u==null?void 0:u.direction)==="backward",v=((o=e.state.data)==null?void 0:o.pages)||[],x=((s=e.state.data)==null?void 0:s.pageParams)||[];let _=x,P=!1;const k=F=>{Object.defineProperty(F,"signal",{enumerable:!0,get:()=>{var V;if((V=e.signal)!=null&&V.aborted)P=!0;else{var B;(B=e.signal)==null||B.addEventListener("abort",()=>{P=!0})}return e.signal}})},T=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),M=(F,V,B,H)=>(_=H?[V,..._]:[..._,V],H?[B,...F]:[...F,B]),O=(F,V,B,H)=>{if(P)return Promise.reject("Cancelled");if(typeof B>"u"&&!V&&F.length)return Promise.resolve(F);const G={queryKey:e.queryKey,pageParam:B,meta:e.options.meta};k(G);const ee=T(G);return Promise.resolve(ee).then(Z=>M(F,B,Z,H))};let N;if(!v.length)N=O([]);else if(p){const F=typeof d<"u",V=F?d:oA(e.options,v);N=O(v,F,V)}else if(m){const F=typeof d<"u",V=F?d:XZ(e.options,v);N=O(v,F,V,!0)}else{_=[];const F=typeof e.options.getNextPageParam>"u";N=(a&&v[0]?a(v[0],0,v):!0)?O([],F,x[0]):Promise.resolve(M([],x[0],v[0]));for(let B=1;B{if(a&&v[B]?a(v[B],B,v):!0){const ee=F?x[B]:oA(e.options,H);return O(H,F,ee)}return Promise.resolve(M(H,x[B],v[B]))})}return N.then(F=>({pages:F,pageParams:_}))}}}}function oA(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function XZ(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class YZ{constructor(t={}){this.queryCache=t.queryCache||new WZ,this.mutationCache=t.mutationCache||new qZ,this.logger=t.logger||AP,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=j1.subscribe(()=>{j1.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=H1.subscribe(()=>{H1.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var t,n;this.mountCount--,this.mountCount===0&&((t=this.unsubscribeFocus)==null||t.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(t,n){const[r]=Xu(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}ensureQueryData(t,n,r){const i=ig(t,n,r),o=this.getQueryData(i.queryKey);return o?Promise.resolve(o):this.fetchQuery(i)}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.queryCache.find(t),o=i==null?void 0:i.state.data,s=FZ(n,o);if(typeof s>"u")return;const a=ig(t),u=this.defaultQueryOptions(a);return this.queryCache.build(this,u).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return bi.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Xu(t,n),i=this.queryCache;bi.batch(()=>{i.findAll(r).forEach(o=>{i.remove(o)})})}resetQueries(t,n,r){const[i,o]=Xu(t,n,r),s=this.queryCache,a={type:"active",...i};return bi.batch(()=>(s.findAll(i).forEach(u=>{u.reset()}),this.refetchQueries(a,o)))}cancelQueries(t,n,r){const[i,o={}]=Xu(t,n,r);typeof o.revert>"u"&&(o.revert=!0);const s=bi.batch(()=>this.queryCache.findAll(i).map(a=>a.cancel(o)));return Promise.all(s).then(ts).catch(ts)}invalidateQueries(t,n,r){const[i,o]=Xu(t,n,r);return bi.batch(()=>{var s,a;if(this.queryCache.findAll(i).forEach(d=>{d.invalidate()}),i.refetchType==="none")return Promise.resolve();const u={...i,type:(s=(a=i.refetchType)!=null?a:i.type)!=null?s:"active"};return this.refetchQueries(u,o)})}refetchQueries(t,n,r){const[i,o]=Xu(t,n,r),s=bi.batch(()=>this.queryCache.findAll(i).filter(u=>!u.isDisabled()).map(u=>{var d;return u.fetch(void 0,{...o,cancelRefetch:(d=o==null?void 0:o.cancelRefetch)!=null?d:!0,meta:{refetchPage:i.refetchPage}})}));let a=Promise.all(s).then(ts);return o!=null&&o.throwOnError||(a=a.catch(ts)),a}fetchQuery(t,n,r){const i=ig(t,n,r),o=this.defaultQueryOptions(i);typeof o.retry>"u"&&(o.retry=!1);const s=this.queryCache.build(this,o);return s.isStaleByTime(o.staleTime)?s.fetch(o):Promise.resolve(s.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(ts).catch(ts)}fetchInfiniteQuery(t,n,r){const i=ig(t,n,r);return i.behavior=ZZ(),this.fetchQuery(i)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(ts).catch(ts)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(i=>Dd(t)===Dd(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>U1(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(i=>Dd(t)===Dd(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>U1(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=RP(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class QZ extends gp{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),aA(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return FS(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return FS(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),OS(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const o=this.hasListeners();o&&sA(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const s=this.computeRefetchInterval();o&&(this.currentQuery!==i||this.options.enabled!==r.enabled||s!==this.currentRefetchInterval)&&this.updateRefetchInterval(s)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ts)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),tv||this.currentResult.isStale||!DS(this.options.staleTime))return;const n=GF(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(tv||this.options.enabled===!1||!DS(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||j1.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,i=this.options,o=this.currentResult,s=this.currentResultState,a=this.currentResultOptions,u=t!==r,d=u?t.state:this.currentQueryInitialState,p=u?this.currentResult:this.previousQueryResult,{state:m}=t;let{dataUpdatedAt:v,error:x,errorUpdatedAt:_,fetchStatus:P,status:k}=m,T=!1,M=!1,O;if(n._optimisticResults){const B=this.hasListeners(),H=!B&&aA(t,n),G=B&&sA(t,r,n,i);(H||G)&&(P=a_(t.options.networkMode)?"fetching":"paused",v||(k="loading")),n._optimisticResults==="isRestoring"&&(P="idle")}if(n.keepPreviousData&&!m.dataUpdatedAt&&p!=null&&p.isSuccess&&k!=="error")O=p.data,v=p.dataUpdatedAt,k=p.status,T=!0;else if(n.select&&typeof m.data<"u")if(o&&m.data===(s==null?void 0:s.data)&&n.select===this.selectFn)O=this.selectResult;else try{this.selectFn=n.select,O=n.select(m.data),O=LS(o==null?void 0:o.data,O,n),this.selectResult=O,this.selectError=null}catch(B){this.selectError=B}else O=m.data;if(typeof n.placeholderData<"u"&&typeof O>"u"&&k==="loading"){let B;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))B=o.data;else if(B=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof B<"u")try{B=n.select(B),this.selectError=null}catch(H){this.selectError=H}typeof B<"u"&&(k="success",O=LS(o==null?void 0:o.data,B,n),M=!0)}this.selectError&&(x=this.selectError,O=this.selectResult,_=Date.now(),k="error");const N=P==="fetching",L=k==="loading",F=k==="error";return{status:k,fetchStatus:P,isLoading:L,isSuccess:k==="success",isError:F,isInitialLoading:L&&N,data:O,dataUpdatedAt:v,error:x,errorUpdatedAt:_,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>d.dataUpdateCount||m.errorUpdateCount>d.errorUpdateCount,isFetching:N,isRefetching:N&&!L,isLoadingError:F&&m.dataUpdatedAt===0,isPaused:P==="paused",isPlaceholderData:M,isPreviousData:T,isRefetchError:F&&m.dataUpdatedAt!==0,isStale:DP(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,OS(r,n))return;this.currentResult=r;const i={cache:!0},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options;if(s==="all"||!s&&!this.trackedProps.size)return!0;const a=new Set(s!=null?s:this.trackedProps);return this.options.useErrorBoundary&&a.add("error"),Object.keys(this.currentResult).some(u=>{const d=u;return this.currentResult[d]!==n[d]&&a.has(d)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),this.notify({...i,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Wx(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){bi.batch(()=>{if(t.onSuccess){var n,r,i,o;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(o=this.options).onSettled)==null||i.call(o,this.currentResult.data,null)}else if(t.onError){var s,a,u,d;(s=(a=this.options).onError)==null||s.call(a,this.currentResult.error),(u=(d=this.options).onSettled)==null||u.call(d,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(p=>{p(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function JZ(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function aA(e,t){return JZ(e,t)||e.state.dataUpdatedAt>0&&FS(e,t,t.refetchOnMount)}function FS(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&DP(e,t)}return!1}function sA(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&DP(e,n)}function DP(e,t){return e.isStaleByTime(t.staleTime)}class eX extends gp{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.client.defaultMutationOptions(t),OS(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:ez(),n={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=n}notify(t){bi.batch(()=>{if(this.mutateOptions&&this.hasListeners()){if(t.onSuccess){var n,r,i,o;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(i=(o=this.mutateOptions).onSettled)==null||i.call(o,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var s,a,u,d;(s=(a=this.mutateOptions).onError)==null||s.call(a,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(u=(d=this.mutateOptions).onSettled)==null||u.call(d,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(p=>{p(this.currentResult)})})}}var OP={exports:{}},tz={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Gh=w.exports;function tX(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nX=typeof Object.is=="function"?Object.is:tX,rX=Gh.useState,iX=Gh.useEffect,oX=Gh.useLayoutEffect,aX=Gh.useDebugValue;function sX(e,t){var n=t(),r=rX({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return oX(function(){i.value=n,i.getSnapshot=t,nC(i)&&o({inst:i})},[e,n,t]),iX(function(){return nC(i)&&o({inst:i}),e(function(){nC(i)&&o({inst:i})})},[e]),aX(n),n}function nC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nX(e,n)}catch{return!0}}function lX(e,t){return t()}var uX=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?lX:sX;tz.useSyncExternalStore=Gh.useSyncExternalStore!==void 0?Gh.useSyncExternalStore:uX;(function(e){e.exports=tz})(OP);const nz=OP.exports.useSyncExternalStore;var s_={exports:{}},l_={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var cX=w.exports,dX=Symbol.for("react.element"),fX=Symbol.for("react.fragment"),hX=Object.prototype.hasOwnProperty,pX=cX.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mX={key:!0,ref:!0,__self:!0,__source:!0};function rz(e,t,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)hX.call(t,r)&&!mX.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:dX,type:e,key:o,ref:s,props:i,_owner:pX.current}}l_.Fragment=fX;l_.jsx=rz;l_.jsxs=rz;(function(e){e.exports=l_})(s_);const Tn=s_.exports.Fragment,I=s_.exports.jsx,$e=s_.exports.jsxs,lA=w.exports.createContext(void 0),iz=w.exports.createContext(!1);function oz(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=lA),window.ReactQueryClientContext):lA)}const ff=({context:e}={})=>{const t=w.exports.useContext(oz(e,w.exports.useContext(iz)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},gX=({client:e,children:t,context:n,contextSharing:r=!1})=>{w.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const i=oz(n,r);return I(iz.Provider,{value:!n&&r,children:I(i.Provider,{value:e,children:t})})},az=w.exports.createContext(!1),vX=()=>w.exports.useContext(az);az.Provider;function yX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const xX=w.exports.createContext(yX()),bX=()=>w.exports.useContext(xX);function sz(e,t){return typeof e=="function"?e(...t):!!e}const _X=(e,t)=>{(e.suspense||e.useErrorBoundary)&&(t.isReset()||(e.retryOnMount=!1))},wX=e=>{w.exports.useEffect(()=>{e.clearReset()},[e])},CX=({result:e,errorResetBoundary:t,useErrorBoundary:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&sz(n,[e.error,r]),SX=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},EX=(e,t)=>e.isLoading&&e.isFetching&&!t,PX=(e,t,n)=>(e==null?void 0:e.suspense)&&EX(t,n),IX=(e,t,n)=>t.fetchOptimistic(e).then(({data:r})=>{e.onSuccess==null||e.onSuccess(r),e.onSettled==null||e.onSettled(r,null)}).catch(r=>{n.clearReset(),e.onError==null||e.onError(r),e.onSettled==null||e.onSettled(void 0,r)});function TX(e,t){const n=ff({context:e.context}),r=vX(),i=bX(),o=n.defaultQueryOptions(e);o._optimisticResults=r?"isRestoring":"optimistic",o.onError&&(o.onError=bi.batchCalls(o.onError)),o.onSuccess&&(o.onSuccess=bi.batchCalls(o.onSuccess)),o.onSettled&&(o.onSettled=bi.batchCalls(o.onSettled)),SX(o),_X(o,i),wX(i);const[s]=w.exports.useState(()=>new t(n,o)),a=s.getOptimisticResult(o);if(nz(w.exports.useCallback(u=>r?()=>{}:s.subscribe(bi.batchCalls(u)),[s,r]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),w.exports.useEffect(()=>{s.setOptions(o,{listeners:!1})},[o,s]),PX(o,a,r))throw IX(o,s,i);if(CX({result:a,errorResetBoundary:i,useErrorBoundary:o.useErrorBoundary,query:s.getCurrentQuery()}))throw a.error;return o.notifyOnChangeProps?a:s.trackResult(a)}function Vi(e,t,n){const r=ig(e,t,n);return TX(r,QZ)}function NP(e,t,n){const r=zZ(e,t,n),i=ff({context:r.context}),[o]=w.exports.useState(()=>new eX(i,r));w.exports.useEffect(()=>{o.setOptions(r)},[o,r]);const s=nz(w.exports.useCallback(u=>o.subscribe(bi.batchCalls(u)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),a=w.exports.useCallback((u,d)=>{o.mutate(u,d).catch(kX)},[o]);if(s.error&&sz(o.options.useErrorBoundary,[s.error]))throw s.error;return{...s,mutate:a,mutateAsync:s.mutate}}function kX(){}function is(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:LP(e)?2:FP(e)?3:0}function zS(e,t){return vp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function MX(e,t){return vp(e)===2?e.get(t):e[t]}function lz(e,t,n){var r=vp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function RX(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function LP(e){return FX&&e instanceof Map}function FP(e){return zX&&e instanceof Set}function to(e){return e.o||e.t}function zP(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=BX(e);delete t[kr];for(var n=UP(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=AX),Object.freeze(e),t&&Zh(e,function(n,r){return $P(r,!0)},!0)),e}function AX(){is(2)}function BP(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function gl(e){var t=BS[e];return t||is(18,e),t}function DX(e,t){BS[e]||(BS[e]=t)}function K1(){return rv}function rC(e,t){t&&(gl("Patches"),e.u=[],e.s=[],e.v=t)}function W1(e){$S(e),e.p.forEach(OX),e.p=null}function $S(e){e===rv&&(rv=e.l)}function uA(e){return rv={p:[],l:rv,h:e,m:!0,_:0}}function OX(e){var t=e[kr];t.i===0||t.i===1?t.j():t.O=!0}function iC(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||gl("ES5").S(t,e,r),r?(n[kr].P&&(W1(t),is(4)),mu(e)&&(e=G1(t,e),t.l||q1(t,e)),t.u&&gl("Patches").M(n[kr].t,e,t.u,t.s)):e=G1(t,n,[]),W1(t),t.u&&t.v(t.u,t.s),e!==uz?e:void 0}function G1(e,t,n){if(BP(t))return t;var r=t[kr];if(!r)return Zh(t,function(a,u){return cA(e,r,t,a,u,n)},!0),t;if(r.A!==e)return t;if(!r.P)return q1(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=zP(r.k):r.o,o=i,s=!1;r.i===3&&(o=new Set(i),i.clear(),s=!0),Zh(o,function(a,u){return cA(e,r,i,a,u,n,s)}),q1(e,i,!1),n&&e.u&&gl("Patches").N(r,n,e.u,e.s)}return r.o}function cA(e,t,n,r,i,o,s){if(qh(i)){var a=G1(e,i,o&&t&&t.i!==3&&!zS(t.R,r)?o.concat(r):void 0);if(lz(n,r,a),!qh(a))return;e.m=!1}else s&&n.add(i);if(mu(i)&&!BP(i)){if(!e.h.D&&e._<1)return;G1(e,i),t&&t.A.l||q1(e,i)}}function q1(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&$P(t,n)}function oC(e,t){var n=e[kr];return(n?to(n):e)[t]}function dA(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Jl(e){e.P||(e.P=!0,e.l&&Jl(e.l))}function aC(e){e.o||(e.o=zP(e.t))}function nv(e,t,n){var r=LP(t)?gl("MapSet").F(t,n):FP(t)?gl("MapSet").T(t,n):e.g?function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:K1(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},u=a,d=VS;s&&(u=[a],d=og);var p=Proxy.revocable(u,d),m=p.revoke,v=p.proxy;return a.k=v,a.j=m,v}(t,n):gl("ES5").J(t,n);return(n?n.A:K1()).p.push(r),r}function NX(e){return qh(e)||is(22,e),function t(n){if(!mu(n))return n;var r,i=n[kr],o=vp(n);if(i){if(!i.P&&(i.i<4||!gl("ES5").K(i)))return i.t;i.I=!0,r=fA(n,o),i.I=!1}else r=fA(n,o);return Zh(r,function(s,a){i&&MX(i.t,s)===a||lz(r,s,t(a))}),o===3?new Set(r):r}(e)}function fA(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return zP(e)}function LX(){function e(a,u){function d(){this.constructor=a}i(a,u),a.prototype=(d.prototype=u.prototype,new d)}function t(a){a.o||(a.R=new Map,a.o=new Map(a.t))}function n(a){a.o||(a.o=new Set,a.t.forEach(function(u){if(mu(u)){var d=nv(a.A.h,u,a);a.p.set(u,d),a.o.add(d)}else a.o.add(u)}))}function r(a){a.O&&is(3,JSON.stringify(to(a)))}var i=function(a,u){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,p){d.__proto__=p}||function(d,p){for(var m in p)p.hasOwnProperty(m)&&(d[m]=p[m])})(a,u)},o=function(){function a(d,p){return this[kr]={i:2,l:p,A:p?p.A:K1(),P:!1,I:!1,o:void 0,R:void 0,t:d,k:this,C:!1,O:!1},this}e(a,Map);var u=a.prototype;return Object.defineProperty(u,"size",{get:function(){return to(this[kr]).size}}),u.has=function(d){return to(this[kr]).has(d)},u.set=function(d,p){var m=this[kr];return r(m),to(m).has(d)&&to(m).get(d)===p||(t(m),Jl(m),m.R.set(d,!0),m.o.set(d,p),m.R.set(d,!0)),this},u.delete=function(d){if(!this.has(d))return!1;var p=this[kr];return r(p),t(p),Jl(p),p.t.has(d)?p.R.set(d,!1):p.R.delete(d),p.o.delete(d),!0},u.clear=function(){var d=this[kr];r(d),to(d).size&&(t(d),Jl(d),d.R=new Map,Zh(d.t,function(p){d.R.set(p,!1)}),d.o.clear())},u.forEach=function(d,p){var m=this;to(this[kr]).forEach(function(v,x){d.call(p,m.get(x),x,m)})},u.get=function(d){var p=this[kr];r(p);var m=to(p).get(d);if(p.I||!mu(m)||m!==p.t.get(d))return m;var v=nv(p.A.h,m,p);return t(p),p.o.set(d,v),v},u.keys=function(){return to(this[kr]).keys()},u.values=function(){var d,p=this,m=this.keys();return(d={})[Vy]=function(){return p.values()},d.next=function(){var v=m.next();return v.done?v:{done:!1,value:p.get(v.value)}},d},u.entries=function(){var d,p=this,m=this.keys();return(d={})[Vy]=function(){return p.entries()},d.next=function(){var v=m.next();if(v.done)return v;var x=p.get(v.value);return{done:!1,value:[v.value,x]}},d},u[Vy]=function(){return this.entries()},a}(),s=function(){function a(d,p){return this[kr]={i:3,l:p,A:p?p.A:K1(),P:!1,I:!1,o:void 0,t:d,k:this,p:new Map,O:!1,C:!1},this}e(a,Set);var u=a.prototype;return Object.defineProperty(u,"size",{get:function(){return to(this[kr]).size}}),u.has=function(d){var p=this[kr];return r(p),p.o?!!p.o.has(d)||!(!p.p.has(d)||!p.o.has(p.p.get(d))):p.t.has(d)},u.add=function(d){var p=this[kr];return r(p),this.has(d)||(n(p),Jl(p),p.o.add(d)),this},u.delete=function(d){if(!this.has(d))return!1;var p=this[kr];return r(p),n(p),Jl(p),p.o.delete(d)||!!p.p.has(d)&&p.o.delete(p.p.get(d))},u.clear=function(){var d=this[kr];r(d),to(d).size&&(n(d),Jl(d),d.o.clear())},u.values=function(){var d=this[kr];return r(d),n(d),d.o.values()},u.entries=function(){var d=this[kr];return r(d),n(d),d.o.entries()},u.keys=function(){return this.values()},u[Vy]=function(){return this.values()},u.forEach=function(d,p){for(var m=this.values(),v=m.next();!v.done;)d.call(p,v.value,v.value,this),v=m.next()},a}();DX("MapSet",{F:function(a,u){return new o(a,u)},T:function(a,u){return new s(a,u)}})}var hA,rv,VP=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",FX=typeof Map<"u",zX=typeof Set<"u",pA=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",uz=VP?Symbol.for("immer-nothing"):((hA={})["immer-nothing"]=!0,hA),mA=VP?Symbol.for("immer-draftable"):"__$immer_draftable",kr=VP?Symbol.for("immer-state"):"__$immer_state",Vy=typeof Symbol<"u"&&Symbol.iterator||"@@iterator",$X=""+Object.prototype.constructor,UP=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,BX=Object.getOwnPropertyDescriptors||function(e){var t={};return UP(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},BS={},VS={get:function(e,t){if(t===kr)return e;var n=to(e);if(!zS(n,t))return function(i,o,s){var a,u=dA(o,s);return u?"value"in u?u.value:(a=u.get)===null||a===void 0?void 0:a.call(i.k):void 0}(e,n,t);var r=n[t];return e.I||!mu(r)?r:r===oC(e.t,t)?(aC(e),e.o[t]=nv(e.A.h,r,e)):r},has:function(e,t){return t in to(e)},ownKeys:function(e){return Reflect.ownKeys(to(e))},set:function(e,t,n){var r=dA(to(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var i=oC(to(e),t),o=i==null?void 0:i[kr];if(o&&o.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(RX(n,i)&&(n!==void 0||zS(e.t,t)))return!0;aC(e),Jl(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return oC(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,aC(e),Jl(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=to(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){is(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){is(12)}},og={};Zh(VS,function(e,t){og[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),og.deleteProperty=function(e,t){return og.set.call(this,e,t,void 0)},og.set=function(e,t,n){return VS.set.call(this,e[0],t,n,e[0])};var VX=function(){function e(n){var r=this;this.g=pA,this.D=!0,this.produce=function(i,o,s){if(typeof i=="function"&&typeof o!="function"){var a=o;o=i;var u=r;return function(P){var k=this;P===void 0&&(P=a);for(var T=arguments.length,M=Array(T>1?T-1:0),O=1;O1?p-1:0),v=1;v=0;i--){var o=r[i];if(o.path.length===0&&o.op==="replace"){n=o.value;break}}i>-1&&(r=r.slice(i+1));var s=gl("Patches").$;return qh(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),za=new VX,UX=za.produce;za.produceWithPatches.bind(za);za.setAutoFreeze.bind(za);za.setUseProxies.bind(za);za.applyPatches.bind(za);za.createDraft.bind(za);za.finishDraft.bind(za);/** * @remix-run/router v1.3.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Z1(){return Z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function HX(){return Math.random().toString(36).substr(2,8)}function vA(e,t){return{usr:e.state,key:e.key,idx:t}}function US(e,t,n,r){return n===void 0&&(n=null),Z1({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?u_(t):t,{state:n,key:t&&t.key||r||HX()})}function cz(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function u_(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function KX(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=nc.Pop,u=null,d=p();d==null&&(d=0,s.replaceState(Z1({},s.state,{idx:d}),""));function p(){return(s.state||{idx:null}).idx}function m(){a=nc.Pop;let k=p(),T=k==null?null:k-d;d=k,u&&u({action:a,location:P.location,delta:T})}function v(k,T){a=nc.Push;let M=US(P.location,k,T);n&&n(M,k),d=p()+1;let O=vA(M,d),N=P.createHref(M);try{s.pushState(O,"",N)}catch{i.location.assign(N)}o&&u&&u({action:a,location:P.location,delta:1})}function x(k,T){a=nc.Replace;let M=US(P.location,k,T);n&&n(M,k),d=p();let O=vA(M,d),N=P.createHref(M);s.replaceState(O,"",N),o&&u&&u({action:a,location:P.location,delta:0})}function _(k){let T=i.location.origin!=="null"?i.location.origin:i.location.href,M=typeof k=="string"?k:cz(k);return ma(T,"No window.location.(origin|href) available to create URL for href: "+M),new URL(M,T)}let P={get action(){return a},get location(){return e(i,s)},listen(k){if(u)throw new Error("A history only accepts one active listener");return i.addEventListener(gA,m),u=k,()=>{i.removeEventListener(gA,m),u=null}},createHref(k){return t(i,k)},createURL:_,encodeLocation(k){let T=_(k);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:v,replace:x,go(k){return s.go(k)}};return P}var yA;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(yA||(yA={}));function WX(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?u_(t):t,i=hz(r.pathname||"/",n);if(i==null)return null;let o=dz(e);GX(o);let s=null;for(let a=0;s==null&&a{let u={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};u.relativePath.startsWith("/")&&(ma(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let d=Ah([r,u.relativePath]),p=n.concat(u);o.children&&o.children.length>0&&(ma(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),dz(o.children,t,p,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:eY(d,o.index),routesMeta:p})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let u of fz(o.path))i(o,s,u)}),t}function fz(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=fz(r.join("/")),a=[];return a.push(...s.map(u=>u===""?o:[o,u].join("/"))),i&&a.push(...s),a.map(u=>e.startsWith("/")&&u===""?"/":u)}function GX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:tY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const qX=/^:\w+$/,ZX=3,XX=2,YX=1,QX=10,JX=-2,xA=e=>e==="*";function eY(e,t){let n=e.split("/"),r=n.length;return n.some(xA)&&(r+=JX),t&&(r+=XX),n.filter(i=>!xA(i)).reduce((i,o)=>i+(qX.test(o)?ZX:o===""?YX:QX),r)}function tY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function nY(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{if(p==="*"){let v=a[m]||"";s=o.slice(0,o.length-v.length).replace(/(.)\/+$/,"$1")}return d[p]=aY(a[m]||"",p),d},{}),pathname:o,pathnameBase:s,pattern:e}}function iY(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),jP(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(s,a)=>(r.push(a),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function oY(e){try{return decodeURI(e)}catch(t){return jP(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function aY(e,t){try{return decodeURIComponent(e)}catch(n){return jP(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+n+").")),e}}function hz(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function jP(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}const Ah=e=>e.join("/").replace(/\/\/+/g,"/"),sY=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/");function lY(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uY=["post","put","patch","delete"];[...uY];/** * React Router v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function jS(){return jS=Object.assign?Object.assign.bind():function(e){for(var t=1;t{i.value=r,i.getSnapshot=t,sC(i)&&o({inst:i})},[e,r,t]),hY(()=>(sC(i)&&o({inst:i}),e(()=>{sC(i)&&o({inst:i})})),[e]),mY(r),r}function sC(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!dY(n,r)}catch{return!0}}function vY(e,t,n){return t()}const yY=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xY=!yY,bY=xY?vY:gY;"useSyncExternalStore"in v1&&(e=>e.useSyncExternalStore)(v1);const pz=w.exports.createContext(null),mz=w.exports.createContext(null),gz=w.exports.createContext(null),c_=w.exports.createContext(null),d_=w.exports.createContext({outlet:null,matches:[]}),vz=w.exports.createContext(null);function HP(){return w.exports.useContext(c_)!=null}function _Y(){return HP()||ma(!1),w.exports.useContext(c_).location}function wY(e,t){HP()||ma(!1);let{navigator:n}=w.exports.useContext(gz),r=w.exports.useContext(mz),{matches:i}=w.exports.useContext(d_),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let a=o?o.pathnameBase:"/";o&&o.route;let u=_Y(),d;if(t){var p;let P=typeof t=="string"?u_(t):t;a==="/"||((p=P.pathname)==null?void 0:p.startsWith(a))||ma(!1),d=P}else d=u;let m=d.pathname||"/",v=a==="/"?m:m.slice(a.length)||"/",x=WX(e,{pathname:v}),_=PY(x&&x.map(P=>Object.assign({},P,{params:Object.assign({},s,P.params),pathname:Ah([a,n.encodeLocation?n.encodeLocation(P.pathname).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?a:Ah([a,n.encodeLocation?n.encodeLocation(P.pathnameBase).pathname:P.pathnameBase])})),i,r||void 0);return t&&_?I(c_.Provider,{value:{location:jS({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:nc.Pop},children:_}):_}function CY(){let e=MY(),t=lY(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null;return $e(Tn,{children:[I("h2",{children:"Unexpected Application Error!"}),I("h3",{style:{fontStyle:"italic"},children:t}),n?I("pre",{style:{padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},children:n}):null,null]})}class SY extends w.exports.Component{constructor(t){super(t),this.state={location:t.location,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location?{error:t.error,location:t.location}:{error:t.error||n.error,location:n.location}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error?I(d_.Provider,{value:this.props.routeContext,children:I(vz.Provider,{value:this.state.error,children:this.props.component})}):this.props.children}}function EY(e){let{routeContext:t,match:n,children:r}=e,i=w.exports.useContext(pz);return i&&i.static&&i.staticContext&&n.route.errorElement&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),I(d_.Provider,{value:t,children:r})}function PY(e,t,n){if(t===void 0&&(t=[]),e==null)if(n!=null&&n.errors)e=n.matches;else return null;let r=e,i=n==null?void 0:n.errors;if(i!=null){let o=r.findIndex(s=>s.route.id&&(i==null?void 0:i[s.route.id]));o>=0||ma(!1),r=r.slice(0,Math.min(r.length,o+1))}return r.reduceRight((o,s,a)=>{let u=s.route.id?i==null?void 0:i[s.route.id]:null,d=n?s.route.errorElement||I(CY,{}):null,p=t.concat(r.slice(0,a+1)),m=()=>I(EY,{match:s,routeContext:{outlet:o,matches:p},children:u?d:s.route.element!==void 0?s.route.element:o});return n&&(s.route.errorElement||a===0)?I(SY,{location:n.location,component:d,error:u,children:m(),routeContext:{outlet:null,matches:p}}):m()},null)}var bA;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator"})(bA||(bA={}));var X1;(function(e){e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator"})(X1||(X1={}));function IY(e){let t=w.exports.useContext(mz);return t||ma(!1),t}function TY(e){let t=w.exports.useContext(d_);return t||ma(!1),t}function kY(e){let t=TY(),n=t.matches[t.matches.length-1];return n.route.id||ma(!1),n.route.id}function MY(){var e;let t=w.exports.useContext(vz),n=IY(X1.UseRouteError),r=kY(X1.UseRouteError);return t||((e=n.errors)==null?void 0:e[r])}function yz(e){ma(!1)}function RY(e){let{basename:t="/",children:n=null,location:r,navigationType:i=nc.Pop,navigator:o,static:s=!1}=e;HP()&&ma(!1);let a=t.replace(/^\/*/,"/"),u=w.exports.useMemo(()=>({basename:a,navigator:o,static:s}),[a,o,s]);typeof r=="string"&&(r=u_(r));let{pathname:d="/",search:p="",hash:m="",state:v=null,key:x="default"}=r,_=w.exports.useMemo(()=>{let P=hz(d,a);return P==null?null:{pathname:P,search:p,hash:m,state:v,key:x}},[a,d,p,m,v,x]);return _==null?null:I(gz.Provider,{value:u,children:I(c_.Provider,{children:n,value:{location:_,navigationType:i}})})}function AY(e){let{children:t,location:n}=e,r=w.exports.useContext(pz),i=r&&!t?r.router.routes:HS(t);return wY(i,n)}var _A;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})(_A||(_A={}));new Promise(()=>{});function HS(e,t){t===void 0&&(t=[]);let n=[];return w.exports.Children.forEach(e,(r,i)=>{if(!w.exports.isValidElement(r))return;if(r.type===w.exports.Fragment){n.push.apply(n,HS(r.props.children,t));return}r.type!==yz&&ma(!1),!r.props.index||!r.props.children||ma(!1);let o=[...t,i],s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(s.children=HS(r.props.children,o)),n.push(s)}),n}/** * React Router DOM v6.8.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function DY(e){let{basename:t,children:n,window:r}=e,i=w.exports.useRef();i.current==null&&(i.current=jX({window:r,v5Compat:!0}));let o=i.current,[s,a]=w.exports.useState({action:o.action,location:o.location});return w.exports.useLayoutEffect(()=>o.listen(a),[o]),I(RY,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:o})}var wA;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmitImpl="useSubmitImpl",e.UseFetcher="useFetcher"})(wA||(wA={}));var CA;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(CA||(CA={}));const iv=(e,t)=>{const[n,r]=w.exports.useState(()=>{let i;try{i=JSON.parse(localStorage.getItem(e)||String(t))}catch{i=t}return i});return w.exports.useEffect(()=>{localStorage.setItem(e,JSON.stringify(n))},[n,e]),[n,r]};var OY="Expected a function",SA=0/0,NY="[object Symbol]",LY=/^\s+|\s+$/g,FY=/^[-+]0x[0-9a-f]+$/i,zY=/^0b[01]+$/i,$Y=/^0o[0-7]+$/i,BY=parseInt,VY=typeof ru=="object"&&ru&&ru.Object===Object&&ru,UY=typeof self=="object"&&self&&self.Object===Object&&self,jY=VY||UY||Function("return this")(),HY=Object.prototype,KY=HY.toString,WY=Math.max,GY=Math.min,lC=function(){return jY.Date.now()};function qY(e,t,n){var r,i,o,s,a,u,d=0,p=!1,m=!1,v=!0;if(typeof e!="function")throw new TypeError(OY);t=EA(t)||0,KS(n)&&(p=!!n.leading,m="maxWait"in n,o=m?WY(EA(n.maxWait)||0,t):o,v="trailing"in n?!!n.trailing:v);function x(F){var V=r,B=i;return r=i=void 0,d=F,s=e.apply(B,V),s}function _(F){return d=F,a=setTimeout(T,t),p?x(F):s}function P(F){var V=F-u,B=F-d,H=t-V;return m?GY(H,o-B):H}function k(F){var V=F-u,B=F-d;return u===void 0||V>=t||V<0||m&&B>=o}function T(){var F=lC();if(k(F))return M(F);a=setTimeout(T,P(F))}function M(F){return a=void 0,v&&r?x(F):(r=i=void 0,s)}function O(){a!==void 0&&clearTimeout(a),d=0,r=u=i=a=void 0}function N(){return a===void 0?s:M(lC())}function L(){var F=lC(),V=k(F);if(r=arguments,i=this,u=F,V){if(a===void 0)return _(u);if(m)return a=setTimeout(T,t),x(u)}return a===void 0&&(a=setTimeout(T,t)),s}return L.cancel=O,L.flush=N,L}function KS(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ZY(e){return!!e&&typeof e=="object"}function XY(e){return typeof e=="symbol"||ZY(e)&&KY.call(e)==NY}function EA(e){if(typeof e=="number")return e;if(XY(e))return SA;if(KS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=KS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(LY,"");var n=zY.test(e);return n||$Y.test(e)?BY(e.slice(2),n?2:8):FY.test(e)?SA:+e}var YY=qY,xz={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ru,function(){var n,r,i;function o(a,u){if(!n)n=u;else if(!r)r=u;else{var d="var sharedChunk = {}; ("+n+")(sharedChunk); ("+r+")(sharedChunk);",p={};n(p),i=u(p),typeof window<"u"&&(i.workerUrl=window.URL.createObjectURL(new Blob([d],{type:"text/javascript"})))}}o(["exports"],function(a){var u=d;function d(f,l,h,y){this.cx=3*f,this.bx=3*(h-f)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*l,this.by=3*(y-l)-this.cy,this.ay=1-this.cy-this.by,this.p1x=f,this.p1y=l,this.p2x=h,this.p2y=y}function p(f,l,h,y){const S=new u(f,l,h,y);return function(R){return S.solve(R)}}d.prototype={sampleCurveX:function(f){return((this.ax*f+this.bx)*f+this.cx)*f},sampleCurveY:function(f){return((this.ay*f+this.by)*f+this.cy)*f},sampleCurveDerivativeX:function(f){return(3*this.ax*f+2*this.bx)*f+this.cx},solveCurveX:function(f,l){if(l===void 0&&(l=1e-6),f<0)return 0;if(f>1)return 1;for(var h=f,y=0;y<8;y++){var S=this.sampleCurveX(h)-f;if(Math.abs(S)S?D=h:$=h,h=.5*($-D)+D;return h},solve:function(f,l){return this.sampleCurveY(this.solveCurveX(f,l))}};const m=p(.25,.1,.25,1);function v(f,l,h){return Math.min(h,Math.max(l,f))}function x(f,l,h){const y=h-l,S=((f-l)%y+y)%y+l;return S===l?h:S}function _(f,...l){for(const h of l)for(const y in h)f[y]=h[y];return f}let P=1;function k(f,l){f.forEach(h=>{l[h]&&(l[h]=l[h].bind(l))})}function T(f,l,h){const y={};for(const S in f)y[S]=l.call(h||this,f[S],S,f);return y}function M(f,l,h){const y={};for(const S in f)l.call(h||this,f[S],S,f)&&(y[S]=f[S]);return y}function O(f){return Array.isArray(f)?f.map(O):typeof f=="object"&&f?T(f,O):f}const N={};function L(f){N[f]||(typeof console<"u"&&console.warn(f),N[f]=!0)}function F(f,l,h){return(h.y-f.y)*(l.x-f.x)>(l.y-f.y)*(h.x-f.x)}function V(f){let l=0;for(let h,y,S=0,R=f.length,D=R-1;S@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(h,y,S,R)=>{const D=S||R;return l[y]=!D||D.toLowerCase(),""}),l["max-age"]){const h=parseInt(l["max-age"],10);isNaN(h)?delete l["max-age"]:l["max-age"]=h}return l}let G,ee,X=null;function Z(f){if(X==null){const l=f.navigator?f.navigator.userAgent:null;X=!!f.safari||!(!l||!(/\b(iPad|iPhone|iPod)\b/.test(l)||l.match("Safari")&&!l.match("Chrome")))}return X}function Q(f){return typeof ImageBitmap<"u"&&f instanceof ImageBitmap}const le={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(f){const l=requestAnimationFrame(f);return{cancel:()=>cancelAnimationFrame(l)}},getImageData(f,l=0){const h=window.document.createElement("canvas"),y=h.getContext("2d");if(!y)throw new Error("failed to create canvas 2d context");return h.width=f.width,h.height=f.height,y.drawImage(f,0,0,f.width,f.height),y.getImageData(-l,-l,f.width+2*l,f.height+2*l)},resolveURL:f=>(G||(G=document.createElement("a")),G.href=f,G.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(ee==null&&(ee=matchMedia("(prefers-reduced-motion: reduce)")),ee.matches)}};var ne=se;function se(f,l){this.x=f,this.y=l}se.prototype={clone:function(){return new se(this.x,this.y)},add:function(f){return this.clone()._add(f)},sub:function(f){return this.clone()._sub(f)},multByPoint:function(f){return this.clone()._multByPoint(f)},divByPoint:function(f){return this.clone()._divByPoint(f)},mult:function(f){return this.clone()._mult(f)},div:function(f){return this.clone()._div(f)},rotate:function(f){return this.clone()._rotate(f)},rotateAround:function(f,l){return this.clone()._rotateAround(f,l)},matMult:function(f){return this.clone()._matMult(f)},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(f){return this.x===f.x&&this.y===f.y},dist:function(f){return Math.sqrt(this.distSqr(f))},distSqr:function(f){var l=f.x-this.x,h=f.y-this.y;return l*l+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(f){return Math.atan2(this.y-f.y,this.x-f.x)},angleWith:function(f){return this.angleWithSep(f.x,f.y)},angleWithSep:function(f,l){return Math.atan2(this.x*l-this.y*f,this.x*f+this.y*l)},_matMult:function(f){var l=f[2]*this.x+f[3]*this.y;return this.x=f[0]*this.x+f[1]*this.y,this.y=l,this},_add:function(f){return this.x+=f.x,this.y+=f.y,this},_sub:function(f){return this.x-=f.x,this.y-=f.y,this},_mult:function(f){return this.x*=f,this.y*=f,this},_div:function(f){return this.x/=f,this.y/=f,this},_multByPoint:function(f){return this.x*=f.x,this.y*=f.y,this},_divByPoint:function(f){return this.x/=f.x,this.y/=f.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var f=this.y;return this.y=this.x,this.x=-f,this},_rotate:function(f){var l=Math.cos(f),h=Math.sin(f),y=h*this.x+l*this.y;return this.x=l*this.x-h*this.y,this.y=y,this},_rotateAround:function(f,l){var h=Math.cos(f),y=Math.sin(f),S=l.y+y*(this.x-l.x)+h*(this.y-l.y);return this.x=l.x+h*(this.x-l.x)-y*(this.y-l.y),this.y=S,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},se.convert=function(f){return f instanceof se?f:Array.isArray(f)?new se(f[0],f[1]):f};const oe={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},he="mapbox-tiles";let _e,be,xe=500,Te=50;function Ee(){typeof caches>"u"||_e||(_e=caches.open(he))}let Ce=1/0;const ke={supported:!1,testSupport:function(f){!Ue&&Ke&&(tt?lt(f):De=f)}};let De,Ke,Ue=!1,tt=!1;function lt(f){const l=f.createTexture();f.bindTexture(f.TEXTURE_2D,l);try{if(f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,Ke),f.isContextLost())return;ke.supported=!0}catch{}f.deleteTexture(l),Ue=!0}typeof document<"u"&&(Ke=document.createElement("img"),Ke.onload=function(){De&<(De),De=null,tt=!0},Ke.onerror=function(){Ue=!0,De=null},Ke.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const St={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(St);class We extends Error{constructor(l,h,y,S){super(`AJAXError: ${h} (${l}): ${y}`),this.status=l,this.statusText=h,this.url=y,this.body=S}}const bt=B()?()=>self.worker&&self.worker.referrer:()=>(window.location.protocol==="blob:"?window.parent:window).location.href;function Qe(f,l){const h=new AbortController,y=new Request(f.url,{method:f.method||"GET",body:f.body,credentials:f.credentials,headers:f.headers,referrer:bt(),signal:h.signal});let S=!1,R=!1;return f.type==="json"&&y.headers.set("Accept","application/json"),((D,$,U)=>{if(R)return;const W=Date.now();fetch(y).then(te=>te.ok?((ae,de,ge)=>{(f.type==="arrayBuffer"?ae.arrayBuffer():f.type==="json"?ae.json():ae.text()).then(ve=>{R||(de&&ge&&function(Fe,Ne,it){if(Ee(),!_e)return;const yt={status:Ne.status,statusText:Ne.statusText,headers:new Headers};Ne.headers.forEach((pt,Ot)=>yt.headers.set(Ot,pt));const Ye=H(Ne.headers.get("Cache-Control")||"");Ye["no-store"]||(Ye["max-age"]&&yt.headers.set("Expires",new Date(it+1e3*Ye["max-age"]).toUTCString()),new Date(yt.headers.get("Expires")).getTime()-it<42e4||function(pt,Ot){if(be===void 0)try{new Response(new ReadableStream),be=!0}catch{be=!1}be?Ot(pt.body):pt.blob().then(Ot)}(Ne,pt=>{const Ot=new Response(pt,yt);Ee(),_e&&_e.then(At=>At.put(function(gn){const _n=gn.indexOf("?");return _n<0?gn:gn.slice(0,_n)}(Fe.url),Ot)).catch(At=>L(At.message))}))}(y,de,ge),S=!0,l(null,ve,ae.headers.get("Cache-Control"),ae.headers.get("Expires")))}).catch(ve=>{R||l(new Error(ve.message))})})(te,null,W):te.blob().then(ae=>l(new We(te.status,te.statusText,f.url,ae)))).catch(te=>{te.code!==20&&l(new Error(te.message))})})(),{cancel:()=>{R=!0,S||h.abort()}}}const mt=function(f,l){if(/:\/\//.test(f.url)&&!/^https?:|^file:/.test(f.url)){if(B()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",f,l);if(!B()){const y=f.url.substring(0,f.url.indexOf("://"));return(oe.REGISTERED_PROTOCOLS[y]||Qe)(f,l)}}if(!(/^file:/.test(h=f.url)||/^file:/.test(bt())&&!/^\w+:/.test(h))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Qe(f,l);if(B()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",f,l,void 0,!0)}var h;return function(y,S){const R=new XMLHttpRequest;R.open(y.method||"GET",y.url,!0),y.type==="arrayBuffer"&&(R.responseType="arraybuffer");for(const D in y.headers)R.setRequestHeader(D,y.headers[D]);return y.type==="json"&&(R.responseType="text",R.setRequestHeader("Accept","application/json")),R.withCredentials=y.credentials==="include",R.onerror=()=>{S(new Error(R.statusText))},R.onload=()=>{if((R.status>=200&&R.status<300||R.status===0)&&R.response!==null){let D=R.response;if(y.type==="json")try{D=JSON.parse(R.response)}catch($){return S($)}S(null,D,R.getResponseHeader("Cache-Control"),R.getResponseHeader("Expires"))}else{const D=new Blob([R.response],{type:R.getResponseHeader("Content-Type")});S(new We(R.status,R.statusText,y.url,D))}},R.send(y.body),{cancel:()=>R.abort()}}(f,l)},ct=function(f,l){return mt(_(f,{type:"arrayBuffer"}),l)};function wt(f){const l=window.document.createElement("a");return l.href=f,l.protocol===window.document.location.protocol&&l.host===window.document.location.host}const rt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let ut,nt;ut=[],nt=0;const qe=function(f,l){if(ke.supported&&(f.headers||(f.headers={}),f.headers.accept="image/webp,*/*"),nt>=oe.MAX_PARALLEL_IMAGE_REQUESTS){const R={requestParameters:f,callback:l,cancelled:!1,cancel(){this.cancelled=!0}};return ut.push(R),R}nt++;let h=!1;const y=()=>{if(!h)for(h=!0,nt--;ut.length&&nt{y(),R?l(R):D&&function(W,te){typeof createImageBitmap=="function"?function(ae,de){const ge=new Blob([new Uint8Array(ae)],{type:"image/png"});createImageBitmap(ge).then(ve=>{de(null,ve)}).catch(ve=>{de(new Error(`Could not load image because of ${ve.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(W,te):function(ae,de){const ge=new Image;ge.onload=()=>{de(null,ge),URL.revokeObjectURL(ge.src),ge.onload=null,window.requestAnimationFrame(()=>{ge.src=rt})},ge.onerror=()=>de(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 ve=new Blob([new Uint8Array(ae)],{type:"image/png"});ge.src=ae.byteLength?URL.createObjectURL(ve):rt}(W,te)}(D,(W,te)=>{W!=null?l(W):te!=null&&l(null,te,{cacheControl:$,expires:U})})});return{cancel:()=>{S.cancel(),y()}}};function dt(f,l,h){h[f]&&h[f].indexOf(l)!==-1||(h[f]=h[f]||[],h[f].push(l))}function _t(f,l,h){if(h&&h[f]){const y=h[f].indexOf(l);y!==-1&&h[f].splice(y,1)}}class Dt{constructor(l,h={}){_(this,h),this.type=l}}class Nt extends Dt{constructor(l,h={}){super("error",_({error:l},h))}}class jt{on(l,h){return this._listeners=this._listeners||{},dt(l,h,this._listeners),this}off(l,h){return _t(l,h,this._listeners),_t(l,h,this._oneTimeListeners),this}once(l,h){return this._oneTimeListeners=this._oneTimeListeners||{},dt(l,h,this._oneTimeListeners),this}fire(l,h){typeof l=="string"&&(l=new Dt(l,h||{}));const y=l.type;if(this.listens(y)){l.target=this;const S=this._listeners&&this._listeners[y]?this._listeners[y].slice():[];for(const $ of S)$.call(this,l);const R=this._oneTimeListeners&&this._oneTimeListeners[y]?this._oneTimeListeners[y].slice():[];for(const $ of R)_t(y,$,this._oneTimeListeners),$.call(this,l);const D=this._eventedParent;D&&(_(l,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),D.fire(l))}else l instanceof Nt&&console.error(l.error);return this}listens(l){return this._listeners&&this._listeners[l]&&this._listeners[l].length>0||this._oneTimeListeners&&this._oneTimeListeners[l]&&this._oneTimeListeners[l].length>0||this._eventedParent&&this._eventedParent.listens(l)}setEventedParent(l,h){return this._eventedParent=l,this._eventedParentData=h,this}}var Ve={$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"},terrain:{type:"terrain"},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",{"!":"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-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":{},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},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"}}};class Ze{constructor(l,h,y,S){this.message=(l?`${l}: `:"")+y,S&&(this.identifier=S),h!=null&&h.__line__&&(this.line=h.__line__)}}function Yt(f){const l=f.value;return l?[new Ze(f.key,l,"constants have been deprecated as of v8")]:[]}function sn(f,...l){for(const h of l)for(const y in h)f[y]=h[y];return f}function Gt(f){return f instanceof Number||f instanceof String||f instanceof Boolean?f.valueOf():f}function zt(f){if(Array.isArray(f))return f.map(zt);if(f instanceof Object&&!(f instanceof Number||f instanceof String||f instanceof Boolean)){const l={};for(const h in f)l[h]=zt(f[h]);return l}return Gt(f)}class Rt extends Error{constructor(l,h){super(h),this.message=h,this.key=l}}class Qt{constructor(l,h=[]){this.parent=l,this.bindings={};for(const[y,S]of h)this.bindings[y]=S}concat(l){return new Qt(this,l)}get(l){if(this.bindings[l])return this.bindings[l];if(this.parent)return this.parent.get(l);throw new Error(`${l} not found in scope.`)}has(l){return!!this.bindings[l]||!!this.parent&&this.parent.has(l)}}const pn={kind:"null"},ot={kind:"number"},Lt={kind:"string"},Tt={kind:"boolean"},Kt={kind:"color"},Zt={kind:"object"},ht={kind:"value"},xn={kind:"collator"},bn={kind:"formatted"},tn={kind:"padding"},Bt={kind:"resolvedImage"};function gt(f,l){return{kind:"array",itemType:f,N:l}}function xt(f){if(f.kind==="array"){const l=xt(f.itemType);return typeof f.N=="number"?`array<${l}, ${f.N}>`:f.itemType.kind==="value"?"array":`array<${l}>`}return f.kind}const Vt=[pn,ot,Lt,Tt,Kt,bn,Zt,gt(ht),tn,Bt];function qt(f,l){if(l.kind==="error")return null;if(f.kind==="array"){if(l.kind==="array"&&(l.N===0&&l.itemType.kind==="value"||!qt(f.itemType,l.itemType))&&(typeof f.N!="number"||f.N===l.N))return null}else{if(f.kind===l.kind)return null;if(f.kind==="value"){for(const h of Vt)if(!qt(h,l))return null}}return`Expected ${xt(f)} but found ${xt(l)} instead.`}function vn(f,l){return l.some(h=>h.kind===f.kind)}function Fn(f,l){return l.some(h=>h==="null"?f===null:h==="array"?Array.isArray(f):h==="object"?f&&!Array.isArray(f)&&typeof f=="object":h===typeof f)}var tr,nr={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 ye(f){return(f=Math.round(f))<0?0:f>255?255:f}function q(f){return ye(f[f.length-1]==="%"?parseFloat(f)/100*255:parseInt(f))}function J(f){return(l=f[f.length-1]==="%"?parseFloat(f)/100:parseFloat(f))<0?0:l>1?1:l;var l}function pe(f,l,h){return h<0?h+=1:h>1&&(h-=1),6*h<1?f+(l-f)*h*6:2*h<1?l:3*h<2?f+(l-f)*(2/3-h)*6:f}try{tr={}.parseCSSColor=function(f){var l,h=f.replace(/ /g,"").toLowerCase();if(h in nr)return nr[h].slice();if(h[0]==="#")return h.length===4?(l=parseInt(h.substr(1),16))>=0&&l<=4095?[(3840&l)>>4|(3840&l)>>8,240&l|(240&l)>>4,15&l|(15&l)<<4,1]:null:h.length===7&&(l=parseInt(h.substr(1),16))>=0&&l<=16777215?[(16711680&l)>>16,(65280&l)>>8,255&l,1]:null;var y=h.indexOf("("),S=h.indexOf(")");if(y!==-1&&S+1===h.length){var R=h.substr(0,y),D=h.substr(y+1,S-(y+1)).split(","),$=1;switch(R){case"rgba":if(D.length!==4)return null;$=J(D.pop());case"rgb":return D.length!==3?null:[q(D[0]),q(D[1]),q(D[2]),$];case"hsla":if(D.length!==4)return null;$=J(D.pop());case"hsl":if(D.length!==3)return null;var U=(parseFloat(D[0])%360+360)%360/360,W=J(D[1]),te=J(D[2]),ae=te<=.5?te*(W+1):te+W-te*W,de=2*te-ae;return[ye(255*pe(de,ae,U+1/3)),ye(255*pe(de,ae,U)),ye(255*pe(de,ae,U-1/3)),$];default:return null}}return null}}catch{}class ce{constructor(l,h,y,S=1){this.r=l,this.g=h,this.b=y,this.a=S}static parse(l){if(!l)return;if(l instanceof ce)return l;if(typeof l!="string")return;const h=tr(l);return h?new ce(h[0]/255*h[3],h[1]/255*h[3],h[2]/255*h[3],h[3]):void 0}toString(){const[l,h,y,S]=this.toArray();return`rgba(${Math.round(l)},${Math.round(h)},${Math.round(y)},${S})`}toArray(){const{r:l,g:h,b:y,a:S}=this;return S===0?[0,0,0,0]:[255*l/S,255*h/S,255*y/S,S]}}ce.black=new ce(0,0,0,1),ce.white=new ce(1,1,1,1),ce.transparent=new ce(0,0,0,0),ce.red=new ce(1,0,0,1);class we{constructor(l,h,y){this.sensitivity=l?h?"variant":"case":h?"accent":"base",this.locale=y,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(l,h){return this.collator.compare(l,h)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Ae{constructor(l,h,y,S,R){this.text=l,this.image=h,this.scale=y,this.fontStack=S,this.textColor=R}}class Pe{constructor(l){this.sections=l}static fromString(l){return new Pe([new Ae(l,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(l=>l.text.length!==0||l.image&&l.image.name.length!==0)}static factory(l){return l instanceof Pe?l:Pe.fromString(l)}toString(){return this.sections.length===0?"":this.sections.map(l=>l.text).join("")}}class Me{constructor(l){this.values=l.slice()}static parse(l){if(l instanceof Me)return l;if(typeof l=="number")return new Me([l,l,l,l]);if(Array.isArray(l)&&!(l.length<1||l.length>4)){for(const h of l)if(typeof h!="number")return;switch(l.length){case 1:l=[l[0],l[0],l[0],l[0]];break;case 2:l=[l[0],l[1],l[0],l[1]];break;case 3:l=[l[0],l[1],l[2],l[1]]}return new Me(l)}}toString(){return JSON.stringify(this.values)}}class Be{constructor(l){this.name=l.name,this.available=l.available}toString(){return this.name}static fromString(l){return l?new Be({name:l,available:!1}):null}}function Je(f,l,h,y){return typeof f=="number"&&f>=0&&f<=255&&typeof l=="number"&&l>=0&&l<=255&&typeof h=="number"&&h>=0&&h<=255?y===void 0||typeof y=="number"&&y>=0&&y<=1?null:`Invalid rgba value [${[f,l,h,y].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof y=="number"?[f,l,h,y]:[f,l,h]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function et(f){if(f===null||typeof f=="string"||typeof f=="boolean"||typeof f=="number"||f instanceof ce||f instanceof we||f instanceof Pe||f instanceof Me||f instanceof Be)return!0;if(Array.isArray(f)){for(const l of f)if(!et(l))return!1;return!0}if(typeof f=="object"){for(const l in f)if(!et(f[l]))return!1;return!0}return!1}function Ge(f){if(f===null)return pn;if(typeof f=="string")return Lt;if(typeof f=="boolean")return Tt;if(typeof f=="number")return ot;if(f instanceof ce)return Kt;if(f instanceof we)return xn;if(f instanceof Pe)return bn;if(f instanceof Me)return tn;if(f instanceof Be)return Bt;if(Array.isArray(f)){const l=f.length;let h;for(const y of f){const S=Ge(y);if(h){if(h===S)continue;h=ht;break}h=S}return gt(h||ht,l)}return Zt}function Ut(f){const l=typeof f;return f===null?"":l==="string"||l==="number"||l==="boolean"?String(f):f instanceof ce||f instanceof Pe||f instanceof Me||f instanceof Be?f.toString():JSON.stringify(f)}class Mt{constructor(l,h){this.type=l,this.value=h}static parse(l,h){if(l.length!==2)return h.error(`'literal' expression requires exactly one argument, but found ${l.length-1} instead.`);if(!et(l[1]))return h.error("invalid value");const y=l[1];let S=Ge(y);const R=h.expectedType;return S.kind!=="array"||S.N!==0||!R||R.kind!=="array"||typeof R.N=="number"&&R.N!==0||(S=R),new Mt(S,y)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class at{constructor(l){this.name="ExpressionEvaluationError",this.message=l}toJSON(){return this.message}}const $t={string:Lt,number:ot,boolean:Tt,object:Zt};class Xt{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");let y,S=1;const R=l[0];if(R==="array"){let $,U;if(l.length>2){const W=l[1];if(typeof W!="string"||!(W in $t)||W==="object")return h.error('The item type argument of "array" must be one of string, number, boolean',1);$=$t[W],S++}else $=ht;if(l.length>3){if(l[2]!==null&&(typeof l[2]!="number"||l[2]<0||l[2]!==Math.floor(l[2])))return h.error('The length argument to "array" must be a positive integer literal',2);U=l[2],S++}y=gt($,U)}else{if(!$t[R])throw new Error(`Types doesn't contain name = ${R}`);y=$t[R]}const D=[];for(;Sl.outputDefined())}}const En={"to-boolean":Tt,"to-color":Kt,"to-number":ot,"to-string":Lt};class hn{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");const y=l[0];if(!En[y])throw new Error(`Can't parse ${y} as it is not part of the known types`);if((y==="to-boolean"||y==="to-string")&&l.length!==2)return h.error("Expected one argument.");const S=En[y],R=[];for(let D=1;D4?`Invalid rbga value ${JSON.stringify(h)}: expected an array containing either three or four numeric values.`:Je(h[0],h[1],h[2],h[3]),!y))return new ce(h[0]/255,h[1]/255,h[2]/255,h[3])}throw new at(y||`Could not parse color from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}if(this.type.kind==="padding"){let h;for(const y of this.args){h=y.evaluate(l);const S=Me.parse(h);if(S)return S}throw new at(`Could not parse padding from value '${typeof h=="string"?h:JSON.stringify(h)}'`)}if(this.type.kind==="number"){let h=null;for(const y of this.args){if(h=y.evaluate(l),h===null)return 0;const S=Number(h);if(!isNaN(S))return S}throw new at(`Could not convert ${JSON.stringify(h)} to number.`)}return this.type.kind==="formatted"?Pe.fromString(Ut(this.args[0].evaluate(l))):this.type.kind==="resolvedImage"?Be.fromString(Ut(this.args[0].evaluate(l))):Ut(this.args[0].evaluate(l))}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}const Pn=["Unknown","Point","LineString","Polygon"];class Gn{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?Pn[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(l){let h=this._parseColorCache[l];return h||(h=this._parseColorCache[l]=ce.parse(l)),h}}class lr{constructor(l,h,y,S){this.name=l,this.type=h,this._evaluate=y,this.args=S}evaluate(l){return this._evaluate(l,this.args)}eachChild(l){this.args.forEach(l)}outputDefined(){return!1}static parse(l,h){const y=l[0],S=lr.definitions[y];if(!S)return h.error(`Unknown expression "${y}". If you wanted a literal array, use ["literal", [...]].`,0);const R=Array.isArray(S)?S[0]:S.type,D=Array.isArray(S)?[[S[1],S[2]]]:S.overloads,$=D.filter(([W])=>!Array.isArray(W)||W.length===l.length-1);let U=null;for(const[W,te]of $){U=new Gs(h.registry,h.path,null,h.scope);const ae=[];let de=!1;for(let ge=1;ge{return de=ae,Array.isArray(de)?`(${de.map(xt).join(", ")})`:`(${xt(de.type)}...)`;var de}).join(" | "),te=[];for(let ae=1;ae=l[2]||f[1]<=l[1]||f[3]>=l[3])}function An(f,l){const h=(180+f[0])/360,y=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+f[1]*Math.PI/360)))/360,S=Math.pow(2,l.z);return[Math.round(h*S*hr),Math.round(y*S*hr)]}function zn(f,l,h){const y=f[0]-l[0],S=f[1]-l[1],R=f[0]-h[0],D=f[1]-h[1];return y*D-R*S==0&&y*R<=0&&S*D<=0}function ri(f,l){let h=!1;for(let D=0,$=l.length;D<$;D++){const U=l[D];for(let W=0,te=U.length;W(y=f)[1]!=(R=U[W+1])[1]>y[1]&&y[0]<(R[0]-S[0])*(y[1]-S[1])/(R[1]-S[1])+S[0]&&(h=!h)}}var y,S,R;return h}function Er(f,l){for(let h=0;h0&&$<0||D<0&&$>0}function Kn(f,l,h){for(const W of h)for(let te=0;teh[2]){const S=.5*y;let R=f[0]-h[0]>S?-y:h[0]-f[0]>S?y:0;R===0&&(R=f[0]-h[2]>S?-y:h[2]-f[0]>S?y:0),f[0]+=R}Vr(l,f)}function Eu(f,l,h,y){const S=Math.pow(2,y.z)*hr,R=[y.x*hr,y.y*hr],D=[];for(const $ of f)for(const U of $){const W=[U.x+R[0],U.y+R[1]];Oo(W,l,h,S),D.push(W)}return D}function Pf(f,l,h,y){const S=Math.pow(2,y.z)*hr,R=[y.x*hr,y.y*hr],D=[];for(const U of f){const W=[];for(const te of U){const ae=[te.x+R[0],te.y+R[1]];Vr(l,ae),W.push(ae)}D.push(W)}if(l[2]-l[0]<=S/2){($=l)[0]=$[1]=1/0,$[2]=$[3]=-1/0;for(const U of D)for(const W of U)Oo(W,l,h,S)}var $;return D}class xs{constructor(l,h){this.type=Tt,this.geojson=l,this.geometries=h}static parse(l,h){if(l.length!==2)return h.error(`'within' expression requires exactly one argument, but found ${l.length-1} instead.`);if(et(l[1])){const y=l[1];if(y.type==="FeatureCollection")for(let S=0;S{l&&!Wn(h)&&(l=!1)}),l}function rr(f){if(f instanceof lr&&f.name==="feature-state")return!1;let l=!0;return f.eachChild(h=>{l&&!rr(h)&&(l=!1)}),l}function Ur(f,l){if(f instanceof lr&&l.indexOf(f.name)>=0)return!1;let h=!0;return f.eachChild(y=>{h&&!Ur(y,l)&&(h=!1)}),h}class Ui{constructor(l,h){this.type=h.type,this.name=l,this.boundExpression=h}static parse(l,h){if(l.length!==2||typeof l[1]!="string")return h.error("'var' expression requires exactly one string literal argument.");const y=l[1];return h.scope.has(y)?new Ui(y,h.scope.get(y)):h.error(`Unknown variable "${y}". Make sure "${y}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(l){return this.boundExpression.evaluate(l)}eachChild(){}outputDefined(){return!1}}class Gs{constructor(l,h=[],y,S=new Qt,R=[]){this.registry=l,this.path=h,this.key=h.map(D=>`[${D}]`).join(""),this.scope=S,this.errors=R,this.expectedType=y}parse(l,h,y,S,R={}){return h?this.concat(h,y,S)._parse(l,R):this._parse(l,R)}_parse(l,h){function y(S,R,D){return D==="assert"?new Xt(R,[S]):D==="coerce"?new hn(R,[S]):S}if(l!==null&&typeof l!="string"&&typeof l!="boolean"&&typeof l!="number"||(l=["literal",l]),Array.isArray(l)){if(l.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const S=l[0];if(typeof S!="string")return this.error(`Expression name must be a string, but found ${typeof S} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const R=this.registry[S];if(R){let D=R.parse(l,this);if(!D)return null;if(this.expectedType){const $=this.expectedType,U=D.type;if($.kind!=="string"&&$.kind!=="number"&&$.kind!=="boolean"&&$.kind!=="object"&&$.kind!=="array"||U.kind!=="value")if($.kind!=="color"&&$.kind!=="formatted"&&$.kind!=="resolvedImage"||U.kind!=="value"&&U.kind!=="string")if($.kind!=="padding"||U.kind!=="value"&&U.kind!=="number"&&U.kind!=="array"){if(this.checkSubtype($,U))return null}else D=y(D,$,h.typeAnnotation||"coerce");else D=y(D,$,h.typeAnnotation||"coerce");else D=y(D,$,h.typeAnnotation||"assert")}if(!(D instanceof Mt)&&D.type.kind!=="resolvedImage"&&Jo(D)){const $=new Gn;try{D=new Mt(D.type,D.evaluate($))}catch(U){return this.error(U.message),null}}return D}return this.error(`Unknown expression "${S}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(l===void 0?"'undefined' value invalid. Use null instead.":typeof l=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof l} instead.`)}concat(l,h,y){const S=typeof l=="number"?this.path.concat(l):this.path,R=y?this.scope.concat(y):this.scope;return new Gs(this.registry,S,h||null,R,this.errors)}error(l,...h){const y=`${this.key}${h.map(S=>`[${S}]`).join("")}`;this.errors.push(new Rt(y,l))}checkSubtype(l,h){const y=qt(l,h);return y&&this.error(y),y}}function Jo(f){if(f instanceof Ui)return Jo(f.boundExpression);if(f instanceof lr&&f.name==="error"||f instanceof Zr||f instanceof xs)return!1;const l=f instanceof hn||f instanceof Xt;let h=!0;return f.eachChild(y=>{h=l?h&&Jo(y):h&&y instanceof Mt}),!!h&&Wn(f)&&Ur(f,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Rl(f,l){const h=f.length-1;let y,S,R=0,D=h,$=0;for(;R<=D;)if($=Math.floor((R+D)/2),y=f[$],S=f[$+1],y<=l){if($===h||ll))throw new at("Input is not a number.");D=$-1}return 0}class bs{constructor(l,h,y){this.type=l,this.input=h,this.labels=[],this.outputs=[];for(const[S,R]of y)this.labels.push(S),this.outputs.push(R)}static parse(l,h){if(l.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return h.error("Expected an even number of arguments.");const y=h.parse(l[1],1,ot);if(!y)return null;const S=[];let R=null;h.expectedType&&h.expectedType.kind!=="value"&&(R=h.expectedType);for(let D=1;D=$)return h.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',W);const ae=h.parse(U,te,R);if(!ae)return null;R=R||ae.type,S.push([$,ae])}return new bs(R,y,S)}evaluate(l){const h=this.labels,y=this.outputs;if(h.length===1)return y[0].evaluate(l);const S=this.input.evaluate(l);if(S<=h[0])return y[0].evaluate(l);const R=h.length;return S>=h[R-1]?y[R-1].evaluate(l):y[Rl(h,S)].evaluate(l)}eachChild(l){l(this.input);for(const h of this.outputs)l(h)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function Pr(f,l,h){return f*(1-h)+l*h}var _s=Object.freeze({__proto__:null,number:Pr,color:function(f,l,h){return new ce(Pr(f.r,l.r,h),Pr(f.g,l.g,h),Pr(f.b,l.b,h),Pr(f.a,l.a,h))},array:function(f,l,h){return f.map((y,S)=>Pr(y,l[S],h))},padding:function(f,l,h){const y=f.values,S=l.values;return new Me([Pr(y[0],S[0],h),Pr(y[1],S[1],h),Pr(y[2],S[2],h),Pr(y[3],S[3],h)])}});const w0=.95047,C0=1.08883,Np=4/29,If=6/29,S0=3*If*If,Iw=Math.PI/180,Tw=180/Math.PI;function Lp(f){return f>.008856451679035631?Math.pow(f,1/3):f/S0+Np}function Fp(f){return f>If?f*f*f:S0*(f-Np)}function zp(f){return 255*(f<=.0031308?12.92*f:1.055*Math.pow(f,1/2.4)-.055)}function $p(f){return(f/=255)<=.04045?f/12.92:Math.pow((f+.055)/1.055,2.4)}function pr(f){const l=$p(f.r),h=$p(f.g),y=$p(f.b),S=Lp((.4124564*l+.3575761*h+.1804375*y)/w0),R=Lp((.2126729*l+.7151522*h+.072175*y)/1);return{l:116*R-16,a:500*(S-R),b:200*(R-Lp((.0193339*l+.119192*h+.9503041*y)/C0)),alpha:f.a}}function E0(f){let l=(f.l+16)/116,h=isNaN(f.a)?l:l+f.a/500,y=isNaN(f.b)?l:l-f.b/200;return l=1*Fp(l),h=w0*Fp(h),y=C0*Fp(y),new ce(zp(3.2404542*h-1.5371385*l-.4985314*y),zp(-.969266*h+1.8760108*l+.041556*y),zp(.0556434*h-.2040259*l+1.0572252*y),f.alpha)}function kw(f,l,h){const y=l-f;return f+h*(y>180||y<-180?y-360*Math.round(y/360):y)}const Uc={forward:pr,reverse:E0,interpolate:function(f,l,h){return{l:Pr(f.l,l.l,h),a:Pr(f.a,l.a,h),b:Pr(f.b,l.b,h),alpha:Pr(f.alpha,l.alpha,h)}}},jc={forward:function(f){const{l,a:h,b:y}=pr(f),S=Math.atan2(y,h)*Tw;return{h:S<0?S+360:S,c:Math.sqrt(h*h+y*y),l,alpha:f.a}},reverse:function(f){const l=f.h*Iw,h=f.c;return E0({l:f.l,a:Math.cos(l)*h,b:Math.sin(l)*h,alpha:f.alpha})},interpolate:function(f,l,h){return{h:kw(f.h,l.h,h),c:Pr(f.c,l.c,h),l:Pr(f.l,l.l,h),alpha:Pr(f.alpha,l.alpha,h)}}};var P0=Object.freeze({__proto__:null,lab:Uc,hcl:jc});class No{constructor(l,h,y,S,R){this.type=l,this.operator=h,this.interpolation=y,this.input=S,this.labels=[],this.outputs=[];for(const[D,$]of R)this.labels.push(D),this.outputs.push($)}static interpolationFactor(l,h,y,S){let R=0;if(l.name==="exponential")R=Bp(h,l.base,y,S);else if(l.name==="linear")R=Bp(h,1,y,S);else if(l.name==="cubic-bezier"){const D=l.controlPoints;R=new u(D[0],D[1],D[2],D[3]).solve(Bp(h,1,y,S))}return R}static parse(l,h){let[y,S,R,...D]=l;if(!Array.isArray(S)||S.length===0)return h.error("Expected an interpolation type expression.",1);if(S[0]==="linear")S={name:"linear"};else if(S[0]==="exponential"){const W=S[1];if(typeof W!="number")return h.error("Exponential interpolation requires a numeric base.",1,1);S={name:"exponential",base:W}}else{if(S[0]!=="cubic-bezier")return h.error(`Unknown interpolation type ${String(S[0])}`,1,0);{const W=S.slice(1);if(W.length!==4||W.some(te=>typeof te!="number"||te<0||te>1))return h.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);S={name:"cubic-bezier",controlPoints:W}}}if(l.length-1<4)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if((l.length-1)%2!=0)return h.error("Expected an even number of arguments.");if(R=h.parse(R,2,ot),!R)return null;const $=[];let U=null;y==="interpolate-hcl"||y==="interpolate-lab"?U=Kt:h.expectedType&&h.expectedType.kind!=="value"&&(U=h.expectedType);for(let W=0;W=te)return h.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',de);const ve=h.parse(ae,ge,U);if(!ve)return null;U=U||ve.type,$.push([te,ve])}return U.kind==="number"||U.kind==="color"||U.kind==="padding"||U.kind==="array"&&U.itemType.kind==="number"&&typeof U.N=="number"?new No(U,y,S,R,$):h.error(`Type ${xt(U)} is not interpolatable.`)}evaluate(l){const h=this.labels,y=this.outputs;if(h.length===1)return y[0].evaluate(l);const S=this.input.evaluate(l);if(S<=h[0])return y[0].evaluate(l);const R=h.length;if(S>=h[R-1])return y[R-1].evaluate(l);const D=Rl(h,S),$=No.interpolationFactor(this.interpolation,S,h[D],h[D+1]),U=y[D].evaluate(l),W=y[D+1].evaluate(l);return this.operator==="interpolate"?_s[this.type.kind.toLowerCase()](U,W,$):this.operator==="interpolate-hcl"?jc.reverse(jc.interpolate(jc.forward(U),jc.forward(W),$)):Uc.reverse(Uc.interpolate(Uc.forward(U),Uc.forward(W),$))}eachChild(l){l(this.input);for(const h of this.outputs)l(h)}outputDefined(){return this.outputs.every(l=>l.outputDefined())}}function Bp(f,l,h,y){const S=y-h,R=f-h;return S===0?0:l===1?R/S:(Math.pow(l,R)-1)/(Math.pow(l,S)-1)}class Tf{constructor(l,h){this.type=l,this.args=h}static parse(l,h){if(l.length<2)return h.error("Expectected at least one argument.");let y=null;const S=h.expectedType;S&&S.kind!=="value"&&(y=S);const R=[];for(const $ of l.slice(1)){const U=h.parse($,1+R.length,y,void 0,{typeAnnotation:"omit"});if(!U)return null;y=y||U.type,R.push(U)}if(!y)throw new Error("No output type");const D=S&&R.some($=>qt(S,$.type));return new Tf(D?ht:y,R)}evaluate(l){let h,y=null,S=0;for(const R of this.args)if(S++,y=R.evaluate(l),y&&y instanceof Be&&!y.available&&(h||(h=y.name),y=null,S===this.args.length&&(y=h)),y!==null)break;return y}eachChild(l){this.args.forEach(l)}outputDefined(){return this.args.every(l=>l.outputDefined())}}class kf{constructor(l,h){this.type=h.type,this.bindings=[].concat(l),this.result=h}evaluate(l){return this.result.evaluate(l)}eachChild(l){for(const h of this.bindings)l(h[1]);l(this.result)}static parse(l,h){if(l.length<4)return h.error(`Expected at least 3 arguments, but found ${l.length-1} instead.`);const y=[];for(let R=1;R=y.length)throw new at(`Array index out of bounds: ${h} > ${y.length-1}.`);if(h!==Math.floor(h))throw new at(`Array index must be an integer, but found ${h} instead.`);return y[h]}eachChild(l){l(this.index),l(this.input)}outputDefined(){return!1}}class Up{constructor(l,h){this.type=Tt,this.needle=l,this.haystack=h}static parse(l,h){if(l.length!==3)return h.error(`Expected 2 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,ht),S=h.parse(l[2],2,ht);return y&&S?vn(y.type,[Tt,Lt,ot,pn,ht])?new Up(y,S):h.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(y.type)} instead`):null}evaluate(l){const h=this.needle.evaluate(l),y=this.haystack.evaluate(l);if(!y)return!1;if(!Fn(h,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${xt(Ge(h))} instead.`);if(!Fn(y,["string","array"]))throw new at(`Expected second argument to be of type array or string, but found ${xt(Ge(y))} instead.`);return y.indexOf(h)>=0}eachChild(l){l(this.needle),l(this.haystack)}outputDefined(){return!0}}class Mf{constructor(l,h,y){this.type=ot,this.needle=l,this.haystack=h,this.fromIndex=y}static parse(l,h){if(l.length<=2||l.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,ht),S=h.parse(l[2],2,ht);if(!y||!S)return null;if(!vn(y.type,[Tt,Lt,ot,pn,ht]))return h.error(`Expected first argument to be of type boolean, string, number or null, but found ${xt(y.type)} instead`);if(l.length===4){const R=h.parse(l[3],3,ot);return R?new Mf(y,S,R):null}return new Mf(y,S)}evaluate(l){const h=this.needle.evaluate(l),y=this.haystack.evaluate(l);if(!Fn(h,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${xt(Ge(h))} instead.`);if(!Fn(y,["string","array"]))throw new at(`Expected second argument to be of type array or string, but found ${xt(Ge(y))} instead.`);if(this.fromIndex){const S=this.fromIndex.evaluate(l);return y.indexOf(h,S)}return y.indexOf(h)}eachChild(l){l(this.needle),l(this.haystack),this.fromIndex&&l(this.fromIndex)}outputDefined(){return!1}}class jp{constructor(l,h,y,S,R,D){this.inputType=l,this.type=h,this.input=y,this.cases=S,this.outputs=R,this.otherwise=D}static parse(l,h){if(l.length<5)return h.error(`Expected at least 4 arguments, but found only ${l.length-1}.`);if(l.length%2!=1)return h.error("Expected an even number of arguments.");let y,S;h.expectedType&&h.expectedType.kind!=="value"&&(S=h.expectedType);const R={},D=[];for(let W=2;WNumber.MAX_SAFE_INTEGER)return de.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof ve=="number"&&Math.floor(ve)!==ve)return de.error("Numeric branch labels must be integer values.");if(y){if(de.checkSubtype(y,Ge(ve)))return null}else y=Ge(ve);if(R[String(ve)]!==void 0)return de.error("Branch labels must be unique.");R[String(ve)]=D.length}const ge=h.parse(ae,W,S);if(!ge)return null;S=S||ge.type,D.push(ge)}const $=h.parse(l[1],1,ht);if(!$)return null;const U=h.parse(l[l.length-1],l.length-1,S);return U?$.type.kind!=="value"&&h.concat(1).checkSubtype(y,$.type)?null:new jp(y,S,$,R,D,U):null}evaluate(l){const h=this.input.evaluate(l);return(Ge(h)===this.inputType&&this.outputs[this.cases[h]]||this.otherwise).evaluate(l)}eachChild(l){l(this.input),this.outputs.forEach(l),l(this.otherwise)}outputDefined(){return this.outputs.every(l=>l.outputDefined())&&this.otherwise.outputDefined()}}class Hp{constructor(l,h,y){this.type=l,this.branches=h,this.otherwise=y}static parse(l,h){if(l.length<4)return h.error(`Expected at least 3 arguments, but found only ${l.length-1}.`);if(l.length%2!=0)return h.error("Expected an odd number of arguments.");let y;h.expectedType&&h.expectedType.kind!=="value"&&(y=h.expectedType);const S=[];for(let D=1;Dh.outputDefined())&&this.otherwise.outputDefined()}}class Rf{constructor(l,h,y,S){this.type=l,this.input=h,this.beginIndex=y,this.endIndex=S}static parse(l,h){if(l.length<=2||l.length>=5)return h.error(`Expected 3 or 4 arguments, but found ${l.length-1} instead.`);const y=h.parse(l[1],1,ht),S=h.parse(l[2],2,ot);if(!y||!S)return null;if(!vn(y.type,[gt(ht),Lt,ht]))return h.error(`Expected first argument to be of type array or string, but found ${xt(y.type)} instead`);if(l.length===4){const R=h.parse(l[3],3,ot);return R?new Rf(y.type,y,S,R):null}return new Rf(y.type,y,S)}evaluate(l){const h=this.input.evaluate(l),y=this.beginIndex.evaluate(l);if(!Fn(h,["string","array"]))throw new at(`Expected first argument to be of type array or string, but found ${xt(Ge(h))} instead.`);if(this.endIndex){const S=this.endIndex.evaluate(l);return h.slice(y,S)}return h.slice(y)}eachChild(l){l(this.input),l(this.beginIndex),this.endIndex&&l(this.endIndex)}outputDefined(){return!1}}function I0(f,l){return f==="=="||f==="!="?l.kind==="boolean"||l.kind==="string"||l.kind==="number"||l.kind==="null"||l.kind==="value":l.kind==="string"||l.kind==="number"||l.kind==="value"}function T0(f,l,h,y){return y.compare(l,h)===0}function Pu(f,l,h){const y=f!=="=="&&f!=="!=";return class bz{constructor(R,D,$){this.type=Tt,this.lhs=R,this.rhs=D,this.collator=$,this.hasUntypedArgument=R.type.kind==="value"||D.type.kind==="value"}static parse(R,D){if(R.length!==3&&R.length!==4)return D.error("Expected two or three arguments.");const $=R[0];let U=D.parse(R[1],1,ht);if(!U)return null;if(!I0($,U.type))return D.concat(1).error(`"${$}" comparisons are not supported for type '${xt(U.type)}'.`);let W=D.parse(R[2],2,ht);if(!W)return null;if(!I0($,W.type))return D.concat(2).error(`"${$}" comparisons are not supported for type '${xt(W.type)}'.`);if(U.type.kind!==W.type.kind&&U.type.kind!=="value"&&W.type.kind!=="value")return D.error(`Cannot compare types '${xt(U.type)}' and '${xt(W.type)}'.`);y&&(U.type.kind==="value"&&W.type.kind!=="value"?U=new Xt(W.type,[U]):U.type.kind!=="value"&&W.type.kind==="value"&&(W=new Xt(U.type,[W])));let te=null;if(R.length===4){if(U.type.kind!=="string"&&W.type.kind!=="string"&&U.type.kind!=="value"&&W.type.kind!=="value")return D.error("Cannot use collator to compare non-string types.");if(te=D.parse(R[3],3,xn),!te)return null}return new bz(U,W,te)}evaluate(R){const D=this.lhs.evaluate(R),$=this.rhs.evaluate(R);if(y&&this.hasUntypedArgument){const U=Ge(D),W=Ge($);if(U.kind!==W.kind||U.kind!=="string"&&U.kind!=="number")throw new at(`Expected arguments for "${f}" to be (string, string) or (number, number), but found (${U.kind}, ${W.kind}) instead.`)}if(this.collator&&!y&&this.hasUntypedArgument){const U=Ge(D),W=Ge($);if(U.kind!=="string"||W.kind!=="string")return l(R,D,$)}return this.collator?h(R,D,$,this.collator.evaluate(R)):l(R,D,$)}eachChild(R){R(this.lhs),R(this.rhs),this.collator&&R(this.collator)}outputDefined(){return!0}}}const Mw=Pu("==",function(f,l,h){return l===h},T0),Rw=Pu("!=",function(f,l,h){return l!==h},function(f,l,h,y){return!T0(0,l,h,y)}),Aw=Pu("<",function(f,l,h){return l",function(f,l,h){return l>h},function(f,l,h,y){return y.compare(l,h)>0}),Ow=Pu("<=",function(f,l,h){return l<=h},function(f,l,h,y){return y.compare(l,h)<=0}),Nw=Pu(">=",function(f,l,h){return l>=h},function(f,l,h,y){return y.compare(l,h)>=0});class Kp{constructor(l,h,y,S,R){this.type=Lt,this.number=l,this.locale=h,this.currency=y,this.minFractionDigits=S,this.maxFractionDigits=R}static parse(l,h){if(l.length!==3)return h.error("Expected two arguments.");const y=h.parse(l[1],1,ot);if(!y)return null;const S=l[2];if(typeof S!="object"||Array.isArray(S))return h.error("NumberFormat options argument must be an object.");let R=null;if(S.locale&&(R=h.parse(S.locale,1,Lt),!R))return null;let D=null;if(S.currency&&(D=h.parse(S.currency,1,Lt),!D))return null;let $=null;if(S["min-fraction-digits"]&&($=h.parse(S["min-fraction-digits"],1,ot),!$))return null;let U=null;return S["max-fraction-digits"]&&(U=h.parse(S["max-fraction-digits"],1,ot),!U)?null:new Kp(y,R,D,$,U)}evaluate(l){return new Intl.NumberFormat(this.locale?this.locale.evaluate(l):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(l):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(l):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(l):void 0}).format(this.number.evaluate(l))}eachChild(l){l(this.number),this.locale&&l(this.locale),this.currency&&l(this.currency),this.minFractionDigits&&l(this.minFractionDigits),this.maxFractionDigits&&l(this.maxFractionDigits)}outputDefined(){return!1}}class Af{constructor(l){this.type=bn,this.sections=l}static parse(l,h){if(l.length<2)return h.error("Expected at least one argument.");const y=l[1];if(!Array.isArray(y)&&typeof y=="object")return h.error("First argument must be an image or text section.");const S=[];let R=!1;for(let D=1;D<=l.length-1;++D){const $=l[D];if(R&&typeof $=="object"&&!Array.isArray($)){R=!1;let U=null;if($["font-scale"]&&(U=h.parse($["font-scale"],1,ot),!U))return null;let W=null;if($["text-font"]&&(W=h.parse($["text-font"],1,gt(Lt)),!W))return null;let te=null;if($["text-color"]&&(te=h.parse($["text-color"],1,Kt),!te))return null;const ae=S[S.length-1];ae.scale=U,ae.font=W,ae.textColor=te}else{const U=h.parse(l[D],1,ht);if(!U)return null;const W=U.type.kind;if(W!=="string"&&W!=="value"&&W!=="null"&&W!=="resolvedImage")return h.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");R=!0,S.push({content:U,scale:null,font:null,textColor:null})}}return new Af(S)}evaluate(l){return new Pe(this.sections.map(h=>{const y=h.content.evaluate(l);return Ge(y)===Bt?new Ae("",y,null,null,null):new Ae(Ut(y),null,h.scale?h.scale.evaluate(l):null,h.font?h.font.evaluate(l).join(","):null,h.textColor?h.textColor.evaluate(l):null)}))}eachChild(l){for(const h of this.sections)l(h.content),h.scale&&l(h.scale),h.font&&l(h.font),h.textColor&&l(h.textColor)}outputDefined(){return!1}}class Wp{constructor(l){this.type=Bt,this.input=l}static parse(l,h){if(l.length!==2)return h.error("Expected two arguments.");const y=h.parse(l[1],1,Lt);return y?new Wp(y):h.error("No image name provided.")}evaluate(l){const h=this.input.evaluate(l),y=Be.fromString(h);return y&&l.availableImages&&(y.available=l.availableImages.indexOf(h)>-1),y}eachChild(l){l(this.input)}outputDefined(){return!1}}class Gp{constructor(l){this.type=ot,this.input=l}static parse(l,h){if(l.length!==2)return h.error(`Expected 1 argument, but found ${l.length-1} instead.`);const y=h.parse(l[1],1);return y?y.type.kind!=="array"&&y.type.kind!=="string"&&y.type.kind!=="value"?h.error(`Expected argument of type string or array, but found ${xt(y.type)} instead.`):new Gp(y):null}evaluate(l){const h=this.input.evaluate(l);if(typeof h=="string"||Array.isArray(h))return h.length;throw new at(`Expected value to be of type string or array, but found ${xt(Ge(h))} instead.`)}eachChild(l){l(this.input)}outputDefined(){return!1}}const Iu={"==":Mw,"!=":Rw,">":Dw,"<":Aw,">=":Nw,"<=":Ow,array:Xt,at:Vp,boolean:Xt,case:Hp,coalesce:Tf,collator:Zr,format:Af,image:Wp,in:Up,"index-of":Mf,interpolate:No,"interpolate-hcl":No,"interpolate-lab":No,length:Gp,let:kf,literal:Mt,match:jp,number:Xt,"number-format":Kp,object:Xt,slice:Rf,step:bs,string:Xt,"to-boolean":hn,"to-color":hn,"to-number":hn,"to-string":hn,var:Ui,within:xs};function k0(f,[l,h,y,S]){l=l.evaluate(f),h=h.evaluate(f),y=y.evaluate(f);const R=S?S.evaluate(f):1,D=Je(l,h,y,R);if(D)throw new at(D);return new ce(l/255*R,h/255*R,y/255*R,R)}function M0(f,l){return f in l}function Df(f,l){const h=l[f];return h===void 0?null:h}function Al(f){return{type:f}}function R0(f){return{result:"success",value:f}}function Tu(f){return{result:"error",value:f}}function zr(f){return f["property-type"]==="data-driven"||f["property-type"]==="cross-faded-data-driven"}function A0(f){return!!f.expression&&f.expression.parameters.indexOf("zoom")>-1}function ir(f){return!!f.expression&&f.expression.interpolated}function mr(f){return f instanceof Number?"number":f instanceof String?"string":f instanceof Boolean?"boolean":Array.isArray(f)?"array":f===null?"null":typeof f}function Rr(f){return typeof f=="object"&&f!==null&&!Array.isArray(f)}function jr(f){return f}function Hc(f,l){const h=l.type==="color",y=f.stops&&typeof f.stops[0][0]=="object",S=y||!(y||f.property!==void 0),R=f.type||(ir(l)?"exponential":"interval");if(h||l.type==="padding"){const W=h?ce.parse:Me.parse;(f=sn({},f)).stops&&(f.stops=f.stops.map(te=>[te[0],W(te[1])])),f.default=W(f.default?f.default:l.default)}if(f.colorSpace&&f.colorSpace!=="rgb"&&!P0[f.colorSpace])throw new Error(`Unknown color space: ${f.colorSpace}`);let D,$,U;if(R==="exponential")D=D0;else if(R==="interval")D=Fw;else if(R==="categorical"){D=Lw,$=Object.create(null);for(const W of f.stops)$[W[0]]=W[1];U=typeof f.stops[0][0]}else{if(R!=="identity")throw new Error(`Unknown function type "${R}"`);D=zw}if(y){const W={},te=[];for(let ge=0;gege[0]),evaluate:({zoom:ge},ve)=>D0({stops:ae,base:f.base},l,ge).evaluate(ge,ve)}}if(S){const W=R==="exponential"?{name:"exponential",base:f.base!==void 0?f.base:1}:null;return{kind:"camera",interpolationType:W,interpolationFactor:No.interpolationFactor.bind(void 0,W),zoomStops:f.stops.map(te=>te[0]),evaluate:({zoom:te})=>D(f,l,te,$,U)}}return{kind:"source",evaluate(W,te){const ae=te&&te.properties?te.properties[f.property]:void 0;return ae===void 0?ku(f.default,l.default):D(f,l,ae,$,U)}}}function ku(f,l,h){return f!==void 0?f:l!==void 0?l:h!==void 0?h:void 0}function Lw(f,l,h,y,S){return ku(typeof h===S?y[h]:void 0,f.default,l.default)}function Fw(f,l,h){if(mr(h)!=="number")return ku(f.default,l.default);const y=f.stops.length;if(y===1||h<=f.stops[0][0])return f.stops[0][1];if(h>=f.stops[y-1][0])return f.stops[y-1][1];const S=Rl(f.stops.map(R=>R[0]),h);return f.stops[S][1]}function D0(f,l,h){const y=f.base!==void 0?f.base:1;if(mr(h)!=="number")return ku(f.default,l.default);const S=f.stops.length;if(S===1||h<=f.stops[0][0])return f.stops[0][1];if(h>=f.stops[S-1][0])return f.stops[S-1][1];const R=Rl(f.stops.map(te=>te[0]),h),D=function(te,ae,de,ge){const ve=ge-de,Fe=te-de;return ve===0?0:ae===1?Fe/ve:(Math.pow(ae,Fe)-1)/(Math.pow(ae,ve)-1)}(h,y,f.stops[R][0],f.stops[R+1][0]),$=f.stops[R][1],U=f.stops[R+1][1];let W=_s[l.type]||jr;if(f.colorSpace&&f.colorSpace!=="rgb"){const te=P0[f.colorSpace];W=(ae,de)=>te.reverse(te.interpolate(te.forward(ae),te.forward(de),D))}return typeof $.evaluate=="function"?{evaluate(...te){const ae=$.evaluate.apply(void 0,te),de=U.evaluate.apply(void 0,te);if(ae!==void 0&&de!==void 0)return W(ae,de,D)}}:W($,U,D)}function zw(f,l,h){switch(l.type){case"color":h=ce.parse(h);break;case"formatted":h=Pe.fromString(h.toString());break;case"resolvedImage":h=Be.fromString(h.toString());break;case"padding":h=Me.parse(h);break;default:mr(h)===l.type||l.type==="enum"&&l.values[h]||(h=void 0)}return ku(h,f.default,l.default)}lr.register(Iu,{error:[{kind:"error"},[Lt],(f,[l])=>{throw new at(l.evaluate(f))}],typeof:[Lt,[ht],(f,[l])=>xt(Ge(l.evaluate(f)))],"to-rgba":[gt(ot,4),[Kt],(f,[l])=>l.evaluate(f).toArray()],rgb:[Kt,[ot,ot,ot],k0],rgba:[Kt,[ot,ot,ot,ot],k0],has:{type:Tt,overloads:[[[Lt],(f,[l])=>M0(l.evaluate(f),f.properties())],[[Lt,Zt],(f,[l,h])=>M0(l.evaluate(f),h.evaluate(f))]]},get:{type:ht,overloads:[[[Lt],(f,[l])=>Df(l.evaluate(f),f.properties())],[[Lt,Zt],(f,[l,h])=>Df(l.evaluate(f),h.evaluate(f))]]},"feature-state":[ht,[Lt],(f,[l])=>Df(l.evaluate(f),f.featureState||{})],properties:[Zt,[],f=>f.properties()],"geometry-type":[Lt,[],f=>f.geometryType()],id:[ht,[],f=>f.id()],zoom:[ot,[],f=>f.globals.zoom],"heatmap-density":[ot,[],f=>f.globals.heatmapDensity||0],"line-progress":[ot,[],f=>f.globals.lineProgress||0],accumulated:[ht,[],f=>f.globals.accumulated===void 0?null:f.globals.accumulated],"+":[ot,Al(ot),(f,l)=>{let h=0;for(const y of l)h+=y.evaluate(f);return h}],"*":[ot,Al(ot),(f,l)=>{let h=1;for(const y of l)h*=y.evaluate(f);return h}],"-":{type:ot,overloads:[[[ot,ot],(f,[l,h])=>l.evaluate(f)-h.evaluate(f)],[[ot],(f,[l])=>-l.evaluate(f)]]},"/":[ot,[ot,ot],(f,[l,h])=>l.evaluate(f)/h.evaluate(f)],"%":[ot,[ot,ot],(f,[l,h])=>l.evaluate(f)%h.evaluate(f)],ln2:[ot,[],()=>Math.LN2],pi:[ot,[],()=>Math.PI],e:[ot,[],()=>Math.E],"^":[ot,[ot,ot],(f,[l,h])=>Math.pow(l.evaluate(f),h.evaluate(f))],sqrt:[ot,[ot],(f,[l])=>Math.sqrt(l.evaluate(f))],log10:[ot,[ot],(f,[l])=>Math.log(l.evaluate(f))/Math.LN10],ln:[ot,[ot],(f,[l])=>Math.log(l.evaluate(f))],log2:[ot,[ot],(f,[l])=>Math.log(l.evaluate(f))/Math.LN2],sin:[ot,[ot],(f,[l])=>Math.sin(l.evaluate(f))],cos:[ot,[ot],(f,[l])=>Math.cos(l.evaluate(f))],tan:[ot,[ot],(f,[l])=>Math.tan(l.evaluate(f))],asin:[ot,[ot],(f,[l])=>Math.asin(l.evaluate(f))],acos:[ot,[ot],(f,[l])=>Math.acos(l.evaluate(f))],atan:[ot,[ot],(f,[l])=>Math.atan(l.evaluate(f))],min:[ot,Al(ot),(f,l)=>Math.min(...l.map(h=>h.evaluate(f)))],max:[ot,Al(ot),(f,l)=>Math.max(...l.map(h=>h.evaluate(f)))],abs:[ot,[ot],(f,[l])=>Math.abs(l.evaluate(f))],round:[ot,[ot],(f,[l])=>{const h=l.evaluate(f);return h<0?-Math.round(-h):Math.round(h)}],floor:[ot,[ot],(f,[l])=>Math.floor(l.evaluate(f))],ceil:[ot,[ot],(f,[l])=>Math.ceil(l.evaluate(f))],"filter-==":[Tt,[Lt,ht],(f,[l,h])=>f.properties()[l.value]===h.value],"filter-id-==":[Tt,[ht],(f,[l])=>f.id()===l.value],"filter-type-==":[Tt,[Lt],(f,[l])=>f.geometryType()===l.value],"filter-<":[Tt,[Lt,ht],(f,[l,h])=>{const y=f.properties()[l.value],S=h.value;return typeof y==typeof S&&y{const h=f.id(),y=l.value;return typeof h==typeof y&&h":[Tt,[Lt,ht],(f,[l,h])=>{const y=f.properties()[l.value],S=h.value;return typeof y==typeof S&&y>S}],"filter-id->":[Tt,[ht],(f,[l])=>{const h=f.id(),y=l.value;return typeof h==typeof y&&h>y}],"filter-<=":[Tt,[Lt,ht],(f,[l,h])=>{const y=f.properties()[l.value],S=h.value;return typeof y==typeof S&&y<=S}],"filter-id-<=":[Tt,[ht],(f,[l])=>{const h=f.id(),y=l.value;return typeof h==typeof y&&h<=y}],"filter->=":[Tt,[Lt,ht],(f,[l,h])=>{const y=f.properties()[l.value],S=h.value;return typeof y==typeof S&&y>=S}],"filter-id->=":[Tt,[ht],(f,[l])=>{const h=f.id(),y=l.value;return typeof h==typeof y&&h>=y}],"filter-has":[Tt,[ht],(f,[l])=>l.value in f.properties()],"filter-has-id":[Tt,[],f=>f.id()!==null&&f.id()!==void 0],"filter-type-in":[Tt,[gt(Lt)],(f,[l])=>l.value.indexOf(f.geometryType())>=0],"filter-id-in":[Tt,[gt(ht)],(f,[l])=>l.value.indexOf(f.id())>=0],"filter-in-small":[Tt,[Lt,gt(ht)],(f,[l,h])=>h.value.indexOf(f.properties()[l.value])>=0],"filter-in-large":[Tt,[Lt,gt(ht)],(f,[l,h])=>function(y,S,R,D){for(;R<=D;){const $=R+D>>1;if(S[$]===y)return!0;S[$]>y?D=$-1:R=$+1}return!1}(f.properties()[l.value],h.value,0,h.value.length-1)],all:{type:Tt,overloads:[[[Tt,Tt],(f,[l,h])=>l.evaluate(f)&&h.evaluate(f)],[Al(Tt),(f,l)=>{for(const h of l)if(!h.evaluate(f))return!1;return!0}]]},any:{type:Tt,overloads:[[[Tt,Tt],(f,[l,h])=>l.evaluate(f)||h.evaluate(f)],[Al(Tt),(f,l)=>{for(const h of l)if(h.evaluate(f))return!0;return!1}]]},"!":[Tt,[Tt],(f,[l])=>!l.evaluate(f)],"is-supported-script":[Tt,[Lt],(f,[l])=>{const h=f.globals&&f.globals.isSupportedScript;return!h||h(l.evaluate(f))}],upcase:[Lt,[Lt],(f,[l])=>l.evaluate(f).toUpperCase()],downcase:[Lt,[Lt],(f,[l])=>l.evaluate(f).toLowerCase()],concat:[Lt,Al(ht),(f,l)=>l.map(h=>Ut(h.evaluate(f))).join("")],"resolved-locale":[Lt,[xn],(f,[l])=>l.evaluate(f).resolvedLocale()]});class Of{constructor(l,h){this.expression=l,this._warningHistory={},this._evaluator=new Gn,this._defaultValue=h?function(y){return y.type==="color"&&Rr(y.default)?new ce(0,0,0,0):y.type==="color"?ce.parse(y.default)||null:y.type==="padding"?Me.parse(y.default)||null:y.default===void 0?null:y.default}(h):null,this._enumValues=h&&h.type==="enum"?h.values:null}evaluateWithoutErrorHandling(l,h,y,S,R,D){return this._evaluator.globals=l,this._evaluator.feature=h,this._evaluator.featureState=y,this._evaluator.canonical=S,this._evaluator.availableImages=R||null,this._evaluator.formattedSection=D,this.expression.evaluate(this._evaluator)}evaluate(l,h,y,S,R,D){this._evaluator.globals=l,this._evaluator.feature=h||null,this._evaluator.featureState=y||null,this._evaluator.canonical=S,this._evaluator.availableImages=R||null,this._evaluator.formattedSection=D||null;try{const $=this.expression.evaluate(this._evaluator);if($==null||typeof $=="number"&&$!=$)return this._defaultValue;if(this._enumValues&&!($ in this._enumValues))throw new at(`Expected value to be one of ${Object.keys(this._enumValues).map(U=>JSON.stringify(U)).join(", ")}, but found ${JSON.stringify($)} instead.`);return $}catch($){return this._warningHistory[$.message]||(this._warningHistory[$.message]=!0,typeof console<"u"&&console.warn($.message)),this._defaultValue}}}function Kc(f){return Array.isArray(f)&&f.length>0&&typeof f[0]=="string"&&f[0]in Iu}function Wc(f,l){const h=new Gs(Iu,[],l?function(S){const R={color:Kt,string:Lt,number:ot,enum:Lt,boolean:Tt,formatted:bn,padding:tn,resolvedImage:Bt};return S.type==="array"?gt(R[S.value]||ht,S.length):R[S.type]}(l):void 0),y=h.parse(f,void 0,void 0,void 0,l&&l.type==="string"?{typeAnnotation:"coerce"}:void 0);return y?R0(new Of(y,l)):Tu(h.errors)}class Gc{constructor(l,h){this.kind=l,this._styleExpression=h,this.isStateDependent=l!=="constant"&&!rr(h.expression)}evaluateWithoutErrorHandling(l,h,y,S,R,D){return this._styleExpression.evaluateWithoutErrorHandling(l,h,y,S,R,D)}evaluate(l,h,y,S,R,D){return this._styleExpression.evaluate(l,h,y,S,R,D)}}class qp{constructor(l,h,y,S){this.kind=l,this.zoomStops=y,this._styleExpression=h,this.isStateDependent=l!=="camera"&&!rr(h.expression),this.interpolationType=S}evaluateWithoutErrorHandling(l,h,y,S,R,D){return this._styleExpression.evaluateWithoutErrorHandling(l,h,y,S,R,D)}evaluate(l,h,y,S,R,D){return this._styleExpression.evaluate(l,h,y,S,R,D)}interpolationFactor(l,h,y){return this.interpolationType?No.interpolationFactor(this.interpolationType,l,h,y):0}}function O0(f,l){const h=Wc(f,l);if(h.result==="error")return h;const y=h.value.expression,S=Wn(y);if(!S&&!zr(l))return Tu([new Rt("","data expressions not supported")]);const R=Ur(y,["zoom"]);if(!R&&!A0(l))return Tu([new Rt("","zoom expressions not supported")]);const D=Lf(y);return D||R?D instanceof Rt?Tu([D]):D instanceof No&&!ir(l)?Tu([new Rt("",'"interpolate" expressions cannot be used with this property')]):R0(D?new qp(S?"camera":"composite",h.value,D.labels,D instanceof No?D.interpolation:void 0):new Gc(S?"constant":"source",h.value)):Tu([new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Nf{constructor(l,h){this._parameters=l,this._specification=h,sn(this,Hc(this._parameters,this._specification))}static deserialize(l){return new Nf(l._parameters,l._specification)}static serialize(l){return{_parameters:l._parameters,_specification:l._specification}}}function Lf(f){let l=null;if(f instanceof kf)l=Lf(f.result);else if(f instanceof Tf){for(const h of f.args)if(l=Lf(h),l)break}else(f instanceof bs||f instanceof No)&&f.input instanceof lr&&f.input.name==="zoom"&&(l=f);return l instanceof Rt||f.eachChild(h=>{const y=Lf(h);y instanceof Rt?l=y:!l&&y?l=new Rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):l&&y&&l!==y&&(l=new Rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),l}function ya(f){const l=f.key,h=f.value,y=f.valueSpec||{},S=f.objectElementValidators||{},R=f.style,D=f.styleSpec;let $=[];const U=mr(h);if(U!=="object")return[new Ze(l,h,`object expected, ${U} found`)];for(const W in h){const te=W.split(".")[0],ae=y[te]||y["*"];let de;if(S[te])de=S[te];else if(y[te])de=Fo;else if(S["*"])de=S["*"];else{if(!y["*"]){$.push(new Ze(l,h[W],`unknown property "${W}"`));continue}de=Fo}$=$.concat(de({key:(l&&`${l}.`)+W,value:h[W],valueSpec:ae,style:R,styleSpec:D,object:h,objectKey:W},h))}for(const W in y)S[W]||y[W].required&&y[W].default===void 0&&h[W]===void 0&&$.push(new Ze(l,h,`missing required property "${W}"`));return $}function N0(f){const l=f.value,h=f.valueSpec,y=f.style,S=f.styleSpec,R=f.key,D=f.arrayElementValidator||Fo;if(mr(l)!=="array")return[new Ze(R,l,`array expected, ${mr(l)} found`)];if(h.length&&l.length!==h.length)return[new Ze(R,l,`array length ${h.length} expected, length ${l.length} found`)];if(h["min-length"]&&l.lengthy.maximum?[new Ze(l,h,`${h} is greater than the maximum value ${y.maximum}`)]:[]}function L0(f){const l=f.valueSpec,h=Gt(f.value.type);let y,S,R,D={};const $=h!=="categorical"&&f.value.property===void 0,U=!$,W=mr(f.value.stops)==="array"&&mr(f.value.stops[0])==="array"&&mr(f.value.stops[0][0])==="object",te=ya({key:f.key,value:f.value,valueSpec:f.styleSpec.function,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{stops:function(ge){if(h==="identity")return[new Ze(ge.key,ge.value,'identity function may not have a "stops" property')];let ve=[];const Fe=ge.value;return ve=ve.concat(N0({key:ge.key,value:Fe,valueSpec:ge.valueSpec,style:ge.style,styleSpec:ge.styleSpec,arrayElementValidator:ae})),mr(Fe)==="array"&&Fe.length===0&&ve.push(new Ze(ge.key,Fe,"array must have at least one stop")),ve},default:function(ge){return Fo({key:ge.key,value:ge.value,valueSpec:l,style:ge.style,styleSpec:ge.styleSpec})}}});return h==="identity"&&$&&te.push(new Ze(f.key,f.value,'missing required property "property"')),h==="identity"||f.value.stops||te.push(new Ze(f.key,f.value,'missing required property "stops"')),h==="exponential"&&f.valueSpec.expression&&!ir(f.valueSpec)&&te.push(new Ze(f.key,f.value,"exponential functions not supported")),f.styleSpec.$version>=8&&(U&&!zr(f.valueSpec)?te.push(new Ze(f.key,f.value,"property functions not supported")):$&&!A0(f.valueSpec)&&te.push(new Ze(f.key,f.value,"zoom functions not supported"))),h!=="categorical"&&!W||f.value.property!==void 0||te.push(new Ze(f.key,f.value,'"property" property is required')),te;function ae(ge){let ve=[];const Fe=ge.value,Ne=ge.key;if(mr(Fe)!=="array")return[new Ze(Ne,Fe,`array expected, ${mr(Fe)} found`)];if(Fe.length!==2)return[new Ze(Ne,Fe,`array length 2 expected, length ${Fe.length} found`)];if(W){if(mr(Fe[0])!=="object")return[new Ze(Ne,Fe,`object expected, ${mr(Fe[0])} found`)];if(Fe[0].zoom===void 0)return[new Ze(Ne,Fe,"object stop key must have zoom")];if(Fe[0].value===void 0)return[new Ze(Ne,Fe,"object stop key must have value")];if(R&&R>Gt(Fe[0].zoom))return[new Ze(Ne,Fe[0].zoom,"stop zoom values must appear in ascending order")];Gt(Fe[0].zoom)!==R&&(R=Gt(Fe[0].zoom),S=void 0,D={}),ve=ve.concat(ya({key:`${Ne}[0]`,value:Fe[0],valueSpec:{zoom:{}},style:ge.style,styleSpec:ge.styleSpec,objectElementValidators:{zoom:Zp,value:de}}))}else ve=ve.concat(de({key:`${Ne}[0]`,value:Fe[0],valueSpec:{},style:ge.style,styleSpec:ge.styleSpec},Fe));return Kc(zt(Fe[1]))?ve.concat([new Ze(`${Ne}[1]`,Fe[1],"expressions are not allowed in function stops.")]):ve.concat(Fo({key:`${Ne}[1]`,value:Fe[1],valueSpec:l,style:ge.style,styleSpec:ge.styleSpec}))}function de(ge,ve){const Fe=mr(ge.value),Ne=Gt(ge.value),it=ge.value!==null?ge.value:ve;if(y){if(Fe!==y)return[new Ze(ge.key,it,`${Fe} stop domain type must match previous stop domain type ${y}`)]}else y=Fe;if(Fe!=="number"&&Fe!=="string"&&Fe!=="boolean")return[new Ze(ge.key,it,"stop domain value must be a number, string, or boolean")];if(Fe!=="number"&&h!=="categorical"){let yt=`number expected, ${Fe} found`;return zr(l)&&h===void 0&&(yt+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Ze(ge.key,it,yt)]}return h!=="categorical"||Fe!=="number"||isFinite(Ne)&&Math.floor(Ne)===Ne?h!=="categorical"&&Fe==="number"&&S!==void 0&&Nenew Ze(`${f.key}${y.key}`,f.value,y.message));const h=l.value.expression||l.value._styleExpression.expression;if(f.expressionContext==="property"&&f.propertyKey==="text-font"&&!h.outputDefined())return[new Ze(f.key,f.value,`Invalid data expression for "${f.propertyKey}". Output values must be contained as literals within the expression.`)];if(f.expressionContext==="property"&&f.propertyType==="layout"&&!rr(h))return[new Ze(f.key,f.value,'"feature-state" data expressions are not supported with layout properties.')];if(f.expressionContext==="filter"&&!rr(h))return[new Ze(f.key,f.value,'"feature-state" data expressions are not supported with filters.')];if(f.expressionContext&&f.expressionContext.indexOf("cluster")===0){if(!Ur(h,["zoom","feature-state"]))return[new Ze(f.key,f.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(f.expressionContext==="cluster-initial"&&!Wn(h))return[new Ze(f.key,f.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qc(f){const l=f.key,h=f.value,y=f.valueSpec,S=[];return Array.isArray(y.values)?y.values.indexOf(Gt(h))===-1&&S.push(new Ze(l,h,`expected one of [${y.values.join(", ")}], ${JSON.stringify(h)} found`)):Object.keys(y.values).indexOf(Gt(h))===-1&&S.push(new Ze(l,h,`expected one of [${Object.keys(y.values).join(", ")}], ${JSON.stringify(h)} found`)),S}function Mu(f){if(f===!0||f===!1)return!0;if(!Array.isArray(f)||f.length===0)return!1;switch(f[0]){case"has":return f.length>=2&&f[1]!=="$id"&&f[1]!=="$type";case"in":return f.length>=3&&(typeof f[1]!="string"||Array.isArray(f[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return f.length!==3||Array.isArray(f[1])||Array.isArray(f[2]);case"any":case"all":for(const l of f.slice(1))if(!Mu(l)&&typeof l!="boolean")return!1;return!0;default:return!0}}const $w={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Ff(f){if(f==null)return{filter:()=>!0,needGeometry:!1};Mu(f)||(f=Zc(f));const l=Wc(f,$w);if(l.result==="error")throw new Error(l.value.map(h=>`${h.key}: ${h.message}`).join(", "));return{filter:(h,y,S)=>l.value.evaluate(h,y,{},S),needGeometry:z0(f)}}function F0(f,l){return fl?1:0}function z0(f){if(!Array.isArray(f))return!1;if(f[0]==="within")return!0;for(let l=1;l"||l==="<="||l===">="?Xp(f[1],f[2],l):l==="any"?(h=f.slice(1),["any"].concat(h.map(Zc))):l==="all"?["all"].concat(f.slice(1).map(Zc)):l==="none"?["all"].concat(f.slice(1).map(Zc).map(Ru)):l==="in"?zf(f[1],f.slice(2)):l==="!in"?Ru(zf(f[1],f.slice(2))):l==="has"?Xc(f[1]):l==="!has"?Ru(Xc(f[1])):l!=="within"||f;var h}function Xp(f,l,h){switch(f){case"$type":return[`filter-type-${h}`,l];case"$id":return[`filter-id-${h}`,l];default:return[`filter-${h}`,f,l]}}function zf(f,l){if(l.length===0)return!1;switch(f){case"$type":return["filter-type-in",["literal",l]];case"$id":return["filter-id-in",["literal",l]];default:return l.length>200&&!l.some(h=>typeof h!=typeof l[0])?["filter-in-large",f,["literal",l.sort(F0)]]:["filter-in-small",f,["literal",l]]}}function Xc(f){switch(f){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",f]}}function Ru(f){return["!",f]}function Yc(f){return Mu(zt(f.value))?Dl(sn({},f,{expressionContext:"filter",valueSpec:{value:"boolean"}})):$0(f)}function $0(f){const l=f.value,h=f.key;if(mr(l)!=="array")return[new Ze(h,l,`array expected, ${mr(l)} found`)];const y=f.styleSpec;let S,R=[];if(l.length<1)return[new Ze(h,l,"filter array must have at least 1 element")];switch(R=R.concat(qc({key:`${h}[0]`,value:l[0],valueSpec:y.filter_operator,style:f.style,styleSpec:f.styleSpec})),Gt(l[0])){case"<":case"<=":case">":case">=":l.length>=2&&Gt(l[1])==="$type"&&R.push(new Ze(h,l,`"$type" cannot be use with operator "${l[0]}"`));case"==":case"!=":l.length!==3&&R.push(new Ze(h,l,`filter array for operator "${l[0]}" must have 3 elements`));case"in":case"!in":l.length>=2&&(S=mr(l[1]),S!=="string"&&R.push(new Ze(`${h}[1]`,l[1],`string expected, ${S} found`)));for(let D=2;D{W in h&&l.push(new Ze(y,h[W],`"${W}" is prohibited for ref layers`))}),S.layers.forEach(W=>{Gt(W.id)===$&&(U=W)}),U?U.ref?l.push(new Ze(y,h.ref,"ref cannot reference another ref layer")):D=Gt(U.type):l.push(new Ze(y,h.ref,`ref layer "${$}" not found`))}else if(D!=="background")if(h.source){const U=S.sources&&S.sources[h.source],W=U&&Gt(U.type);U?W==="vector"&&D==="raster"?l.push(new Ze(y,h.source,`layer "${h.id}" requires a raster source`)):W==="raster"&&D!=="raster"?l.push(new Ze(y,h.source,`layer "${h.id}" requires a vector source`)):W!=="vector"||h["source-layer"]?W==="raster-dem"&&D!=="hillshade"?l.push(new Ze(y,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):D!=="line"||!h.paint||!h.paint["line-gradient"]||W==="geojson"&&U.lineMetrics||l.push(new Ze(y,h,`layer "${h.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):l.push(new Ze(y,h,`layer "${h.id}" must specify a "source-layer"`)):l.push(new Ze(y,h.source,`source "${h.source}" not found`))}else l.push(new Ze(y,h,'missing required property "source"'));return l=l.concat(ya({key:y,value:h,valueSpec:R.layer,style:f.style,styleSpec:f.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Fo({key:`${y}.type`,value:h.type,valueSpec:R.layer.type,style:f.style,styleSpec:f.styleSpec,object:h,objectKey:"type"}),filter:Yc,layout:U=>ya({layer:h,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":W=>V0(sn({layerType:D},W))}}),paint:U=>ya({layer:h,key:U.key,value:U.value,style:U.style,styleSpec:U.styleSpec,objectElementValidators:{"*":W=>B0(sn({layerType:D},W))}})}})),l}function Au(f){const l=f.value,h=f.key,y=mr(l);return y!=="string"?[new Ze(h,l,`string expected, ${y} found`)]:[]}const j0={promoteId:function({key:f,value:l}){if(mr(l)==="string")return Au({key:f,value:l});{const h=[];for(const y in l)h.push(...Au({key:`${f}.${y}`,value:l[y]}));return h}}};function Jc(f){const l=f.value,h=f.key,y=f.styleSpec,S=f.style;if(!l.type)return[new Ze(h,l,'"type" is required')];const R=Gt(l.type);let D;switch(R){case"vector":case"raster":case"raster-dem":return D=ya({key:h,value:l,valueSpec:y[`source_${R.replace("-","_")}`],style:f.style,styleSpec:y,objectElementValidators:j0}),D;case"geojson":if(D=ya({key:h,value:l,valueSpec:y.source_geojson,style:S,styleSpec:y,objectElementValidators:j0}),l.cluster)for(const $ in l.clusterProperties){const[U,W]=l.clusterProperties[$],te=typeof U=="string"?[U,["accumulated"],["get",$]]:U;D.push(...Dl({key:`${h}.${$}.map`,value:W,expressionContext:"cluster-map"})),D.push(...Dl({key:`${h}.${$}.reduce`,value:te,expressionContext:"cluster-reduce"}))}return D;case"video":return ya({key:h,value:l,valueSpec:y.source_video,style:S,styleSpec:y});case"image":return ya({key:h,value:l,valueSpec:y.source_image,style:S,styleSpec:y});case"canvas":return[new Ze(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qc({key:`${h}.type`,value:l.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:S,styleSpec:y})}}function ed(f){const l=f.value,h=f.styleSpec,y=h.light,S=f.style;let R=[];const D=mr(l);if(l===void 0)return R;if(D!=="object")return R=R.concat([new Ze("light",l,`object expected, ${D} found`)]),R;for(const $ in l){const U=$.match(/^(.*)-transition$/);R=R.concat(U&&y[U[1]]&&y[U[1]].transition?Fo({key:$,value:l[$],valueSpec:h.transition,style:S,styleSpec:h}):y[$]?Fo({key:$,value:l[$],valueSpec:y[$],style:S,styleSpec:h}):[new Ze($,l[$],`unknown property "${$}"`)])}return R}function Lo(f){const l=f.value,h=f.styleSpec,y=h.terrain,S=f.style;let R=[];const D=mr(l);if(l===void 0)return R;if(D!=="object")return R=R.concat([new Ze("terrain",l,`object expected, ${D} found`)]),R;for(const $ in l)R=R.concat(y[$]?Fo({key:$,value:l[$],valueSpec:y[$],style:S,styleSpec:h}):[new Ze($,l[$],`unknown property "${$}"`)]);return R}const td={"*":()=>[],array:N0,boolean:function(f){const l=f.value,h=f.key,y=mr(l);return y!=="boolean"?[new Ze(h,l,`boolean expected, ${y} found`)]:[]},number:Zp,color:function(f){const l=f.key,h=f.value,y=mr(h);return y!=="string"?[new Ze(l,h,`color expected, ${y} found`)]:tr(h)===null?[new Ze(l,h,`color expected, "${h}" found`)]:[]},constants:Yt,enum:qc,filter:Yc,function:L0,layer:U0,object:ya,source:Jc,light:ed,terrain:Lo,string:Au,formatted:function(f){return Au(f).length===0?[]:Dl(f)},resolvedImage:function(f){return Au(f).length===0?[]:Dl(f)},padding:function(f){const l=f.key,h=f.value;if(mr(h)==="array"){if(h.length<1||h.length>4)return[new Ze(l,h,`padding requires 1 to 4 values; ${h.length} values found`)];const y={type:"number"};let S=[];for(let R=0;R[]}})),f.constants&&(h=h.concat(Yt({key:"constants",value:f.constants,style:f,styleSpec:l}))),H0(h)}function H0(f){return[].concat(f).sort((l,h)=>l.line-h.line)}function ws(f){return function(...l){return H0(f.apply(this,l))}}qs.source=ws(Jc),qs.light=ws(ed),qs.terrain=ws(Lo),qs.layer=ws(U0),qs.filter=ws(Yc),qs.paintProperty=ws(B0),qs.layoutProperty=ws(V0);const nd=qs,Yp=nd.light,Vw=nd.paintProperty,Uw=nd.layoutProperty;function $f(f,l){let h=!1;if(l&&l.length)for(const y of l)f.fire(new Nt(new Error(y.message))),h=!0;return h}class rd{constructor(l,h,y){const S=this.cells=[];if(l instanceof ArrayBuffer){this.arrayBuffer=l;const D=new Int32Array(this.arrayBuffer);l=D[0],this.d=(h=D[1])+2*(y=D[2]);for(let U=0;U=ae[ve+0]&&S>=ae[ve+1])?($[ge]=!0,D.push(te[ge])):$[ge]=!1}}}}_forEachCell(l,h,y,S,R,D,$,U){const W=this._convertToCellCoord(l),te=this._convertToCellCoord(h),ae=this._convertToCellCoord(y),de=this._convertToCellCoord(S);for(let ge=W;ge<=ae;ge++)for(let ve=te;ve<=de;ve++){const Fe=this.d*ve+ge;if((!U||U(this._convertFromCellCoord(ge),this._convertFromCellCoord(ve),this._convertFromCellCoord(ge+1),this._convertFromCellCoord(ve+1)))&&R.call(this,l,h,y,S,Fe,D,$,U))return}}_convertFromCellCoord(l){return(l-this.padding)/this.scale}_convertToCellCoord(l){return Math.max(0,Math.min(this.d-1,Math.floor(l*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const l=this.cells,h=3+this.cells.length+1+1;let y=0;for(let D=0;D=0)continue;const D=f[R];S[R]=Cs[y].shallow.indexOf(R)>=0?D:Ol(D,l)}f instanceof Error&&(S.message=f.message)}if(S.$name)throw new Error("$name property is reserved for worker serialization logic.");return y!=="Object"&&(S.$name=y),S}throw new Error("can't serialize object of type "+typeof f)}function Zs(f){if(f==null||typeof f=="boolean"||typeof f=="number"||typeof f=="string"||f instanceof Boolean||f instanceof Number||f instanceof String||f instanceof Date||f instanceof RegExp||f instanceof Blob||K0(f)||Q(f)||ArrayBuffer.isView(f)||f instanceof ImageData)return f;if(Array.isArray(f))return f.map(Zs);if(typeof f=="object"){const l=f.$name||"Object";if(!Cs[l])throw new Error(`can't deserialize unregistered class ${l}`);const{klass:h}=Cs[l];if(!h)throw new Error(`can't deserialize unregistered class ${l}`);if(h.deserialize)return h.deserialize(f);const y=Object.create(h.prototype);for(const S of Object.keys(f)){if(S==="$name")continue;const R=f[S];y[S]=Cs[l].shallow.indexOf(S)>=0?R:Zs(R)}return y}throw new Error("can't deserialize object of type "+typeof f)}class Qp{constructor(){this.first=!0}update(l,h){const y=Math.floor(l);return this.first?(this.first=!1,this.lastIntegerZoom=y,this.lastIntegerZoomTime=0,this.lastZoom=l,this.lastFloorZoom=y,!0):(this.lastFloorZoom>y?(this.lastIntegerZoom=y+1,this.lastIntegerZoomTime=h):this.lastFloorZoomf>=128&&f<=255,Arabic:f=>f>=1536&&f<=1791,"Arabic Supplement":f=>f>=1872&&f<=1919,"Arabic Extended-A":f=>f>=2208&&f<=2303,"Hangul Jamo":f=>f>=4352&&f<=4607,"Unified Canadian Aboriginal Syllabics":f=>f>=5120&&f<=5759,Khmer:f=>f>=6016&&f<=6143,"Unified Canadian Aboriginal Syllabics Extended":f=>f>=6320&&f<=6399,"General Punctuation":f=>f>=8192&&f<=8303,"Letterlike Symbols":f=>f>=8448&&f<=8527,"Number Forms":f=>f>=8528&&f<=8591,"Miscellaneous Technical":f=>f>=8960&&f<=9215,"Control Pictures":f=>f>=9216&&f<=9279,"Optical Character Recognition":f=>f>=9280&&f<=9311,"Enclosed Alphanumerics":f=>f>=9312&&f<=9471,"Geometric Shapes":f=>f>=9632&&f<=9727,"Miscellaneous Symbols":f=>f>=9728&&f<=9983,"Miscellaneous Symbols and Arrows":f=>f>=11008&&f<=11263,"CJK Radicals Supplement":f=>f>=11904&&f<=12031,"Kangxi Radicals":f=>f>=12032&&f<=12255,"Ideographic Description Characters":f=>f>=12272&&f<=12287,"CJK Symbols and Punctuation":f=>f>=12288&&f<=12351,Hiragana:f=>f>=12352&&f<=12447,Katakana:f=>f>=12448&&f<=12543,Bopomofo:f=>f>=12544&&f<=12591,"Hangul Compatibility Jamo":f=>f>=12592&&f<=12687,Kanbun:f=>f>=12688&&f<=12703,"Bopomofo Extended":f=>f>=12704&&f<=12735,"CJK Strokes":f=>f>=12736&&f<=12783,"Katakana Phonetic Extensions":f=>f>=12784&&f<=12799,"Enclosed CJK Letters and Months":f=>f>=12800&&f<=13055,"CJK Compatibility":f=>f>=13056&&f<=13311,"CJK Unified Ideographs Extension A":f=>f>=13312&&f<=19903,"Yijing Hexagram Symbols":f=>f>=19904&&f<=19967,"CJK Unified Ideographs":f=>f>=19968&&f<=40959,"Yi Syllables":f=>f>=40960&&f<=42127,"Yi Radicals":f=>f>=42128&&f<=42191,"Hangul Jamo Extended-A":f=>f>=43360&&f<=43391,"Hangul Syllables":f=>f>=44032&&f<=55215,"Hangul Jamo Extended-B":f=>f>=55216&&f<=55295,"Private Use Area":f=>f>=57344&&f<=63743,"CJK Compatibility Ideographs":f=>f>=63744&&f<=64255,"Arabic Presentation Forms-A":f=>f>=64336&&f<=65023,"Vertical Forms":f=>f>=65040&&f<=65055,"CJK Compatibility Forms":f=>f>=65072&&f<=65103,"Small Form Variants":f=>f>=65104&&f<=65135,"Arabic Presentation Forms-B":f=>f>=65136&&f<=65279,"Halfwidth and Fullwidth Forms":f=>f>=65280&&f<=65519};function Bf(f){for(const l of f)if(em(l.charCodeAt(0)))return!0;return!1}function jw(f){for(const l of f)if(!Jp(l.charCodeAt(0)))return!1;return!0}function Jp(f){return!(un.Arabic(f)||un["Arabic Supplement"](f)||un["Arabic Extended-A"](f)||un["Arabic Presentation Forms-A"](f)||un["Arabic Presentation Forms-B"](f))}function em(f){return!(f!==746&&f!==747&&(f<4352||!(un["Bopomofo Extended"](f)||un.Bopomofo(f)||un["CJK Compatibility Forms"](f)&&!(f>=65097&&f<=65103)||un["CJK Compatibility Ideographs"](f)||un["CJK Compatibility"](f)||un["CJK Radicals Supplement"](f)||un["CJK Strokes"](f)||!(!un["CJK Symbols and Punctuation"](f)||f>=12296&&f<=12305||f>=12308&&f<=12319||f===12336)||un["CJK Unified Ideographs Extension A"](f)||un["CJK Unified Ideographs"](f)||un["Enclosed CJK Letters and Months"](f)||un["Hangul Compatibility Jamo"](f)||un["Hangul Jamo Extended-A"](f)||un["Hangul Jamo Extended-B"](f)||un["Hangul Jamo"](f)||un["Hangul Syllables"](f)||un.Hiragana(f)||un["Ideographic Description Characters"](f)||un.Kanbun(f)||un["Kangxi Radicals"](f)||un["Katakana Phonetic Extensions"](f)||un.Katakana(f)&&f!==12540||!(!un["Halfwidth and Fullwidth Forms"](f)||f===65288||f===65289||f===65293||f>=65306&&f<=65310||f===65339||f===65341||f===65343||f>=65371&&f<=65503||f===65507||f>=65512&&f<=65519)||!(!un["Small Form Variants"](f)||f>=65112&&f<=65118||f>=65123&&f<=65126)||un["Unified Canadian Aboriginal Syllabics"](f)||un["Unified Canadian Aboriginal Syllabics Extended"](f)||un["Vertical Forms"](f)||un["Yijing Hexagram Symbols"](f)||un["Yi Syllables"](f)||un["Yi Radicals"](f))))}function W0(f){return!(em(f)||function(l){return!!(un["Latin-1 Supplement"](l)&&(l===167||l===169||l===174||l===177||l===188||l===189||l===190||l===215||l===247)||un["General Punctuation"](l)&&(l===8214||l===8224||l===8225||l===8240||l===8241||l===8251||l===8252||l===8258||l===8263||l===8264||l===8265||l===8273)||un["Letterlike Symbols"](l)||un["Number Forms"](l)||un["Miscellaneous Technical"](l)&&(l>=8960&&l<=8967||l>=8972&&l<=8991||l>=8996&&l<=9e3||l===9003||l>=9085&&l<=9114||l>=9150&&l<=9165||l===9167||l>=9169&&l<=9179||l>=9186&&l<=9215)||un["Control Pictures"](l)&&l!==9251||un["Optical Character Recognition"](l)||un["Enclosed Alphanumerics"](l)||un["Geometric Shapes"](l)||un["Miscellaneous Symbols"](l)&&!(l>=9754&&l<=9759)||un["Miscellaneous Symbols and Arrows"](l)&&(l>=11026&&l<=11055||l>=11088&&l<=11097||l>=11192&&l<=11243)||un["CJK Symbols and Punctuation"](l)||un.Katakana(l)||un["Private Use Area"](l)||un["CJK Compatibility Forms"](l)||un["Small Form Variants"](l)||un["Halfwidth and Fullwidth Forms"](l)||l===8734||l===8756||l===8757||l>=9984&&l<=10087||l>=10102&&l<=10131||l===65532||l===65533)}(f))}function G0(f){return f>=1424&&f<=2303||un["Arabic Presentation Forms-A"](f)||un["Arabic Presentation Forms-B"](f)}function Hw(f,l){return!(!l&&G0(f)||f>=2304&&f<=3583||f>=3840&&f<=4255||un.Khmer(f))}function q0(f){for(const l of f)if(G0(l.charCodeAt(0)))return!0;return!1}const tm="deferred",nm="loading",rm="loaded";let im=null,xo="unavailable",Xs=null;const Z0=function(f){f&&typeof f=="string"&&f.indexOf("NetworkError")>-1&&(xo="error"),im&&im(f)};function Du(){om.fire(new Dt("pluginStateChange",{pluginStatus:xo,pluginURL:Xs}))}const om=new jt,id=function(){return xo},X0=function(){if(xo!==tm||!Xs)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");xo=nm,Du(),Xs&&ct({url:Xs},f=>{f?Z0(f):(xo=rm,Du())})},ea={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>xo===rm||ea.applyArabicShaping!=null,isLoading:()=>xo===nm,setState(f){if(!B())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");xo=f.pluginStatus,Xs=f.pluginURL},isParsed(){if(!B())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return ea.applyArabicShaping!=null&&ea.processBidirectionalText!=null&&ea.processStyledBidirectionalText!=null},getPluginURL(){if(!B())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Xs}};class Hr{constructor(l,h){this.zoom=l,h?(this.now=h.now,this.fadeDuration=h.fadeDuration,this.zoomHistory=h.zoomHistory,this.transition=h.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Qp,this.transition={})}isSupportedScript(l){return function(h,y){for(const S of h)if(!Hw(S.charCodeAt(0),y))return!1;return!0}(l,ea.isLoaded())}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const l=this.zoom,h=l-Math.floor(l),y=this.crossFadingFactor();return l>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:h+(1-h)*y}:{fromScale:.5,toScale:1,t:1-(1-y)*h}}}class od{constructor(l,h){this.property=l,this.value=h,this.expression=function(y,S){if(Rr(y))return new Nf(y,S);if(Kc(y)){const R=O0(y,S);if(R.result==="error")throw new Error(R.value.map(D=>`${D.key}: ${D.message}`).join(", "));return R.value}{let R=y;return S.type==="color"&&typeof y=="string"?R=ce.parse(y):S.type!=="padding"||typeof y!="number"&&!Array.isArray(y)||(R=Me.parse(y)),{kind:"constant",evaluate:()=>R}}}(h===void 0?l.specification.default:h,l.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(l,h,y){return this.property.possiblyEvaluate(this,l,h,y)}}class Vf{constructor(l){this.property=l,this.value=new od(l,void 0)}transitioned(l,h){return new Q0(this.property,this.value,h,_({},l.transition,this.transition),l.now)}untransitioned(){return new Q0(this.property,this.value,null,{},0)}}class Y0{constructor(l){this._properties=l,this._values=Object.create(l.defaultTransitionablePropertyValues)}getValue(l){return O(this._values[l].value.value)}setValue(l,h){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new Vf(this._values[l].property)),this._values[l].value=new od(this._values[l].property,h===null?void 0:O(h))}getTransition(l){return O(this._values[l].transition)}setTransition(l,h){Object.prototype.hasOwnProperty.call(this._values,l)||(this._values[l]=new Vf(this._values[l].property)),this._values[l].transition=O(h)||void 0}serialize(){const l={};for(const h of Object.keys(this._values)){const y=this.getValue(h);y!==void 0&&(l[h]=y);const S=this.getTransition(h);S!==void 0&&(l[`${h}-transition`]=S)}return l}transitioned(l,h){const y=new J0(this._properties);for(const S of Object.keys(this._values))y._values[S]=this._values[S].transitioned(l,h._values[S]);return y}untransitioned(){const l=new J0(this._properties);for(const h of Object.keys(this._values))l._values[h]=this._values[h].untransitioned();return l}}class Q0{constructor(l,h,y,S,R){this.property=l,this.value=h,this.begin=R+S.delay||0,this.end=this.begin+S.duration||0,l.specification.transition&&(S.delay||S.duration)&&(this.prior=y)}possiblyEvaluate(l,h,y){const S=l.now||0,R=this.value.possiblyEvaluate(l,h,y),D=this.prior;if(D){if(S>this.end)return this.prior=null,R;if(this.value.isDataDriven())return this.prior=null,R;if(S=1)return 1;const W=U*U,te=W*U;return 4*(U<.5?te:3*(U-W)+te-.75)}($))}}return R}}class J0{constructor(l){this._properties=l,this._values=Object.create(l.defaultTransitioningPropertyValues)}possiblyEvaluate(l,h,y){const S=new ad(this._properties);for(const R of Object.keys(this._values))S._values[R]=this._values[R].possiblyEvaluate(l,h,y);return S}hasTransition(){for(const l of Object.keys(this._values))if(this._values[l].prior)return!0;return!1}}class Kw{constructor(l){this._properties=l,this._values=Object.create(l.defaultPropertyValues)}getValue(l){return O(this._values[l].value)}setValue(l,h){this._values[l]=new od(this._values[l].property,h===null?void 0:O(h))}serialize(){const l={};for(const h of Object.keys(this._values)){const y=this.getValue(h);y!==void 0&&(l[h]=y)}return l}possiblyEvaluate(l,h,y){const S=new ad(this._properties);for(const R of Object.keys(this._values))S._values[R]=this._values[R].possiblyEvaluate(l,h,y);return S}}class ja{constructor(l,h,y){this.property=l,this.value=h,this.parameters=y}isConstant(){return this.value.kind==="constant"}constantOr(l){return this.value.kind==="constant"?this.value.value:l}evaluate(l,h,y,S){return this.property.evaluate(this.value,this.parameters,l,h,y,S)}}class ad{constructor(l){this._properties=l,this._values=Object.create(l.defaultPossiblyEvaluatedValues)}get(l){return this._values[l]}}class wn{constructor(l){this.specification=l}possiblyEvaluate(l,h){if(l.isDataDriven())throw new Error("Value should not be data driven");return l.expression.evaluate(h)}interpolate(l,h,y){const S=_s[this.specification.type];return S?S(l,h,y):l}}class Dn{constructor(l,h){this.specification=l,this.overrides=h}possiblyEvaluate(l,h,y,S){return new ja(this,l.expression.kind==="constant"||l.expression.kind==="camera"?{kind:"constant",value:l.expression.evaluate(h,null,{},y,S)}:l.expression,h)}interpolate(l,h,y){if(l.value.kind!=="constant"||h.value.kind!=="constant")return l;if(l.value.value===void 0||h.value.value===void 0)return new ja(this,{kind:"constant",value:void 0},l.parameters);const S=_s[this.specification.type];return S?new ja(this,{kind:"constant",value:S(l.value.value,h.value.value,y)},l.parameters):l}evaluate(l,h,y,S,R,D){return l.kind==="constant"?l.value:l.evaluate(h,y,S,R,D)}}class Ou extends Dn{possiblyEvaluate(l,h,y,S){if(l.value===void 0)return new ja(this,{kind:"constant",value:void 0},h);if(l.expression.kind==="constant"){const R=l.expression.evaluate(h,null,{},y,S),D=l.property.specification.type==="resolvedImage"&&typeof R!="string"?R.name:R,$=this._calculate(D,D,D,h);return new ja(this,{kind:"constant",value:$},h)}if(l.expression.kind==="camera"){const R=this._calculate(l.expression.evaluate({zoom:h.zoom-1}),l.expression.evaluate({zoom:h.zoom}),l.expression.evaluate({zoom:h.zoom+1}),h);return new ja(this,{kind:"constant",value:R},h)}return new ja(this,l.expression,h)}evaluate(l,h,y,S,R,D){if(l.kind==="source"){const $=l.evaluate(h,y,S,R,D);return this._calculate($,$,$,h)}return l.kind==="composite"?this._calculate(l.evaluate({zoom:Math.floor(h.zoom)-1},y,S),l.evaluate({zoom:Math.floor(h.zoom)},y,S),l.evaluate({zoom:Math.floor(h.zoom)+1},y,S),h):l.value}_calculate(l,h,y,S){return S.zoom>S.zoomHistory.lastIntegerZoom?{from:l,to:h}:{from:y,to:h}}interpolate(l){return l}}class am{constructor(l){this.specification=l}possiblyEvaluate(l,h,y,S){if(l.value!==void 0){if(l.expression.kind==="constant"){const R=l.expression.evaluate(h,null,{},y,S);return this._calculate(R,R,R,h)}return this._calculate(l.expression.evaluate(new Hr(Math.floor(h.zoom-1),h)),l.expression.evaluate(new Hr(Math.floor(h.zoom),h)),l.expression.evaluate(new Hr(Math.floor(h.zoom+1),h)),h)}}_calculate(l,h,y,S){return S.zoom>S.zoomHistory.lastIntegerZoom?{from:l,to:h}:{from:y,to:h}}interpolate(l){return l}}class Ys{constructor(l){this.specification=l}possiblyEvaluate(l,h,y,S){return!!l.expression.evaluate(h,null,{},y,S)}interpolate(){return!1}}class ji{constructor(l){this.properties=l,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const h in l){const y=l[h];y.specification.overridable&&this.overridableProperties.push(h);const S=this.defaultPropertyValues[h]=new od(y,void 0),R=this.defaultTransitionablePropertyValues[h]=new Vf(y);this.defaultTransitioningPropertyValues[h]=R.untransitioned(),this.defaultPossiblyEvaluatedValues[h]=S.possiblyEvaluate({})}}}yn("DataDrivenProperty",Dn),yn("DataConstantProperty",wn),yn("CrossFadedDataDrivenProperty",Ou),yn("CrossFadedProperty",am),yn("ColorRampProperty",Ys);const Qs="-transition";class Ha extends jt{constructor(l,h){if(super(),this.id=l.id,this.type=l.type,this._featureFilter={filter:()=>!0,needGeometry:!1},l.type!=="custom"&&(this.metadata=l.metadata,this.minzoom=l.minzoom,this.maxzoom=l.maxzoom,l.type!=="background"&&(this.source=l.source,this.sourceLayer=l["source-layer"],this.filter=l.filter),h.layout&&(this._unevaluatedLayout=new Kw(h.layout)),h.paint)){this._transitionablePaint=new Y0(h.paint);for(const y in l.paint)this.setPaintProperty(y,l.paint[y],{validate:!1});for(const y in l.layout)this.setLayoutProperty(y,l.layout[y],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ad(h.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(l){return l==="visibility"?this.visibility:this._unevaluatedLayout.getValue(l)}setLayoutProperty(l,h,y={}){h!=null&&this._validate(Uw,`layers.${this.id}.layout.${l}`,l,h,y)||(l!=="visibility"?this._unevaluatedLayout.setValue(l,h):this.visibility=h)}getPaintProperty(l){return l.endsWith(Qs)?this._transitionablePaint.getTransition(l.slice(0,-Qs.length)):this._transitionablePaint.getValue(l)}setPaintProperty(l,h,y={}){if(h!=null&&this._validate(Vw,`layers.${this.id}.paint.${l}`,l,h,y))return!1;if(l.endsWith(Qs))return this._transitionablePaint.setTransition(l.slice(0,-Qs.length),h||void 0),!1;{const S=this._transitionablePaint._values[l],R=S.property.specification["property-type"]==="cross-faded-data-driven",D=S.value.isDataDriven(),$=S.value;this._transitionablePaint.setValue(l,h),this._handleSpecialPaintPropertyUpdate(l);const U=this._transitionablePaint._values[l].value;return U.isDataDriven()||D||R||this._handleOverridablePaintPropertyUpdate(l,$,U)}}_handleSpecialPaintPropertyUpdate(l){}_handleOverridablePaintPropertyUpdate(l,h,y){return!1}isHidden(l){return!!(this.minzoom&&l=this.maxzoom)||this.visibility==="none"}updateTransitions(l){this._transitioningPaint=this._transitionablePaint.transitioned(l,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(l,h){l.getCrossfadeParameters&&(this._crossfadeParameters=l.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(l,void 0,h)),this.paint=this._transitioningPaint.possiblyEvaluate(l,void 0,h)}serialize(){const l={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&&(l.layout=l.layout||{},l.layout.visibility=this.visibility),M(l,(h,y)=>!(h===void 0||y==="layout"&&!Object.keys(h).length||y==="paint"&&!Object.keys(h).length))}_validate(l,h,y,S,R={}){return(!R||R.validate!==!1)&&$f(this,l.call(nd,{key:h,layerType:this.type,objectKey:y,value:S,styleSpec:Ve,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const l in this.paint._values){const h=this.paint.get(l);if(h instanceof ja&&zr(h.property.specification)&&(h.value.kind==="source"||h.value.kind==="composite")&&h.value.isStateDependent)return!0}return!1}}const ey={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Js{constructor(l,h){this._structArray=l,this._pos1=h*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class ii{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(l,h){return l._trim(),h&&(l.isTransferred=!0,h.push(l.arrayBuffer)),{length:l.length,arrayBuffer:l.arrayBuffer}}static deserialize(l){const h=Object.create(this.prototype);return h.arrayBuffer=l.arrayBuffer,h.length=l.length,h.capacity=l.arrayBuffer.byteLength/h.bytesPerElement,h._refreshViews(),h}_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(l){this.reserve(l),this.length=l}reserve(l){if(l>this.capacity){this.capacity=Math.max(l,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const h=this.uint8;this._refreshViews(),h&&this.uint8.set(h)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function gi(f,l=1){let h=0,y=0;return{members:f.map(S=>{const R=ey[S.type].BYTES_PER_ELEMENT,D=h=sm(h,Math.max(l,R)),$=S.components||1;return y=Math.max(y,R),h+=R*$,{name:S.name,type:S.type,components:$,offset:D}}),size:sm(h,Math.max(y,l)),alignment:l}}function sm(f,l){return Math.ceil(f/l)*l}class Nl extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const S=2*l;return this.int16[S+0]=h,this.int16[S+1]=y,l}}Nl.prototype.bytesPerElement=4,yn("StructArrayLayout2i4",Nl);class C extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,S){const R=this.length;return this.resize(R+1),this.emplace(R,l,h,y,S)}emplace(l,h,y,S,R){const D=4*l;return this.int16[D+0]=h,this.int16[D+1]=y,this.int16[D+2]=S,this.int16[D+3]=R,l}}C.prototype.bytesPerElement=8,yn("StructArrayLayout4i8",C);class c extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R,D){const $=this.length;return this.resize($+1),this.emplace($,l,h,y,S,R,D)}emplace(l,h,y,S,R,D,$){const U=6*l;return this.int16[U+0]=h,this.int16[U+1]=y,this.int16[U+2]=S,this.int16[U+3]=R,this.int16[U+4]=D,this.int16[U+5]=$,l}}c.prototype.bytesPerElement=12,yn("StructArrayLayout2i4i12",c);class g extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R,D){const $=this.length;return this.resize($+1),this.emplace($,l,h,y,S,R,D)}emplace(l,h,y,S,R,D,$){const U=4*l,W=8*l;return this.int16[U+0]=h,this.int16[U+1]=y,this.uint8[W+4]=S,this.uint8[W+5]=R,this.uint8[W+6]=D,this.uint8[W+7]=$,l}}g.prototype.bytesPerElement=8,yn("StructArrayLayout2i4ub8",g);class b extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const S=2*l;return this.float32[S+0]=h,this.float32[S+1]=y,l}}b.prototype.bytesPerElement=8,yn("StructArrayLayout2f8",b);class E extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R,D,$,U,W,te){const ae=this.length;return this.resize(ae+1),this.emplace(ae,l,h,y,S,R,D,$,U,W,te)}emplace(l,h,y,S,R,D,$,U,W,te,ae){const de=10*l;return this.uint16[de+0]=h,this.uint16[de+1]=y,this.uint16[de+2]=S,this.uint16[de+3]=R,this.uint16[de+4]=D,this.uint16[de+5]=$,this.uint16[de+6]=U,this.uint16[de+7]=W,this.uint16[de+8]=te,this.uint16[de+9]=ae,l}}E.prototype.bytesPerElement=20,yn("StructArrayLayout10ui20",E);class A extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R,D,$,U,W,te,ae,de){const ge=this.length;return this.resize(ge+1),this.emplace(ge,l,h,y,S,R,D,$,U,W,te,ae,de)}emplace(l,h,y,S,R,D,$,U,W,te,ae,de,ge){const ve=12*l;return this.int16[ve+0]=h,this.int16[ve+1]=y,this.int16[ve+2]=S,this.int16[ve+3]=R,this.uint16[ve+4]=D,this.uint16[ve+5]=$,this.uint16[ve+6]=U,this.uint16[ve+7]=W,this.int16[ve+8]=te,this.int16[ve+9]=ae,this.int16[ve+10]=de,this.int16[ve+11]=ge,l}}A.prototype.bytesPerElement=24,yn("StructArrayLayout4i4ui4i24",A);class z extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y){const S=this.length;return this.resize(S+1),this.emplace(S,l,h,y)}emplace(l,h,y,S){const R=3*l;return this.float32[R+0]=h,this.float32[R+1]=y,this.float32[R+2]=S,l}}z.prototype.bytesPerElement=12,yn("StructArrayLayout3f12",z);class j extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.uint32[1*l+0]=h,l}}j.prototype.bytesPerElement=4,yn("StructArrayLayout1ul4",j);class K extends ii{_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(l,h,y,S,R,D,$,U,W){const te=this.length;return this.resize(te+1),this.emplace(te,l,h,y,S,R,D,$,U,W)}emplace(l,h,y,S,R,D,$,U,W,te){const ae=10*l,de=5*l;return this.int16[ae+0]=h,this.int16[ae+1]=y,this.int16[ae+2]=S,this.int16[ae+3]=R,this.int16[ae+4]=D,this.int16[ae+5]=$,this.uint32[de+3]=U,this.uint16[ae+8]=W,this.uint16[ae+9]=te,l}}K.prototype.bytesPerElement=20,yn("StructArrayLayout6i1ul2ui20",K);class Y extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R,D){const $=this.length;return this.resize($+1),this.emplace($,l,h,y,S,R,D)}emplace(l,h,y,S,R,D,$){const U=6*l;return this.int16[U+0]=h,this.int16[U+1]=y,this.int16[U+2]=S,this.int16[U+3]=R,this.int16[U+4]=D,this.int16[U+5]=$,l}}Y.prototype.bytesPerElement=12,yn("StructArrayLayout2i2i2i12",Y);class ie extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y,S,R){const D=this.length;return this.resize(D+1),this.emplace(D,l,h,y,S,R)}emplace(l,h,y,S,R,D){const $=4*l,U=8*l;return this.float32[$+0]=h,this.float32[$+1]=y,this.float32[$+2]=S,this.int16[U+6]=R,this.int16[U+7]=D,l}}ie.prototype.bytesPerElement=16,yn("StructArrayLayout2f1f2i16",ie);class ue extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,S){const R=this.length;return this.resize(R+1),this.emplace(R,l,h,y,S)}emplace(l,h,y,S,R){const D=12*l,$=3*l;return this.uint8[D+0]=h,this.uint8[D+1]=y,this.float32[$+1]=S,this.float32[$+2]=R,l}}ue.prototype.bytesPerElement=12,yn("StructArrayLayout2ub2f12",ue);class me extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y){const S=this.length;return this.resize(S+1),this.emplace(S,l,h,y)}emplace(l,h,y,S){const R=3*l;return this.uint16[R+0]=h,this.uint16[R+1]=y,this.uint16[R+2]=S,l}}me.prototype.bytesPerElement=6,yn("StructArrayLayout3ui6",me);class Re extends ii{_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(l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it){const yt=this.length;return this.resize(yt+1),this.emplace(yt,l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it)}emplace(l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it,yt){const Ye=24*l,pt=12*l,Ot=48*l;return this.int16[Ye+0]=h,this.int16[Ye+1]=y,this.uint16[Ye+2]=S,this.uint16[Ye+3]=R,this.uint32[pt+2]=D,this.uint32[pt+3]=$,this.uint32[pt+4]=U,this.uint16[Ye+10]=W,this.uint16[Ye+11]=te,this.uint16[Ye+12]=ae,this.float32[pt+7]=de,this.float32[pt+8]=ge,this.uint8[Ot+36]=ve,this.uint8[Ot+37]=Fe,this.uint8[Ot+38]=Ne,this.uint32[pt+10]=it,this.int16[Ye+22]=yt,l}}Re.prototype.bytesPerElement=48,yn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Re);class Se extends ii{_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(l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it,yt,Ye,pt,Ot,At,gn,_n,cn,on,en,dn){const an=this.length;return this.resize(an+1),this.emplace(an,l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it,yt,Ye,pt,Ot,At,gn,_n,cn,on,en,dn)}emplace(l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe,Ne,it,yt,Ye,pt,Ot,At,gn,_n,cn,on,en,dn,an){const Wt=34*l,Mn=17*l;return this.int16[Wt+0]=h,this.int16[Wt+1]=y,this.int16[Wt+2]=S,this.int16[Wt+3]=R,this.int16[Wt+4]=D,this.int16[Wt+5]=$,this.int16[Wt+6]=U,this.int16[Wt+7]=W,this.uint16[Wt+8]=te,this.uint16[Wt+9]=ae,this.uint16[Wt+10]=de,this.uint16[Wt+11]=ge,this.uint16[Wt+12]=ve,this.uint16[Wt+13]=Fe,this.uint16[Wt+14]=Ne,this.uint16[Wt+15]=it,this.uint16[Wt+16]=yt,this.uint16[Wt+17]=Ye,this.uint16[Wt+18]=pt,this.uint16[Wt+19]=Ot,this.uint16[Wt+20]=At,this.uint16[Wt+21]=gn,this.uint16[Wt+22]=_n,this.uint32[Mn+12]=cn,this.float32[Mn+13]=on,this.float32[Mn+14]=en,this.float32[Mn+15]=dn,this.float32[Mn+16]=an,l}}Se.prototype.bytesPerElement=68,yn("StructArrayLayout8i15ui1ul4f68",Se);class Ie extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.float32[1*l+0]=h,l}}Ie.prototype.bytesPerElement=4,yn("StructArrayLayout1f4",Ie);class je extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(l,h,y){const S=this.length;return this.resize(S+1),this.emplace(S,l,h,y)}emplace(l,h,y,S){const R=3*l;return this.int16[R+0]=h,this.int16[R+1]=y,this.int16[R+2]=S,l}}je.prototype.bytesPerElement=6,yn("StructArrayLayout3i6",je);class Xe extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h,y){const S=this.length;return this.resize(S+1),this.emplace(S,l,h,y)}emplace(l,h,y,S){const R=4*l;return this.uint32[2*l+0]=h,this.uint16[R+2]=y,this.uint16[R+3]=S,l}}Xe.prototype.bytesPerElement=8,yn("StructArrayLayout1ul2ui8",Xe);class st extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l,h){const y=this.length;return this.resize(y+1),this.emplace(y,l,h)}emplace(l,h,y){const S=2*l;return this.uint16[S+0]=h,this.uint16[S+1]=y,l}}st.prototype.bytesPerElement=4,yn("StructArrayLayout2ui4",st);class Oe extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(l){const h=this.length;return this.resize(h+1),this.emplace(h,l)}emplace(l,h){return this.uint16[1*l+0]=h,l}}Oe.prototype.bytesPerElement=2,yn("StructArrayLayout1ui2",Oe);class vt extends ii{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(l,h,y,S){const R=this.length;return this.resize(R+1),this.emplace(R,l,h,y,S)}emplace(l,h,y,S,R){const D=4*l;return this.float32[D+0]=h,this.float32[D+1]=y,this.float32[D+2]=S,this.float32[D+3]=R,l}}vt.prototype.bytesPerElement=16,yn("StructArrayLayout4f16",vt);class ft extends Js{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 ne(this.anchorPointX,this.anchorPointY)}}ft.prototype.size=20;class Et extends K{get(l){return new ft(this,l)}}yn("CollisionBoxArray",Et);class It extends Js{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(l){this._structArray.uint8[this._pos1+37]=l}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(l){this._structArray.uint8[this._pos1+38]=l}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(l){this._structArray.uint32[this._pos4+10]=l}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}It.prototype.size=48;class Ht extends Re{get(l){return new It(this,l)}}yn("PlacedSymbolArray",Ht);class Ct extends Js{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(l){this._structArray.uint32[this._pos4+12]=l}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Ct.prototype.size=68;class fn extends Se{get(l){return new Ct(this,l)}}yn("SymbolInstanceArray",fn);class rn extends Ie{getoffsetX(l){return this.float32[1*l+0]}}yn("GlyphOffsetArray",rn);class mn extends je{getx(l){return this.int16[3*l+0]}gety(l){return this.int16[3*l+1]}gettileUnitDistanceFromAnchor(l){return this.int16[3*l+2]}}yn("SymbolLineVertexArray",mn);class Hn extends Js{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]}}Hn.prototype.size=8;class qn extends Xe{get(l){return new Hn(this,l)}}yn("FeatureIndexArray",qn);class kn extends Nl{}class vr extends Nl{}class yr extends Nl{}class sr extends c{}class ur extends g{}class Cr extends b{}class Ri extends E{}class Ka extends A{}class xa extends z{}class Wa extends j{}class el extends Y{}class ta extends ue{}class bo extends me{}class Ss extends st{}const Uf=gi([{name:"a_pos",components:2,type:"Int16"}],4),{members:Si}=Uf;class Jn{constructor(l=[]){this.segments=l}prepareSegment(l,h,y,S){let R=this.segments[this.segments.length-1];return l>Jn.MAX_VERTEX_ARRAY_LENGTH&&L(`Max vertices per segment is ${Jn.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${l}`),(!R||R.vertexLength+l>Jn.MAX_VERTEX_ARRAY_LENGTH||R.sortKey!==S)&&(R={vertexOffset:h.length,primitiveOffset:y.length,vertexLength:0,primitiveLength:0},S!==void 0&&(R.sortKey=S),this.segments.push(R)),R}get(){return this.segments}destroy(){for(const l of this.segments)for(const h in l.vaos)l.vaos[h].destroy()}static simpleSegment(l,h,y,S){return new Jn([{vertexOffset:l,primitiveOffset:h,vertexLength:y,primitiveLength:S,vaos:{},sortKey:0}])}}function gr(f,l){return 256*(f=v(Math.floor(f),0,255))+v(Math.floor(l),0,255)}Jn.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,yn("SegmentVector",Jn);const Ai=gi([{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 Di={exports:{}},Kr={exports:{}};Kr.exports=function(f,l){var h,y,S,R,D,$,U,W;for(y=f.length-(h=3&f.length),S=l,D=3432918353,$=461845907,W=0;W>>16)*D&65535)<<16)&4294967295)<<15|U>>>17))*$+(((U>>>16)*$&65535)<<16)&4294967295)<<13|S>>>19))+((5*(S>>>16)&65535)<<16)&4294967295))+((58964+(R>>>16)&65535)<<16);switch(U=0,h){case 3:U^=(255&f.charCodeAt(W+2))<<16;case 2:U^=(255&f.charCodeAt(W+1))<<8;case 1:S^=U=(65535&(U=(U=(65535&(U^=255&f.charCodeAt(W)))*D+(((U>>>16)*D&65535)<<16)&4294967295)<<15|U>>>17))*$+(((U>>>16)*$&65535)<<16)&4294967295}return S^=f.length,S=2246822507*(65535&(S^=S>>>16))+((2246822507*(S>>>16)&65535)<<16)&4294967295,S=3266489909*(65535&(S^=S>>>13))+((3266489909*(S>>>16)&65535)<<16)&4294967295,(S^=S>>>16)>>>0};var na={exports:{}};na.exports=function(f,l){for(var h,y=f.length,S=l^y,R=0;y>=4;)h=1540483477*(65535&(h=255&f.charCodeAt(R)|(255&f.charCodeAt(++R))<<8|(255&f.charCodeAt(++R))<<16|(255&f.charCodeAt(++R))<<24))+((1540483477*(h>>>16)&65535)<<16),S=1540483477*(65535&S)+((1540483477*(S>>>16)&65535)<<16)^(h=1540483477*(65535&(h^=h>>>24))+((1540483477*(h>>>16)&65535)<<16)),y-=4,++R;switch(y){case 3:S^=(255&f.charCodeAt(R+2))<<16;case 2:S^=(255&f.charCodeAt(R+1))<<8;case 1:S=1540483477*(65535&(S^=255&f.charCodeAt(R)))+((1540483477*(S>>>16)&65535)<<16)}return S=1540483477*(65535&(S^=S>>>13))+((1540483477*(S>>>16)&65535)<<16),(S^=S>>>15)>>>0};var Ll=Kr.exports,lm=na.exports;Di.exports=Ll,Di.exports.murmur3=Ll,Di.exports.murmur2=lm;class Nu{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(l,h,y,S){this.ids.push(ty(l)),this.positions.push(h,y,S)}getPositions(l){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const h=ty(l);let y=0,S=this.ids.length-1;for(;y>1;this.ids[D]>=h?S=D:y=D+1}const R=[];for(;this.ids[y]===h;)R.push({index:this.positions[3*y],start:this.positions[3*y+1],end:this.positions[3*y+2]}),y++;return R}static serialize(l,h){const y=new Float64Array(l.ids),S=new Uint32Array(l.positions);return um(y,S,0,y.length-1),h&&h.push(y.buffer,S.buffer),{ids:y,positions:S}}static deserialize(l){const h=new Nu;return h.ids=l.ids,h.positions=l.positions,h.indexed=!0,h}}function ty(f){const l=+f;return!isNaN(l)&&l<=Number.MAX_SAFE_INTEGER?l:Di.exports(String(f))}function um(f,l,h,y){for(;h>1];let R=h-1,D=y+1;for(;;){do R++;while(f[R]S);if(R>=D)break;tl(f,R,D),tl(l,3*R,3*D),tl(l,3*R+1,3*D+1),tl(l,3*R+2,3*D+2)}D-h`u_${S}`),this.type=y}setUniform(l,h,y){l.set(y.constantOr(this.value))}getBinding(l,h,y){return this.type==="color"?new Ck(l,h):new zl(l,h)}}class Hf{constructor(l,h){this.uniformNames=h.map(y=>`u_${y}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(l,h){this.pixelRatioFrom=h.pixelRatio,this.pixelRatioTo=l.pixelRatio,this.patternFrom=h.tlbr,this.patternTo=l.tlbr}setUniform(l,h,y,S){const R=S==="u_pattern_to"?this.patternTo:S==="u_pattern_from"?this.patternFrom:S==="u_pixel_ratio_to"?this.pixelRatioTo:S==="u_pixel_ratio_from"?this.pixelRatioFrom:null;R&&l.set(R)}getBinding(l,h,y){return y.substr(0,9)==="u_pattern"?new jf(l,h):new zl(l,h)}}class $l{constructor(l,h,y,S){this.expression=l,this.type=y,this.maxValue=0,this.paintVertexAttributes=h.map(R=>({name:`a_${R}`,type:"Float32",components:y==="color"?2:1,offset:0})),this.paintVertexArray=new S}populatePaintArray(l,h,y,S,R){const D=this.paintVertexArray.length,$=this.expression.evaluate(new Hr(0),h,{},S,[],R);this.paintVertexArray.resize(l),this._setPaintValue(D,l,$)}updatePaintArray(l,h,y,S){const R=this.expression.evaluate({zoom:0},y,S);this._setPaintValue(l,h,R)}_setPaintValue(l,h,y){if(this.type==="color"){const S=Ww(y);for(let R=l;R`u_${$}_t`),this.type=y,this.useIntegerZoom=S,this.zoom=R,this.maxValue=0,this.paintVertexAttributes=h.map($=>({name:`a_${$}`,type:"Float32",components:y==="color"?4:2,offset:0})),this.paintVertexArray=new D}populatePaintArray(l,h,y,S,R){const D=this.expression.evaluate(new Hr(this.zoom),h,{},S,[],R),$=this.expression.evaluate(new Hr(this.zoom+1),h,{},S,[],R),U=this.paintVertexArray.length;this.paintVertexArray.resize(l),this._setPaintValue(U,l,D,$)}updatePaintArray(l,h,y,S){const R=this.expression.evaluate({zoom:this.zoom},y,S),D=this.expression.evaluate({zoom:this.zoom+1},y,S);this._setPaintValue(l,h,R,D)}_setPaintValue(l,h,y,S){if(this.type==="color"){const R=Ww(y),D=Ww(S);for(let $=l;$`#define HAS_UNIFORM_${S}`))}return l}getBinderAttributes(){const l=[];for(const h in this.binders){const y=this.binders[h];if(y instanceof $l||y instanceof Es)for(let S=0;S!0){this.programConfigurations={};for(const S of l)this.programConfigurations[S.id]=new Sk(S,h,y);this.needsUpload=!1,this._featureMap=new Nu,this._bufferOffset=0}populatePaintArrays(l,h,y,S,R,D){for(const $ in this.programConfigurations)this.programConfigurations[$].populatePaintArrays(l,h,S,R,D);h.id!==void 0&&this._featureMap.add(h.id,y,this._bufferOffset,l),this._bufferOffset=l,this.needsUpload=!0}updatePaintArrays(l,h,y,S){for(const R of y)this.needsUpload=this.programConfigurations[R.id].updatePaintArrays(l,this._featureMap,h,R,S)||this.needsUpload}get(l){return this.programConfigurations[l]}upload(l){if(this.needsUpload){for(const h in this.programConfigurations)this.programConfigurations[h].upload(l);this.needsUpload=!1}}destroy(){for(const l in this.programConfigurations)this.programConfigurations[l].destroy()}}function MK(f,l){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"]}[f]||[f.replace(`${l}-`,"").replace(/-/g,"_")]}function Ek(f,l,h){const y={color:{source:b,composite:vt},number:{source:Ie,composite:b}},S=function(R){return{"line-pattern":{source:Ri,composite:Ri},"fill-pattern":{source:Ri,composite:Ri},"fill-extrusion-pattern":{source:Ri,composite:Ri}}[R]}(f);return S&&S[h]||y[l][h]}yn("ConstantBinder",cm),yn("CrossFadedConstantBinder",Hf),yn("SourceExpressionBinder",$l),yn("CrossFadedCompositeBinder",Lu),yn("CompositeExpressionBinder",Es),yn("ProgramConfiguration",Sk,{omit:["_buffers"]}),yn("ProgramConfigurationSet",sd);var Ei=8192;const Gw=Math.pow(2,14)-1,Pk=-Gw-1;function ld(f){const l=Ei/f.extent,h=f.loadGeometry();for(let y=0;yD.x+1||UD.y+1)&&L("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return h}function ud(f,l){return{type:f.type,id:f.id,properties:f.properties,geometry:l?ld(f):[]}}function ny(f,l,h,y,S){f.emplaceBack(2*l+(y+1)/2,2*h+(S+1)/2)}class qw{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.layoutVertexArray=new vr,this.indexArray=new bo,this.segments=new Jn,this.programConfigurations=new sd(l.layers,l.zoom),this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){const S=this.layers[0],R=[];let D=null,$=!1;S.type==="circle"&&(D=S.layout.get("circle-sort-key"),$=!D.isConstant());for(const{feature:U,id:W,index:te,sourceLayerIndex:ae}of l){const de=this.layers[0]._featureFilter.needGeometry,ge=ud(U,de);if(!this.layers[0]._featureFilter.filter(new Hr(this.zoom),ge,y))continue;const ve=$?D.evaluate(ge,{},y):void 0,Fe={id:W,properties:U.properties,type:U.type,sourceLayerIndex:ae,index:te,geometry:de?ge.geometry:ld(U),patterns:{},sortKey:ve};R.push(Fe)}$&&R.sort((U,W)=>U.sortKey-W.sortKey);for(const U of R){const{geometry:W,index:te,sourceLayerIndex:ae}=U,de=l[te].feature;this.addFeature(U,W,te,y),h.featureIndex.insert(de,W,te,ae,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,Si),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(l,h,y,S){for(const R of h)for(const D of R){const $=D.x,U=D.y;if($<0||$>=Ei||U<0||U>=Ei)continue;const W=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,l.sortKey),te=W.vertexLength;ny(this.layoutVertexArray,$,U,-1,-1),ny(this.layoutVertexArray,$,U,1,-1),ny(this.layoutVertexArray,$,U,1,1),ny(this.layoutVertexArray,$,U,-1,1),this.indexArray.emplaceBack(te,te+1,te+2),this.indexArray.emplaceBack(te,te+3,te+2),W.vertexLength+=4,W.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,y,{},S)}}function Ik(f,l){for(let h=0;h1){if(Zw(f,l))return!0;for(let y=0;y1?h:h.sub(l)._mult(S)._add(l))}function Mk(f,l){let h,y,S,R=!1;for(let D=0;Dl.y!=S.y>l.y&&l.x<(S.x-y.x)*(l.y-y.y)/(S.y-y.y)+y.x&&(R=!R)}return R}function Kf(f,l){let h=!1;for(let y=0,S=f.length-1;yl.y!=D.y>l.y&&l.x<(D.x-R.x)*(l.y-R.y)/(D.y-R.y)+R.x&&(h=!h)}return h}function OK(f,l,h){const y=h[0],S=h[2];if(f.xS.x&&l.x>S.x||f.yS.y&&l.y>S.y)return!1;const R=F(f,l,h[0]);return R!==F(f,l,h[1])||R!==F(f,l,h[2])||R!==F(f,l,h[3])}function dm(f,l,h){const y=l.paint.get(f).value;return y.kind==="constant"?y.value:h.programConfigurations.get(l.id).getMaxValue(f)}function ry(f){return Math.sqrt(f[0]*f[0]+f[1]*f[1])}function iy(f,l,h,y,S){if(!l[0]&&!l[1])return f;const R=ne.convert(l)._mult(S);h==="viewport"&&R._rotate(-y);const D=[];for(let $=0;$f.width||S.height>f.height||h.x>f.width-S.width||h.y>f.height-S.height)throw new RangeError("out of range source coordinates for image copy");if(S.width>l.width||S.height>l.height||y.x>l.width-S.width||y.y>l.height-S.height)throw new RangeError("out of range destination coordinates for image copy");const D=f.data,$=l.data;if(D===$)throw new Error("srcData equals dstData, so image is already copied");for(let U=0;U{l[f.evaluationKey]=U;const W=f.expression.evaluate(l);S.data[D+$+0]=Math.floor(255*W.r/W.a),S.data[D+$+1]=Math.floor(255*W.g/W.a),S.data[D+$+2]=Math.floor(255*W.b/W.a),S.data[D+$+3]=Math.floor(255*W.a)};if(f.clips)for(let D=0,$=0;D80*h){y=R=f[0],S=D=f[1];for(var ve=h;veR&&(R=$),U>D&&(D=U);W=(W=Math.max(R-y,D-S))!==0?32767/W:0}return pm(de,ge,h,y,S,W,0),ge}function Bk(f,l,h,y,S){var R,D;if(S===n4(f,l,h,y)>0)for(R=l;R=l;R-=y)D=jk(R,f[R],f[R+1],D);return D&&ly(D,D.next)&&(gm(D),D=D.next),D}function cd(f,l){if(!f)return f;l||(l=f);var h,y=f;do if(h=!1,y.steiner||!ly(y,y.next)&&fi(y.prev,y,y.next)!==0)y=y.next;else{if(gm(y),(y=l=y.prev)===y.next)break;h=!0}while(h||y!==l);return l}function pm(f,l,h,y,S,R,D){if(f){!D&&R&&function(te,ae,de,ge){var ve=te;do ve.z===0&&(ve.z=e4(ve.x,ve.y,ae,de,ge)),ve.prevZ=ve.prev,ve.nextZ=ve.next,ve=ve.next;while(ve!==te);ve.prevZ.nextZ=null,ve.prevZ=null,function(Fe){var Ne,it,yt,Ye,pt,Ot,At,gn,_n=1;do{for(it=Fe,Fe=null,pt=null,Ot=0;it;){for(Ot++,yt=it,At=0,Ne=0;Ne<_n&&(At++,yt=yt.nextZ);Ne++);for(gn=_n;At>0||gn>0&&yt;)At!==0&&(gn===0||!yt||it.z<=yt.z)?(Ye=it,it=it.nextZ,At--):(Ye=yt,yt=yt.nextZ,gn--),pt?pt.nextZ=Ye:Fe=Ye,Ye.prevZ=pt,pt=Ye;it=yt}pt.nextZ=null,_n*=2}while(Ot>1)}(ve)}(f,y,S,R);for(var $,U,W=f;f.prev!==f.next;)if($=f.prev,U=f.next,R?jK(f,y,S,R):UK(f))l.push($.i/h|0),l.push(f.i/h|0),l.push(U.i/h|0),gm(f),f=U.next,W=U.next;else if((f=U)===W){D?D===1?pm(f=HK(cd(f),l,h),l,h,y,S,R,2):D===2&&KK(f,l,h,y,S,R):pm(cd(f),l,h,y,S,R,1);break}}}function UK(f){var l=f.prev,h=f,y=f.next;if(fi(l,h,y)>=0)return!1;for(var S=l.x,R=h.x,D=y.x,$=l.y,U=h.y,W=y.y,te=SR?S>D?S:D:R>D?R:D,ge=$>U?$>W?$:W:U>W?U:W,ve=y.next;ve!==l;){if(ve.x>=te&&ve.x<=de&&ve.y>=ae&&ve.y<=ge&&Wf(S,$,R,U,D,W,ve.x,ve.y)&&fi(ve.prev,ve,ve.next)>=0)return!1;ve=ve.next}return!0}function jK(f,l,h,y){var S=f.prev,R=f,D=f.next;if(fi(S,R,D)>=0)return!1;for(var $=S.x,U=R.x,W=D.x,te=S.y,ae=R.y,de=D.y,ge=$U?$>W?$:W:U>W?U:W,Ne=te>ae?te>de?te:de:ae>de?ae:de,it=e4(ge,ve,l,h,y),yt=e4(Fe,Ne,l,h,y),Ye=f.prevZ,pt=f.nextZ;Ye&&Ye.z>=it&&pt&&pt.z<=yt;){if(Ye.x>=ge&&Ye.x<=Fe&&Ye.y>=ve&&Ye.y<=Ne&&Ye!==S&&Ye!==D&&Wf($,te,U,ae,W,de,Ye.x,Ye.y)&&fi(Ye.prev,Ye,Ye.next)>=0||(Ye=Ye.prevZ,pt.x>=ge&&pt.x<=Fe&&pt.y>=ve&&pt.y<=Ne&&pt!==S&&pt!==D&&Wf($,te,U,ae,W,de,pt.x,pt.y)&&fi(pt.prev,pt,pt.next)>=0))return!1;pt=pt.nextZ}for(;Ye&&Ye.z>=it;){if(Ye.x>=ge&&Ye.x<=Fe&&Ye.y>=ve&&Ye.y<=Ne&&Ye!==S&&Ye!==D&&Wf($,te,U,ae,W,de,Ye.x,Ye.y)&&fi(Ye.prev,Ye,Ye.next)>=0)return!1;Ye=Ye.prevZ}for(;pt&&pt.z<=yt;){if(pt.x>=ge&&pt.x<=Fe&&pt.y>=ve&&pt.y<=Ne&&pt!==S&&pt!==D&&Wf($,te,U,ae,W,de,pt.x,pt.y)&&fi(pt.prev,pt,pt.next)>=0)return!1;pt=pt.nextZ}return!0}function HK(f,l,h){var y=f;do{var S=y.prev,R=y.next.next;!ly(S,R)&&Vk(S,y,y.next,R)&&mm(S,R)&&mm(R,S)&&(l.push(S.i/h|0),l.push(y.i/h|0),l.push(R.i/h|0),gm(y),gm(y.next),y=f=R),y=y.next}while(y!==f);return cd(y)}function KK(f,l,h,y,S,R){var D=f;do{for(var $=D.next.next;$!==D.prev;){if(D.i!==$.i&&XK(D,$)){var U=Uk(D,$);return D=cd(D,D.next),U=cd(U,U.next),pm(D,l,h,y,S,R,0),void pm(U,l,h,y,S,R,0)}$=$.next}D=D.next}while(D!==f)}function WK(f,l){return f.x-l.x}function GK(f,l){var h=function(S,R){var D,$=R,U=S.x,W=S.y,te=-1/0;do{if(W<=$.y&&W>=$.next.y&&$.next.y!==$.y){var ae=$.x+(W-$.y)*($.next.x-$.x)/($.next.y-$.y);if(ae<=U&&ae>te&&(te=ae,D=$.x<$.next.x?$:$.next,ae===U))return D}$=$.next}while($!==R);if(!D)return null;var de,ge=D,ve=D.x,Fe=D.y,Ne=1/0;$=D;do U>=$.x&&$.x>=ve&&U!==$.x&&Wf(WD.x||$.x===D.x&&qK(D,$)))&&(D=$,Ne=de)),$=$.next;while($!==ge);return D}(f,l);if(!h)return l;var y=Uk(h,f);return cd(y,y.next),cd(h,h.next)}function qK(f,l){return fi(f.prev,f,l.prev)<0&&fi(l.next,f,f.next)<0}function e4(f,l,h,y,S){return(f=1431655765&((f=858993459&((f=252645135&((f=16711935&((f=(f-h)*S|0)|f<<8))|f<<4))|f<<2))|f<<1))|(l=1431655765&((l=858993459&((l=252645135&((l=16711935&((l=(l-y)*S|0)|l<<8))|l<<4))|l<<2))|l<<1))<<1}function ZK(f){var l=f,h=f;do(l.x=(f-D)*(R-$)&&(f-D)*(y-$)>=(h-D)*(l-$)&&(h-D)*(R-$)>=(S-D)*(y-$)}function XK(f,l){return f.next.i!==l.i&&f.prev.i!==l.i&&!function(h,y){var S=h;do{if(S.i!==h.i&&S.next.i!==h.i&&S.i!==y.i&&S.next.i!==y.i&&Vk(S,S.next,h,y))return!0;S=S.next}while(S!==h);return!1}(f,l)&&(mm(f,l)&&mm(l,f)&&function(h,y){var S=h,R=!1,D=(h.x+y.x)/2,$=(h.y+y.y)/2;do S.y>$!=S.next.y>$&&S.next.y!==S.y&&D<(S.next.x-S.x)*($-S.y)/(S.next.y-S.y)+S.x&&(R=!R),S=S.next;while(S!==h);return R}(f,l)&&(fi(f.prev,f,l.prev)||fi(f,l.prev,l))||ly(f,l)&&fi(f.prev,f,f.next)>0&&fi(l.prev,l,l.next)>0)}function fi(f,l,h){return(l.y-f.y)*(h.x-l.x)-(l.x-f.x)*(h.y-l.y)}function ly(f,l){return f.x===l.x&&f.y===l.y}function Vk(f,l,h,y){var S=cy(fi(f,l,h)),R=cy(fi(f,l,y)),D=cy(fi(h,y,f)),$=cy(fi(h,y,l));return S!==R&&D!==$||!(S!==0||!uy(f,h,l))||!(R!==0||!uy(f,y,l))||!(D!==0||!uy(h,f,y))||!($!==0||!uy(h,l,y))}function uy(f,l,h){return l.x<=Math.max(f.x,h.x)&&l.x>=Math.min(f.x,h.x)&&l.y<=Math.max(f.y,h.y)&&l.y>=Math.min(f.y,h.y)}function cy(f){return f>0?1:f<0?-1:0}function mm(f,l){return fi(f.prev,f,f.next)<0?fi(f,l,f.next)>=0&&fi(f,f.prev,l)>=0:fi(f,l,f.prev)<0||fi(f,f.next,l)<0}function Uk(f,l){var h=new t4(f.i,f.x,f.y),y=new t4(l.i,l.x,l.y),S=f.next,R=l.prev;return f.next=l,l.prev=f,h.next=S,S.prev=h,y.next=h,h.prev=y,R.next=y,y.prev=R,y}function jk(f,l,h,y){var S=new t4(f,l,h);return y?(S.next=y.next,S.prev=y,y.next.prev=S,y.next=S):(S.prev=S,S.next=S),S}function gm(f){f.next.prev=f.prev,f.prev.next=f.next,f.prevZ&&(f.prevZ.nextZ=f.nextZ),f.nextZ&&(f.nextZ.prevZ=f.prevZ)}function t4(f,l,h){this.i=f,this.x=l,this.y=h,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function n4(f,l,h,y){for(var S=0,R=l,D=h-y;Rh;){if(y-h>600){var R=y-h+1,D=l-h+1,$=Math.log(R),U=.5*Math.exp(2*$/3),W=.5*Math.sqrt($*U*(R-U)/R)*(D-R/2<0?-1:1);Hk(f,l,Math.max(h,Math.floor(l-D*U/R+W)),Math.min(y,Math.floor(l+(R-D)*U/R+W)),S)}var te=f[l],ae=h,de=y;for(vm(f,h,l),S(f[y],te)>0&&vm(f,h,y);ae0;)de--}S(f[h],te)===0?vm(f,h,de):vm(f,++de,y),de<=l&&(h=de+1),l<=de&&(y=de-1)}}function vm(f,l,h){var y=f[l];f[l]=f[h],f[h]=y}function QK(f,l){return fl?1:0}function r4(f,l){const h=f.length;if(h<=1)return[f];const y=[];let S,R;for(let D=0;D1)for(let D=0;D0&&h.holes.push(y+=f[S-1].length)}return h};class a4{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new yr,this.indexArray=new bo,this.indexArray2=new Ss,this.programConfigurations=new sd(l.layers,l.zoom),this.segments=new Jn,this.segments2=new Jn,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.hasPattern=i4("fill",this.layers,h);const S=this.layers[0].layout.get("fill-sort-key"),R=!S.isConstant(),D=[];for(const{feature:$,id:U,index:W,sourceLayerIndex:te}of l){const ae=this.layers[0]._featureFilter.needGeometry,de=ud($,ae);if(!this.layers[0]._featureFilter.filter(new Hr(this.zoom),de,y))continue;const ge=R?S.evaluate(de,{},y,h.availableImages):void 0,ve={id:U,properties:$.properties,type:$.type,sourceLayerIndex:te,index:W,geometry:ae?de.geometry:ld($),patterns:{},sortKey:ge};D.push(ve)}R&&D.sort(($,U)=>$.sortKey-U.sortKey);for(const $ of D){const{geometry:U,index:W,sourceLayerIndex:te}=$;if(this.hasPattern){const ae=o4("fill",this.layers,$,this.zoom,h);this.patternFeatures.push(ae)}else this.addFeature($,U,W,y,{});h.featureIndex.insert(l[W].feature,U,W,te,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}addFeatures(l,h,y){for(const S of this.patternFeatures)this.addFeature(S,S.geometry,S.index,h,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,VK),this.indexBuffer=l.createIndexBuffer(this.indexArray),this.indexBuffer2=l.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(l),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(l,h,y,S,R){for(const D of r4(h,500)){let $=0;for(const ge of D)$+=ge.length;const U=this.segments.prepareSegment($,this.layoutVertexArray,this.indexArray),W=U.vertexLength,te=[],ae=[];for(const ge of D){if(ge.length===0)continue;ge!==D[0]&&ae.push(te.length/2);const ve=this.segments2.prepareSegment(ge.length,this.layoutVertexArray,this.indexArray2),Fe=ve.vertexLength;this.layoutVertexArray.emplaceBack(ge[0].x,ge[0].y),this.indexArray2.emplaceBack(Fe+ge.length-1,Fe),te.push(ge[0].x),te.push(ge[0].y);for(let Ne=1;Ne>3}if(S--,y===1||y===2)R+=f.readSVarint(),D+=f.readSVarint(),y===1&&(l&&$.push(l),l=[]),l.push(new oW(R,D));else{if(y!==7)throw new Error("unknown command "+y);l&&l.push(l[0].clone())}}return l&&$.push(l),$},Gf.prototype.bbox=function(){var f=this._pbf;f.pos=this._geometry;for(var l=f.readVarint()+f.pos,h=1,y=0,S=0,R=0,D=1/0,$=-1/0,U=1/0,W=-1/0;f.pos>3}if(y--,h===1||h===2)(S+=f.readSVarint())$&&($=S),(R+=f.readSVarint())W&&(W=R);else if(h!==7)throw new Error("unknown command "+h)}return[D,U,$,W]},Gf.prototype.toGeoJSON=function(f,l,h){var y,S,R=this.extent*Math.pow(2,h),D=this.extent*f,$=this.extent*l,U=this.loadGeometry(),W=Gf.types[this.type];function te(ge){for(var ve=0;ve>3;S=D===1?y.readString():D===2?y.readFloat():D===3?y.readDouble():D===4?y.readVarint64():D===5?y.readVarint():D===6?y.readSVarint():D===7?y.readBoolean():null}return S}(h))}Gk.prototype.feature=function(f){if(f<0||f>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[f];var l=this._pbf.readVarint()+this._pbf.pos;return new lW(this._pbf,l,this.extent,this._keys,this._values)};var cW=Wk;function dW(f,l,h){if(f===3){var y=new cW(h,h.readVarint()+h.pos);y.length&&(l[y.name]=y)}}Fu.VectorTile=function(f,l){this.layers=f.readFields(dW,{},l)},Fu.VectorTileFeature=Kk,Fu.VectorTileLayer=Wk;const fW=Fu.VectorTileFeature.types,s4=Math.pow(2,13);function ym(f,l,h,y,S,R,D,$){f.emplaceBack(l,h,2*Math.floor(y*s4)+D,S*s4*2,R*s4*2,Math.round($))}class l4{constructor(l){this.zoom=l.zoom,this.overscaling=l.overscaling,this.layers=l.layers,this.layerIds=this.layers.map(h=>h.id),this.index=l.index,this.hasPattern=!1,this.layoutVertexArray=new sr,this.centroidVertexArray=new kn,this.indexArray=new bo,this.programConfigurations=new sd(l.layers,l.zoom),this.segments=new Jn,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.features=[],this.hasPattern=i4("fill-extrusion",this.layers,h);for(const{feature:S,id:R,index:D,sourceLayerIndex:$}of l){const U=this.layers[0]._featureFilter.needGeometry,W=ud(S,U);if(!this.layers[0]._featureFilter.filter(new Hr(this.zoom),W,y))continue;const te={id:R,sourceLayerIndex:$,index:D,geometry:U?W.geometry:ld(S),properties:S.properties,type:S.type,patterns:{}};this.hasPattern?this.features.push(o4("fill-extrusion",this.layers,te,this.zoom,h)):this.addFeature(te,te.geometry,D,y,{}),h.featureIndex.insert(S,te.geometry,D,$,this.index,!0)}}addFeatures(l,h,y){for(const S of this.features){const{geometry:R}=S;this.addFeature(S,R,S.index,h,y)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,iW),this.centroidVertexBuffer=l.createVertexBuffer(this.centroidVertexArray,rW.members,!0),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(l,h,y,S,R){const D={x:0,y:0,vertexCount:0};for(const $ of r4(h,500)){let U=0;for(const ve of $)U+=ve.length;let W=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const ve of $){if(ve.length===0||pW(ve))continue;let Fe=0;for(let Ne=0;Ne=1){const yt=ve[Ne-1];if(!hW(it,yt)){W.vertexLength+4>Jn.MAX_VERTEX_ARRAY_LENGTH&&(W=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ye=it.sub(yt)._perp()._unit(),pt=yt.dist(it);Fe+pt>32768&&(Fe=0),ym(this.layoutVertexArray,it.x,it.y,Ye.x,Ye.y,0,0,Fe),ym(this.layoutVertexArray,it.x,it.y,Ye.x,Ye.y,0,1,Fe),D.x+=2*it.x,D.y+=2*it.y,D.vertexCount+=2,Fe+=pt,ym(this.layoutVertexArray,yt.x,yt.y,Ye.x,Ye.y,0,0,Fe),ym(this.layoutVertexArray,yt.x,yt.y,Ye.x,Ye.y,0,1,Fe),D.x+=2*yt.x,D.y+=2*yt.y,D.vertexCount+=2;const Ot=W.vertexLength;this.indexArray.emplaceBack(Ot,Ot+2,Ot+1),this.indexArray.emplaceBack(Ot+1,Ot+2,Ot+3),W.vertexLength+=4,W.primitiveLength+=2}}}}if(W.vertexLength+U>Jn.MAX_VERTEX_ARRAY_LENGTH&&(W=this.segments.prepareSegment(U,this.layoutVertexArray,this.indexArray)),fW[l.type]!=="Polygon")continue;const te=[],ae=[],de=W.vertexLength;for(const ve of $)if(ve.length!==0){ve!==$[0]&&ae.push(te.length/2);for(let Fe=0;FeEi)||f.y===l.y&&(f.y<0||f.y>Ei)}function pW(f){return f.every(l=>l.x<0)||f.every(l=>l.x>Ei)||f.every(l=>l.y<0)||f.every(l=>l.y>Ei)}yn("FillExtrusionBucket",l4,{omit:["layers","features"]});var mW={paint:new ji({"fill-extrusion-opacity":new wn(Ve["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Dn(Ve["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new wn(Ve["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new wn(Ve["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Ou(Ve["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Dn(Ve["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Dn(Ve["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new wn(Ve["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function xm(f,l){return f.x*l.x+f.y*l.y}function qk(f,l){if(f.length===1){let h=0;const y=l[h++];let S;for(;!S||y.equals(S);)if(S=l[h++],!S)return 1/0;for(;hh.id),this.index=l.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(h=>{this.gradients[h.id]={}}),this.layoutVertexArray=new ur,this.layoutVertexArray2=new Cr,this.indexArray=new bo,this.programConfigurations=new sd(l.layers,l.zoom),this.segments=new Jn,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(h=>h.isStateDependent()).map(h=>h.id)}populate(l,h,y){this.hasPattern=i4("line",this.layers,h);const S=this.layers[0].layout.get("line-sort-key"),R=!S.isConstant(),D=[];for(const{feature:$,id:U,index:W,sourceLayerIndex:te}of l){const ae=this.layers[0]._featureFilter.needGeometry,de=ud($,ae);if(!this.layers[0]._featureFilter.filter(new Hr(this.zoom),de,y))continue;const ge=R?S.evaluate(de,{},y):void 0,ve={id:U,properties:$.properties,type:$.type,sourceLayerIndex:te,index:W,geometry:ae?de.geometry:ld($),patterns:{},sortKey:ge};D.push(ve)}R&&D.sort(($,U)=>$.sortKey-U.sortKey);for(const $ of D){const{geometry:U,index:W,sourceLayerIndex:te}=$;if(this.hasPattern){const ae=o4("line",this.layers,$,this.zoom,h);this.patternFeatures.push(ae)}else this.addFeature($,U,W,y,{});h.featureIndex.insert(l[W].feature,U,W,te,this.index)}}update(l,h,y){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(l,h,this.stateDependentLayers,y)}addFeatures(l,h,y){for(const S of this.patternFeatures)this.addFeature(S,S.geometry,S.index,h,y)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(l){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=l.createVertexBuffer(this.layoutVertexArray2,xW)),this.layoutVertexBuffer=l.createVertexBuffer(this.layoutVertexArray,vW),this.indexBuffer=l.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(l),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(l){if(l.properties&&Object.prototype.hasOwnProperty.call(l.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(l.properties,"mapbox_clip_end"))return{start:+l.properties.mapbox_clip_start,end:+l.properties.mapbox_clip_end}}addFeature(l,h,y,S,R){const D=this.layers[0].layout,$=D.get("line-join").evaluate(l,{}),U=D.get("line-cap"),W=D.get("line-miter-limit"),te=D.get("line-round-limit");this.lineClips=this.lineFeatureClips(l);for(const ae of h)this.addLine(ae,l,$,U,W,te);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,l,y,R,S)}addLine(l,h,y,S,R,D){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let it=0;it=2&&l[U-1].equals(l[U-2]);)U--;let W=0;for(;W0;if(gn&&it>W){const en=de.dist(ge);if(en>2*te){const dn=de.sub(de.sub(ge)._mult(te/en)._round());this.updateDistance(ge,dn),this.addCurrentVertex(dn,Fe,0,0,ae),ge=dn}}const cn=ge&&ve;let on=cn?y:$?"butt":S;if(cn&&on==="round"&&(OtR&&(on="bevel"),on==="bevel"&&(Ot>2&&(on="flipbevel"),Ot100)yt=Ne.mult(-1);else{const en=Ot*Fe.add(Ne).mag()/Fe.sub(Ne).mag();yt._perp()._mult(en*(_n?-1:1))}this.addCurrentVertex(de,yt,0,0,ae),this.addCurrentVertex(de,yt.mult(-1),0,0,ae)}else if(on==="bevel"||on==="fakeround"){const en=-Math.sqrt(Ot*Ot-1),dn=_n?en:0,an=_n?0:en;if(ge&&this.addCurrentVertex(de,Fe,dn,an,ae),on==="fakeround"){const Wt=Math.round(180*At/Math.PI/20);for(let Mn=1;Mn2*te){const dn=de.add(ve.sub(de)._mult(te/en)._round());this.updateDistance(de,dn),this.addCurrentVertex(dn,Ne,0,0,ae),de=dn}}}}addCurrentVertex(l,h,y,S,R,D=!1){const $=h.y*S-h.x,U=-h.y-h.x*S;this.addHalfVertex(l,h.x+h.y*y,h.y-h.x*y,D,!1,y,R),this.addHalfVertex(l,$,U,D,!0,-S,R),this.distance>Zk/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(l,h,y,S,R,D))}addHalfVertex({x:l,y:h},y,S,R,D,$,U){const W=.5*(this.lineClips?this.scaledDistance*(Zk-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((l<<1)+(R?1:0),(h<<1)+(D?1:0),Math.round(63*y)+128,Math.round(63*S)+128,1+($===0?0:$<0?-1:1)|(63&W)<<2,W>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const te=U.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,te),U.primitiveLength++),D?this.e2=te:this.e1=te}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(l,h){this.distance+=l.dist(h),this.updateScaledDistance()}}yn("LineBucket",u4,{omit:["layers","patternFeatures"]});const wW=new ji({"line-cap":new wn(Ve.layout_line["line-cap"]),"line-join":new Dn(Ve.layout_line["line-join"]),"line-miter-limit":new wn(Ve.layout_line["line-miter-limit"]),"line-round-limit":new wn(Ve.layout_line["line-round-limit"]),"line-sort-key":new Dn(Ve.layout_line["line-sort-key"])});var Xk={paint:new ji({"line-opacity":new Dn(Ve.paint_line["line-opacity"]),"line-color":new Dn(Ve.paint_line["line-color"]),"line-translate":new wn(Ve.paint_line["line-translate"]),"line-translate-anchor":new wn(Ve.paint_line["line-translate-anchor"]),"line-width":new Dn(Ve.paint_line["line-width"]),"line-gap-width":new Dn(Ve.paint_line["line-gap-width"]),"line-offset":new Dn(Ve.paint_line["line-offset"]),"line-blur":new Dn(Ve.paint_line["line-blur"]),"line-dasharray":new am(Ve.paint_line["line-dasharray"]),"line-pattern":new Ou(Ve.paint_line["line-pattern"]),"line-gradient":new Ys(Ve.paint_line["line-gradient"])}),layout:wW};const Yk=new class extends Dn{possiblyEvaluate(f,l){return l=new Hr(Math.floor(l.zoom),{now:l.now,fadeDuration:l.fadeDuration,zoomHistory:l.zoomHistory,transition:l.transition}),super.possiblyEvaluate(f,l)}evaluate(f,l,h,y){return l=_({},l,{zoom:Math.floor(l.zoom)}),super.evaluate(f,l,h,y)}}(Xk.paint.properties["line-width"].specification);function Qk(f,l){return l>0?l+2*f:f}Yk.useIntegerZoom=!0;const CW=gi([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),SW=gi([{name:"a_projected_pos",components:3,type:"Float32"}],4);gi([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const EW=gi([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);gi([{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 Jk=gi([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),PW=gi([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function IW(f,l,h){return f.sections.forEach(y=>{y.text=function(S,R,D){const $=R.layout.get("text-transform").evaluate(D,{});return $==="uppercase"?S=S.toLocaleUpperCase():$==="lowercase"&&(S=S.toLocaleLowerCase()),ea.applyArabicShaping&&(S=ea.applyArabicShaping(S)),S}(y.text,l,h)}),f}gi([{name:"triangle",components:3,type:"Uint16"}]),gi([{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"}]),gi([{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"}]),gi([{type:"Float32",name:"offsetX"}]),gi([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const bm={"!":"\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 Hi=24,c4=Ir,eM=function(f,l,h,y,S){var R,D,$=8*S-y-1,U=(1<<$)-1,W=U>>1,te=-7,ae=h?S-1:0,de=h?-1:1,ge=f[l+ae];for(ae+=de,R=ge&(1<<-te)-1,ge>>=-te,te+=$;te>0;R=256*R+f[l+ae],ae+=de,te-=8);for(D=R&(1<<-te)-1,R>>=-te,te+=y;te>0;D=256*D+f[l+ae],ae+=de,te-=8);if(R===0)R=1-W;else{if(R===U)return D?NaN:1/0*(ge?-1:1);D+=Math.pow(2,y),R-=W}return(ge?-1:1)*D*Math.pow(2,R-y)},tM=function(f,l,h,y,S,R){var D,$,U,W=8*R-S-1,te=(1<>1,de=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,ge=y?0:R-1,ve=y?1:-1,Fe=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?($=isNaN(l)?1:0,D=te):(D=Math.floor(Math.log(l)/Math.LN2),l*(U=Math.pow(2,-D))<1&&(D--,U*=2),(l+=D+ae>=1?de/U:de*Math.pow(2,1-ae))*U>=2&&(D++,U/=2),D+ae>=te?($=0,D=te):D+ae>=1?($=(l*U-1)*Math.pow(2,S),D+=ae):($=l*Math.pow(2,ae-1)*Math.pow(2,S),D=0));S>=8;f[h+ge]=255&$,ge+=ve,$/=256,S-=8);for(D=D<0;f[h+ge]=255&D,ge+=ve,D/=256,W-=8);f[h+ge-ve]|=128*Fe};function Ir(f){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(f)?f:new Uint8Array(f||0),this.pos=0,this.type=0,this.length=this.buf.length}Ir.Varint=0,Ir.Fixed64=1,Ir.Bytes=2,Ir.Fixed32=5;var zu,d4=4294967296,nM=1/d4,rM=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Bl(f){return f.type===Ir.Bytes?f.readVarint()+f.pos:f.pos+1}function qf(f,l,h){return h?4294967296*l+(f>>>0):4294967296*(l>>>0)+(f>>>0)}function iM(f,l,h){var y=l<=16383?1:l<=2097151?2:l<=268435455?3:Math.floor(Math.log(l)/(7*Math.LN2));h.realloc(y);for(var S=h.pos-1;S>=f;S--)h.buf[S+y]=h.buf[S]}function TW(f,l){for(var h=0;h>>8,f[h+2]=l>>>16,f[h+3]=l>>>24}function oM(f,l){return(f[l]|f[l+1]<<8|f[l+2]<<16)+(f[l+3]<<24)}function FW(f,l,h){f===1&&h.readMessage(zW,l)}function zW(f,l,h){if(f===3){const{id:y,bitmap:S,width:R,height:D,left:$,top:U,advance:W}=h.readMessage($W,{});l.push({id:y,bitmap:new hm({width:R+6,height:D+6},S),metrics:{width:R,height:D,left:$,top:U,advance:W}})}}function $W(f,l,h){f===1?l.id=h.readVarint():f===2?l.bitmap=h.readBytes():f===3?l.width=h.readVarint():f===4?l.height=h.readVarint():f===5?l.left=h.readSVarint():f===6?l.top=h.readSVarint():f===7&&(l.advance=h.readVarint())}function aM(f){let l=0,h=0;for(const D of f)l+=D.w*D.h,h=Math.max(h,D.w);f.sort((D,$)=>$.h-D.h);const y=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(l/.95)),h),h:1/0}];let S=0,R=0;for(const D of f)for(let $=y.length-1;$>=0;$--){const U=y[$];if(!(D.w>U.w||D.h>U.h)){if(D.x=U.x,D.y=U.y,R=Math.max(R,D.y+D.h),S=Math.max(S,D.x+D.w),D.w===U.w&&D.h===U.h){const W=y.pop();$>3,R=this.pos;this.type=7&y,f(S,l,this),this.pos===R&&this.skip(y)}return l},readMessage:function(f,l){return this.readFields(f,l,this.readVarint()+this.pos)},readFixed32:function(){var f=dy(this.buf,this.pos);return this.pos+=4,f},readSFixed32:function(){var f=oM(this.buf,this.pos);return this.pos+=4,f},readFixed64:function(){var f=dy(this.buf,this.pos)+dy(this.buf,this.pos+4)*d4;return this.pos+=8,f},readSFixed64:function(){var f=dy(this.buf,this.pos)+oM(this.buf,this.pos+4)*d4;return this.pos+=8,f},readFloat:function(){var f=eM(this.buf,this.pos,!0,23,4);return this.pos+=4,f},readDouble:function(){var f=eM(this.buf,this.pos,!0,52,8);return this.pos+=8,f},readVarint:function(f){var l,h,y=this.buf;return l=127&(h=y[this.pos++]),h<128?l:(l|=(127&(h=y[this.pos++]))<<7,h<128?l:(l|=(127&(h=y[this.pos++]))<<14,h<128?l:(l|=(127&(h=y[this.pos++]))<<21,h<128?l:function(S,R,D){var $,U,W=D.buf;if($=(112&(U=W[D.pos++]))>>4,U<128||($|=(127&(U=W[D.pos++]))<<3,U<128)||($|=(127&(U=W[D.pos++]))<<10,U<128)||($|=(127&(U=W[D.pos++]))<<17,U<128)||($|=(127&(U=W[D.pos++]))<<24,U<128)||($|=(1&(U=W[D.pos++]))<<31,U<128))return qf(S,$,R);throw new Error("Expected varint not more than 10 bytes")}(l|=(15&(h=y[this.pos]))<<28,f,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var f=this.readVarint();return f%2==1?(f+1)/-2:f/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var f=this.readVarint()+this.pos,l=this.pos;return this.pos=f,f-l>=12&&rM?function(h,y,S){return rM.decode(h.subarray(y,S))}(this.buf,l,f):function(h,y,S){for(var R="",D=y;D239?4:te>223?3:te>191?2:1;if(D+de>S)break;de===1?te<128&&(ae=te):de===2?(192&($=h[D+1]))==128&&(ae=(31&te)<<6|63&$)<=127&&(ae=null):de===3?(U=h[D+2],(192&($=h[D+1]))==128&&(192&U)==128&&((ae=(15&te)<<12|(63&$)<<6|63&U)<=2047||ae>=55296&&ae<=57343)&&(ae=null)):de===4&&(U=h[D+2],W=h[D+3],(192&($=h[D+1]))==128&&(192&U)==128&&(192&W)==128&&((ae=(15&te)<<18|(63&$)<<12|(63&U)<<6|63&W)<=65535||ae>=1114112)&&(ae=null)),ae===null?(ae=65533,de=1):ae>65535&&(ae-=65536,R+=String.fromCharCode(ae>>>10&1023|55296),ae=56320|1023&ae),R+=String.fromCharCode(ae),D+=de}return R}(this.buf,l,f)},readBytes:function(){var f=this.readVarint()+this.pos,l=this.buf.subarray(this.pos,f);return this.pos=f,l},readPackedVarint:function(f,l){if(this.type!==Ir.Bytes)return f.push(this.readVarint(l));var h=Bl(this);for(f=f||[];this.pos127;);else if(l===Ir.Bytes)this.pos=this.readVarint()+this.pos;else if(l===Ir.Fixed32)this.pos+=4;else{if(l!==Ir.Fixed64)throw new Error("Unimplemented type: "+l);this.pos+=8}},writeTag:function(f,l){this.writeVarint(f<<3|l)},realloc:function(f){for(var l=this.length||16;l268435455||f<0?function(l,h){var y,S;if(l>=0?(y=l%4294967296|0,S=l/4294967296|0):(S=~(-l/4294967296),4294967295^(y=~(-l%4294967296))?y=y+1|0:(y=0,S=S+1|0)),l>=18446744073709552e3||l<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(R,D,$){$.buf[$.pos++]=127&R|128,R>>>=7,$.buf[$.pos++]=127&R|128,R>>>=7,$.buf[$.pos++]=127&R|128,R>>>=7,$.buf[$.pos++]=127&R|128,$.buf[$.pos]=127&(R>>>=7)}(y,0,h),function(R,D){var $=(7&R)<<4;D.buf[D.pos++]|=$|((R>>>=3)?128:0),R&&(D.buf[D.pos++]=127&R|((R>>>=7)?128:0),R&&(D.buf[D.pos++]=127&R|((R>>>=7)?128:0),R&&(D.buf[D.pos++]=127&R|((R>>>=7)?128:0),R&&(D.buf[D.pos++]=127&R|((R>>>=7)?128:0),R&&(D.buf[D.pos++]=127&R)))))}(S,h)}(f,this):(this.realloc(4),this.buf[this.pos++]=127&f|(f>127?128:0),f<=127||(this.buf[this.pos++]=127&(f>>>=7)|(f>127?128:0),f<=127||(this.buf[this.pos++]=127&(f>>>=7)|(f>127?128:0),f<=127||(this.buf[this.pos++]=f>>>7&127))))},writeSVarint:function(f){this.writeVarint(f<0?2*-f-1:2*f)},writeBoolean:function(f){this.writeVarint(Boolean(f))},writeString:function(f){f=String(f),this.realloc(4*f.length),this.pos++;var l=this.pos;this.pos=function(y,S,R){for(var D,$,U=0;U55295&&D<57344){if(!$){D>56319||U+1===S.length?(y[R++]=239,y[R++]=191,y[R++]=189):$=D;continue}if(D<56320){y[R++]=239,y[R++]=191,y[R++]=189,$=D;continue}D=$-55296<<10|D-56320|65536,$=null}else $&&(y[R++]=239,y[R++]=191,y[R++]=189,$=null);D<128?y[R++]=D:(D<2048?y[R++]=D>>6|192:(D<65536?y[R++]=D>>12|224:(y[R++]=D>>18|240,y[R++]=D>>12&63|128),y[R++]=D>>6&63|128),y[R++]=63&D|128)}return R}(this.buf,f,this.pos);var h=this.pos-l;h>=128&&iM(l,h,this),this.pos=l-1,this.writeVarint(h),this.pos+=h},writeFloat:function(f){this.realloc(4),tM(this.buf,f,this.pos,!0,23,4),this.pos+=4},writeDouble:function(f){this.realloc(8),tM(this.buf,f,this.pos,!0,52,8),this.pos+=8},writeBytes:function(f){var l=f.length;this.writeVarint(l),this.realloc(l);for(var h=0;h=128&&iM(h,y,this),this.pos=h-1,this.writeVarint(y),this.pos+=y},writeMessage:function(f,l,h){this.writeTag(f,Ir.Bytes),this.writeRawMessage(l,h)},writePackedVarint:function(f,l){l.length&&this.writeMessage(f,TW,l)},writePackedSVarint:function(f,l){l.length&&this.writeMessage(f,kW,l)},writePackedBoolean:function(f,l){l.length&&this.writeMessage(f,AW,l)},writePackedFloat:function(f,l){l.length&&this.writeMessage(f,MW,l)},writePackedDouble:function(f,l){l.length&&this.writeMessage(f,RW,l)},writePackedFixed32:function(f,l){l.length&&this.writeMessage(f,DW,l)},writePackedSFixed32:function(f,l){l.length&&this.writeMessage(f,OW,l)},writePackedFixed64:function(f,l){l.length&&this.writeMessage(f,NW,l)},writePackedSFixed64:function(f,l){l.length&&this.writeMessage(f,LW,l)},writeBytesField:function(f,l){this.writeTag(f,Ir.Bytes),this.writeBytes(l)},writeFixed32Field:function(f,l){this.writeTag(f,Ir.Fixed32),this.writeFixed32(l)},writeSFixed32Field:function(f,l){this.writeTag(f,Ir.Fixed32),this.writeSFixed32(l)},writeFixed64Field:function(f,l){this.writeTag(f,Ir.Fixed64),this.writeFixed64(l)},writeSFixed64Field:function(f,l){this.writeTag(f,Ir.Fixed64),this.writeSFixed64(l)},writeVarintField:function(f,l){this.writeTag(f,Ir.Varint),this.writeVarint(l)},writeSVarintField:function(f,l){this.writeTag(f,Ir.Varint),this.writeSVarint(l)},writeStringField:function(f,l){this.writeTag(f,Ir.Bytes),this.writeString(l)},writeFloatField:function(f,l){this.writeTag(f,Ir.Fixed32),this.writeFloat(l)},writeDoubleField:function(f,l){this.writeTag(f,Ir.Fixed64),this.writeDouble(l)},writeBooleanField:function(f,l){this.writeVarintField(f,Boolean(l))}};class f4{constructor(l,{pixelRatio:h,version:y,stretchX:S,stretchY:R,content:D}){this.paddedRect=l,this.pixelRatio=h,this.stretchX=S,this.stretchY=R,this.content=D,this.version=y}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 sM{constructor(l,h){const y={},S={};this.haveRenderCallbacks=[];const R=[];this.addImages(l,y,R),this.addImages(h,S,R);const{w:D,h:$}=aM(R),U=new ba({width:D||1,height:$||1});for(const W in l){const te=l[W],ae=y[W].paddedRect;ba.copy(te.data,U,{x:0,y:0},{x:ae.x+1,y:ae.y+1},te.data)}for(const W in h){const te=h[W],ae=S[W].paddedRect,de=ae.x+1,ge=ae.y+1,ve=te.data.width,Fe=te.data.height;ba.copy(te.data,U,{x:0,y:0},{x:de,y:ge},te.data),ba.copy(te.data,U,{x:0,y:Fe-1},{x:de,y:ge-1},{width:ve,height:1}),ba.copy(te.data,U,{x:0,y:0},{x:de,y:ge+Fe},{width:ve,height:1}),ba.copy(te.data,U,{x:ve-1,y:0},{x:de-1,y:ge},{width:1,height:Fe}),ba.copy(te.data,U,{x:0,y:0},{x:de+ve,y:ge},{width:1,height:Fe})}this.image=U,this.iconPositions=y,this.patternPositions=S}addImages(l,h,y){for(const S in l){const R=l[S],D={x:0,y:0,w:R.data.width+2,h:R.data.height+2};y.push(D),h[S]=new f4(D,R),R.hasRenderCallback&&this.haveRenderCallbacks.push(S)}}patchUpdatedImages(l,h){l.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const y in l.updatedImages)this.patchUpdatedImage(this.iconPositions[y],l.getImage(y),h),this.patchUpdatedImage(this.patternPositions[y],l.getImage(y),h)}patchUpdatedImage(l,h,y){if(!l||!h||l.version===h.version)return;l.version=h.version;const[S,R]=l.tl;y.update(h.data,void 0,{x:S,y:R})}}yn("ImagePosition",f4),yn("ImageAtlas",sM),a.WritingMode=void 0,(zu=a.WritingMode||(a.WritingMode={}))[zu.none=0]="none",zu[zu.horizontal=1]="horizontal",zu[zu.vertical=2]="vertical",zu[zu.horizontalOnly=3]="horizontalOnly";const fy=-17;class _m{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(l,h){const y=new _m;return y.scale=l||1,y.fontStack=h,y}static forImage(l){const h=new _m;return h.imageName=l,h}}class Xf{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(l,h){const y=new Xf;for(let S=0;S=0&&y>=l&&py[this.text.charCodeAt(y)];y--)h--;this.text=this.text.substring(l,h),this.sectionIndex=this.sectionIndex.slice(l,h)}substring(l,h){const y=new Xf;return y.text=this.text.substring(l,h),y.sectionIndex=this.sectionIndex.slice(l,h),y.sections=this.sections,y}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((l,h)=>Math.max(l,this.sections[h].scale),0)}addTextSection(l,h){this.text+=l.text,this.sections.push(_m.forText(l.scale,l.fontStack||h));const y=this.sections.length-1;for(let S=0;S=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function hy(f,l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve,Fe){const Ne=Xf.fromFeature(f,S);let it;ae===a.WritingMode.vertical&&Ne.verticalizePunctuation();const{processBidirectionalText:yt,processStyledBidirectionalText:Ye}=ea;if(yt&&Ne.sections.length===1){it=[];const At=yt(Ne.toString(),h4(Ne,W,R,l,y,ge,ve));for(const gn of At){const _n=new Xf;_n.text=gn,_n.sections=Ne.sections;for(let cn=0;cn0&&jl>Bo&&(Bo=jl)}else{const Ca=_n[er.fontStack],Vo=Ca&&Ca[eo];if(Vo&&Vo.rect)Ps=Vo.rect,Ga=Vo.metrics;else{const jl=gn[er.fontStack],Sm=jl&&jl[eo];if(!Sm)continue;Ga=Sm.metrics}co=(Ji-er.scale)*Hi}qa?(At.verticalizable=!0,$o.push({glyph:eo,imageName:Is,x:$r,y:Wr+co,vertical:qa,scale:er.scale,fontStack:er.fontStack,sectionIndex:ra,metrics:Ga,rect:Ps}),$r+=Ul*er.scale+Mn):($o.push({glyph:eo,imageName:Is,x:$r,y:Wr+co,vertical:qa,scale:er.scale,fontStack:er.fontStack,sectionIndex:ra,metrics:Ga,rect:Ps}),$r+=Ga.advance*er.scale+Mn)}$o.length!==0&&(Pi=Math.max($r-Mn,Pi),UW($o,0,$o.length-1,Yi,Bo)),$r=0;const Yr=en*Ji+Bo;Co.lineOffset=Math.max(Bo,uo),Wr+=Yr,wa=Math.max(Yr,wa),++vi}var Oi;const Qi=Wr-fy,{horizontalAlign:lo,verticalAlign:zo}=p4(dn);(function(yi,Ji,uo,Co,$o,Bo,Yr,Ni,er){const ra=(Ji-uo)*$o;let eo=0;eo=Bo!==Yr?-Ni*Co-fy:(-Co*er+.5)*Yr;for(const co of yi)for(const Ga of co.positionedGlyphs)Ga.x+=ra,Ga.y+=eo})(At.positionedLines,Yi,lo,zo,Pi,wa,en,Qi,on.length),At.top+=-zo*Qi,At.bottom=At.top+Qi,At.left+=-lo*Pi,At.right=At.left+Pi}(Ot,l,h,y,it,D,$,U,ae,W,de,Fe),!function(At){for(const gn of At)if(gn.positionedGlyphs.length!==0)return!1;return!0}(pt)&&Ot}const py={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},BW={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function lM(f,l,h,y,S,R){if(l.imageName){const D=y[l.imageName];return D?D.displaySize[0]*l.scale*Hi/R+S:0}{const D=h[l.fontStack],$=D&&D[f];return $?$.metrics.advance*l.scale+S:0}}function uM(f,l,h,y){const S=Math.pow(f-l,2);return y?f=0;let te=0;for(let de=0;de-h/2;){if(D--,D<0)return!1;$-=f[D].dist(R),R=f[D]}$+=f[D].dist(f[D+1]),D++;const U=[];let W=0;for(;$y;)W-=U.shift().angleDelta;if(W>S)return!1;D++,$+=te.dist(ae)}return!0}function mM(f){let l=0;for(let h=0;hW){const ve=(W-U)/ge,Fe=Pr(ae.x,de.x,ve),Ne=Pr(ae.y,de.y,ve),it=new $u(Fe,Ne,de.angleTo(ae),te);return it._round(),!D||pM(f,it,$,D,l)?it:void 0}U+=ge}}function KW(f,l,h,y,S,R,D,$,U){const W=gM(y,R,D),te=vM(y,S),ae=te*D,de=f[0].x===0||f[0].x===U||f[0].y===0||f[0].y===U;return l-ae=0&&pt=0&&Ot=0&&de+W<=te){const At=new $u(pt,Ot,yt,ve);At._round(),y&&!pM(f,At,R,y,S)||ge.push(At)}}ae+=it}return $||ge.length||D||(ge=yM(f,ae/2,h,y,S,R,D,!0,U)),ge}function xM(f,l,h,y,S){const R=[];for(let D=0;D=y&&ae.x>=y||(te.x>=y?te=new ne(y,te.y+(y-te.x)/(ae.x-te.x)*(ae.y-te.y))._round():ae.x>=y&&(ae=new ne(y,te.y+(y-te.x)/(ae.x-te.x)*(ae.y-te.y))._round()),te.y>=S&&ae.y>=S||(te.y>=S?te=new ne(te.x+(S-te.y)/(ae.y-te.y)*(ae.x-te.x),S)._round():ae.y>=S&&(ae=new ne(te.x+(S-te.y)/(ae.y-te.y)*(ae.x-te.x),S)._round()),U&&te.equals(U[U.length-1])||(U=[te],R.push(U)),U.push(ae)))))}}return R}function bM(f,l,h,y){const S=[],R=f.image,D=R.pixelRatio,$=R.paddedRect.w-2,U=R.paddedRect.h-2,W=f.right-f.left,te=f.bottom-f.top,ae=R.stretchX||[[0,$]],de=R.stretchY||[[0,U]],ge=(en,dn)=>en+dn[1]-dn[0],ve=ae.reduce(ge,0),Fe=de.reduce(ge,0),Ne=$-ve,it=U-Fe;let yt=0,Ye=ve,pt=0,Ot=Fe,At=0,gn=Ne,_n=0,cn=it;if(R.content&&y){const en=R.content;yt=my(ae,0,en[0]),pt=my(de,0,en[1]),Ye=my(ae,en[0],en[2]),Ot=my(de,en[1],en[3]),At=en[0]-yt,_n=en[1]-pt,gn=en[2]-en[0]-Ye,cn=en[3]-en[1]-Ot}const on=(en,dn,an,Wt)=>{const Mn=gy(en.stretch-yt,Ye,W,f.left),Sn=vy(en.fixed-At,gn,en.stretch,ve),Zn=gy(dn.stretch-pt,Ot,te,f.top),$r=vy(dn.fixed-_n,cn,dn.stretch,Fe),Wr=gy(an.stretch-yt,Ye,W,f.left),Pi=vy(an.fixed-At,gn,an.stretch,ve),wa=gy(Wt.stretch-pt,Ot,te,f.top),Yi=vy(Wt.fixed-_n,cn,Wt.stretch,Fe),vi=new ne(Mn,Zn),Oi=new ne(Wr,Zn),Qi=new ne(Wr,wa),lo=new ne(Mn,wa),zo=new ne(Sn/D,$r/D),yi=new ne(Pi/D,Yi/D),Ji=l*Math.PI/180;if(Ji){const $o=Math.sin(Ji),Bo=Math.cos(Ji),Yr=[Bo,-$o,$o,Bo];vi._matMult(Yr),Oi._matMult(Yr),lo._matMult(Yr),Qi._matMult(Yr)}const uo=en.stretch+en.fixed,Co=dn.stretch+dn.fixed;return{tl:vi,tr:Oi,bl:lo,br:Qi,tex:{x:R.paddedRect.x+1+uo,y:R.paddedRect.y+1+Co,w:an.stretch+an.fixed-uo,h:Wt.stretch+Wt.fixed-Co},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:zo,pixelOffsetBR:yi,minFontScaleX:gn/D/W,minFontScaleY:cn/D/te,isSDF:h}};if(y&&(R.stretchX||R.stretchY)){const en=_M(ae,Ne,ve),dn=_M(de,it,Fe);for(let an=0;an0&&(ve=Math.max(10,ve),this.circleDiameter=ve)}else{let ae=D.top*$-U[0],de=D.bottom*$+U[2],ge=D.left*$-U[3],ve=D.right*$+U[1];const Fe=D.collisionPadding;if(Fe&&(ge-=Fe[0]*$,ae-=Fe[1]*$,ve+=Fe[2]*$,de+=Fe[3]*$),te){const Ne=new ne(ge,ae),it=new ne(ve,ae),yt=new ne(ge,de),Ye=new ne(ve,de),pt=te*Math.PI/180;Ne._rotate(pt),it._rotate(pt),yt._rotate(pt),Ye._rotate(pt),ge=Math.min(Ne.x,it.x,yt.x,Ye.x),ve=Math.max(Ne.x,it.x,yt.x,Ye.x),ae=Math.min(Ne.y,it.y,yt.y,Ye.y),de=Math.max(Ne.y,it.y,yt.y,Ye.y)}l.emplaceBack(h.x,h.y,ge,ae,ve,de,y,S,R)}this.boxEndIndex=l.length}}class WW{constructor(l=[],h=GW){if(this.data=l,this.length=this.data.length,this.compare=h,this.length>0)for(let y=(this.length>>1)-1;y>=0;y--)this._down(y)}push(l){this.data.push(l),this.length++,this._up(this.length-1)}pop(){if(this.length===0)return;const l=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),l}peek(){return this.data[0]}_up(l){const{data:h,compare:y}=this,S=h[l];for(;l>0;){const R=l-1>>1,D=h[R];if(y(S,D)>=0)break;h[l]=D,l=R}h[l]=S}_down(l){const{data:h,compare:y}=this,S=this.length>>1,R=h[l];for(;l=0)break;h[l]=$,l=D}h[l]=R}}function GW(f,l){return fl?1:0}function qW(f,l=1,h=!1){let y=1/0,S=1/0,R=-1/0,D=-1/0;const $=f[0];for(let ge=0;ge<$.length;ge++){const ve=$[ge];(!ge||ve.xR)&&(R=ve.x),(!ge||ve.y>D)&&(D=ve.y)}const U=Math.min(R-y,D-S);let W=U/2;const te=new WW([],ZW);if(U===0)return new ne(y,S);for(let ge=y;geae.d||!ae.d)&&(ae=ge,h&&console.log("found best %d after %d probes",Math.round(1e4*ge.d)/1e4,de)),ge.max-ae.d<=l||(W=ge.h/2,te.push(new Yf(ge.p.x-W,ge.p.y-W,W,f)),te.push(new Yf(ge.p.x+W,ge.p.y-W,W,f)),te.push(new Yf(ge.p.x-W,ge.p.y+W,W,f)),te.push(new Yf(ge.p.x+W,ge.p.y+W,W,f)),de+=4)}return h&&(console.log(`num probes: ${de}`),console.log(`best distance: ${ae.d}`)),ae.p}function ZW(f,l){return l.max-f.max}function Yf(f,l,h,y){this.p=new ne(f,l),this.h=h,this.d=function(S,R){let D=!1,$=1/0;for(let U=0;US.y!=ve.y>S.y&&S.x<(ve.x-ge.x)*(S.y-ge.y)/(ve.y-ge.y)+ge.x&&(D=!D),$=Math.min($,kk(S,ge,ve))}}return(D?1:-1)*Math.sqrt($)}(this.p,y),this.max=this.d+this.h*Math.SQRT2}const m4=Number.POSITIVE_INFINITY;function wM(f,l){return l[1]!==m4?function(h,y,S){let R=0,D=0;switch(y=Math.abs(y),S=Math.abs(S),h){case"top-right":case"top-left":case"top":D=S-7;break;case"bottom-right":case"bottom-left":case"bottom":D=7-S}switch(h){case"top-right":case"bottom-right":case"right":R=-y;break;case"top-left":case"bottom-left":case"left":R=y}return[R,D]}(f,l[0],l[1]):function(h,y){let S=0,R=0;y<0&&(y=0);const D=y/Math.sqrt(2);switch(h){case"top-right":case"top-left":R=D-7;break;case"bottom-right":case"bottom-left":R=7-D;break;case"bottom":R=7-y;break;case"top":R=y-7}switch(h){case"top-right":case"bottom-right":S=-D;break;case"top-left":case"bottom-left":S=D;break;case"left":S=y;break;case"right":S=-y}return[S,R]}(f,l[0])}function g4(f){switch(f){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function XW(f,l,h,y,S,R,D,$,U,W,te){let ae=R.textMaxSize.evaluate(l,{});ae===void 0&&(ae=D);const de=f.layers[0].layout,ge=de.get("icon-offset").evaluate(l,{},te),ve=SM(h.horizontal),Fe=D/24,Ne=f.tilePixelRatio*Fe,it=f.tilePixelRatio*ae/24,yt=f.tilePixelRatio*$,Ye=f.tilePixelRatio*de.get("symbol-spacing"),pt=de.get("text-padding")*f.tilePixelRatio,Ot=function(Wt,Mn,Sn,Zn=1){const $r=Wt.get("icon-padding").evaluate(Mn,{},Sn),Wr=$r&&$r.values;return[Wr[0]*Zn,Wr[1]*Zn,Wr[2]*Zn,Wr[3]*Zn]}(de,l,te,f.tilePixelRatio),At=de.get("text-max-angle")/180*Math.PI,gn=de.get("text-rotation-alignment")!=="viewport"&&de.get("symbol-placement")!=="point",_n=de.get("icon-rotation-alignment")==="map"&&de.get("symbol-placement")!=="point",cn=de.get("symbol-placement"),on=Ye/2,en=de.get("icon-text-fit");let dn;y&&en!=="none"&&(f.allowVerticalPlacement&&h.vertical&&(dn=fM(y,h.vertical,en,de.get("icon-text-fit-padding"),ge,Fe)),ve&&(y=fM(y,ve,en,de.get("icon-text-fit-padding"),ge,Fe)));const an=(Wt,Mn)=>{Mn.x<0||Mn.x>=Ei||Mn.y<0||Mn.y>=Ei||function(Sn,Zn,$r,Wr,Pi,wa,Yi,vi,Oi,Qi,lo,zo,yi,Ji,uo,Co,$o,Bo,Yr,Ni,er,ra,eo,co,Ga){const Ps=Sn.addToLineVertexArray(Zn,$r);let Is,Ul,qa,Ca,Vo=0,jl=0,Sm=0,BM=0,P4=-1,I4=-1;const Hl={};let VM=Di.exports(""),T4=0,k4=0;if(vi._unevaluatedLayout.getValue("text-radial-offset")===void 0?[T4,k4]=vi.layout.get("text-offset").evaluate(er,{},co).map(Uo=>Uo*Hi):(T4=vi.layout.get("text-radial-offset").evaluate(er,{},co)*Hi,k4=m4),Sn.allowVerticalPlacement&&Wr.vertical){const Uo=vi.layout.get("text-rotate").evaluate(er,{},co)+90;qa=new yy(Oi,Zn,Qi,lo,zo,Wr.vertical,yi,Ji,uo,Uo),Yi&&(Ca=new yy(Oi,Zn,Qi,lo,zo,Yi,$o,Bo,uo,Uo))}if(Pi){const Uo=vi.layout.get("icon-rotate").evaluate(er,{}),nl=vi.layout.get("icon-text-fit")!=="none",Em=bM(Pi,Uo,eo,nl),Pm=Yi?bM(Yi,Uo,eo,nl):void 0;Ul=new yy(Oi,Zn,Qi,lo,zo,Pi,$o,Bo,!1,Uo),Vo=4*Em.length;const HM=Sn.iconSizeData;let fd=null;HM.kind==="source"?(fd=[Vl*vi.layout.get("icon-size").evaluate(er,{})],fd[0]>Bu&&L(`${Sn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):HM.kind==="composite"&&(fd=[Vl*ra.compositeIconSizes[0].evaluate(er,{},co),Vl*ra.compositeIconSizes[1].evaluate(er,{},co)],(fd[0]>Bu||fd[1]>Bu)&&L(`${Sn.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),Sn.addSymbols(Sn.icon,Em,fd,Ni,Yr,er,a.WritingMode.none,Zn,Ps.lineStartIndex,Ps.lineLength,-1,co),P4=Sn.icon.placedSymbolArray.length-1,Pm&&(jl=4*Pm.length,Sn.addSymbols(Sn.icon,Pm,fd,Ni,Yr,er,a.WritingMode.vertical,Zn,Ps.lineStartIndex,Ps.lineLength,-1,co),I4=Sn.icon.placedSymbolArray.length-1)}const UM=Object.keys(Wr.horizontal);for(const Uo of UM){const nl=Wr.horizontal[Uo];if(!Is){VM=Di.exports(nl.text);const Pm=vi.layout.get("text-rotate").evaluate(er,{},co);Is=new yy(Oi,Zn,Qi,lo,zo,nl,yi,Ji,uo,Pm)}const Em=nl.positionedLines.length===1;if(Sm+=CM(Sn,Zn,nl,wa,vi,uo,er,Co,Ps,Wr.vertical?a.WritingMode.horizontal:a.WritingMode.horizontalOnly,Em?UM:[Uo],Hl,P4,ra,co),Em)break}Wr.vertical&&(BM+=CM(Sn,Zn,Wr.vertical,wa,vi,uo,er,Co,Ps,a.WritingMode.vertical,["vertical"],Hl,I4,ra,co));const uG=Is?Is.boxStartIndex:Sn.collisionBoxArray.length,cG=Is?Is.boxEndIndex:Sn.collisionBoxArray.length,dG=qa?qa.boxStartIndex:Sn.collisionBoxArray.length,fG=qa?qa.boxEndIndex:Sn.collisionBoxArray.length,hG=Ul?Ul.boxStartIndex:Sn.collisionBoxArray.length,pG=Ul?Ul.boxEndIndex:Sn.collisionBoxArray.length,mG=Ca?Ca.boxStartIndex:Sn.collisionBoxArray.length,gG=Ca?Ca.boxEndIndex:Sn.collisionBoxArray.length;let Ts=-1;const Cy=(Uo,nl)=>Uo&&Uo.circleDiameter?Math.max(Uo.circleDiameter,nl):nl;Ts=Cy(Is,Ts),Ts=Cy(qa,Ts),Ts=Cy(Ul,Ts),Ts=Cy(Ca,Ts);const jM=Ts>-1?1:0;jM&&(Ts*=Ga/Hi),Sn.glyphOffsetArray.length>=Qf.MAX_GLYPHS&&L("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),er.sortKey!==void 0&&Sn.addToSortKeyRanges(Sn.symbolInstances.length,er.sortKey),Sn.symbolInstances.emplaceBack(Zn.x,Zn.y,Hl.right>=0?Hl.right:-1,Hl.center>=0?Hl.center:-1,Hl.left>=0?Hl.left:-1,Hl.vertical||-1,P4,I4,VM,uG,cG,dG,fG,hG,pG,mG,gG,Qi,Sm,BM,Vo,jl,jM,0,yi,T4,k4,Ts)}(f,Mn,Wt,h,y,S,dn,f.layers[0],f.collisionBoxArray,l.index,l.sourceLayerIndex,f.index,Ne,[pt,pt,pt,pt],gn,U,yt,Ot,_n,ge,l,R,W,te,D)};if(cn==="line")for(const Wt of xM(l.geometry,0,0,Ei,Ei)){const Mn=KW(Wt,Ye,At,h.vertical||ve,y,24,it,f.overscaling,Ei);for(const Sn of Mn){const Zn=ve;Zn&&YW(f,Zn.text,on,Sn)||an(Wt,Sn)}}else if(cn==="line-center"){for(const Wt of l.geometry)if(Wt.length>1){const Mn=HW(Wt,At,h.vertical||ve,y,24,it);Mn&&an(Wt,Mn)}}else if(l.type==="Polygon")for(const Wt of r4(l.geometry,0)){const Mn=qW(Wt,16);an(Wt[0],new $u(Mn.x,Mn.y,0))}else if(l.type==="LineString")for(const Wt of l.geometry)an(Wt,new $u(Wt[0].x,Wt[0].y,0));else if(l.type==="Point")for(const Wt of l.geometry)for(const Mn of Wt)an([Mn],new $u(Mn.x,Mn.y,0))}const Bu=32640;function CM(f,l,h,y,S,R,D,$,U,W,te,ae,de,ge,ve){const Fe=function(yt,Ye,pt,Ot,At,gn,_n,cn){const on=Ot.layout.get("text-rotate").evaluate(gn,{})*Math.PI/180,en=[];for(const dn of Ye.positionedLines)for(const an of dn.positionedGlyphs){if(!an.rect)continue;const Wt=an.rect||{};let Mn=4,Sn=!0,Zn=1,$r=0;const Wr=(At||cn)&&an.vertical,Pi=an.metrics.advance*an.scale/2;if(cn&&Ye.verticalizable){const Yr=(an.scale-1)*Hi,Ni=(Hi-an.metrics.width*an.scale)/2;$r=dn.lineOffset/2-(an.imageName?-Ni:Yr)}if(an.imageName){const Yr=_n[an.imageName];Sn=Yr.sdf,Zn=Yr.pixelRatio,Mn=1/Zn}const wa=At?[an.x+Pi,an.y]:[0,0];let Yi=At?[0,0]:[an.x+Pi+pt[0],an.y+pt[1]-$r],vi=[0,0];Wr&&(vi=Yi,Yi=[0,0]);const Oi=(an.metrics.left-Mn)*an.scale-Pi+Yi[0],Qi=(-an.metrics.top-Mn)*an.scale+Yi[1],lo=Oi+Wt.w*an.scale/Zn,zo=Qi+Wt.h*an.scale/Zn,yi=new ne(Oi,Qi),Ji=new ne(lo,Qi),uo=new ne(Oi,zo),Co=new ne(lo,zo);if(Wr){const Yr=new ne(-Pi,Pi-fy),Ni=-Math.PI/2,er=12-Pi,ra=new ne(22-er,-(an.imageName?er:0)),eo=new ne(...vi);yi._rotateAround(Ni,Yr)._add(ra)._add(eo),Ji._rotateAround(Ni,Yr)._add(ra)._add(eo),uo._rotateAround(Ni,Yr)._add(ra)._add(eo),Co._rotateAround(Ni,Yr)._add(ra)._add(eo)}if(on){const Yr=Math.sin(on),Ni=Math.cos(on),er=[Ni,-Yr,Yr,Ni];yi._matMult(er),Ji._matMult(er),uo._matMult(er),Co._matMult(er)}const $o=new ne(0,0),Bo=new ne(0,0);en.push({tl:yi,tr:Ji,bl:uo,br:Co,tex:Wt,writingMode:Ye.writingMode,glyphOffset:wa,sectionIndex:an.sectionIndex,isSDF:Sn,pixelOffsetTL:$o,pixelOffsetBR:Bo,minFontScaleX:0,minFontScaleY:0})}return en}(0,h,$,S,R,D,y,f.allowVerticalPlacement),Ne=f.textSizeData;let it=null;Ne.kind==="source"?(it=[Vl*S.layout.get("text-size").evaluate(D,{})],it[0]>Bu&&L(`${f.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):Ne.kind==="composite"&&(it=[Vl*ge.compositeTextSizes[0].evaluate(D,{},ve),Vl*ge.compositeTextSizes[1].evaluate(D,{},ve)],(it[0]>Bu||it[1]>Bu)&&L(`${f.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),f.addSymbols(f.text,Fe,it,$,R,D,W,l,U.lineStartIndex,U.lineLength,de,ve);for(const yt of te)ae[yt]=f.text.placedSymbolArray.length-1;return 4*Fe.length}function SM(f){for(const l in f)return f[l];return null}function YW(f,l,h,y){const S=f.compareText;if(l in S){const R=S[l];for(let D=R.length-1;D>=0;D--)if(y.dist(R[D])D.id),this.index=l.index,this.pixelRatio=l.pixelRatio,this.sourceLayerIndex=l.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Yw([]),this.placementViewportMatrix=Yw([]);const h=this.layers[0]._unevaluatedLayout._values;this.textSizeData=hM(this.zoom,h["text-size"]),this.iconSizeData=hM(this.zoom,h["icon-size"]);const y=this.layers[0].layout,S=y.get("symbol-sort-key"),R=y.get("symbol-z-order");this.canOverlap=_4(y,"text-overlap","text-allow-overlap")!=="never"||_4(y,"icon-overlap","icon-allow-overlap")!=="never"||y.get("text-ignore-placement")||y.get("icon-ignore-placement"),this.sortFeaturesByKey=R!=="viewport-y"&&!S.isConstant(),this.sortFeaturesByY=(R==="viewport-y"||R==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,y.get("symbol-placement")==="point"&&(this.writingModes=y.get("text-writing-mode").map(D=>a.WritingMode[D])),this.stateDependentLayerIds=this.layers.filter(D=>D.isStateDependent()).map(D=>D.id),this.sourceID=l.sourceID}createArrays(){this.text=new y4(new sd(this.layers,this.zoom,l=>/^text/.test(l))),this.icon=new y4(new sd(this.layers,this.zoom,l=>/^icon/.test(l))),this.glyphOffsetArray=new rn,this.lineVertexArray=new mn,this.symbolInstances=new fn}calculateGlyphDependencies(l,h,y,S,R){for(let D=0;D0)&&(D.value.kind!=="constant"||D.value.value.length>0),te=U.value.kind!=="constant"||!!U.value.value||Object.keys(U.parameters).length>0,ae=R.get("symbol-sort-key");if(this.features=[],!W&&!te)return;const de=h.iconDependencies,ge=h.glyphDependencies,ve=h.availableImages,Fe=new Hr(this.zoom);for(const{feature:Ne,id:it,index:yt,sourceLayerIndex:Ye}of l){const pt=S._featureFilter.needGeometry,Ot=ud(Ne,pt);if(!S._featureFilter.filter(Fe,Ot,y))continue;let At,gn;if(pt||(Ot.geometry=ld(Ne)),W){const cn=S.getValueAndResolveTokens("text-field",Ot,y,ve),on=Pe.factory(cn);eG(on)&&(this.hasRTLText=!0),(!this.hasRTLText||id()==="unavailable"||this.hasRTLText&&ea.isParsed())&&(At=IW(on,S,Ot))}if(te){const cn=S.getValueAndResolveTokens("icon-image",Ot,y,ve);gn=cn instanceof Be?cn:Be.fromString(cn)}if(!At&&!gn)continue;const _n=this.sortFeaturesByKey?ae.evaluate(Ot,{},y):void 0;if(this.features.push({id:it,text:At,icon:gn,index:yt,sourceLayerIndex:Ye,geometry:Ot.geometry,properties:Ne.properties,type:QW[Ne.type],sortKey:_n}),gn&&(de[gn.name]=!0),At){const cn=D.evaluate(Ot,{},y).join(","),on=R.get("text-rotation-alignment")!=="viewport"&&R.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(a.WritingMode.vertical)>=0;for(const en of At.sections)if(en.image)de[en.image.name]=!0;else{const dn=Bf(At.toString()),an=en.fontStack||cn,Wt=ge[an]=ge[an]||{};this.calculateGlyphDependencies(en.text,Wt,on,this.allowVerticalPlacement,dn)}}}R.get("symbol-placement")==="line"&&(this.features=function(Ne){const it={},yt={},Ye=[];let pt=0;function Ot(cn){Ye.push(Ne[cn]),pt++}function At(cn,on,en){const dn=yt[cn];return delete yt[cn],yt[on]=dn,Ye[dn].geometry[0].pop(),Ye[dn].geometry[0]=Ye[dn].geometry[0].concat(en[0]),dn}function gn(cn,on,en){const dn=it[on];return delete it[on],it[cn]=dn,Ye[dn].geometry[0].shift(),Ye[dn].geometry[0]=en[0].concat(Ye[dn].geometry[0]),dn}function _n(cn,on,en){const dn=en?on[0][on[0].length-1]:on[0][0];return`${cn}:${dn.x}:${dn.y}`}for(let cn=0;cncn.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((Ne,it)=>Ne.sortKey-it.sortKey)}update(l,h,y){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(l,h,this.layers,y),this.icon.programConfigurations.updatePaintArrays(l,h,this.layers,y))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(l){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(l),this.iconCollisionBox.upload(l)),this.text.upload(l,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(l,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(l,h){const y=this.lineVertexArray.length;if(l.segment!==void 0){let S=l.dist(h[l.segment+1]),R=l.dist(h[l.segment]);const D={};for(let $=l.segment+1;$=0;$--)D[$]={x:h[$].x,y:h[$].y,tileUnitDistanceFromAnchor:R},$>0&&(R+=h[$-1].dist(h[$]));for(let $=0;$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(l,h){const y=l.placedSymbolArray.get(h),S=y.vertexStartIndex+4*y.numGlyphs;for(let R=y.vertexStartIndex;RS[$]-S[U]||R[U]-R[$]),D}addToSortKeyRanges(l,h){const y=this.sortKeyRanges[this.sortKeyRanges.length-1];y&&y.sortKey===h?y.symbolInstanceEnd=l+1:this.sortKeyRanges.push({sortKey:h,symbolInstanceStart:l,symbolInstanceEnd:l+1})}sortFeatures(l){if(this.sortFeaturesByY&&this.sortedAngle!==l&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(l),this.sortedAngle=l,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const h of this.symbolInstanceIndexes){const y=this.symbolInstances.get(h);this.featureSortOrder.push(y.featureIndex),[y.rightJustifiedTextSymbolIndex,y.centerJustifiedTextSymbolIndex,y.leftJustifiedTextSymbolIndex].forEach((S,R,D)=>{S>=0&&D.indexOf(S)===R&&this.addIndicesForPlacedSymbol(this.text,S)}),y.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,y.verticalPlacedTextSymbolIndex),y.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.placedIconSymbolIndex),y.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,y.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}yn("SymbolBucket",Qf,{omit:["layers","collisionBoxArray","features","compareText"]}),Qf.MAX_GLYPHS=65535,Qf.addDynamicAttributes=v4;const tG=new ji({"symbol-placement":new wn(Ve.layout_symbol["symbol-placement"]),"symbol-spacing":new wn(Ve.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new wn(Ve.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Dn(Ve.layout_symbol["symbol-sort-key"]),"symbol-z-order":new wn(Ve.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new wn(Ve.layout_symbol["icon-allow-overlap"]),"icon-overlap":new wn(Ve.layout_symbol["icon-overlap"]),"icon-ignore-placement":new wn(Ve.layout_symbol["icon-ignore-placement"]),"icon-optional":new wn(Ve.layout_symbol["icon-optional"]),"icon-rotation-alignment":new wn(Ve.layout_symbol["icon-rotation-alignment"]),"icon-size":new Dn(Ve.layout_symbol["icon-size"]),"icon-text-fit":new wn(Ve.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new wn(Ve.layout_symbol["icon-text-fit-padding"]),"icon-image":new Dn(Ve.layout_symbol["icon-image"]),"icon-rotate":new Dn(Ve.layout_symbol["icon-rotate"]),"icon-padding":new Dn(Ve.layout_symbol["icon-padding"]),"icon-keep-upright":new wn(Ve.layout_symbol["icon-keep-upright"]),"icon-offset":new Dn(Ve.layout_symbol["icon-offset"]),"icon-anchor":new Dn(Ve.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new wn(Ve.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new wn(Ve.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new wn(Ve.layout_symbol["text-rotation-alignment"]),"text-field":new Dn(Ve.layout_symbol["text-field"]),"text-font":new Dn(Ve.layout_symbol["text-font"]),"text-size":new Dn(Ve.layout_symbol["text-size"]),"text-max-width":new Dn(Ve.layout_symbol["text-max-width"]),"text-line-height":new wn(Ve.layout_symbol["text-line-height"]),"text-letter-spacing":new Dn(Ve.layout_symbol["text-letter-spacing"]),"text-justify":new Dn(Ve.layout_symbol["text-justify"]),"text-radial-offset":new Dn(Ve.layout_symbol["text-radial-offset"]),"text-variable-anchor":new wn(Ve.layout_symbol["text-variable-anchor"]),"text-anchor":new Dn(Ve.layout_symbol["text-anchor"]),"text-max-angle":new wn(Ve.layout_symbol["text-max-angle"]),"text-writing-mode":new wn(Ve.layout_symbol["text-writing-mode"]),"text-rotate":new Dn(Ve.layout_symbol["text-rotate"]),"text-padding":new wn(Ve.layout_symbol["text-padding"]),"text-keep-upright":new wn(Ve.layout_symbol["text-keep-upright"]),"text-transform":new Dn(Ve.layout_symbol["text-transform"]),"text-offset":new Dn(Ve.layout_symbol["text-offset"]),"text-allow-overlap":new wn(Ve.layout_symbol["text-allow-overlap"]),"text-overlap":new wn(Ve.layout_symbol["text-overlap"]),"text-ignore-placement":new wn(Ve.layout_symbol["text-ignore-placement"]),"text-optional":new wn(Ve.layout_symbol["text-optional"])});var b4={paint:new ji({"icon-opacity":new Dn(Ve.paint_symbol["icon-opacity"]),"icon-color":new Dn(Ve.paint_symbol["icon-color"]),"icon-halo-color":new Dn(Ve.paint_symbol["icon-halo-color"]),"icon-halo-width":new Dn(Ve.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Dn(Ve.paint_symbol["icon-halo-blur"]),"icon-translate":new wn(Ve.paint_symbol["icon-translate"]),"icon-translate-anchor":new wn(Ve.paint_symbol["icon-translate-anchor"]),"text-opacity":new Dn(Ve.paint_symbol["text-opacity"]),"text-color":new Dn(Ve.paint_symbol["text-color"],{runtimeType:Kt,getOverride:f=>f.textColor,hasOverride:f=>!!f.textColor}),"text-halo-color":new Dn(Ve.paint_symbol["text-halo-color"]),"text-halo-width":new Dn(Ve.paint_symbol["text-halo-width"]),"text-halo-blur":new Dn(Ve.paint_symbol["text-halo-blur"]),"text-translate":new wn(Ve.paint_symbol["text-translate"]),"text-translate-anchor":new wn(Ve.paint_symbol["text-translate-anchor"])}),layout:tG};class EM{constructor(l){if(l.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=l.property.overrides?l.property.overrides.runtimeType:pn,this.defaultValue=l}evaluate(l){if(l.formattedSection){const h=this.defaultValue.property.overrides;if(h&&h.hasOverride(l.formattedSection))return h.getOverride(l.formattedSection)}return l.feature&&l.featureState?this.defaultValue.evaluate(l.feature,l.featureState):this.defaultValue.property.specification.default}eachChild(l){this.defaultValue.isConstant()||l(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}yn("FormatSectionOverride",EM,{omit:["defaultValue"]});class by extends Ha{constructor(l){super(l,b4)}recalculate(l,h){if(super.recalculate(l,h),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const y=this.layout.get("text-writing-mode");if(y){const S=[];for(const R of y)S.indexOf(R)<0&&S.push(R);this.layout._values["text-writing-mode"]=S}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(l,h,y,S){const R=this.layout.get(l).evaluate(h,{},y,S),D=this._unevaluatedLayout._values[l];return D.isDataDriven()||Kc(D.value)||!R?R:function($,U){return U.replace(/{([^{}]+)}/g,(W,te)=>te in $?String($[te]):"")}(h.properties,R)}createBucket(l){return new Qf(l)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const l of b4.paint.overridableProperties){if(!by.hasPaintOverride(this.layout,l))continue;const h=this.paint.get(l),y=new EM(h),S=new Of(y,h.property.specification);let R=null;R=h.value.kind==="constant"||h.value.kind==="source"?new Gc("source",S):new qp("composite",S,h.value.zoomStops),this.paint._values[l]=new ja(h.property,R,h.parameters)}}_handleOverridablePaintPropertyUpdate(l,h,y){return!(!this.layout||h.isDataDriven()||y.isDataDriven())&&by.hasPaintOverride(this.layout,l)}static hasPaintOverride(l,h){const y=l.get("text-field"),S=b4.paint.properties[h];let R=!1;const D=$=>{for(const U of $)if(S.overrides&&S.overrides.hasOverride(U))return void(R=!0)};if(y.value.kind==="constant"&&y.value.value instanceof Pe)D(y.value.value.sections);else if(y.value.kind==="source"){const $=W=>{R||(W instanceof Mt&&Ge(W.value)===bn?D(W.value.sections):W instanceof Af?D(W.sections):W.eachChild($))},U=y.value;U._styleExpression&&$(U._styleExpression.expression)}return R}}function _4(f,l,h){let y="never";const S=f.get(l);return S?y=S:f.get(h)&&(y="always"),y}var nG={paint:new ji({"background-color":new wn(Ve.paint_background["background-color"]),"background-pattern":new am(Ve.paint_background["background-pattern"]),"background-opacity":new wn(Ve.paint_background["background-opacity"])})},rG={paint:new ji({"raster-opacity":new wn(Ve.paint_raster["raster-opacity"]),"raster-hue-rotate":new wn(Ve.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new wn(Ve.paint_raster["raster-brightness-min"]),"raster-brightness-max":new wn(Ve.paint_raster["raster-brightness-max"]),"raster-saturation":new wn(Ve.paint_raster["raster-saturation"]),"raster-contrast":new wn(Ve.paint_raster["raster-contrast"]),"raster-resampling":new wn(Ve.paint_raster["raster-resampling"]),"raster-fade-duration":new wn(Ve.paint_raster["raster-fade-duration"])})};class iG extends Ha{constructor(l){super(l,{}),this.onAdd=h=>{this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},this.onRemove=h=>{this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},this.implementation=l}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const oG={circle:class extends Ha{constructor(f){super(f,LK)}createBucket(f){return new qw(f)}queryRadius(f){const l=f;return dm("circle-radius",this,l)+dm("circle-stroke-width",this,l)+ry(this.paint.get("circle-translate"))}queryIntersectsFeature(f,l,h,y,S,R,D,$){const U=iy(f,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),R.angle,D),W=this.paint.get("circle-radius").evaluate(l,h)+this.paint.get("circle-stroke-width").evaluate(l,h),te=this.paint.get("circle-pitch-alignment")==="map",ae=te?U:function(ge,ve){return ge.map(Fe=>Lk(Fe,ve))}(U,$),de=te?W*D:W;for(const ge of y)for(const ve of ge){const Fe=te?ve:Lk(ve,$);let Ne=de;const it=oy([],[ve.x,ve.y,0,1],$);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?Ne*=it[3]/R.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(Ne*=R.cameraToCenterDistance/it[3]),RK(ae,Fe,Ne))return!0}return!1}},heatmap:class extends Ha{constructor(f){super(f,zK),this._updateColorRamp()}createBucket(f){return new Fk(f)}_handleSpecialPaintPropertyUpdate(f){f==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=$k({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}},hillshade:class extends Ha{constructor(f){super(f,$K)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}},fill:class extends Ha{constructor(f){super(f,tW)}recalculate(f,l){super.recalculate(f,l);const h=this.paint._values["fill-outline-color"];h.value.kind==="constant"&&h.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(f){return new a4(f)}queryRadius(){return ry(this.paint.get("fill-translate"))}queryIntersectsFeature(f,l,h,y,S,R,D){return Tk(iy(f,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),R.angle,D),y)}isTileClipped(){return!0}},"fill-extrusion":class extends Ha{constructor(f){super(f,mW)}createBucket(f){return new l4(f)}queryRadius(){return ry(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(f,l,h,y,S,R,D,$){const U=iy(f,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),R.angle,D),W=this.paint.get("fill-extrusion-height").evaluate(l,h),te=this.paint.get("fill-extrusion-base").evaluate(l,h),ae=function(ge,ve,Fe,Ne){const it=[];for(const yt of ge){const Ye=[yt.x,yt.y,0,1];oy(Ye,Ye,ve),it.push(new ne(Ye[0]/Ye[3],Ye[1]/Ye[3]))}return it}(U,$),de=function(ge,ve,Fe,Ne){const it=[],yt=[],Ye=Ne[8]*ve,pt=Ne[9]*ve,Ot=Ne[10]*ve,At=Ne[11]*ve,gn=Ne[8]*Fe,_n=Ne[9]*Fe,cn=Ne[10]*Fe,on=Ne[11]*Fe;for(const en of ge){const dn=[],an=[];for(const Wt of en){const Mn=Wt.x,Sn=Wt.y,Zn=Ne[0]*Mn+Ne[4]*Sn+Ne[12],$r=Ne[1]*Mn+Ne[5]*Sn+Ne[13],Wr=Ne[2]*Mn+Ne[6]*Sn+Ne[14],Pi=Ne[3]*Mn+Ne[7]*Sn+Ne[15],wa=Wr+Ot,Yi=Pi+At,vi=Zn+gn,Oi=$r+_n,Qi=Wr+cn,lo=Pi+on,zo=new ne((Zn+Ye)/Yi,($r+pt)/Yi);zo.z=wa/Yi,dn.push(zo);const yi=new ne(vi/lo,Oi/lo);yi.z=Qi/lo,an.push(yi)}it.push(dn),yt.push(an)}return[it,yt]}(y,te,W,$);return function(ge,ve,Fe){let Ne=1/0;Tk(Fe,ve)&&(Ne=qk(Fe,ve[0]));for(let it=0;it=3){for(let Fe=0;Fe{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._callback()},0))}remove(){delete this._channel,this._callback=()=>{}}}const PM=63710088e-1;class oi{constructor(l,h){if(isNaN(l)||isNaN(h))throw new Error(`Invalid LngLat object: (${l}, ${h})`);if(this.lng=+l,this.lat=+h,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new oi(x(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(l){const h=Math.PI/180,y=this.lat*h,S=l.lat*h,R=Math.sin(y)*Math.sin(S)+Math.cos(y)*Math.cos(S)*Math.cos((l.lng-this.lng)*h);return PM*Math.acos(Math.min(R,1))}toBounds(l=0){const h=360*l/40075017,y=h/Math.cos(Math.PI/180*this.lat);return new dd(new oi(this.lng-y,this.lat-h),new oi(this.lng+y,this.lat+h))}static convert(l){if(l instanceof oi)return l;if(Array.isArray(l)&&(l.length===2||l.length===3))return new oi(Number(l[0]),Number(l[1]));if(!Array.isArray(l)&&typeof l=="object"&&l!==null)return new oi(Number("lng"in l?l.lng:l.lon),Number(l.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class dd{constructor(l,h){l&&(h?this.setSouthWest(l).setNorthEast(h):l.length===4?this.setSouthWest([l[0],l[1]]).setNorthEast([l[2],l[3]]):this.setSouthWest(l[0]).setNorthEast(l[1]))}setNorthEast(l){return this._ne=l instanceof oi?new oi(l.lng,l.lat):oi.convert(l),this}setSouthWest(l){return this._sw=l instanceof oi?new oi(l.lng,l.lat):oi.convert(l),this}extend(l){const h=this._sw,y=this._ne;let S,R;if(l instanceof oi)S=l,R=l;else{if(!(l instanceof dd))return Array.isArray(l)?l.length===4||l.every(Array.isArray)?this.extend(dd.convert(l)):this.extend(oi.convert(l)):this;if(S=l._sw,R=l._ne,!S||!R)return this}return h||y?(h.lng=Math.min(S.lng,h.lng),h.lat=Math.min(S.lat,h.lat),y.lng=Math.max(R.lng,y.lng),y.lat=Math.max(R.lat,y.lat)):(this._sw=new oi(S.lng,S.lat),this._ne=new oi(R.lng,R.lat)),this}getCenter(){return new oi((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 oi(this.getWest(),this.getNorth())}getSouthEast(){return new oi(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(l){const{lng:h,lat:y}=oi.convert(l);let S=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(S=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=y&&y<=this._ne.lat&&S}static convert(l){return l instanceof dd?l:l&&new dd(l)}}const IM=2*Math.PI*PM;function TM(f){return IM*Math.cos(f*Math.PI/180)}function kM(f){return(180+f)/360}function MM(f){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+f*Math.PI/360)))/360}function RM(f,l){return f/TM(l)}function w4(f){return 360/Math.PI*Math.atan(Math.exp((180-360*f)*Math.PI/180))-90}class _y{constructor(l,h,y=0){this.x=+l,this.y=+h,this.z=+y}static fromLngLat(l,h=0){const y=oi.convert(l);return new _y(kM(y.lng),MM(y.lat),RM(h,y.lat))}toLngLat(){return new oi(360*this.x-180,w4(this.y))}toAltitude(){return this.z*TM(w4(this.y))}meterInMercatorCoordinateUnits(){return 1/IM*(l=w4(this.y),1/Math.cos(l*Math.PI/180));var l}}function AM(f,l,h){var y=2*Math.PI*6378137/256/Math.pow(2,h);return[f*y-2*Math.PI*6378137/2,l*y-2*Math.PI*6378137/2]}class C4{constructor(l,h,y){if(l<0||l>25||y<0||y>=Math.pow(2,l)||h<0||h>=Math.pow(2,l))throw new Error(`x=${h}, y=${y}, z=${l} outside of bounds. 0<=x<${Math.pow(2,l)}, 0<=y<${Math.pow(2,l)} 0<=z<=25 `);this.z=l,this.x=h,this.y=y,this.key=wm(0,l,l,h,y)}equals(l){return this.z===l.z&&this.x===l.x&&this.y===l.y}url(l,h,y){const S=(D=this.y,$=this.z,U=AM(256*(R=this.x),256*(D=Math.pow(2,$)-D-1),$),W=AM(256*(R+1),256*(D+1),$),U[0]+","+U[1]+","+W[0]+","+W[1]);var R,D,$,U,W;const te=function(ae,de,ge){let ve,Fe="";for(let Ne=ae;Ne>0;Ne--)ve=1<1?"@2x":"").replace(/{quadkey}/g,te).replace(/{bbox-epsg-3857}/g,S)}isChildOf(l){const h=this.z-l.z;return h>0&&l.x===this.x>>h&&l.y===this.y>>h}getTilePoint(l){const h=Math.pow(2,this.z);return new ne((l.x*h-this.x)*Ei,(l.y*h-this.y)*Ei)}toString(){return`${this.z}/${this.x}/${this.y}`}}class DM{constructor(l,h){this.wrap=l,this.canonical=h,this.key=wm(l,h.z,h.z,h.x,h.y)}}class _a{constructor(l,h,y,S,R){if(l= z; overscaledZ = ${l}; z = ${y}`);this.overscaledZ=l,this.wrap=h,this.canonical=new C4(y,+S,+R),this.key=wm(h,l,y,S,R)}clone(){return new _a(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(l){return this.overscaledZ===l.overscaledZ&&this.wrap===l.wrap&&this.canonical.equals(l.canonical)}scaledTo(l){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);const h=this.canonical.z-l;return l>this.canonical.z?new _a(l,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new _a(l,this.wrap,l,this.canonical.x>>h,this.canonical.y>>h)}calculateScaledKey(l,h){if(l>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${l}; overscaledZ = ${this.overscaledZ}`);const y=this.canonical.z-l;return l>this.canonical.z?wm(this.wrap*+h,l,this.canonical.z,this.canonical.x,this.canonical.y):wm(this.wrap*+h,l,l,this.canonical.x>>y,this.canonical.y>>y)}isChildOf(l){if(l.wrap!==this.wrap)return!1;const h=this.canonical.z-l.canonical.z;return l.overscaledZ===0||l.overscaledZ>h&&l.canonical.y===this.canonical.y>>h}children(l){if(this.overscaledZ>=l)return[new _a(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const h=this.canonical.z+1,y=2*this.canonical.x,S=2*this.canonical.y;return[new _a(h,this.wrap,h,y,S),new _a(h,this.wrap,h,y+1,S),new _a(h,this.wrap,h,y,S+1),new _a(h,this.wrap,h,y+1,S+1)]}isLessThan(l){return this.wrapl.wrap)&&(this.overscaledZl.overscaledZ)&&(this.canonical.xl.canonical.x)&&this.canonical.ythis.max&&(this.max=$),$=this.dim+1||h<-1||h>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(h+1)*this.stride+(l+1)}_unpackMapbox(l,h,y){return(256*l*256+256*h+y)/10-1e4}_unpackTerrarium(l,h,y){return 256*l+h+y/256-32768}getPixels(){return new ba({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(l,h,y){if(this.dim!==l.dim)throw new Error("dem dimension mismatch");let S=h*this.dim,R=h*this.dim+this.dim,D=y*this.dim,$=y*this.dim+this.dim;switch(h){case-1:S=R-1;break;case 1:R=S+1}switch(y){case-1:D=$-1;break;case 1:$=D+1}const U=-h*this.dim,W=-y*this.dim;for(let te=D;te<$;te++)for(let ae=S;ae=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${l} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[l]}}class LM{constructor(l,h,y,S,R){this.type="Feature",this._vectorTileFeature=l,l._z=h,l._x=y,l._y=S,this.properties=l.properties,this.id=R}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(l){this._geometry=l}toJSON(){const l={geometry:this.geometry};for(const h in this)h!=="_geometry"&&h!=="_vectorTileFeature"&&(l[h]=this[h]);return l}}class FM{constructor(l,h){this.tileID=l,this.x=l.canonical.x,this.y=l.canonical.y,this.z=l.canonical.z,this.grid=new rd(Ei,16,0),this.grid3D=new rd(Ei,16,0),this.featureIndexArray=new qn,this.promoteId=h}insert(l,h,y,S,R,D){const $=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(y,S,R);const U=D?this.grid3D:this.grid;for(let W=0;W=0&&ae[3]>=0&&U.insert($,ae[0],ae[1],ae[2],ae[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Fu.VectorTile(new c4(this.rawTileData)).layers,this.sourceLayerCoder=new NM(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(l,h,y,S){this.loadVTLayers();const R=l.params||{},D=Ei/l.tileSize/l.scale,$=Ff(R.filter),U=l.queryGeometry,W=l.queryPadding*D,te=$M(U),ae=this.grid.query(te.minX-W,te.minY-W,te.maxX+W,te.maxY+W),de=$M(l.cameraQueryGeometry),ge=this.grid3D.query(de.minX-W,de.minY-W,de.maxX+W,de.maxY+W,(Ne,it,yt,Ye)=>function(pt,Ot,At,gn,_n){for(const on of pt)if(Ot<=on.x&&At<=on.y&&gn>=on.x&&_n>=on.y)return!0;const cn=[new ne(Ot,At),new ne(Ot,_n),new ne(gn,_n),new ne(gn,At)];if(pt.length>2){for(const on of cn)if(Kf(pt,on))return!0}for(let on=0;on(Ye||(Ye=ld(pt)),Ot.queryIntersectsFeature(U,pt,At,Ye,this.z,l.transform,D,l.pixelPosMatrix)))}return ve}loadMatchingFeature(l,h,y,S,R,D,$,U,W,te,ae){const de=this.bucketLayerIDs[h];if(D&&!function(Ne,it){for(let yt=0;yt=0)return!0;return!1}(D,de))return;const ge=this.sourceLayerCoder.decode(y),ve=this.vtLayers[ge].feature(S);if(R.needGeometry){const Ne=ud(ve,!0);if(!R.filter(new Hr(this.tileID.overscaledZ),Ne,this.tileID.canonical))return}else if(!R.filter(new Hr(this.tileID.overscaledZ),ve))return;const Fe=this.getId(ve,ge);for(let Ne=0;Ne{const $=l instanceof ad?l.get(D):null;return $&&$.evaluate?$.evaluate(h,y,S):$})}function $M(f){let l=1/0,h=1/0,y=-1/0,S=-1/0;for(const R of f)l=Math.min(l,R.x),h=Math.min(h,R.y),y=Math.max(y,R.x),S=Math.max(S,R.y);return{minX:l,minY:h,maxX:y,maxY:S}}function sG(f,l){return l-f}var S4;yn("FeatureIndex",FM,{omit:["rawTileData","sourceLayerCoder"]}),a.PerformanceMarkers=void 0,(S4=a.PerformanceMarkers||(a.PerformanceMarkers={})).create="create",S4.load="load",S4.fullLoad="fullLoad";let wy=null,Cm=[];const E4=1e3/30,lG={mark(f){performance.mark(f)},frame(f){const l=f;wy!=null&&Cm.push(l-wy),wy=l},clearMetrics(){wy=null,Cm=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const f in a.PerformanceMarkers)performance.clearMarks(a.PerformanceMarkers[f])},getPerformanceMetrics(){performance.measure("loadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.load),performance.measure("fullLoadTime",a.PerformanceMarkers.create,a.PerformanceMarkers.fullLoad);const f=performance.getEntriesByName("loadTime")[0].duration,l=performance.getEntriesByName("fullLoadTime")[0].duration,h=Cm.length,y=1/(Cm.reduce((R,D)=>R+D,0)/h/1e3),S=Cm.filter(R=>R>E4).reduce((R,D)=>R+(D-E4)/E4,0);return{loadTime:f,fullLoadTime:l,fps:y,percentDroppedFrames:S/(h+S)*100}}};a.AJAXError=We,a.ARRAY_TYPE=wo,a.Actor=class{constructor(f,l,h){this.target=f,this.parent=l,this.mapId=h,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},k(["receive","process"],this),this.invoker=new aG(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=B()?f:window}send(f,l,h,y,S=!1){const R=Math.round(1e18*Math.random()).toString(36).substring(0,10);h&&(this.callbacks[R]=h);const D=Z(this.globalScope)?void 0:[];return this.target.postMessage({id:R,type:f,hasCallback:!!h,targetMapId:y,mustQueue:S,sourceMapId:this.mapId,data:Ol(l,D)},D),{cancel:()=>{h&&delete this.callbacks[R],this.target.postMessage({id:R,type:"",targetMapId:y,sourceMapId:this.mapId})}}}receive(f){const l=f.data,h=l.id;if(h&&(!l.targetMapId||this.mapId===l.targetMapId))if(l.type===""){delete this.tasks[h];const y=this.cancelCallbacks[h];delete this.cancelCallbacks[h],y&&y()}else B()||l.mustQueue?(this.tasks[h]=l,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,l)}process(){if(!this.taskQueue.length)return;const f=this.taskQueue.shift(),l=this.tasks[f];delete this.tasks[f],this.taskQueue.length&&this.invoker.trigger(),l&&this.processTask(f,l)}processTask(f,l){if(l.type===""){const h=this.callbacks[f];delete this.callbacks[f],h&&(l.error?h(Zs(l.error)):h(null,Zs(l.data)))}else{let h=!1;const y=Z(this.globalScope)?void 0:[],S=l.hasCallback?($,U)=>{h=!0,delete this.cancelCallbacks[f],this.target.postMessage({id:f,type:"",sourceMapId:this.mapId,error:$?Ol($):null,data:Ol(U,y)},y)}:$=>{h=!0};let R=null;const D=Zs(l.data);if(this.parent[l.type])R=this.parent[l.type](l.sourceMapId,D,S);else if(this.parent.getWorkerSource){const $=l.type.split(".");R=this.parent.getWorkerSource(l.sourceMapId,$[0],D.source)[$[1]](D,S)}else S(new Error(`Could not find function ${l.type}`));!h&&R&&R.cancel&&(this.cancelCallbacks[f]=R.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},a.AlphaImage=hm,a.CanonicalTileID=C4,a.CollisionBoxArray=Et,a.CollisionCircleLayoutArray=class extends ie{},a.Color=ce,a.DEMData=OM,a.DataConstantProperty=wn,a.DictionaryCoder=NM,a.EXTENT=Ei,a.ErrorEvent=Nt,a.EvaluationParameters=Hr,a.Event=Dt,a.Evented=jt,a.FeatureIndex=FM,a.FillBucket=a4,a.FillExtrusionBucket=l4,a.GeoJSONFeature=LM,a.ImageAtlas=sM,a.ImagePosition=f4,a.LineBucket=u4,a.LineStripIndexArray=class extends Oe{},a.LngLat=oi,a.LngLatBounds=dd,a.MercatorCoordinate=_y,a.ONE_EM=Hi,a.OverscaledTileID=_a,a.PerformanceUtils=lG,a.PosArray=kn,a.Properties=ji,a.QuadTriangleArray=class extends me{},a.RGBAImage=ba,a.RasterBoundsArray=class extends C{},a.RequestPerformance=class{constructor(f){this._marks={start:[f.url,"start"].join("#"),end:[f.url,"end"].join("#"),measure:f.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let f=performance.getEntriesByName(this._marks.measure);return f.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),f=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),f}},a.ResourceType=St,a.SegmentVector=Jn,a.SymbolBucket=Qf,a.Transitionable=Y0,a.TriangleIndexArray=bo,a.Uniform1f=zl,a.Uniform1i=class extends Fl{constructor(f,l){super(f,l),this.current=0}set(f){this.current!==f&&(this.current=f,this.gl.uniform1i(this.location,f))}},a.Uniform2f=class extends Fl{constructor(f,l){super(f,l),this.current=[0,0]}set(f){f[0]===this.current[0]&&f[1]===this.current[1]||(this.current=f,this.gl.uniform2f(this.location,f[0],f[1]))}},a.Uniform3f=class extends Fl{constructor(f,l){super(f,l),this.current=[0,0,0]}set(f){f[0]===this.current[0]&&f[1]===this.current[1]&&f[2]===this.current[2]||(this.current=f,this.gl.uniform3f(this.location,f[0],f[1],f[2]))}},a.Uniform4f=jf,a.UniformColor=Ck,a.UniformMatrix4f=class extends Fl{constructor(f,l){super(f,l),this.current=kK}set(f){if(f[12]!==this.current[12]||f[0]!==this.current[0])return this.current=f,void this.gl.uniformMatrix4fv(this.location,!1,f);for(let l=1;l<16;l++)if(f[l]!==this.current[l]){this.current=f,this.gl.uniformMatrix4fv(this.location,!1,f);break}}},a.UnwrappedTileID=DM,a.ValidationError=Ze,a.ZoomHistory=Qp,a.add=function(f,l,h){return f[0]=l[0]+h[0],f[1]=l[1]+h[1],f[2]=l[2]+h[2],f},a.addDynamicAttributes=v4,a.asyncAll=function(f,l,h){if(!f.length)return h(null,[]);let y=f.length;const S=new Array(f.length);let R=null;f.forEach((D,$)=>{l(D,(U,W)=>{U&&(R=U),S[$]=W,--y==0&&h(R,S)})})},a.bezier=p,a.bindAll=k,a.cacheEntryPossiblyAdded=function(f){Ce++,Ce>Te&&(f.getActor().send("enforceCacheSizeLimit",xe),Ce=0)},a.clamp=v,a.clearTileCache=function(f){const l=caches.delete(he);f&&l.catch(f).then(()=>f())},a.clipLine=xM,a.clone=function(f){var l=new wo(16);return l[0]=f[0],l[1]=f[1],l[2]=f[2],l[3]=f[3],l[4]=f[4],l[5]=f[5],l[6]=f[6],l[7]=f[7],l[8]=f[8],l[9]=f[9],l[10]=f[10],l[11]=f[11],l[12]=f[12],l[13]=f[13],l[14]=f[14],l[15]=f[15],l},a.clone$1=O,a.clone$2=function(f){var l=new wo(3);return l[0]=f[0],l[1]=f[1],l[2]=f[2],l},a.collisionCircleLayout=PW,a.config=oe,a.copy=function(f,l){return f[0]=l[0],f[1]=l[1],f[2]=l[2],f[3]=l[3],f[4]=l[4],f[5]=l[5],f[6]=l[6],f[7]=l[7],f[8]=l[8],f[9]=l[9],f[10]=l[10],f[11]=l[11],f[12]=l[12],f[13]=l[13],f[14]=l[14],f[15]=l[15],f},a.create=function(){var f=new wo(16);return wo!=Float32Array&&(f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0),f[0]=1,f[5]=1,f[10]=1,f[15]=1,f},a.create$1=Rk,a.createExpression=Wc,a.createFilter=Ff,a.createLayout=gi,a.createStyleLayer=function(f){return f.type==="custom"?new iG(f):new oG[f.type](f)},a.cross=function(f,l,h){var y=l[0],S=l[1],R=l[2],D=h[0],$=h[1],U=h[2];return f[0]=S*U-R*$,f[1]=R*D-y*U,f[2]=y*$-S*D,f},a.dot=function(f,l){return f[0]*l[0]+f[1]*l[1]+f[2]*l[2]},a.dot$1=function(f,l){return f[0]*l[0]+f[1]*l[1]+f[2]*l[2]+f[3]*l[3]},a.ease=m,a.emitValidationErrors=$f,a.enforceCacheSizeLimit=function(f){Ee(),_e&&_e.then(l=>{l.keys().then(h=>{for(let y=0;y{}}},a.identity=Yw,a.invert=function(f,l){var h=l[0],y=l[1],S=l[2],R=l[3],D=l[4],$=l[5],U=l[6],W=l[7],te=l[8],ae=l[9],de=l[10],ge=l[11],ve=l[12],Fe=l[13],Ne=l[14],it=l[15],yt=h*$-y*D,Ye=h*U-S*D,pt=h*W-R*D,Ot=y*U-S*$,At=y*W-R*$,gn=S*W-R*U,_n=te*Fe-ae*ve,cn=te*Ne-de*ve,on=te*it-ge*ve,en=ae*Ne-de*Fe,dn=ae*it-ge*Fe,an=de*it-ge*Ne,Wt=yt*an-Ye*dn+pt*en+Ot*on-At*cn+gn*_n;return Wt?(f[0]=($*an-U*dn+W*en)*(Wt=1/Wt),f[1]=(S*dn-y*an-R*en)*Wt,f[2]=(Fe*gn-Ne*At+it*Ot)*Wt,f[3]=(de*At-ae*gn-ge*Ot)*Wt,f[4]=(U*on-D*an-W*cn)*Wt,f[5]=(h*an-S*on+R*cn)*Wt,f[6]=(Ne*pt-ve*gn-it*Ye)*Wt,f[7]=(te*gn-de*pt+ge*Ye)*Wt,f[8]=(D*dn-$*on+W*_n)*Wt,f[9]=(y*on-h*dn-R*_n)*Wt,f[10]=(ve*At-Fe*pt+it*yt)*Wt,f[11]=(ae*pt-te*At-ge*yt)*Wt,f[12]=($*cn-D*en-U*_n)*Wt,f[13]=(h*en-y*cn+S*_n)*Wt,f[14]=(Fe*Ye-ve*Ot-Ne*yt)*Wt,f[15]=(te*Ot-ae*Ye+de*yt)*Wt,f):null},a.isImageBitmap=Q,a.isSafari=Z,a.isWorker=B,a.keysDifference=function(f,l){const h=[];for(const y in f)y in l||h.push(y);return h},a.lazyLoadRTLTextPlugin=function(){ea.isLoading()||ea.isLoaded()||id()!=="deferred"||X0()},a.makeRequest=mt,a.mapObject=T,a.mercatorXfromLng=kM,a.mercatorYfromLat=MM,a.mercatorZfromAltitude=RM,a.mul=FK,a.mul$1=function(f,l,h){return f[0]=l[0]*h[0],f[1]=l[1]*h[1],f[2]=l[2]*h[2],f[3]=l[3]*h[3],f},a.multiply=Ak,a.nextPowerOfTwo=function(f){return f<=1?1:Math.pow(2,Math.ceil(Math.log(f)/Math.LN2))},a.normalize=function(f,l){var h=l[0],y=l[1],S=l[2],R=h*h+y*y+S*S;return R>0&&(R=1/Math.sqrt(R)),f[0]=l[0]*R,f[1]=l[1]*R,f[2]=l[2]*R,f},a.number=Pr,a.ortho=function(f,l,h,y,S,R,D){var $=1/(l-h),U=1/(y-S),W=1/(R-D);return f[0]=-2*$,f[1]=0,f[2]=0,f[3]=0,f[4]=0,f[5]=-2*U,f[6]=0,f[7]=0,f[8]=0,f[9]=0,f[10]=2*W,f[11]=0,f[12]=(l+h)*$,f[13]=(S+y)*U,f[14]=(D+R)*W,f[15]=1,f},a.parseCacheControl=H,a.parseGlyphPbf=function(f){return new c4(f).readFields(FW,[])},a.pbf=c4,a.performSymbolLayout=function(f){f.bucket.createArrays(),f.bucket.tilePixelRatio=Ei/(512*f.bucket.overscaling),f.bucket.compareText={},f.bucket.iconsNeedLinear=!1;const l=f.bucket.layers[0].layout,h=f.bucket.layers[0]._unevaluatedLayout._values,y={layoutIconSize:h["icon-size"].possiblyEvaluate(new Hr(f.bucket.zoom+1),f.canonical),layoutTextSize:h["text-size"].possiblyEvaluate(new Hr(f.bucket.zoom+1),f.canonical),textMaxSize:h["text-size"].possiblyEvaluate(new Hr(18))};if(f.bucket.textSizeData.kind==="composite"){const{minZoom:U,maxZoom:W}=f.bucket.textSizeData;y.compositeTextSizes=[h["text-size"].possiblyEvaluate(new Hr(U),f.canonical),h["text-size"].possiblyEvaluate(new Hr(W),f.canonical)]}if(f.bucket.iconSizeData.kind==="composite"){const{minZoom:U,maxZoom:W}=f.bucket.iconSizeData;y.compositeIconSizes=[h["icon-size"].possiblyEvaluate(new Hr(U),f.canonical),h["icon-size"].possiblyEvaluate(new Hr(W),f.canonical)]}const S=l.get("text-line-height")*Hi,R=l.get("text-rotation-alignment")!=="viewport"&&l.get("symbol-placement")!=="point",D=l.get("text-keep-upright"),$=l.get("text-size");for(const U of f.bucket.features){const W=l.get("text-font").evaluate(U,{},f.canonical).join(","),te=$.evaluate(U,{},f.canonical),ae=y.layoutTextSize.evaluate(U,{},f.canonical),de=y.layoutIconSize.evaluate(U,{},f.canonical),ge={horizontal:{},vertical:void 0},ve=U.text;let Fe,Ne=[0,0];if(ve){const Ye=ve.toString(),pt=l.get("text-letter-spacing").evaluate(U,{},f.canonical)*Hi,Ot=jw(Ye)?pt:0,At=l.get("text-anchor").evaluate(U,{},f.canonical),gn=l.get("text-variable-anchor");if(!gn){const dn=l.get("text-radial-offset").evaluate(U,{},f.canonical);Ne=dn?wM(At,[dn*Hi,m4]):l.get("text-offset").evaluate(U,{},f.canonical).map(an=>an*Hi)}let _n=R?"center":l.get("text-justify").evaluate(U,{},f.canonical);const cn=l.get("symbol-placement"),on=cn==="point"?l.get("text-max-width").evaluate(U,{},f.canonical)*Hi:0,en=()=>{f.bucket.allowVerticalPlacement&&Bf(Ye)&&(ge.vertical=hy(ve,f.glyphMap,f.glyphPositions,f.imagePositions,W,on,S,At,"left",Ot,Ne,a.WritingMode.vertical,!0,cn,ae,te))};if(!R&&gn){const dn=_n==="auto"?gn.map(Wt=>g4(Wt)):[_n];let an=!1;for(let Wt=0;Wtthis._layers[et.id]),Ae=we[0];if(Ae.visibility==="none")continue;const Pe=Ae.source||"";let Me=this.familiesBySource[Pe];Me||(Me=this.familiesBySource[Pe]={});const Be=Ae.sourceLayer||"_geojsonTileLayer";let Je=Me[Be];Je||(Je=Me[Be]=[]),Je.push(we)}}}class m{constructor(q){const J={},pe=[];for(const Pe in q){const Me=q[Pe],Be=J[Pe]={};for(const Je in Me){const et=Me[+Je];if(!et||et.bitmap.width===0||et.bitmap.height===0)continue;const Ge={x:0,y:0,w:et.bitmap.width+2,h:et.bitmap.height+2};pe.push(Ge),Be[Je]={rect:Ge,metrics:et.metrics}}}const{w:ce,h:we}=a.potpack(pe),Ae=new a.AlphaImage({width:ce||1,height:we||1});for(const Pe in q){const Me=q[Pe];for(const Be in Me){const Je=Me[+Be];if(!Je||Je.bitmap.width===0||Je.bitmap.height===0)continue;const et=J[Pe][Be].rect;a.AlphaImage.copy(Je.bitmap,Ae,{x:0,y:0},{x:et.x+1,y:et.y+1},Je.bitmap)}}this.image=Ae,this.positions=J}}a.register("GlyphAtlas",m);class v{constructor(q){this.tileID=new a.OverscaledTileID(q.tileID.overscaledZ,q.tileID.wrap,q.tileID.canonical.z,q.tileID.canonical.x,q.tileID.canonical.y),this.uid=q.uid,this.zoom=q.zoom,this.pixelRatio=q.pixelRatio,this.tileSize=q.tileSize,this.source=q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=q.showCollisionBoxes,this.collectResourceTiming=!!q.collectResourceTiming,this.returnDependencies=!!q.returnDependencies,this.promoteId=q.promoteId}parse(q,J,pe,ce,we){this.status="parsing",this.data=q,this.collisionBoxArray=new a.CollisionBoxArray;const Ae=new a.DictionaryCoder(Object.keys(q.layers).sort()),Pe=new a.FeatureIndex(this.tileID,this.promoteId);Pe.bucketLayerIDs=[];const Me={},Be={featureIndex:Pe,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:pe},Je=J.familiesBySource[this.source];for(const hn in Je){const Pn=q.layers[hn];if(!Pn)continue;Pn.version===1&&a.warnOnce(`Vector tile source "${this.source}" layer "${hn}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const Gn=Ae.encode(hn),lr=[];for(let Zr=0;Zr=hr.maxzoom||hr.visibility!=="none"&&(x(Zr,this.zoom,pe),(Me[hr.id]=hr.createBucket({index:Pe.bucketLayerIDs.length,layers:Zr,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:Gn,sourceID:this.source})).populate(lr,Be,this.tileID.canonical),Pe.bucketLayerIDs.push(Zr.map(Vr=>Vr.id)))}}let et,Ge,Ut,Mt;const at=a.mapObject(Be.glyphDependencies,hn=>Object.keys(hn).map(Number));Object.keys(at).length?ce.send("getGlyphs",{uid:this.uid,stacks:at},(hn,Pn)=>{et||(et=hn,Ge=Pn,En.call(this))}):Ge={};const $t=Object.keys(Be.iconDependencies);$t.length?ce.send("getImages",{icons:$t,source:this.source,tileID:this.tileID,type:"icons"},(hn,Pn)=>{et||(et=hn,Ut=Pn,En.call(this))}):Ut={};const Xt=Object.keys(Be.patternDependencies);function En(){if(et)return we(et);if(Ge&&Ut&&Mt){const hn=new m(Ge),Pn=new a.ImageAtlas(Ut,Mt);for(const Gn in Me){const lr=Me[Gn];lr instanceof a.SymbolBucket?(x(lr.layers,this.zoom,pe),a.performSymbolLayout({bucket:lr,glyphMap:Ge,glyphPositions:hn.positions,imageMap:Ut,imagePositions:Pn.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):lr.hasPattern&&(lr instanceof a.LineBucket||lr instanceof a.FillBucket||lr instanceof a.FillExtrusionBucket)&&(x(lr.layers,this.zoom,pe),lr.addFeatures(Be,this.tileID.canonical,Pn.patternPositions))}this.status="done",we(null,{buckets:Object.values(Me).filter(Gn=>!Gn.isEmpty()),featureIndex:Pe,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:hn.image,imageAtlas:Pn,glyphMap:this.returnDependencies?Ge:null,iconMap:this.returnDependencies?Ut:null,glyphPositions:this.returnDependencies?hn.positions:null})}}Xt.length?ce.send("getImages",{icons:Xt,source:this.source,tileID:this.tileID,type:"patterns"},(hn,Pn)=>{et||(et=hn,Mt=Pn,En.call(this))}):Mt={},En.call(this)}}function x(ye,q,J){const pe=new a.EvaluationParameters(q);for(const ce of ye)ce.recalculate(pe,J)}function _(ye,q){const J=a.getArrayBuffer(ye.request,(pe,ce,we,Ae)=>{pe?q(pe):ce&&q(null,{vectorTile:new a.vectorTile.VectorTile(new a.pbf(ce)),rawData:ce,cacheControl:we,expires:Ae})});return()=>{J.cancel(),q()}}class P{constructor(q,J,pe,ce){this.actor=q,this.layerIndex=J,this.availableImages=pe,this.loadVectorData=ce||_,this.loading={},this.loaded={}}loadTile(q,J){const pe=q.uid;this.loading||(this.loading={});const ce=!!(q&&q.request&&q.request.collectResourceTiming)&&new a.RequestPerformance(q.request),we=this.loading[pe]=new v(q);we.abort=this.loadVectorData(q,(Ae,Pe)=>{if(delete this.loading[pe],Ae||!Pe)return we.status="done",this.loaded[pe]=we,J(Ae);const Me=Pe.rawData,Be={};Pe.expires&&(Be.expires=Pe.expires),Pe.cacheControl&&(Be.cacheControl=Pe.cacheControl);const Je={};if(ce){const et=ce.finish();et&&(Je.resourceTiming=JSON.parse(JSON.stringify(et)))}we.vectorTile=Pe.vectorTile,we.parse(Pe.vectorTile,this.layerIndex,this.availableImages,this.actor,(et,Ge)=>{if(et||!Ge)return J(et);J(null,a.extend({rawTileData:Me.slice(0)},Ge,Be,Je))}),this.loaded=this.loaded||{},this.loaded[pe]=we})}reloadTile(q,J){const pe=this.loaded,ce=q.uid,we=this;if(pe&&pe[ce]){const Ae=pe[ce];Ae.showCollisionBoxes=q.showCollisionBoxes;const Pe=(Me,Be)=>{const Je=Ae.reloadCallback;Je&&(delete Ae.reloadCallback,Ae.parse(Ae.vectorTile,we.layerIndex,this.availableImages,we.actor,Je)),J(Me,Be)};Ae.status==="parsing"?Ae.reloadCallback=Pe:Ae.status==="done"&&(Ae.vectorTile?Ae.parse(Ae.vectorTile,this.layerIndex,this.availableImages,this.actor,Pe):Pe())}}abortTile(q,J){const pe=this.loading,ce=q.uid;pe&&pe[ce]&&pe[ce].abort&&(pe[ce].abort(),delete pe[ce]),J()}removeTile(q,J){const pe=this.loaded,ce=q.uid;pe&&pe[ce]&&delete pe[ce],J()}}class k{constructor(){this.loaded={}}loadTile(q,J){const{uid:pe,encoding:ce,rawImageData:we}=q,Ae=a.isImageBitmap(we)?this.getImageData(we):we,Pe=new a.DEMData(pe,Ae,ce);this.loaded=this.loaded||{},this.loaded[pe]=Pe,J(null,Pe)}getImageData(q){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(q.width,q.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=q.width,this.offscreenCanvas.height=q.height,this.offscreenCanvasContext.drawImage(q,0,0,q.width,q.height);const J=this.offscreenCanvasContext.getImageData(-1,-1,q.width+2,q.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new a.RGBAImage({width:J.width,height:J.height},J.data)}removeTile(q){const J=this.loaded,pe=q.uid;J&&J[pe]&&delete J[pe]}}var T=function ye(q,J){var pe,ce=q&&q.type;if(ce==="FeatureCollection")for(pe=0;pe=Math.abs(Pe)?J-Me+Pe:Pe-Me+J,J=Me}J+pe>=0!=!!q&&ye.reverse()}const N=a.vectorTile.VectorTileFeature.prototype.toGeoJSON;class L{constructor(q){this._feature=q,this.extent=a.EXTENT,this.type=q.type,this.properties=q.tags,"id"in q&&!isNaN(q.id)&&(this.id=parseInt(q.id,10))}loadGeometry(){if(this._feature.type===1){const q=[];for(const J of this._feature.geometry)q.push([new a.pointGeometry(J[0],J[1])]);return q}{const q=[];for(const J of this._feature.geometry){const pe=[];for(const ce of J)pe.push(new a.pointGeometry(ce[0],ce[1]));q.push(pe)}return q}}toGeoJSON(q,J,pe){return N.call(this,q,J,pe)}}class F{constructor(q){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=a.EXTENT,this.length=q.length,this._features=q}feature(q){return new L(this._features[q])}}var V={exports:{}},B=a.pointGeometry,H=a.vectorTile.VectorTileFeature,G=ee;function ee(ye,q){this.options=q||{},this.features=ye,this.length=ye.length}function X(ye,q){this.id=typeof ye.id=="number"?ye.id:void 0,this.type=ye.type,this.rawGeometry=ye.type===1?[ye.geometry]:ye.geometry,this.properties=ye.tags,this.extent=q||4096}ee.prototype.feature=function(ye){return new X(this.features[ye],this.options.extent)},X.prototype.loadGeometry=function(){var ye=this.rawGeometry;this.geometry=[];for(var q=0;q>31}function be(ye,q){for(var J=ye.loadGeometry(),pe=ye.type,ce=0,we=0,Ae=J.length,Pe=0;Pe>1;Ee(ye,q,Ae,pe,ce,we%2),Te(ye,q,J,pe,Ae-1,we+1),Te(ye,q,J,Ae+1,ce,we+1)}function Ee(ye,q,J,pe,ce,we){for(;ce>pe;){if(ce-pe>600){const Be=ce-pe+1,Je=J-pe+1,et=Math.log(Be),Ge=.5*Math.exp(2*et/3),Ut=.5*Math.sqrt(et*Ge*(Be-Ge)/Be)*(Je-Be/2<0?-1:1);Ee(ye,q,J,Math.max(pe,Math.floor(J-Je*Ge/Be+Ut)),Math.min(ce,Math.floor(J+(Be-Je)*Ge/Be+Ut)),we)}const Ae=q[2*J+we];let Pe=pe,Me=ce;for(Ce(ye,q,pe,J),q[2*ce+we]>Ae&&Ce(ye,q,pe,ce);PeAe;)Me--}q[2*pe+we]===Ae?Ce(ye,q,pe,Me):(Me++,Ce(ye,q,Me,ce)),Me<=J&&(pe=Me+1),J<=Me&&(ce=Me-1)}}function Ce(ye,q,J,pe){ke(ye,J,pe),ke(q,2*J,2*pe),ke(q,2*J+1,2*pe+1)}function ke(ye,q,J){const pe=ye[q];ye[q]=ye[J],ye[J]=pe}function De(ye,q,J,pe){const ce=ye-J,we=q-pe;return ce*ce+we*we}V.exports=le,V.exports.fromVectorTileJs=le,V.exports.fromGeojsonVt=function(ye,q){q=q||{};var J={};for(var pe in ye)J[pe]=new Q(ye[pe].features,q),J[pe].name=pe,J[pe].version=q.version,J[pe].extent=q.extent;return le({layers:J})},V.exports.GeoJSONWrapper=Q;const Ke=ye=>ye[0],Ue=ye=>ye[1];class tt{constructor(q,J=Ke,pe=Ue,ce=64,we=Float64Array){this.nodeSize=ce,this.points=q;const Ae=q.length<65536?Uint16Array:Uint32Array,Pe=this.ids=new Ae(q.length),Me=this.coords=new we(2*q.length);for(let Be=0;Be=Pe&&Mt<=Be&&at>=Me&&at<=Je&&Ut.push(we[Gn]);continue}const hn=Math.floor((En+Xt)/2);Mt=Ae[2*hn],at=Ae[2*hn+1],Mt>=Pe&&Mt<=Be&&at>=Me&&at<=Je&&Ut.push(we[hn]);const Pn=($t+1)%2;($t===0?Pe<=Mt:Me<=at)&&(Ge.push(En),Ge.push(hn-1),Ge.push(Pn)),($t===0?Be>=Mt:Je>=at)&&(Ge.push(hn+1),Ge.push(Xt),Ge.push(Pn))}return Ut}(this.ids,this.coords,q,J,pe,ce,this.nodeSize)}within(q,J,pe){return function(ce,we,Ae,Pe,Me,Be){const Je=[0,ce.length-1,0],et=[],Ge=Me*Me;for(;Je.length;){const Ut=Je.pop(),Mt=Je.pop(),at=Je.pop();if(Mt-at<=Be){for(let Pn=at;Pn<=Mt;Pn++)De(we[2*Pn],we[2*Pn+1],Ae,Pe)<=Ge&&et.push(ce[Pn]);continue}const $t=Math.floor((at+Mt)/2),Xt=we[2*$t],En=we[2*$t+1];De(Xt,En,Ae,Pe)<=Ge&&et.push(ce[$t]);const hn=(Ut+1)%2;(Ut===0?Ae-Me<=Xt:Pe-Me<=En)&&(Je.push(at),Je.push($t-1),Je.push(hn)),(Ut===0?Ae+Me>=Xt:Pe+Me>=En)&&(Je.push($t+1),Je.push(Mt),Je.push(hn))}return et}(this.ids,this.coords,q,J,pe,this.nodeSize)}}const lt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:ye=>ye},St=Math.fround||(We=new Float32Array(1),ye=>(We[0]=+ye,We[0]));var We;class bt{constructor(q){this.options=qe(Object.create(lt),q),this.trees=new Array(this.options.maxZoom+1)}load(q){const{log:J,minZoom:pe,maxZoom:ce,nodeSize:we}=this.options;J&&console.time("total time");const Ae=`prepare ${q.length} points`;J&&console.time(Ae),this.points=q;let Pe=[];for(let Me=0;Me=pe;Me--){const Be=+Date.now();Pe=this._cluster(Pe,Me),this.trees[Me]=new tt(Pe,dt,_t,we,Float32Array),J&&console.log("z%d: %d clusters in %dms",Me,Pe.length,+Date.now()-Be)}return J&&console.timeEnd("total time"),this}getClusters(q,J){let pe=((q[0]+180)%360+360)%360-180;const ce=Math.max(-90,Math.min(90,q[1]));let we=q[2]===180?180:((q[2]+180)%360+360)%360-180;const Ae=Math.max(-90,Math.min(90,q[3]));if(q[2]-q[0]>=360)pe=-180,we=180;else if(pe>we){const Je=this.getClusters([pe,ce,180,Ae],J),et=this.getClusters([-180,ce,we,Ae],J);return Je.concat(et)}const Pe=this.trees[this._limitZoom(J)],Me=Pe.range(rt(pe),ut(Ae),rt(we),ut(ce)),Be=[];for(const Je of Me){const et=Pe.points[Je];Be.push(et.numPoints?ct(et):this.points[et.index])}return Be}getChildren(q){const J=this._getOriginId(q),pe=this._getOriginZoom(q),ce="No cluster with the specified id.",we=this.trees[pe];if(!we)throw new Error(ce);const Ae=we.points[J];if(!Ae)throw new Error(ce);const Pe=this.options.radius/(this.options.extent*Math.pow(2,pe-1)),Me=we.within(Ae.x,Ae.y,Pe),Be=[];for(const Je of Me){const et=we.points[Je];et.parentId===q&&Be.push(et.numPoints?ct(et):this.points[et.index])}if(Be.length===0)throw new Error(ce);return Be}getLeaves(q,J,pe){const ce=[];return this._appendLeaves(ce,q,J=J||10,pe=pe||0,0),ce}getTile(q,J,pe){const ce=this.trees[this._limitZoom(q)],we=Math.pow(2,q),{extent:Ae,radius:Pe}=this.options,Me=Pe/Ae,Be=(pe-Me)/we,Je=(pe+1+Me)/we,et={features:[]};return this._addTileFeatures(ce.range((J-Me)/we,Be,(J+1+Me)/we,Je),ce.points,J,pe,we,et),J===0&&this._addTileFeatures(ce.range(1-Me/we,Be,1,Je),ce.points,we,pe,we,et),J===we-1&&this._addTileFeatures(ce.range(0,Be,Me/we,Je),ce.points,-1,pe,we,et),et.features.length?et:null}getClusterExpansionZoom(q){let J=this._getOriginZoom(q)-1;for(;J<=this.options.maxZoom;){const pe=this.getChildren(q);if(J++,pe.length!==1)break;q=pe[0].properties.cluster_id}return J}_appendLeaves(q,J,pe,ce,we){const Ae=this.getChildren(J);for(const Pe of Ae){const Me=Pe.properties;if(Me&&Me.cluster?we+Me.point_count<=ce?we+=Me.point_count:we=this._appendLeaves(q,Me.cluster_id,pe,ce,we):weJ&&(Mt+=$t.numPoints||1)}if(Mt>Ut&&Mt>=Pe){let at=Je.x*Ut,$t=Je.y*Ut,Xt=Ae&&Ut>1?this._map(Je,!0):null;const En=(Be<<5)+(J+1)+this.points.length;for(const hn of Ge){const Pn=et.points[hn];if(Pn.zoom<=J)continue;Pn.zoom=J;const Gn=Pn.numPoints||1;at+=Pn.x*Gn,$t+=Pn.y*Gn,Pn.parentId=En,Ae&&(Xt||(Xt=this._map(Je,!0)),Ae(Xt,this._map(Pn)))}Je.parentId=En,pe.push(Qe(at/Mt,$t/Mt,En,Mt,Xt))}else if(pe.push(Je),Mt>1)for(const at of Ge){const $t=et.points[at];$t.zoom<=J||($t.zoom=J,pe.push($t))}}return pe}_getOriginId(q){return q-this.points.length>>5}_getOriginZoom(q){return(q-this.points.length)%32}_map(q,J){if(q.numPoints)return J?qe({},q.properties):q.properties;const pe=this.points[q.index].properties,ce=this.options.map(pe);return J&&ce===pe?qe({},ce):ce}}function Qe(ye,q,J,pe,ce){return{x:St(ye),y:St(q),zoom:1/0,id:J,parentId:-1,numPoints:pe,properties:ce}}function mt(ye,q){const[J,pe]=ye.geometry.coordinates;return{x:St(rt(J)),y:St(ut(pe)),zoom:1/0,index:q,parentId:-1}}function ct(ye){return{type:"Feature",id:ye.id,properties:wt(ye),geometry:{type:"Point",coordinates:[(q=ye.x,360*(q-.5)),nt(ye.y)]}};var q}function wt(ye){const q=ye.numPoints,J=q>=1e4?`${Math.round(q/1e3)}k`:q>=1e3?Math.round(q/100)/10+"k":q;return qe(qe({},ye.properties),{cluster:!0,cluster_id:ye.id,point_count:q,point_count_abbreviated:J})}function rt(ye){return ye/360+.5}function ut(ye){const q=Math.sin(ye*Math.PI/180),J=.5-.25*Math.log((1+q)/(1-q))/Math.PI;return J<0?0:J>1?1:J}function nt(ye){const q=(180-360*ye)*Math.PI/180;return 360*Math.atan(Math.exp(q))/Math.PI-90}function qe(ye,q){for(const J in q)ye[J]=q[J];return ye}function dt(ye){return ye.x}function _t(ye){return ye.y}function Dt(ye,q,J,pe){for(var ce,we=pe,Ae=J-q>>1,Pe=J-q,Me=ye[q],Be=ye[q+1],Je=ye[J],et=ye[J+1],Ge=q+3;Gewe)ce=Ge,we=Ut;else if(Ut===we){var Mt=Math.abs(Ge-Ae);Mtpe&&(ce-q>3&&Dt(ye,q,ce,pe),ye[ce+2]=we,J-ce>3&&Dt(ye,ce,J,pe))}function Nt(ye,q,J,pe,ce,we){var Ae=ce-J,Pe=we-pe;if(Ae!==0||Pe!==0){var Me=((ye-J)*Ae+(q-pe)*Pe)/(Ae*Ae+Pe*Pe);Me>1?(J=ce,pe=we):Me>0&&(J+=Ae*Me,pe+=Pe*Me)}return(Ae=ye-J)*Ae+(Pe=q-pe)*Pe}function jt(ye,q,J,pe){var ce={id:ye===void 0?null:ye,type:q,geometry:J,tags:pe,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(we){var Ae=we.geometry,Pe=we.type;if(Pe==="Point"||Pe==="MultiPoint"||Pe==="LineString")Ve(we,Ae);else if(Pe==="Polygon"||Pe==="MultiLineString")for(var Me=0;Me0&&(Ae+=pe?(ce*Be-Me*we)/2:Math.sqrt(Math.pow(Me-ce,2)+Math.pow(Be-we,2))),ce=Me,we=Be}var Je=q.length-3;q[2]=1,Dt(q,0,Je,J),q[Je+2]=1,q.size=Math.abs(Ae),q.start=0,q.end=q.size}function Gt(ye,q,J,pe){for(var ce=0;ce1?1:J}function Qt(ye,q,J,pe,ce,we,Ae,Pe){if(pe/=q,we>=(J/=q)&&Ae=pe)return null;for(var Me=[],Be=0;Be=J&&Mt=pe)){var at=[];if(Ge==="Point"||Ge==="MultiPoint")pn(et,at,J,pe,ce);else if(Ge==="LineString")ot(et,at,J,pe,ce,!1,Pe.lineMetrics);else if(Ge==="MultiLineString")Tt(et,at,J,pe,ce,!1);else if(Ge==="Polygon")Tt(et,at,J,pe,ce,!0);else if(Ge==="MultiPolygon")for(var $t=0;$t=J&&Ae<=pe&&(q.push(ye[we]),q.push(ye[we+1]),q.push(ye[we+2]))}}function ot(ye,q,J,pe,ce,we,Ae){for(var Pe,Me,Be=Lt(ye),Je=ce===0?Zt:ht,et=ye.start,Ge=0;GeJ&&(Me=Je(Be,Ut,Mt,$t,Xt,J),Ae&&(Be.start=et+Pe*Me)):En>pe?hn=J&&(Me=Je(Be,Ut,Mt,$t,Xt,J),Pn=!0),hn>pe&&En<=pe&&(Me=Je(Be,Ut,Mt,$t,Xt,pe),Pn=!0),!we&&Pn&&(Ae&&(Be.end=et+Pe*Me),q.push(Be),Be=Lt(ye)),Ae&&(et+=Pe)}var Gn=ye.length-3;Ut=ye[Gn],Mt=ye[Gn+1],at=ye[Gn+2],(En=ce===0?Ut:Mt)>=J&&En<=pe&&Kt(Be,Ut,Mt,at),Gn=Be.length-3,we&&Gn>=3&&(Be[Gn]!==Be[0]||Be[Gn+1]!==Be[1])&&Kt(Be,Be[0],Be[1],Be[2]),Be.length&&q.push(Be)}function Lt(ye){var q=[];return q.size=ye.size,q.start=ye.start,q.end=ye.end,q}function Tt(ye,q,J,pe,ce,we){for(var Ae=0;AeAe.maxX&&(Ae.maxX=Je),et>Ae.maxY&&(Ae.maxY=et)}return Ae}function xt(ye,q,J,pe){var ce=q.geometry,we=q.type,Ae=[];if(we==="Point"||we==="MultiPoint")for(var Pe=0;Pe0&&q.size<(ce?Ae:pe))J.numPoints+=q.length/3;else{for(var Pe=[],Me=0;MeAe)&&(J.numSimplified++,Pe.push(q[Me]),Pe.push(q[Me+1])),J.numPoints++;ce&&function(Be,Je){for(var et=0,Ge=0,Ut=Be.length,Mt=Ut-2;Ge0===Je)for(Ge=0,Ut=Be.length;Ge24)throw new Error("maxZoom should be in the 0-24 range");if(q.promoteId&&q.generateId)throw new Error("promoteId and generateId cannot be used together.");var pe=function(ce,we){var Ae=[];if(ce.type==="FeatureCollection")for(var Pe=0;Pe1&&console.time("creation"),Ge=this.tiles[et]=gt(ye,q,J,pe,Me),this.tileCoords.push({z:q,x:J,y:pe}),Be)){Be>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",q,J,pe,Ge.numFeatures,Ge.numPoints,Ge.numSimplified),console.timeEnd("creation"));var Ut="z"+q;this.stats[Ut]=(this.stats[Ut]||0)+1,this.total++}if(Ge.source=ye,ce){if(q===Me.maxZoom||q===ce)continue;var Mt=1<1&&console.time("clipping");var at,$t,Xt,En,hn,Pn,Gn=.5*Me.buffer/Me.extent,lr=.5-Gn,Zr=.5+Gn,hr=1+Gn;at=$t=Xt=En=null,hn=Qt(ye,Je,J-Gn,J+Zr,0,Ge.minX,Ge.maxX,Me),Pn=Qt(ye,Je,J+lr,J+hr,0,Ge.minX,Ge.maxX,Me),ye=null,hn&&(at=Qt(hn,Je,pe-Gn,pe+Zr,1,Ge.minY,Ge.maxY,Me),$t=Qt(hn,Je,pe+lr,pe+hr,1,Ge.minY,Ge.maxY,Me),hn=null),Pn&&(Xt=Qt(Pn,Je,pe-Gn,pe+Zr,1,Ge.minY,Ge.maxY,Me),En=Qt(Pn,Je,pe+lr,pe+hr,1,Ge.minY,Ge.maxY,Me),Pn=null),Be>1&&console.timeEnd("clipping"),Pe.push(at||[],q+1,2*J,2*pe),Pe.push($t||[],q+1,2*J,2*pe+1),Pe.push(Xt||[],q+1,2*J+1,2*pe),Pe.push(En||[],q+1,2*J+1,2*pe+1)}}},qt.prototype.getTile=function(ye,q,J){var pe=this.options,ce=pe.extent,we=pe.debug;if(ye<0||ye>24)return null;var Ae=1<1&&console.log("drilling down to z%d-%d-%d",ye,q,J);for(var Me,Be=ye,Je=q,et=J;!Me&&Be>0;)Be--,Je=Math.floor(Je/2),et=Math.floor(et/2),Me=this.tiles[vn(Be,Je,et)];return Me&&Me.source?(we>1&&console.log("found parent tile z%d-%d-%d",Be,Je,et),we>1&&console.time("drilling down"),this.splitTile(Me.source,Be,Je,et,ye,q,J),we>1&&console.timeEnd("drilling down"),this.tiles[Pe]?tn(this.tiles[Pe],ce):null):null};class tr extends P{constructor(q,J,pe,ce){super(q,J,pe,Fn),ce&&(this.loadGeoJSON=ce)}loadData(q,J){var pe;(pe=this._pendingRequest)===null||pe===void 0||pe.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const ce=!!(q&&q.request&&q.request.collectResourceTiming)&&new a.RequestPerformance(q.request);this._pendingCallback=J,this._pendingRequest=this.loadGeoJSON(q,(we,Ae)=>{if(delete this._pendingCallback,delete this._pendingRequest,we||!Ae)return J(we);if(typeof Ae!="object")return J(new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`));{T(Ae,!0);try{if(q.filter){const Me=a.createExpression(q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(Me.result==="error")throw new Error(Me.value.map(Je=>`${Je.key}: ${Je.message}`).join(", "));Ae={type:"FeatureCollection",features:Ae.features.filter(Je=>Me.value.evaluate({zoom:0},Je))}}this._geoJSONIndex=q.cluster?new bt(function({superclusterOptions:Me,clusterProperties:Be}){if(!Be||!Me)return Me;const Je={},et={},Ge={accumulated:null,zoom:0},Ut={properties:null},Mt=Object.keys(Be);for(const at of Mt){const[$t,Xt]=Be[at],En=a.createExpression(Xt),hn=a.createExpression(typeof $t=="string"?[$t,["accumulated"],["get",at]]:$t);Je[at]=En.value,et[at]=hn.value}return Me.map=at=>{Ut.properties=at;const $t={};for(const Xt of Mt)$t[Xt]=Je[Xt].evaluate(Ge,Ut);return $t},Me.reduce=(at,$t)=>{Ut.properties=$t;for(const Xt of Mt)Ge.accumulated=at[Xt],at[Xt]=et[Xt].evaluate(Ge,Ut)},Me}(q)).load(Ae.features):function(Me,Be){return new qt(Me,Be)}(Ae,q.geojsonVtOptions)}catch(Me){return J(Me)}this.loaded={};const Pe={};if(ce){const Me=ce.finish();Me&&(Pe.resourceTiming={},Pe.resourceTiming[q.source]=JSON.parse(JSON.stringify(Me)))}J(null,Pe)}})}reloadTile(q,J){const pe=this.loaded;return pe&&pe[q.uid]?super.reloadTile(q,J):this.loadTile(q,J)}loadGeoJSON(q,J){if(q.request)return a.getJSON(q.request,J);if(typeof q.data=="string")try{J(null,JSON.parse(q.data))}catch{J(new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`))}else J(new Error(`Input data given to '${q.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(q,J){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),J()}getClusterExpansionZoom(q,J){try{J(null,this._geoJSONIndex.getClusterExpansionZoom(q.clusterId))}catch(pe){J(pe)}}getClusterChildren(q,J){try{J(null,this._geoJSONIndex.getChildren(q.clusterId))}catch(pe){J(pe)}}getClusterLeaves(q,J){try{J(null,this._geoJSONIndex.getLeaves(q.clusterId,q.limit,q.offset))}catch(pe){J(pe)}}}class nr{constructor(q){this.self=q,this.actor=new a.Actor(q,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:P,geojson:tr},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(J,pe)=>{if(this.workerSourceTypes[J])throw new Error(`Worker source with name "${J}" already registered.`);this.workerSourceTypes[J]=pe},this.self.registerRTLTextPlugin=J=>{if(a.plugin.isParsed())throw new Error("RTL text plugin already registered.");a.plugin.applyArabicShaping=J.applyArabicShaping,a.plugin.processBidirectionalText=J.processBidirectionalText,a.plugin.processStyledBidirectionalText=J.processStyledBidirectionalText}}setReferrer(q,J){this.referrer=J}setImages(q,J,pe){this.availableImages[q]=J;for(const ce in this.workerSources[q]){const we=this.workerSources[q][ce];for(const Ae in we)we[Ae].availableImages=J}pe()}setLayers(q,J,pe){this.getLayerIndex(q).replace(J),pe()}updateLayers(q,J,pe){this.getLayerIndex(q).update(J.layers,J.removedIds),pe()}loadTile(q,J,pe){this.getWorkerSource(q,J.type,J.source).loadTile(J,pe)}loadDEMTile(q,J,pe){this.getDEMWorkerSource(q,J.source).loadTile(J,pe)}reloadTile(q,J,pe){this.getWorkerSource(q,J.type,J.source).reloadTile(J,pe)}abortTile(q,J,pe){this.getWorkerSource(q,J.type,J.source).abortTile(J,pe)}removeTile(q,J,pe){this.getWorkerSource(q,J.type,J.source).removeTile(J,pe)}removeDEMTile(q,J){this.getDEMWorkerSource(q,J.source).removeTile(J)}removeSource(q,J,pe){if(!this.workerSources[q]||!this.workerSources[q][J.type]||!this.workerSources[q][J.type][J.source])return;const ce=this.workerSources[q][J.type][J.source];delete this.workerSources[q][J.type][J.source],ce.removeSource!==void 0?ce.removeSource(J,pe):pe()}loadWorkerSource(q,J,pe){try{this.self.importScripts(J.url),pe()}catch(ce){pe(ce.toString())}}syncRTLPluginState(q,J,pe){try{a.plugin.setState(J);const ce=a.plugin.getPluginURL();if(a.plugin.isLoaded()&&!a.plugin.isParsed()&&ce!=null){this.self.importScripts(ce);const we=a.plugin.isParsed();pe(we?void 0:new Error(`RTL Text Plugin failed to import scripts from ${ce}`),we)}}catch(ce){pe(ce.toString())}}getAvailableImages(q){let J=this.availableImages[q];return J||(J=[]),J}getLayerIndex(q){let J=this.layerIndexes[q];return J||(J=this.layerIndexes[q]=new p),J}getWorkerSource(q,J,pe){if(this.workerSources[q]||(this.workerSources[q]={}),this.workerSources[q][J]||(this.workerSources[q][J]={}),!this.workerSources[q][J][pe]){const ce={send:(we,Ae,Pe)=>{this.actor.send(we,Ae,Pe,q)}};this.workerSources[q][J][pe]=new this.workerSourceTypes[J](ce,this.getLayerIndex(q),this.getAvailableImages(q))}return this.workerSources[q][J][pe]}getDEMWorkerSource(q,J){return this.demWorkerSources[q]||(this.demWorkerSources[q]={}),this.demWorkerSources[q][J]||(this.demWorkerSources[q][J]=new k),this.demWorkerSources[q][J]}enforceCacheSizeLimit(q,J){a.enforceCacheSizeLimit(J)}}return a.isWorker()&&(self.worker=new nr(self)),nr}),o(["./shared"],function(a){var u=d;function d(C){return!function(c){return typeof window>"u"||typeof document>"u"?"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 b,E,A=new Blob([""],{type:"text/javascript"}),z=URL.createObjectURL(A);try{E=new Worker(z),b=!0}catch{b=!1}return E&&E.terminate(),URL.revokeObjectURL(z),b}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var b=document.createElement("canvas");b.width=b.height=1;var E=b.getContext("2d");if(!E)return!1;var A=E.getImageData(0,0,1,1);return A&&A.width===b.width}()?(p[g=c&&c.failIfMajorPerformanceCaveat]===void 0&&(p[g]=function(b){var E,A=function(z){var j=document.createElement("canvas"),K=Object.create(d.webGLContextAttributes);return K.failIfMajorPerformanceCaveat=z,j.getContext("webgl",K)||j.getContext("experimental-webgl",K)}(b);if(!A)return!1;try{E=A.createShader(A.VERTEX_SHADER)}catch{return!1}return!(!E||A.isContextLost())&&(A.shaderSource(E,"void main() {}"),A.compileShader(E),A.getShaderParameter(E,A.COMPILE_STATUS)===!0)}(g)),p[g]?document.documentMode?"insufficient ECMAScript 6 support":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 g}(C)}var p={};function m(C,c){if(Array.isArray(C)){if(!Array.isArray(c)||C.length!==c.length)return!1;for(let g=0;g{window.removeEventListener("click",v.suppressClickInternal,!0)},0)}static mousePos(c,g){const b=c.getBoundingClientRect();return new a.pointGeometry(g.clientX-b.left-c.clientLeft,g.clientY-b.top-c.clientTop)}static touchPos(c,g){const b=c.getBoundingClientRect(),E=[];for(let A=0;A-1);K++,A[K]=j,z[K]=Y,z[K+1]=M}for(let j=0,K=0;j{let j=this.entries[E];j||(j=this.entries[E]={glyphs:{},requests:{},ranges:{}});let K=j.glyphs[A];if(K!==void 0)return void z(null,{stack:E,id:A,glyph:K});if(K=this._tinySDF(j,E,A),K)return j.glyphs[A]=K,void z(null,{stack:E,id:A,glyph:K});const Y=Math.floor(A/256);if(256*Y>65535)return void z(new Error("glyphs > 65535 not supported"));if(j.ranges[Y])return void z(null,{stack:E,id:A,glyph:K});let ie=j.requests[Y];ie||(ie=j.requests[Y]=[],L.loadGlyphRange(E,Y,this.url,this.requestManager,(ue,me)=>{if(me){for(const Re in me)this._doesCharSupportLocalGlyph(+Re)||(j.glyphs[+Re]=me[+Re]);j.ranges[Y]=!0}for(const Re of ie)Re(ue,me);delete j.requests[Y]})),ie.push((ue,me)=>{ue?z(ue):me&&z(null,{stack:E,id:A,glyph:me[A]||null})})},(E,A)=>{if(E)g(E);else if(A){const z={};for(const{stack:j,id:K,glyph:Y}of A)(z[j]||(z[j]={}))[K]=Y&&{id:Y.id,bitmap:Y.bitmap.clone(),metrics:Y.metrics};g(null,z)}})}_doesCharSupportLocalGlyph(c){return!!this.localIdeographFontFamily&&(a.unicodeBlockLookup["CJK Unified Ideographs"](c)||a.unicodeBlockLookup["Hangul Syllables"](c)||a.unicodeBlockLookup.Hiragana(c)||a.unicodeBlockLookup.Katakana(c))}_tinySDF(c,g,b){const E=this.localIdeographFontFamily;if(!E||!this._doesCharSupportLocalGlyph(b))return;let A=c.tinySDF;if(!A){let j="400";/bold/i.test(g)?j="900":/medium/i.test(g)?j="500":/light/i.test(g)&&(j="200"),A=c.tinySDF=new L.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:E,fontWeight:j})}const z=A.draw(String.fromCharCode(b));return{id:b,bitmap:new a.AlphaImage({width:z.width||30,height:z.height||30},z.data),metrics:{width:z.glyphWidth||24,height:z.glyphHeight||24,left:z.glyphLeft||0,top:z.glyphTop-27||-8,advance:z.glyphAdvance||24}}}}L.loadGlyphRange=function(C,c,g,b,E){const A=256*c,z=A+255,j=b.transformRequest(g.replace("{fontstack}",C).replace("{range}",`${A}-${z}`),a.ResourceType.Glyphs);a.getArrayBuffer(j,(K,Y)=>{if(K)E(K);else if(Y){const ie={};for(const ue of a.parseGlyphPbf(Y))ie[ue.id]=ue;E(null,ie)}})},L.TinySDF=class{constructor({fontSize:C=24,buffer:c=3,radius:g=8,cutoff:b=.25,fontFamily:E="sans-serif",fontWeight:A="normal",fontStyle:z="normal"}={}){this.buffer=c,this.cutoff=b,this.radius=g;const j=this.size=C+4*c,K=this._createCanvas(j),Y=this.ctx=K.getContext("2d",{willReadFrequently:!0});Y.font=`${z} ${A} ${C}px ${E}`,Y.textBaseline="alphabetic",Y.textAlign="left",Y.fillStyle="black",this.gridOuter=new Float64Array(j*j),this.gridInner=new Float64Array(j*j),this.f=new Float64Array(j),this.z=new Float64Array(j+1),this.v=new Uint16Array(j)}_createCanvas(C){const c=document.createElement("canvas");return c.width=c.height=C,c}draw(C){const{width:c,actualBoundingBoxAscent:g,actualBoundingBoxDescent:b,actualBoundingBoxLeft:E,actualBoundingBoxRight:A}=this.ctx.measureText(C),z=Math.ceil(g),j=Math.min(this.size-this.buffer,Math.ceil(A-E)),K=Math.min(this.size-this.buffer,z+Math.ceil(b)),Y=j+2*this.buffer,ie=K+2*this.buffer,ue=Math.max(Y*ie,0),me=new Uint8ClampedArray(ue),Re={data:me,width:Y,height:ie,glyphWidth:j,glyphHeight:K,glyphTop:z,glyphLeft:0,glyphAdvance:c};if(j===0||K===0)return Re;const{ctx:Se,buffer:Ie,gridInner:je,gridOuter:Xe}=this;Se.clearRect(Ie,Ie,j,K),Se.fillText(C,Ie,Ie+z);const st=Se.getImageData(Ie,Ie,j,K);Xe.fill(M,0,ue),je.fill(0,0,ue);for(let Oe=0;Oe0?It*It:0,je[Et]=It<0?It*It:0}}O(Xe,0,0,Y,ie,Y,this.f,this.v,this.z),O(je,Ie,Ie,j,K,Y,this.f,this.v,this.z);for(let Oe=0;Oe1&&(K=c[++j]);const ie=Math.abs(Y-K.left),ue=Math.abs(Y-K.right),me=Math.min(ie,ue);let Re;const Se=A/b*(E+1);if(K.isDash){const Ie=E-Math.abs(Se);Re=Math.sqrt(me*me+Ie*Ie)}else Re=E-Math.sqrt(me*me+Se*Se);this.data[z+Y]=Math.max(0,Math.min(255,Re+128))}}}addRegularDash(c){for(let j=c.length-1;j>=0;--j){const K=c[j],Y=c[j+1];K.zeroLength?c.splice(j,1):Y&&Y.isDash===K.isDash&&(Y.left=K.left,c.splice(j,1))}const g=c[0],b=c[c.length-1];g.isDash===b.isDash&&(g.left=b.left-this.width,b.right=g.right+this.width);const E=this.width*this.nextRow;let A=0,z=c[A];for(let j=0;j1&&(z=c[++A]);const K=Math.abs(j-z.left),Y=Math.abs(j-z.right),ie=Math.min(K,Y);this.data[E+j]=Math.max(0,Math.min(255,(z.isDash?ie:-ie)+128))}}addDash(c,g){const b=g?7:0,E=2*b+1;if(this.nextRow+E>this.height)return a.warnOnce("LineAtlas out of space"),null;let A=0;for(let j=0;j{E.send(c,g,A)},b=b||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach(c=>{c.remove()}),this.actors=[],this.workerPool.release(this.id)}}function ee(C,c,g){const b=function(E,A){if(E)return g(E);if(A){const z=a.pick(a.extend(A,C),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);A.vector_layers&&(z.vectorLayers=A.vector_layers,z.vectorLayerIds=z.vectorLayers.map(j=>j.id)),g(null,z)}};return C.url?a.getJSON(c.transformRequest(C.url,a.ResourceType.Source),b):a.exported.frame(()=>b(null,C))}G.Actor=a.Actor;class X{constructor(c,g,b){this.bounds=a.LngLatBounds.convert(this.validateBounds(c)),this.minzoom=g||0,this.maxzoom=b||24}validateBounds(c){return Array.isArray(c)&&c.length===4?[Math.max(-180,c[0]),Math.max(-90,c[1]),Math.min(180,c[2]),Math.min(90,c[3])]:[-180,-90,180,90]}contains(c){const g=Math.pow(2,c.z),b=Math.floor(a.mercatorXfromLng(this.bounds.getWest())*g),E=Math.floor(a.mercatorYfromLat(this.bounds.getNorth())*g),A=Math.ceil(a.mercatorXfromLng(this.bounds.getEast())*g),z=Math.ceil(a.mercatorYfromLat(this.bounds.getSouth())*g);return c.x>=b&&c.x=E&&c.y{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),c?this.fire(new a.ErrorEvent(c)):g&&(a.extend(this,g),g.bounds&&(this.tileBounds=new X(g.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}onAdd(c){this.map=c,this.load()}setSourceProperty(c){this._tileJSONRequest&&this._tileJSONRequest.cancel(),c(),this.load()}setTiles(c){return this.setSourceProperty(()=>{this._options.tiles=c}),this}setUrl(c){return this.setSourceProperty(()=>{this.url=c,this._options.url=c}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}loadTile(c,g){const b=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),E={request:this.map._requestManager.transformRequest(b,a.ResourceType.Tile),uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,tileSize:this.tileSize*c.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function A(z,j){return delete c.request,c.aborted?g(null):z&&z.status!==404?g(z):(j&&j.resourceTiming&&(c.resourceTiming=j.resourceTiming),this.map._refreshExpiredTiles&&j&&c.setExpiryData(j),c.loadVectorData(j,this.map.painter),a.cacheEntryPossiblyAdded(this.dispatcher),g(null),void(c.reloadCallback&&(this.loadTile(c,c.reloadCallback),c.reloadCallback=null)))}E.request.collectResourceTiming=this._collectResourceTiming,c.actor&&c.state!=="expired"?c.state==="loading"?c.reloadCallback=g:c.request=c.actor.send("reloadTile",E,A.bind(this)):(c.actor=this.dispatcher.getActor(),c.request=c.actor.send("loadTile",E,A.bind(this)))}abortTile(c){c.request&&(c.request.cancel(),delete c.request),c.actor&&c.actor.send("abortTile",{uid:c.uid,type:this.type,source:this.id},void 0)}unloadTile(c){c.unloadVectorData(),c.actor&&c.actor.send("removeTile",{uid:c.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class Q extends a.Evented{constructor(c,g,b,E){super(),this.id=c,this.dispatcher=b,this.setEventedParent(E),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=a.extend({type:"raster"},g),a.extend(this,a.pick(g,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=ee(this._options,this.map._requestManager,(c,g)=>{this._tileJSONRequest=null,this._loaded=!0,c?this.fire(new a.ErrorEvent(c)):g&&(a.extend(this,g),g.bounds&&(this.tileBounds=new X(g.bounds,this.minzoom,this.maxzoom)),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})))})}loaded(){return this._loaded}onAdd(c){this.map=c,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return a.extend({},this._options)}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}loadTile(c,g){const b=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);c.request=a.getImage(this.map._requestManager.transformRequest(b,a.ResourceType.Tile),(E,A,z)=>{if(delete c.request,c.aborted)c.state="unloaded",g(null);else if(E)c.state="errored",g(E);else if(A){this.map._refreshExpiredTiles&&c.setExpiryData(z);const j=this.map.painter.context,K=j.gl;c.texture=this.map.painter.getTileTexture(A.width),c.texture?c.texture.update(A,{useMipmap:!0}):(c.texture=new P(j,A,K.RGBA,{useMipmap:!0}),c.texture.bind(K.LINEAR,K.CLAMP_TO_EDGE,K.LINEAR_MIPMAP_NEAREST),j.extTextureFilterAnisotropic&&K.texParameterf(K.TEXTURE_2D,j.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,j.extTextureFilterAnisotropicMax)),c.state="loaded",a.cacheEntryPossiblyAdded(this.dispatcher),g(null)}})}abortTile(c,g){c.request&&(c.request.cancel(),delete c.request),g()}unloadTile(c,g){c.texture&&this.map.painter.saveTileTexture(c.texture),g()}hasTransition(){return!1}}let le;class ne extends Q{constructor(c,g,b,E){super(c,g,b,E),this.type="raster-dem",this.maxzoom=22,this._options=a.extend({type:"raster-dem"},g),this.encoding=g.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(c,g){const b=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function E(A,z){A&&(c.state="errored",g(A)),z&&(c.dem=z,c.needsHillshadePrepare=!0,c.needsTerrainPrepare=!0,c.state="loaded",g(null))}c.request=a.getImage(this.map._requestManager.transformRequest(b,a.ResourceType.Tile),function(A,z){if(delete c.request,c.aborted)c.state="unloaded",g(null);else if(A)c.state="errored",g(A);else if(z){this.map._refreshExpiredTiles&&c.setExpiryData(z),delete z.cacheControl,delete z.expires;const j=a.isImageBitmap(z)&&(le==null&&(le=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),le)?z:a.exported.getImageData(z,1),K={uid:c.uid,coord:c.tileID,source:this.id,rawImageData:j,encoding:this.encoding};c.actor&&c.state!=="expired"||(c.actor=this.dispatcher.getActor(),c.actor.send("loadDEMTile",K,E.bind(this)))}}.bind(this)),c.neighboringTiles=this._getNeighboringTiles(c.tileID)}_getNeighboringTiles(c){const g=c.canonical,b=Math.pow(2,g.z),E=(g.x-1+b)%b,A=g.x===0?c.wrap-1:c.wrap,z=(g.x+1+b)%b,j=g.x+1===b?c.wrap+1:c.wrap,K={};return K[new a.OverscaledTileID(c.overscaledZ,A,g.z,E,g.y).key]={backfilled:!1},K[new a.OverscaledTileID(c.overscaledZ,j,g.z,z,g.y).key]={backfilled:!1},g.y>0&&(K[new a.OverscaledTileID(c.overscaledZ,A,g.z,E,g.y-1).key]={backfilled:!1},K[new a.OverscaledTileID(c.overscaledZ,c.wrap,g.z,g.x,g.y-1).key]={backfilled:!1},K[new a.OverscaledTileID(c.overscaledZ,j,g.z,z,g.y-1).key]={backfilled:!1}),g.y+1{if(this._pendingLoads--,this._removed||A&&A.abandoned)return void this.fire(new a.Event("dataabort",{dataType:"source",sourceDataType:c}));let z=null;if(A&&A.resourceTiming&&A.resourceTiming[this.id]&&(z=A.resourceTiming[this.id].slice(0)),E)return void this.fire(new a.ErrorEvent(E));const j={dataType:"source",sourceDataType:c};this._collectResourceTiming&&z&&z.length>0&&a.extend(j,{resourceTiming:z}),this.fire(new a.Event("data",j))})}loaded(){return this._pendingLoads===0}loadTile(c,g){const b=c.actor?"reloadTile":"loadTile";c.actor=this.actor;const E={type:this.type,uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};c.request=this.actor.send(b,E,(A,z)=>(delete c.request,c.unloadVectorData(),c.aborted?g(null):A?g(A):(c.loadVectorData(z,this.map.painter,b==="reloadTile"),g(null))))}abortTile(c){c.request&&(c.request.cancel(),delete c.request),c.aborted=!0}unloadTile(c){c.unloadVectorData(),this.actor.send("removeTile",{uid:c.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return a.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var oe=a.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class he extends a.Evented{constructor(c,g,b,E){super(),this.id=c,this.dispatcher=b,this.coordinates=g.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(E),this.options=g}load(c,g){this._loaded=!1,this.fire(new a.Event("dataloading",{dataType:"source"})),this.url=this.options.url,a.getImage(this.map._requestManager.transformRequest(this.url,a.ResourceType.Image),(b,E)=>{this._loaded=!0,b?this.fire(new a.ErrorEvent(b)):E&&(this.image=E,c&&(this.coordinates=c),g&&g(),this._finishLoading())})}loaded(){return this._loaded}updateImage(c){return this.image&&c.url?(this.options.url=c.url,this.load(c.coordinates,()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(c){this.map=c,this.load()}setCoordinates(c){this.coordinates=c;const g=c.map(a.MercatorCoordinate.fromLngLat);this.tileID=function(E){let A=1/0,z=1/0,j=-1/0,K=-1/0;for(const me of E)A=Math.min(A,me.x),z=Math.min(z,me.y),j=Math.max(j,me.x),K=Math.max(K,me.y);const Y=Math.max(j-A,K-z),ie=Math.max(0,Math.floor(-Math.log(Y)/Math.LN2)),ue=Math.pow(2,ie);return new a.CanonicalTileID(ie,Math.floor((A+j)/2*ue),Math.floor((z+K)/2*ue))}(g),this.minzoom=this.maxzoom=this.tileID.z;const b=g.map(E=>this.tileID.getTilePoint(E)._round());return this._boundsArray=new a.RasterBoundsArray,this._boundsArray.emplaceBack(b[0].x,b[0].y,0,0),this._boundsArray.emplaceBack(b[1].x,b[1].y,a.EXTENT,0),this._boundsArray.emplaceBack(b[3].x,b[3].y,0,a.EXTENT),this._boundsArray.emplaceBack(b[2].x,b[2].y,a.EXTENT,a.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new a.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const c=this.map.painter.context,g=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new P(c,this.image,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));for(const b in this.tiles){const E=this.tiles[b];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}}loadTile(c,g){this.tileID&&this.tileID.equals(c.tileID.canonical)?(this.tiles[String(c.tileID.wrap)]=c,c.buckets={},g(null)):(c.state="errored",g(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class _e extends he{constructor(c,g,b,E){super(c,g,b,E),this.roundZoom=!0,this.type="video",this.options=g}load(){this._loaded=!1;const c=this.options;this.urls=[];for(const g of c.urls)this.urls.push(this.map._requestManager.transformRequest(g,a.ResourceType.Source).url);a.getVideo(this.urls,(g,b)=>{this._loaded=!0,g?this.fire(new a.ErrorEvent(g)):b&&(this.video=b,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading())})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(c){if(this.video){const g=this.video.seekable;cg.end(0)?this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${this.id}`,null,`Playback for this video can be set only between the ${g.start(0)} and ${g.end(0)}-second mark.`))):this.video.currentTime=c}}getVideo(){return this.video}onAdd(c){this.map||(this.map=c,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const c=this.map.painter.context,g=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE),g.texSubImage2D(g.TEXTURE_2D,0,0,0,g.RGBA,g.UNSIGNED_BYTE,this.video)):(this.texture=new P(c,this.video,g.RGBA),this.texture.bind(g.LINEAR,g.CLAMP_TO_EDGE));for(const b in this.tiles){const E=this.tiles[b];E.state!=="loaded"&&(E.state="loaded",E.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class be extends he{constructor(c,g,b,E){super(c,g,b,E),g.coordinates?Array.isArray(g.coordinates)&&g.coordinates.length===4&&!g.coordinates.some(A=>!Array.isArray(A)||A.length!==2||A.some(z=>typeof z!="number"))||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${c}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${c}`,null,'missing required property "coordinates"'))),g.animate&&typeof g.animate!="boolean"&&this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${c}`,null,'optional "animate" property must be a boolean value'))),g.canvas?typeof g.canvas=="string"||g.canvas instanceof HTMLCanvasElement||this.fire(new a.ErrorEvent(new a.ValidationError(`sources.${c}`,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 a.ErrorEvent(new a.ValidationError(`sources.${c}`,null,'missing required property "canvas"'))),this.options=g,this.animate=g.animate===void 0||g.animate}load(){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 a.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())}getCanvas(){return this.canvas}onAdd(c){this.map=c,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let c=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,c=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,c=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const g=this.map.painter.context,b=g.gl;this.boundsBuffer||(this.boundsBuffer=g.createVertexBuffer(this._boundsArray,oe.members)),this.boundsSegments||(this.boundsSegments=a.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(c||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new P(g,this.canvas,b.RGBA,{premultiply:!0});for(const E in this.tiles){const A=this.tiles[E];A.state!=="loaded"&&(A.state="loaded",A.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const c of[this.canvas.width,this.canvas.height])if(isNaN(c)||c<=0)return!0;return!1}}const xe={vector:Z,raster:Q,"raster-dem":ne,geojson:se,video:_e,image:he,canvas:be};function Te(C,c){const g=a.create();return a.translate(g,g,[1,1,0]),a.scale(g,g,[.5*C.width,.5*C.height,1]),a.multiply(g,g,C.calculatePosMatrix(c.toUnwrapped()))}function Ee(C,c,g,b,E,A){const z=function(ue,me,Re){if(ue)for(const Se of ue){const Ie=me[Se];if(Ie&&Ie.source===Re&&Ie.type==="fill-extrusion")return!0}else for(const Se in me){const Ie=me[Se];if(Ie.source===Re&&Ie.type==="fill-extrusion")return!0}return!1}(E&&E.layers,c,C.id),j=A.maxPitchScaleFactor(),K=C.tilesIn(b,j,z);K.sort(Ce);const Y=[];for(const ue of K)Y.push({wrappedTileID:ue.tileID.wrapped().key,queryResults:ue.tile.queryRenderedFeatures(c,g,C._state,ue.queryGeometry,ue.cameraQueryGeometry,ue.scale,E,A,j,Te(C.transform,ue.tileID))});const ie=function(ue){const me={},Re={};for(const Se of ue){const Ie=Se.queryResults,je=Se.wrappedTileID,Xe=Re[je]=Re[je]||{};for(const st in Ie){const Oe=Ie[st],vt=Xe[st]=Xe[st]||{},ft=me[st]=me[st]||[];for(const Et of Oe)vt[Et.featureIndex]||(vt[Et.featureIndex]=!0,ft.push(Et))}}return me}(Y);for(const ue in ie)ie[ue].forEach(me=>{const Re=me.feature,Se=C.getFeatureState(Re.layer["source-layer"],Re.id);Re.source=Re.layer.source,Re.layer["source-layer"]&&(Re.sourceLayer=Re.layer["source-layer"]),Re.state=Se});return ie}function Ce(C,c){const g=C.tileID,b=c.tileID;return g.overscaledZ-b.overscaledZ||g.canonical.y-b.canonical.y||g.wrap-b.wrap||g.canonical.x-b.canonical.x}class ke{constructor(c,g){this.tileID=c,this.uid=a.uniqueId(),this.uses=0,this.tileSize=g,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(c){const g=c+this.timeAdded;gc.saveTileTexture(g)),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(c,g,b){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",c){c.featureIndex&&(this.latestFeatureIndex=c.featureIndex,c.rawTileData?(this.latestRawTileData=c.rawTileData,this.latestFeatureIndex.rawTileData=c.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=c.collisionBoxArray,this.buckets=function(E,A){const z={};if(!A)return z;for(const j of E){const K=j.layerIds.map(Y=>A.getLayer(Y)).filter(Boolean);if(K.length!==0){j.layers=K,j.stateDependentLayerIds&&(j.stateDependentLayers=j.stateDependentLayerIds.map(Y=>K.filter(ie=>ie.id===Y)[0]));for(const Y of K)z[Y.id]=j}}return z}(c.buckets,g.style),this.hasSymbolBuckets=!1;for(const E in this.buckets){const A=this.buckets[E];if(A instanceof a.SymbolBucket){if(this.hasSymbolBuckets=!0,!b)break;A.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const E in this.buckets){const A=this.buckets[E];if(A instanceof a.SymbolBucket&&A.hasRTLText){this.hasRTLText=!0,a.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const E in this.buckets){const A=this.buckets[E];this.queryPadding=Math.max(this.queryPadding,g.style.getLayer(E).queryRadius(A))}c.imageAtlas&&(this.imageAtlas=c.imageAtlas),c.glyphAtlasImage&&(this.glyphAtlasImage=c.glyphAtlasImage)}else this.collisionBoxArray=new a.CollisionBoxArray}unloadVectorData(){for(const c in this.buckets)this.buckets[c].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(c){return this.buckets[c.id]}upload(c){for(const b in this.buckets){const E=this.buckets[b];E.uploadPending()&&E.upload(c)}const g=c.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new P(c,this.imageAtlas.image,g.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new P(c,this.glyphAtlasImage,g.ALPHA),this.glyphAtlasImage=null)}prepare(c){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(c,this.imageAtlasTexture)}queryRenderedFeatures(c,g,b,E,A,z,j,K,Y,ie){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:E,cameraQueryGeometry:A,scale:z,tileSize:this.tileSize,pixelPosMatrix:ie,transform:K,params:j,queryPadding:this.queryPadding*Y},c,g,b):{}}querySourceFeatures(c,g){const b=this.latestFeatureIndex;if(!b||!b.rawTileData)return;const E=b.loadVTLayers(),A=g?g.sourceLayer:"",z=E._geojsonTileLayer||E[A];if(!z)return;const j=a.createFilter(g&&g.filter),{z:K,x:Y,y:ie}=this.tileID.canonical,ue={z:K,x:Y,y:ie};for(let me=0;meb)E=!1;else if(g)if(this.expirationTime{this.remove(c,A)},b)),this.data[E].push(A),this.order.push(E),this.order.length>this.max){const z=this._getAndRemoveByKey(this.order[0]);z&&this.onRemove(z)}return this}has(c){return c.wrapped().key in this.data}getAndRemove(c){return this.has(c)?this._getAndRemoveByKey(c.wrapped().key):null}_getAndRemoveByKey(c){const g=this.data[c].shift();return g.timeout&&clearTimeout(g.timeout),this.data[c].length===0&&delete this.data[c],this.order.splice(this.order.indexOf(c),1),g.value}getByKey(c){const g=this.data[c];return g?g[0].value:null}get(c){return this.has(c)?this.data[c.wrapped().key][0].value:null}remove(c,g){if(!this.has(c))return this;const b=c.wrapped().key,E=g===void 0?0:this.data[b].indexOf(g),A=this.data[b][E];return this.data[b].splice(E,1),A.timeout&&clearTimeout(A.timeout),this.data[b].length===0&&delete this.data[b],this.onRemove(A.value),this.order.splice(this.order.indexOf(b),1),this}setMaxSize(c){for(this.max=c;this.order.length>this.max;){const g=this._getAndRemoveByKey(this.order[0]);g&&this.onRemove(g)}return this}filter(c){const g=[];for(const b in this.data)for(const E of this.data[b])c(E.value)||g.push(E);for(const b of g)this.remove(b.value.tileID,b)}}class Ke{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(c,g,b){const E=String(g);if(this.stateChanges[c]=this.stateChanges[c]||{},this.stateChanges[c][E]=this.stateChanges[c][E]||{},a.extend(this.stateChanges[c][E],b),this.deletedStates[c]===null){this.deletedStates[c]={};for(const A in this.state[c])A!==E&&(this.deletedStates[c][A]=null)}else if(this.deletedStates[c]&&this.deletedStates[c][E]===null){this.deletedStates[c][E]={};for(const A in this.state[c][E])b[A]||(this.deletedStates[c][E][A]=null)}else for(const A in b)this.deletedStates[c]&&this.deletedStates[c][E]&&this.deletedStates[c][E][A]===null&&delete this.deletedStates[c][E][A]}removeFeatureState(c,g,b){if(this.deletedStates[c]===null)return;const E=String(g);if(this.deletedStates[c]=this.deletedStates[c]||{},b&&g!==void 0)this.deletedStates[c][E]!==null&&(this.deletedStates[c][E]=this.deletedStates[c][E]||{},this.deletedStates[c][E][b]=null);else if(g!==void 0)if(this.stateChanges[c]&&this.stateChanges[c][E])for(b in this.deletedStates[c][E]={},this.stateChanges[c][E])this.deletedStates[c][E][b]=null;else this.deletedStates[c][E]=null;else this.deletedStates[c]=null}getState(c,g){const b=String(g),E=a.extend({},(this.state[c]||{})[b],(this.stateChanges[c]||{})[b]);if(this.deletedStates[c]===null)return{};if(this.deletedStates[c]){const A=this.deletedStates[c][g];if(A===null)return{};for(const z in A)delete E[z]}return E}initializeTileState(c,g){c.setFeatureState(this.state,g)}coalesceChanges(c,g){const b={};for(const E in this.stateChanges){this.state[E]=this.state[E]||{};const A={};for(const z in this.stateChanges[E])this.state[E][z]||(this.state[E][z]={}),a.extend(this.state[E][z],this.stateChanges[E][z]),A[z]=this.state[E][z];b[E]=A}for(const E in this.deletedStates){this.state[E]=this.state[E]||{};const A={};if(this.deletedStates[E]===null)for(const z in this.state[E])A[z]={},this.state[E][z]={};else for(const z in this.deletedStates[E]){if(this.deletedStates[E][z]===null)this.state[E][z]={};else for(const j of Object.keys(this.deletedStates[E][z]))delete this.state[E][z][j];A[z]=this.state[E][z]}b[E]=b[E]||{},a.extend(b[E],A)}if(this.stateChanges={},this.deletedStates={},Object.keys(b).length!==0)for(const E in c)c[E].setFeatureState(b,g)}}class Ue extends a.Evented{constructor(c,g,b){super(),this.id=c,this.dispatcher=b,this.on("data",E=>{E.dataType==="source"&&E.sourceDataType==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&E.dataType==="source"&&E.sourceDataType==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))}),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=function(E,A,z,j){const K=new xe[A.type](E,A,z,j);if(K.id!==E)throw new Error(`Expected Source id to be ${E} instead of ${K.id}`);return a.bindAll(["load","abort","unload","serialize","prepare"],K),K}(c,g,b,this),this._tiles={},this._cache=new De(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Ke}onAdd(c){this.map=c,this._maxTileCacheSize=c?c._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(c)}onRemove(c){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(c)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(const c in this._tiles){const g=this._tiles[c];if(g.state!=="loaded"&&g.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const c=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,c&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(c,g){return this._source.loadTile(c,g)}_unloadTile(c){if(this._source.unloadTile)return this._source.unloadTile(c,()=>{})}_abortTile(c){this._source.abortTile&&this._source.abortTile(c,()=>{}),this._source.fire(new a.Event("dataabort",{tile:c,coord:c.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(c){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const g in this._tiles){const b=this._tiles[g];b.upload(c),b.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(c=>c.tileID).sort(tt).map(c=>c.key)}getRenderableIds(c){const g=[];for(const b in this._tiles)this._isIdRenderable(b,c)&&g.push(this._tiles[b]);return c?g.sort((b,E)=>{const A=b.tileID,z=E.tileID,j=new a.pointGeometry(A.canonical.x,A.canonical.y)._rotate(this.transform.angle),K=new a.pointGeometry(z.canonical.x,z.canonical.y)._rotate(this.transform.angle);return A.overscaledZ-z.overscaledZ||K.y-j.y||K.x-j.x}).map(b=>b.tileID.key):g.map(b=>b.tileID).sort(tt).map(b=>b.key)}hasRenderableParent(c){const g=this.findLoadedParent(c,0);return!!g&&this._isIdRenderable(g.tileID.key)}_isIdRenderable(c,g){return this._tiles[c]&&this._tiles[c].hasData()&&!this._coveredTiles[c]&&(g||!this._tiles[c].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const c in this._tiles)this._tiles[c].state!=="errored"&&this._reloadTile(c,"reloading")}}_reloadTile(c,g){const b=this._tiles[c];b&&(b.state!=="loading"&&(b.state=g),this._loadTile(b,this._tileLoaded.bind(this,b,c,g)))}_tileLoaded(c,g,b,E){if(E)return c.state="errored",void(E.status!==404?this._source.fire(new a.ErrorEvent(E,{tile:c})):this.update(this.transform,this.terrain));c.timeAdded=a.exported.now(),b==="expired"&&(c.refreshedUponExpiration=!0),this._setTileReloadTimer(g,c),this.getSource().type==="raster-dem"&&c.dem&&this._backfillDEM(c),this._state.initializeTileState(c,this.map?this.map.painter:null),c.aborted||this._source.fire(new a.Event("data",{dataType:"source",tile:c,coord:c.tileID}))}_backfillDEM(c){const g=this.getRenderableIds();for(let E=0;E1||(Math.abs(z)>1&&(Math.abs(z+K)===1?z+=K:Math.abs(z-K)===1&&(z-=K)),A.dem&&E.dem&&(E.dem.backfillBorder(A.dem,z,j),E.neighboringTiles&&E.neighboringTiles[Y]&&(E.neighboringTiles[Y].backfilled=!0)))}}getTile(c){return this.getTileByID(c.key)}getTileByID(c){return this._tiles[c]}_retainLoadedChildren(c,g,b,E){for(const A in this._tiles){let z=this._tiles[A];if(E[A]||!z.hasData()||z.tileID.overscaledZ<=g||z.tileID.overscaledZ>b)continue;let j=z.tileID;for(;z&&z.tileID.overscaledZ>g+1;){const Y=z.tileID.scaledTo(z.tileID.overscaledZ-1);z=this._tiles[Y.key],z&&z.hasData()&&(j=Y)}let K=j;for(;K.overscaledZ>g;)if(K=K.scaledTo(K.overscaledZ-1),c[K.key]){E[j.key]=j;break}}}findLoadedParent(c,g){if(c.key in this._loadedParentTiles){const b=this._loadedParentTiles[c.key];return b&&b.tileID.overscaledZ>=g?b:null}for(let b=c.overscaledZ-1;b>=g;b--){const E=c.scaledTo(b),A=this._getLoadedTile(E);if(A)return A}}_getLoadedTile(c){const g=this._tiles[c.key];return g&&g.hasData()?g:this._cache.getByKey(c.wrapped().key)}updateCacheSize(c){const g=Math.ceil(c.width/this._source.tileSize)+1,b=Math.ceil(c.height/this._source.tileSize)+1,E=Math.floor(g*b*5),A=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,E):E;this._cache.setMaxSize(A)}handleWrapJump(c){const g=Math.round((c-(this._prevLng===void 0?c:this._prevLng))/360);if(this._prevLng=c,g){const b={};for(const E in this._tiles){const A=this._tiles[E];A.tileID=A.tileID.unwrapTo(A.tileID.wrap+g),b[A.tileID.key]=A}this._tiles=b;for(const E in this._timers)clearTimeout(this._timers[E]),delete this._timers[E];for(const E in this._tiles)this._setTileReloadTimer(E,this._tiles[E])}}update(c,g){if(this.transform=c,this.terrain=g,!this._sourceLoaded||this._paused)return;let b;this.updateCacheSize(c),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?b=c.getVisibleUnwrappedCoordinates(this._source.tileID).map(Y=>new a.OverscaledTileID(Y.canonical.z,Y.wrap,Y.canonical.z,Y.canonical.x,Y.canonical.y)):(b=c.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:g}),this._source.hasTile&&(b=b.filter(Y=>this._source.hasTile(Y)))):b=[];const E=c.coveringZoomLevel(this._source),A=Math.max(E-Ue.maxOverzooming,this._source.minzoom),z=Math.max(E+Ue.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const Y={};for(const ie of b)if(ie.canonical.z>this._source.minzoom){const ue=ie.scaledTo(ie.canonical.z-1);Y[ue.key]=ue;const me=ie.scaledTo(Math.max(this._source.minzoom,Math.min(ie.canonical.z,5)));Y[me.key]=me}b=b.concat(Object.values(Y))}const j=this._updateRetainedTiles(b,E);if(lt(this._source.type)){const Y={},ie={},ue=Object.keys(j);for(const me of ue){const Re=j[me],Se=this._tiles[me];if(!Se||Se.fadeEndTime&&Se.fadeEndTime<=a.exported.now())continue;const Ie=this.findLoadedParent(Re,A);Ie&&(this._addTile(Ie.tileID),Y[Ie.tileID.key]=Ie.tileID),ie[me]=Re}this._retainLoadedChildren(ie,E,z,j);for(const me in Y)j[me]||(this._coveredTiles[me]=!0,j[me]=Y[me]);if(g){const me={},Re={};for(const Se of b)this._tiles[Se.key].hasData()?me[Se.key]=Se:Re[Se.key]=Se;for(const Se in Re){const Ie=Re[Se].children(this._source.maxzoom);this._tiles[Ie[0].key]&&this._tiles[Ie[1].key]&&this._tiles[Ie[2].key]&&this._tiles[Ie[3].key]&&(me[Ie[0].key]=j[Ie[0].key]=Ie[0],me[Ie[1].key]=j[Ie[1].key]=Ie[1],me[Ie[2].key]=j[Ie[2].key]=Ie[2],me[Ie[3].key]=j[Ie[3].key]=Ie[3],delete Re[Se])}for(const Se in Re){const Ie=this.findLoadedParent(Re[Se],this._source.minzoom);if(Ie){me[Ie.tileID.key]=j[Ie.tileID.key]=Ie.tileID;for(const je in me)me[je].isChildOf(Ie.tileID)&&delete me[je]}}for(const Se in this._tiles)me[Se]||(this._coveredTiles[Se]=!0)}}for(const Y in j)this._tiles[Y].clearFadeHold();const K=a.keysDifference(this._tiles,j);for(const Y of K){const ie=this._tiles[Y];ie.hasSymbolBuckets&&!ie.holdingForFade()?ie.setHoldDuration(this.map._fadeDuration):ie.hasSymbolBuckets&&!ie.symbolFadeFinished()||this._removeTile(Y)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const c in this._tiles)this._tiles[c].holdingForFade()&&this._removeTile(c)}_updateRetainedTiles(c,g){const b={},E={},A=Math.max(g-Ue.maxOverzooming,this._source.minzoom),z=Math.max(g+Ue.maxUnderzooming,this._source.minzoom),j={};for(const K of c){const Y=this._addTile(K);b[K.key]=K,Y.hasData()||gthis._source.maxzoom){const ue=K.children(this._source.maxzoom)[0],me=this.getTile(ue);if(me&&me.hasData()){b[ue.key]=ue;continue}}else{const ue=K.children(this._source.maxzoom);if(b[ue[0].key]&&b[ue[1].key]&&b[ue[2].key]&&b[ue[3].key])continue}let ie=Y.wasRequested();for(let ue=K.overscaledZ-1;ue>=A;--ue){const me=K.scaledTo(ue);if(E[me.key]||(E[me.key]=!0,Y=this.getTile(me),!Y&&ie&&(Y=this._addTile(me)),Y&&(b[me.key]=me,ie=Y.wasRequested(),Y.hasData())))break}}return b}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const c in this._tiles){const g=[];let b,E=this._tiles[c].tileID;for(;E.overscaledZ>0;){if(E.key in this._loadedParentTiles){b=this._loadedParentTiles[E.key];break}g.push(E.key);const A=E.scaledTo(E.overscaledZ-1);if(b=this._getLoadedTile(A),b)break;E=A}for(const A of g)this._loadedParentTiles[A]=b}}_addTile(c){let g=this._tiles[c.key];if(g)return g;g=this._cache.getAndRemove(c),g&&(this._setTileReloadTimer(c.key,g),g.tileID=c,this._state.initializeTileState(g,this.map?this.map.painter:null),this._cacheTimers[c.key]&&(clearTimeout(this._cacheTimers[c.key]),delete this._cacheTimers[c.key],this._setTileReloadTimer(c.key,g)));const b=g;return g||(g=new ke(c,this._source.tileSize*c.overscaleFactor()),this._loadTile(g,this._tileLoaded.bind(this,g,c.key,g.state))),g.uses++,this._tiles[c.key]=g,b||this._source.fire(new a.Event("dataloading",{tile:g,coord:g.tileID,dataType:"source"})),g}_setTileReloadTimer(c,g){c in this._timers&&(clearTimeout(this._timers[c]),delete this._timers[c]);const b=g.getExpiryTimeout();b&&(this._timers[c]=setTimeout(()=>{this._reloadTile(c,"expired"),delete this._timers[c]},b))}_removeTile(c){const g=this._tiles[c];g&&(g.uses--,delete this._tiles[c],this._timers[c]&&(clearTimeout(this._timers[c]),delete this._timers[c]),g.uses>0||(g.hasData()&&g.state!=="reloading"?this._cache.add(g.tileID,g,g.getExpiryTimeout()):(g.aborted=!0,this._abortTile(g),this._unloadTile(g))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const c in this._tiles)this._removeTile(c);this._cache.reset()}tilesIn(c,g,b){const E=[],A=this.transform;if(!A)return E;const z=b?A.getCameraQueryGeometry(c):c,j=c.map(Se=>A.pointCoordinate(Se,this.terrain)),K=z.map(Se=>A.pointCoordinate(Se,this.terrain)),Y=this.getIds();let ie=1/0,ue=1/0,me=-1/0,Re=-1/0;for(const Se of K)ie=Math.min(ie,Se.x),ue=Math.min(ue,Se.y),me=Math.max(me,Se.x),Re=Math.max(Re,Se.y);for(let Se=0;Se=0&&Oe[1].y+st>=0){const vt=j.map(Et=>je.getTilePoint(Et)),ft=K.map(Et=>je.getTilePoint(Et));E.push({tile:Ie,tileID:je,queryGeometry:vt,cameraQueryGeometry:ft,scale:Xe})}}return E}getVisibleCoordinates(c){const g=this.getRenderableIds(c).map(b=>this._tiles[b].tileID);for(const b of g)b.posMatrix=this.transform.calculatePosMatrix(b.toUnwrapped());return g}hasTransition(){if(this._source.hasTransition())return!0;if(lt(this._source.type))for(const c in this._tiles){const g=this._tiles[c];if(g.fadeEndTime!==void 0&&g.fadeEndTime>=a.exported.now())return!0}return!1}setFeatureState(c,g,b){this._state.updateState(c=c||"_geojsonTileLayer",g,b)}removeFeatureState(c,g,b){this._state.removeFeatureState(c=c||"_geojsonTileLayer",g,b)}getFeatureState(c,g){return this._state.getState(c=c||"_geojsonTileLayer",g)}setDependencies(c,g,b){const E=this._tiles[c];E&&E.setDependencies(g,b)}reloadTilesForDependencies(c,g){for(const b in this._tiles)this._tiles[b].hasDependency(c,g)&&this._reloadTile(b,"reloading");this._cache.filter(b=>!b.hasDependency(c,g))}}function tt(C,c){const g=Math.abs(2*C.wrap)-+(C.wrap<0),b=Math.abs(2*c.wrap)-+(c.wrap<0);return C.overscaledZ-c.overscaledZ||b-g||c.canonical.y-C.canonical.y||c.canonical.x-C.canonical.x}function lt(C){return C==="raster"||C==="image"||C==="video"}Ue.maxOverzooming=10,Ue.maxUnderzooming=3;const St="mapboxgl_preloaded_worker_pool";class We{constructor(){this.active={}}acquire(c){if(!this.workers)for(this.workers=[];this.workers.length{g.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[St]}numActive(){return Object.keys(this.active).length}}const bt=Math.floor(a.exported.hardwareConcurrency/2);let Qe;function mt(){return Qe||(Qe=new We),Qe}function ct(C,c){const g={};for(const b in C)b!=="ref"&&(g[b]=C[b]);return a.refProperties.forEach(b=>{b in c&&(g[b]=c[b])}),g}function wt(C){C=C.slice();const c=Object.create(null);for(let g=0;g0?(E-z)/j:0;return this.points[A].mult(1-K).add(this.points[g].mult(K))}}function Ve(C,c){let g=!0;return C==="always"||C!=="never"&&c!=="never"||(g=!1),g}class Ze{constructor(c,g,b){const E=this.boxCells=[],A=this.circleCells=[];this.xCellCount=Math.ceil(c/b),this.yCellCount=Math.ceil(g/b);for(let z=0;zthis.width||E<0||g>this.height)return[];const K=[];if(c<=0&&g<=0&&this.width<=b&&this.height<=E){if(A)return[{key:null,x1:c,y1:g,x2:b,y2:E}];for(let Y=0;Y0}hitTestCircle(c,g,b,E,A){const z=c-b,j=c+b,K=g-b,Y=g+b;if(j<0||z>this.width||Y<0||K>this.height)return!1;const ie=[];return this._forEachCell(z,K,j,Y,this._queryCellCircle,ie,{hitTest:!0,overlapMode:E,circle:{x:c,y:g,radius:b},seenUids:{box:{},circle:{}}},A),ie.length>0}_queryCell(c,g,b,E,A,z,j,K){const{seenUids:Y,hitTest:ie,overlapMode:ue}=j,me=this.boxCells[A];if(me!==null){const Se=this.bboxes;for(const Ie of me)if(!Y.box[Ie]){Y.box[Ie]=!0;const je=4*Ie,Xe=this.boxKeys[Ie];if(c<=Se[je+2]&&g<=Se[je+3]&&b>=Se[je+0]&&E>=Se[je+1]&&(!K||K(Xe))&&(!ie||!Ve(ue,Xe.overlapMode))&&(z.push({key:Xe,x1:Se[je],y1:Se[je+1],x2:Se[je+2],y2:Se[je+3]}),ie))return!0}}const Re=this.circleCells[A];if(Re!==null){const Se=this.circles;for(const Ie of Re)if(!Y.circle[Ie]){Y.circle[Ie]=!0;const je=3*Ie,Xe=this.circleKeys[Ie];if(this._circleAndRectCollide(Se[je],Se[je+1],Se[je+2],c,g,b,E)&&(!K||K(Xe))&&(!ie||!Ve(ue,Xe.overlapMode))){const st=Se[je],Oe=Se[je+1],vt=Se[je+2];if(z.push({key:Xe,x1:st-vt,y1:Oe-vt,x2:st+vt,y2:Oe+vt}),ie)return!0}}}return!1}_queryCellCircle(c,g,b,E,A,z,j,K){const{circle:Y,seenUids:ie,overlapMode:ue}=j,me=this.boxCells[A];if(me!==null){const Se=this.bboxes;for(const Ie of me)if(!ie.box[Ie]){ie.box[Ie]=!0;const je=4*Ie,Xe=this.boxKeys[Ie];if(this._circleAndRectCollide(Y.x,Y.y,Y.radius,Se[je+0],Se[je+1],Se[je+2],Se[je+3])&&(!K||K(Xe))&&!Ve(ue,Xe.overlapMode))return z.push(!0),!0}}const Re=this.circleCells[A];if(Re!==null){const Se=this.circles;for(const Ie of Re)if(!ie.circle[Ie]){ie.circle[Ie]=!0;const je=3*Ie,Xe=this.circleKeys[Ie];if(this._circlesCollide(Se[je],Se[je+1],Se[je+2],Y.x,Y.y,Y.radius)&&(!K||K(Xe))&&!Ve(ue,Xe.overlapMode))return z.push(!0),!0}}}_forEachCell(c,g,b,E,A,z,j,K){const Y=this._convertToXCellCoord(c),ie=this._convertToYCellCoord(g),ue=this._convertToXCellCoord(b),me=this._convertToYCellCoord(E);for(let Re=Y;Re<=ue;Re++)for(let Se=ie;Se<=me;Se++)if(A.call(this,c,g,b,E,this.xCellCount*Se+Re,z,j,K))return}_convertToXCellCoord(c){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(c*this.xScale)))}_convertToYCellCoord(c){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(c*this.yScale)))}_circlesCollide(c,g,b,E,A,z){const j=E-c,K=A-g,Y=b+z;return Y*Y>j*j+K*K}_circleAndRectCollide(c,g,b,E,A,z,j){const K=(z-E)/2,Y=Math.abs(c-(E+K));if(Y>K+b)return!1;const ie=(j-A)/2,ue=Math.abs(g-(A+ie));if(ue>ie+b)return!1;if(Y<=K||ue<=ie)return!0;const me=Y-K,Re=ue-ie;return me*me+Re*Re<=b*b}}function Yt(C,c,g,b,E){const A=a.create();return c?(a.scale(A,A,[1/E,1/E,1]),g||a.rotateZ(A,A,b.angle)):a.multiply(A,b.labelPlaneMatrix,C),A}function sn(C,c,g,b,E){if(c){const A=a.clone(C);return a.scale(A,A,[E,E,1]),g||a.rotateZ(A,A,-b.angle),A}return b.glCoordMatrix}function Gt(C,c,g){let b;g?(b=[C.x,C.y,g(C.x,C.y),1],a.transformMat4(b,b,c)):(b=[C.x,C.y,0,1],xn(b,b,c));const E=b[3];return{point:new a.pointGeometry(b[0]/E,b[1]/E),signedDistanceFromCamera:E}}function zt(C,c){return .5+C/c*.5}function Rt(C,c){const g=C[0]/C[3],b=C[1]/C[3];return g>=-c[0]&&g<=c[0]&&b>=-c[1]&&b<=c[1]}function Qt(C,c,g,b,E,A,z,j,K,Y){const ie=b?C.textSizeData:C.iconSizeData,ue=a.evaluateSizeForZoom(ie,g.transform.zoom),me=[256/g.width*2+1,256/g.height*2+1],Re=b?C.text.dynamicLayoutVertexArray:C.icon.dynamicLayoutVertexArray;Re.clear();const Se=C.lineVertexArray,Ie=b?C.text.placedSymbolArray:C.icon.placedSymbolArray,je=g.transform.width/g.transform.height;let Xe=!1;for(let st=0;stMath.abs(g.x-c.x)*b?{useVertical:!0}:(C===a.WritingMode.vertical?c.yg.x)?{needsFlipping:!0}:null}function Lt(C,c,g,b,E,A,z,j,K,Y,ie,ue,me,Re,Se,Ie){const je=c/24,Xe=C.lineOffsetX*je,st=C.lineOffsetY*je;let Oe;if(C.numGlyphs>1){const vt=C.glyphStartIndex+C.numGlyphs,ft=C.lineStartIndex,Et=C.lineStartIndex+C.lineLength,It=pn(je,j,Xe,st,g,ie,ue,C,K,A,me,Se,Ie);if(!It)return{notEnoughRoom:!0};const Ht=Gt(It.first.point,z,Ie).point,Ct=Gt(It.last.point,z,Ie).point;if(b&&!g){const fn=ot(C.writingMode,Ht,Ct,Re);if(fn)return fn}Oe=[It.first];for(let fn=C.glyphStartIndex+1;fn0?Ht.point:Tt(ue,It,ft,1,E,Ie),fn=ot(C.writingMode,ft,Ct,Re);if(fn)return fn}const vt=Kt(je*j.getoffsetX(C.glyphStartIndex),Xe,st,g,ie,ue,C.segment,C.lineStartIndex,C.lineStartIndex+C.lineLength,K,A,me,Se,Ie);if(!vt)return{notEnoughRoom:!0};Oe=[vt]}for(const vt of Oe)a.addDynamicAttributes(Y,vt.point,vt.angle);return{}}function Tt(C,c,g,b,E,A){const z=Gt(C.add(C.sub(c)._unit()),E,A).point,j=g.sub(z);return g.add(j._mult(b/j.mag()))}function Kt(C,c,g,b,E,A,z,j,K,Y,ie,ue,me,Re){const Se=b?C-c:C+c;let Ie=Se>0?1:-1,je=0;b&&(Ie*=-1,je=Math.PI),Ie<0&&(je+=Math.PI);let Xe=Ie>0?j+z:j+z+1,st=E,Oe=E,vt=0,ft=0;const Et=Math.abs(Se),It=[];for(;vt+ft<=Et;){if(Xe+=Ie,Xe=K)return null;if(Oe=st,It.push(st),st=ue[Xe],st===void 0){const mn=new a.pointGeometry(Y.getx(Xe),Y.gety(Xe)),Hn=Gt(mn,ie,Re);if(Hn.signedDistanceFromCamera>0)st=ue[Xe]=Hn.point;else{const qn=Xe-Ie;st=Tt(vt===0?A:new a.pointGeometry(Y.getx(qn),Y.gety(qn)),mn,Oe,Et-vt+1,ie,Re)}}vt+=ft,ft=Oe.dist(st)}const Ht=(Et-vt)/ft,Ct=st.sub(Oe),fn=Ct.mult(Ht)._add(Oe);fn._add(Ct._unit()._perp()._mult(g*Ie));const rn=je+Math.atan2(st.y-Oe.y,st.x-Oe.x);return It.push(fn),{point:fn,angle:me?rn:0,path:It}}const Zt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ht(C,c){for(let g=0;g=1;sr--)kn.push(Hn.path[sr]);for(let sr=1;srGt(ur,K,Se));kn=sr.some(ur=>ur.signedDistanceFromCamera<=0)?[]:sr.map(ur=>ur.point)}let yr=[];if(kn.length>0){const sr=kn[0].clone(),ur=kn[0].clone();for(let Cr=1;Cr=fn.x&&ur.x<=rn.x&&sr.y>=fn.y&&ur.y<=rn.y?[kn]:ur.xrn.x||ur.yrn.y?[]:a.clipLine([kn],fn.x,fn.y,rn.x,rn.y)}for(const sr of yr){mn.reset(sr,.25*Ct);let ur=0;ur=mn.length<=.5*Ct?1:Math.ceil(mn.paddedLength/vr)+1;for(let Cr=0;Cr=this.screenRightBoundary||Ethis.screenBottomBoundary}isInsideGrid(c,g,b,E){return b>=0&&c=0&&gb.collisionGroupID===g}}return this.collisionGroups[c]}}function tr(C,c,g,b,E){const{horizontalAlign:A,verticalAlign:z}=a.getAnchorAlignment(C),j=-(A-.5)*c,K=-(z-.5)*g,Y=a.evaluateVariableOffset(C,b);return new a.pointGeometry(j+Y[0]*E,K+Y[1]*E)}function nr(C,c,g,b,E,A){const{x1:z,x2:j,y1:K,y2:Y,anchorPointX:ie,anchorPointY:ue}=C,me=new a.pointGeometry(c,g);return b&&me._rotate(E?A:-A),{x1:z+me.x,y1:K+me.y,x2:j+me.x,y2:Y+me.y,anchorPointX:ie,anchorPointY:ue}}class ye{constructor(c,g,b,E,A){this.transform=c.clone(),this.terrain=g,this.collisionIndex=new tn(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=b,this.retainedQueryData={},this.collisionGroups=new Fn(E),this.collisionCircleArrays={},this.prevPlacement=A,A&&(A.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(c,g,b,E){const A=b.getBucket(g),z=b.latestFeatureIndex;if(!A||!z||g.id!==A.layerIds[0])return;const j=b.collisionBoxArray,K=A.layers[0].layout,Y=Math.pow(2,this.transform.zoom-b.tileID.overscaledZ),ie=b.tileSize/a.EXTENT,ue=this.transform.calculatePosMatrix(b.tileID.toUnwrapped()),me=K.get("text-pitch-alignment")==="map",Re=K.get("text-rotation-alignment")==="map",Se=Bt(b,1,this.transform.zoom),Ie=Yt(ue,me,Re,this.transform,Se);let je=null;if(me){const st=sn(ue,me,Re,this.transform,Se);je=a.multiply([],this.transform.labelPlaneMatrix,st)}this.retainedQueryData[A.bucketInstanceId]=new vn(A.bucketInstanceId,z,A.sourceLayerIndex,A.index,b.tileID);const Xe={bucket:A,layout:K,posMatrix:ue,textLabelPlaneMatrix:Ie,labelToScreenMatrix:je,scale:Y,textPixelRatio:ie,holdingForFade:b.holdingForFade(),collisionBoxArray:j,partiallyEvaluatedTextSize:a.evaluateSizeForZoom(A.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(A.sourceID)};if(E)for(const st of A.sortKeyRanges){const{sortKey:Oe,symbolInstanceStart:vt,symbolInstanceEnd:ft}=st;c.push({sortKey:Oe,symbolInstanceStart:vt,symbolInstanceEnd:ft,parameters:Xe})}else c.push({symbolInstanceStart:0,symbolInstanceEnd:A.symbolInstances.length,parameters:Xe})}attemptAnchorPlacement(c,g,b,E,A,z,j,K,Y,ie,ue,me,Re,Se,Ie,je){const Xe=[me.textOffset0,me.textOffset1],st=tr(c,b,E,Xe,A),Oe=this.collisionIndex.placeCollisionBox(nr(g,st.x,st.y,z,j,this.transform.angle),ue,K,Y,ie.predicate,je);if((!Ie||this.collisionIndex.placeCollisionBox(nr(Ie,st.x,st.y,z,j,this.transform.angle),ue,K,Y,ie.predicate,je).box.length!==0)&&Oe.box.length>0){let vt;if(this.prevPlacement&&this.prevPlacement.variableOffsets[me.crossTileID]&&this.prevPlacement.placements[me.crossTileID]&&this.prevPlacement.placements[me.crossTileID].text&&(vt=this.prevPlacement.variableOffsets[me.crossTileID].anchor),me.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[me.crossTileID]={textOffset:Xe,width:b,height:E,anchor:c,textBoxScale:A,prevAnchor:vt},this.markUsedJustification(Re,c,me,Se),Re.allowVerticalPlacement&&(this.markUsedOrientation(Re,Se,me),this.placedOrientations[me.crossTileID]=Se),{shift:st,placedGlyphBoxes:Oe}}}placeLayerBucketPart(c,g,b){const{bucket:E,layout:A,posMatrix:z,textLabelPlaneMatrix:j,labelToScreenMatrix:K,textPixelRatio:Y,holdingForFade:ie,collisionBoxArray:ue,partiallyEvaluatedTextSize:me,collisionGroup:Re}=c.parameters,Se=A.get("text-optional"),Ie=A.get("icon-optional"),je=a.getOverlapMode(A,"text-overlap","text-allow-overlap"),Xe=je==="always",st=a.getOverlapMode(A,"icon-overlap","icon-allow-overlap"),Oe=st==="always",vt=A.get("text-rotation-alignment")==="map",ft=A.get("text-pitch-alignment")==="map",Et=A.get("icon-text-fit")!=="none",It=A.get("symbol-z-order")==="viewport-y",Ht=Xe&&(Oe||!E.hasIconData()||Ie),Ct=Oe&&(Xe||!E.hasTextData()||Se);!E.collisionArrays&&ue&&E.deserializeCollisionBoxes(ue);const fn=(rn,mn)=>{if(g[rn.crossTileID])return;if(ie)return void(this.placements[rn.crossTileID]=new Vt(!1,!1,!1));let Hn=!1,qn=!1,kn=!0,vr=null,yr={box:null,offscreen:null},sr={box:null,offscreen:null},ur=null,Cr=null,Ri=null,Ka=0,xa=0,Wa=0;mn.textFeatureIndex?Ka=mn.textFeatureIndex:rn.useRuntimeCollisionCircles&&(Ka=rn.featureIndex),mn.verticalTextFeatureIndex&&(xa=mn.verticalTextFeatureIndex);const el=this.retainedQueryData[E.bucketInstanceId].tileID,ta=this.terrain?(Si,Jn)=>this.terrain.getElevation(el,Si,Jn):null;for(const Si of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const Jn=mn[Si];Jn&&(Jn.elevation=ta?ta(Jn.anchorPointX,Jn.anchorPointY):0)}const bo=mn.textBox;if(bo){const Si=gr=>{let Ai=a.WritingMode.horizontal;if(E.allowVerticalPlacement&&!gr&&this.prevPlacement){const Di=this.prevPlacement.placedOrientations[rn.crossTileID];Di&&(this.placedOrientations[rn.crossTileID]=Di,Ai=Di,this.markUsedOrientation(E,Ai,rn))}return Ai},Jn=(gr,Ai)=>{if(E.allowVerticalPlacement&&rn.numVerticalGlyphVertices>0&&mn.verticalTextBox){for(const Di of E.writingModes)if(Di===a.WritingMode.vertical?(yr=Ai(),sr=yr):yr=gr(),yr&&yr.box&&yr.box.length)break}else yr=gr()};if(A.get("text-variable-anchor")){let gr=A.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[rn.crossTileID]){const Kr=this.prevPlacement.variableOffsets[rn.crossTileID];gr.indexOf(Kr.anchor)>0&&(gr=gr.filter(na=>na!==Kr.anchor),gr.unshift(Kr.anchor))}const Ai=(Kr,na,Ll)=>{const lm=Kr.x2-Kr.x1,Nu=Kr.y2-Kr.y1,ty=rn.textBoxScale,um=Et&&st==="never"?na:null;let tl={box:[],offscreen:!1};const Fl=je!=="never"?2*gr.length:gr.length;for(let zl=0;zl=gr.length?je:"never",rn,E,Ll,um,ta);if(jf&&(tl=jf.placedGlyphBoxes,tl&&tl.box&&tl.box.length)){Hn=!0,vr=jf.shift;break}}return tl};Jn(()=>Ai(bo,mn.iconBox,a.WritingMode.horizontal),()=>{const Kr=mn.verticalTextBox;return E.allowVerticalPlacement&&!(yr&&yr.box&&yr.box.length)&&rn.numVerticalGlyphVertices>0&&Kr?Ai(Kr,mn.verticalIconBox,a.WritingMode.vertical):{box:null,offscreen:null}}),yr&&(Hn=yr.box,kn=yr.offscreen);const Di=Si(yr&&yr.box);if(!Hn&&this.prevPlacement){const Kr=this.prevPlacement.variableOffsets[rn.crossTileID];Kr&&(this.variableOffsets[rn.crossTileID]=Kr,this.markUsedJustification(E,Kr.anchor,rn,Di))}}else{const gr=(Ai,Di)=>{const Kr=this.collisionIndex.placeCollisionBox(Ai,je,Y,z,Re.predicate,ta);return Kr&&Kr.box&&Kr.box.length&&(this.markUsedOrientation(E,Di,rn),this.placedOrientations[rn.crossTileID]=Di),Kr};Jn(()=>gr(bo,a.WritingMode.horizontal),()=>{const Ai=mn.verticalTextBox;return E.allowVerticalPlacement&&rn.numVerticalGlyphVertices>0&&Ai?gr(Ai,a.WritingMode.vertical):{box:null,offscreen:null}}),Si(yr&&yr.box&&yr.box.length)}}if(ur=yr,Hn=ur&&ur.box&&ur.box.length>0,kn=ur&&ur.offscreen,rn.useRuntimeCollisionCircles){const Si=E.text.placedSymbolArray.get(rn.centerJustifiedTextSymbolIndex),Jn=a.evaluateSizeForFeature(E.textSizeData,me,Si),gr=A.get("text-padding");Cr=this.collisionIndex.placeCollisionCircles(je,Si,E.lineVertexArray,E.glyphOffsetArray,Jn,z,j,K,b,ft,Re.predicate,rn.collisionCircleDiameter,gr,ta),Cr.circles.length&&Cr.collisionDetected&&!b&&a.warnOnce("Collisions detected, but collision boxes are not shown"),Hn=Xe||Cr.circles.length>0&&!Cr.collisionDetected,kn=kn&&Cr.offscreen}if(mn.iconFeatureIndex&&(Wa=mn.iconFeatureIndex),mn.iconBox){const Si=Jn=>{const gr=Et&&vr?nr(Jn,vr.x,vr.y,vt,ft,this.transform.angle):Jn;return this.collisionIndex.placeCollisionBox(gr,st,Y,z,Re.predicate,ta)};sr&&sr.box&&sr.box.length&&mn.verticalIconBox?(Ri=Si(mn.verticalIconBox),qn=Ri.box.length>0):(Ri=Si(mn.iconBox),qn=Ri.box.length>0),kn=kn&&Ri.offscreen}const Ss=Se||rn.numHorizontalGlyphVertices===0&&rn.numVerticalGlyphVertices===0,Uf=Ie||rn.numIconVertices===0;if(Ss||Uf?Uf?Ss||(qn=qn&&Hn):Hn=qn&&Hn:qn=Hn=qn&&Hn,Hn&&ur&&ur.box&&this.collisionIndex.insertCollisionBox(ur.box,je,A.get("text-ignore-placement"),E.bucketInstanceId,sr&&sr.box&&xa?xa:Ka,Re.ID),qn&&Ri&&this.collisionIndex.insertCollisionBox(Ri.box,st,A.get("icon-ignore-placement"),E.bucketInstanceId,Wa,Re.ID),Cr&&(Hn&&this.collisionIndex.insertCollisionCircles(Cr.circles,je,A.get("text-ignore-placement"),E.bucketInstanceId,Ka,Re.ID),b)){const Si=E.bucketInstanceId;let Jn=this.collisionCircleArrays[Si];Jn===void 0&&(Jn=this.collisionCircleArrays[Si]=new qt);for(let gr=0;gr=0;--mn){const Hn=rn[mn];fn(E.symbolInstances.get(Hn),E.collisionArrays[Hn])}}else for(let rn=c.symbolInstanceStart;rn=0&&(c.text.placedSymbolArray.get(j).crossTileID=A>=0&&j!==A?0:b.crossTileID)}markUsedOrientation(c,g,b){const E=g===a.WritingMode.horizontal||g===a.WritingMode.horizontalOnly?g:0,A=g===a.WritingMode.vertical?g:0,z=[b.leftJustifiedTextSymbolIndex,b.centerJustifiedTextSymbolIndex,b.rightJustifiedTextSymbolIndex];for(const j of z)c.text.placedSymbolArray.get(j).placedOrientation=E;b.verticalPlacedTextSymbolIndex&&(c.text.placedSymbolArray.get(b.verticalPlacedTextSymbolIndex).placedOrientation=A)}commit(c){this.commitTime=c,this.zoomAtLastRecencyCheck=this.transform.zoom;const g=this.prevPlacement;let b=!1;this.prevZoomAdjustment=g?g.zoomAdjustment(this.transform.zoom):0;const E=g?g.symbolFadeChange(c):1,A=g?g.opacities:{},z=g?g.variableOffsets:{},j=g?g.placedOrientations:{};for(const K in this.placements){const Y=this.placements[K],ie=A[K];ie?(this.opacities[K]=new xt(ie,E,Y.text,Y.icon),b=b||Y.text!==ie.text.placed||Y.icon!==ie.icon.placed):(this.opacities[K]=new xt(null,E,Y.text,Y.icon,Y.skipFade),b=b||Y.text||Y.icon)}for(const K in A){const Y=A[K];if(!this.opacities[K]){const ie=new xt(Y,E,!1,!1);ie.isHidden()||(this.opacities[K]=ie,b=b||Y.text.placed||Y.icon.placed)}}for(const K in z)this.variableOffsets[K]||!this.opacities[K]||this.opacities[K].isHidden()||(this.variableOffsets[K]=z[K]);for(const K in j)this.placedOrientations[K]||!this.opacities[K]||this.opacities[K].isHidden()||(this.placedOrientations[K]=j[K]);if(g&&g.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");b?this.lastPlacementChangeTime=c:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=g?g.lastPlacementChangeTime:c)}updateLayerOpacities(c,g){const b={};for(const E of g){const A=E.getBucket(c);A&&E.latestFeatureIndex&&c.id===A.layerIds[0]&&this.updateBucketOpacities(A,b,E.collisionBoxArray)}}updateBucketOpacities(c,g,b){c.hasTextData()&&c.text.opacityVertexArray.clear(),c.hasIconData()&&c.icon.opacityVertexArray.clear(),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexArray.clear(),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexArray.clear();const E=c.layers[0].layout,A=new xt(null,0,!1,!1,!0),z=E.get("text-allow-overlap"),j=E.get("icon-allow-overlap"),K=E.get("text-variable-anchor"),Y=E.get("text-rotation-alignment")==="map",ie=E.get("text-pitch-alignment")==="map",ue=E.get("icon-text-fit")!=="none",me=new xt(null,0,z&&(j||!c.hasIconData()||E.get("icon-optional")),j&&(z||!c.hasTextData()||E.get("text-optional")),!0);!c.collisionArrays&&b&&(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData())&&c.deserializeCollisionBoxes(b);const Re=(Se,Ie,je)=>{for(let Xe=0;Xe0,ft=this.placedOrientations[Ie.crossTileID],Et=ft===a.WritingMode.vertical,It=ft===a.WritingMode.horizontal||ft===a.WritingMode.horizontalOnly;if(je>0||Xe>0){const Ht=Be(Oe.text);Re(c.text,je,Et?Je:Ht),Re(c.text,Xe,It?Je:Ht);const Ct=Oe.text.isHidden();[Ie.rightJustifiedTextSymbolIndex,Ie.centerJustifiedTextSymbolIndex,Ie.leftJustifiedTextSymbolIndex].forEach(mn=>{mn>=0&&(c.text.placedSymbolArray.get(mn).hidden=Ct||Et?1:0)}),Ie.verticalPlacedTextSymbolIndex>=0&&(c.text.placedSymbolArray.get(Ie.verticalPlacedTextSymbolIndex).hidden=Ct||It?1:0);const fn=this.variableOffsets[Ie.crossTileID];fn&&this.markUsedJustification(c,fn.anchor,Ie,ft);const rn=this.placedOrientations[Ie.crossTileID];rn&&(this.markUsedJustification(c,"left",Ie,rn),this.markUsedOrientation(c,rn,Ie))}if(vt){const Ht=Be(Oe.icon),Ct=!(ue&&Ie.verticalPlacedIconSymbolIndex&&Et);Ie.placedIconSymbolIndex>=0&&(Re(c.icon,Ie.numIconVertices,Ct?Ht:Je),c.icon.placedSymbolArray.get(Ie.placedIconSymbolIndex).hidden=Oe.icon.isHidden()),Ie.verticalPlacedIconSymbolIndex>=0&&(Re(c.icon,Ie.numVerticalIconVertices,Ct?Je:Ht),c.icon.placedSymbolArray.get(Ie.verticalPlacedIconSymbolIndex).hidden=Oe.icon.isHidden())}if(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData()){const Ht=c.collisionArrays[Se];if(Ht){let Ct=new a.pointGeometry(0,0);if(Ht.textBox||Ht.verticalTextBox){let rn=!0;if(K){const mn=this.variableOffsets[st];mn?(Ct=tr(mn.anchor,mn.width,mn.height,mn.textOffset,mn.textBoxScale),Y&&Ct._rotate(ie?this.transform.angle:-this.transform.angle)):rn=!1}Ht.textBox&&q(c.textCollisionBox.collisionVertexArray,Oe.text.placed,!rn||Et,Ct.x,Ct.y),Ht.verticalTextBox&&q(c.textCollisionBox.collisionVertexArray,Oe.text.placed,!rn||It,Ct.x,Ct.y)}const fn=Boolean(!It&&Ht.verticalIconBox);Ht.iconBox&&q(c.iconCollisionBox.collisionVertexArray,Oe.icon.placed,fn,ue?Ct.x:0,ue?Ct.y:0),Ht.verticalIconBox&&q(c.iconCollisionBox.collisionVertexArray,Oe.icon.placed,!fn,ue?Ct.x:0,ue?Ct.y:0)}}}if(c.sortFeatures(this.transform.angle),this.retainedQueryData[c.bucketInstanceId]&&(this.retainedQueryData[c.bucketInstanceId].featureSortOrder=c.featureSortOrder),c.hasTextData()&&c.text.opacityVertexBuffer&&c.text.opacityVertexBuffer.updateData(c.text.opacityVertexArray),c.hasIconData()&&c.icon.opacityVertexBuffer&&c.icon.opacityVertexBuffer.updateData(c.icon.opacityVertexArray),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexBuffer&&c.iconCollisionBox.collisionVertexBuffer.updateData(c.iconCollisionBox.collisionVertexArray),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexBuffer&&c.textCollisionBox.collisionVertexBuffer.updateData(c.textCollisionBox.collisionVertexArray),c.text.opacityVertexArray.length!==c.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${c.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${c.text.layoutVertexArray.length}) / 4`);if(c.icon.opacityVertexArray.length!==c.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${c.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${c.icon.layoutVertexArray.length}) / 4`);if(c.bucketInstanceId in this.collisionCircleArrays){const Se=this.collisionCircleArrays[c.bucketInstanceId];c.placementInvProjMatrix=Se.invProjMatrix,c.placementViewportMatrix=Se.viewportMatrix,c.collisionCircleArray=Se.circles,delete this.collisionCircleArrays[c.bucketInstanceId]}}symbolFadeChange(c){return this.fadeDuration===0?1:(c-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(c){return Math.max(0,(this.transform.zoom-c)/1.5)}hasTransitions(c){return this.stale||c-this.lastPlacementChangeTimec}setStale(){this.stale=!0}}function q(C,c,g,b,E){C.emplaceBack(c?1:0,g?1:0,b||0,E||0),C.emplaceBack(c?1:0,g?1:0,b||0,E||0),C.emplaceBack(c?1:0,g?1:0,b||0,E||0),C.emplaceBack(c?1:0,g?1:0,b||0,E||0)}const J=Math.pow(2,25),pe=Math.pow(2,24),ce=Math.pow(2,17),we=Math.pow(2,16),Ae=Math.pow(2,9),Pe=Math.pow(2,8),Me=Math.pow(2,1);function Be(C){if(C.opacity===0&&!C.placed)return 0;if(C.opacity===1&&C.placed)return 4294967295;const c=C.placed?1:0,g=Math.floor(127*C.opacity);return g*J+c*pe+g*ce+c*we+g*Ae+c*Pe+g*Me+c}const Je=0;class et{constructor(c){this._sortAcrossTiles=c.layout.get("symbol-z-order")!=="viewport-y"&&!c.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(c,g,b,E,A){const z=this._bucketParts;for(;this._currentTileIndexj.sortKey-K.sortKey));this._currentPartIndex{const z=a.exported.now()-E;return!this._forceFullPlacement&&z>2};for(;this._currentPlacementIndex>=0;){const z=g[c[this._currentPlacementIndex]],j=this.placement.collisionIndex.transform.zoom;if(z.type==="symbol"&&(!z.minzoom||z.minzoom<=j)&&(!z.maxzoom||z.maxzoom>j)){if(this._inProgressLayer||(this._inProgressLayer=new et(z)),this._inProgressLayer.continuePlacement(b[z.source],this.placement,this._showCollisionBoxes,z,A))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(c){return this.placement.commit(c),this.placement}}const Ut=512/a.EXTENT/2;class Mt{constructor(c,g,b){this.tileID=c,this.indexedSymbolInstances={},this.bucketInstanceId=b;for(let E=0;Ec.overscaledZ)for(const j in z){const K=z[j];K.tileID.isChildOf(c)&&K.findMatches(g.symbolInstances,c,E)}else{const j=z[c.scaledTo(Number(A)).key];j&&j.findMatches(g.symbolInstances,c,E)}}for(let A=0;A{g[b]=!0});for(const b in this.layerIndexes)g[b]||delete this.layerIndexes[b]}}var En=a.createLayout([{name:"a_pos",type:"Int16",components:2}]);class hn extends a.Evented{constructor(c){super(),this.sourceCache=c,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=c._cache.max,c.usedForTerrain=!0,c.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const c in this._tiles){const g=this._tiles[c];g.textures.forEach(b=>b.destroy()),g.textures=[]}}update(c,g){this.sourceCache.update(c,g),this._renderableTilesKeys=[];for(const b of c.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:g}))this._renderableTilesKeys.push(b.key),this._tiles[b.key]||(b.posMatrix=new Float64Array(16),a.ortho(b.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),this._tiles[b.key]=new ke(b,this.tileSize))}removeOutdated(c){const g={};this.renderHistory=this.renderHistory.filter((b,E)=>this.renderHistory.indexOf(b)===E).slice(0,this.renderHistorySize);for(const b of this._renderableTilesKeys)g[b]=!0;for(const b of this.renderHistory)g[b]=!0;for(const b in this._tiles)g[b]||(this._tiles[b].clearTextures(c),delete this._tiles[b])}getRenderableTiles(){return this._renderableTilesKeys.map(c=>this.getTileByID(c))}getTileByID(c){return this._tiles[c]}getTerrainCoords(c){const g={};for(const b of this._renderableTilesKeys){const E=this._tiles[b].tileID;if(E.canonical.equals(c.canonical)){const A=c.clone();A.posMatrix=new Float64Array(16),a.ortho(A.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),g[b]=A}else if(E.canonical.isChildOf(c.canonical)){const A=c.clone();A.posMatrix=new Float64Array(16);const z=E.canonical.z-c.canonical.z,j=E.canonical.x-(E.canonical.x>>z<>z<>z;a.ortho(A.posMatrix,0,Y,0,Y,0,1),a.translate(A.posMatrix,A.posMatrix,[-j*Y,-K*Y,0]),g[b]=A}else if(c.canonical.isChildOf(E.canonical)){const A=c.clone();A.posMatrix=new Float64Array(16);const z=c.canonical.z-E.canonical.z,j=c.canonical.x-(c.canonical.x>>z<>z<>z;a.ortho(A.posMatrix,0,a.EXTENT,0,a.EXTENT,0,1),a.translate(A.posMatrix,A.posMatrix,[j*Y,K*Y,0]),a.scale(A.posMatrix,A.posMatrix,[1/2**z,1/2**z,0]),g[b]=A}}return g}getSourceTile(c,g){const b=this.sourceCache._source;let E=c.overscaledZ-this.deltaZoom;if(E>b.maxzoom&&(E=b.maxzoom),E=b.minzoom&&(!A||!A.dem);)A=this.sourceCache.getTileByID(c.scaledTo(E--).key);return A}tilesAfterTime(c=Date.now()){return Object.values(this._tiles).filter(g=>g.timeLoaded>=c)}}class Pn{constructor(c,g,b){this.style=c,this.sourceCache=new hn(g),this.options=b,this.exaggeration=typeof b.exaggeration=="number"?b.exaggeration:1,this.elevationOffset=typeof b.elevationOffset=="number"?b.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(c,g,b,E=a.EXTENT){if(!(g>=0&&g=0&&bc.canonical.z&&(c.canonical.z>=E?A=c.canonical.z-E:a.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const z=c.canonical.x-(c.canonical.x>>A<>A<>8<<4|A>>8,g[z+3]=0;const b=new a.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(g.buffer)),E=new P(c,b,c.gl.RGBA,{premultiply:!1});return E.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._coordsTexture=E,E}pointCoordinate(c){const g=new Uint8Array(4),b=this.style.map.painter,E=b.context,A=E.gl;E.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),A.readPixels(c.x,b.height/devicePixelRatio-c.y-1,1,1,A.RGBA,A.UNSIGNED_BYTE,g),E.bindFramebuffer.set(null);const z=g[0]+(g[2]>>4<<8),j=g[1]+((15&g[2])<<8),K=this.coordsIndex[255-g[3]],Y=K&&this.sourceCache.getTileByID(K);if(!Y)return null;const ie=this._coordsTextureSize,ue=(1<a.emitValidationErrors(C,c&&c.filter(g=>g.identifier!=="source.canvas")),lr=a.pick(rt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Zr=a.pick(rt,["setCenter","setZoom","setBearing","setPitch"]),hr=function(){const C={},c=a.spec.$version;for(const g in a.spec.$root){const b=a.spec.$root[g];if(b.required){let E=null;E=g==="version"?c:b.type==="array"?[]:{},E!=null&&(C[g]=E)}}return C}();class Vr extends a.Evented{constructor(c,g={}){super(),this.map=c,this.dispatcher=new G(mt(),this),this.imageManager=new T,this.imageManager.setEventedParent(this),this.glyphManager=new L(c._requestManager,g.localIdeographFontFamily),this.lineAtlas=new H(256,512),this.crossTileSymbolIndex=new Xt,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new a.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",a.getReferrer());const b=this;this._rtlTextPluginCallback=Vr.registerForPluginStateChange(E=>{b.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:E.pluginStatus,pluginURL:E.pluginURL},(A,z)=>{if(a.triggerPluginCompletionEvent(A),z&&z.every(j=>j))for(const j in b.sourceCaches)b.sourceCaches[j].reload()})}),this.on("data",E=>{if(E.dataType!=="source"||E.sourceDataType!=="metadata")return;const A=this.sourceCaches[E.sourceId];if(!A)return;const z=A.getSource();if(z&&z.vectorLayerIds)for(const j in this._layers){const K=this._layers[j];K.source===z.id&&this._validateLayer(K)}})}loadURL(c,g={}){this.fire(new a.Event("dataloading",{dataType:"style"}));const b=typeof g.validate!="boolean"||g.validate,E=this.map._requestManager.transformRequest(c,a.ResourceType.Style);this._request=a.getJSON(E,(A,z)=>{this._request=null,A?this.fire(new a.ErrorEvent(A)):z&&this._load(z,b)})}loadJSON(c,g={}){this.fire(new a.Event("dataloading",{dataType:"style"})),this._request=a.exported.frame(()=>{this._request=null,this._load(c,g.validate!==!1)})}loadEmpty(){this.fire(new a.Event("dataloading",{dataType:"style"})),this._load(hr,!1)}_load(c,g){if(g&&Gn(this,a.validateStyle(c)))return;this._loaded=!0,this.stylesheet=c;for(const E in c.sources)this.addSource(E,c.sources[E],{validate:!1});c.sprite?this._loadSprite(c.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(c.glyphs);const b=wt(this.stylesheet.layers);this._order=b.map(E=>E.id),this._layers={},this._serializedLayers={};for(let E of b)E=a.createStyleLayer(E),E.setEventedParent(this,{layer:{id:E.id}}),this._layers[E.id]=E,this._serializedLayers[E.id]=E.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new B(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new a.Event("data",{dataType:"style"})),this.fire(new a.Event("style.load"))}_loadSprite(c){this._spriteRequest=function(g,b,E,A){let z,j,K;const Y=E>1?"@2x":"";let ie=a.getJSON(b.transformRequest(b.normalizeSpriteURL(g,Y,".json"),a.ResourceType.SpriteJSON),(Re,Se)=>{ie=null,K||(K=Re,z=Se,me())}),ue=a.getImage(b.transformRequest(b.normalizeSpriteURL(g,Y,".png"),a.ResourceType.SpriteImage),(Re,Se)=>{ue=null,K||(K=Re,j=Se,me())});function me(){if(K)A(K);else if(z&&j){const Re=a.exported.getImageData(j),Se={};for(const Ie in z){const{width:je,height:Xe,x:st,y:Oe,sdf:vt,pixelRatio:ft,stretchX:Et,stretchY:It,content:Ht}=z[Ie],Ct=new a.RGBAImage({width:je,height:Xe});a.RGBAImage.copy(Re,Ct,{x:st,y:Oe},{x:0,y:0},{width:je,height:Xe}),Se[Ie]={data:Ct,pixelRatio:ft,sdf:vt,stretchX:Et,stretchY:It,content:Ht}}A(null,Se)}}return{cancel(){ie&&(ie.cancel(),ie=null),ue&&(ue.cancel(),ue=null)}}}(c,this.map._requestManager,this.map.getPixelRatio(),(g,b)=>{if(this._spriteRequest=null,g)this.fire(new a.ErrorEvent(g));else if(b)for(const E in b)this.imageManager.addImage(E,b[E]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))})}_validateLayer(c){const g=this.sourceCaches[c.source];if(!g)return;const b=c.sourceLayer;if(!b)return;const E=g.getSource();(E.type==="geojson"||E.vectorLayerIds&&E.vectorLayerIds.indexOf(b)===-1)&&this.fire(new a.ErrorEvent(new Error(`Source layer "${b}" does not exist on source "${E.id}" as specified by style layer "${c.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const c in this.sourceCaches)if(!this.sourceCaches[c].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(c){const g=[];for(const b of c){const E=this._layers[b];E.type!=="custom"&&g.push(E.serialize())}return g}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const c in this.sourceCaches)if(this.sourceCaches[c].hasTransition())return!0;for(const c in this._layers)if(this._layers[c].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(c){if(!this._loaded)return;const g=this._changed;if(this._changed){const E=Object.keys(this._updatedLayers),A=Object.keys(this._removedLayers);(E.length||A.length)&&this._updateWorkerLayers(E,A);for(const z in this._updatedSources){const j=this._updatedSources[z];if(j==="reload")this._reloadSource(z);else{if(j!=="clear")throw new Error(`Invalid action ${j}`);this._clearSource(z)}}this._updateTilesForChangedImages();for(const z in this._updatedPaintProps)this._layers[z].updateTransitions(c);this.light.updateTransitions(c),this._resetUpdates()}const b={};for(const E in this.sourceCaches){const A=this.sourceCaches[E];b[E]=A.used,A.used=!1}for(const E of this._order){const A=this._layers[E];A.recalculate(c,this._availableImages),!A.isHidden(c.zoom)&&A.source&&(this.sourceCaches[A.source].used=!0)}for(const E in b){const A=this.sourceCaches[E];b[E]!==A.used&&A.fire(new a.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:E}))}this.light.recalculate(c),this.z=c.zoom,g&&this.fire(new a.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const c=Object.keys(this._changedImages);if(c.length){for(const g in this.sourceCaches)this.sourceCaches[g].reloadTilesForDependencies(["icons","patterns"],c);this._changedImages={}}}_updateWorkerLayers(c,g){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(c),removedIds:g})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(c){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),c){const g=this.sourceCaches[c.source];if(!g)throw new Error(`cannot load terrain, because there exists no source with ID: ${c.source}`);this.terrain=new Pn(this,g,c),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=b=>{b.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=b=>{b.tile&&(b.sourceId===c.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(b.sourceId,b.tile.tileID)):b.source.type==="geojson"&&this.terrain.rememberForRerender(b.sourceId,b.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new a.Event("terrain",{terrain:c}))}setState(c){if(this._checkLoaded(),Gn(this,a.validateStyle(c)))return!1;(c=a.clone$1(c)).layers=wt(c.layers);const g=function(E,A){if(!E)return[{command:rt.setStyle,args:[A]}];let z=[];try{if(!m(E.version,A.version))return[{command:rt.setStyle,args:[A]}];m(E.center,A.center)||z.push({command:rt.setCenter,args:[A.center]}),m(E.zoom,A.zoom)||z.push({command:rt.setZoom,args:[A.zoom]}),m(E.bearing,A.bearing)||z.push({command:rt.setBearing,args:[A.bearing]}),m(E.pitch,A.pitch)||z.push({command:rt.setPitch,args:[A.pitch]}),m(E.sprite,A.sprite)||z.push({command:rt.setSprite,args:[A.sprite]}),m(E.glyphs,A.glyphs)||z.push({command:rt.setGlyphs,args:[A.glyphs]}),m(E.transition,A.transition)||z.push({command:rt.setTransition,args:[A.transition]}),m(E.light,A.light)||z.push({command:rt.setLight,args:[A.light]});const j={},K=[];(function(ie,ue,me,Re){let Se;for(Se in ue=ue||{},ie=ie||{})Object.prototype.hasOwnProperty.call(ie,Se)&&(Object.prototype.hasOwnProperty.call(ue,Se)||nt(Se,me,Re));for(Se in ue)Object.prototype.hasOwnProperty.call(ue,Se)&&(Object.prototype.hasOwnProperty.call(ie,Se)?m(ie[Se],ue[Se])||(ie[Se].type==="geojson"&&ue[Se].type==="geojson"&&dt(ie,ue,Se)?me.push({command:rt.setGeoJSONSourceData,args:[Se,ue[Se].data]}):qe(Se,ue,me,Re)):ut(Se,ue,me))})(E.sources,A.sources,K,j);const Y=[];E.layers&&E.layers.forEach(ie=>{j[ie.source]?z.push({command:rt.removeLayer,args:[ie.id]}):Y.push(ie)}),z=z.concat(K),function(ie,ue,me){ue=ue||[];const Re=(ie=ie||[]).map(Dt),Se=ue.map(Dt),Ie=ie.reduce(Nt,{}),je=ue.reduce(Nt,{}),Xe=Re.slice(),st=Object.create(null);let Oe,vt,ft,Et,It,Ht,Ct;for(Oe=0,vt=0;Oe!(E.command in Zr));if(g.length===0)return!1;const b=g.filter(E=>!(E.command in lr));if(b.length>0)throw new Error(`Unimplemented: ${b.map(E=>E.command).join(", ")}.`);return g.forEach(E=>{E.command!=="setTransition"&&this[E.command].apply(this,E.args)}),this.stylesheet=c,!0}addImage(c,g){if(this.getImage(c))return this.fire(new a.ErrorEvent(new Error(`An image named "${c}" already exists.`)));this.imageManager.addImage(c,g),this._afterImageUpdated(c)}updateImage(c,g){this.imageManager.updateImage(c,g)}getImage(c){return this.imageManager.getImage(c)}removeImage(c){if(!this.getImage(c))return this.fire(new a.ErrorEvent(new Error(`An image named "${c}" does not exist.`)));this.imageManager.removeImage(c),this._afterImageUpdated(c)}_afterImageUpdated(c){this._availableImages=this.imageManager.listImages(),this._changedImages[c]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new a.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(c,g,b={}){if(this._checkLoaded(),this.sourceCaches[c]!==void 0)throw new Error(`Source "${c}" already exists.`);if(!g.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(g).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(g.type)>=0&&this._validate(a.validateStyle.source,`sources.${c}`,g,null,b))return;this.map&&this.map._collectResourceTiming&&(g.collectResourceTiming=!0);const E=this.sourceCaches[c]=new Ue(c,g,this.dispatcher);E.style=this,E.setEventedParent(this,()=>({isSourceLoaded:this.loaded(),source:E.serialize(),sourceId:c})),E.onAdd(this.map),this._changed=!0}removeSource(c){if(this._checkLoaded(),this.sourceCaches[c]===void 0)throw new Error("There is no source with this ID");for(const b in this._layers)if(this._layers[b].source===c)return this.fire(new a.ErrorEvent(new Error(`Source "${c}" cannot be removed while layer "${b}" is using it.`)));const g=this.sourceCaches[c];delete this.sourceCaches[c],delete this._updatedSources[c],g.fire(new a.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:c})),g.setEventedParent(null),g.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(c,g){if(this._checkLoaded(),this.sourceCaches[c]===void 0)throw new Error(`There is no source with this ID=${c}`);const b=this.sourceCaches[c].getSource();if(b.type!=="geojson")throw new Error(`geojsonSource.type is ${b.type}, which is !== 'geojson`);b.setData(g),this._changed=!0}getSource(c){return this.sourceCaches[c]&&this.sourceCaches[c].getSource()}addLayer(c,g,b={}){this._checkLoaded();const E=c.id;if(this.getLayer(E))return void this.fire(new a.ErrorEvent(new Error(`Layer "${E}" already exists on this map.`)));let A;if(c.type==="custom"){if(Gn(this,a.validateCustomStyleLayer(c)))return;A=a.createStyleLayer(c)}else{if(typeof c.source=="object"&&(this.addSource(E,c.source),c=a.clone$1(c),c=a.extend(c,{source:E})),this._validate(a.validateStyle.layer,`layers.${E}`,c,{arrayIndex:-1},b))return;A=a.createStyleLayer(c),this._validateLayer(A),A.setEventedParent(this,{layer:{id:E}}),this._serializedLayers[A.id]=A.serialize()}const z=g?this._order.indexOf(g):this._order.length;if(g&&z===-1)this.fire(new a.ErrorEvent(new Error(`Cannot add layer "${E}" before non-existing layer "${g}".`)));else{if(this._order.splice(z,0,E),this._layerOrderChanged=!0,this._layers[E]=A,this._removedLayers[E]&&A.source&&A.type!=="custom"){const j=this._removedLayers[E];delete this._removedLayers[E],j.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(c,g){if(this._checkLoaded(),this._changed=!0,!this._layers[c])return void this.fire(new a.ErrorEvent(new Error(`The layer '${c}' does not exist in the map's style and cannot be moved.`)));if(c===g)return;const b=this._order.indexOf(c);this._order.splice(b,1);const E=g?this._order.indexOf(g):this._order.length;g&&E===-1?this.fire(new a.ErrorEvent(new Error(`Cannot move layer "${c}" before non-existing layer "${g}".`))):(this._order.splice(E,0,c),this._layerOrderChanged=!0)}removeLayer(c){this._checkLoaded();const g=this._layers[c];if(!g)return void this.fire(new a.ErrorEvent(new Error(`Cannot remove non-existing layer "${c}".`)));g.setEventedParent(null);const b=this._order.indexOf(c);this._order.splice(b,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[c]=g,delete this._layers[c],delete this._serializedLayers[c],delete this._updatedLayers[c],delete this._updatedPaintProps[c],g.onRemove&&g.onRemove(this.map)}getLayer(c){return this._layers[c]}hasLayer(c){return c in this._layers}setLayerZoomRange(c,g,b){this._checkLoaded();const E=this.getLayer(c);E?E.minzoom===g&&E.maxzoom===b||(g!=null&&(E.minzoom=g),b!=null&&(E.maxzoom=b),this._updateLayer(E)):this.fire(new a.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${c}".`)))}setFilter(c,g,b={}){this._checkLoaded();const E=this.getLayer(c);if(E){if(!m(E.filter,g))return g==null?(E.filter=void 0,void this._updateLayer(E)):void(this._validate(a.validateStyle.filter,`layers.${E.id}.filter`,g,null,b)||(E.filter=a.clone$1(g),this._updateLayer(E)))}else this.fire(new a.ErrorEvent(new Error(`Cannot filter non-existing layer "${c}".`)))}getFilter(c){return a.clone$1(this.getLayer(c).filter)}setLayoutProperty(c,g,b,E={}){this._checkLoaded();const A=this.getLayer(c);A?m(A.getLayoutProperty(g),b)||(A.setLayoutProperty(g,b,E),this._updateLayer(A)):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${c}".`)))}getLayoutProperty(c,g){const b=this.getLayer(c);if(b)return b.getLayoutProperty(g);this.fire(new a.ErrorEvent(new Error(`Cannot get style of non-existing layer "${c}".`)))}setPaintProperty(c,g,b,E={}){this._checkLoaded();const A=this.getLayer(c);A?m(A.getPaintProperty(g),b)||(A.setPaintProperty(g,b,E)&&this._updateLayer(A),this._changed=!0,this._updatedPaintProps[c]=!0):this.fire(new a.ErrorEvent(new Error(`Cannot style non-existing layer "${c}".`)))}getPaintProperty(c,g){return this.getLayer(c).getPaintProperty(g)}setFeatureState(c,g){this._checkLoaded();const b=c.source,E=c.sourceLayer,A=this.sourceCaches[b];if(A===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${b}' does not exist in the map's style.`)));const z=A.getSource().type;z==="geojson"&&E?this.fire(new a.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):z!=="vector"||E?(c.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),A.setFeatureState(E,c.id,g)):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(c,g){this._checkLoaded();const b=c.source,E=this.sourceCaches[b];if(E===void 0)return void this.fire(new a.ErrorEvent(new Error(`The source '${b}' does not exist in the map's style.`)));const A=E.getSource().type,z=A==="vector"?c.sourceLayer:void 0;A!=="vector"||z?g&&typeof c.id!="string"&&typeof c.id!="number"?this.fire(new a.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):E.removeFeatureState(z,c.id,g):this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(c){this._checkLoaded();const g=c.source,b=c.sourceLayer,E=this.sourceCaches[g];if(E!==void 0)return E.getSource().type!=="vector"||b?(c.id===void 0&&this.fire(new a.ErrorEvent(new Error("The feature id parameter must be provided."))),E.getFeatureState(b,c.id)):void this.fire(new a.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new a.ErrorEvent(new Error(`The source '${g}' does not exist in the map's style.`)))}getTransition(){return a.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return a.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:a.mapObject(this.sourceCaches,c=>c.serialize()),layers:this._serializeLayers(this._order)},c=>c!==void 0)}_updateLayer(c){this._updatedLayers[c.id]=!0,c.source&&!this._updatedSources[c.source]&&this.sourceCaches[c.source].getSource().type!=="raster"&&(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(c){const g=z=>this._layers[z].type==="fill-extrusion",b={},E=[];for(let z=this._order.length-1;z>=0;z--){const j=this._order[z];if(g(j)){b[j]=z;for(const K of c){const Y=K[j];if(Y)for(const ie of Y)E.push(ie)}}}E.sort((z,j)=>j.intersectionZ-z.intersectionZ);const A=[];for(let z=this._order.length-1;z>=0;z--){const j=this._order[z];if(g(j))for(let K=E.length-1;K>=0;K--){const Y=E[K].feature;if(b[Y.layer.id]{const It=je.featureSortOrder;if(It){const Ht=It.indexOf(ft.featureIndex);return It.indexOf(Et.featureIndex)-Ht}return Et.featureIndex-ft.featureIndex});for(const ft of vt)Oe.push(ft)}}for(const je in Re)Re[je].forEach(Xe=>{const st=Xe.feature,Oe=K[z[je].source].getFeatureState(st.layer["source-layer"],st.id);st.source=st.layer.source,st.layer["source-layer"]&&(st.sourceLayer=st.layer["source-layer"]),st.state=Oe});return Re}(this._layers,this._serializedLayers,this.sourceCaches,c,g,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(A)}querySourceFeatures(c,g){g&&g.filter&&this._validate(a.validateStyle.filter,"querySourceFeatures.filter",g.filter,null,g);const b=this.sourceCaches[c];return b?function(E,A){const z=E.getRenderableIds().map(Y=>E.getTileByID(Y)),j=[],K={};for(let Y=0;Yme.getTileByID(Re)).sort((Re,Se)=>Se.tileID.overscaledZ-Re.tileID.overscaledZ||(Re.tileID.isLessThan(Se.tileID)?-1:1))}const ue=this.crossTileSymbolIndex.addLayer(ie,K[ie.source],c.center.lng);z=z||ue}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((A=A||this._layerOrderChanged||b===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(a.exported.now(),c.zoom))&&(this.pauseablePlacement=new Ge(c,this.terrain,this._order,A,g,b,E,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,K),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(a.exported.now()),j=!0),z&&this.pauseablePlacement.placement.setStale()),j||z)for(const Y of this._order){const ie=this._layers[Y];ie.type==="symbol"&&this.placement.updateLayerOpacities(ie,K[ie.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(a.exported.now())}_releaseSymbolFadeTiles(){for(const c in this.sourceCaches)this.sourceCaches[c].releaseSymbolFadeTiles()}getImages(c,g,b){this.imageManager.getImages(g.icons,b),this._updateTilesForChangedImages();const E=this.sourceCaches[g.source];E&&E.setDependencies(g.tileID.key,g.type,g.icons)}getGlyphs(c,g,b){this.glyphManager.getGlyphs(g.stacks,b)}getResource(c,g,b){return a.makeRequest(g,b)}}Vr.getSourceType=function(C){return xe[C]},Vr.setSourceType=function(C,c){xe[C]=c},Vr.registerForPluginStateChange=a.registerForPluginStateChange;var Nn="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";const An={prelude:zn(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif`,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0 );}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;} #ifdef TERRAIN3D uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth; #endif const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration; #else return 0.0; #endif }`),background:zn(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:zn(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:zn(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=v_data.xy;float extrude_length=length(extrude);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=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:zn("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:zn(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:zn(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:zn("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,get_elevation(a_pos),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;}"),collisionCircle:zn("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:zn("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:zn(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:zn(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:zn(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:zn(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:zn(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+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;}`),fillExtrusionPattern:zn(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to; #ifdef TERRAIN3D float baseDelta=10.0;float ele=get_elevation(a_centroid); #else float baseDelta=0.0;float ele=0.0; #endif base=max(0.0,ele+base-baseDelta);height=max(0.0,ele+height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:zn(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:zn(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:zn(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:zn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:zn(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:zn(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:zn(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:zn(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;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),z,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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:zn(`#define SDF_PX 8.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;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:zn(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;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;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ? camera_to_anchor_distance/u_camera_to_center_distance : u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;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:zn("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",Nn),terrainDepth:zn("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);}",Nn),terrainCoords:zn("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);}",Nn)};function zn(C,c){const g=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,b=c.match(/attribute ([\w]+) ([\w]+)/g),E=C.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),A=c.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),z=A?A.concat(E):E,j={};return{fragmentSource:C=C.replace(g,(K,Y,ie,ue,me)=>(j[me]=!0,Y==="define"?` #ifndef HAS_UNIFORM_u_${me} varying ${ie} ${ue} ${me}; #else uniform ${ie} ${ue} u_${me}; #endif `:` #ifdef HAS_UNIFORM_u_${me} ${ie} ${ue} ${me} = u_${me}; #endif `)),vertexSource:c=c.replace(g,(K,Y,ie,ue,me)=>{const Re=ue==="float"?"vec2":"vec4",Se=me.match(/color/)?"color":Re;return j[me]?Y==="define"?` #ifndef HAS_UNIFORM_u_${me} uniform lowp float u_${me}_t; attribute ${ie} ${Re} a_${me}; varying ${ie} ${ue} ${me}; #else uniform ${ie} ${ue} u_${me}; #endif `:Se==="vec4"?` #ifndef HAS_UNIFORM_u_${me} ${me} = a_${me}; #else ${ie} ${ue} ${me} = u_${me}; #endif `:` #ifndef HAS_UNIFORM_u_${me} ${me} = unpack_mix_${Se}(a_${me}, u_${me}_t); #else ${ie} ${ue} ${me} = u_${me}; #endif `:Y==="define"?` #ifndef HAS_UNIFORM_u_${me} uniform lowp float u_${me}_t; attribute ${ie} ${Re} a_${me}; #else uniform ${ie} ${ue} u_${me}; #endif `:Se==="vec4"?` #ifndef HAS_UNIFORM_u_${me} ${ie} ${ue} ${me} = a_${me}; #else ${ie} ${ue} ${me} = u_${me}; #endif `:` #ifndef HAS_UNIFORM_u_${me} ${ie} ${ue} ${me} = unpack_mix_${Se}(a_${me}, u_${me}_t); #else ${ie} ${ue} ${me} = u_${me}; #endif `}),staticAttributes:b,staticUniforms:z}}class ri{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(c,g,b,E,A,z,j,K,Y){this.context=c;let ie=this.boundPaintVertexBuffers.length!==E.length;for(let ue=0;!ie&&ue({u_depth:new a.Uniform1i(It,Ht.u_depth),u_terrain:new a.Uniform1i(It,Ht.u_terrain),u_terrain_dim:new a.Uniform1f(It,Ht.u_terrain_dim),u_terrain_matrix:new a.UniformMatrix4f(It,Ht.u_terrain_matrix),u_terrain_unpack:new a.Uniform4f(It,Ht.u_terrain_unpack),u_terrain_offset:new a.Uniform1f(It,Ht.u_terrain_offset),u_terrain_exaggeration:new a.Uniform1f(It,Ht.u_terrain_exaggeration)}))(c,Et),this.binderUniforms=E?E.getUniforms(c,Et):[]}draw(c,g,b,E,A,z,j,K,Y,ie,ue,me,Re,Se,Ie,je,Xe,st){const Oe=c.gl;if(this.failedToCreate)return;if(c.program.set(this.program),c.setDepthMode(b),c.setStencilMode(E),c.setColorMode(A),c.setCullFace(z),K){c.activeTexture.set(Oe.TEXTURE2),Oe.bindTexture(Oe.TEXTURE_2D,K.depthTexture),c.activeTexture.set(Oe.TEXTURE3),Oe.bindTexture(Oe.TEXTURE_2D,K.texture);for(const ft in this.terrainUniforms)this.terrainUniforms[ft].set(K[ft])}for(const ft in this.fixedUniforms)this.fixedUniforms[ft].set(j[ft]);Ie&&Ie.setUniforms(c,this.binderUniforms,Re,{zoom:Se});let vt=0;switch(g){case Oe.LINES:vt=2;break;case Oe.TRIANGLES:vt=3;break;case Oe.LINE_STRIP:vt=1}for(const ft of me.get()){const Et=ft.vaos||(ft.vaos={});(Et[Y]||(Et[Y]=new ri)).bind(c,this,ie,Ie?Ie.getPaintVertexBuffers():[],ue,ft.vertexOffset,je,Xe,st),Oe.drawElements(g,ft.primitiveLength*vt,Oe.UNSIGNED_SHORT,ft.primitiveOffset*vt*2)}}}function Kn(C,c,g){const b=1/Bt(g,1,c.transform.tileZoom),E=Math.pow(2,g.tileID.overscaledZ),A=g.tileSize*Math.pow(2,c.transform.tileZoom)/E,z=A*(g.tileID.canonical.x+g.tileID.wrap*E),j=A*g.tileID.canonical.y;return{u_image:0,u_texsize:g.imageAtlasTexture.size,u_scale:[b,C.fromScale,C.toScale],u_fade:C.t,u_pixel_coord_upper:[z>>16,j>>16],u_pixel_coord_lower:[65535&z,65535&j]}}const or=(C,c,g,b)=>{const E=c.style.light,A=E.properties.get("position"),z=[A.x,A.y,A.z],j=a.create$1();E.properties.get("anchor")==="viewport"&&a.fromRotation(j,-c.transform.angle),a.transformMat3(z,z,j);const K=E.properties.get("color");return{u_matrix:C,u_lightpos:z,u_lightintensity:E.properties.get("intensity"),u_lightcolor:[K.r,K.g,K.b],u_vertical_gradient:+g,u_opacity:b}},Tr=(C,c,g,b,E,A,z)=>a.extend(or(C,c,g,b),Kn(A,c,z),{u_height_factor:-Math.pow(2,E.overscaledZ)/z.tileSize/8}),Mr=C=>({u_matrix:C}),Xr=(C,c,g,b)=>a.extend(Mr(C),Kn(g,c,b)),Oo=(C,c)=>({u_matrix:C,u_world:c}),Eu=(C,c,g,b,E)=>a.extend(Xr(C,c,g,b),{u_world:E}),Pf=(C,c,g,b)=>{const E=C.transform;let A,z;if(b.paint.get("circle-pitch-alignment")==="map"){const j=Bt(g,1,E.zoom);A=!0,z=[j,j]}else A=!1,z=E.pixelsToGLUnits;return{u_camera_to_center_distance:E.cameraToCenterDistance,u_scale_with_map:+(b.paint.get("circle-pitch-scale")==="map"),u_matrix:C.translatePosMatrix(c.posMatrix,g,b.paint.get("circle-translate"),b.paint.get("circle-translate-anchor")),u_pitch_with_map:+A,u_device_pixel_ratio:C.pixelRatio,u_extrude_scale:z}},xs=(C,c,g)=>{const b=Bt(g,1,c.zoom),E=Math.pow(2,c.zoom-g.tileID.overscaledZ),A=g.tileID.overscaleFactor();return{u_matrix:C,u_camera_to_center_distance:c.cameraToCenterDistance,u_pixels_to_tile_units:b,u_extrude_scale:[c.pixelsToGLUnits[0]/(b*E),c.pixelsToGLUnits[1]/(b*E)],u_overscale_factor:A}},Wn=(C,c,g=1)=>({u_matrix:C,u_color:c,u_overlay:0,u_overlay_scale:g}),rr=C=>({u_matrix:C}),Ur=(C,c,g,b)=>({u_matrix:C,u_extrude_scale:Bt(c,1,g),u_intensity:b});function Ui(C,c){const g=Math.pow(2,c.canonical.z),b=c.canonical.y;return[new a.MercatorCoordinate(0,b/g).toLngLat().lat,new a.MercatorCoordinate(0,(b+1)/g).toLngLat().lat]}const Gs=(C,c,g,b)=>{const E=C.transform;return{u_matrix:_s(C,c,g,b),u_ratio:1/Bt(c,1,E.zoom),u_device_pixel_ratio:C.pixelRatio,u_units_to_pixels:[1/E.pixelsToGLUnits[0],1/E.pixelsToGLUnits[1]]}},Jo=(C,c,g,b,E)=>a.extend(Gs(C,c,g,E),{u_image:0,u_image_height:b}),Rl=(C,c,g,b,E)=>{const A=C.transform,z=Pr(c,A);return{u_matrix:_s(C,c,g,E),u_texsize:c.imageAtlasTexture.size,u_ratio:1/Bt(c,1,A.zoom),u_device_pixel_ratio:C.pixelRatio,u_image:0,u_scale:[z,b.fromScale,b.toScale],u_fade:b.t,u_units_to_pixels:[1/A.pixelsToGLUnits[0],1/A.pixelsToGLUnits[1]]}},bs=(C,c,g,b,E,A)=>{const z=C.lineAtlas,j=Pr(c,C.transform),K=g.layout.get("line-cap")==="round",Y=z.getDash(b.from,K),ie=z.getDash(b.to,K),ue=Y.width*E.fromScale,me=ie.width*E.toScale;return a.extend(Gs(C,c,g,A),{u_patternscale_a:[j/ue,-Y.height/2],u_patternscale_b:[j/me,-ie.height/2],u_sdfgamma:z.width/(256*Math.min(ue,me)*C.pixelRatio)/2,u_image:0,u_tex_y_a:Y.y,u_tex_y_b:ie.y,u_mix:E.t})};function Pr(C,c){return 1/Bt(C,1,c.tileZoom)}function _s(C,c,g,b){return C.translatePosMatrix(b?b.posMatrix:c.tileID.posMatrix,c,g.paint.get("line-translate"),g.paint.get("line-translate-anchor"))}const w0=(C,c,g,b,E)=>{return{u_matrix:C,u_tl_parent:c,u_scale_parent:g,u_buffer_scale:1,u_fade_t:b.mix,u_opacity:b.opacity*E.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:E.paint.get("raster-brightness-min"),u_brightness_high:E.paint.get("raster-brightness-max"),u_saturation_factor:(z=E.paint.get("raster-saturation"),z>0?1-1/(1.001-z):-z),u_contrast_factor:(A=E.paint.get("raster-contrast"),A>0?1/(1-A):1+A),u_spin_weights:C0(E.paint.get("raster-hue-rotate"))};var A,z};function C0(C){C*=Math.PI/180;const c=Math.sin(C),g=Math.cos(C);return[(2*g+1)/3,(-Math.sqrt(3)*c-g+1)/3,(Math.sqrt(3)*c-g+1)/3]}const Np=(C,c,g,b,E,A,z,j,K,Y)=>{const ie=E.transform;return{u_is_size_zoom_constant:+(C==="constant"||C==="source"),u_is_size_feature_constant:+(C==="constant"||C==="camera"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:ie.cameraToCenterDistance,u_pitch:ie.pitch/360*2*Math.PI,u_rotate_symbol:+g,u_aspect_ratio:ie.width/ie.height,u_fade_change:E.options.fadeDuration?E.symbolFadeChange:1,u_matrix:A,u_label_plane_matrix:z,u_coord_matrix:j,u_is_text:+K,u_pitch_with_map:+b,u_texsize:Y,u_texture:0}},If=(C,c,g,b,E,A,z,j,K,Y,ie)=>{const ue=E.transform;return a.extend(Np(C,c,g,b,E,A,z,j,K,Y),{u_gamma_scale:b?Math.cos(ue._pitch)*ue.cameraToCenterDistance:1,u_device_pixel_ratio:E.pixelRatio,u_is_halo:+ie})},S0=(C,c,g,b,E,A,z,j,K,Y)=>a.extend(If(C,c,g,b,E,A,z,j,!0,K,!0),{u_texsize_icon:Y,u_texture_icon:1}),Iw=(C,c,g)=>({u_matrix:C,u_opacity:c,u_color:g}),Tw=(C,c,g,b,E,A)=>a.extend(function(z,j,K,Y){const ie=K.imageManager.getPattern(z.from.toString()),ue=K.imageManager.getPattern(z.to.toString()),{width:me,height:Re}=K.imageManager.getPixelSize(),Se=Math.pow(2,Y.tileID.overscaledZ),Ie=Y.tileSize*Math.pow(2,K.transform.tileZoom)/Se,je=Ie*(Y.tileID.canonical.x+Y.tileID.wrap*Se),Xe=Ie*Y.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:ie.tl,u_pattern_br_a:ie.br,u_pattern_tl_b:ue.tl,u_pattern_br_b:ue.br,u_texsize:[me,Re],u_mix:j.t,u_pattern_size_a:ie.displaySize,u_pattern_size_b:ue.displaySize,u_scale_a:j.fromScale,u_scale_b:j.toScale,u_tile_units_to_pixels:1/Bt(Y,1,K.transform.tileZoom),u_pixel_coord_upper:[je>>16,Xe>>16],u_pixel_coord_lower:[65535&je,65535&Xe]}}(b,A,g,E),{u_matrix:C,u_opacity:c}),Lp={fillExtrusion:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_lightpos:new a.Uniform3f(C,c.u_lightpos),u_lightintensity:new a.Uniform1f(C,c.u_lightintensity),u_lightcolor:new a.Uniform3f(C,c.u_lightcolor),u_vertical_gradient:new a.Uniform1f(C,c.u_vertical_gradient),u_opacity:new a.Uniform1f(C,c.u_opacity)}),fillExtrusionPattern:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_lightpos:new a.Uniform3f(C,c.u_lightpos),u_lightintensity:new a.Uniform1f(C,c.u_lightintensity),u_lightcolor:new a.Uniform3f(C,c.u_lightcolor),u_vertical_gradient:new a.Uniform1f(C,c.u_vertical_gradient),u_height_factor:new a.Uniform1f(C,c.u_height_factor),u_image:new a.Uniform1i(C,c.u_image),u_texsize:new a.Uniform2f(C,c.u_texsize),u_pixel_coord_upper:new a.Uniform2f(C,c.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(C,c.u_pixel_coord_lower),u_scale:new a.Uniform3f(C,c.u_scale),u_fade:new a.Uniform1f(C,c.u_fade),u_opacity:new a.Uniform1f(C,c.u_opacity)}),fill:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix)}),fillPattern:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_image:new a.Uniform1i(C,c.u_image),u_texsize:new a.Uniform2f(C,c.u_texsize),u_pixel_coord_upper:new a.Uniform2f(C,c.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(C,c.u_pixel_coord_lower),u_scale:new a.Uniform3f(C,c.u_scale),u_fade:new a.Uniform1f(C,c.u_fade)}),fillOutline:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_world:new a.Uniform2f(C,c.u_world)}),fillOutlinePattern:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_world:new a.Uniform2f(C,c.u_world),u_image:new a.Uniform1i(C,c.u_image),u_texsize:new a.Uniform2f(C,c.u_texsize),u_pixel_coord_upper:new a.Uniform2f(C,c.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(C,c.u_pixel_coord_lower),u_scale:new a.Uniform3f(C,c.u_scale),u_fade:new a.Uniform1f(C,c.u_fade)}),circle:(C,c)=>({u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_scale_with_map:new a.Uniform1i(C,c.u_scale_with_map),u_pitch_with_map:new a.Uniform1i(C,c.u_pitch_with_map),u_extrude_scale:new a.Uniform2f(C,c.u_extrude_scale),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_matrix:new a.UniformMatrix4f(C,c.u_matrix)}),collisionBox:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_pixels_to_tile_units:new a.Uniform1f(C,c.u_pixels_to_tile_units),u_extrude_scale:new a.Uniform2f(C,c.u_extrude_scale),u_overscale_factor:new a.Uniform1f(C,c.u_overscale_factor)}),collisionCircle:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_inv_matrix:new a.UniformMatrix4f(C,c.u_inv_matrix),u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_viewport_size:new a.Uniform2f(C,c.u_viewport_size)}),debug:(C,c)=>({u_color:new a.UniformColor(C,c.u_color),u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_overlay:new a.Uniform1i(C,c.u_overlay),u_overlay_scale:new a.Uniform1f(C,c.u_overlay_scale)}),clippingMask:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix)}),heatmap:(C,c)=>({u_extrude_scale:new a.Uniform1f(C,c.u_extrude_scale),u_intensity:new a.Uniform1f(C,c.u_intensity),u_matrix:new a.UniformMatrix4f(C,c.u_matrix)}),heatmapTexture:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_world:new a.Uniform2f(C,c.u_world),u_image:new a.Uniform1i(C,c.u_image),u_color_ramp:new a.Uniform1i(C,c.u_color_ramp),u_opacity:new a.Uniform1f(C,c.u_opacity)}),hillshade:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_image:new a.Uniform1i(C,c.u_image),u_latrange:new a.Uniform2f(C,c.u_latrange),u_light:new a.Uniform2f(C,c.u_light),u_shadow:new a.UniformColor(C,c.u_shadow),u_highlight:new a.UniformColor(C,c.u_highlight),u_accent:new a.UniformColor(C,c.u_accent)}),hillshadePrepare:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_image:new a.Uniform1i(C,c.u_image),u_dimension:new a.Uniform2f(C,c.u_dimension),u_zoom:new a.Uniform1f(C,c.u_zoom),u_unpack:new a.Uniform4f(C,c.u_unpack)}),line:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_ratio:new a.Uniform1f(C,c.u_ratio),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(C,c.u_units_to_pixels)}),lineGradient:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_ratio:new a.Uniform1f(C,c.u_ratio),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(C,c.u_units_to_pixels),u_image:new a.Uniform1i(C,c.u_image),u_image_height:new a.Uniform1f(C,c.u_image_height)}),linePattern:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_texsize:new a.Uniform2f(C,c.u_texsize),u_ratio:new a.Uniform1f(C,c.u_ratio),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_image:new a.Uniform1i(C,c.u_image),u_units_to_pixels:new a.Uniform2f(C,c.u_units_to_pixels),u_scale:new a.Uniform3f(C,c.u_scale),u_fade:new a.Uniform1f(C,c.u_fade)}),lineSDF:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_ratio:new a.Uniform1f(C,c.u_ratio),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_units_to_pixels:new a.Uniform2f(C,c.u_units_to_pixels),u_patternscale_a:new a.Uniform2f(C,c.u_patternscale_a),u_patternscale_b:new a.Uniform2f(C,c.u_patternscale_b),u_sdfgamma:new a.Uniform1f(C,c.u_sdfgamma),u_image:new a.Uniform1i(C,c.u_image),u_tex_y_a:new a.Uniform1f(C,c.u_tex_y_a),u_tex_y_b:new a.Uniform1f(C,c.u_tex_y_b),u_mix:new a.Uniform1f(C,c.u_mix)}),raster:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_tl_parent:new a.Uniform2f(C,c.u_tl_parent),u_scale_parent:new a.Uniform1f(C,c.u_scale_parent),u_buffer_scale:new a.Uniform1f(C,c.u_buffer_scale),u_fade_t:new a.Uniform1f(C,c.u_fade_t),u_opacity:new a.Uniform1f(C,c.u_opacity),u_image0:new a.Uniform1i(C,c.u_image0),u_image1:new a.Uniform1i(C,c.u_image1),u_brightness_low:new a.Uniform1f(C,c.u_brightness_low),u_brightness_high:new a.Uniform1f(C,c.u_brightness_high),u_saturation_factor:new a.Uniform1f(C,c.u_saturation_factor),u_contrast_factor:new a.Uniform1f(C,c.u_contrast_factor),u_spin_weights:new a.Uniform3f(C,c.u_spin_weights)}),symbolIcon:(C,c)=>({u_is_size_zoom_constant:new a.Uniform1i(C,c.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(C,c.u_is_size_feature_constant),u_size_t:new a.Uniform1f(C,c.u_size_t),u_size:new a.Uniform1f(C,c.u_size),u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_pitch:new a.Uniform1f(C,c.u_pitch),u_rotate_symbol:new a.Uniform1i(C,c.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(C,c.u_aspect_ratio),u_fade_change:new a.Uniform1f(C,c.u_fade_change),u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(C,c.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(C,c.u_coord_matrix),u_is_text:new a.Uniform1i(C,c.u_is_text),u_pitch_with_map:new a.Uniform1i(C,c.u_pitch_with_map),u_texsize:new a.Uniform2f(C,c.u_texsize),u_texture:new a.Uniform1i(C,c.u_texture)}),symbolSDF:(C,c)=>({u_is_size_zoom_constant:new a.Uniform1i(C,c.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(C,c.u_is_size_feature_constant),u_size_t:new a.Uniform1f(C,c.u_size_t),u_size:new a.Uniform1f(C,c.u_size),u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_pitch:new a.Uniform1f(C,c.u_pitch),u_rotate_symbol:new a.Uniform1i(C,c.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(C,c.u_aspect_ratio),u_fade_change:new a.Uniform1f(C,c.u_fade_change),u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(C,c.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(C,c.u_coord_matrix),u_is_text:new a.Uniform1i(C,c.u_is_text),u_pitch_with_map:new a.Uniform1i(C,c.u_pitch_with_map),u_texsize:new a.Uniform2f(C,c.u_texsize),u_texture:new a.Uniform1i(C,c.u_texture),u_gamma_scale:new a.Uniform1f(C,c.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(C,c.u_is_halo)}),symbolTextAndIcon:(C,c)=>({u_is_size_zoom_constant:new a.Uniform1i(C,c.u_is_size_zoom_constant),u_is_size_feature_constant:new a.Uniform1i(C,c.u_is_size_feature_constant),u_size_t:new a.Uniform1f(C,c.u_size_t),u_size:new a.Uniform1f(C,c.u_size),u_camera_to_center_distance:new a.Uniform1f(C,c.u_camera_to_center_distance),u_pitch:new a.Uniform1f(C,c.u_pitch),u_rotate_symbol:new a.Uniform1i(C,c.u_rotate_symbol),u_aspect_ratio:new a.Uniform1f(C,c.u_aspect_ratio),u_fade_change:new a.Uniform1f(C,c.u_fade_change),u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_label_plane_matrix:new a.UniformMatrix4f(C,c.u_label_plane_matrix),u_coord_matrix:new a.UniformMatrix4f(C,c.u_coord_matrix),u_is_text:new a.Uniform1i(C,c.u_is_text),u_pitch_with_map:new a.Uniform1i(C,c.u_pitch_with_map),u_texsize:new a.Uniform2f(C,c.u_texsize),u_texsize_icon:new a.Uniform2f(C,c.u_texsize_icon),u_texture:new a.Uniform1i(C,c.u_texture),u_texture_icon:new a.Uniform1i(C,c.u_texture_icon),u_gamma_scale:new a.Uniform1f(C,c.u_gamma_scale),u_device_pixel_ratio:new a.Uniform1f(C,c.u_device_pixel_ratio),u_is_halo:new a.Uniform1i(C,c.u_is_halo)}),background:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_opacity:new a.Uniform1f(C,c.u_opacity),u_color:new a.UniformColor(C,c.u_color)}),backgroundPattern:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_opacity:new a.Uniform1f(C,c.u_opacity),u_image:new a.Uniform1i(C,c.u_image),u_pattern_tl_a:new a.Uniform2f(C,c.u_pattern_tl_a),u_pattern_br_a:new a.Uniform2f(C,c.u_pattern_br_a),u_pattern_tl_b:new a.Uniform2f(C,c.u_pattern_tl_b),u_pattern_br_b:new a.Uniform2f(C,c.u_pattern_br_b),u_texsize:new a.Uniform2f(C,c.u_texsize),u_mix:new a.Uniform1f(C,c.u_mix),u_pattern_size_a:new a.Uniform2f(C,c.u_pattern_size_a),u_pattern_size_b:new a.Uniform2f(C,c.u_pattern_size_b),u_scale_a:new a.Uniform1f(C,c.u_scale_a),u_scale_b:new a.Uniform1f(C,c.u_scale_b),u_pixel_coord_upper:new a.Uniform2f(C,c.u_pixel_coord_upper),u_pixel_coord_lower:new a.Uniform2f(C,c.u_pixel_coord_lower),u_tile_units_to_pixels:new a.Uniform1f(C,c.u_tile_units_to_pixels)}),terrain:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_texture:new a.Uniform1i(C,c.u_texture)}),terrainDepth:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix)}),terrainCoords:(C,c)=>({u_matrix:new a.UniformMatrix4f(C,c.u_matrix),u_texture:new a.Uniform1i(C,c.u_texture),u_terrain_coords_id:new a.Uniform1f(C,c.u_terrain_coords_id)})};class Fp{constructor(c,g,b){this.context=c;const E=c.gl;this.buffer=E.createBuffer(),this.dynamicDraw=Boolean(b),this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),E.bufferData(E.ELEMENT_ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?E.DYNAMIC_DRAW:E.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){const g=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),g.bufferSubData(g.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const zp={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class $p{constructor(c,g,b,E){this.length=g.length,this.attributes=b,this.itemSize=g.bytesPerElement,this.dynamicDraw=E,this.context=c;const A=c.gl;this.buffer=A.createBuffer(),c.bindVertexBuffer.set(this.buffer),A.bufferData(A.ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?A.DYNAMIC_DRAW:A.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){if(c.length!==this.length)throw new Error(`Length of new data is ${c.length}, which doesn't match current length of ${this.length}`);const g=this.context.gl;this.bind(),g.bufferSubData(g.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,g){for(let b=0;b0){const fn=a.create(),rn=It;a.mul(fn,Et.placementInvProjMatrix,C.transform.glCoordMatrix),a.mul(fn,fn,Et.placementViewportMatrix),ie.push({circleArray:Ct,circleOffset:me,transform:rn,invTransform:fn,coord:vt}),ue+=Ct.length/4,me=ue}Ht&&Y.draw(j,K.LINES,ir.disabled,Rr.disabled,C.colorModeForRenderPass(),jr.disabled,xs(It,C.transform,ft),C.style.terrain&&C.style.terrain.getTerrainData(vt),g.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,null,C.transform.zoom,null,null,Ht.collisionVertexBuffer)}if(!z||!ie.length)return;const Re=C.useProgram("collisionCircle"),Se=new a.CollisionCircleLayoutArray;Se.resize(4*ue),Se._trim();let Ie=0;for(const Oe of ie)for(let vt=0;vt=0&&(Se[je.associatedIconIndex]={shiftedAnchor:Hn,angle:qn})}else ht(je.numGlyphs,me)}if(Y){Re.clear();const Ie=C.icon.placedSymbolArray;for(let je=0;jeC.style.terrain.getElevation(Ht,lm,Nu):null,Ll=g.layout.get("text-rotation-alignment")==="map";Qt(fn,Ht.posMatrix,C,E,ta,bo,je,Y,Ll,na)}const Si=C.translatePosMatrix(Ht.posMatrix,Ct,A,z),Jn=Xe||E&&Et||Uf?Lw:ta,gr=C.translatePosMatrix(bo,Ct,A,z,!0),Ai=Hn&&g.paint.get(E?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Di;Di=Hn?fn.iconsInText?S0(qn.kind,yr,st,je,C,Si,Jn,gr,ur,xa):If(qn.kind,yr,st,je,C,Si,Jn,gr,E,ur,!0):Np(qn.kind,yr,st,je,C,Si,Jn,gr,E,ur);const Kr={program:vr,buffers:rn,uniformValues:Di,atlasTexture:Cr,atlasTextureIcon:Wa,atlasInterpolation:Ri,atlasInterpolationIcon:Ka,isSDF:Hn,hasHalo:Ai};if(Oe&&fn.canOverlap){vt=!0;const na=rn.segments.get();for(const Ll of na)It.push({segments:new a.SegmentVector([Ll]),sortKey:Ll.sortKey,state:Kr,terrainData:sr})}else It.push({segments:rn.segments,sortKey:0,state:Kr,terrainData:sr})}vt&&It.sort((Ht,Ct)=>Ht.sortKey-Ct.sortKey);for(const Ht of It){const Ct=Ht.state;if(me.activeTexture.set(Re.TEXTURE0),Ct.atlasTexture.bind(Ct.atlasInterpolation,Re.CLAMP_TO_EDGE),Ct.atlasTextureIcon&&(me.activeTexture.set(Re.TEXTURE1),Ct.atlasTextureIcon&&Ct.atlasTextureIcon.bind(Ct.atlasInterpolationIcon,Re.CLAMP_TO_EDGE)),Ct.isSDF){const fn=Ct.uniformValues;Ct.hasHalo&&(fn.u_is_halo=1,Kc(Ct.buffers,Ht.segments,g,C,Ct.program,ft,ie,ue,fn,Ht.terrainData)),fn.u_is_halo=0}Kc(Ct.buffers,Ht.segments,g,C,Ct.program,ft,ie,ue,Ct.uniformValues,Ht.terrainData)}}function Kc(C,c,g,b,E,A,z,j,K,Y){const ie=b.context;E.draw(ie,ie.gl.TRIANGLES,A,z,j,jr.disabled,K,Y,g.id,C.layoutVertexBuffer,C.indexBuffer,c,g.paint,b.transform.zoom,C.programConfigurations.get(g.id),C.dynamicLayoutVertexBuffer,C.opacityVertexBuffer)}function Wc(C,c,g,b,E,A,z){const j=C.context.gl,K=g.paint.get("fill-pattern"),Y=K&&K.constantOr(1),ie=g.getCrossfadeParameters();let ue,me,Re,Se,Ie;z?(me=Y&&!g.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ue=j.LINES):(me=Y?"fillPattern":"fill",ue=j.TRIANGLES);for(const je of b){const Xe=c.getTile(je);if(Y&&!Xe.patternsLoaded())continue;const st=Xe.getBucket(g);if(!st)continue;const Oe=st.programConfigurations.get(g.id),vt=C.useProgram(me,Oe),ft=C.style.terrain&&C.style.terrain.getTerrainData(je);Y&&(C.context.activeTexture.set(j.TEXTURE0),Xe.imageAtlasTexture.bind(j.LINEAR,j.CLAMP_TO_EDGE),Oe.updatePaintBuffers(ie));const Et=K.constantOr(null);if(Et&&Xe.imageAtlas){const Ct=Xe.imageAtlas,fn=Ct.patternPositions[Et.to.toString()],rn=Ct.patternPositions[Et.from.toString()];fn&&rn&&Oe.setConstantPatternPositions(fn,rn)}const It=ft?je:null,Ht=C.translatePosMatrix(It?It.posMatrix:je.posMatrix,Xe,g.paint.get("fill-translate"),g.paint.get("fill-translate-anchor"));if(z){Se=st.indexBuffer2,Ie=st.segments2;const Ct=[j.drawingBufferWidth,j.drawingBufferHeight];Re=me==="fillOutlinePattern"&&Y?Eu(Ht,C,ie,Xe,Ct):Oo(Ht,Ct)}else Se=st.indexBuffer,Ie=st.segments,Re=Y?Xr(Ht,C,ie,Xe):Mr(Ht);vt.draw(C.context,ue,E,C.stencilModeForClipping(je),A,jr.disabled,Re,ft,g.id,st.layoutVertexBuffer,Se,Ie,g.paint,C.transform.zoom,Oe)}}function Gc(C,c,g,b,E,A,z){const j=C.context,K=j.gl,Y=g.paint.get("fill-extrusion-pattern"),ie=Y.constantOr(1),ue=g.getCrossfadeParameters(),me=g.paint.get("fill-extrusion-opacity");for(const Re of b){const Se=c.getTile(Re),Ie=Se.getBucket(g);if(!Ie)continue;const je=C.style.terrain&&C.style.terrain.getTerrainData(Re),Xe=Ie.programConfigurations.get(g.id),st=C.useProgram(ie?"fillExtrusionPattern":"fillExtrusion",Xe);ie&&(C.context.activeTexture.set(K.TEXTURE0),Se.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),Xe.updatePaintBuffers(ue));const Oe=Y.constantOr(null);if(Oe&&Se.imageAtlas){const It=Se.imageAtlas,Ht=It.patternPositions[Oe.to.toString()],Ct=It.patternPositions[Oe.from.toString()];Ht&&Ct&&Xe.setConstantPatternPositions(Ht,Ct)}const vt=C.translatePosMatrix(Re.posMatrix,Se,g.paint.get("fill-extrusion-translate"),g.paint.get("fill-extrusion-translate-anchor")),ft=g.paint.get("fill-extrusion-vertical-gradient"),Et=ie?Tr(vt,C,ft,me,Re,ue,Se):or(vt,C,ft,me);st.draw(j,j.gl.TRIANGLES,E,A,z,jr.backCCW,Et,je,g.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,g.paint,C.transform.zoom,Xe,C.style.terrain&&Ie.centroidVertexBuffer)}}function qp(C,c,g,b,E,A,z){const j=C.context,K=j.gl,Y=g.fbo;if(!Y)return;const ie=C.useProgram("hillshade"),ue=C.style.terrain&&C.style.terrain.getTerrainData(c);j.activeTexture.set(K.TEXTURE0),K.bindTexture(K.TEXTURE_2D,Y.colorAttachment.get()),ie.draw(j,K.TRIANGLES,E,A,z,jr.disabled,((me,Re,Se,Ie)=>{const je=Se.paint.get("hillshade-shadow-color"),Xe=Se.paint.get("hillshade-highlight-color"),st=Se.paint.get("hillshade-accent-color");let Oe=Se.paint.get("hillshade-illumination-direction")*(Math.PI/180);Se.paint.get("hillshade-illumination-anchor")==="viewport"&&(Oe-=me.transform.angle);const vt=!me.options.moving;return{u_matrix:Ie?Ie.posMatrix:me.transform.calculatePosMatrix(Re.tileID.toUnwrapped(),vt),u_image:0,u_latrange:Ui(0,Re.tileID),u_light:[Se.paint.get("hillshade-exaggeration"),Oe],u_shadow:je,u_highlight:Xe,u_accent:st}})(C,g,b,ue?c:null),ue,b.id,C.rasterBoundsBuffer,C.quadTriangleIndexBuffer,C.rasterBoundsSegments)}function O0(C,c,g,b,E,A){const z=C.context,j=z.gl,K=c.dem;if(K&&K.data){const Y=K.dim,ie=K.stride,ue=K.getPixels();if(z.activeTexture.set(j.TEXTURE1),z.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture=c.demTexture||C.getTileTexture(ie),c.demTexture){const Re=c.demTexture;Re.update(ue,{premultiply:!1}),Re.bind(j.NEAREST,j.CLAMP_TO_EDGE)}else c.demTexture=new P(z,ue,j.RGBA,{premultiply:!1}),c.demTexture.bind(j.NEAREST,j.CLAMP_TO_EDGE);z.activeTexture.set(j.TEXTURE0);let me=c.fbo;if(!me){const Re=new P(z,{width:Y,height:Y,data:null},j.RGBA);Re.bind(j.LINEAR,j.CLAMP_TO_EDGE),me=c.fbo=z.createFramebuffer(Y,Y,!0),me.colorAttachment.set(Re.texture)}z.bindFramebuffer.set(me.framebuffer),z.viewport.set([0,0,Y,Y]),C.useProgram("hillshadePrepare").draw(z,j.TRIANGLES,b,E,A,jr.disabled,((Re,Se)=>{const Ie=Se.stride,je=a.create();return a.ortho(je,0,a.EXTENT,-a.EXTENT,0,0,1),a.translate(je,je,[0,-a.EXTENT,0]),{u_matrix:je,u_image:1,u_dimension:[Ie,Ie],u_zoom:Re.overscaledZ,u_unpack:Se.getUnpackVector()}})(c.tileID,K),null,g.id,C.rasterBoundsBuffer,C.quadTriangleIndexBuffer,C.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function Nf(C,c,g,b,E,A){const z=b.paint.get("raster-fade-duration");if(!A&&z>0){const j=a.exported.now(),K=(j-C.timeAdded)/z,Y=c?(j-c.timeAdded)/z:-1,ie=g.getSource(),ue=E.coveringZoomLevel({tileSize:ie.tileSize,roundZoom:ie.roundZoom}),me=!c||Math.abs(c.tileID.overscaledZ-ue)>Math.abs(C.tileID.overscaledZ-ue),Re=me&&C.refreshedUponExpiration?1:a.clamp(me?K:1-Y,0,1);return C.refreshedUponExpiration&&K>=1&&(C.refreshedUponExpiration=!1),c?{opacity:1,mix:1-Re}:{opacity:Re,mix:0}}return{opacity:1,mix:0}}const Lf=new a.Color(1,0,0,1),ya=new a.Color(0,1,0,1),N0=new a.Color(0,0,1,1),Zp=new a.Color(1,0,1,1),L0=new a.Color(0,1,1,1);function Dl(C,c,g,b){Mu(C,0,c+g/2,C.transform.width,g,b)}function qc(C,c,g,b){Mu(C,c-g/2,0,g,C.transform.height,b)}function Mu(C,c,g,b,E,A){const z=C.context,j=z.gl;j.enable(j.SCISSOR_TEST),j.scissor(c*C.pixelRatio,g*C.pixelRatio,b*C.pixelRatio,E*C.pixelRatio),z.clear({color:A}),j.disable(j.SCISSOR_TEST)}function $w(C,c,g){const b=C.context,E=b.gl,A=g.posMatrix,z=C.useProgram("debug"),j=ir.disabled,K=Rr.disabled,Y=C.colorModeForRenderPass(),ie="$debug",ue=C.style.terrain&&C.style.terrain.getTerrainData(g);b.activeTexture.set(E.TEXTURE0),C.emptyTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE);const me=c.getTileByID(g.key).latestRawTileData,Re=Math.floor((me&&me.byteLength||0)/1024),Se=c.getTile(g).tileSize,Ie=512/Math.min(Se,512)*(g.overscaledZ/C.transform.zoom)*.5;let je=g.canonical.toString();g.overscaledZ!==g.canonical.z&&(je+=` => ${g.overscaledZ}`),function(Xe,st){Xe.initDebugOverlayCanvas();const Oe=Xe.debugOverlayCanvas,vt=Xe.context.gl,ft=Xe.debugOverlayCanvas.getContext("2d");ft.clearRect(0,0,Oe.width,Oe.height),ft.shadowColor="white",ft.shadowBlur=2,ft.lineWidth=1.5,ft.strokeStyle="white",ft.textBaseline="top",ft.font="bold 36px Open Sans, sans-serif",ft.fillText(st,5,5),ft.strokeText(st,5,5),Xe.debugOverlayTexture.update(Oe),Xe.debugOverlayTexture.bind(vt.LINEAR,vt.CLAMP_TO_EDGE)}(C,`${je} ${Re}kB`),z.draw(b,E.TRIANGLES,j,K,zr.alphaBlended,jr.disabled,Wn(A,a.Color.transparent,Ie),null,ie,C.debugBuffer,C.quadTriangleIndexBuffer,C.debugSegments),z.draw(b,E.LINE_STRIP,j,K,Y,jr.disabled,Wn(A,a.Color.red),ue,ie,C.debugBuffer,C.tileBorderIndexBuffer,C.debugSegments)}function Ff(C,c,g){const b=C.context,E=b.gl,A=C.colorModeForRenderPass(),z=new ir(E.LEQUAL,ir.ReadWrite,C.depthRangeFor3D),j=C.useProgram("terrain"),K=c.getTerrainMesh(),Y=c.getTerrainData(g.tileID);b.bindFramebuffer.set(null),b.viewport.set([0,0,C.width,C.height]),b.activeTexture.set(E.TEXTURE0),E.bindTexture(E.TEXTURE_2D,c.getRTTFramebuffer().colorAttachment.get());const ie=C.transform.calculatePosMatrix(g.tileID.toUnwrapped());j.draw(b,E.TRIANGLES,z,Rr.disabled,A,jr.backCCW,{u_matrix:ie,u_texture:0},Y,"terrain",K.vertexBuffer,K.indexBuffer,K.segments)}function F0(C,c,g,b){const E=C.context,A=g.tileSize*c.qualityFactor;g.textures[b]||(g.textures[b]=C.getTileTexture(A)||new P(E,{width:A,height:A,data:null},E.gl.RGBA),g.textures[b].bind(E.gl.LINEAR,E.gl.CLAMP_TO_EDGE),b===0&&c.sourceCache.renderHistory.unshift(g.tileID.key));const z=c.getRTTFramebuffer();z.colorAttachment.set(g.textures[b].texture),E.bindFramebuffer.set(z.framebuffer),E.viewport.set([0,0,A,A])}class z0{constructor(c){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=c,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=c.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const c=this.painter.style,g=c.terrain;for(const b in c.sourceCaches){this._coordsDescendingInv[b]={};const E=c.sourceCaches[b].getVisibleCoordinates();for(const A of E){const z=g.sourceCache.getTerrainCoords(A);for(const j in z)this._coordsDescendingInv[b][j]||(this._coordsDescendingInv[b][j]=[]),this._coordsDescendingInv[b][j].push(z[j])}}for(const b of c._order){const E=c._layers[b],A=E.source;if(this._renderToTexture[E.type]&&!this._coordsDescendingInvStr[A]){this._coordsDescendingInvStr[A]={};for(const z in this._coordsDescendingInv[A])this._coordsDescendingInvStr[A][z]=this._coordsDescendingInv[A][z].map(j=>j.key).sort().join()}}return this._renderableTiles.forEach(b=>{for(const E in this._coordsDescendingInvStr){const A=this._coordsDescendingInvStr[E][b.tileID.key];A&&A!==b.textureCoords[E]&&b.clearTextures(this.painter),g.needsRerender(E,b.tileID)&&b.clearTextures(this.painter)}this._rerender[b.tileID.key]=!b.textures.length}),g.clearRerenderCache(),g.sourceCache.removeOutdated(this.painter),this}renderLayer(c){const g=c.type,b=this.painter,E=b.style._order,A=b.currentLayer,z=A+1===E.length;if(this._renderToTexture[g]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=g,this._stacks[this._stacks.length-1].push(E[A]),!z))return!0;if(this._renderToTexture[this._prevType]||g==="hillshade"||this._renderToTexture[g]&&z){this._prevType=g;const j=this._stacks.length-1,K=this._stacks[j]||[];for(const Y of this._renderableTiles){if(F0(b,b.style.terrain,Y,j),this._rerender[Y.tileID.key]){b.context.clear({color:a.Color.transparent});for(let ie=0;ieK.style.terrain.getElevation(Xe,Ct,fn):null)}}}(b,C,g,c,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),E),g.paint.get("icon-opacity").constantOr(1)!==0&&Of(C,c,g,b,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),A,z),g.paint.get("text-opacity").constantOr(1)!==0&&Of(C,c,g,b,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),A,z),c.map.showCollisionBoxes&&(ku(C,c,g,b,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),ku(C,c,g,b,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))},circle:function(C,c,g,b){if(C.renderPass!=="translucent")return;const E=g.paint.get("circle-opacity"),A=g.paint.get("circle-stroke-width"),z=g.paint.get("circle-stroke-opacity"),j=!g.layout.get("circle-sort-key").isConstant();if(E.constantOr(1)===0&&(A.constantOr(1)===0||z.constantOr(1)===0))return;const K=C.context,Y=K.gl,ie=C.depthModeForSublayer(0,ir.ReadOnly),ue=Rr.disabled,me=C.colorModeForRenderPass(),Re=[];for(let Se=0;SeSe.sortKey-Ie.sortKey);for(const Se of Re){const{programConfiguration:Ie,program:je,layoutVertexBuffer:Xe,indexBuffer:st,uniformValues:Oe,terrainData:vt}=Se.state;je.draw(K,Y.TRIANGLES,ie,ue,me,jr.disabled,Oe,vt,g.id,Xe,st,Se.segments,g.paint,C.transform.zoom,Ie)}},heatmap:function(C,c,g,b){if(g.paint.get("heatmap-opacity")!==0)if(C.renderPass==="offscreen"){const E=C.context,A=E.gl,z=Rr.disabled,j=new zr([A.ONE,A.ONE],a.Color.transparent,[!0,!0,!0,!0]);(function(K,Y,ie){const ue=K.gl;K.activeTexture.set(ue.TEXTURE1),K.viewport.set([0,0,Y.width/4,Y.height/4]);let me=ie.heatmapFbo;if(me)ue.bindTexture(ue.TEXTURE_2D,me.colorAttachment.get()),K.bindFramebuffer.set(me.framebuffer);else{const Re=ue.createTexture();ue.bindTexture(ue.TEXTURE_2D,Re),ue.texParameteri(ue.TEXTURE_2D,ue.TEXTURE_WRAP_S,ue.CLAMP_TO_EDGE),ue.texParameteri(ue.TEXTURE_2D,ue.TEXTURE_WRAP_T,ue.CLAMP_TO_EDGE),ue.texParameteri(ue.TEXTURE_2D,ue.TEXTURE_MIN_FILTER,ue.LINEAR),ue.texParameteri(ue.TEXTURE_2D,ue.TEXTURE_MAG_FILTER,ue.LINEAR),me=ie.heatmapFbo=K.createFramebuffer(Y.width/4,Y.height/4,!1),function(Se,Ie,je,Xe){const st=Se.gl;st.texImage2D(st.TEXTURE_2D,0,st.RGBA,Ie.width/4,Ie.height/4,0,st.RGBA,Se.extRenderToTextureHalfFloat?Se.extTextureHalfFloat.HALF_FLOAT_OES:st.UNSIGNED_BYTE,null),Xe.colorAttachment.set(je)}(K,Y,Re,me)}})(E,C,g),E.clear({color:a.Color.transparent});for(let K=0;K{const Se=a.create();a.ortho(Se,0,ie.width,ie.height,0,0,1);const Ie=ie.context.gl;return{u_matrix:Se,u_world:[Ie.drawingBufferWidth,Ie.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ue.paint.get("heatmap-opacity")}})(E,A),null,A.id,E.viewportBuffer,E.quadTriangleIndexBuffer,E.viewportSegments,A.paint,E.transform.zoom)}(C,g))},line:function(C,c,g,b){if(C.renderPass!=="translucent")return;const E=g.paint.get("line-opacity"),A=g.paint.get("line-width");if(E.constantOr(1)===0||A.constantOr(1)===0)return;const z=C.depthModeForSublayer(0,ir.ReadOnly),j=C.colorModeForRenderPass(),K=g.paint.get("line-dasharray"),Y=g.paint.get("line-pattern"),ie=Y.constantOr(1),ue=g.paint.get("line-gradient"),me=g.getCrossfadeParameters(),Re=ie?"linePattern":K?"lineSDF":ue?"lineGradient":"line",Se=C.context,Ie=Se.gl;let je=!0;for(const Xe of b){const st=c.getTile(Xe);if(ie&&!st.patternsLoaded())continue;const Oe=st.getBucket(g);if(!Oe)continue;const vt=Oe.programConfigurations.get(g.id),ft=C.context.program.get(),Et=C.useProgram(Re,vt),It=je||Et.program!==ft,Ht=C.style.terrain&&C.style.terrain.getTerrainData(Xe),Ct=Y.constantOr(null);if(Ct&&st.imageAtlas){const mn=st.imageAtlas,Hn=mn.patternPositions[Ct.to.toString()],qn=mn.patternPositions[Ct.from.toString()];Hn&&qn&&vt.setConstantPatternPositions(Hn,qn)}const fn=Ht?Xe:null,rn=ie?Rl(C,st,g,me,fn):K?bs(C,st,g,K,me,fn):ue?Jo(C,st,g,Oe.lineClipsArray.length,fn):Gs(C,st,g,fn);if(ie)Se.activeTexture.set(Ie.TEXTURE0),st.imageAtlasTexture.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE),vt.updatePaintBuffers(me);else if(K&&(It||C.lineAtlas.dirty))Se.activeTexture.set(Ie.TEXTURE0),C.lineAtlas.bind(Se);else if(ue){const mn=Oe.gradients[g.id];let Hn=mn.texture;if(g.gradientVersion!==mn.version){let qn=256;if(g.stepInterpolant){const kn=c.getSource().maxzoom,vr=Xe.canonical.z===kn?Math.ceil(1<256&&this.clearStencil(),b.setColorMode(zr.disabled),b.setDepthMode(ir.disabled);const A=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const z of g){const j=this._tileClippingMaskIDs[z.key]=this.nextStencilID++,K=this.style.terrain&&this.style.terrain.getTerrainData(z);A.draw(b,E.TRIANGLES,ir.disabled,new Rr({func:E.ALWAYS,mask:0},j,255,E.KEEP,E.KEEP,E.REPLACE),zr.disabled,jr.disabled,rr(z.posMatrix),K,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const c=this.nextStencilID++,g=this.context.gl;return new Rr({func:g.NOTEQUAL,mask:255},c,255,g.KEEP,g.KEEP,g.REPLACE)}stencilModeForClipping(c){const g=this.context.gl;return new Rr({func:g.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,g.KEEP,g.KEEP,g.REPLACE)}stencilConfigForOverlap(c){const g=this.context.gl,b=c.sort((z,j)=>j.overscaledZ-z.overscaledZ),E=b[b.length-1].overscaledZ,A=b[0].overscaledZ-E+1;if(A>1){this.currentStencilSource=void 0,this.nextStencilID+A>256&&this.clearStencil();const z={};for(let j=0;j=0;this.currentLayer--){const Y=this.style._layers[b[this.currentLayer]],ie=E[Y.source],ue=z[Y.source];this._renderTileClippingMasks(Y,ue),this.renderLayer(this,ie,Y,ue)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer{ue.source&&!ue.isHidden(this.transform.zoom)&&(ue.source!==(ie&&ie.id)&&(ie=this.style.sourceCaches[ue.source]),(!Y||Y.getSource().maxzoom0?g.pop():null}isPatternMissing(c){if(!c)return!1;if(!c.from||!c.to)return!0;const g=this.imageManager.getPattern(c.from.toString()),b=this.imageManager.getPattern(c.to.toString());return!g||!b}useProgram(c,g){this.cache=this.cache||{};const b=c+(g?g.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[b]||(this.cache[b]=new Xn(this.context,c,An[c],g,Lp[c],this._showOverdrawInspector,this.style.terrain)),this.cache[b]}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 c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new P(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class zf{constructor(c,g){this.points=c,this.planes=g}static fromInvProjectionMatrix(c,g,b){const E=Math.pow(2,b),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(j=>{const K=1/(j=a.transformMat4([],j,c))[3]/g*E;return a.mul$1(j,j,[K,K,1/j[3],K])}),z=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(j=>{const K=a.sub([],A[j[0]],A[j[1]]),Y=a.sub([],A[j[2]],A[j[1]]),ie=a.normalize([],a.cross([],K,Y)),ue=-a.dot(ie,A[j[1]]);return ie.concat(ue)});return new zf(A,z)}}class Xc{constructor(c,g){this.min=c,this.max=g,this.center=a.scale$1([],a.add([],this.min,this.max),.5)}quadrant(c){const g=[c%2==0,c<2],b=a.clone$2(this.min),E=a.clone$2(this.max);for(let A=0;A=0&&z++;if(z===0)return 0;z!==g.length&&(b=!1)}if(b)return 2;for(let E=0;E<3;E++){let A=Number.MAX_VALUE,z=-Number.MAX_VALUE;for(let j=0;jthis.max[E]-this.min[E])return 0}return 1}}class Ru{constructor(c=0,g=0,b=0,E=0){if(isNaN(c)||c<0||isNaN(g)||g<0||isNaN(b)||b<0||isNaN(E)||E<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=c,this.bottom=g,this.left=b,this.right=E}interpolate(c,g,b){return g.top!=null&&c.top!=null&&(this.top=a.number(c.top,g.top,b)),g.bottom!=null&&c.bottom!=null&&(this.bottom=a.number(c.bottom,g.bottom,b)),g.left!=null&&c.left!=null&&(this.left=a.number(c.left,g.left,b)),g.right!=null&&c.right!=null&&(this.right=a.number(c.right,g.right,b)),this}getCenter(c,g){const b=a.clamp((this.left+c-this.right)/2,0,c),E=a.clamp((this.top+g-this.bottom)/2,0,g);return new a.pointGeometry(b,E)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new Ru(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class Yc{constructor(c,g,b,E,A){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=A===void 0||!!A,this._minZoom=c||0,this._maxZoom=g||22,this._minPitch=b==null?0:b,this._maxPitch=E==null?60:E,this.setMaxBounds(),this.width=0,this.height=0,this._center=new a.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Ru,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const c=new Yc(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return c.tileSize=this.tileSize,c.latRange=this.latRange,c.width=this.width,c.height=this.height,c._center=this._center,c._elevation=this._elevation,c.zoom=this.zoom,c.angle=this.angle,c._fov=this._fov,c._pitch=this._pitch,c._unmodified=this._unmodified,c._edgeInsets=this._edgeInsets.clone(),c._calcMatrices(),c}get minZoom(){return this._minZoom}set minZoom(c){this._minZoom!==c&&(this._minZoom=c,this.zoom=Math.max(this.zoom,c))}get maxZoom(){return this._maxZoom}set maxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.zoom=Math.min(this.zoom,c))}get minPitch(){return this._minPitch}set minPitch(c){this._minPitch!==c&&(this._minPitch=c,this.pitch=Math.max(this.pitch,c))}get maxPitch(){return this._maxPitch}set maxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.pitch=Math.min(this.pitch,c))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new a.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(c){const g=-a.wrap(c,-180,180)*Math.PI/180;var b;this.angle!==g&&(this._unmodified=!1,this.angle=g,this._calcMatrices(),this.rotationMatrix=(b=new a.ARRAY_TYPE(4),a.ARRAY_TYPE!=Float32Array&&(b[1]=0,b[2]=0),b[0]=1,b[3]=1,b),function(E,A,z){var j=A[0],K=A[1],Y=A[2],ie=A[3],ue=Math.sin(z),me=Math.cos(z);E[0]=j*me+Y*ue,E[1]=K*me+ie*ue,E[2]=j*-ue+Y*me,E[3]=K*-ue+ie*me}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(c){const g=a.clamp(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==g&&(this._unmodified=!1,this._pitch=g,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(c){c=Math.max(.01,Math.min(60,c)),this._fov!==c&&(this._unmodified=!1,this._fov=c/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(c){const g=Math.min(Math.max(c,this.minZoom),this.maxZoom);this._zoom!==g&&(this._unmodified=!1,this._zoom=g,this.scale=this.zoomScale(g),this.tileZoom=Math.floor(g),this.zoomFraction=g-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(c){c!==this._elevation&&(this._elevation=c,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,g,b){this._unmodified=!1,this._edgeInsets.interpolate(c,g,b),this._constrain(),this._calcMatrices()}coveringZoomLevel(c){const g=(c.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/c.tileSize));return Math.max(0,g)}getVisibleUnwrappedCoordinates(c){const g=[new a.UnwrappedTileID(0,c)];if(this._renderWorldCopies){const b=this.pointCoordinate(new a.pointGeometry(0,0)),E=this.pointCoordinate(new a.pointGeometry(this.width,0)),A=this.pointCoordinate(new a.pointGeometry(this.width,this.height)),z=this.pointCoordinate(new a.pointGeometry(0,this.height)),j=Math.floor(Math.min(b.x,E.x,A.x,z.x)),K=Math.floor(Math.max(b.x,E.x,A.x,z.x)),Y=1;for(let ie=j-Y;ie<=K+Y;ie++)ie!==0&&g.push(new a.UnwrappedTileID(ie,c))}return g}coveringTiles(c){var g,b;let E=this.coveringZoomLevel(c);const A=E;if(c.minzoom!==void 0&&Ec.maxzoom&&(E=c.maxzoom);const z=this.pointCoordinate(this.getCameraPoint()),j=a.MercatorCoordinate.fromLngLat(this.center),K=Math.pow(2,E),Y=[K*z.x,K*z.y,0],ie=[K*j.x,K*j.y,0],ue=zf.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,E);let me=c.minzoom||0;!c.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(me=E);const Re=c.terrain?2/Math.min(this.tileSize,c.tileSize)*this.tileSize:3,Se=Oe=>({aabb:new Xc([Oe*K,0,0],[(Oe+1)*K,K,0]),zoom:0,x:0,y:0,wrap:Oe,fullyVisible:!1}),Ie=[],je=[],Xe=E,st=c.reparseOverscaled?A:E;if(this._renderWorldCopies)for(let Oe=1;Oe<=3;Oe++)Ie.push(Se(-Oe)),Ie.push(Se(Oe));for(Ie.push(Se(0));Ie.length>0;){const Oe=Ie.pop(),vt=Oe.x,ft=Oe.y;let Et=Oe.fullyVisible;if(!Et){const mn=Oe.aabb.intersects(ue);if(mn===0)continue;Et=mn===2}const It=c.terrain?Y:ie,Ht=Oe.aabb.distanceX(It),Ct=Oe.aabb.distanceY(It),fn=Math.max(Math.abs(Ht),Math.abs(Ct)),rn=Re+(1<rn&&Oe.zoom>=me){const mn=Xe-Oe.zoom,Hn=Y[0]-.5-(vt<>1),kn=Oe.zoom+1;let vr=Oe.aabb.quadrant(mn);if(c.terrain){const yr=new a.OverscaledTileID(kn,Oe.wrap,kn,Hn,qn),sr=c.terrain.getMinMaxElevation(yr),ur=(g=sr.minElevation)!==null&&g!==void 0?g:this.elevation,Cr=(b=sr.maxElevation)!==null&&b!==void 0?b:this.elevation;vr=new Xc([vr.min[0],vr.min[1],ur],[vr.max[0],vr.max[1],Cr])}Ie.push({aabb:vr,zoom:kn,x:Hn,y:qn,wrap:Oe.wrap,fullyVisible:Et})}}return je.sort((Oe,vt)=>Oe.distanceSq-vt.distanceSq).map(Oe=>Oe.tileID)}resize(c,g){this.width=c,this.height=g,this.pixelsToGLUnits=[2/c,-2/g],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(c){return Math.pow(2,c)}scaleZoom(c){return Math.log(c)/Math.LN2}project(c){const g=a.clamp(c.lat,-this.maxValidLatitude,this.maxValidLatitude);return new a.pointGeometry(a.mercatorXfromLng(c.lng)*this.worldSize,a.mercatorYfromLat(g)*this.worldSize)}unproject(c){return new a.MercatorCoordinate(c.x/this.worldSize,c.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(c){this.freezeElevation||(this.elevation=c?this.getElevation(this._center,c):0)}getElevation(c,g){const b=a.MercatorCoordinate.fromLngLat(c),E=(1<z&&(E=z-Se)}if(this.lngRange){const Re=(j+K)/2,Se=a.wrap(ue.x,Re-this.worldSize/2,Re+this.worldSize/2),Ie=Y.x/2;Se-IeK&&(b=K-Ie)}b===void 0&&E===void 0||(this.center=this.unproject(new a.pointGeometry(b!==void 0?b:ue.x,E!==void 0?E:ue.y)).wrap()),this._unmodified=ie,this._constraining=!1}_calcMatrices(){if(!this.height)return;const c=this.centerOffset,g=this.point.x,b=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=a.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let E=a.identity(new Float64Array(16));a.scale(E,E,[this.width/2,-this.height/2,1]),a.translate(E,E,[1,-1,0]),this.labelPlaneMatrix=E,E=a.identity(new Float64Array(16)),a.scale(E,E,[1,-1,1]),a.translate(E,E,[-1,-1,0]),a.scale(E,E,[2/this.width,2/this.height,1]),this.glCoordMatrix=E,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const A=Math.PI/2+this._pitch,z=this._fov*(.5+c.y/this.height),j=Math.sin(z)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-A-z,.01,Math.PI-.01)),K=this.getHorizon(),Y=2*Math.atan(K/this.cameraToCenterDistance)*(.5+c.y/(2*K)),ie=Math.sin(Y)*this.cameraToSeaLevelDistance/Math.sin(a.clamp(Math.PI-A-Y,.01,Math.PI-.01)),ue=Math.cos(Math.PI/2-this._pitch)*j+this.cameraToSeaLevelDistance,me=Math.cos(Math.PI/2-this._pitch)*ie+this.cameraToSeaLevelDistance,Re=1.01*Math.min(ue,me),Se=this.height/50;E=new Float64Array(16),a.perspective(E,this._fov,this.width/this.height,Se,Re),E[8]=2*-c.x/this.width,E[9]=2*c.y/this.height,a.scale(E,E,[1,-1,1]),a.translate(E,E,[0,0,-this.cameraToCenterDistance]),a.rotateX(E,E,this._pitch),a.rotateZ(E,E,this.angle),a.translate(E,E,[-g,-b,0]),this.mercatorMatrix=a.scale([],E,[this.worldSize,this.worldSize,this.worldSize]),a.scale(E,E,[1,1,this._pixelPerMeter]),this.pixelMatrix=a.multiply(new Float64Array(16),this.labelPlaneMatrix,E),a.translate(E,E,[0,0,-this.elevation]),this.projMatrix=E,this.invProjMatrix=a.invert([],E),this.pixelMatrix3D=a.multiply(new Float64Array(16),this.labelPlaneMatrix,E);const Ie=this.width%2/2,je=this.height%2/2,Xe=Math.cos(this.angle),st=Math.sin(this.angle),Oe=g-Math.round(g)+Xe*Ie+st*je,vt=b-Math.round(b)+Xe*je+st*Ie,ft=new Float64Array(E);if(a.translate(ft,ft,[Oe>.5?Oe-1:Oe,vt>.5?vt-1:vt,0]),this.alignedProjMatrix=ft,E=a.invert(new Float64Array(16),this.pixelMatrix),!E)throw new Error("failed to invert matrix");this.pixelMatrixInverse=E,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const c=this.pointCoordinate(new a.pointGeometry(0,0)),g=[c.x*this.worldSize,c.y*this.worldSize,0,1];return a.transformMat4(g,g,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const c=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new a.pointGeometry(0,c))}getCameraQueryGeometry(c){const g=this.getCameraPoint();if(c.length===1)return[c[0],g];{let b=g.x,E=g.y,A=g.x,z=g.y;for(const j of c)b=Math.min(b,j.x),E=Math.min(E,j.y),A=Math.max(A,j.x),z=Math.max(z,j.y);return[new a.pointGeometry(b,E),new a.pointGeometry(A,E),new a.pointGeometry(A,z),new a.pointGeometry(b,z),new a.pointGeometry(b,E)]}}}class $0{constructor(c){this._hashName=c&&encodeURIComponent(c),a.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(g,b){let E=!1,A=null;const z=()=>{A=null,E&&(g(),A=setTimeout(z,300),E=!1)};return()=>(E=!0,A||z(),A)}(this._updateHashUnthrottled.bind(this))}addTo(c){return this._map=c,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()),delete this._map,this}getHashString(c){const g=this._map.getCenter(),b=Math.round(100*this._map.getZoom())/100,E=Math.ceil((b*Math.LN2+Math.log(512/360/.5))/Math.LN10),A=Math.pow(10,E),z=Math.round(g.lng*A)/A,j=Math.round(g.lat*A)/A,K=this._map.getBearing(),Y=this._map.getPitch();let ie="";if(ie+=c?`/${z}/${j}/${b}`:`${b}/${j}/${z}`,(K||Y)&&(ie+="/"+Math.round(10*K)/10),Y&&(ie+=`/${Math.round(Y)}`),this._hashName){const ue=this._hashName;let me=!1;const Re=window.location.hash.slice(1).split("&").map(Se=>{const Ie=Se.split("=")[0];return Ie===ue?(me=!0,`${Ie}=${ie}`):Se}).filter(Se=>Se);return me||Re.push(`${ue}=${ie}`),`#${Re.join("&")}`}return`#${ie}`}_getCurrentHash(){const c=window.location.hash.replace("#","");if(this._hashName){let g;return c.split("&").map(b=>b.split("=")).forEach(b=>{b[0]===this._hashName&&(g=b)}),(g&&g[1]||"").split("/")}return c.split("/")}_onHashChange(){const c=this._getCurrentHash();if(c.length>=3&&!c.some(g=>isNaN(g))){const g=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(c[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+c[2],+c[1]],zoom:+c[0],bearing:g,pitch:+(c[4]||0)}),!0}return!1}_updateHashUnthrottled(){const c=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,c)}catch{}}}const Qc={linearity:.3,easing:a.bezier(0,0,.3,1)},B0=a.extend({deceleration:2500,maxSpeed:1400},Qc),V0=a.extend({deceleration:20,maxSpeed:1400},Qc),U0=a.extend({deceleration:1e3,maxSpeed:360},Qc),Au=a.extend({deceleration:1e3,maxSpeed:90},Qc);class j0{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:a.exported.now(),settings:c})}_drainInertiaBuffer(){const c=this._inertiaBuffer,g=a.exported.now();for(;c.length>0&&g-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const g={zoom:0,bearing:0,pitch:0,pan:new a.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:A}of this._inertiaBuffer)g.zoom+=A.zoomDelta||0,g.bearing+=A.bearingDelta||0,g.pitch+=A.pitchDelta||0,A.panDelta&&g.pan._add(A.panDelta),A.around&&(g.around=A.around),A.pinchAround&&(g.pinchAround=A.pinchAround);const b=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,E={};if(g.pan.mag()){const A=ed(g.pan.mag(),b,a.extend({},B0,c||{}));E.offset=g.pan.mult(A.amount/g.pan.mag()),E.center=this._map.transform.center,Jc(E,A)}if(g.zoom){const A=ed(g.zoom,b,V0);E.zoom=this._map.transform.zoom+A.amount,Jc(E,A)}if(g.bearing){const A=ed(g.bearing,b,U0);E.bearing=this._map.transform.bearing+a.clamp(A.amount,-179,179),Jc(E,A)}if(g.pitch){const A=ed(g.pitch,b,Au);E.pitch=this._map.transform.pitch+A.amount,Jc(E,A)}if(E.zoom||E.bearing){const A=g.pinchAround===void 0?g.around:g.pinchAround;E.around=A?this._map.unproject(A):this._map.getCenter()}return this.clear(),a.extend(E,{noMoveStart:!0})}}function Jc(C,c){(!C.duration||C.durationg.unproject(K)),j=A.reduce((K,Y,ie,ue)=>K.add(Y.div(ue.length)),new a.pointGeometry(0,0));super(c,{points:A,point:j,lngLats:z,lngLat:g.unproject(j),originalEvent:b}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Fo extends a.Event{constructor(c,g,b){super(c,{originalEvent:b}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Bw{constructor(c,g){this._map=c,this._clickTolerance=g.clickTolerance}reset(){delete this._mousedownPos}wheel(c){return this._firePreventable(new Fo(c.type,this._map,c))}mousedown(c,g){return this._mousedownPos=g,this._firePreventable(new Lo(c.type,this._map,c))}mouseup(c){this._map.fire(new Lo(c.type,this._map,c))}click(c,g){this._mousedownPos&&this._mousedownPos.dist(g)>=this._clickTolerance||this._map.fire(new Lo(c.type,this._map,c))}dblclick(c){return this._firePreventable(new Lo(c.type,this._map,c))}mouseover(c){this._map.fire(new Lo(c.type,this._map,c))}mouseout(c){this._map.fire(new Lo(c.type,this._map,c))}touchstart(c){return this._firePreventable(new td(c.type,this._map,c))}touchmove(c){this._map.fire(new td(c.type,this._map,c))}touchend(c){this._map.fire(new td(c.type,this._map,c))}touchcancel(c){this._map.fire(new td(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qs{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(c){this._map.fire(new Lo(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Lo("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._ignoreContextMenu||this._map.fire(new Lo(c.type,this._map,c)),this._map.listens("contextmenu")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class H0{constructor(c,g){this._map=c,this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=g.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,g){this.isEnabled()&&c.shiftKey&&c.button===0&&(v.disableDrag(),this._startPos=this._lastPos=g,this._active=!0)}mousemoveWindow(c,g){if(!this._active)return;const b=g;if(this._lastPos.equals(b)||!this._box&&b.dist(this._startPos)A.fitScreenCoordinates(b,E,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",c)}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",c))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(v.remove(this._box),this._box=null),v.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(c,g){return this._map.fire(new a.Event(c,{originalEvent:g}))}}function ws(C,c){if(C.length!==c.length)throw new Error(`The number of touches and points are not equal - touches ${C.length}, points ${c.length}`);const g={};for(let b=0;bthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=c.timeStamp),b.length===this.numTouches&&(this.centroid=function(E){const A=new a.pointGeometry(0,0);for(const z of E)A._add(z);return A.div(E.length)}(g),this.touches=ws(b,g)))}touchmove(c,g,b){if(this.aborted||!this.centroid)return;const E=ws(b,g);for(const A in this.touches){const z=this.touches[A],j=E[A];(!j||j.dist(z)>30)&&(this.aborted=!0)}}touchend(c,g,b){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),b.length===0){const E=!this.aborted&&this.centroid;if(this.reset(),E)return E}}}class Yp{constructor(c){this.singleTap=new nd(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(c,g,b){this.singleTap.touchstart(c,g,b)}touchmove(c,g,b){this.singleTap.touchmove(c,g,b)}touchend(c,g,b){const E=this.singleTap.touchend(c,g,b);if(E){const A=c.timeStamp-this.lastTime<500,z=!this.lastTap||this.lastTap.dist(E)<30;if(A&&z||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=E,this.count===this.numTaps)return this.reset(),E}}}class Vw{constructor(){this._zoomIn=new Yp({numTouches:1,numTaps:2}),this._zoomOut=new Yp({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,g,b){this._zoomIn.touchstart(c,g,b),this._zoomOut.touchstart(c,g,b)}touchmove(c,g,b){this._zoomIn.touchmove(c,g,b),this._zoomOut.touchmove(c,g,b)}touchend(c,g,b){const E=this._zoomIn.touchend(c,g,b),A=this._zoomOut.touchend(c,g,b);return E?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()+1,around:z.unproject(E)},{originalEvent:c})}):A?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:z=>z.easeTo({duration:300,zoom:z.getZoom()-1,around:z.unproject(A)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const Uw={0:1,2:2};class $f{constructor(c){this.reset(),this._clickTolerance=c.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(c,g){return!1}_move(c,g){return{}}mousedown(c,g){if(this._lastPoint)return;const b=v.mouseButton(c);this._correctButton(c,b)&&(this._lastPoint=g,this._eventButton=b)}mousemoveWindow(c,g){const b=this._lastPoint;if(b){if(c.preventDefault(),function(E,A){const z=Uw[A];return E.buttons===void 0||(E.buttons&z)!==z}(c,this._eventButton))this.reset();else if(this._moved||!(g.dist(b){this._cancelCooperativeMessage=!1},200)}touchstart(c,g,b){return this._calculateTransform(c,g,b)}touchmove(c,g,b){if(this._map._cooperativeGestures&&(this._minTouches===2&&b.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(c,!1,b.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(b.length0&&(this._active=!0);const E=ws(b,g),A=new a.pointGeometry(0,0),z=new a.pointGeometry(0,0);let j=0;for(const Y in E){const ie=E[Y],ue=this._touches[Y];ue&&(A._add(ie),z._add(ie.sub(ue)),j++,E[Y]=ie)}if(this._touches=E,jMath.abs(C.x)}class em extends Ol{constructor(c){super(),this._map=c}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(c,g,b){super.touchstart(c,g,b),this._currentTouchCount=b.length}_start(c){this._lastPoints=c,Jp(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,g,b){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const E=c[0].sub(this._lastPoints[0]),A=c[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(E,A,b.timeStamp),this._valid?(this._lastPoints=c,this._active=!0,{pitchDelta:(E.y+A.y)/2*-.5}):void 0}gestureBeginsVertically(c,g,b){if(this._valid!==void 0)return this._valid;const E=c.mag()>=2,A=g.mag()>=2;if(!E&&!A)return;if(!E||!A)return this._firstMove===void 0&&(this._firstMove=b),b-this._firstMove<100&&void 0;const z=c.y>0==g.y>0;return Jp(c)&&Jp(g)&&z}}const W0={panStep:100,bearingStep:15,pitchStep:10};class G0{constructor(){const c=W0;this._panStep=c.panStep,this._bearingStep=c.bearingStep,this._pitchStep=c.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let g=0,b=0,E=0,A=0,z=0;switch(c.keyCode){case 61:case 107:case 171:case 187:g=1;break;case 189:case 109:case 173:g=-1;break;case 37:c.shiftKey?b=-1:(c.preventDefault(),A=-1);break;case 39:c.shiftKey?b=1:(c.preventDefault(),A=1);break;case 38:c.shiftKey?E=1:(c.preventDefault(),z=-1);break;case 40:c.shiftKey?E=-1:(c.preventDefault(),z=1);break;default:return}return this._rotationDisabled&&(b=0,E=0),{cameraAnimation:j=>{const K=j.getZoom();j.easeTo({duration:300,easeId:"keyboardHandler",easing:Hw,zoom:g?Math.round(K)+g*(c.shiftKey?2:1):K,bearing:j.getBearing()+b*this._bearingStep,pitch:j.getPitch()+E*this._pitchStep,offset:[-A*this._panStep,-z*this._panStep],center:j.getCenter()},{originalEvent:c})}}}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 Hw(C){return C*(2-C)}const q0=4.000244140625;class tm{constructor(c,g){this._map=c,this._el=c.getCanvasContainer(),this._handler=g,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,a.bindAll(["_onTimeout"],this)}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=c&&c.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(c){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;c.preventDefault()}let g=c.deltaMode===WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY;const b=a.exported.now(),E=b-(this._lastWheelEventTime||0);this._lastWheelEventTime=b,g!==0&&g%q0==0?this._type="wheel":g!==0&&Math.abs(g)<4?this._type="trackpad":E>400?(this._type=null,this._lastValue=g,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(E*g)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,g+=this._lastValue)),c.shiftKey&&g&&(g/=4),this._type&&(this._lastWheelEvent=c,this._delta-=g,this._active||this._start(c)),c.preventDefault()}_onTimeout(c){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(c)}_start(c){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 g=v.mousePos(this._el,c);this._around=a.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(g)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const c=this._map.transform;if(this._delta!==0){const j=this._type==="wheel"&&Math.abs(this._delta)>q0?this._wheelZoomRate:this._defaultZoomRate;let K=2/(1+Math.exp(-Math.abs(this._delta*j)));this._delta<0&&K!==0&&(K=1/K);const Y=typeof this._targetZoom=="number"?c.zoomScale(this._targetZoom):c.scale;this._targetZoom=Math.min(c.maxZoom,Math.max(c.minZoom,c.scaleZoom(Y*K))),this._type==="wheel"&&(this._startZoom=c.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const g=typeof this._targetZoom=="number"?this._targetZoom:c.zoom,b=this._startZoom,E=this._easing;let A,z=!1;if(this._type==="wheel"&&b&&E){const j=Math.min((a.exported.now()-this._lastWheelEventTime)/200,1),K=E(j);A=a.number(b,g,K),j<1?this._frameId||(this._frameId=!0):z=!0}else A=g,z=!0;return this._active=!0,z&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!z,zoomDelta:A-c.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let g=a.ease;if(this._prevEase){const b=this._prevEase,E=(a.exported.now()-b.start)/b.duration,A=b.easing(E+.01)-b.easing(E),z=.27/Math.sqrt(A*A+1e-4)*.01,j=Math.sqrt(.0729-z*z);g=a.bezier(z,j,.25,1)}return this._prevEase={start:a.exported.now(),duration:c,easing:g},g}reset(){this._active=!1}}class nm{constructor(c,g){this._clickZoom=c,this._tapZoom=g}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 rm{constructor(){this.reset()}reset(){this._active=!1}dblclick(c,g){return c.preventDefault(),{cameraAnimation:b=>{b.easeTo({duration:300,zoom:b.getZoom()+(c.shiftKey?-1:1),around:b.unproject(g)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class im{constructor(){this._tap=new Yp({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(c,g,b){this._swipePoint||(this._tapTime&&c.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?b.length>0&&(this._swipePoint=g[0],this._swipeTouch=b[0].identifier):this._tap.touchstart(c,g,b))}touchmove(c,g,b){if(this._tapTime){if(this._swipePoint){if(b[0].identifier!==this._swipeTouch)return;const E=g[0],A=E.y-this._swipePoint.y;return this._swipePoint=E,c.preventDefault(),this._active=!0,{zoomDelta:A/128}}}else this._tap.touchmove(c,g,b)}touchend(c,g,b){this._tapTime?this._swipePoint&&b.length===0&&this.reset():this._tap.touchend(c,g,b)&&(this._tapTime=c.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class xo{constructor(c,g,b){this._el=c,this._mousePan=g,this._touchPan=b}enable(c){this._inertiaOptions=c||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Xs{constructor(c,g,b){this._pitchWithRotate=c.pitchWithRotate,this._mouseRotate=g,this._mousePitch=b}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 Z0{constructor(c,g,b,E){this._el=c,this._touchZoom=g,this._touchRotate=b,this._tapDragZoom=E,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-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()}}const Du=C=>C.zoom||C.drag||C.pitch||C.rotate;class om extends a.Event{}function id(C){return C.panDelta&&C.panDelta.mag()||C.zoomDelta||C.bearingDelta||C.pitchDelta}class X0{constructor(c,g){this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new j0(c),this._bearingSnap=g.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(g),a.bindAll(["handleEvent","handleWindowEvent"],this);const b=this._el;this._listeners=[[b,"touchstart",{passive:!0}],[b,"touchmove",{passive:!1}],[b,"touchend",void 0],[b,"touchcancel",void 0],[b,"mousedown",void 0],[b,"mousemove",void 0],[b,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[b,"mouseover",void 0],[b,"mouseout",void 0],[b,"dblclick",void 0],[b,"click",void 0],[b,"keydown",{capture:!1}],[b,"keyup",void 0],[b,"wheel",{passive:!1}],[b,"contextmenu",void 0],[window,"blur",void 0]];for(const[E,A,z]of this._listeners)v.addEventListener(E,A,E===document?this.handleWindowEvent:this.handleEvent,z)}destroy(){for(const[c,g,b]of this._listeners)v.removeEventListener(c,g,c===document?this.handleWindowEvent:this.handleEvent,b)}_addDefaultHandlers(c){const g=this._map,b=g.getCanvasContainer();this._add("mapEvent",new Bw(g,c));const E=g.boxZoom=new H0(g,c);this._add("boxZoom",E);const A=new Vw,z=new rm;g.doubleClickZoom=new nm(z,A),this._add("tapZoom",A),this._add("clickZoom",z);const j=new im;this._add("tapDragZoom",j);const K=g.touchPitch=new em(g);this._add("touchPitch",K);const Y=new Cs(c),ie=new yn(c);g.dragRotate=new Xs(c,Y,ie),this._add("mouseRotate",Y,["mousePitch"]),this._add("mousePitch",ie,["mouseRotate"]);const ue=new rd(c),me=new K0(c,g);g.dragPan=new xo(b,ue,me),this._add("mousePan",ue),this._add("touchPan",me,["touchZoom","touchRotate"]);const Re=new jw,Se=new un;g.touchZoomRotate=new Z0(b,Se,Re,j),this._add("touchRotate",Re,["touchPan","touchZoom"]),this._add("touchZoom",Se,["touchPan","touchRotate"]);const Ie=g.scrollZoom=new tm(g,this);this._add("scrollZoom",Ie,["mousePan"]);const je=g.keyboard=new G0;this._add("keyboard",je),this._add("blockableMapEvent",new qs(g));for(const Xe of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])c.interactive&&c[Xe]&&g[Xe].enable(c[Xe])}_add(c,g,b){this._handlers.push({handlerName:c,handler:g,allowed:b}),this._handlersById[c]=g}stop(c){if(!this._updatingCamera){for(const{handler:g}of this._handlers)g.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(const{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Du(this._eventsInProgress))||this.isZooming()}_blockedByActive(c,g,b){for(const E in c)if(E!==b&&(!g||g.indexOf(E)<0))return!0;return!1}handleWindowEvent(c){this.handleEvent(c,`${c.type}Window`)}_getMapTouches(c){const g=[];for(const b of c)this._el.contains(b.target)&&g.push(b);return g}handleEvent(c,g){if(c.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const b=c.type==="renderFrame"?void 0:c,E={needsRenderFrame:!1},A={},z={},j=c.touches,K=j?this._getMapTouches(j):void 0,Y=K?v.touchPos(this._el,K):v.mousePos(this._el,c);for(const{handlerName:me,handler:Re,allowed:Se}of this._handlers){if(!Re.isEnabled())continue;let Ie;this._blockedByActive(z,Se,me)?Re.reset():Re[g||c.type]&&(Ie=Re[g||c.type](c,Y,K),this.mergeHandlerResult(E,A,Ie,me,b),Ie&&Ie.needsRenderFrame&&this._triggerRenderFrame()),(Ie||Re.isActive())&&(z[me]=Re)}const ie={};for(const me in this._previousActiveHandlers)z[me]||(ie[me]=b);this._previousActiveHandlers=z,(Object.keys(ie).length||id(E))&&(this._changes.push([E,A,ie]),this._triggerRenderFrame()),(Object.keys(z).length||id(E))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:ue}=E;ue&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ue(this._map))}mergeHandlerResult(c,g,b,E,A){if(!b)return;a.extend(c,b);const z={handlerName:E,originalEvent:b.originalEvent||A};b.zoomDelta!==void 0&&(g.zoom=z),b.panDelta!==void 0&&(g.drag=z),b.pitchDelta!==void 0&&(g.pitch=z),b.bearingDelta!==void 0&&(g.rotate=z)}_applyChanges(){const c={},g={},b={};for(const[E,A,z]of this._changes)E.panDelta&&(c.panDelta=(c.panDelta||new a.pointGeometry(0,0))._add(E.panDelta)),E.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+E.zoomDelta),E.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+E.bearingDelta),E.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+E.pitchDelta),E.around!==void 0&&(c.around=E.around),E.pinchAround!==void 0&&(c.pinchAround=E.pinchAround),E.noInertia&&(c.noInertia=E.noInertia),a.extend(g,A),a.extend(b,z);this._updateMapTransform(c,g,b),this._changes=[]}_updateMapTransform(c,g,b){const E=this._map,A=E.transform,z=E.style&&E.style.terrain;if(!(id(c)||z&&this._drag))return this._fireEvents(g,b,!0);let{panDelta:j,zoomDelta:K,bearingDelta:Y,pitchDelta:ie,around:ue,pinchAround:me}=c;me!==void 0&&(ue=me),E._stop(!0),ue=ue||E.transform.centerPoint;const Re=A.pointLocation(j?ue.sub(j):ue);Y&&(A.bearing+=Y),ie&&(A.pitch+=ie),K&&(A.zoom+=K),z?g.drag&&!this._drag?(this._drag={center:A.centerPoint,lngLat:A.pointLocation(ue),point:ue,handlerName:g.drag.handlerName},E.fire(new a.Event("freezeElevation",{freeze:!0}))):this._drag&&b[this._drag.handlerName]?(E.fire(new a.Event("freezeElevation",{freeze:!1})),this._drag=null):g.drag&&this._drag&&(A.center=A.pointLocation(A.centerPoint.sub(j))):A.setLocationAtPoint(Re,ue),this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(g,b,!0)}_fireEvents(c,g,b){const E=Du(this._eventsInProgress),A=Du(c),z={};for(const ie in c){const{originalEvent:ue}=c[ie];this._eventsInProgress[ie]||(z[`${ie}start`]=ue),this._eventsInProgress[ie]=c[ie]}!E&&A&&this._fireEvent("movestart",A.originalEvent);for(const ie in z)this._fireEvent(ie,z[ie]);A&&this._fireEvent("move",A.originalEvent);for(const ie in c){const{originalEvent:ue}=c[ie];this._fireEvent(ie,ue)}const j={};let K;for(const ie in this._eventsInProgress){const{handlerName:ue,originalEvent:me}=this._eventsInProgress[ie];this._handlersById[ue].isActive()||(delete this._eventsInProgress[ie],K=g[ue]||me,j[`${ie}end`]=K)}for(const ie in j)this._fireEvent(ie,j[ie]);const Y=Du(this._eventsInProgress);if(b&&(E||A)&&!Y){this._updatingCamera=!0;const ie=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ue=me=>me!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new om("renderFrame",{timeStamp:c})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}const ea={extend:(C,...c)=>a.extend(C,...c),run(C){C()},logToElement(C,c=!1,g="log"){const b=window.document.getElementById(g);b&&(c&&(b.innerHTML=""),b.innerHTML+=`
${C}`)}};class Hr extends a.Evented{constructor(c,g){super(),this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=g.bearingSnap,a.bindAll(["_renderFrameCallback"],this)}getCenter(){return new a.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(c,g){return this.jumpTo({center:c},g)}panBy(c,g,b){return c=a.pointGeometry.convert(c).mult(-1),this.panTo(this.transform.center,a.extend({offset:c},g),b)}panTo(c,g,b){return this.easeTo(a.extend({center:c},g),b)}getZoom(){return this.transform.zoom}setZoom(c,g){return this.jumpTo({zoom:c},g),this}zoomTo(c,g,b){return this.easeTo(a.extend({zoom:c},g),b)}zoomIn(c,g){return this.zoomTo(this.getZoom()+1,c,g),this}zoomOut(c,g){return this.zoomTo(this.getZoom()-1,c,g),this}getBearing(){return this.transform.bearing}setBearing(c,g){return this.jumpTo({bearing:c},g),this}getPadding(){return this.transform.padding}setPadding(c,g){return this.jumpTo({padding:c},g),this}rotateTo(c,g,b){return this.easeTo(a.extend({bearing:c},g),b)}resetNorth(c,g){return this.rotateTo(0,a.extend({duration:1e3},c),g),this}resetNorthPitch(c,g){return this.easeTo(a.extend({bearing:0,pitch:0,duration:1e3},c),g),this}snapToNorth(c,g){return Math.abs(this.getBearing()){if(this._zooming&&(b.zoom=a.number(E,K,Et)),this._rotating&&(b.bearing=a.number(A,Y,Et)),this._pitching&&(b.pitch=a.number(z,ie,Et)),this._padding&&(b.interpolatePadding(j,ue,Et),Re=b.centerPoint.add(me)),Oe)b.setLocationAtPoint(Oe,vt);else{const It=b.zoomScale(b.zoom-E),Ht=K>E?Math.min(2,st):Math.max(.5,st),Ct=Math.pow(Ht,1-Et),fn=b.unproject(je.add(Xe.mult(Et*Ct)).mult(It));b.setLocationAtPoint(b.renderWorldCopies?fn.wrap():fn,Re)}this._fireMoveEvents(g)},Et=>{this._afterEase(g,Et)},c),this}_prepareEase(c,g,b={}){this._moving=!0,this.fire(new a.Event("freezeElevation",{freeze:!0})),g||b.moving||this.fire(new a.Event("movestart",c)),this._zooming&&!b.zooming&&this.fire(new a.Event("zoomstart",c)),this._rotating&&!b.rotating&&this.fire(new a.Event("rotatestart",c)),this._pitching&&!b.pitching&&this.fire(new a.Event("pitchstart",c))}_fireMoveEvents(c){this.fire(new a.Event("move",c)),this._zooming&&this.fire(new a.Event("zoom",c)),this._rotating&&this.fire(new a.Event("rotate",c)),this._pitching&&this.fire(new a.Event("pitch",c))}_afterEase(c,g){if(this._easeId&&g&&this._easeId===g)return;delete this._easeId,this.fire(new a.Event("freezeElevation",{freeze:!1}));const b=this._zooming,E=this._rotating,A=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,b&&this.fire(new a.Event("zoomend",c)),E&&this.fire(new a.Event("rotateend",c)),A&&this.fire(new a.Event("pitchend",c)),this.fire(new a.Event("moveend",c))}flyTo(c,g){if(!c.essential&&a.exported.prefersReducedMotion){const kn=a.pick(c,["center","zoom","bearing","pitch","around"]);return this.jumpTo(kn,g)}this.stop(),c=a.extend({offset:[0,0],speed:1.2,curve:1.42,easing:a.ease},c);const b=this.transform,E=this.getZoom(),A=this.getBearing(),z=this.getPitch(),j=this.getPadding(),K="zoom"in c?a.clamp(+c.zoom,b.minZoom,b.maxZoom):E,Y="bearing"in c?this._normalizeBearing(c.bearing,A):A,ie="pitch"in c?+c.pitch:z,ue="padding"in c?c.padding:b.padding,me=b.zoomScale(K-E),Re=a.pointGeometry.convert(c.offset);let Se=b.centerPoint.add(Re);const Ie=b.pointLocation(Se),je=a.LngLat.convert(c.center||Ie);this._normalizeCenter(je);const Xe=b.project(Ie),st=b.project(je).sub(Xe);let Oe=c.curve;const vt=Math.max(b.width,b.height),ft=vt/me,Et=st.mag();if("minZoom"in c){const kn=a.clamp(Math.min(c.minZoom,E,K),b.minZoom,b.maxZoom),vr=vt/b.zoomScale(kn-E);Oe=Math.sqrt(vr/Et*2)}const It=Oe*Oe;function Ht(kn){const vr=(ft*ft-vt*vt+(kn?-1:1)*It*It*Et*Et)/(2*(kn?ft:vt)*It*Et);return Math.log(Math.sqrt(vr*vr+1)-vr)}function Ct(kn){return(Math.exp(kn)-Math.exp(-kn))/2}function fn(kn){return(Math.exp(kn)+Math.exp(-kn))/2}const rn=Ht(0);let mn=function(kn){return fn(rn)/fn(rn+Oe*kn)},Hn=function(kn){return vt*((fn(rn)*(Ct(vr=rn+Oe*kn)/fn(vr))-Ct(rn))/It)/Et;var vr},qn=(Ht(1)-rn)/Oe;if(Math.abs(Et)<1e-6||!isFinite(qn)){if(Math.abs(vt-ft)<1e-6)return this.easeTo(c,g);const kn=ftc.maxDuration&&(c.duration=0),this._zooming=!0,this._rotating=A!==Y,this._pitching=ie!==z,this._padding=!b.isPaddingEqual(ue),this._prepareEase(g,!1),this._ease(kn=>{const vr=kn*qn,yr=1/mn(vr);b.zoom=kn===1?K:E+b.scaleZoom(yr),this._rotating&&(b.bearing=a.number(A,Y,kn)),this._pitching&&(b.pitch=a.number(z,ie,kn)),this._padding&&(b.interpolatePadding(j,ue,kn),Se=b.centerPoint.add(Re));const sr=kn===1?je:b.unproject(Xe.add(st.mult(Hn(vr))).mult(yr));b.setLocationAtPoint(b.renderWorldCopies?sr.wrap():sr,Se),this._fireMoveEvents(g)},()=>this._afterEase(g),c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,g){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const b=this._onEaseEnd;delete this._onEaseEnd,b.call(this,g)}if(!c){const b=this.handlers;b&&b.stop(!1)}return this}_ease(c,g,b){b.animate===!1||b.duration===0?(c(1),g()):(this._easeStart=a.exported.now(),this._easeOptions=b,this._onEaseFrame=c,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const c=Math.min((a.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(c)),c<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(c,g){c=a.wrap(c,-180,180);const b=Math.abs(c-g);return Math.abs(c-360-g)180?-360:b<-180?360:0}}class od{constructor(c={}){this.options=c,a.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(c){return this._map=c,this._compact=this.options&&this.options.compact,this._container=v.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=v.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=v.create("div","maplibregl-ctrl-attrib-inner mapboxgl-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(){v.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(c,g){const b=this._map._getUIString(`AttributionControl.${g}`);c.title=b,c.setAttribute("aria-label",b)}_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","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(c){!c||c.sourceDataType!=="metadata"&&c.sourceDataType!=="visibility"&&c.dataType!=="style"&&c.type!=="terrain"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let c=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=c.concat(this.options.customAttribution.map(E=>typeof E!="string"?"":E)):typeof this.options.customAttribution=="string"&&c.push(this.options.customAttribution)),this._map.style.stylesheet){const E=this._map.style.stylesheet;this.styleOwner=E.owner,this.styleId=E.id}const g=this._map.style.sourceCaches;for(const E in g){const A=g[E];if(A.used||A.usedForTerrain){const z=A.getSource();z.attribution&&c.indexOf(z.attribution)<0&&c.push(z.attribution)}}c=c.filter(E=>String(E).trim()),c.sort((E,A)=>E.length-A.length),c=c.filter((E,A)=>{for(let z=A+1;z=0)return!1;return!0});const b=c.join(" | ");b!==this._attribHTML&&(this._attribHTML=b,c.length?(this._innerContainer.innerHTML=b,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Vf{constructor(c={}){this.options=c,a.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(c){this._map=c,this._compact=this.options&&this.options.compact,this._container=v.create("div","maplibregl-ctrl mapboxgl-ctrl");const g=v.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return g.target="_blank",g.rel="noopener nofollow",g.href="https://maplibre.org/",g.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),g.setAttribute("rel","noopener nofollow"),this._container.appendChild(g),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){v.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const c=this._container.children;if(c.length){const g=c[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&g.classList.add("maplibregl-compact","mapboxgl-compact"):g.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Y0{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){const g=++this._id;return this._queue.push({callback:c,id:g,cancelled:!1}),g}remove(c){const g=this._currentlyRunning,b=g?this._queue.concat(g):this._queue;for(const E of b)if(E.id===c)return void(E.cancelled=!0)}run(c=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const g=this._currentlyRunning=this._queue;this._queue=[];for(const b of g)if(!b.cancelled&&(b.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const Q0={"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","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},J0={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},Kw={showCompass:!0,showZoom:!0,visualizePitch:!1};class ja{constructor(c,g,b=!1){this._clickTolerance=10,this.element=g,this.mouseRotate=new Cs({clickTolerance:c.dragRotate._mouseRotate._clickTolerance}),this.map=c,b&&(this.mousePitch=new yn({clickTolerance:c.dragRotate._mousePitch._clickTolerance})),a.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),v.addEventListener(g,"mousedown",this.mousedown),v.addEventListener(g,"touchstart",this.touchstart,{passive:!1}),v.addEventListener(g,"touchmove",this.touchmove),v.addEventListener(g,"touchend",this.touchend),v.addEventListener(g,"touchcancel",this.reset)}down(c,g){this.mouseRotate.mousedown(c,g),this.mousePitch&&this.mousePitch.mousedown(c,g),v.disableDrag()}move(c,g){const b=this.map,E=this.mouseRotate.mousemoveWindow(c,g);if(E&&E.bearingDelta&&b.setBearing(b.getBearing()+E.bearingDelta),this.mousePitch){const A=this.mousePitch.mousemoveWindow(c,g);A&&A.pitchDelta&&b.setPitch(b.getPitch()+A.pitchDelta)}}off(){const c=this.element;v.removeEventListener(c,"mousedown",this.mousedown),v.removeEventListener(c,"touchstart",this.touchstart,{passive:!1}),v.removeEventListener(c,"touchmove",this.touchmove),v.removeEventListener(c,"touchend",this.touchend),v.removeEventListener(c,"touchcancel",this.reset),this.offTemp()}offTemp(){v.enableDrag(),v.removeEventListener(window,"mousemove",this.mousemove),v.removeEventListener(window,"mouseup",this.mouseup)}mousedown(c){this.down(a.extend({},c,{ctrlKey:!0,preventDefault:()=>c.preventDefault()}),v.mousePos(this.element,c)),v.addEventListener(window,"mousemove",this.mousemove),v.addEventListener(window,"mouseup",this.mouseup)}mousemove(c){this.move(c,v.mousePos(this.element,c))}mouseup(c){this.mouseRotate.mouseupWindow(c),this.mousePitch&&this.mousePitch.mouseupWindow(c),this.offTemp()}touchstart(c){c.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=v.touchPos(this.element,c.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>c.preventDefault()},this._startPos))}touchmove(c){c.targetTouches.length!==1?this.reset():(this._lastPos=v.touchPos(this.element,c.targetTouches)[0],this.move({preventDefault:()=>c.preventDefault()},this._lastPos))}touchend(c){c.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)180;){const b=g.locationPoint(C);if(b.x>=0&&b.y>=0&&b.x<=g.width&&b.y<=g.height)break;C.lng>g.center.lng?C.lng-=360:C.lng+=360}return C}const wn={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 Dn(C,c,g){const b=C.classList;for(const E in wn)b.remove(`maplibregl-${g}-anchor-${E}`,`mapboxgl-${g}-anchor-${E}`);b.add(`maplibregl-${g}-anchor-${c}`,`mapboxgl-${g}-anchor-${c}`)}class Ou extends a.Evented{constructor(c,g){if(super(),(c instanceof HTMLElement||g)&&(c=a.extend({element:c},g)),a.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=c&&c.anchor||"center",this._color=c&&c.color||"#3FB1CE",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||"auto",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment!=="auto"?c.pitchAlignment:this._rotationAlignment,c&&c.element)this._element=c.element,this._offset=a.pointGeometry.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=v.create("div"),this._element.setAttribute("aria-label","Map marker");const b=v.createNS("http://www.w3.org/2000/svg","svg"),E=41,A=27;b.setAttributeNS(null,"display","block"),b.setAttributeNS(null,"height",`${E}px`),b.setAttributeNS(null,"width",`${A}px`),b.setAttributeNS(null,"viewBox",`0 0 ${A} ${E}`);const z=v.createNS("http://www.w3.org/2000/svg","g");z.setAttributeNS(null,"stroke","none"),z.setAttributeNS(null,"stroke-width","1"),z.setAttributeNS(null,"fill","none"),z.setAttributeNS(null,"fill-rule","evenodd");const j=v.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"fill-rule","nonzero");const K=v.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(3.0, 29.0)"),K.setAttributeNS(null,"fill","#000000");const Y=[{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 st of Y){const Oe=v.createNS("http://www.w3.org/2000/svg","ellipse");Oe.setAttributeNS(null,"opacity","0.04"),Oe.setAttributeNS(null,"cx","10.5"),Oe.setAttributeNS(null,"cy","5.80029008"),Oe.setAttributeNS(null,"rx",st.rx),Oe.setAttributeNS(null,"ry",st.ry),K.appendChild(Oe)}const ie=v.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"fill",this._color);const ue=v.createNS("http://www.w3.org/2000/svg","path");ue.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"),ie.appendChild(ue);const me=v.createNS("http://www.w3.org/2000/svg","g");me.setAttributeNS(null,"opacity","0.25"),me.setAttributeNS(null,"fill","#000000");const Re=v.createNS("http://www.w3.org/2000/svg","path");Re.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"),me.appendChild(Re);const Se=v.createNS("http://www.w3.org/2000/svg","g");Se.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Se.setAttributeNS(null,"fill","#FFFFFF");const Ie=v.createNS("http://www.w3.org/2000/svg","g");Ie.setAttributeNS(null,"transform","translate(8.0, 8.0)");const je=v.createNS("http://www.w3.org/2000/svg","circle");je.setAttributeNS(null,"fill","#000000"),je.setAttributeNS(null,"opacity","0.25"),je.setAttributeNS(null,"cx","5.5"),je.setAttributeNS(null,"cy","5.5"),je.setAttributeNS(null,"r","5.4999962");const Xe=v.createNS("http://www.w3.org/2000/svg","circle");Xe.setAttributeNS(null,"fill","#FFFFFF"),Xe.setAttributeNS(null,"cx","5.5"),Xe.setAttributeNS(null,"cy","5.5"),Xe.setAttributeNS(null,"r","5.4999962"),Ie.appendChild(je),Ie.appendChild(Xe),j.appendChild(K),j.appendChild(ie),j.appendChild(me),j.appendChild(Se),j.appendChild(Ie),b.appendChild(j),b.setAttributeNS(null,"height",E*this._scale+"px"),b.setAttributeNS(null,"width",A*this._scale+"px"),this._element.appendChild(b),this._offset=a.pointGeometry.convert(c&&c.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",b=>{b.preventDefault()}),this._element.addEventListener("mousedown",b=>{b.preventDefault()}),Dn(this._element,this._anchor,"marker"),this._popup=null}addTo(c){return this.remove(),this._map=c,c.getCanvasContainer().appendChild(this._element),c.on("move",this._update),c.on("moveend",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("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),v.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=a.LngLat.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(c){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),c){if(!("offset"in c.options)){const E=Math.sqrt(Math.pow(13.5,2)/2);c.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[E,-1*(38.1-13.5+E)],"bottom-right":[-E,-1*(38.1-13.5+E)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=c,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}_onKeyPress(c){const g=c.code,b=c.charCode||c.keyCode;g!=="Space"&&g!=="Enter"&&b!==32&&b!==13||this.togglePopup()}_onMapClick(c){const g=c.originalEvent.target,b=this._element;this._popup&&(g===b||b.contains(g))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const c=this._popup;return c?(c.isOpen()?c.remove():c.addTo(this._map),this):this}_update(c){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=ad(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(g=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let b="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?b="rotateX(0deg)":this._pitchAlignment==="map"&&(b=`rotateX(${this._map.getPitch()}deg)`),c&&c.type!=="moveend"||(this._pos=this._pos.round()),v.setTransform(this._element,`${wn[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${b} ${g}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout(()=>{const E=this._map.unproject(this._pos),A=40075016686e-3*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=E.distanceTo(this._lngLat)>20*A?"0.2":"1.0",this._opacityTimeout=null},100))}getOffset(){return this._offset}setOffset(c){return this._offset=a.pointGeometry.convert(c),this._update(),this}_onMove(c){if(!this._isDragging){const g=this._clickTolerance||this._map._clickTolerance;this._isDragging=c.point.dist(this._pointerdownPos)>=g}this._isDragging&&(this._pos=c.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new a.Event("dragstart"))),this.fire(new a.Event("drag")))}_onUp(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new a.Event("dragend")),this._state="inactive"}_addDragHandler(c){this._element.contains(c.originalEvent.target)&&(c.preventDefault(),this._positionDelta=c.point.sub(this._pos).add(this._offset),this._pointerdownPos=c.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))}setDraggable(c){return this._draggable=!!c,this._map&&(c?(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(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c&&c!=="auto"?c:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const am={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ys,ji=0,Qs=!1;const Ha={maxWidth:100,unit:"metric"};function ey(C,c,g){const b=g&&g.maxWidth||100,E=C._container.clientHeight/2,A=C.unproject([0,E]),z=C.unproject([b,E]),j=A.distanceTo(z);if(g&&g.unit==="imperial"){const K=3.2808*j;K>5280?Js(c,b,K/5280,C._getUIString("ScaleControl.Miles")):Js(c,b,K,C._getUIString("ScaleControl.Feet"))}else g&&g.unit==="nautical"?Js(c,b,j/1852,C._getUIString("ScaleControl.NauticalMiles")):j>=1e3?Js(c,b,j/1e3,C._getUIString("ScaleControl.Kilometers")):Js(c,b,j,C._getUIString("ScaleControl.Meters"))}function Js(C,c,g,b){const E=function(A){const z=Math.pow(10,`${Math.floor(A)}`.length-1);let j=A/z;return j=j>=10?10:j>=5?5:j>=3?3:j>=2?2:j>=1?1:function(K){const Y=Math.pow(10,Math.ceil(-Math.log(K)/Math.LN10));return Math.round(K*Y)/Y}(j),z*j}(g);C.style.width=c*(E/g)+"px",C.innerHTML=`${E} ${b}`}const ii={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},gi=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function sm(C){if(C){if(typeof C=="number"){const c=Math.round(Math.sqrt(.5*Math.pow(C,2)));return{center:new a.pointGeometry(0,0),top:new a.pointGeometry(0,C),"top-left":new a.pointGeometry(c,c),"top-right":new a.pointGeometry(-c,c),bottom:new a.pointGeometry(0,-C),"bottom-left":new a.pointGeometry(c,-c),"bottom-right":new a.pointGeometry(-c,-c),left:new a.pointGeometry(C,0),right:new a.pointGeometry(-C,0)}}if(C instanceof a.pointGeometry||Array.isArray(C)){const c=a.pointGeometry.convert(C);return{center:c,top:c,"top-left":c,"top-right":c,bottom:c,"bottom-left":c,"bottom-right":c,left:c,right:c}}return{center:a.pointGeometry.convert(C.center||[0,0]),top:a.pointGeometry.convert(C.top||[0,0]),"top-left":a.pointGeometry.convert(C["top-left"]||[0,0]),"top-right":a.pointGeometry.convert(C["top-right"]||[0,0]),bottom:a.pointGeometry.convert(C.bottom||[0,0]),"bottom-left":a.pointGeometry.convert(C["bottom-left"]||[0,0]),"bottom-right":a.pointGeometry.convert(C["bottom-right"]||[0,0]),left:a.pointGeometry.convert(C.left||[0,0]),right:a.pointGeometry.convert(C.right||[0,0])}}return sm(new a.pointGeometry(0,0))}const Nl={supported:u,setRTLTextPlugin:a.setRTLTextPlugin,getRTLTextPluginStatus:a.getRTLTextPluginStatus,Map:class extends Hr{constructor(C){var c;if(a.PerformanceUtils.mark(a.PerformanceMarkers.create),(C=a.extend({},J0,C)).minZoom!=null&&C.maxZoom!=null&&C.minZoom>C.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(C.minPitch!=null&&C.maxPitch!=null&&C.minPitch>C.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(C.minPitch!=null&&C.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(C.maxPitch!=null&&C.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Yc(C.minZoom,C.maxZoom,C.minPitch,C.maxPitch,C.renderWorldCopies),{bearingSnap:C.bearingSnap}),this._interactive=C.interactive,this._cooperativeGestures=C.cooperativeGestures,this._maxTileCacheSize=C.maxTileCacheSize,this._failIfMajorPerformanceCaveat=C.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=C.preserveDrawingBuffer,this._antialias=C.antialias,this._trackResize=C.trackResize,this._bearingSnap=C.bearingSnap,this._refreshExpiredTiles=C.refreshExpiredTiles,this._fadeDuration=C.fadeDuration,this._crossSourceCollisions=C.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=C.collectResourceTiming,this._renderTaskQueue=new Y0,this._controls=[],this._mapId=a.uniqueId(),this._locale=a.extend({},Q0,C.locale),this._clickTolerance=C.clickTolerance,this._pixelRatio=(c=C.pixelRatio)!==null&&c!==void 0?c:devicePixelRatio,this._requestManager=new x(C.transformRequest),typeof C.container=="string"){if(this._container=document.getElementById(C.container),!this._container)throw new Error(`Container '${C.container}' not found.`)}else{if(!(C.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=C.container}if(C.maxBounds&&this.setMaxBounds(C.maxBounds),a.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new X0(this,C),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=C.hash&&new $0(typeof C.hash=="string"&&C.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:C.center,zoom:C.zoom,bearing:C.bearing,pitch:C.pitch}),C.bounds&&(this.resize(),this.fitBounds(C.bounds,a.extend({},C.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=C.localIdeographFontFamily,C.style&&this.setStyle(C.style,{localIdeographFontFamily:C.localIdeographFontFamily}),C.attributionControl&&this.addControl(new od({customAttribution:C.customAttribution})),C.maplibreLogo&&this.addControl(new Vf,C.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",g=>{this._update(g.dataType==="style"),this.fire(new a.Event(`${g.dataType}data`,g))}),this.on("dataloading",g=>{this.fire(new a.Event(`${g.dataType}dataloading`,g))}),this.on("dataabort",g=>{this.fire(new a.Event("sourcedataabort",g))})}_getMapId(){return this._mapId}addControl(C,c){if(c===void 0&&(c=C.getDefaultPosition?C.getDefaultPosition():"top-right"),!C||!C.onAdd)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const g=C.onAdd(this);this._controls.push(C);const b=this._controlPositions[c];return c.indexOf("bottom")!==-1?b.insertBefore(g,b.firstChild):b.appendChild(g),this}removeControl(C){if(!C||!C.onRemove)return this.fire(new a.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const c=this._controls.indexOf(C);return c>-1&&this._controls.splice(c,1),C.onRemove(this),this}hasControl(C){return this._controls.indexOf(C)>-1}calculateCameraOptionsFromTo(C,c,g,b){return b==null&&this.style.terrain&&(b=this.transform.getElevation(g,this.style.terrain)),super.calculateCameraOptionsFromTo(C,c,g,b)}resize(C){const c=this._containerDimensions(),g=c[0],b=c[1];this._resizeCanvas(g,b,this.getPixelRatio()),this.transform.resize(g,b),this.painter.resize(g,b,this.getPixelRatio());const E=!this._moving;return E&&(this.stop(),this.fire(new a.Event("movestart",C)).fire(new a.Event("move",C))),this.fire(new a.Event("resize",C)),E&&this.fire(new a.Event("moveend",C)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(C){const[c,g]=this._containerDimensions();this._pixelRatio=C,this._resizeCanvas(c,g,C),this.painter.resize(c,g,C)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(C){return this.transform.setMaxBounds(a.LngLatBounds.convert(C)),this._update()}setMinZoom(C){if((C=C==null?-2:C)>=-2&&C<=this.transform.maxZoom)return this.transform.minZoom=C,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=C,this._update(),this.getZoom()>C&&this.setZoom(C),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(C){if((C=C==null?0:C)<0)throw new Error("minPitch must be greater than or equal to 0");if(C>=0&&C<=this.transform.maxPitch)return this.transform.minPitch=C,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(C>=this.transform.minPitch)return this.transform.maxPitch=C,this._update(),this.getPitch()>C&&this.setPitch(C),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(C){return this.transform.renderWorldCopies=C,this._update()}project(C){return this.transform.locationPoint(a.LngLat.convert(C),this.style&&this.style.terrain)}unproject(C){return this.transform.pointLocation(a.pointGeometry.convert(C),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(C,c,g){if(C==="mouseenter"||C==="mouseover"){let b=!1;return{layer:c,listener:g,delegates:{mousemove:A=>{const z=this.getLayer(c)?this.queryRenderedFeatures(A.point,{layers:[c]}):[];z.length?b||(b=!0,g.call(this,new Lo(C,this,A.originalEvent,{features:z}))):b=!1},mouseout:()=>{b=!1}}}}if(C==="mouseleave"||C==="mouseout"){let b=!1;return{layer:c,listener:g,delegates:{mousemove:z=>{(this.getLayer(c)?this.queryRenderedFeatures(z.point,{layers:[c]}):[]).length?b=!0:b&&(b=!1,g.call(this,new Lo(C,this,z.originalEvent)))},mouseout:z=>{b&&(b=!1,g.call(this,new Lo(C,this,z.originalEvent)))}}}}{const b=E=>{const A=this.getLayer(c)?this.queryRenderedFeatures(E.point,{layers:[c]}):[];A.length&&(E.features=A,g.call(this,E),delete E.features)};return{layer:c,listener:g,delegates:{[C]:b}}}}on(C,c,g){if(g===void 0)return super.on(C,c);const b=this._createDelegatedListener(C,c,g);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[C]=this._delegatedListeners[C]||[],this._delegatedListeners[C].push(b);for(const E in b.delegates)this.on(E,b.delegates[E]);return this}once(C,c,g){if(g===void 0)return super.once(C,c);const b=this._createDelegatedListener(C,c,g);for(const E in b.delegates)this.once(E,b.delegates[E]);return this}off(C,c,g){return g===void 0?super.off(C,c):(this._delegatedListeners&&this._delegatedListeners[C]&&(b=>{const E=this._delegatedListeners[C];for(let A=0;A{b?this.fire(new a.ErrorEvent(b)):E&&this._updateDiff(E,c)})}else typeof C=="object"&&this._updateDiff(C,c)}_updateDiff(C,c){try{this.style.setState(C)&&this._update(!0)}catch(g){a.warnOnce(`Unable to perform style diff: ${g.message||g.error||g}. Rebuilding the style from scratch.`),this._updateStyle(C,c)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():a.warnOnce("There is no style added to the map.")}addSource(C,c){return this._lazyInitEmptyStyle(),this.style.addSource(C,c),this._update(!0)}isSourceLoaded(C){const c=this.style&&this.style.sourceCaches[C];if(c!==void 0)return c.loaded();this.fire(new a.ErrorEvent(new Error(`There is no source with ID '${C}'`)))}setTerrain(C){return this.style.setTerrain(C),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const C=this.style&&this.style.sourceCaches;for(const c in C){const g=C[c]._tiles;for(const b in g){const E=g[b];if(E.state!=="loaded"&&E.state!=="errored")return!1}}return!0}addSourceType(C,c,g){return this._lazyInitEmptyStyle(),this.style.addSourceType(C,c,g)}removeSource(C){return this.style.removeSource(C),this._update(!0)}getSource(C){return this.style.getSource(C)}addImage(C,c,{pixelRatio:g=1,sdf:b=!1,stretchX:E,stretchY:A,content:z}={}){if(this._lazyInitEmptyStyle(),c instanceof HTMLImageElement||a.isImageBitmap(c)){const{width:j,height:K,data:Y}=a.exported.getImageData(c);this.style.addImage(C,{data:new a.RGBAImage({width:j,height:K},Y),pixelRatio:g,stretchX:E,stretchY:A,content:z,sdf:b,version:0})}else{if(c.width===void 0||c.height===void 0)return this.fire(new a.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`")));{const{width:j,height:K,data:Y}=c,ie=c;this.style.addImage(C,{data:new a.RGBAImage({width:j,height:K},new Uint8Array(Y)),pixelRatio:g,stretchX:E,stretchY:A,content:z,sdf:b,version:0,userImage:ie}),ie.onAdd&&ie.onAdd(this,C)}}}updateImage(C,c){const g=this.style.getImage(C);if(!g)return this.fire(new a.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const b=c instanceof HTMLImageElement||a.isImageBitmap(c)?a.exported.getImageData(c):c,{width:E,height:A,data:z}=b;if(E===void 0||A===void 0)return this.fire(new a.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(E!==g.data.width||A!==g.data.height)return this.fire(new a.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const j=!(c instanceof HTMLImageElement||a.isImageBitmap(c));g.data.replace(z,j),this.style.updateImage(C,g)}hasImage(C){return C?!!this.style.getImage(C):(this.fire(new a.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(C){this.style.removeImage(C)}loadImage(C,c){a.getImage(this._requestManager.transformRequest(C,a.ResourceType.Image),c)}listImages(){return this.style.listImages()}addLayer(C,c){return this._lazyInitEmptyStyle(),this.style.addLayer(C,c),this._update(!0)}moveLayer(C,c){return this.style.moveLayer(C,c),this._update(!0)}removeLayer(C){return this.style.removeLayer(C),this._update(!0)}getLayer(C){return this.style.getLayer(C)}setLayerZoomRange(C,c,g){return this.style.setLayerZoomRange(C,c,g),this._update(!0)}setFilter(C,c,g={}){return this.style.setFilter(C,c,g),this._update(!0)}getFilter(C){return this.style.getFilter(C)}setPaintProperty(C,c,g,b={}){return this.style.setPaintProperty(C,c,g,b),this._update(!0)}getPaintProperty(C,c){return this.style.getPaintProperty(C,c)}setLayoutProperty(C,c,g,b={}){return this.style.setLayoutProperty(C,c,g,b),this._update(!0)}getLayoutProperty(C,c){return this.style.getLayoutProperty(C,c)}setLight(C,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(C,c),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(C,c){return this.style.setFeatureState(C,c),this._update()}removeFeatureState(C,c){return this.style.removeFeatureState(C,c),this._update()}getFeatureState(C){return this.style.getFeatureState(C)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let C=0,c=0;return this._container&&(C=this._container.clientWidth||400,c=this._container.clientHeight||300),[C,c]}_setupContainer(){const C=this._container;C.classList.add("maplibregl-map","mapboxgl-map");const c=this._canvasContainer=v.create("div","maplibregl-canvas-container mapboxgl-canvas-container",C);this._interactive&&c.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=v.create("canvas","maplibregl-canvas mapboxgl-canvas",c),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");const g=this._containerDimensions();this._resizeCanvas(g[0],g[1],this.getPixelRatio());const b=this._controlContainer=v.create("div","maplibregl-control-container mapboxgl-control-container",C),E=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(A=>{E[A]=v.create("div",`maplibregl-ctrl-${A} mapboxgl-ctrl-${A}`,b)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const C=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=v.create("div","maplibregl-cooperative-gesture-screen",C);let c="Control",g=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";navigator.platform.indexOf("Mac")===0&&(g=typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use \u2318 + scroll to zoom the map",c="Meta"),this._cooperativeGesturesScreen.innerHTML=`
${g}
${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}
`,document.addEventListener("keydown",b=>{b.key===c&&(this._metaPress=!0)}),document.addEventListener("keyup",b=>{b.key===c&&(this._metaPress=!1)}),this._canvasContainer.addEventListener("wheel",b=>{this._onCooperativeGesture(b,this._metaPress,1)},!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(C,c,g){this._canvas.width=g*C,this._canvas.height=g*c,this._canvas.style.width=`${C}px`,this._canvas.style.height=`${c}px`}_setupPainter(){const C=a.extend({},u.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),c=this._canvas.getContext("webgl",C)||this._canvas.getContext("experimental-webgl",C);c?(this.painter=new Xp(c,this.transform),a.exported$1.testSupport(c)):this.fire(new a.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(C){C.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new a.Event("webglcontextlost",{originalEvent:C}))}_contextRestored(C){this._setupPainter(),this.resize(),this._update(),this.fire(new a.Event("webglcontextrestored",{originalEvent:C}))}_onMapScroll(C){if(C.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(C,c,g){return!c&&g<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout(()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")},100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(C){return this.style?(this._styleDirty=this._styleDirty||C,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(C){return this._update(),this._renderTaskQueue.add(C)}_cancelRenderFrame(C){this._renderTaskQueue.remove(C)}_render(C){let c,g=0;const b=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(c=b.createQueryEXT(),b.beginQueryEXT(b.TIME_ELAPSED_EXT,c),g=a.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(C),this._removed)return;let E=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const z=this.transform.zoom,j=a.exported.now();this.style.zoomHistory.update(z,j);const K=new a.EvaluationParameters(z,{now:j,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),Y=K.crossFadingFactor();Y===1&&Y===this._crossFadingFactor||(E=!0,this._crossFadingFactor=Y),this.style.update(K)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),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 a.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.load),this.fire(new a.Event("load"))),this.style&&(this.style.hasTransitions()||E)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const z=a.exported.now()-g;b.endQueryEXT(b.TIME_ELAPSED_EXT,c),setTimeout(()=>{const j=b.getQueryObjectEXT(c,b.QUERY_RESULT_EXT)/1e6;b.deleteQueryEXT(c),this.fire(new a.Event("gpu-timing-frame",{cpuTime:z,gpuTime:j}))},50)}if(this.listens("gpu-timing-layer")){const z=this.painter.collectGpuTimers();setTimeout(()=>{const j=this.painter.queryGpuTimers(z);this.fire(new a.Event("gpu-timing-layer",{layerTimes:j}))},50)}const A=this._sourcesDirty||this._styleDirty||this._placementDirty;return A||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new a.Event("idle")),!this._loaded||this._fullyLoaded||A||(this._fullyLoaded=!0,a.PerformanceUtils.mark(a.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const c of this._controls)c.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),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));const C=this.painter.context.gl.getExtension("WEBGL_lose_context");C&&C.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),v.remove(this._canvasContainer),v.remove(this._controlContainer),this._cooperativeGestures&&v.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),a.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new a.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=a.exported.frame(C=>{a.PerformanceUtils.frame(C),this._frame=null,this._render(C)}))}_onWindowOnline(){this._update()}_onWindowResize(C){this._trackResize&&this.resize({originalEvent:C})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(C){this._showTileBoundaries!==C&&(this._showTileBoundaries=C,this._update())}get showPadding(){return!!this._showPadding}set showPadding(C){this._showPadding!==C&&(this._showPadding=C,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(C){this._showCollisionBoxes!==C&&(this._showCollisionBoxes=C,C?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(C){this._showOverdrawInspector!==C&&(this._showOverdrawInspector=C,this._update())}get repaint(){return!!this._repaint}set repaint(C){this._repaint!==C&&(this._repaint=C,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(C){this._vertices=C,this._update()}_setCacheLimits(C,c){a.setCacheLimits(C,c)}get version(){return"2.4.0"}},NavigationControl:class{constructor(C){this.options=a.extend({},Kw,C),this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",c=>c.preventDefault()),this.options.showZoom&&(a.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",c=>this._map.zoomIn({},{originalEvent:c})),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",c=>this._map.zoomOut({},{originalEvent:c})),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(a.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",c=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:c}):this._map.resetNorth({},{originalEvent:c})}),this._compassIcon=v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const C=this._map.getZoom(),c=C===this._map.getMaxZoom(),g=C===this._map.getMinZoom();this._zoomInButton.disabled=c,this._zoomOutButton.disabled=g,this._zoomInButton.setAttribute("aria-disabled",c.toString()),this._zoomOutButton.setAttribute("aria-disabled",g.toString())}_rotateCompassArrow(){const C=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=C}onAdd(C){return this._map=C,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 ja(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){v.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(C,c){const g=v.create("button",C,this._container);return g.type="button",g.addEventListener("click",c),g}_setButtonTitle(C,c){const g=this._map._getUIString(`NavigationControl.${c}`);C.title=g,C.setAttribute("aria-label",g)}},GeolocateControl:class extends a.Evented{constructor(C){super(),this.options=a.extend({},am,C),a.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(C){var c;return this._map=C,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),c=this._setupUI,Ys!==void 0?c(Ys):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(g=>{Ys=g.state!=="denied",c(Ys)}):(Ys=!!window.navigator.geolocation,c(Ys)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),v.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,ji=0,Qs=!1}_isOutOfMapMaxBounds(C){const c=this._map.getMaxBounds(),g=C.coords;return c&&(g.longitudec.getEast()||g.latitudec.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(C){if(this._map){if(this._isOutOfMapMaxBounds(C))return this._setErrorState(),this.fire(new a.Event("outofmaxbounds",C)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=C,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(C),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(C),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("geolocate",C)),this._finish()}}_updateCamera(C){const c=new a.LngLat(C.coords.longitude,C.coords.latitude),g=C.coords.accuracy,b=this._map.getBearing(),E=a.extend({bearing:b},this.options.fitBoundsOptions);this._map.fitBounds(c.toBounds(g),E,{geolocateSource:!0})}_updateMarker(C){if(C){const c=new a.LngLat(C.coords.longitude,C.coords.latitude);this._accuracyCircleMarker.setLngLat(c).addTo(this._map),this._userLocationDotMarker.setLngLat(c).addTo(this._map),this._accuracy=C.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const C=this._map._container.clientHeight/2,c=this._map.unproject([0,C]),g=this._map.unproject([1,C]),b=c.distanceTo(g),E=Math.ceil(2*this._accuracy/b);this._circleElement.style.width=`${E}px`,this._circleElement.style.height=`${E}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(C){if(this._map){if(this.options.trackUserLocation)if(C.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const c=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=c,this._geolocateButton.setAttribute("aria-label",c),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(C.code===3&&Qs)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new a.Event("error",C)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(C){if(this._container.addEventListener("contextmenu",c=>c.preventDefault()),this._geolocateButton=v.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",C===!1){a.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const c=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=c,this._geolocateButton.setAttribute("aria-label",c)}else{const c=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=c,this._geolocateButton.setAttribute("aria-label",c)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=v.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ou(this._dotElement),this._circleElement=v.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ou({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",c=>{c.geolocateSource||this._watchState!=="ACTIVE_LOCK"||c.originalEvent&&c.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new a.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return a.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 a.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":ji--,Qs=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new a.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new a.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let C;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),ji++,ji>1?(C={maximumAge:6e5,timeout:0},Qs=!0):(C=this.options.positionOptions,Qs=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,C)}}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","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:od,LogoControl:Vf,ScaleControl:class{constructor(C){this.options=a.extend({},Ha,C),a.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){ey(this._map,this._container,this.options)}onAdd(C){return this._map=C,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",C.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){v.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(C){this.options.unit=C,ey(this._map,this._container,this.options)}},FullscreenControl:class{constructor(C){this._fullscreen=!1,C&&C.container&&(C.container instanceof HTMLElement?this._container=C.container:a.warnOnce("Full screen control 'container' must be a DOM element.")),a.bindAll(["_onClickFullscreen","_changeIcon"],this),"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(C){return this._map=C,this._container||(this._container=this._map.getContainer()),this._controlContainer=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",a.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){v.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){const C=this._fullscreenButton=v.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);v.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",C).setAttribute("aria-hidden","true"),C.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const C=this._getTitle();this._fullscreenButton.setAttribute("aria-label",C),this._fullscreenButton.title=C}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?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._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},TerrainControl:class{constructor(C){this.options=C,a.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(C){return this._map=C,this._container=v.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=v.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),v.create("span","maplibregl-ctrl-icon mapboxgl-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(){v.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends a.Evented{constructor(C){super(),this.options=a.extend(Object.create(ii),C),a.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(C){return this._map&&this.remove(),this._map=C,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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new a.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&v.remove(this._content),this._container&&(v.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 a.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(C){return this._lngLat=a.LngLat.convert(C),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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(C){return this.setDOMContent(document.createTextNode(C))}setHTML(C){const c=document.createDocumentFragment(),g=document.createElement("body");let b;for(g.innerHTML=C;b=g.firstChild,b;)c.appendChild(b);return this.setDOMContent(c)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(C){return this.options.maxWidth=C,this._update(),this}setDOMContent(C){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=v.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(C),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(C){this._container&&this._container.classList.add(C)}removeClassName(C){this._container&&this._container.classList.remove(C)}setOffset(C){return this.options.offset=C,this._update(),this}toggleClassName(C){if(this._container)return this._container.classList.toggle(C)}_createCloseButton(){this.options.closeButton&&(this._closeButton=v.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(C){this._update(C.point)}_onMouseMove(C){this._update(C.point)}_onDrag(C){this._update(C.point)}_update(C){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=v.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=v.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(A=>this._container.classList.add(A)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","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=ad(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!C))return;const c=this._pos=this._trackPointer&&C?C:this._map.project(this._lngLat);let g=this.options.anchor;const b=sm(this.options.offset);if(!g){const A=this._container.offsetWidth,z=this._container.offsetHeight;let j;j=c.y+b.bottom.ythis._map.transform.height-z?["bottom"]:[],c.xthis._map.transform.width-A/2&&j.push("right"),g=j.length===0?"bottom":j.join("-")}const E=c.add(b[g]).round();v.setTransform(this._container,`${wn[g]} translate(${E.x}px,${E.y}px)`),Dn(this._container,g,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const C=this._container.querySelector(gi);C&&C.focus()}_onClose(){this.remove()}},Marker:Ou,Style:Vr,LngLat:a.LngLat,LngLatBounds:a.LngLatBounds,Point:a.pointGeometry,MercatorCoordinate:a.MercatorCoordinate,Evented:a.Evented,AJAXError:a.AJAXError,config:a.config,CanvasSource:be,GeoJSONSource:se,ImageSource:he,RasterDEMTileSource:ne,RasterTileSource:Q,VectorTileSource:Z,VideoSource:_e,prewarm:function(){mt().acquire(St)},clearPrewarmedResources:function(){const C=Qe;C&&(C.isPreloaded()&&C.numActive()===1?(C.release(St),Qe=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 version(){return"2.4.0"},get workerCount(){return We.workerCount},set workerCount(C){We.workerCount=C},get maxParallelImageRequests(){return a.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(C){a.config.MAX_PARALLEL_IMAGE_REQUESTS=C},clearStorage(C){a.clearTileCache(C)},workerUrl:"",addProtocol(C,c){a.config.REGISTERED_PROTOCOLS[C]=c},removeProtocol(C){delete a.config.REGISTERED_PROTOCOLS[C]}};return ea.extend(Nl,{isSafari:a.isSafari,getPerformanceMetrics:a.PerformanceUtils.getPerformanceMetrics}),Nl});var s=i;return s})})(xz);const QY=xz.exports,JY="modulepreload",eQ=function(e){return"/"+e},PA={},tQ=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=eQ(o),o in PA)return;PA[o]=!0;const s=o.endsWith(".css"),a=s?'[rel="stylesheet"]':"";if(!!r)for(let p=i.length-1;p>=0;p--){const m=i[p];if(m.href===o&&(!s||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${a}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":JY,s||(d.as="script",d.crossOrigin=""),d.href=o,document.head.appendChild(d),s)return new Promise((p,m)=>{d.addEventListener("load",p),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())},KP=w.exports.createContext(null),nQ=e=>{const[t,n]=w.exports.useState({}),r=w.exports.useCallback((o,s="default")=>{n(a=>{if(s==="current")throw new Error("'current' cannot be used as map id");if(a[s])throw new Error(`Multiple maps with the same id: ${s}`);return{...a,[s]:o}})},[]),i=w.exports.useCallback((o="default")=>{n(s=>{if(s[o]){const a={...s};return delete a[o],a}return s})},[]);return I(KP.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i},children:e.children})};function WP(){var e;const t=(e=w.exports.useContext(KP))===null||e===void 0?void 0:e.maps,n=w.exports.useContext(hf);return w.exports.useMemo(()=>({...t,current:n==null?void 0:n.map}),[t,n])}function rQ(e){const t=e.clone();return t.pixelsToGLUnits=e.pixelsToGLUnits,t}function IA(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function TA(e,t){const n=t.viewState||t;let r=!1;if("longitude"in n&&"latitude"in n){const i=e.center;e.center=new i.constructor(n.longitude,n.latitude),r=r||i!==e.center}if("zoom"in n){const i=e.zoom;e.zoom=n.zoom,r=r||i!==e.zoom}if("bearing"in n){const i=e.bearing;e.bearing=n.bearing,r=r||i!==e.bearing}if("pitch"in n){const i=e.pitch;e.pitch=n.pitch,r=r||i!==e.pitch}return n.padding&&!e.isPaddingEqual(n.padding)&&(r=!0,e.padding=n.padding),r}const iQ=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function kA(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const t={};for(const r of e.layers)t[r.id]=r;const n=e.layers.map(r=>{const i=t[r.ref];let o=null;if("interactive"in r&&(o={...r},delete o.interactive),i){o=o||{...r},delete o.ref;for(const s of iQ)s in i&&(o[s]=i[s])}return o||r});return{...e,layers:n}}function oQ(e,t){const n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,o=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===o}function os(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n{const o=this.props[RA[i.type]];o&&o(i)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const o=this.props[MA[i.type]];if(o){if(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"){const s=this._hoveredFeatures||this._map.queryRenderedFeatures(i.point,{layers:this.props.interactiveLayerIds});i.features=s}o(i),delete i.features}},this._onCameraEvent=i=>{if(!this._internalUpdate){const o=this.props[uC[i.type]];o&&o(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=t,this.props=n,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(t){const n=this.props;this.props=t;const r=this._updateSettings(t,n);r&&this._createShadowTransform(this._map);const i=this._updateSize(t),o=this._updateViewState(t,!0);this._updateStyle(t,n),this._updateStyleComponents(t,n),this._updateHandlers(t,n),(r||i||o&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){const r=Xh.savedMaps.pop();if(!r)return null;const i=r.map,o=i.getContainer();for(n.className=o.className;o.childNodes.length>0;)n.appendChild(o.childNodes[0]);i._container=n,r.setProps({...t,styleDiffing:!1}),i.resize();const{initialViewState:s}=t;return s&&(s.bounds?i.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):r._updateViewState(s,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),r}_initialize(t){const{props:n}=this,r={...n,...n.initialViewState,accessToken:n.mapboxAccessToken||lQ()||null,container:t,style:kA(n.mapStyle)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),n.gl){const d=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=d,n.gl)}const o=new this._MapClass(r);i.padding&&o.setPadding(i.padding),n.cursor&&(o.getCanvas().style.cursor=n.cursor),this._createShadowTransform(o);const s=o._render;o._render=d=>{this._inRender=!0,s.call(o,d),this._inRender=!1};const a=o._renderTaskQueue.run;o._renderTaskQueue.run=d=>{a.call(o._renderTaskQueue,d),this._onBeforeRepaint()},o.on("render",()=>this._onAfterRepaint());const u=o.fire;o.fire=this._fireEvent.bind(this,u),o.on("resize",()=>{this._renderTransform.resize(o.transform.width,o.transform.height)}),o.on("styledata",()=>this._updateStyleComponents(this.props,{})),o.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const d in MA)o.on(d,this._onPointerEvent);for(const d in uC)o.on(d,this._onCameraEvent);for(const d in RA)o.on(d,this._onEvent);this._map=o}recycle(){const n=this.map.getContainer().querySelector("[mapboxgl-children]");n==null||n.remove(),Xh.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const t=this._map;!this._inRender&&t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}_createShadowTransform(t){const n=rQ(t.transform);t.painter.transform=n,this._renderTransform=n}_updateSize(t){const{viewState:n}=t;if(n){const r=this._map;if(n.width!==r.transform.width||n.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(t,n){if(this._internalUpdate)return!1;const r=this._map,i=this._renderTransform,{zoom:o,pitch:s,bearing:a}=i,u=r.isMoving();u&&(i.cameraElevationReference="sea");const d=TA(i,{...IA(r.transform),...t});if(u&&(i.cameraElevationReference="ground"),d&&n){const p=this._deferredEvents;p.move=!0,p.zoom||(p.zoom=o!==i.zoom),p.rotate||(p.rotate=a!==i.bearing),p.pitch||(p.pitch=s!==i.pitch)}return u||TA(r.transform,t),d}_updateSettings(t,n){const r=this._map;let i=!1;for(const o of aQ)o in t&&!os(t[o],n[o])&&(i=!0,r[`set${o[0].toUpperCase()}${o.slice(1)}`](t[o]));return i}_updateStyle(t,n){if(t.cursor!==n.cursor&&(this._map.getCanvas().style.cursor=t.cursor),t.mapStyle!==n.mapStyle){const r={diff:t.styleDiffing};return"localIdeographFontFamily"in t&&(r.localIdeographFontFamily=t.localIdeographFontFamily),this._map.setStyle(kA(t.mapStyle),r),!0}return!1}_updateStyleComponents(t,n){const r=this._map;let i=!1;return r.style.loaded()&&("light"in t&&!os(t.light,n.light)&&(i=!0,r.setLight(t.light)),"fog"in t&&!os(t.fog,n.fog)&&(i=!0,r.setFog(t.fog)),"terrain"in t&&!os(t.terrain,n.terrain)&&(!t.terrain||r.getSource(t.terrain.source))&&(i=!0,r.setTerrain(t.terrain))),i}_updateHandlers(t,n){const r=this._map;let i=!1;for(const o of sQ){const s=t[o];os(s,n[o])||(i=!0,s?r[o].enable(s):r[o].disable())}return i}_updateHover(t){var n;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const o=t.type,s=((n=this._hoveredFeatures)===null||n===void 0?void 0:n.length)>0;let a;if(o==="mousemove")try{a=this._map.queryRenderedFeatures(t.point,{layers:r.interactiveLayerIds})}catch{a=[]}else a=[];const u=a.length>0;!u&&s&&(t.type="mouseleave",this._onPointerEvent(t)),this._hoveredFeatures=a,u&&!s&&(t.type="mouseenter",this._onPointerEvent(t)),t.type=o}else this._hoveredFeatures=null}_fireEvent(t,n,r){const i=this._map,o=i.transform,s=typeof n=="string"?n:n.type;return s==="move"&&this._updateViewState(this.props,!1),s in uC&&(typeof n=="object"&&(n.viewState=IA(o)),this._map.isMoving())?(i.transform=this._renderTransform,t.call(i,n,r),i.transform=o,i):(t.call(i,n,r),i)}_onBeforeRepaint(){const t=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&t.fire(r);this._internalUpdate=!1;const n=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=n}}}Xh.savedMaps=[];function lQ(){let e=null;if(typeof location<"u"){const t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||{}.MapboxAccessToken}catch{}try{e=e||{}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const uQ=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function cQ(e,t){if(!e)return null;const n=e.map,r={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:i=>e.transform.locationPoint(t.LngLat.convert(i)),unproject:i=>e.transform.pointLocation(t.Point.convert(i)),queryTerrainElevation:(i,o)=>{const s=n.transform;n.transform=e.transform;const a=n.queryTerrainElevation(i,o);return n.transform=s,a}};for(const i of dQ(n))!(i in r)&&!uQ.includes(i)&&(r[i]=n[i].bind(n));return r}function dQ(e){const t=new Set;let n=e;for(;n;){for(const r of Object.getOwnPropertyNames(n))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}const fQ=typeof document<"u"?w.exports.useLayoutEffect:w.exports.useEffect,hQ=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function pQ(e,t){for(const n of hQ)n in t&&(e[n]=t[n]);t.RTLTextPlugin&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(t.RTLTextPlugin,n=>{n&&console.error(n)},!1)}const hf=w.exports.createContext(null),mQ={minZoom:0,maxZoom:22,minPitch:0,maxPitch:60,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,mapStyle:{version:8,sources:{},layers:[]},styleDiffing:!0,projection:"mercator",renderWorldCopies:!0,onError:e=>console.error(e.error),RTLTextPlugin:"https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"},GP=w.exports.forwardRef((e,t)=>{const n=w.exports.useContext(KP),[r,i]=w.exports.useState(null),o=w.exports.useRef(),{current:s}=w.exports.useRef({mapLib:null,map:null});w.exports.useEffect(()=>{const u=e.mapLib;let d=!0,p;return Promise.resolve(u||tQ(()=>import("./index.764e1a39.js").then(m=>m.i),[])).then(m=>{if(!!d){if(m.Map||(m=m.default),!m||!m.Map)throw new Error("Invalid mapLib");if(m.supported(e))pQ(m,e),e.reuseMaps&&(p=Xh.reuse(e,o.current)),p||(p=new Xh(m.Map,e,o.current)),s.map=cQ(p,m),s.mapLib=m,i(p),n==null||n.onMapMount(s.map,e.id);else throw new Error("Map is not supported by this browser")}}).catch(m=>{e.onError({type:"error",target:null,originalEvent:null,error:m})}),()=>{d=!1,p&&(n==null||n.onMapUnmount(e.id),e.reuseMaps?p.recycle():p.destroy())}},[]),fQ(()=>{r&&r.setProps(e)}),w.exports.useImperativeHandle(t,()=>s.map,[r]);const a=w.exports.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]);return I("div",{id:e.id,ref:o,style:a,children:r&&I(hf.Provider,{value:s,children:I("div",{"mapboxgl-children":"",children:e.children})})})});GP.displayName="Map";GP.defaultProps=mQ;const gQ=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function pf(e,t){if(!e||!t)return;const n=e.style;for(const r in t){const i=t[r];Number.isFinite(i)&&!gQ.test(r)?n[r]=`${i}px`:n[r]=i}}const vQ={draggable:!1,popup:null,rotation:0,rotationAlignment:"auto",pitchAlignment:"auto"};function _z(e){const{map:t,mapLib:n}=w.exports.useContext(hf),r=w.exports.useRef({props:e});r.current.props=e;const i=w.exports.useMemo(()=>{let o=!1;w.exports.Children.forEach(e.children,u=>{u&&(o=!0)});const s={...e,element:o?document.createElement("div"):null},a=new n.Marker(s).setLngLat([e.longitude,e.latitude]);return a.getElement().addEventListener("click",u=>{var d,p;(p=(d=r.current.props).onClick)===null||p===void 0||p.call(d,{type:"click",target:a,originalEvent:u})}),a.on("dragstart",u=>{var d,p;const m=u;m.lngLat=i.getLngLat(),(p=(d=r.current.props).onDragStart)===null||p===void 0||p.call(d,m)}),a.on("drag",u=>{var d,p;const m=u;m.lngLat=i.getLngLat(),(p=(d=r.current.props).onDrag)===null||p===void 0||p.call(d,m)}),a.on("dragend",u=>{var d,p;const m=u;m.lngLat=i.getLngLat(),(p=(d=r.current.props).onDragEnd)===null||p===void 0||p.call(d,m)}),a},[]);return w.exports.useEffect(()=>(i.addTo(t.getMap()),()=>{i.remove()}),[]),w.exports.useEffect(()=>{pf(i.getElement(),e.style)},[e.style]),(i.getLngLat().lng!==e.longitude||i.getLngLat().lat!==e.latitude)&&i.setLngLat([e.longitude,e.latitude]),e.offset&&!oQ(i.getOffset(),e.offset)&&i.setOffset(e.offset),i.isDraggable()!==e.draggable&&i.setDraggable(e.draggable),i.getRotation()!==e.rotation&&i.setRotation(e.rotation),i.getRotationAlignment()!==e.rotationAlignment&&i.setRotationAlignment(e.rotationAlignment),i.getPitchAlignment()!==e.pitchAlignment&&i.setPitchAlignment(e.pitchAlignment),i.getPopup()!==e.popup&&i.setPopup(e.popup),Cl.exports.createPortal(e.children,i.getElement())}_z.defaultProps=vQ;w.exports.memo(_z);function AA(e){return new Set(e?e.trim().split(/\s+/):[])}function yQ(e){const{map:t,mapLib:n}=w.exports.useContext(hf),r=w.exports.useMemo(()=>document.createElement("div"),[]),i=w.exports.useRef({props:e});i.current.props=e;const o=w.exports.useMemo(()=>{const s={...e},a=new n.Popup(s).setLngLat([e.longitude,e.latitude]);return a.once("open",u=>{var d,p;(p=(d=i.current.props).onOpen)===null||p===void 0||p.call(d,u)}),a},[]);if(w.exports.useEffect(()=>{const s=a=>{var u,d;(d=(u=i.current.props).onClose)===null||d===void 0||d.call(u,a)};return o.on("close",s),o.setDOMContent(r).addTo(t.getMap()),()=>{o.off("close",s),o.isOpen()&&o.remove()}},[]),w.exports.useEffect(()=>{pf(o.getElement(),e.style)},[e.style]),o.isOpen()&&((o.getLngLat().lng!==e.longitude||o.getLngLat().lat!==e.latitude)&&o.setLngLat([e.longitude,e.latitude]),e.offset&&!os(o.options.offset,e.offset)&&o.setOffset(e.offset),(o.options.anchor!==e.anchor||o.options.maxWidth!==e.maxWidth)&&(o.options.anchor=e.anchor,o.setMaxWidth(e.maxWidth)),o.options.className!==e.className)){const s=AA(o.options.className),a=AA(e.className);for(const u of s)a.has(u)||o.removeClassName(u);for(const u of a)s.has(u)||o.addClassName(u);o.options.className=e.className}return Cl.exports.createPortal(e.children,r)}const xQ=w.exports.memo(yQ);function Fv(e,t,n,r){const i=w.exports.useContext(hf),o=w.exports.useMemo(()=>e(i),[]);return w.exports.useEffect(()=>{const s=r||n||t,a=typeof t=="function"&&typeof n=="function"?t:null,u=typeof n=="function"?n:typeof t=="function"?t:null,{map:d}=i;return d.hasControl(o)||(d.addControl(o,s==null?void 0:s.position),a&&a(i)),()=>{u&&u(i),d.hasControl(o)&&d.removeControl(o)}},[]),o}function bQ(e){const t=Fv(({mapLib:n})=>new n.AttributionControl(e),{position:e.position});return w.exports.useEffect(()=>{pf(t._container,e.style)},[e.style]),null}w.exports.memo(bQ);function _Q(e){const t=Fv(({mapLib:n})=>new n.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return w.exports.useEffect(()=>{pf(t._controlContainer,e.style)},[e.style]),null}w.exports.memo(_Q);const wz=w.exports.forwardRef((e,t)=>{const n=w.exports.useRef({props:e}),r=Fv(({mapLib:i})=>{const o=new i.GeolocateControl(e),s=o._setupUI;return o._setupUI=a=>{o._container.hasChildNodes()||s(a)},o.on("geolocate",a=>{var u,d;(d=(u=n.current.props).onGeolocate)===null||d===void 0||d.call(u,a)}),o.on("error",a=>{var u,d;(d=(u=n.current.props).onError)===null||d===void 0||d.call(u,a)}),o.on("outofmaxbounds",a=>{var u,d;(d=(u=n.current.props).onOutOfMaxBounds)===null||d===void 0||d.call(u,a)}),o.on("trackuserlocationstart",a=>{var u,d;(d=(u=n.current.props).onTrackUserLocationStart)===null||d===void 0||d.call(u,a)}),o.on("trackuserlocationend",a=>{var u,d;(d=(u=n.current.props).onTrackUserLocationEnd)===null||d===void 0||d.call(u,a)}),o},{position:e.position});return n.current.props=e,w.exports.useImperativeHandle(t,()=>({trigger:()=>r.trigger()}),[]),w.exports.useEffect(()=>{pf(r._container,e.style)},[e.style]),null});wz.displayName="GeolocateControl";w.exports.memo(wz);function wQ(e){const t=Fv(({mapLib:n})=>new n.NavigationControl(e),{position:e.position});return w.exports.useEffect(()=>{pf(t._container,e.style)},[e.style]),null}w.exports.memo(wQ);const CQ={unit:"metric",maxWidth:100};function Cz(e){const t=Fv(({mapLib:n})=>new n.ScaleControl(e),{position:e.position});return(t.options.unit!==e.unit||t.options.maxWidth!==e.maxWidth)&&(t.options.maxWidth=e.maxWidth,t.setUnit(e.unit)),w.exports.useEffect(()=>{pf(t._container,e.style)},[e.style]),null}Cz.defaultProps=CQ;w.exports.memo(Cz);function Y1(e,t){if(!e)throw new Error(t)}let SQ=0;function EQ(e,t,n){if(e.style&&e.style._loaded){const r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function PQ(e,t,n){Y1(t.id===n.id,"source id changed"),Y1(t.type===n.type,"source type changed");let r="",i=0;for(const s in t)s!=="children"&&s!=="id"&&!os(n[s],t[s])&&(r=s,i++);if(!i)return;const o=t.type;if(o==="geojson")e.setData(t.data);else if(o==="image")e.updateImage({url:t.url,coordinates:t.coordinates});else if((o==="canvas"||o==="video")&&i===1&&r==="coordinates")e.setCoordinates(t.coordinates);else if(o==="vector"&&"setUrl"in e)switch(r){case"url":e.setUrl(t.url);break;case"tiles":e.setTiles(t.tiles);break}else console.warn(`Unable to update prop: ${r}`)}function Od(e){const t=w.exports.useContext(hf).map.getMap(),n=w.exports.useRef(e),[,r]=w.exports.useState(0),i=w.exports.useMemo(()=>e.id||`jsx-source-${SQ++}`,[]);w.exports.useEffect(()=>{if(t){const s=()=>setTimeout(()=>r(a=>a+1),0);return t.on("styledata",s),s(),()=>{var a;if(t.off("styledata",s),t.style&&t.style._loaded&&t.getSource(i)){const u=(a=t.getStyle())===null||a===void 0?void 0:a.layers;if(u)for(const d of u)d.source===i&&t.removeLayer(d.id);t.removeSource(i)}}}},[t]);let o=t&&t.style&&t.getSource(i);return o?PQ(o,e,n.current):o=EQ(t,i,e),n.current=e,o&&w.exports.Children.map(e.children,s=>s&&w.exports.cloneElement(s,{source:i}))||null}function IQ(e,t,n,r){if(Y1(n.id===r.id,"layer id changed"),Y1(n.type===r.type,"layer type changed"),n.type==="custom"||r.type==="custom")return;const{layout:i={},paint:o={},filter:s,minzoom:a,maxzoom:u,beforeId:d}=n;if(d!==r.beforeId&&e.moveLayer(t,d),i!==r.layout){const p=r.layout||{};for(const m in i)os(i[m],p[m])||e.setLayoutProperty(t,m,i[m]);for(const m in p)i.hasOwnProperty(m)||e.setLayoutProperty(t,m,void 0)}if(o!==r.paint){const p=r.paint||{};for(const m in o)os(o[m],p[m])||e.setPaintProperty(t,m,o[m]);for(const m in p)o.hasOwnProperty(m)||e.setPaintProperty(t,m,void 0)}os(s,r.filter)||e.setFilter(t,s),(a!==r.minzoom||u!==r.maxzoom)&&e.setLayerZoomRange(t,a,u)}function TQ(e,t,n){if(e.style&&e.style._loaded&&(!("source"in n)||e.getSource(n.source))){const r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}let kQ=0;function ps(e){const t=w.exports.useContext(hf).map.getMap(),n=w.exports.useRef(e),[,r]=w.exports.useState(0),i=w.exports.useMemo(()=>e.id||`jsx-layer-${kQ++}`,[]);if(w.exports.useEffect(()=>{if(t){const s=()=>r(a=>a+1);return t.on("styledata",s),s(),()=>{t.off("styledata",s),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{IQ(t,i,e,n.current)}catch(s){console.warn(s)}else TQ(t,i,e);return n.current=e,null}function MQ(){for(var e=0,t,n,r="";ee&&(t=0,r=n,n=new Map)}return{get:function(s){var a=n.get(s);if(a!==void 0)return a;if((a=r.get(s))!==void 0)return i(s,a),a},set:function(s,a){n.has(s)?n.set(s,a):i(s,a)}}}var Pz="!";function FQ(e){var t=e.separator||":";return function(r){for(var i=0,o=[],s=0,a=0;at=>{const n=Mz.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),xu=e=>(e=e.toLowerCase(),t=>XP(t)===e),f_=e=>t=>typeof t===e,{isArray:yp}=Array,ov=f_("undefined");function nJ(e){return e!==null&&!ov(e)&&e.constructor!==null&&!ov(e.constructor)&&kc(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Rz=xu("ArrayBuffer");function rJ(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Rz(e.buffer),t}const iJ=f_("string"),kc=f_("function"),Az=f_("number"),YP=e=>e!==null&&typeof e=="object",oJ=e=>e===!0||e===!1,Gx=e=>{if(XP(e)!=="object")return!1;const t=ZP(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},aJ=xu("Date"),sJ=xu("File"),lJ=xu("Blob"),uJ=xu("FileList"),cJ=e=>YP(e)&&kc(e.pipe),dJ=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Mz.call(e)===t||kc(e.toString)&&e.toString()===t)},fJ=xu("URLSearchParams"),hJ=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zv(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),yp(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Oz=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Nz=e=>!ov(e)&&e!==Oz;function GS(){const{caseless:e}=Nz(this)&&this||{},t={},n=(r,i)=>{const o=e&&Dz(t,i)||i;Gx(t[o])&&Gx(r)?t[o]=GS(t[o],r):Gx(r)?t[o]=GS({},r):yp(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(zv(t,(i,o)=>{n&&kc(i)?e[o]=kz(i,n):e[o]=i},{allOwnKeys:r}),e),mJ=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),gJ=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},vJ=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&ZP(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},yJ=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},xJ=e=>{if(!e)return null;if(yp(e))return e;let t=e.length;if(!Az(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},bJ=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ZP(Uint8Array)),_J=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},wJ=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},CJ=xu("HTMLFormElement"),SJ=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),LA=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),EJ=xu("RegExp"),Lz=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};zv(n,(i,o)=>{t(i,o,e)!==!1&&(r[o]=i)}),Object.defineProperties(e,r)},PJ=e=>{Lz(e,(t,n)=>{if(kc(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(!!kc(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},IJ=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return yp(e)?r(e):r(String(e).split(t)),n},TJ=()=>{},kJ=(e,t)=>(e=+e,Number.isFinite(e)?e:t),dC="abcdefghijklmnopqrstuvwxyz",FA="0123456789",Fz={DIGIT:FA,ALPHA:dC,ALPHA_DIGIT:dC+dC.toUpperCase()+FA},MJ=(e=16,t=Fz.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function RJ(e){return!!(e&&kc(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const AJ=e=>{const t=new Array(10),n=(r,i)=>{if(YP(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=yp(r)?[]:{};return zv(r,(s,a)=>{const u=n(s,i+1);!ov(u)&&(o[a]=u)}),t[i]=void 0,o}}return r};return n(e,0)},Ft={isArray:yp,isArrayBuffer:Rz,isBuffer:nJ,isFormData:dJ,isArrayBufferView:rJ,isString:iJ,isNumber:Az,isBoolean:oJ,isObject:YP,isPlainObject:Gx,isUndefined:ov,isDate:aJ,isFile:sJ,isBlob:lJ,isRegExp:EJ,isFunction:kc,isStream:cJ,isURLSearchParams:fJ,isTypedArray:bJ,isFileList:uJ,forEach:zv,merge:GS,extend:pJ,trim:hJ,stripBOM:mJ,inherits:gJ,toFlatObject:vJ,kindOf:XP,kindOfTest:xu,endsWith:yJ,toArray:xJ,forEachEntry:_J,matchAll:wJ,isHTMLForm:CJ,hasOwnProperty:LA,hasOwnProp:LA,reduceDescriptors:Lz,freezeMethods:PJ,toObjectSet:IJ,toCamelCase:SJ,noop:TJ,toFiniteNumber:kJ,findKey:Dz,global:Oz,isContextDefined:Nz,ALPHABET:Fz,generateString:MJ,isSpecCompliantForm:RJ,toJSONObject:AJ};function xr(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}Ft.inherits(xr,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ft.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const zz=xr.prototype,$z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{$z[e]={value:e}});Object.defineProperties(xr,$z);Object.defineProperty(zz,"isAxiosError",{value:!0});xr.from=(e,t,n,r,i,o)=>{const s=Object.create(zz);return Ft.toFlatObject(e,s,function(u){return u!==Error.prototype},a=>a!=="isAxiosError"),xr.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const DJ=null;function qS(e){return Ft.isPlainObject(e)||Ft.isArray(e)}function Bz(e){return Ft.endsWith(e,"[]")?e.slice(0,-2):e}function zA(e,t,n){return e?e.concat(t).map(function(i,o){return i=Bz(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function OJ(e){return Ft.isArray(e)&&!e.some(qS)}const NJ=Ft.toFlatObject(Ft,{},null,function(t){return/^is[A-Z]/.test(t)});function h_(e,t,n){if(!Ft.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ft.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(P,k){return!Ft.isUndefined(k[P])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,s=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&Ft.isSpecCompliantForm(t);if(!Ft.isFunction(i))throw new TypeError("visitor must be a function");function d(_){if(_===null)return"";if(Ft.isDate(_))return _.toISOString();if(!u&&Ft.isBlob(_))throw new xr("Blob is not supported. Use a Buffer instead.");return Ft.isArrayBuffer(_)||Ft.isTypedArray(_)?u&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function p(_,P,k){let T=_;if(_&&!k&&typeof _=="object"){if(Ft.endsWith(P,"{}"))P=r?P:P.slice(0,-2),_=JSON.stringify(_);else if(Ft.isArray(_)&&OJ(_)||(Ft.isFileList(_)||Ft.endsWith(P,"[]"))&&(T=Ft.toArray(_)))return P=Bz(P),T.forEach(function(O,N){!(Ft.isUndefined(O)||O===null)&&t.append(s===!0?zA([P],N,o):s===null?P:P+"[]",d(O))}),!1}return qS(_)?!0:(t.append(zA(k,P,o),d(_)),!1)}const m=[],v=Object.assign(NJ,{defaultVisitor:p,convertValue:d,isVisitable:qS});function x(_,P){if(!Ft.isUndefined(_)){if(m.indexOf(_)!==-1)throw Error("Circular reference detected in "+P.join("."));m.push(_),Ft.forEach(_,function(T,M){(!(Ft.isUndefined(T)||T===null)&&i.call(t,T,Ft.isString(M)?M.trim():M,P,v))===!0&&x(T,P?P.concat(M):[M])}),m.pop()}}if(!Ft.isObject(e))throw new TypeError("data must be an object");return x(e),t}function $A(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function QP(e,t){this._pairs=[],e&&h_(e,this,t)}const Vz=QP.prototype;Vz.append=function(t,n){this._pairs.push([t,n])};Vz.toString=function(t){const n=t?function(r){return t.call(this,r,$A)}:$A;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function LJ(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Uz(e,t,n){if(!t)return e;const r=n&&n.encode||LJ,i=n&&n.serialize;let o;if(i?o=i(t,n):o=Ft.isURLSearchParams(t)?t.toString():new QP(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class FJ{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ft.forEach(this.handlers,function(r){r!==null&&t(r)})}}const BA=FJ,jz={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zJ=typeof URLSearchParams<"u"?URLSearchParams:QP,$J=typeof FormData<"u"?FormData:null,BJ=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),VJ=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),fl={isBrowser:!0,classes:{URLSearchParams:zJ,FormData:$J,Blob},isStandardBrowserEnv:BJ,isStandardBrowserWebWorkerEnv:VJ,protocols:["http","https","file","blob","url","data"]};function UJ(e,t){return h_(e,new fl.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return fl.isNode&&Ft.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function jJ(e){return Ft.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function HJ(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&Ft.isArray(i)?i.length:s,u?(Ft.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!Ft.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&Ft.isArray(i[s])&&(i[s]=HJ(i[s])),!a)}if(Ft.isFormData(e)&&Ft.isFunction(e.entries)){const n={};return Ft.forEachEntry(e,(r,i)=>{t(jJ(r),i,n,0)}),n}return null}const KJ={"Content-Type":void 0};function WJ(e,t,n){if(Ft.isString(e))try{return(t||JSON.parse)(e),Ft.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const p_={transitional:jz,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=Ft.isObject(t);if(o&&Ft.isHTMLForm(t)&&(t=new FormData(t)),Ft.isFormData(t))return i&&i?JSON.stringify(Hz(t)):t;if(Ft.isArrayBuffer(t)||Ft.isBuffer(t)||Ft.isStream(t)||Ft.isFile(t)||Ft.isBlob(t))return t;if(Ft.isArrayBufferView(t))return t.buffer;if(Ft.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return UJ(t,this.formSerializer).toString();if((a=Ft.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return h_(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),WJ(t)):t}],transformResponse:[function(t){const n=this.transitional||p_.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&Ft.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?xr.from(a,xr.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:fl.classes.FormData,Blob:fl.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Ft.forEach(["delete","get","head"],function(t){p_.headers[t]={}});Ft.forEach(["post","put","patch"],function(t){p_.headers[t]=Ft.merge(KJ)});const JP=p_,GJ=Ft.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qJ=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&GJ[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},VA=Symbol("internals");function Fm(e){return e&&String(e).trim().toLowerCase()}function qx(e){return e===!1||e==null?e:Ft.isArray(e)?e.map(qx):String(e)}function ZJ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function XJ(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function fC(e,t,n,r,i){if(Ft.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Ft.isString(t)){if(Ft.isString(r))return t.indexOf(r)!==-1;if(Ft.isRegExp(r))return r.test(t)}}function YJ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function QJ(e,t){const n=Ft.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class m_{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,u,d){const p=Fm(u);if(!p)throw new Error("header name must be a non-empty string");const m=Ft.findKey(i,p);(!m||i[m]===void 0||d===!0||d===void 0&&i[m]!==!1)&&(i[m||u]=qx(a))}const s=(a,u)=>Ft.forEach(a,(d,p)=>o(d,p,u));return Ft.isPlainObject(t)||t instanceof this.constructor?s(t,n):Ft.isString(t)&&(t=t.trim())&&!XJ(t)?s(qJ(t),n):t!=null&&o(n,t,r),this}get(t,n){if(t=Fm(t),t){const r=Ft.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return ZJ(i);if(Ft.isFunction(n))return n.call(this,i,r);if(Ft.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Fm(t),t){const r=Ft.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||fC(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=Fm(s),s){const a=Ft.findKey(r,s);a&&(!n||fC(r,r[a],a,n))&&(delete r[a],i=!0)}}return Ft.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||fC(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Ft.forEach(this,(i,o)=>{const s=Ft.findKey(r,o);if(s){n[s]=qx(i),delete n[o];return}const a=t?YJ(o):String(o).trim();a!==o&&delete n[o],n[a]=qx(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Ft.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Ft.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[VA]=this[VA]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Fm(s);r[a]||(QJ(i,s),r[a]=!0)}return Ft.isArray(t)?t.forEach(o):o(t),this}}m_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ft.freezeMethods(m_.prototype);Ft.freezeMethods(m_);const lu=m_;function hC(e,t){const n=this||JP,r=t||n,i=lu.from(r.headers);let o=r.data;return Ft.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function Kz(e){return!!(e&&e.__CANCEL__)}function $v(e,t,n){xr.call(this,e==null?"canceled":e,xr.ERR_CANCELED,t,n),this.name="CanceledError"}Ft.inherits($v,xr,{__CANCEL__:!0});function JJ(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new xr("Request failed with status code "+n.status,[xr.ERR_BAD_REQUEST,xr.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const eee=fl.isStandardBrowserEnv?function(){return{write:function(n,r,i,o,s,a){const u=[];u.push(n+"="+encodeURIComponent(r)),Ft.isNumber(i)&&u.push("expires="+new Date(i).toGMTString()),Ft.isString(o)&&u.push("path="+o),Ft.isString(s)&&u.push("domain="+s),a===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function tee(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function nee(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Wz(e,t){return e&&!tee(t)?nee(e,t):t}const ree=fl.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=Ft.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function iee(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function oee(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),p=r[o];s||(s=d),n[i]=u,r[i]=d;let m=o,v=0;for(;m!==i;)v+=n[m++],m=m%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-s{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,u=r(a),d=o<=s;n=o;const p={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:u||void 0,estimated:u&&s&&d?(s-o)/u:void 0,event:i};p[t?"download":"upload"]=!0,e(p)}}const aee=typeof XMLHttpRequest<"u",see=aee&&function(e){return new Promise(function(n,r){let i=e.data;const o=lu.from(e.headers).normalize(),s=e.responseType;let a;function u(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}Ft.isFormData(i)&&(fl.isStandardBrowserEnv||fl.isStandardBrowserWebWorkerEnv)&&o.setContentType(!1);let d=new XMLHttpRequest;if(e.auth){const x=e.auth.username||"",_=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(x+":"+_))}const p=Wz(e.baseURL,e.url);d.open(e.method.toUpperCase(),Uz(p,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function m(){if(!d)return;const x=lu.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),P={data:!s||s==="text"||s==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:x,config:e,request:d};JJ(function(T){n(T),u()},function(T){r(T),u()},P),d=null}if("onloadend"in d?d.onloadend=m:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(m)},d.onabort=function(){!d||(r(new xr("Request aborted",xr.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new xr("Network Error",xr.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let _=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const P=e.transitional||jz;e.timeoutErrorMessage&&(_=e.timeoutErrorMessage),r(new xr(_,P.clarifyTimeoutError?xr.ETIMEDOUT:xr.ECONNABORTED,e,d)),d=null},fl.isStandardBrowserEnv){const x=(e.withCredentials||ree(p))&&e.xsrfCookieName&&eee.read(e.xsrfCookieName);x&&o.set(e.xsrfHeaderName,x)}i===void 0&&o.setContentType(null),"setRequestHeader"in d&&Ft.forEach(o.toJSON(),function(_,P){d.setRequestHeader(P,_)}),Ft.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),s&&s!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",UA(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",UA(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=x=>{!d||(r(!x||x.type?new $v(null,e,d):x),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const v=iee(p);if(v&&fl.protocols.indexOf(v)===-1){r(new xr("Unsupported protocol "+v+":",xr.ERR_BAD_REQUEST,e));return}d.send(i||null)})},Zx={http:DJ,xhr:see};Ft.forEach(Zx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const lee={getAdapter:e=>{e=Ft.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;ie instanceof lu?e.toJSON():e;function Yh(e,t){t=t||{};const n={};function r(d,p,m){return Ft.isPlainObject(d)&&Ft.isPlainObject(p)?Ft.merge.call({caseless:m},d,p):Ft.isPlainObject(p)?Ft.merge({},p):Ft.isArray(p)?p.slice():p}function i(d,p,m){if(Ft.isUndefined(p)){if(!Ft.isUndefined(d))return r(void 0,d,m)}else return r(d,p,m)}function o(d,p){if(!Ft.isUndefined(p))return r(void 0,p)}function s(d,p){if(Ft.isUndefined(p)){if(!Ft.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function a(d,p,m){if(m in t)return r(d,p);if(m in e)return r(void 0,d)}const u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(d,p)=>i(HA(d),HA(p),!0)};return Ft.forEach(Object.keys(e).concat(Object.keys(t)),function(p){const m=u[p]||i,v=m(e[p],t[p],p);Ft.isUndefined(v)&&m!==a||(n[p]=v)}),n}const Gz="1.3.3",eI={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{eI[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const KA={};eI.transitional=function(t,n,r){function i(o,s){return"[Axios v"+Gz+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new xr(i(s," has been removed"+(n?" in "+n:"")),xr.ERR_DEPRECATED);return n&&!KA[s]&&(KA[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function uee(e,t,n){if(typeof e!="object")throw new xr("options must be an object",xr.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],u=a===void 0||s(a,o,e);if(u!==!0)throw new xr("option "+o+" must be "+u,xr.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new xr("Unknown option "+o,xr.ERR_BAD_OPTION)}}const ZS={assertOptions:uee,validators:eI},ju=ZS.validators;class Q1{constructor(t){this.defaults=t,this.interceptors={request:new BA,response:new BA}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Yh(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&ZS.assertOptions(r,{silentJSONParsing:ju.transitional(ju.boolean),forcedJSONParsing:ju.transitional(ju.boolean),clarifyTimeoutError:ju.transitional(ju.boolean)},!1),i!==void 0&&ZS.assertOptions(i,{encode:ju.function,serialize:ju.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s;s=o&&Ft.merge(o.common,o[n.method]),s&&Ft.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),n.headers=lu.concat(s,o);const a=[];let u=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(u=u&&P.synchronous,a.unshift(P.fulfilled,P.rejected))});const d=[];this.interceptors.response.forEach(function(P){d.push(P.fulfilled,P.rejected)});let p,m=0,v;if(!u){const _=[jA.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,d),v=_.length,p=Promise.resolve(n);m{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new $v(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new tI(function(i){t=i}),cancel:t}}}const cee=tI;function dee(e){return function(n){return e.apply(null,n)}}function fee(e){return Ft.isObject(e)&&e.isAxiosError===!0}const XS={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(XS).forEach(([e,t])=>{XS[t]=e});const hee=XS;function qz(e){const t=new Xx(e),n=kz(Xx.prototype.request,t);return Ft.extend(n,Xx.prototype,t,{allOwnKeys:!0}),Ft.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return qz(Yh(e,i))},n}const qi=qz(JP);qi.Axios=Xx;qi.CanceledError=$v;qi.CancelToken=cee;qi.isCancel=Kz;qi.VERSION=Gz;qi.toFormData=h_;qi.AxiosError=xr;qi.Cancel=qi.CanceledError;qi.all=function(t){return Promise.all(t)};qi.spread=dee;qi.isAxiosError=fee;qi.mergeConfig=Yh;qi.AxiosHeaders=lu;qi.formToJSON=e=>Hz(Ft.isHTMLForm(e)?new FormData(e):e);qi.HttpStatusCode=hee;qi.default=qi;const pee=qi,Cn={initial:"initial","initial-match":"initial-match-points","initial-unmatch":"initial-unmatch-points",approve:"approve-points",working:"working-points",workingBackground:"working-points-bg",filteredWorking:"filtered-working-points",filteredWorkingBackground:"filtered-working-points-bg",cancelled:"cancelled-points",atd:"atd",pvz:"pvz",pvz_category:"pvz_category",other_category:"other_category",other:"other"},jn={pending:"Pending",onApproval:"Installation",working:"Working",cancelled:"Cancelled"},Nd={[jn.pending]:"\u041A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E",[jn.onApproval]:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",[jn.working]:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442",[jn.cancelled]:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"},nI={kiosk:"\u0413\u043E\u0440\u043E\u0434\u0441\u043A\u043E\u0439 \u043A\u0438\u043E\u0441\u043A",mfc:"\u041C\u0424\u0426",library:"\u0411\u0438\u0431\u043B\u0438\u043E\u0442\u0435\u043A\u0430",sport:"\u0421\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0439 \u043E\u0431\u044A\u0435\u043A\u0442",retail:"\u0420\u0438\u0442\u0435\u0439\u043B",residential:"\u041F\u043E\u0434\u044A\u0435\u0437\u0434 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dk:"\u0414\u043E\u043C \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B/\u041A\u043B\u0443\u0431"},mee="\u0424\u0438\u043B\u044C\u0442\u0440 \u0437\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D - \u0431\u044B\u043B\u043E \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435",Gr={PENDING:"INITIAL",ON_APPROVAL:"ON_APPROVAL",WORKING:"WORKING"},gee={[Gr.PENDING]:[Cn.initial,Cn.working,Cn.cancelled],[Gr.ON_APPROVAL]:[Cn.approve,Cn.working,Cn.cancelled],[Gr.WORKING]:[Cn.filteredWorking]},WA=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const m=t;t=(d!=null?d:typeof p!="object")?p:Object.assign({},t,p),n.forEach(v=>v(t,m))}},i=()=>t,a={setState:r,getState:i,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{var u;((u={VITE_API_URL:"https://postamates.spatialsystems.ru",VITE_KEYCLOAK_CLIENT_ID:"postnet",VITE_KEYCLOAK_CLIENT_SECRET:"K2yHweEUispkVeWn03VMk843sW2Moic5",VITE_KEYCLOAK_URL:"https://kk.dev.selftech.ru/",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:u.MODE)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},vee=e=>e?WA(e):WA;var Zz={exports:{}},Xz={};/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var g_=w.exports,yee=OP.exports;function xee(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bee=typeof Object.is=="function"?Object.is:xee,_ee=yee.useSyncExternalStore,wee=g_.useRef,Cee=g_.useEffect,See=g_.useMemo,Eee=g_.useDebugValue;Xz.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var o=wee(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=See(function(){function u(x){if(!d){if(d=!0,p=x,x=r(x),i!==void 0&&s.hasValue){var _=s.value;if(i(_,x))return m=_}return m=x}if(_=m,bee(p,x))return _;var P=r(x);return i!==void 0&&i(_,P)?_:(p=x,m=P)}var d=!1,p,m,v=n===void 0?null:n;return[function(){return u(t())},v===null?void 0:function(){return u(v())}]},[t,n,r,i]);var a=_ee(e,o[0],o[1]);return Cee(function(){s.hasValue=!0,s.value=a},[a]),Eee(a),a};(function(e){e.exports=Xz})(Zz);const Pee=LE(Zz.exports),{useSyncExternalStoreWithSelector:Iee}=Pee;function Tee(e,t=e.getState,n){const r=Iee(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.exports.useDebugValue(r),r}const GA=e=>{var t;((t={VITE_API_URL:"https://postamates.spatialsystems.ru",VITE_KEYCLOAK_CLIENT_ID:"postnet",VITE_KEYCLOAK_CLIENT_SECRET:"K2yHweEUispkVeWn03VMk843sW2Moic5",VITE_KEYCLOAK_URL:"https://kk.dev.selftech.ru/",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:t.MODE)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const n=typeof e=="function"?vee(e):e,r=(i,o)=>Tee(n,i,o);return Object.assign(r,n),r},Sl=e=>e?GA(e):GA,kee=e=>(t,n,r)=>(r.setState=(i,o,...s)=>{const a=typeof i=="function"?UX(i):i;return t(a,o,...s)},e(r.setState,n,r)),El=kee;function Mee(e){let t;try{t=e()}catch{return}return{getItem:r=>{var i;const o=a=>a===null?null:JSON.parse(a),s=(i=t.getItem(r))!=null?i:null;return s instanceof Promise?s.then(o):o(s)},setItem:(r,i)=>t.setItem(r,JSON.stringify(i)),removeItem:r=>t.removeItem(r)}}const av=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return av(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return av(r)(n)}}}},Ree=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:k=>k,version:0,merge:(k,T)=>({...T,...k}),...t},s=!1;const a=new Set,u=new Set;let d;try{d=o.getStorage()}catch{}if(!d)return e((...k)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...k)},r,i);const p=av(o.serialize),m=()=>{const k=o.partialize({...r()});let T;const M=p({state:k,version:o.version}).then(O=>d.setItem(o.name,O)).catch(O=>{T=O});if(T)throw T;return M},v=i.setState;i.setState=(k,T)=>{v(k,T),m()};const x=e((...k)=>{n(...k),m()},r,i);let _;const P=()=>{var k;if(!d)return;s=!1,a.forEach(M=>M(r()));const T=((k=o.onRehydrateStorage)==null?void 0:k.call(o,r()))||void 0;return av(d.getItem.bind(d))(o.name).then(M=>{if(M)return o.deserialize(M)}).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate)return o.migrate(M.state,M.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return M.state}).then(M=>{var O;return _=o.merge(M,(O=r())!=null?O:x),n(_,!0),m()}).then(()=>{T==null||T(_,void 0),s=!0,u.forEach(M=>M(_))}).catch(M=>{T==null||T(void 0,M)})};return i.persist={setOptions:k=>{o={...o,...k},k.getStorage&&(d=k.getStorage())},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>P(),hasHydrated:()=>s,onHydrate:k=>(a.add(k),()=>{a.delete(k)}),onFinishHydration:k=>(u.add(k),()=>{u.delete(k)})},P(),_||x},Aee=(e,t)=>(n,r,i)=>{let o={storage:Mee(()=>localStorage),partialize:P=>P,version:0,merge:(P,k)=>({...k,...P}),...t},s=!1;const a=new Set,u=new Set;let d=o.storage;if(!d)return e((...P)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...P)},r,i);const p=()=>{const P=o.partialize({...r()});return d.setItem(o.name,{state:P,version:o.version})},m=i.setState;i.setState=(P,k)=>{m(P,k),p()};const v=e((...P)=>{n(...P),p()},r,i);let x;const _=()=>{var P;if(!d)return;s=!1,a.forEach(T=>T(r()));const k=((P=o.onRehydrateStorage)==null?void 0:P.call(o,r()))||void 0;return av(d.getItem.bind(d))(o.name).then(T=>{if(T)if(typeof T.version=="number"&&T.version!==o.version){if(o.migrate)return o.migrate(T.state,T.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return T.state}).then(T=>{var M;return x=o.merge(T,(M=r())!=null?M:v),n(x,!0),p()}).then(()=>{k==null||k(x,void 0),s=!0,u.forEach(T=>T(x))}).catch(T=>{k==null||k(void 0,T)})};return i.persist={setOptions:P=>{o={...o,...P},P.storage&&(d=P.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>_(),hasHydrated:()=>s,onHydrate:P=>(a.add(P),()=>{a.delete(P)}),onFinishHydration:P=>(u.add(P),()=>{u.delete(P)})},_(),x||v},Dee=(e,t)=>{var n;return"getStorage"in t||"serialize"in t||"deserialize"in t?(((n={VITE_API_URL:"https://postamates.spatialsystems.ru",VITE_KEYCLOAK_CLIENT_ID:"postnet",VITE_KEYCLOAK_CLIENT_SECRET:"K2yHweEUispkVeWn03VMk843sW2Moic5",VITE_KEYCLOAK_URL:"https://kk.dev.selftech.ru/",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0})==null?void 0:n.MODE)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Ree(e,t)):Aee(e,t)},Bv=Dee,Oee=e=>({mode:Gr.PENDING,isImportMode:!1,setMode:t=>{e(n=>{n.mode=t})},setImportMode:t=>{e(n=>{n.isImportMode=t})}}),Do=Sl(Bv(El(Oee),{name:"postnet/mode"})),ms=["doors","flat_cnt","rival_post_cnt","rival_pvz_cnt","target_post_cnt","flats_cnt","tc_cnt","culture_cnt","mfc_cnt","public_stop_cnt","supermarket_cnt","target_dist","metro_dist"],J1={common:{name:"\u041E\u0431\u0449\u0438\u0435",doors:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u043E\u0432 \u0432 \u0436\u0438\u043B\u043E\u043C \u0434\u043E\u043C\u0435",flat_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430"},objects_dist:{name:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438 500\u043C",rival_post_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0442\u0435\u0439",rival_pvz_cnt:"\u041A\u043E\u043B-\u0432\u043E \u041F\u0412\u0417",target_post_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",flats_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438",tc_cnt:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432",culture_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B (\u0442\u0435\u0430\u0442\u0440\u044B, \u043C\u0443\u0437\u0435\u0439 \u0438 \u0442\u0434)",mfc_cnt:"\u041A\u043E\u043B-\u0432\u043E \u041C\u0424\u0426",public_stop_cnt:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043E\u043A \u041E\u0422",supermarket_cnt:"\u041A\u043E\u043B-\u0432\u043E \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432",target_dist:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",metro_dist:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043C\u0435\u0442\u0440\u043E"}},Yz={\u041F\u0412\u0417:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u041F\u0412\u0417 \u0441\u0435\u0442\u0438","\u041F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B \u043F\u0440\u043E\u0447\u0438\u0445 \u0441\u0435\u0442\u0435\u0439":"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430 \u0441\u0435\u0442\u0438"},Hd={prediction:[0,0],categories:[],region:null,doors__gt:0,doors__lt:0,flat_cnt__gt:0,flat_cnt__lt:5e3,rival_post_cnt__gt:0,rival_post_cnt__lt:5e3,rival_pvz_cnt__gt:0,rival_pvz_cnt__lt:5e3,target_post_cnt__gt:0,target_post_cnt__lt:5e3,flats_cnt__gt:0,flats_cnt__lt:5e3,tc_cnt__gt:0,tc_cnt__lt:5e3,culture_cnt__gt:0,culture_cnt__lt:5e3,mfc_cnt__gt:0,mfc_cnt__lt:5e3,public_stop_cnt__gt:0,public_stop_cnt__lt:5e3,supermarket_cnt__gt:0,supermarket_cnt__lt:5e3,target_dist__gt:0,target_dist__lt:5e3,metro_dist__gt:0,metro_dist__lt:5e3},Nee={prediction:[0,0],doors:[0,0],flat_cnt:[0,5e3],rival_post_cnt:[0,5e3],rival_pvz_cnt:[0,5e3],target_post_cnt:[0,5e3],flats_cnt:[0,5e3],tc_cnt:[0,5e3],culture_cnt:[0,5e3],mfc_cnt:[0,5e3],public_stop_cnt:[0,5e3],supermarket_cnt:[0,5e3],target_dist:[0,5e3],metro_dist:[0,5e3]},Lee=e=>({filters:Hd,ranges:Nee,setPrediction:t=>{e(n=>{n.filters.prediction=t})},setCategories:t=>e(n=>{n.filters.categories=t}),setRegion:t=>e(n=>{n.filters.region=t}),setFilterWithKey:(t,n)=>e(r=>{r.filters[`${n}__gt`]=t[0],r.filters[`${n}__lt`]=t[1]}),setRanges:t=>e(n=>{n.ranges=t}),clear:t=>e(n=>{if(!t)return n.filters=Hd,n;n.filters={...Hd,prediction:t.prediction}})}),va=Sl(Bv(El(Lee),{name:"postnet/pending-filters"})),Fee={included:new Set([]),excluded:new Set([])},zee=e=>({selection:Fee,include:t=>{e(n=>{const{excluded:r}=n.selection;r.has(t)?n.selection.excluded.delete(t):n.selection.included.add(t)})},exclude:t=>{e(n=>{const{included:r}=n.selection;r.has(t)?n.selection.included.delete(t):n.selection.excluded.add(t)})},reset:()=>e(t=>{t.selection.included.clear(),t.selection.excluded.clear()})}),Pl=Sl(El(zee)),$ee=()=>{const{selection:e}=Pl();return w.exports.useMemo(()=>e.included.size||e.excluded.size,[e])},Bee=e=>({updateCounter:-1,updatePVZLayer:-1,toggleUpdateCounter:()=>{e(t=>{t.updateCounter=t.updateCounter===-1?1:-1})},toggleUpdatePVZLayer:()=>{e(t=>{t.updatePVZLayer=t.updatePVZLayer===-1?1:-1})}}),bu=Sl(El(Bee));function Qz(e,t){const n=window.document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var Vee={\u0401:"YO",\u0419:"I",\u0426:"TS",\u0423:"U",\u041A:"K",\u0415:"E",\u041D:"N",\u0413:"G",\u0428:"SH",\u0429:"SCH",\u0417:"Z",\u0425:"H",\u042A:"'",\u0451:"yo",\u0439:"i",\u0446:"ts",\u0443:"u",\u043A:"k",\u0435:"e",\u043D:"n",\u0433:"g",\u0448:"sh",\u0449:"sch",\u0437:"z",\u0445:"h",\u044A:"'",\u0424:"F",\u042B:"I",\u0412:"V",\u0410:"A",\u041F:"P",\u0420:"R",\u041E:"O",\u041B:"L",\u0414:"D",\u0416:"ZH",\u042D:"E",\u0444:"f",\u044B:"i",\u0432:"v",\u0430:"a",\u043F:"p",\u0440:"r",\u043E:"o",\u043B:"l",\u0434:"d",\u0436:"zh",\u044D:"e",\u042F:"Ya",\u0427:"CH",\u0421:"S",\u041C:"M",\u0418:"I",\u0422:"T",\u042C:"'",\u0411:"B",\u042E:"YU",\u044F:"ya",\u0447:"ch",\u0441:"s",\u043C:"m",\u0438:"i",\u0442:"t",\u044C:"'",\u0431:"b",\u044E:"yu"," ":""};function YS(e){return e.split("").map(function(t){return t===" "?"":Vee[t]||t}).join("")}function sv(e){return e?e.filter(t=>t.visible).map(t=>({...t,groups:[...t.groups.filter(n=>n.visible)]})):[]}function Qh(e,t,n){const r=t[n],i=e[`${n}__gt`],o=r?r[0]:0,s=e[`${n}__lt`],a=r?r[1]:0;return{result:!(i===o&&s===a),gtValue:i,ltValue:s}}const Jz=(e,t,n)=>{const{prediction:r,categories:i,region:o}=e,{prediction_current:s,category:a,area:u,district:d,area_id:p,district_id:m}=n.properties,v=s>=r[0]&&s<=r[1],x=i.length>0?i.includes(a):!0,_=()=>{let k=!0;return ms.map(T=>{Qh(e,t,T).result&&k&&(k=n.properties[T]>=e[`${T}__gt`]&&n.properties[T]<=e[`${T}__lt`])}),k};return v&&x&&(()=>o?o.type==="ao"?(d!=null?d:m)===o.id:(u!=null?u:p)===o.id:!0)()&&_()},v_=(e,t,n)=>{ms.map(r=>{!Qh(t,n,r).result||(/d[0-9]/.test(r)?(e.append("dist_to_group__gt",[r.split("d")[1],t[`${r}__gt`]-1].join(",")),t[`${r}__lt`]<4e3&&e.append("dist_to_group__lt",[r.split("d")[1],t[`${r}__lt`]+1].join(","))):(e.append(`${r}__gt`,t[`${r}__gt`]-1),e.append(`${r}__lt`,t[`${r}__lt`]+1)))}),rI(t,n)&&e.append("prediction_current[]",t.prediction)},rI=(e,t)=>{const n=t.prediction[0]!==e.prediction[0],r=t.prediction[1]!==e.prediction[1];return n||r},Dh=(e,t,n)=>{if(!t[n])return!1;const r=t[n][0]!==e[0],i=t[n][1]!==e[1];return r||i},QS=e=>e==null||e==="",Uee="https://postamates.spatialsystems.ru",Mi=pee.create({baseURL:Uee}),ys=()=>{const{isImportMode:e}=Do();return e?"pre_placement_points":"placement_points"},tf=()=>{const{isImportMode:e}=Do();return e?"public.prepoints_with_dist":"public.points_with_dist"},e$=(e,t)=>{const n=e||new URLSearchParams;return t&&(t.type==="ao"&&n.append("district[]",t.id),t.type==="rayon"&&n.append("area[]",t.id)),n},gf=async(e,t,n="placement_points",r)=>{const i=e$(e,t),{data:o}=await Mi.get(`https://postamates.spatialsystems.ru/api/${n}/?${i.toString()}`,{signal:r});return o},iI=async(e,t,n="placement_points")=>{const r=e$(e,t),{data:i}=await Mi.get(`https://postamates.spatialsystems.ru/api/${n}/to_excel/?${r.toString()}`,{responseType:"arraybuffer"});return i},jee=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/pre_placement_points/download_template/",{responseType:"arraybuffer"});return e},Hee=async(e,t)=>{const n=new FormData;n.append("file",e);const{data:r}=await Mi.post("https://postamates.spatialsystems.ru/api/pre_placement_points/load_matching_file/",n,t);return r},Kee=async e=>{const t=new FormData;t.append("id",e);const{data:n}=await Mi.post("https://postamates.spatialsystems.ru/api/pre_placement_points/start_matching/",t);return n},Wee=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/pre_placement_points/import_status/");return e},Gee=()=>{const e=ys(),{updateCounter:t}=bu();return Vi(["all-initial-count",e,t],async({signal:n})=>{const r=new URLSearchParams({page:1,page_size:1});return r.append("status[]",[jn.pending,jn.cancelled]),await gf(r,null,e,n)},{select:n=>n.count,refetchOnWindowFocus:!1})},qee=e=>{const{filters:t,ranges:n}=va(),{updateCounter:r}=bu(),{categories:i,region:o}=t,{selection:{included:s}}=Pl(),a=[...s],u=()=>{const m=new URLSearchParams({page:1,page_size:1,"categories[]":i,"included[]":a});return m.append("status[]",jn.pending),v_(m,t,n),m},d=()=>new URLSearchParams({matching_status:"New"}),p=ys();return Vi(["filtered-points",t,p,a,r],async({signal:m})=>{const v=e?d():u();return await gf(v,o,p,m)},{select:m=>m.count,keepPreviousData:!0,refetchOnWindowFocus:!1})},Zee=()=>{const e=()=>new URLSearchParams({matching_status:"New"}),t=ys();return Vi(["filtered-points",t],async()=>{const n=e();return await gf(n,null,t)},{select:n=>n.count,keepPreviousData:!0})},Xee=()=>NP({mutationFn:()=>Mi.post("https://postamates.spatialsystems.ru/api/pre_placement_points/move_points/")}),t$=()=>NP({mutationFn:e=>Mi.put(`https://postamates.spatialsystems.ru/api/placement_points/update_postamat_id/?${e.toString()}`)}),Yee=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/placement_points/last_time_ml_run/");return e},Qee=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/placement_points/start/");return e},Jee=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/postamate_and_pvz_groups/");return e},oI=()=>Vi(["groups"],async()=>await Jee()),ete=async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/other_object_groups/");return e},n$=()=>Vi(["other_groups"],async()=>await ete()),tte=()=>Vi(["last_time"],async()=>await Yee(),{refetchInterval:5e3}),nte=e=>{const{isImportMode:t}=Do(),n=t?"":`?status[]=${jn.pending}`;return Vi(["prediction-max-min",e],async()=>{const{data:r,isInitialLoading:i,isFetching:o}=await Mi.get(`https://postamates.spatialsystems.ru/api/${e}/filters/${n}`);return{data:r,isLoading:i||o}},{select:({data:r,isLoading:i})=>{const o=r.dist_to_groups.map(d=>({[`d${d.group_id}`]:[Math.floor(d.dist[0]),Math.min(Math.ceil(d.dist[1]),4e3)]})),s=Object.assign({},...o),a=ms.map(d=>{if(!/d[0-9]/.test(d))return{[d]:[Math.floor(r[d][0]),Math.ceil(r[d][1])]}}).filter(d=>!!d),u=Object.assign({},...a);return{fullRange:{prediction:r.prediction_current,...u,...s},isLoading:i}}})},rte=e=>{const t=e.map(s=>s.properties.id),n=ys(),{data:r,isInitialLoading:i,isFetching:o}=Vi(["popup_data",e],async()=>{const s=new URLSearchParams({"location_ids[]":t}),{data:a}=await Mi.get(`https://postamates.spatialsystems.ru/api/${n}/?${s.toString()}`);return a.results},{refetchOnWindowFocus:!1,refetchOnMount:!1});return{data:r,isLoading:i||o}},ite=async e=>{const t=new FormData;t.append("ids",e),await Mi.delete("https://postamates.spatialsystems.ru/api/pre_placement_points/delete_points/",{data:t})},r$="/assets/logopng.2d4eca6e.png",ote="/assets/circle.bf765fcc.svg",qA=[{name:"logo",url:r$},{name:"defaultIcon",url:ote}];function ze(){return ze=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Vn(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lte(e,t){if(t&&(nn(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vn(e)}function di(e){var t=ste();return function(){var r=tb(e),i;if(t){var o=tb(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return lte(this,i)}}var o$={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;i1&&arguments[1]!==void 0?arguments[1]:{},n=[];return Un.Children.forEach(e,function(r){r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(yo(r)):y_.exports.isFragment(r)&&r.props?n=n.concat(yo(r.props.children,t)):n.push(r))}),n}var XA={};function pte(e,t){}function mte(e,t,n){!t&&!XA[n]&&(e(!1,n),XA[n]=!0)}function Dr(e,t){mte(pte,e,t)}function YA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fe(e){for(var t=1;t0},e.prototype.connect_=function(){!JS||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),_te?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!JS||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,i=bte.some(function(o){return!!~r.indexOf(o)});i&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),u$=function(e,t){for(var n=0,r=Object.keys(t);n"u"||!(Element instanceof Object))){if(!(t instanceof Jh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Mte(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof Jh(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;!n.has(t)||(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new Rte(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),d$=typeof WeakMap<"u"?new WeakMap:new l$,f$=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=wte.getInstance(),r=new Ate(t,n,this);d$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){f$.prototype[e]=function(){var t;return(t=d$.get(this))[e].apply(t,arguments)}});var h$=function(){return typeof rb.ResizeObserver<"u"?rb.ResizeObserver:f$}(),rc=new Map;function Dte(e){e.forEach(function(t){var n,r=t.target;(n=rc.get(r))===null||n===void 0||n.forEach(function(i){return i(r)})})}var p$=new h$(Dte);function Ote(e,t){rc.has(e)||(rc.set(e,new Set),p$.observe(e)),rc.get(e).add(t)}function Nte(e,t){rc.has(e)&&(rc.get(e).delete(t),rc.get(e).size||(p$.unobserve(e),rc.delete(e)))}var Lte=function(e){ci(n,e);var t=di(n);function n(){return Nr(this,n),t.apply(this,arguments)}return Lr(n,[{key:"render",value:function(){return this.props.children}}]),n}(w.exports.Component),e3=w.exports.createContext(null);function Fte(e){var t=e.children,n=e.onBatchResize,r=w.exports.useRef(0),i=w.exports.useRef([]),o=w.exports.useContext(e3),s=w.exports.useCallback(function(a,u,d){r.current+=1;var p=r.current;i.current.push({size:a,element:u,data:d}),Promise.resolve().then(function(){p===r.current&&(n==null||n(i.current),i.current=[])}),o==null||o(a,u,d)},[n,o]);return I(e3.Provider,{value:s,children:t})}function zte(e,t){var n=e.children,r=e.disabled,i=w.exports.useRef(null),o=w.exports.useRef(null),s=w.exports.useContext(e3),a=typeof n=="function",u=a?n(i):n,d=w.exports.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),p=!a&&w.exports.isValidElement(u)&&vf(u),m=p?u.ref:null,v=w.exports.useMemo(function(){return Zo(m,i)},[m,i]),x=function(){return lv(i.current)||lv(o.current)};w.exports.useImperativeHandle(t,function(){return x()});var _=w.exports.useRef(e);_.current=e;var P=w.exports.useCallback(function(k){var T=_.current,M=T.onResize,O=T.data,N=k.getBoundingClientRect(),L=N.width,F=N.height,V=k.offsetWidth,B=k.offsetHeight,H=Math.floor(L),G=Math.floor(F);if(d.current.width!==H||d.current.height!==G||d.current.offsetWidth!==V||d.current.offsetHeight!==B){var ee={width:H,height:G,offsetWidth:V,offsetHeight:B};d.current=ee;var X=V===Math.round(L)?L:V,Z=B===Math.round(F)?F:B,Q=fe(fe({},ee),{},{offsetWidth:X,offsetHeight:Z});s==null||s(Q,k,O),M&&Promise.resolve().then(function(){M(Q,k)})}},[]);return w.exports.useEffect(function(){var k=x();return k&&!r&&Ote(k,P),function(){return Nte(k,P)}},[i.current,r]),I(Lte,{ref:o,children:p?w.exports.cloneElement(u,{ref:v}):u})}var $te=w.exports.forwardRef(zte),Bte="rc-observer-key";function Vte(e,t){var n=e.children,r=typeof n=="function"?[n]:yo(n);return r.map(function(i,o){var s=(i==null?void 0:i.key)||"".concat(Bte,"-").concat(o);return w.exports.createElement($te,{...e,key:s,ref:o===0?t:void 0},i)})}var _u=w.exports.forwardRef(Vte);_u.Collection=Fte;function Ci(e,t){var n=fe({},e);return Array.isArray(t)&&t.forEach(function(r){delete n[r]}),n}var Ute=w.exports.createContext({});const uI=Ute;function uv(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Rn(e,t){if(e==null)return{};var n=uv(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function t3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0;--ne){var se=this.tryEntries[ne],oe=se.completion;if(se.tryLoc==="root")return le("end");if(se.tryLoc<=this.prev){var he=n.call(se,"catchLoc"),_e=n.call(se,"finallyLoc");if(he&&_e){if(this.prev=0;--le){var ne=this.tryEntries[le];if(ne.tryLoc<=this.prev&&n.call(ne,"finallyLoc")&&this.prev=0;--Q){var le=this.tryEntries[Q];if(le.finallyLoc===Z)return this.complete(le.completion,le.afterLoc),B(le),m}},catch:function(Z){for(var Q=this.tryEntries.length-1;Q>=0;--Q){var le=this.tryEntries[Q];if(le.tryLoc===Z){var ne=le.completion;if(ne.type==="throw"){var se=ne.arg;B(le)}return se}}throw new Error("illegal catch attempt")},delegateYield:function(Z,Q,le){return this.delegate={iterator:G(Z),resultName:Q,nextLoc:le},this.method==="next"&&(this.arg=void 0),m}},e}function JA(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(d){n(d);return}a.done?t(u):Promise.resolve(u).then(r,i)}function Fc(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function s(u){JA(o,r,i,s,a,"next",u)}function a(u){JA(o,r,i,s,a,"throw",u)}s(void 0)})}}function Fd(){return Fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Yx(e,t,n){return Wte()?Yx=Reflect.construct.bind():Yx=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),d=new u;return s&&cv(d,s.prototype),d},Yx.apply(null,arguments)}function Gte(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function i3(e){var t=typeof Map=="function"?new Map:void 0;return i3=function(r){if(r===null||!Gte(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,i)}function i(){return Yx(r,arguments,r3(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),cv(i,r)},i3(e)}var qte=/%[sdj%]/g,Zte=function(){};typeof process<"u"&&process.env;function o3(e){if(!e||!e.length)return null;var t={};return e.forEach(function(n){var r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Ma(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=o)return a;switch(a){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch{return"[Circular]"}break;default:return a}});return s}return e}function Xte(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Xi(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Xte(t)&&typeof e=="string"&&!e)}function Yte(e,t,n){var r=[],i=0,o=e.length;function s(a){r.push.apply(r,a||[]),i++,i===o&&n(r)}e.forEach(function(a){t(a,s)})}function eD(e,t,n){var r=0,i=e.length;function o(s){if(s&&s.length){n(s);return}var a=r;r=r+1,a()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},ag={integer:function(t){return ag.number(t)&&parseInt(t,10)===t},float:function(t){return ag.number(t)&&!ag.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!ag.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(iD.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(rne())},hex:function(t){return typeof t=="string"&&!!t.match(iD.hex)}},ine=function(t,n,r,i,o){if(t.required&&n===void 0){g$(t,n,r,i,o);return}var s=["integer","float","array","regexp","object","method","email","number","date","url","hex"],a=t.type;s.indexOf(a)>-1?ag[a](n)||i.push(Ma(o.messages.types[a],t.fullField,t.type)):a&&typeof n!==t.type&&i.push(Ma(o.messages.types[a],t.fullField,t.type))},one=function(t,n,r,i,o){var s=typeof t.len=="number",a=typeof t.min=="number",u=typeof t.max=="number",d=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,p=n,m=null,v=typeof n=="number",x=typeof n=="string",_=Array.isArray(n);if(v?m="number":x?m="string":_&&(m="array"),!m)return!1;_&&(p=n.length),x&&(p=n.replace(d,"_").length),s?p!==t.len&&i.push(Ma(o.messages[m].len,t.fullField,t.len)):a&&!u&&pt.max?i.push(Ma(o.messages[m].max,t.fullField,t.max)):a&&u&&(pt.max)&&i.push(Ma(o.messages[m].range,t.fullField,t.min,t.max))},eh="enum",ane=function(t,n,r,i,o){t[eh]=Array.isArray(t[eh])?t[eh]:[],t[eh].indexOf(n)===-1&&i.push(Ma(o.messages[eh],t.fullField,t[eh].join(", ")))},sne=function(t,n,r,i,o){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(n)||i.push(Ma(o.messages.pattern.mismatch,t.fullField,n,t.pattern));else if(typeof t.pattern=="string"){var s=new RegExp(t.pattern);s.test(n)||i.push(Ma(o.messages.pattern.mismatch,t.fullField,n,t.pattern))}}},dr={required:g$,whitespace:nne,type:ine,range:one,enum:ane,pattern:sne},lne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n,"string")&&!t.required)return r();dr.required(t,n,i,s,o,"string"),Xi(n,"string")||(dr.type(t,n,i,s,o),dr.range(t,n,i,s,o),dr.pattern(t,n,i,s,o),t.whitespace===!0&&dr.whitespace(t,n,i,s,o))}r(s)},une=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&dr.type(t,n,i,s,o)}r(s)},cne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n===""&&(n=void 0),Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&(dr.type(t,n,i,s,o),dr.range(t,n,i,s,o))}r(s)},dne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&dr.type(t,n,i,s,o)}r(s)},fne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),Xi(n)||dr.type(t,n,i,s,o)}r(s)},hne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&(dr.type(t,n,i,s,o),dr.range(t,n,i,s,o))}r(s)},pne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&(dr.type(t,n,i,s,o),dr.range(t,n,i,s,o))}r(s)},mne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(n==null&&!t.required)return r();dr.required(t,n,i,s,o,"array"),n!=null&&(dr.type(t,n,i,s,o),dr.range(t,n,i,s,o))}r(s)},gne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&dr.type(t,n,i,s,o)}r(s)},vne="enum",yne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o),n!==void 0&&dr[vne](t,n,i,s,o)}r(s)},xne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n,"string")&&!t.required)return r();dr.required(t,n,i,s,o),Xi(n,"string")||dr.pattern(t,n,i,s,o)}r(s)},bne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n,"date")&&!t.required)return r();if(dr.required(t,n,i,s,o),!Xi(n,"date")){var u;n instanceof Date?u=n:u=new Date(n),dr.type(t,u,i,s,o),u&&dr.range(t,u.getTime(),i,s,o)}}r(s)},_ne=function(t,n,r,i,o){var s=[],a=Array.isArray(n)?"array":typeof n;dr.required(t,n,i,s,o,a),r(s)},mC=function(t,n,r,i,o){var s=t.type,a=[],u=t.required||!t.required&&i.hasOwnProperty(t.field);if(u){if(Xi(n,s)&&!t.required)return r();dr.required(t,n,i,a,o,s),Xi(n,s)||dr.type(t,n,i,a,o)}r(a)},wne=function(t,n,r,i,o){var s=[],a=t.required||!t.required&&i.hasOwnProperty(t.field);if(a){if(Xi(n)&&!t.required)return r();dr.required(t,n,i,s,o)}r(s)},Cg={string:lne,method:une,number:cne,boolean:dne,regexp:fne,integer:hne,float:pne,array:mne,object:gne,enum:yne,pattern:xne,date:bne,url:mC,hex:mC,email:mC,required:_ne,any:wne};function a3(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var s3=a3(),Uv=function(){function e(n){this.rules=null,this._messages=s3,this.define(n)}var t=e.prototype;return t.define=function(r){var i=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(o){var s=r[o];i.rules[o]=Array.isArray(s)?s:[s]})},t.messages=function(r){return r&&(this._messages=rD(a3(),r)),this._messages},t.validate=function(r,i,o){var s=this;i===void 0&&(i={}),o===void 0&&(o=function(){});var a=r,u=i,d=o;if(typeof u=="function"&&(d=u,u={}),!this.rules||Object.keys(this.rules).length===0)return d&&d(null,a),Promise.resolve(a);function p(P){var k=[],T={};function M(N){if(Array.isArray(N)){var L;k=(L=k).concat.apply(L,N)}else k.push(N)}for(var O=0;O3&&arguments[3]!==void 0?arguments[3]:!1;return t.length&&r&&n===void 0&&!y$(e,t.slice(0,-1))?e:_$(e,t,n,r)}function M_(e){return Array.isArray(e)?Ene(e):nn(e)==="object"&&e!==null?Sne(e):e}function Sne(e){if(Object.getPrototypeOf(e)===Object.prototype){var t={};for(var n in e)t[n]=M_(e[n]);return t}return e}function Ene(e){return e.map(function(t){return M_(t)})}function Ii(e){return n3(e)}function ic(e,t){var n=y$(e,t);return n}function Wu(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=Cne(e,t,n,r);return i}function oD(e,t){var n={};return t.forEach(function(r){var i=ic(e,r);n=Wu(n,r,i)}),n}function Sg(e,t){return e&&e.some(function(n){return C$(n,t)})}function aD(e){return nn(e)==="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function w$(e,t){var n=Array.isArray(e)?Pt(e):fe({},e);return t&&Object.keys(t).forEach(function(r){var i=n[r],o=t[r],s=aD(i)&&aD(o);n[r]=s?w$(i,o||{}):M_(o)}),n}function Qx(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var i=e[t],o=t-n;return o>0?[].concat(Pt(e.slice(0,n)),[i],Pt(e.slice(n,t)),Pt(e.slice(t+1,r))):o<0?[].concat(Pt(e.slice(0,t)),Pt(e.slice(t+1,n+1)),[i],Pt(e.slice(n+1,r))):e}var Tne=Uv;function kne(e,t){return e.replace(/\$\{\w+\}/g,function(n){var r=n.slice(2,-1);return t[r]})}var lD="CODE_LOGIC_ERROR";function l3(e,t,n,r,i){return u3.apply(this,arguments)}function u3(){return u3=Fc(Zi().mark(function e(t,n,r,i,o){var s,a,u,d,p,m,v,x,_;return Zi().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return s=fe({},r),delete s.ruleIndex,s.validator&&(a=s.validator,s.validator=function(){try{return a.apply(void 0,arguments)}catch(T){return console.error(T),Promise.reject(lD)}}),u=null,s&&s.type==="array"&&s.defaultField&&(u=s.defaultField,delete s.defaultField),d=new Tne(re({},t,[s])),p=Qx({},v$,i.validateMessages),d.messages(p),m=[],k.prev=9,k.next=12,Promise.resolve(d.validate(re({},t,n),fe({},i)));case 12:k.next=17;break;case 14:k.prev=14,k.t0=k.catch(9),k.t0.errors&&(m=k.t0.errors.map(function(T,M){var O=T.message,N=O===lD?p.default:O;return w.exports.isValidElement(N)?w.exports.cloneElement(N,{key:"error_".concat(M)}):N}));case 17:if(!(!m.length&&u)){k.next=22;break}return k.next=20,Promise.all(n.map(function(T,M){return l3("".concat(t,".").concat(M),T,u,i,o)}));case 20:return v=k.sent,k.abrupt("return",v.reduce(function(T,M){return[].concat(Pt(T),Pt(M))},[]));case 22:return x=fe(fe({},r),{},{name:t,enum:(r.enum||[]).join(", ")},o),_=m.map(function(T){return typeof T=="string"?kne(T,x):T}),k.abrupt("return",_);case 25:case"end":return k.stop()}},e,null,[[9,14]])})),u3.apply(this,arguments)}function Mne(e,t,n,r,i,o){var s=e.join("."),a=n.map(function(p,m){var v=p.validator,x=fe(fe({},p),{},{ruleIndex:m});return v&&(x.validator=function(_,P,k){var T=!1,M=function(){for(var L=arguments.length,F=new Array(L),V=0;V0&&arguments[0]!==void 0?arguments[0]:Za;if(i.validatePromise===m){var L;i.validatePromise=null;var F=[],V=[];(L=N.forEach)===null||L===void 0||L.call(N,function(B){var H=B.rule.warningOnly,G=B.errors,ee=G===void 0?Za:G;H?V.push.apply(V,Pt(ee)):F.push.apply(F,Pt(ee))}),i.errors=F,i.warnings=V,i.triggerMetaEvent(),i.reRender()}}),O});return i.validatePromise=m,i.dirty=!0,i.errors=Za,i.warnings=Za,i.triggerMetaEvent(),i.reRender(),m},i.isFieldValidating=function(){return!!i.validatePromise},i.isFieldTouched=function(){return i.touched},i.isFieldDirty=function(){if(i.dirty||i.props.initialValue!==void 0)return!0;var u=i.props.fieldContext,d=u.getInternalHooks(Ld),p=d.getInitialValue;return p(i.getNamePath())!==void 0},i.getErrors=function(){return i.errors},i.getWarnings=function(){return i.warnings},i.isListField=function(){return i.props.isListField},i.isList=function(){return i.props.isList},i.isPreserve=function(){return i.props.preserve},i.getMeta=function(){i.prevValidating=i.isFieldValidating();var u={touched:i.isFieldTouched(),validating:i.prevValidating,errors:i.errors,warnings:i.warnings,name:i.getNamePath()};return u},i.getOnlyChild=function(u){if(typeof u=="function"){var d=i.getMeta();return fe(fe({},i.getOnlyChild(u(i.getControlled(),d,i.props.fieldContext))),{},{isFunction:!0})}var p=yo(u);return p.length!==1||!w.exports.isValidElement(p[0])?{child:p,isFunction:!1}:{child:p[0],isFunction:!1}},i.getValue=function(u){var d=i.props.fieldContext.getFieldsValue,p=i.getNamePath();return ic(u||d(!0),p)},i.getControlled=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=i.props,p=d.trigger,m=d.validateTrigger,v=d.getValueFromEvent,x=d.normalize,_=d.valuePropName,P=d.getValueProps,k=d.fieldContext,T=m!==void 0?m:k.validateTrigger,M=i.getNamePath(),O=k.getInternalHooks,N=k.getFieldsValue,L=O(Ld),F=L.dispatch,V=i.getValue(),B=P||function(X){return re({},_,X)},H=u[p],G=fe(fe({},u),B(V));G[p]=function(){i.touched=!0,i.dirty=!0,i.triggerMetaEvent();for(var X,Z=arguments.length,Q=new Array(Z),le=0;le=0&&H<=G.length?(d.keys=[].concat(Pt(d.keys.slice(0,H)),[d.id],Pt(d.keys.slice(H))),M([].concat(Pt(G.slice(0,H)),[B],Pt(G.slice(H))))):(d.keys=[].concat(Pt(d.keys),[d.id]),M([].concat(Pt(G),[B]))),d.id+=1},remove:function(B){var H=N(),G=new Set(Array.isArray(B)?B:[B]);G.size<=0||(d.keys=d.keys.filter(function(ee,X){return!G.has(X)}),M(H.filter(function(ee,X){return!G.has(X)})))},move:function(B,H){if(B!==H){var G=N();B<0||B>=G.length||H<0||H>=G.length||(d.keys=sD(d.keys,B,H),M(sD(G,B,H)))}}},F=T||[];return Array.isArray(F)||(F=[]),i(F.map(function(V,B){var H=d.keys[B];return H===void 0&&(d.keys[B]=d.id,H=d.keys[B],d.id+=1),{name:B,key:H,isListField:!0}}),L,P)}})})})};function One(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],u=!0,d=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(p){d=!0,i=p}finally{try{if(!u&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(d)throw i}}return a}}function Le(e,t){return x$(e)||One(e,t)||cI(e,t)||b$()}function Nne(e){var t=!1,n=e.length,r=[];return e.length?new Promise(function(i,o){e.forEach(function(s,a){s.catch(function(u){return t=!0,u}).then(function(u){n-=1,r[a]=u,!(n>0)&&(t&&o(r),i(r))})})}):Promise.resolve([])}var P$="__@field_split__";function gC(e){return e.map(function(t){return"".concat(nn(t),":").concat(t)}).join(P$)}var th=function(){function e(){Nr(this,e),this.kvs=new Map}return Lr(e,[{key:"set",value:function(n,r){this.kvs.set(gC(n),r)}},{key:"get",value:function(n){return this.kvs.get(gC(n))}},{key:"update",value:function(n,r){var i=this.get(n),o=r(i);o?this.set(n,o):this.delete(n)}},{key:"delete",value:function(n){this.kvs.delete(gC(n))}},{key:"map",value:function(n){return Pt(this.kvs.entries()).map(function(r){var i=Le(r,2),o=i[0],s=i[1],a=o.split(P$);return n({key:a.map(function(u){var d=u.match(/^([^:]*):(.*)$/),p=Le(d,3),m=p[1],v=p[2];return m==="number"?Number(v):v}),value:s})})}},{key:"toJSON",value:function(){var n={};return this.map(function(r){var i=r.key,o=r.value;return n[i.join(".")]=o,null}),n}}]),e}(),Lne=["name","errors"],Fne=Lr(function e(t){var n=this;Nr(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldValue:n.setFieldValue,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(r){return r===Ld?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Dr(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(r){n.subscribable=r},this.prevWithoutPreserves=null,this.setInitialValues=function(r,i){if(n.initialValues=r||{},i){var o,s=Qx({},r,n.store);(o=n.prevWithoutPreserves)===null||o===void 0||o.map(function(a){var u=a.key;s=Wu(s,u,ic(r,u))}),n.prevWithoutPreserves=null,n.updateStore(s)}},this.destroyForm=function(){var r=new th;n.getFieldEntities(!0).forEach(function(i){n.isMergedPreserve(i.isPreserve())||r.set(i.getNamePath(),!0)}),n.prevWithoutPreserves=r},this.getInitialValue=function(r){var i=ic(n.initialValues,r);return r.length?M_(i):i},this.setCallbacks=function(r){n.callbacks=r},this.setValidateMessages=function(r){n.validateMessages=r},this.setPreserve=function(r){n.preserve=r},this.watchList=[],this.registerWatch=function(r){return n.watchList.push(r),function(){n.watchList=n.watchList.filter(function(i){return i!==r})}},this.notifyWatch=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];if(n.watchList.length){var i=n.getFieldsValue();n.watchList.forEach(function(o){o(i,r)})}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(r){n.store=r},this.getFieldEntities=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r?n.fieldEntities.filter(function(i){return i.getNamePath().length}):n.fieldEntities},this.getFieldsMap=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=new th;return n.getFieldEntities(r).forEach(function(o){var s=o.getNamePath();i.set(s,o)}),i},this.getFieldEntitiesForNamePathList=function(r){if(!r)return n.getFieldEntities(!0);var i=n.getFieldsMap(!0);return r.map(function(o){var s=Ii(o);return i.get(s)||{INVALIDATE_NAME_PATH:Ii(o)}})},this.getFieldsValue=function(r,i){if(n.warningUnhooked(),r===!0&&!i)return n.store;var o=n.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null),s=[];return o.forEach(function(a){var u,d="INVALIDATE_NAME_PATH"in a?a.INVALIDATE_NAME_PATH:a.getNamePath();if(!(!r&&((u=a.isListField)===null||u===void 0?void 0:u.call(a))))if(!i)s.push(d);else{var p="getMeta"in a?a.getMeta():null;i(p)&&s.push(d)}}),oD(n.store,s.map(Ii))},this.getFieldValue=function(r){n.warningUnhooked();var i=Ii(r);return ic(n.store,i)},this.getFieldsError=function(r){n.warningUnhooked();var i=n.getFieldEntitiesForNamePathList(r);return i.map(function(o,s){return o&&!("INVALIDATE_NAME_PATH"in o)?{name:o.getNamePath(),errors:o.getErrors(),warnings:o.getWarnings()}:{name:Ii(r[s]),errors:[],warnings:[]}})},this.getFieldError=function(r){n.warningUnhooked();var i=Ii(r),o=n.getFieldsError([i])[0];return o.errors},this.getFieldWarning=function(r){n.warningUnhooked();var i=Ii(r),o=n.getFieldsError([i])[0];return o.warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var r=arguments.length,i=new Array(r),o=0;o0&&arguments[0]!==void 0?arguments[0]:{},i=new th,o=n.getFieldEntities(!0);o.forEach(function(u){var d=u.props.initialValue,p=u.getNamePath();if(d!==void 0){var m=i.get(p)||new Set;m.add({entity:u,value:d}),i.set(p,m)}});var s=function(d){d.forEach(function(p){var m=p.props.initialValue;if(m!==void 0){var v=p.getNamePath(),x=n.getInitialValue(v);if(x!==void 0)Dr(!1,"Form already set 'initialValues' with path '".concat(v.join("."),"'. Field can not overwrite it."));else{var _=i.get(v);if(_&&_.size>1)Dr(!1,"Multiple Field with path '".concat(v.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(_){var P=n.getFieldValue(v);(!r.skipExist||P===void 0)&&n.updateStore(Wu(n.store,v,Pt(_)[0].value))}}}})},a;r.entities?a=r.entities:r.namePathList?(a=[],r.namePathList.forEach(function(u){var d=i.get(u);if(d){var p;(p=a).push.apply(p,Pt(Pt(d).map(function(m){return m.entity})))}})):a=o,s(a)},this.resetFields=function(r){n.warningUnhooked();var i=n.store;if(!r){n.updateStore(Qx({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(i,null,{type:"reset"}),n.notifyWatch();return}var o=r.map(Ii);o.forEach(function(s){var a=n.getInitialValue(s);n.updateStore(Wu(n.store,s,a))}),n.resetWithFieldInitialValue({namePathList:o}),n.notifyObservers(i,o,{type:"reset"}),n.notifyWatch(o)},this.setFields=function(r){n.warningUnhooked();var i=n.store,o=[];r.forEach(function(s){var a=s.name;s.errors;var u=Rn(s,Lne),d=Ii(a);o.push(d),"value"in u&&n.updateStore(Wu(n.store,d,u.value)),n.notifyObservers(i,[d],{type:"setField",data:s})}),n.notifyWatch(o)},this.getFields=function(){var r=n.getFieldEntities(!0),i=r.map(function(o){var s=o.getNamePath(),a=o.getMeta(),u=fe(fe({},a),{},{name:s,value:n.getFieldValue(s)});return Object.defineProperty(u,"originRCField",{value:!0}),u});return i},this.initEntityValue=function(r){var i=r.props.initialValue;if(i!==void 0){var o=r.getNamePath(),s=ic(n.store,o);s===void 0&&n.updateStore(Wu(n.store,o,i))}},this.isMergedPreserve=function(r){var i=r!==void 0?r:n.preserve;return i!=null?i:!0},this.registerField=function(r){n.fieldEntities.push(r);var i=r.getNamePath();if(n.notifyWatch([i]),r.props.initialValue!==void 0){var o=n.store;n.resetWithFieldInitialValue({entities:[r],skipExist:!0}),n.notifyObservers(o,[r.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(s,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter(function(m){return m!==r}),!n.isMergedPreserve(a)&&(!s||u.length>1)){var d=s?void 0:n.getInitialValue(i);if(i.length&&n.getFieldValue(i)!==d&&n.fieldEntities.every(function(m){return!C$(m.getNamePath(),i)})){var p=n.store;n.updateStore(Wu(p,i,d,!0)),n.notifyObservers(p,[i],{type:"remove"}),n.triggerDependenciesUpdate(p,i)}}n.notifyWatch([i])}},this.dispatch=function(r){switch(r.type){case"updateValue":{var i=r.namePath,o=r.value;n.updateValue(i,o);break}case"validateField":{var s=r.namePath,a=r.triggerName;n.validateFields([s],{triggerName:a});break}}},this.notifyObservers=function(r,i,o){if(n.subscribable){var s=fe(fe({},o),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach(function(a){var u=a.onStoreChange;u(r,i,s)})}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(r,i){var o=n.getDependencyChildrenFields(i);return o.length&&n.validateFields(o),n.notifyObservers(r,o,{type:"dependenciesUpdate",relatedFields:[i].concat(Pt(o))}),o},this.updateValue=function(r,i){var o=Ii(r),s=n.store;n.updateStore(Wu(n.store,o,i)),n.notifyObservers(s,[o],{type:"valueUpdate",source:"internal"}),n.notifyWatch([o]);var a=n.triggerDependenciesUpdate(s,o),u=n.callbacks.onValuesChange;if(u){var d=oD(n.store,[o]);u(d,n.getFieldsValue())}n.triggerOnFieldsChange([o].concat(Pt(a)))},this.setFieldsValue=function(r){n.warningUnhooked();var i=n.store;if(r){var o=Qx(n.store,r);n.updateStore(o)}n.notifyObservers(i,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.setFieldValue=function(r,i){n.setFields([{name:r,value:i}])},this.getDependencyChildrenFields=function(r){var i=new Set,o=[],s=new th;n.getFieldEntities().forEach(function(u){var d=u.props.dependencies;(d||[]).forEach(function(p){var m=Ii(p);s.update(m,function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:new Set;return v.add(u),v})})});var a=function u(d){var p=s.get(d)||new Set;p.forEach(function(m){if(!i.has(m)){i.add(m);var v=m.getNamePath();m.isFieldDirty()&&v.length&&(o.push(v),u(v))}})};return a(r),o},this.triggerOnFieldsChange=function(r,i){var o=n.callbacks.onFieldsChange;if(o){var s=n.getFields();if(i){var a=new th;i.forEach(function(d){var p=d.name,m=d.errors;a.set(p,m)}),s.forEach(function(d){d.errors=a.get(d.name)||d.errors})}var u=s.filter(function(d){var p=d.name;return Sg(r,p)});o(u,s)}},this.validateFields=function(r,i){n.warningUnhooked();var o=!!r,s=o?r.map(Ii):[],a=[];n.getFieldEntities(!0).forEach(function(p){if(o||s.push(p.getNamePath()),(i==null?void 0:i.recursive)&&o){var m=p.getNamePath();m.every(function(_,P){return r[P]===_||r[P]===void 0})&&s.push(m)}if(!(!p.props.rules||!p.props.rules.length)){var v=p.getNamePath();if(!o||Sg(s,v)){var x=p.validateRules(fe({validateMessages:fe(fe({},v$),n.validateMessages)},i));a.push(x.then(function(){return{name:v,errors:[],warnings:[]}}).catch(function(_){var P,k=[],T=[];return(P=_.forEach)===null||P===void 0||P.call(_,function(M){var O=M.rule.warningOnly,N=M.errors;O?T.push.apply(T,Pt(N)):k.push.apply(k,Pt(N))}),k.length?Promise.reject({name:v,errors:k,warnings:T}):{name:v,errors:k,warnings:T}}))}}});var u=Nne(a);n.lastValidatePromise=u,u.catch(function(p){return p}).then(function(p){var m=p.map(function(v){var x=v.name;return x});n.notifyObservers(n.store,m,{type:"validateFinish"}),n.triggerOnFieldsChange(m,p)});var d=u.then(function(){return n.lastValidatePromise===u?Promise.resolve(n.getFieldsValue(s)):Promise.reject([])}).catch(function(p){var m=p.filter(function(v){return v&&v.errors.length});return Promise.reject({values:n.getFieldsValue(s),errorFields:m,outOfDate:n.lastValidatePromise!==u})});return d.catch(function(p){return p}),d},this.submit=function(){n.warningUnhooked(),n.validateFields().then(function(r){var i=n.callbacks.onFinish;if(i)try{i(r)}catch(o){console.error(o)}}).catch(function(r){var i=n.callbacks.onFinishFailed;i&&i(r)})},this.forceRootUpdate=t});function pI(e){var t=w.exports.useRef(),n=w.exports.useState({}),r=Le(n,2),i=r[1];if(!t.current)if(e)t.current=e;else{var o=function(){i({})},s=new Fne(o);t.current=s.getForm()}return[t.current]}var f3=w.exports.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),mI=function(t){var n=t.validateMessages,r=t.onFormChange,i=t.onFormFinish,o=t.children,s=w.exports.useContext(f3),a=w.exports.useRef({});return I(f3.Provider,{value:fe(fe({},s),{},{validateMessages:fe(fe({},s.validateMessages),n),triggerFormChange:function(d,p){r&&r(d,{changedFields:p,forms:a.current}),s.triggerFormChange(d,p)},triggerFormFinish:function(d,p){i&&i(d,{values:p,forms:a.current}),s.triggerFormFinish(d,p)},registerForm:function(d,p){d&&(a.current=fe(fe({},a.current),{},re({},d,p))),s.registerForm(d,p)},unregisterForm:function(d){var p=fe({},a.current);delete p[d],a.current=p,s.unregisterForm(d)}}),children:o})},zne=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],$ne=function(t,n){var r=t.name,i=t.initialValues,o=t.fields,s=t.form,a=t.preserve,u=t.children,d=t.component,p=d===void 0?"form":d,m=t.validateMessages,v=t.validateTrigger,x=v===void 0?"onChange":v,_=t.onValuesChange,P=t.onFieldsChange,k=t.onFinish,T=t.onFinishFailed,M=Rn(t,zne),O=w.exports.useContext(f3),N=pI(s),L=Le(N,1),F=L[0],V=F.getInternalHooks(Ld),B=V.useSubscribe,H=V.setInitialValues,G=V.setCallbacks,ee=V.setValidateMessages,X=V.setPreserve,Z=V.destroyForm;w.exports.useImperativeHandle(n,function(){return F}),w.exports.useEffect(function(){return O.registerForm(r,F),function(){O.unregisterForm(r)}},[O,F,r]),ee(fe(fe({},O.validateMessages),m)),G({onValuesChange:_,onFieldsChange:function(xe){if(O.triggerFormChange(r,xe),P){for(var Te=arguments.length,Ee=new Array(Te>1?Te-1:0),Ce=1;Ce1)&&(e=1),e}function Hy(e){return e<=1?"".concat(Number(e)*100,"%"):e}function zd(e){return e.length===1?"0"+e:String(e)}function ere(e,t,n){return{r:go(e,255)*255,g:go(t,255)*255,b:go(n,255)*255}}function hD(e,t,n){e=go(e,255),t=go(t,255),n=go(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=0,a=(r+i)/2;if(r===i)s=0,o=0;else{var u=r-i;switch(s=a>.5?u/(2-r-i):u/(r+i),r){case e:o=(t-n)/u+(t1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function tre(e,t,n){var r,i,o;if(e=go(e,360),t=go(t,100),n=go(n,100),t===0)i=n,o=n,r=n;else{var s=n<.5?n*(1+t):n+t-n*t,a=2*n-s;r=vC(a,s,e+1/3),i=vC(a,s,e),o=vC(a,s,e-1/3)}return{r:r*255,g:i*255,b:o*255}}function ob(e,t,n){e=go(e,255),t=go(t,255),n=go(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,s=r,a=r-i,u=r===0?0:a/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/a+(t>16,g:(e&65280)>>8,b:e&255}}var h3={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",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:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",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:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",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:"#ff0000",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:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Fs(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,s=!1,a=!1;return typeof e=="string"&&(e=lre(e)),typeof e=="object"&&(Kl(e.r)&&Kl(e.g)&&Kl(e.b)?(t=ere(e.r,e.g,e.b),s=!0,a=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Kl(e.h)&&Kl(e.s)&&Kl(e.v)?(r=Hy(e.s),i=Hy(e.v),t=nre(e.h,r,i),s=!0,a="hsv"):Kl(e.h)&&Kl(e.s)&&Kl(e.l)&&(r=Hy(e.s),o=Hy(e.l),t=tre(e.h,r,o),s=!0,a="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=A$(n),{ok:s,format:e.format||a,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var are="[-\\+]?\\d+%?",sre="[-\\+]?\\d*\\.\\d+%?",oc="(?:".concat(sre,")|(?:").concat(are,")"),yC="[\\s|\\(]+(".concat(oc,")[,|\\s]+(").concat(oc,")[,|\\s]+(").concat(oc,")\\s*\\)?"),xC="[\\s|\\(]+(".concat(oc,")[,|\\s]+(").concat(oc,")[,|\\s]+(").concat(oc,")[,|\\s]+(").concat(oc,")\\s*\\)?"),Rs={CSS_UNIT:new RegExp(oc),rgb:new RegExp("rgb"+yC),rgba:new RegExp("rgba"+xC),hsl:new RegExp("hsl"+yC),hsla:new RegExp("hsla"+xC),hsv:new RegExp("hsv"+yC),hsva:new RegExp("hsva"+xC),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 lre(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var t=!1;if(h3[e])e=h3[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=Rs.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Rs.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Rs.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Rs.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Rs.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Rs.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Rs.hex8.exec(e),n?{r:Pa(n[1]),g:Pa(n[2]),b:Pa(n[3]),a:pD(n[4]),format:t?"name":"hex8"}:(n=Rs.hex6.exec(e),n?{r:Pa(n[1]),g:Pa(n[2]),b:Pa(n[3]),format:t?"name":"hex"}:(n=Rs.hex4.exec(e),n?{r:Pa(n[1]+n[1]),g:Pa(n[2]+n[2]),b:Pa(n[3]+n[3]),a:pD(n[4]+n[4]),format:t?"name":"hex8"}:(n=Rs.hex3.exec(e),n?{r:Pa(n[1]+n[1]),g:Pa(n[2]+n[2]),b:Pa(n[3]+n[3]),format:t?"name":"hex"}:!1)))))))))}function Kl(e){return Boolean(Rs.CSS_UNIT.exec(String(e)))}var bC=function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var r;if(t instanceof e)return t;typeof t=="number"&&(t=ore(t)),this.originalInput=t;var i=Fs(t);this.originalInput=t,this.r=i.r,this.g=i.g,this.b=i.b,this.a=i.a,this.roundA=Math.round(100*this.a)/100,this.format=(r=n.format)!==null&&r!==void 0?r:i.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=i.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,r,i,o=t.r/255,s=t.g/255,a=t.b/255;return o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),s<=.03928?r=s/12.92:r=Math.pow((s+.055)/1.055,2.4),a<=.03928?i=a/12.92:i=Math.pow((a+.055)/1.055,2.4),.2126*n+.7152*r+.0722*i},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=A$(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=ob(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=ob(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsva(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=hD(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=hD(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),i=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(r,"%, ").concat(i,"%)"):"hsla(".concat(n,", ").concat(r,"%, ").concat(i,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=!1),ab(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=!1),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=!1),rre(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=!1),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=!1),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(r,")"):"rgba(".concat(t,", ").concat(n,", ").concat(r,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(go(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(go(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var t="#"+ab(this.r,this.g,this.b,!1),n=0,r=Object.entries(h3);n=0,o=!n&&i&&(t.startsWith("hex")||t==="name");return o?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),r||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=jy(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=jy(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=jy(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=jy(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var r=this.toRgb(),i=new e(t).toRgb(),o=n/100,s={r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var r=this.toHsl(),i=360/n,o=[this];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(new e(r));return o},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),r=n.h,i=n.s,o=n.v,s=[],a=1/t;t--;)s.push(new e({h:r,s:i,v:o})),o=(o+a)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb(),i=n.a+r.a*(1-n.a);return new e({r:(n.r*n.a+r.r*r.a*(1-n.a))/i,g:(n.g*n.a+r.g*r.a*(1-n.a))/i,b:(n.b*n.a+r.b*r.a*(1-n.a))/i,a:i})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,i=[this],o=360/t,s=1;s=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-Ky*t:Math.round(e.h)+Ky*t:r=n?Math.round(e.h)+Ky*t:Math.round(e.h)-Ky*t,r<0?r+=360:r>=360&&(r-=360),r}function yD(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-mD*t:t===O$?r=e.s+mD:r=e.s+ure*t,r>1&&(r=1),n&&t===D$&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function xD(e,t,n){var r;return n?r=e.v+cre*t:r=e.v-dre*t,r>1&&(r=1),Number(r.toFixed(2))}function dv(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Fs(e),i=D$;i>0;i-=1){var o=gD(r),s=Wy(Fs({h:vD(o,i,!0),s:yD(o,i,!0),v:xD(o,i,!0)}));n.push(s)}n.push(Wy(r));for(var a=1;a<=O$;a+=1){var u=gD(r),d=Wy(Fs({h:vD(u,a),s:yD(u,a),v:xD(u,a)}));n.push(d)}return t.theme==="dark"?fre.map(function(p){var m=p.index,v=p.opacity,x=Wy(hre(Fs(t.backgroundColor||"#141414"),Fs(n[m]),v*100));return x}):n}var Oh={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},_C={},wC={};Object.keys(Oh).forEach(function(e){_C[e]=dv(Oh[e]),_C[e].primary=_C[e][5],wC[e]=dv(Oh[e],{theme:"dark",backgroundColor:"#141414"}),wC[e].primary=wC[e][5]});function Mo(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Kd(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var n=t;n;){if(n===e)return!0;n=n.parentNode}return!1}var bD="data-rc-order",pre="rc-util-key",p3=new Map;function N$(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):pre}function R_(e){if(e.attachTo)return e.attachTo;var t=document.querySelector("head");return t||document.body}function mre(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function L$(e){return Array.from((p3.get(e)||e).children).filter(function(t){return t.tagName==="STYLE"})}function F$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Mo())return null;var n=t.csp,r=t.prepend,i=document.createElement("style");i.setAttribute(bD,mre(r)),n!=null&&n.nonce&&(i.nonce=n==null?void 0:n.nonce),i.innerHTML=e;var o=R_(t),s=o.firstChild;if(r){if(r==="queue"){var a=L$(o).filter(function(u){return["prepend","prependQueue"].includes(u.getAttribute(bD))});if(a.length)return o.insertBefore(i,a[a.length-1].nextSibling),i}o.insertBefore(i,s)}else o.appendChild(i);return i}function z$(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=R_(t);return L$(n).find(function(r){return r.getAttribute(N$(t))===e})}function _D(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=z$(e,t);if(n){var r=R_(t);r.removeChild(n)}}function gre(e,t){var n=p3.get(e);if(!n||!Kd(document,n)){var r=F$("",t),i=r.parentNode;p3.set(e,i),e.removeChild(r)}}function jv(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=R_(n);gre(r,n);var i=z$(t,n);if(i){var o,s;if((o=n.csp)!==null&&o!==void 0&&o.nonce&&i.nonce!==((s=n.csp)===null||s===void 0?void 0:s.nonce)){var a;i.nonce=(a=n.csp)===null||a===void 0?void 0:a.nonce}return i.innerHTML!==e&&(i.innerHTML=e),i}var u=F$(e,n);return u.setAttribute(N$(n),t),u}function vre(e,t){Dr(e,"[@ant-design/icons] ".concat(t))}function wD(e){return nn(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(nn(e.icon)==="object"||typeof e.icon=="function")}function CD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function m3(e,t,n){return n?Un.createElement(e.tag,fe(fe({key:t},CD(e.attrs)),n),(e.children||[]).map(function(r,i){return m3(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):Un.createElement(e.tag,fe({key:t},CD(e.attrs)),(e.children||[]).map(function(r,i){return m3(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function $$(e){return dv(e)[0]}function B$(e){return e?Array.isArray(e)?e:[e]:[]}var yre=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,xre=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yre,n=w.exports.useContext(uI),r=n.csp;w.exports.useEffect(function(){jv(t,"@ant-design-icons",{prepend:!0,csp:r})},[])},bre=["icon","className","onClick","style","primaryColor","secondaryColor"],Eg={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function _re(e){var t=e.primaryColor,n=e.secondaryColor;Eg.primaryColor=t,Eg.secondaryColor=n||$$(t),Eg.calculated=!!n}function wre(){return fe({},Eg)}var A_=function(t){var n=t.icon,r=t.className,i=t.onClick,o=t.style,s=t.primaryColor,a=t.secondaryColor,u=Rn(t,bre),d=Eg;if(s&&(d={primaryColor:s,secondaryColor:a||$$(s)}),xre(),vre(wD(n),"icon should be icon definiton, but got ".concat(n)),!wD(n))return null;var p=n;return p&&typeof p.icon=="function"&&(p=fe(fe({},p),{},{icon:p.icon(d.primaryColor,d.secondaryColor)})),m3(p.icon,"svg-".concat(p.name),fe({className:r,onClick:i,style:o,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},u))};A_.displayName="IconReact";A_.getTwoToneColors=wre;A_.setTwoToneColors=_re;const vI=A_;function V$(e){var t=B$(e),n=Le(t,2),r=n[0],i=n[1];return vI.setTwoToneColors({primaryColor:r,secondaryColor:i})}function Cre(){var e=vI.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var Sre=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];V$("#1890ff");var D_=w.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,o=e.spin,s=e.rotate,a=e.tabIndex,u=e.onClick,d=e.twoToneColor,p=Rn(e,Sre),m=w.exports.useContext(uI),v=m.prefixCls,x=v===void 0?"anticon":v,_=m.rootClassName,P=He(_,x,(n={},re(n,"".concat(x,"-").concat(i.name),!!i.name),re(n,"".concat(x,"-spin"),!!o||i.name==="loading"),n),r),k=a;k===void 0&&u&&(k=-1);var T=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,M=B$(d),O=Le(M,2),N=O[0],L=O[1];return I("span",{...fe(fe({role:"img","aria-label":i.name},p),{},{ref:t,tabIndex:k,onClick:u,className:P}),children:I(vI,{icon:i,primaryColor:N,secondaryColor:L,style:T})})});D_.displayName="AntdIcon";D_.getTwoToneColor=Cre;D_.setTwoToneColor=V$;const Qn=D_;var U$=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:Yne})})};U$.displayName="CheckCircleFilled";const O_=w.exports.forwardRef(U$);var Ere={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"};const Pre=Ere;var j$=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:Pre})})};j$.displayName="CloseCircleFilled";const yf=w.exports.forwardRef(j$);var Ire={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"exclamation-circle",theme:"filled"};const Tre=Ire;var H$=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:Tre})})};H$.displayName="ExclamationCircleFilled";const yI=w.exports.forwardRef(H$);var kre={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"}}]},name:"info-circle",theme:"filled"};const Mre=kre;var K$=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:Mre})})};K$.displayName="InfoCircleFilled";const W$=w.exports.forwardRef(K$);var Rre={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};const G$=Rre;var q$=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:G$})})};q$.displayName="LoadingOutlined";const Mc=w.exports.forwardRef(q$);var Hv=fe({},LZ),Are=Hv.version,Dre=Hv.render,Ore=Hv.unmountComponentAtNode,N_;try{var Nre=Number((Are||"").split(".")[0]);Nre>=18&&(N_=Hv.createRoot)}catch{}function SD(e){var t=Hv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&nn(t)==="object"&&(t.usingClientEntryPoint=e)}var sb="__rc_react_root__";function Lre(e,t){SD(!0);var n=t[sb]||N_(t);SD(!1),n.render(e),t[sb]=n}function Fre(e,t){Dre(e,t)}function Z$(e,t){if(N_){Lre(e,t);return}Fre(e,t)}function zre(e){return g3.apply(this,arguments)}function g3(){return g3=Fc(Zi().mark(function e(t){return Zi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",Promise.resolve().then(function(){var i;(i=t[sb])===null||i===void 0||i.unmount(),delete t[sb]}));case 1:case"end":return r.stop()}},e)})),g3.apply(this,arguments)}function $re(e){Ore(e)}function X$(e){return v3.apply(this,arguments)}function v3(){return v3=Fc(Zi().mark(function e(t){return Zi().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(N_===void 0){r.next=2;break}return r.abrupt("return",zre(t));case 2:$re(t);case 3:case"end":return r.stop()}},e)})),v3.apply(this,arguments)}function ED(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit".concat(e)]="webkit".concat(t),n["Moz".concat(e)]="moz".concat(t),n["ms".concat(e)]="MS".concat(t),n["O".concat(e)]="o".concat(t.toLowerCase()),n}function Bre(e,t){var n={animationend:ED("Animation","AnimationEnd"),transitionend:ED("Transition","TransitionEnd")};return e&&("AnimationEvent"in t||delete n.animationend.animation,"TransitionEvent"in t||delete n.transitionend.transition),n}var Vre=Bre(Mo(),typeof window<"u"?window:{}),Y$={};if(Mo()){var Ure=document.createElement("div");Y$=Ure.style}var Gy={};function Q$(e){if(Gy[e])return Gy[e];var t=Vre[e];if(t)for(var n=Object.keys(t),r=n.length,i=0;i1&&arguments[1]!==void 0?arguments[1]:1;MD+=1;var r=MD;function i(o){if(o===0)iB(r),t();else{var s=nB(function(){i(o-1)});bI.set(r,s)}}return i(n),r};ar.cancel=function(e){var t=bI.get(e);return iB(t),rB(t)};const jre=function(){var e=w.exports.useRef(null);function t(){ar.cancel(e.current)}function n(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;t();var o=ar(function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)});e.current=o}return w.exports.useEffect(function(){return function(){t()}},[]),[n,t]};var oB=Mo()?w.exports.useLayoutEffect:w.exports.useEffect,RD=[eu,wh,Ch,xI],aB=!1,Hre=!0;function sB(e){return e===Ch||e===xI}const Kre=function(e,t){var n=vl(kD),r=Le(n,2),i=r[0],o=r[1],s=jre(),a=Le(s,2),u=a[0],d=a[1];function p(){o(eu,!0)}return oB(function(){if(i!==kD&&i!==xI){var m=RD.indexOf(i),v=RD[m+1],x=t(i);x===aB?o(v,!0):u(function(_){function P(){_.isCanceled()||o(v,!0)}x===!0?P():Promise.resolve(x).then(P)})}},[e,i]),w.exports.useEffect(function(){return function(){d()}},[]),[p,i]},Wre=function(e){var t=w.exports.useRef(),n=w.exports.useRef(e);n.current=e;var r=w.exports.useCallback(function(s){n.current(s)},[]);function i(s){s&&(s.removeEventListener(ID,r),s.removeEventListener(PD,r))}function o(s){t.current&&t.current!==s&&i(t.current),s&&s!==t.current&&(s.addEventListener(ID,r),s.addEventListener(PD,r),t.current=s)}return w.exports.useEffect(function(){return function(){i(t.current)}},[]),[o,i]};function Gre(e,t,n,r){var i=r.motionEnter,o=i===void 0?!0:i,s=r.motionAppear,a=s===void 0?!0:s,u=r.motionLeave,d=u===void 0?!0:u,p=r.motionDeadline,m=r.motionLeaveImmediately,v=r.onAppearPrepare,x=r.onEnterPrepare,_=r.onLeavePrepare,P=r.onAppearStart,k=r.onEnterStart,T=r.onLeaveStart,M=r.onAppearActive,O=r.onEnterActive,N=r.onLeaveActive,L=r.onAppearEnd,F=r.onEnterEnd,V=r.onLeaveEnd,B=r.onVisibleChanged,H=vl(),G=Le(H,2),ee=G[0],X=G[1],Z=vl(lh),Q=Le(Z,2),le=Q[0],ne=Q[1],se=vl(null),oe=Le(se,2),he=oe[0],_e=oe[1],be=w.exports.useRef(!1),xe=w.exports.useRef(null);function Te(){return n()}var Ee=w.exports.useRef(!1);function Ce(ct){var wt=Te();if(!(ct&&!ct.deadline&&ct.target!==wt)){var rt=Ee.current,ut;le===qy&&rt?ut=L==null?void 0:L(wt,ct):le===Zy&&rt?ut=F==null?void 0:F(wt,ct):le===Xy&&rt&&(ut=V==null?void 0:V(wt,ct)),le!==lh&&rt&&ut!==!1&&(ne(lh,!0),_e(null,!0))}}var ke=Wre(Ce),De=Le(ke,1),Ke=De[0],Ue=w.exports.useMemo(function(){var ct,wt,rt;switch(le){case qy:return ct={},re(ct,eu,v),re(ct,wh,P),re(ct,Ch,M),ct;case Zy:return wt={},re(wt,eu,x),re(wt,wh,k),re(wt,Ch,O),wt;case Xy:return rt={},re(rt,eu,_),re(rt,wh,T),re(rt,Ch,N),rt;default:return{}}},[le]),tt=Kre(le,function(ct){if(ct===eu){var wt=Ue[eu];return wt?wt(Te()):aB}if(We in Ue){var rt;_e(((rt=Ue[We])===null||rt===void 0?void 0:rt.call(Ue,Te(),null))||null)}return We===Ch&&(Ke(Te()),p>0&&(clearTimeout(xe.current),xe.current=setTimeout(function(){Ce({deadline:!0})},p))),Hre}),lt=Le(tt,2),St=lt[0],We=lt[1],bt=sB(We);Ee.current=bt,oB(function(){X(t);var ct=be.current;if(be.current=!0,!!e){var wt;!ct&&t&&a&&(wt=qy),ct&&t&&o&&(wt=Zy),(ct&&!t&&d||!ct&&m&&!t&&d)&&(wt=Xy),wt&&(ne(wt),St())}},[t]),w.exports.useEffect(function(){(le===qy&&!a||le===Zy&&!o||le===Xy&&!d)&&ne(lh)},[a,o,d]),w.exports.useEffect(function(){return function(){be.current=!1,clearTimeout(xe.current)}},[]);var Qe=w.exports.useRef(!1);w.exports.useEffect(function(){ee&&(Qe.current=!0),ee!==void 0&&le===lh&&((Qe.current||ee)&&(B==null||B(ee)),Qe.current=!0)},[ee,le]);var mt=he;return Ue[eu]&&We===wh&&(mt=fe({transition:"none"},mt)),[le,We,mt,ee!=null?ee:t]}var qre=function(e){ci(n,e);var t=di(n);function n(){return Nr(this,n),t.apply(this,arguments)}return Lr(n,[{key:"render",value:function(){return this.props.children}}]),n}(w.exports.Component);function Zre(e){var t=e;nn(e)==="object"&&(t=e.transitionSupport);function n(i){return!!(i.motionName&&t)}var r=w.exports.forwardRef(function(i,o){var s=i.visible,a=s===void 0?!0:s,u=i.removeOnLeave,d=u===void 0?!0:u,p=i.forceRender,m=i.children,v=i.motionName,x=i.leavedClassName,_=i.eventProps,P=n(i),k=w.exports.useRef(),T=w.exports.useRef();function M(){try{return k.current instanceof HTMLElement?k.current:lv(T.current)}catch{return null}}var O=Gre(P,a,M,i),N=Le(O,4),L=N[0],F=N[1],V=N[2],B=N[3],H=w.exports.useRef(B);B&&(H.current=!0);var G=w.exports.useCallback(function(se){k.current=se,nb(o,se)},[o]),ee,X=fe(fe({},_),{},{visible:a});if(!m)ee=null;else if(L===lh||!n(i))B?ee=m(fe({},X),G):!d&&H.current&&x?ee=m(fe(fe({},X),{},{className:x}),G):p||!d&&!x?ee=m(fe(fe({},X),{},{style:{display:"none"}}),G):ee=null;else{var Z,Q;F===eu?Q="prepare":sB(F)?Q="active":F===wh&&(Q="start"),ee=m(fe(fe({},X),{},{className:He(TD(v,L),(Z={},re(Z,TD(v,"".concat(L,"-").concat(Q)),Q),re(Z,v,typeof v=="string"),Z)),style:V}),G)}if(w.exports.isValidElement(ee)&&vf(ee)){var le=ee,ne=le.ref;ne||(ee=w.exports.cloneElement(ee,{ref:G}))}return I(qre,{ref:T,children:ee})});return r.displayName="CSSMotion",r}const Xo=Zre(tB);var y3="add",x3="keep",b3="remove",CC="removed";function Xre(e){var t;return e&&nn(e)==="object"&&"key"in e?t=e:t={key:e},fe(fe({},t),{},{key:String(t.key)})}function _3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return e.map(Xre)}function Yre(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=[],r=0,i=t.length,o=_3(e),s=_3(t);o.forEach(function(d){for(var p=!1,m=r;m1});return u.forEach(function(d){n=n.filter(function(p){var m=p.key,v=p.status;return m!==d||v!==b3}),n.forEach(function(p){p.key===d&&(p.status=x3)})}),n}var Qre=["component","children","onVisibleChanged","onAllRemoved"],Jre=["status"],eie=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function tie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Xo,n=function(r){ci(o,r);var i=di(o);function o(){var s;Nr(this,o);for(var a=arguments.length,u=new Array(a),d=0;d=v&&(m.key=k[0].notice.key,m.updateMark=DD(),m.userPassKey=p,k.shift()),k.push({notice:m,holderCallback:u})),{notices:k}})},r.remove=function(a){r.setState(function(u){var d=u.notices;return{notices:d.filter(function(p){var m=p.notice,v=m.key,x=m.userPassKey,_=x!=null?x:v;return _!==a})}})},r.noticePropsMap={},r}return Lr(n,[{key:"getTransitionName",value:function(){var i=this.props,o=i.prefixCls,s=i.animation,a=this.props.transitionName;return!a&&s&&(a="".concat(o,"-").concat(s)),a}},{key:"render",value:function(){var i=this,o=this.state.notices,s=this.props,a=s.prefixCls,u=s.className,d=s.closeIcon,p=s.style,m=[];return o.forEach(function(v,x){var _=v.notice,P=v.holderCallback,k=x===o.length-1?_.updateMark:void 0,T=_.key,M=_.userPassKey,O=fe(fe(fe({prefixCls:a,closeIcon:d},_),_.props),{},{key:T,noticeKey:M||T,updateMark:k,onClose:function(L){var F;i.remove(L),(F=_.onClose)===null||F===void 0||F.call(_)},onClick:_.onClick,children:_.content});m.push(T),i.noticePropsMap[T]={props:O,holderCallback:P}}),I("div",{className:He(a,u),style:p,children:I(_I,{keys:m,motionName:this.getTransitionName(),onVisibleChanged:function(x,_){var P=_.key;x||delete i.noticePropsMap[P]},children:function(v){var x=v.key,_=v.className,P=v.style,k=v.visible,T=i.noticePropsMap[x],M=T.props,O=T.holderCallback;return O?I("div",{className:He(_,"".concat(a,"-hook-holder")),style:fe({},P),ref:function(L){typeof x>"u"||(L?(i.hookRefs.set(x,L),O(L,M)):i.hookRefs.delete(x))}},x):I(wI,{...M,className:He(_,M==null?void 0:M.className),style:fe(fe({},P),M==null?void 0:M.style),visible:k})}})})}}]),n}(w.exports.Component);ep.newInstance=void 0;ep.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}};ep.newInstance=function(t,n){var r=t||{},i=r.getContainer,o=Rn(r,nie),s=document.createElement("div");if(i){var a=i();a.appendChild(s)}else document.body.appendChild(s);var u=!1;function d(p){u||(u=!0,n({notice:function(v){p.add(v)},removeNotice:function(v){p.remove(v)},component:p,destroy:function(){X$(s),s.parentNode&&s.parentNode.removeChild(s)},useNotification:function(){return CI(p)}}))}Z$(I(ep,{...o,ref:d}),s)};function iie(e,t){var n=function(){var i,o,s=null,a={add:function(P,k){s==null||s.component.add(P,k)}},u=CI(a),d=Le(u,2),p=d[0],m=d[1];function v(_){var P=_.prefixCls,k=i("message",P),T=i(),M=_.key||mB(),O=new Promise(function(L){var F=function(){return typeof _.onClose=="function"&&_.onClose(),L(!0)};e(ze(ze({},_),{prefixCls:k,rootPrefixCls:T,getPopupContainer:o}),function(V){var B=V.prefixCls,H=V.instance;s=H,p(t(ze(ze({},_),{key:M,onClose:F}),B))})}),N=function(){s&&s.removeNotice(M)};return N.then=function(L,F){return O.then(L,F)},N.promise=O,N}var x=w.exports.useRef({});return x.current.open=v,yB.forEach(function(_){return bB(x.current,_)}),[x.current,I(zc,{children:function(_){return i=_.getPrefixCls,o=_.getPopupContainer,m}},"holder")]};return n}var Ko,lB=3,uB,oie=1,cB="",w3="move-up",dB=!1,fB,hB,pB=!1;function mB(){return oie++}function aie(e){e.top!==void 0&&(uB=e.top,Ko=null),e.duration!==void 0&&(lB=e.duration),e.prefixCls!==void 0&&(cB=e.prefixCls),e.getContainer!==void 0&&(fB=e.getContainer,Ko=null),e.transitionName!==void 0&&(w3=e.transitionName,Ko=null,dB=!0),e.maxCount!==void 0&&(hB=e.maxCount,Ko=null),e.rtl!==void 0&&(pB=e.rtl)}function gB(e,t){var n=e.prefixCls,r=e.getPopupContainer,i=II(),o=i.getPrefixCls,s=i.getRootPrefixCls,a=i.getIconPrefixCls,u=o("message",n||cB),d=s(e.rootPrefixCls,u),p=a();if(Ko){t({prefixCls:u,rootPrefixCls:d,iconPrefixCls:p,instance:Ko});return}var m={prefixCls:u,transitionName:dB?w3:"".concat(d,"-").concat(w3),style:{top:uB},getContainer:fB||r,maxCount:hB};ep.newInstance(m,function(v){if(Ko){t({prefixCls:u,rootPrefixCls:d,iconPrefixCls:p,instance:Ko});return}Ko=v,t({prefixCls:u,rootPrefixCls:d,iconPrefixCls:p,instance:v})})}var vB={info:W$,success:O_,error:yf,warning:yI,loading:Mc},yB=Object.keys(vB);function xB(e,t,n){var r,i=e.duration!==void 0?e.duration:lB,o=vB[e.type],s=He("".concat(t,"-custom-content"),(r={},re(r,"".concat(t,"-").concat(e.type),e.type),re(r,"".concat(t,"-rtl"),pB===!0),r));return{key:e.key,duration:i,style:e.style||{},className:e.className,content:I(wp,{iconPrefixCls:n,children:$e("div",{className:s,children:[e.icon||o&&I(o,{}),I("span",{children:e.content})]})}),onClose:e.onClose,onClick:e.onClick}}function sie(e){var t=e.key||mB(),n=new Promise(function(i){var o=function(){return typeof e.onClose=="function"&&e.onClose(),i(!0)};gB(e,function(s){var a=s.prefixCls,u=s.iconPrefixCls,d=s.instance;d.notice(xB(ze(ze({},e),{key:t,onClose:o}),a,u))})}),r=function(){var o;Ko&&(Ko.removeNotice(t),(o=e.onClose)===null||o===void 0||o.call(e))};return r.then=function(i,o){return n.then(i,o)},r.promise=n,r}function lie(e){return Object.prototype.toString.call(e)==="[object Object]"&&!!e.content}var fv={open:sie,config:aie,destroy:function(t){if(Ko)if(t){var n=Ko,r=n.removeNotice;r(t)}else{var i=Ko,o=i.destroy;o(),Ko=null}}};function bB(e,t){e[t]=function(n,r,i){return lie(n)?e.open(ze(ze({},n),{type:t})):(typeof r=="function"&&(i=r,r=void 0),e.open({content:n,duration:r,type:t,onClose:i}))}}yB.forEach(function(e){return bB(fv,e)});fv.warn=fv.warning;fv.useMessage=iie(gB,xB);const uie=fv;var cie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"};const _B=cie;var wB=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:_B})})};wB.displayName="CheckCircleOutlined";const SI=w.exports.forwardRef(wB);var die={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"};const CB=die;var SB=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:CB})})};SB.displayName="CloseCircleOutlined";const EI=w.exports.forwardRef(SB);var fie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"};const EB=fie;var PB=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:EB})})};PB.displayName="CloseOutlined";const _p=w.exports.forwardRef(PB);var hie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"};const pie=hie;var IB=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:pie})})};IB.displayName="ExclamationCircleOutlined";const L_=w.exports.forwardRef(IB);var mie={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"};const TB=mie;var kB=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:TB})})};kB.displayName="InfoCircleOutlined";const PI=w.exports.forwardRef(kB);function gie(e,t){var n=function(){var i,o=null,s={add:function(_,P){o==null||o.component.add(_,P)}},a=CI(s),u=Le(a,2),d=u[0],p=u[1];function m(x){var _=x.prefixCls,P=i("notification",_);e(ze(ze({},x),{prefixCls:P}),function(k){var T=k.prefixCls,M=k.instance;o=M,d(t(x,T))})}var v=w.exports.useRef({});return v.current.open=m,["success","info","warning","error"].forEach(function(x){v.current[x]=function(_){return v.current.open(ze(ze({},_),{type:x}))}}),[v.current,I(zc,{children:function(x){return i=x.getPrefixCls,p}},"holder")]};return n}globalThis&&globalThis.__awaiter;var kd={},MB=4.5,RB=24,AB=24,DB="",C3="topRight",OB,NB,LB=!1,FB;function vie(e){var t=e.duration,n=e.placement,r=e.bottom,i=e.top,o=e.getContainer,s=e.closeIcon,a=e.prefixCls;a!==void 0&&(DB=a),t!==void 0&&(MB=t),n!==void 0?C3=n:e.rtl&&(C3="topLeft"),r!==void 0&&(AB=r),i!==void 0&&(RB=i),o!==void 0&&(OB=o),s!==void 0&&(NB=s),e.rtl!==void 0&&(LB=e.rtl),e.maxCount!==void 0&&(FB=e.maxCount)}function yie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:RB,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AB,r;switch(e){case"top":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:t,bottom:"auto"};break;case"topLeft":r={left:0,top:t,bottom:"auto"};break;case"topRight":r={right:0,top:t,bottom:"auto"};break;case"bottom":r={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:n};break;case"bottomLeft":r={left:0,top:"auto",bottom:n};break;default:r={right:0,top:"auto",bottom:n};break}return r}function zB(e,t){var n=e.placement,r=n===void 0?C3:n,i=e.top,o=e.bottom,s=e.getContainer,a=s===void 0?OB:s,u=e.prefixCls,d=II(),p=d.getPrefixCls,m=d.getIconPrefixCls,v=p("notification",u||DB),x=m(),_="".concat(v,"-").concat(r),P=kd[_];if(P){Promise.resolve(P).then(function(T){t({prefixCls:"".concat(v,"-notice"),iconPrefixCls:x,instance:T})});return}var k=He("".concat(v,"-").concat(r),re({},"".concat(v,"-rtl"),LB===!0));kd[_]=new Promise(function(T){ep.newInstance({prefixCls:v,className:k,style:yie(r,i,o),getContainer:a,maxCount:FB},function(M){T(M),t({prefixCls:"".concat(v,"-notice"),iconPrefixCls:x,instance:M})})})}var xie={success:SI,info:PI,error:EI,warning:L_};function $B(e,t,n){var r=e.duration,i=e.icon,o=e.type,s=e.description,a=e.message,u=e.btn,d=e.onClose,p=e.onClick,m=e.key,v=e.style,x=e.className,_=e.closeIcon,P=_===void 0?NB:_,k=e.props,T=r===void 0?MB:r,M=null;i?M=I("span",{className:"".concat(t,"-icon"),children:e.icon}):o&&(M=w.exports.createElement(xie[o]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(o)}));var O=I("span",{className:"".concat(t,"-close-x"),children:P||I(_p,{className:"".concat(t,"-close-icon")})}),N=!s&&M?I("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:I(wp,{iconPrefixCls:n,children:$e("div",{className:M?"".concat(t,"-with-icon"):"",role:"alert",children:[M,$e("div",{className:"".concat(t,"-message"),children:[N,a]}),I("div",{className:"".concat(t,"-description"),children:s}),u?I("span",{className:"".concat(t,"-btn"),children:u}):null]})}),duration:T,closable:!0,closeIcon:O,onClose:d,onClick:p,key:m,style:v||{},className:He(x,re({},"".concat(t,"-").concat(o),!!o)),props:k}}function bie(e){zB(e,function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.instance;i.notice($B(e,n,r))})}var tp={open:bie,close:function(t){Object.keys(kd).forEach(function(n){return Promise.resolve(kd[n]).then(function(r){r.removeNotice(t)})})},config:vie,destroy:function(){Object.keys(kd).forEach(function(t){Promise.resolve(kd[t]).then(function(n){n.destroy()}),delete kd[t]})}};["success","info","warning","error"].forEach(function(e){tp[e]=function(t){return tp.open(ze(ze({},t),{type:e}))}});tp.warn=tp.warning;tp.useNotification=gie(zB,$B);const _ie=tp;var wie=function(t,n){return n||(t?"ant-".concat(t):"ant")},On=w.exports.createContext({getPrefixCls:wie}),zc=On.Consumer,Cie="-ant-".concat(Date.now(),"-").concat(Math.random());function Sie(e,t){var n={},r=function(p,m){var v=p.clone();return v=(m==null?void 0:m(v))||v,v.toRgbString()},i=function(p,m){var v=new bC(p),x=dv(v.toRgbString());n["".concat(m,"-color")]=r(v),n["".concat(m,"-color-disabled")]=x[1],n["".concat(m,"-color-hover")]=x[4],n["".concat(m,"-color-active")]=x[6],n["".concat(m,"-color-outline")]=v.clone().setAlpha(.2).toRgbString(),n["".concat(m,"-color-deprecated-bg")]=x[0],n["".concat(m,"-color-deprecated-border")]=x[2]};if(t.primaryColor){i(t.primaryColor,"primary");var o=new bC(t.primaryColor),s=dv(o.toRgbString());s.forEach(function(d,p){n["primary-".concat(p+1)]=d}),n["primary-color-deprecated-l-35"]=r(o,function(d){return d.lighten(35)}),n["primary-color-deprecated-l-20"]=r(o,function(d){return d.lighten(20)}),n["primary-color-deprecated-t-20"]=r(o,function(d){return d.tint(20)}),n["primary-color-deprecated-t-50"]=r(o,function(d){return d.tint(50)}),n["primary-color-deprecated-f-12"]=r(o,function(d){return d.setAlpha(d.getAlpha()*.12)});var a=new bC(s[0]);n["primary-color-active-deprecated-f-30"]=r(a,function(d){return d.setAlpha(d.getAlpha()*.3)}),n["primary-color-active-deprecated-d-02"]=r(a,function(d){return d.darken(2)})}t.successColor&&i(t.successColor,"success"),t.warningColor&&i(t.warningColor,"warning"),t.errorColor&&i(t.errorColor,"error"),t.infoColor&&i(t.infoColor,"info");var u=Object.keys(n).map(function(d){return"--".concat(e,"-").concat(d,": ").concat(n[d],";")});return` :root { `.concat(u.join(` `),` } `).trim()}function Eie(e,t){var n=Sie(e,t);Mo()&&jv(n,"".concat(Cie,"-dynamic-theme"))}var S3=w.exports.createContext(!1),BB=function(t){var n=t.children,r=t.disabled,i=w.exports.useContext(S3);return I(S3.Provider,{value:r!=null?r:i,children:n})};const Il=S3;var E3=w.exports.createContext(void 0),VB=function(t){var n=t.children,r=t.size;return I(E3.Consumer,{children:function(i){return I(E3.Provider,{value:r||i,children:n})}})};const Hs=E3;var Pie=["getTargetContainer","getPopupContainer","renderEmpty","pageHeader","input","pagination","form"],Iie="ant",Tie="anticon",lb,UB;function e1(){return lb||Iie}function kie(){return UB||Tie}var Mie=function(t){var n=t.prefixCls,r=t.iconPrefixCls,i=t.theme;n!==void 0&&(lb=n),r!==void 0&&(UB=r),i&&Eie(e1(),i)},II=function(){return{getPrefixCls:function(n,r){return r||(n?"".concat(e1(),"-").concat(n):e1())},getIconPrefixCls:kie,getRootPrefixCls:function(n,r){return n||lb||(r&&r.includes("-")?r.replace(/^(.*)-[^-]*$/,"$1"):e1())}}},Rie=function(t){var n,r,i=t.children,o=t.csp,s=t.autoInsertSpaceInButton,a=t.form,u=t.locale,d=t.componentSize,p=t.direction,m=t.space,v=t.virtual,x=t.dropdownMatchSelectWidth,_=t.legacyLocale,P=t.parentContext,k=t.iconPrefixCls,T=t.componentDisabled,M=w.exports.useCallback(function(B,H){var G=t.prefixCls;if(H)return H;var ee=G||P.getPrefixCls("");return B?"".concat(ee,"-").concat(B):ee},[P.getPrefixCls,t.prefixCls]),O=ze(ze({},P),{csp:o,autoInsertSpaceInButton:s,locale:u||_,direction:p,space:m,virtual:v,dropdownMatchSelectWidth:x,getPrefixCls:M});Pie.forEach(function(B){var H=t[B];H&&(O[B]=H)});var N=Vv(function(){return O},O,function(B,H){var G=Object.keys(B),ee=Object.keys(H);return G.length!==ee.length||G.some(function(X){return B[X]!==H[X]})}),L=w.exports.useMemo(function(){return{prefixCls:k,csp:o}},[k,o]),F=i,V={};return u&&(V=((n=u.Form)===null||n===void 0?void 0:n.defaultValidateMessages)||((r=gs.Form)===null||r===void 0?void 0:r.defaultValidateMessages)||{}),a&&a.validateMessages&&(V=ze(ze({},V),a.validateMessages)),Object.keys(V).length>0&&(F=I(mI,{validateMessages:V,children:i})),u&&(F=I(qne,{locale:u,_ANT_MARK__:Wne,children:F})),(k||o)&&(F=I(uI.Provider,{value:L,children:F})),d&&(F=I(VB,{size:d,children:F})),T!==void 0&&(F=I(BB,{disabled:T,children:F})),I(On.Provider,{value:N,children:F})},wp=function(t){return w.exports.useEffect(function(){t.direction&&(uie.config({rtl:t.direction==="rtl"}),_ie.config({rtl:t.direction==="rtl"}))},[t.direction]),I(bp,{children:function(n,r,i){return I(zc,{children:function(o){return I(Rie,{parentContext:o,legacyLocale:i,...t})}})}})};wp.ConfigContext=On;wp.SizeContext=Hs;wp.config=Mie;function la(e,t,n,r){var i=Tc.unstable_batchedUpdates?function(s){Tc.unstable_batchedUpdates(n,s)}:n;return e.addEventListener&&e.addEventListener(t,i,r),{remove:function(){e.removeEventListener&&e.removeEventListener(t,i,r)}}}function jB(e){return Object.keys(e).reduce(function(t,n){return(n.startsWith("data-")||n.startsWith("aria-")||n==="role")&&!n.startsWith("data-__")&&(t[n]=e[n]),t},{})}var Ro=w.exports.isValidElement;function HB(e){return e&&Ro(e)&&e.type===w.exports.Fragment}function KB(e,t,n){return Ro(e)?w.exports.cloneElement(e,typeof n=="function"?n(e.props||{}):n):t}function ui(e,t){return KB(e,e,t)}var Aie=function(e){ci(n,e);var t=di(n);function n(){var r;return Nr(this,n),r=t.apply(this,arguments),r.state={error:void 0,info:{componentStack:""}},r}return Lr(n,[{key:"componentDidCatch",value:function(i,o){this.setState({error:i,info:o})}},{key:"render",value:function(){var i=this.props,o=i.message,s=i.description,a=i.children,u=this.state,d=u.error,p=u.info,m=p&&p.componentStack?p.componentStack:null,v=typeof o>"u"?(d||"").toString():o,x=typeof s>"u"?m:s;return d?I(GB,{type:"error",message:v,description:I("pre",{children:x})}):a}}]),n}(w.exports.Component);const Die=Aie;var Oie=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u")return 0;var i=t?"scrollTop":"scrollLeft",o=0;return P3(e)?o=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?o=e.documentElement[i]:(e instanceof HTMLElement||e)&&(o=e[i]),e&&!P3(e)&&typeof o!="number"&&(o=(r=((n=e.ownerDocument)!==null&&n!==void 0?n:e).documentElement)===null||r===void 0?void 0:r[i]),o}function Bie(e,t,n,r){var i=n-t;return e/=r/2,e<1?i/2*e*e*e+t:i/2*((e-=2)*e*e+2)+t}function Vie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.getContainer,r=n===void 0?function(){return window}:n,i=t.callback,o=t.duration,s=o===void 0?450:o,a=r(),u=$ie(a,!0),d=Date.now(),p=function m(){var v=Date.now(),x=v-d,_=Bie(x>s?s:x,u,e,s);P3(a)?a.scrollTo(window.pageXOffset,_):a instanceof Document||a.constructor.name==="HTMLDocument"?a.documentElement.scrollTop=_:a.scrollTop=_,x"u"||typeof window>"u")return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e==null?void 0:e.substr(0,4))};var kt={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(t){var n=t.keyCode;if(t.altKey&&!t.ctrlKey||t.metaKey||n>=kt.F1&&n<=kt.F12)return!1;switch(n){case kt.ALT:case kt.CAPS_LOCK:case kt.CONTEXT_MENU:case kt.CTRL:case kt.DOWN:case kt.END:case kt.ESC:case kt.HOME:case kt.INSERT:case kt.LEFT:case kt.MAC_FF_META:case kt.META:case kt.NUMLOCK:case kt.NUM_CENTER:case kt.PAGE_DOWN:case kt.PAGE_UP:case kt.PAUSE:case kt.PRINT_SCREEN:case kt.RIGHT:case kt.SHIFT:case kt.UP:case kt.WIN_KEY:case kt.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(t){if(t>=kt.ZERO&&t<=kt.NINE||t>=kt.NUM_ZERO&&t<=kt.NUM_MULTIPLY||t>=kt.A&&t<=kt.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&t===0)return!0;switch(t){case kt.SPACE:case kt.QUESTION_MARK:case kt.NUM_PLUS:case kt.NUM_MINUS:case kt.NUM_PERIOD:case kt.NUM_DIVISION:case kt.SEMICOLON:case kt.DASH:case kt.EQUALS:case kt.COMMA:case kt.PERIOD:case kt.SLASH:case kt.APOSTROPHE:case kt.SINGLE_QUOTE:case kt.OPEN_SQUARE_BRACKET:case kt.BACKSLASH:case kt.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},qB=w.exports.createContext(null);function ZB(){return w.exports.useContext(qB)}function Uie(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,t=w.exports.useState(!1),n=Le(t,2),r=n[0],i=n[1],o=w.exports.useRef(null),s=function(){window.clearTimeout(o.current)};w.exports.useEffect(function(){return s},[]);var a=function(d,p){s(),o.current=window.setTimeout(function(){i(d),p&&p()},e)};return[r,a,s]}function XB(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,t=w.exports.useRef(null),n=w.exports.useRef(null);w.exports.useEffect(function(){return function(){window.clearTimeout(n.current)}},[]);function r(i){(i||t.current===null)&&(t.current=i),window.clearTimeout(n.current),n.current=window.setTimeout(function(){t.current=null},e)}return[function(){return t.current},r]}function jie(e,t,n,r){var i=w.exports.useRef(null);i.current={open:t,triggerOpen:n,customizedTrigger:r},w.exports.useEffect(function(){function o(s){var a;if(!((a=i.current)!==null&&a!==void 0&&a.customizedTrigger)){var u=s.target;u.shadowRoot&&s.composed&&(u=s.composedPath()[0]||u),i.current.open&&e().filter(function(d){return d}).every(function(d){return!d.contains(u)&&d!==u})&&i.current.triggerOpen(!1)}}return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}},[])}var Hie=`accept acceptCharset accessKey action allowFullScreen allowTransparency alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge charSet checked classID className colSpan cols content contentEditable contextMenu controls coords crossOrigin data dateTime default defer dir disabled download draggable encType form formAction formEncType formMethod formNoValidate formTarget frameBorder headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media mediaGroup method min minLength multiple muted name noValidate nonce open optimum pattern placeholder poster preload radioGroup readOnly rel required reversed role rowSpan rows sandbox scope scoped scrolling seamless selected shape size sizes span spellCheck src srcDoc srcLang srcSet start step style summary tabIndex target title type useMap value width wmode wrap`,Kie=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Wie="".concat(Hie," ").concat(Kie).split(/[\s\n]+/),Gie="aria-",qie="data-";function OD(e,t){return e.indexOf(t)===0}function gu(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n;t===!1?n={aria:!0,data:!0,attr:!0}:t===!0?n={aria:!0}:n=fe({},t);var r={};return Object.keys(e).forEach(function(i){(n.aria&&(i==="role"||OD(i,Gie))||n.data&&OD(i,qie)||n.attr&&Wie.includes(i))&&(r[i]=e[i])}),r}var Zie=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],nh=void 0;function Xie(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,o=e.renderItem,s=e.responsive,a=e.responsiveDisabled,u=e.registerSize,d=e.itemKey,p=e.className,m=e.style,v=e.children,x=e.display,_=e.order,P=e.component,k=P===void 0?"div":P,T=Rn(e,Zie),M=s&&!x;function O(B){u(d,B)}w.exports.useEffect(function(){return function(){O(null)}},[]);var N=o&&i!==nh?o(i):v,L;r||(L={opacity:M?0:1,height:M?0:nh,overflowY:M?"hidden":nh,order:s?_:nh,pointerEvents:M?"none":nh,position:M?"absolute":nh});var F={};M&&(F["aria-hidden"]=!0);var V=I(k,{className:He(!r&&n,p),style:fe(fe({},L),m),...F,...T,ref:t,children:N});return s&&(V=I(_u,{onResize:function(H){var G=H.offsetWidth;O(G)},disabled:a,children:V})),V}var Ig=w.exports.forwardRef(Xie);Ig.displayName="Item";function Yie(){var e=vl({}),t=Le(e,2),n=t[1],r=w.exports.useRef([]),i=0,o=0;function s(a){var u=i;i+=1,r.current.length_,Ze=w.exports.useMemo(function(){var gt=o;return Nt?ee===null&&B?gt=o:gt=o.slice(0,Math.min(o.length,Z/p)):typeof _=="number"&&(gt=o.slice(0,_)),gt},[o,p,ee,_,Nt]),Yt=w.exports.useMemo(function(){return Nt?o.slice(wt+1):o.slice(Ze.length)},[o,Ze,Nt,wt]),sn=w.exports.useCallback(function(gt,xt){var Vt;return typeof u=="function"?u(gt):(Vt=u&&(gt==null?void 0:gt[u]))!==null&&Vt!==void 0?Vt:xt},[u]),Gt=w.exports.useCallback(s||function(gt){return gt},[s]);function zt(gt,xt,Vt){mt===gt&&(xt===void 0||xt===St)||(ct(gt),Vt||(qe(gtZ){zt(qt-1,gt-vn-Ke+Ee);break}}T&&Lt(0)+Ke>Z&&We(null)}},[Z,ne,Ee,Ke,sn,Ze]);var Tt=nt&&!!Yt.length,Kt={};St!==null&&Nt&&(Kt={position:"absolute",left:St,top:0});var Zt={prefixCls:dt,responsive:Nt,component:N,invalidate:jt},ht=a?function(gt,xt){var Vt=sn(gt,xt);return I(ub.Provider,{value:fe(fe({},Zt),{},{order:xt,item:gt,itemKey:Vt,registerSize:Qt,display:xt<=wt}),children:a(gt,xt)},Vt)}:function(gt,xt){var Vt=sn(gt,xt);return w.exports.createElement(Ig,{...Zt,order:xt,key:Vt,item:gt,renderItem:Gt,itemKey:Vt,registerSize:Qt,display:xt<=wt})},xn,bn={order:Tt?wt:Number.MAX_SAFE_INTEGER,className:"".concat(dt,"-rest"),registerSize:pn,display:Tt};if(k)k&&(xn=I(ub.Provider,{value:fe(fe({},Zt),bn),children:k(Yt)}));else{var tn=P||roe;xn=I(Ig,{...Zt,...bn,children:typeof tn=="function"?tn(Yt):tn})}var Bt=$e(O,{className:He(!jt&&r,x),style:v,ref:t,...F,children:[Ze.map(ht),Ve?xn:null,T&&I(Ig,{...Zt,responsive:Dt,responsiveDisabled:!Nt,order:wt,className:"".concat(dt,"-suffix"),registerSize:ot,display:!0,style:Kt,children:T})]});return Dt&&(Bt=I(_u,{onResize:Rt,disabled:!Nt,children:Bt})),Bt}var yl=w.exports.forwardRef(ioe);yl.displayName="Overflow";yl.Item=YB;yl.RESPONSIVE=QB;yl.INVALIDATE=JB;var cb=function(t){var n=t.className,r=t.customizeIcon,i=t.customizeIconProps,o=t.onMouseDown,s=t.onClick,a=t.children,u;return typeof r=="function"?u=r(i):u=r,I("span",{className:n,onMouseDown:function(p){p.preventDefault(),o&&o(p)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:s,"aria-hidden":!0,children:u!==void 0?u:I("span",{className:He(n.split(/\s+/).map(function(d){return"".concat(d,"-icon")})),children:a})})},ooe=function(t,n){var r,i,o=t.prefixCls,s=t.id,a=t.inputElement,u=t.disabled,d=t.tabIndex,p=t.autoFocus,m=t.autoComplete,v=t.editable,x=t.activeDescendantId,_=t.value,P=t.maxLength,k=t.onKeyDown,T=t.onMouseDown,M=t.onChange,O=t.onPaste,N=t.onCompositionStart,L=t.onCompositionEnd,F=t.open,V=t.attrs,B=a||I("input",{}),H=B,G=H.ref,ee=H.props,X=ee.onKeyDown,Z=ee.onChange,Q=ee.onMouseDown,le=ee.onCompositionStart,ne=ee.onCompositionEnd,se=ee.style;return"maxLength"in B.props,B=w.exports.cloneElement(B,fe(fe(fe({type:"search"},ee),{},{id:s,ref:Zo(n,G),disabled:u,tabIndex:d,autoComplete:m||"off",autoFocus:p,className:He("".concat(o,"-selection-search-input"),(r=B)===null||r===void 0||(i=r.props)===null||i===void 0?void 0:i.className),role:"combobox","aria-expanded":F,"aria-haspopup":"listbox","aria-owns":"".concat(s,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(s,"_list"),"aria-activedescendant":x},V),{},{value:v?_:"",maxLength:P,readOnly:!v,unselectable:v?null:"on",style:fe(fe({},se),{},{opacity:v?null:0}),onKeyDown:function(he){k(he),X&&X(he)},onMouseDown:function(he){T(he),Q&&Q(he)},onChange:function(he){M(he),Z&&Z(he)},onCompositionStart:function(he){N(he),le&&le(he)},onCompositionEnd:function(he){L(he),ne&&ne(he)},onPaste:O})),B},kI=w.exports.forwardRef(ooe);kI.displayName="Input";function e9(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}var aoe=typeof window<"u"&&window.document&&window.document.documentElement,soe=aoe;function loe(e){return e!=null}function ND(e){return["string","number"].includes(nn(e))}function t9(e){var t=void 0;return e&&(ND(e.title)?t=e.title.toString():ND(e.label)&&(t=e.label.toString())),t}function uoe(e,t){soe?w.exports.useLayoutEffect(e,t):w.exports.useEffect(e,t)}function coe(e){var t;return(t=e.key)!==null&&t!==void 0?t:e.value}var LD=function(t){t.preventDefault(),t.stopPropagation()},doe=function(t){var n=t.id,r=t.prefixCls,i=t.values,o=t.open,s=t.searchValue,a=t.autoClearSearchValue,u=t.inputRef,d=t.placeholder,p=t.disabled,m=t.mode,v=t.showSearch,x=t.autoFocus,_=t.autoComplete,P=t.activeDescendantId,k=t.tabIndex,T=t.removeIcon,M=t.maxTagCount,O=t.maxTagTextLength,N=t.maxTagPlaceholder,L=N===void 0?function(We){return"+ ".concat(We.length," ...")}:N,F=t.tagRender,V=t.onToggleOpen,B=t.onRemove,H=t.onInputChange,G=t.onInputPaste,ee=t.onInputKeyDown,X=t.onInputMouseDown,Z=t.onInputCompositionStart,Q=t.onInputCompositionEnd,le=w.exports.useRef(null),ne=w.exports.useState(0),se=Le(ne,2),oe=se[0],he=se[1],_e=w.exports.useState(!1),be=Le(_e,2),xe=be[0],Te=be[1],Ee="".concat(r,"-selection"),Ce=o||m==="multiple"&&a===!1||m==="tags"?s:"",ke=m==="tags"||m==="multiple"&&a===!1||v&&(o||xe);uoe(function(){he(le.current.scrollWidth)},[Ce]);function De(We,bt,Qe,mt,ct){return $e("span",{className:He("".concat(Ee,"-item"),re({},"".concat(Ee,"-item-disabled"),Qe)),title:t9(We),children:[I("span",{className:"".concat(Ee,"-item-content"),children:bt}),mt&&I(cb,{className:"".concat(Ee,"-item-remove"),onMouseDown:LD,onClick:ct,customizeIcon:T,children:"\xD7"})]})}function Ke(We,bt,Qe,mt,ct){var wt=function(ut){LD(ut),V(!o)};return I("span",{onMouseDown:wt,children:F({label:bt,value:We,disabled:Qe,closable:mt,onClose:ct})})}function Ue(We){var bt=We.disabled,Qe=We.label,mt=We.value,ct=!p&&!bt,wt=Qe;if(typeof O=="number"&&(typeof Qe=="string"||typeof Qe=="number")){var rt=String(wt);rt.length>O&&(wt="".concat(rt.slice(0,O),"..."))}var ut=function(qe){qe&&qe.stopPropagation(),B(We)};return typeof F=="function"?Ke(mt,wt,bt,ct,ut):De(We,wt,bt,ct,ut)}function tt(We){var bt=typeof L=="function"?L(We):L;return De({title:bt},bt,!1)}var lt=$e("div",{className:"".concat(Ee,"-search"),style:{width:oe},onFocus:function(){Te(!0)},onBlur:function(){Te(!1)},children:[I(kI,{ref:u,open:o,prefixCls:r,id:n,inputElement:null,disabled:p,autoFocus:x,autoComplete:_,editable:ke,activeDescendantId:P,value:Ce,onKeyDown:ee,onMouseDown:X,onChange:H,onPaste:G,onCompositionStart:Z,onCompositionEnd:Q,tabIndex:k,attrs:gu(t,!0)}),$e("span",{ref:le,className:"".concat(Ee,"-search-mirror"),"aria-hidden":!0,children:[Ce,"\xA0"]})]}),St=I(yl,{prefixCls:"".concat(Ee,"-overflow"),data:i,renderItem:Ue,renderRest:tt,suffix:lt,itemKey:coe,maxCount:M});return $e(Tn,{children:[St,!i.length&&!Ce&&I("span",{className:"".concat(Ee,"-placeholder"),children:d})]})},foe=function(t){var n=t.inputElement,r=t.prefixCls,i=t.id,o=t.inputRef,s=t.disabled,a=t.autoFocus,u=t.autoComplete,d=t.activeDescendantId,p=t.mode,m=t.open,v=t.values,x=t.placeholder,_=t.tabIndex,P=t.showSearch,k=t.searchValue,T=t.activeValue,M=t.maxLength,O=t.onInputKeyDown,N=t.onInputMouseDown,L=t.onInputChange,F=t.onInputPaste,V=t.onInputCompositionStart,B=t.onInputCompositionEnd,H=w.exports.useState(!1),G=Le(H,2),ee=G[0],X=G[1],Z=p==="combobox",Q=Z||P,le=v[0],ne=k||"";Z&&T&&!ee&&(ne=T),w.exports.useEffect(function(){Z&&X(!1)},[Z,T]);var se=p!=="combobox"&&!m&&!P?!1:!!ne,oe=t9(le),he=function(){if(le)return null;var be=se?{visibility:"hidden"}:void 0;return I("span",{className:"".concat(r,"-selection-placeholder"),style:be,children:x})};return $e(Tn,{children:[I("span",{className:"".concat(r,"-selection-search"),children:I(kI,{ref:o,prefixCls:r,id:i,open:m,inputElement:n,disabled:s,autoFocus:a,autoComplete:u,editable:Q,activeDescendantId:d,value:ne,onKeyDown:O,onMouseDown:N,onChange:function(be){X(!0),L(be)},onPaste:F,onCompositionStart:V,onCompositionEnd:B,tabIndex:_,attrs:gu(t,!0),maxLength:Z?M:void 0})}),!Z&&le&&!se&&I("span",{className:"".concat(r,"-selection-item"),title:oe,children:le.label}),he()]})};function hoe(e){return![kt.ESC,kt.SHIFT,kt.BACKSPACE,kt.TAB,kt.WIN_KEY,kt.ALT,kt.META,kt.WIN_KEY_RIGHT,kt.CTRL,kt.SEMICOLON,kt.EQUALS,kt.CAPS_LOCK,kt.CONTEXT_MENU,kt.F1,kt.F2,kt.F3,kt.F4,kt.F5,kt.F6,kt.F7,kt.F8,kt.F9,kt.F10,kt.F11,kt.F12].includes(e)}var poe=function(t,n){var r=w.exports.useRef(null),i=w.exports.useRef(!1),o=t.prefixCls,s=t.open,a=t.mode,u=t.showSearch,d=t.tokenWithEnter,p=t.autoClearSearchValue,m=t.onSearch,v=t.onSearchSubmit,x=t.onToggleOpen,_=t.onInputKeyDown,P=t.domRef;w.exports.useImperativeHandle(n,function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}});var k=XB(0),T=Le(k,2),M=T[0],O=T[1],N=function(se){var oe=se.which;(oe===kt.UP||oe===kt.DOWN)&&se.preventDefault(),_&&_(se),oe===kt.ENTER&&a==="tags"&&!i.current&&!s&&(v==null||v(se.target.value)),hoe(oe)&&x(!0)},L=function(){O(!0)},F=w.exports.useRef(null),V=function(se){m(se,!0,i.current)!==!1&&x(!0)},B=function(){i.current=!0},H=function(se){i.current=!1,a!=="combobox"&&V(se.target.value)},G=function(se){var oe=se.target.value;if(d&&F.current&&/[\r\n]/.test(F.current)){var he=F.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");oe=oe.replace(he,F.current)}F.current=null,V(oe)},ee=function(se){var oe=se.clipboardData,he=oe.getData("text");F.current=he},X=function(se){var oe=se.target;if(oe!==r.current){var he=document.body.style.msTouchAction!==void 0;he?setTimeout(function(){r.current.focus()}):r.current.focus()}},Z=function(se){var oe=M();se.target!==r.current&&!oe&&a!=="combobox"&&se.preventDefault(),(a!=="combobox"&&(!u||!oe)||!s)&&(s&&p!==!1&&m("",!0,!1),x())},Q={inputRef:r,onInputKeyDown:N,onInputMouseDown:L,onInputChange:G,onInputPaste:ee,onInputCompositionStart:B,onInputCompositionEnd:H},le=a==="multiple"||a==="tags"?I(doe,{...t,...Q}):I(foe,{...t,...Q});return I("div",{ref:P,className:"".concat(o,"-selector"),onClick:X,onMouseDown:Z,children:le})},n9=w.exports.forwardRef(poe);n9.displayName="Selector";var moe=w.exports.forwardRef(function(e,t){var n=e.didUpdate,r=e.getContainer,i=e.children,o=w.exports.useRef(),s=w.exports.useRef();w.exports.useImperativeHandle(t,function(){return{}});var a=w.exports.useRef(!1);return!a.current&&Mo()&&(s.current=r(),o.current=s.current.parentNode,a.current=!0),w.exports.useEffect(function(){n==null||n(e)}),w.exports.useEffect(function(){return s.current.parentNode===null&&o.current!==null&&o.current.appendChild(s.current),function(){var u,d;(u=s.current)===null||u===void 0||(d=u.parentNode)===null||d===void 0||d.removeChild(s.current)}},[]),s.current?Tc.createPortal(i,s.current):null});function goe(e,t,n){return n?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function voe(e,t,n){var r=e[t]||{};return fe(fe({},r),n)}function yoe(e,t,n,r){for(var i=n.points,o=Object.keys(e),s=0;s=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Uoe(e,t,n,r){var i=Yn.clone(e),o={width:t.width,height:t.height};return r.adjustX&&i.left=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),Yn.mix(i,o)}function DI(e){var t,n,r;if(!Yn.isWindow(e)&&e.nodeType!==9)t=Yn.offset(e),n=Yn.outerWidth(e),r=Yn.outerHeight(e);else{var i=Yn.getWindow(e);t={left:Yn.getWindowScrollLeft(i),top:Yn.getWindowScrollTop(i)},n=Yn.viewportWidth(i),r=Yn.viewportHeight(i)}return t.width=n,t.height=r,t}function WD(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,o=e.height,s=e.left,a=e.top;return n==="c"?a+=o/2:n==="b"&&(a+=o),r==="c"?s+=i/2:r==="r"&&(s+=i),{left:s,top:a}}function Qy(e,t,n,r,i){var o=WD(t,n[1]),s=WD(e,n[0]),a=[s.left-o.left,s.top-o.top];return{left:Math.round(e.left-a[0]+r[0]-i[0]),top:Math.round(e.top-a[1]+r[1]-i[1])}}function GD(e,t,n){return e.leftn.right}function qD(e,t,n){return e.topn.bottom}function joe(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.right||r.top>=n.bottom}function OI(e,t,n){var r=n.target||t,i=DI(r),o=!Koe(r,n.overflow&&n.overflow.alwaysByViewport);return d9(e,i,n,o)}OI.__getOffsetParent=M3;OI.__getVisibleRectForElement=AI;function Woe(e,t,n){var r,i,o=Yn.getDocument(e),s=o.defaultView||o.parentWindow,a=Yn.getWindowScrollLeft(s),u=Yn.getWindowScrollTop(s),d=Yn.viewportWidth(s),p=Yn.viewportHeight(s);"pageX"in t?r=t.pageX:r=a+t.clientX,"pageY"in t?i=t.pageY:i=u+t.clientY;var m={left:r,top:i,width:0,height:0},v=r>=0&&r<=a+d&&i>=0&&i<=u+p,x=[n.points[0],"cc"];return d9(e,m,zD(zD({},n),{},{points:x}),v)}function NI(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=new Set;function i(o,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=r.has(o);if(Dr(!u,"Warning: There may be circular references"),u)return!1;if(o===s)return!0;if(n&&a>1)return!1;r.add(o);var d=a+1;if(Array.isArray(o)){if(!Array.isArray(s)||o.length!==s.length)return!1;for(var p=0;p1&&(St=I("div",{className:"".concat(r,"-content"),children:s})),I(Xo,{visible:n,ref:F,leavedClassName:"".concat(r,"-hidden"),...Ke,onAppearPrepare:Ue,onEnterPrepare:Ue,removeOnLeave:d,forceRender:p,children:function(We,bt){var Qe=We.className,mt=We.style,ct=He(r,i,H,Qe);return I(f9,{target:Ce(),ref:L,monitorWindowResize:!0,disabled:lt,align:m,onAlign:De,children:I("div",{ref:bt,className:ct,onMouseEnter:k,onMouseLeave:T,onMouseDownCapture:M,onTouchStartCapture:O,onClick:N,style:fe(fe({},mt),tt),children:St})},"popup")}})});h9.displayName="PopupInner";var p9=w.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,o=e.children,s=e.mobile;s=s===void 0?{}:s;var a=s.popupClassName,u=s.popupStyle,d=s.popupMotion,p=d===void 0?{}:d,m=s.popupRender,v=e.onClick,x=w.exports.useRef();w.exports.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return x.current}}});var _=fe({zIndex:i},u),P=o;return w.exports.Children.count(o)>1&&(P=I("div",{className:"".concat(n,"-content"),children:o})),m&&(P=m(P)),I(Xo,{visible:r,ref:x,removeOnLeave:!0,...p,children:function(k,T){var M=k.className,O=k.style,N=He(n,a,M);return I("div",{ref:T,className:N,onClick:v,style:fe(fe({},O),_),children:P})}})});p9.displayName="MobilePopupInner";var Joe=["visible","mobile"],m9=w.exports.forwardRef(function(e,t){var n=e.visible,r=e.mobile,i=Rn(e,Joe),o=w.exports.useState(n),s=Le(o,2),a=s[0],u=s[1],d=w.exports.useState(!1),p=Le(d,2),m=p[0],v=p[1],x=fe(fe({},i),{},{visible:a});w.exports.useEffect(function(){u(n),n&&r&&v(TI())},[n,r]);var _=m?I(p9,{...x,mobile:r,ref:t}):I(h9,{...x,ref:t});return $e("div",{children:[I(xoe,{...x}),_]})});m9.displayName="Popup";var tO=w.exports.createContext(null);function kC(){}function eae(){return""}function tae(e){return e?e.ownerDocument:window.document}var nae=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];function rae(e){var t=function(n){ci(i,n);var r=di(i);function i(o){var s;Nr(this,i),s=r.call(this,o),re(Vn(s),"popupRef",w.exports.createRef()),re(Vn(s),"triggerRef",w.exports.createRef()),re(Vn(s),"portalContainer",void 0),re(Vn(s),"attachId",void 0),re(Vn(s),"clickOutsideHandler",void 0),re(Vn(s),"touchOutsideHandler",void 0),re(Vn(s),"contextMenuOutsideHandler1",void 0),re(Vn(s),"contextMenuOutsideHandler2",void 0),re(Vn(s),"mouseDownTimeout",void 0),re(Vn(s),"focusTime",void 0),re(Vn(s),"preClickTime",void 0),re(Vn(s),"preTouchTime",void 0),re(Vn(s),"delayTimer",void 0),re(Vn(s),"hasPopupMouseDown",void 0),re(Vn(s),"onMouseEnter",function(u){var d=s.props.mouseEnterDelay;s.fireEvents("onMouseEnter",u),s.delaySetPopupVisible(!0,d,d?null:u)}),re(Vn(s),"onMouseMove",function(u){s.fireEvents("onMouseMove",u),s.setPoint(u)}),re(Vn(s),"onMouseLeave",function(u){s.fireEvents("onMouseLeave",u),s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),re(Vn(s),"onPopupMouseEnter",function(){s.clearDelayTimer()}),re(Vn(s),"onPopupMouseLeave",function(u){var d;u.relatedTarget&&!u.relatedTarget.setTimeout&&Kd((d=s.popupRef.current)===null||d===void 0?void 0:d.getElement(),u.relatedTarget)||s.delaySetPopupVisible(!1,s.props.mouseLeaveDelay)}),re(Vn(s),"onFocus",function(u){s.fireEvents("onFocus",u),s.clearDelayTimer(),s.isFocusToShow()&&(s.focusTime=Date.now(),s.delaySetPopupVisible(!0,s.props.focusDelay))}),re(Vn(s),"onMouseDown",function(u){s.fireEvents("onMouseDown",u),s.preClickTime=Date.now()}),re(Vn(s),"onTouchStart",function(u){s.fireEvents("onTouchStart",u),s.preTouchTime=Date.now()}),re(Vn(s),"onBlur",function(u){s.fireEvents("onBlur",u),s.clearDelayTimer(),s.isBlurToHide()&&s.delaySetPopupVisible(!1,s.props.blurDelay)}),re(Vn(s),"onContextMenu",function(u){u.preventDefault(),s.fireEvents("onContextMenu",u),s.setPopupVisible(!0,u)}),re(Vn(s),"onContextMenuClose",function(){s.isContextMenuToShow()&&s.close()}),re(Vn(s),"onClick",function(u){if(s.fireEvents("onClick",u),s.focusTime){var d;if(s.preClickTime&&s.preTouchTime?d=Math.min(s.preClickTime,s.preTouchTime):s.preClickTime?d=s.preClickTime:s.preTouchTime&&(d=s.preTouchTime),Math.abs(d-s.focusTime)<20)return;s.focusTime=0}s.preClickTime=0,s.preTouchTime=0,s.isClickToShow()&&(s.isClickToHide()||s.isBlurToHide())&&u&&u.preventDefault&&u.preventDefault();var p=!s.state.popupVisible;(s.isClickToHide()&&!p||p&&s.isClickToShow())&&s.setPopupVisible(!s.state.popupVisible,u)}),re(Vn(s),"onPopupMouseDown",function(){if(s.hasPopupMouseDown=!0,clearTimeout(s.mouseDownTimeout),s.mouseDownTimeout=window.setTimeout(function(){s.hasPopupMouseDown=!1},0),s.context){var u;(u=s.context).onPopupMouseDown.apply(u,arguments)}}),re(Vn(s),"onDocumentClick",function(u){if(!(s.props.mask&&!s.props.maskClosable)){var d=u.target,p=s.getRootDomNode(),m=s.getPopupDomNode();(!Kd(p,d)||s.isContextMenuOnly())&&!Kd(m,d)&&!s.hasPopupMouseDown&&s.close()}}),re(Vn(s),"getRootDomNode",function(){var u=s.props.getTriggerDOMNode;if(u)return u(s.triggerRef.current);try{var d=lv(s.triggerRef.current);if(d)return d}catch{}return Tc.findDOMNode(Vn(s))}),re(Vn(s),"getPopupClassNameFromAlign",function(u){var d=[],p=s.props,m=p.popupPlacement,v=p.builtinPlacements,x=p.prefixCls,_=p.alignPoint,P=p.getPopupClassNameFromAlign;return m&&v&&d.push(yoe(v,x,u,_)),P&&d.push(P(u)),d.join(" ")}),re(Vn(s),"getComponent",function(){var u=s.props,d=u.prefixCls,p=u.destroyPopupOnHide,m=u.popupClassName,v=u.onPopupAlign,x=u.popupMotion,_=u.popupAnimation,P=u.popupTransitionName,k=u.popupStyle,T=u.mask,M=u.maskAnimation,O=u.maskTransitionName,N=u.maskMotion,L=u.zIndex,F=u.popup,V=u.stretch,B=u.alignPoint,H=u.mobile,G=u.forceRender,ee=u.onPopupClick,X=s.state,Z=X.popupVisible,Q=X.point,le=s.getPopupAlign(),ne={};return s.isMouseEnterToShow()&&(ne.onMouseEnter=s.onPopupMouseEnter),s.isMouseLeaveToHide()&&(ne.onMouseLeave=s.onPopupMouseLeave),ne.onMouseDown=s.onPopupMouseDown,ne.onTouchStart=s.onPopupMouseDown,I(m9,{prefixCls:d,destroyPopupOnHide:p,visible:Z,point:B&&Q,className:m,align:le,onAlign:v,animation:_,getClassNameFromAlign:s.getPopupClassNameFromAlign,...ne,stretch:V,getRootDomNode:s.getRootDomNode,style:k,mask:T,zIndex:L,transitionName:P,maskAnimation:M,maskTransitionName:O,maskMotion:N,ref:s.popupRef,motion:x,mobile:H,forceRender:G,onClick:ee,children:typeof F=="function"?F():F})}),re(Vn(s),"attachParent",function(u){ar.cancel(s.attachId);var d=s.props,p=d.getPopupContainer,m=d.getDocument,v=s.getRootDomNode(),x;p?(v||p.length===0)&&(x=p(v)):x=m(s.getRootDomNode()).body,x?x.appendChild(u):s.attachId=ar(function(){s.attachParent(u)})}),re(Vn(s),"getContainer",function(){if(!s.portalContainer){var u=s.props.getDocument,d=u(s.getRootDomNode()).createElement("div");d.style.position="absolute",d.style.top="0",d.style.left="0",d.style.width="100%",s.portalContainer=d}return s.attachParent(s.portalContainer),s.portalContainer}),re(Vn(s),"setPoint",function(u){var d=s.props.alignPoint;!d||!u||s.setState({point:{pageX:u.pageX,pageY:u.pageY}})}),re(Vn(s),"handlePortalUpdate",function(){s.state.prevPopupVisible!==s.state.popupVisible&&s.props.afterPopupVisibleChange(s.state.popupVisible)}),re(Vn(s),"triggerContextValue",{onPopupMouseDown:s.onPopupMouseDown});var a;return"popupVisible"in o?a=!!o.popupVisible:a=!!o.defaultPopupVisible,s.state={prevPopupVisible:a,popupVisible:a},nae.forEach(function(u){s["fire".concat(u)]=function(d){s.fireEvents(u,d)}}),s}return Lr(i,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var s=this.props,a=this.state;if(a.popupVisible){var u;!this.clickOutsideHandler&&(this.isClickToHide()||this.isContextMenuToShow())&&(u=s.getDocument(this.getRootDomNode()),this.clickOutsideHandler=la(u,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(u=u||s.getDocument(this.getRootDomNode()),this.touchOutsideHandler=la(u,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(u=u||s.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=la(u,"scroll",this.onContextMenuClose)),!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=la(window,"blur",this.onContextMenuClose));return}this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),ar.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var s;return((s=this.popupRef.current)===null||s===void 0?void 0:s.getElement())||null}},{key:"getPopupAlign",value:function(){var s=this.props,a=s.popupPlacement,u=s.popupAlign,d=s.builtinPlacements;return a&&d?voe(d,a,u):u}},{key:"setPopupVisible",value:function(s,a){var u=this.props.alignPoint,d=this.state.popupVisible;this.clearDelayTimer(),d!==s&&("popupVisible"in this.props||this.setState({popupVisible:s,prevPopupVisible:d}),this.props.onPopupVisibleChange(s)),u&&a&&s&&this.setPoint(a)}},{key:"delaySetPopupVisible",value:function(s,a,u){var d=this,p=a*1e3;if(this.clearDelayTimer(),p){var m=u?{pageX:u.pageX,pageY:u.pageY}:null;this.delayTimer=window.setTimeout(function(){d.setPopupVisible(s,m),d.clearDelayTimer()},p)}else this.setPopupVisible(s,u)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(s){var a=this.props.children.props,u=this.props;return a[s]&&u[s]?this["fire".concat(s)]:a[s]||u[s]}},{key:"isClickToShow",value:function(){var s=this.props,a=s.action,u=s.showAction;return a.indexOf("click")!==-1||u.indexOf("click")!==-1}},{key:"isContextMenuOnly",value:function(){var s=this.props.action;return s==="contextMenu"||s.length===1&&s[0]==="contextMenu"}},{key:"isContextMenuToShow",value:function(){var s=this.props,a=s.action,u=s.showAction;return a.indexOf("contextMenu")!==-1||u.indexOf("contextMenu")!==-1}},{key:"isClickToHide",value:function(){var s=this.props,a=s.action,u=s.hideAction;return a.indexOf("click")!==-1||u.indexOf("click")!==-1}},{key:"isMouseEnterToShow",value:function(){var s=this.props,a=s.action,u=s.showAction;return a.indexOf("hover")!==-1||u.indexOf("mouseEnter")!==-1}},{key:"isMouseLeaveToHide",value:function(){var s=this.props,a=s.action,u=s.hideAction;return a.indexOf("hover")!==-1||u.indexOf("mouseLeave")!==-1}},{key:"isFocusToShow",value:function(){var s=this.props,a=s.action,u=s.showAction;return a.indexOf("focus")!==-1||u.indexOf("focus")!==-1}},{key:"isBlurToHide",value:function(){var s=this.props,a=s.action,u=s.hideAction;return a.indexOf("focus")!==-1||u.indexOf("blur")!==-1}},{key:"forcePopupAlign",value:function(){if(this.state.popupVisible){var s;(s=this.popupRef.current)===null||s===void 0||s.forceAlign()}}},{key:"fireEvents",value:function(s,a){var u=this.props.children.props[s];u&&u(a);var d=this.props[s];d&&d(a)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var s=this.state.popupVisible,a=this.props,u=a.children,d=a.forceRender,p=a.alignPoint,m=a.className,v=a.autoDestroy,x=w.exports.Children.only(u),_={key:"trigger"};this.isContextMenuToShow()?_.onContextMenu=this.onContextMenu:_.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(_.onClick=this.onClick,_.onMouseDown=this.onMouseDown,_.onTouchStart=this.onTouchStart):(_.onClick=this.createTwoChains("onClick"),_.onMouseDown=this.createTwoChains("onMouseDown"),_.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(_.onMouseEnter=this.onMouseEnter,p&&(_.onMouseMove=this.onMouseMove)):_.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?_.onMouseLeave=this.onMouseLeave:_.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(_.onFocus=this.onFocus,_.onBlur=this.onBlur):(_.onFocus=this.createTwoChains("onFocus"),_.onBlur=this.createTwoChains("onBlur"));var P=He(x&&x.props&&x.props.className,m);P&&(_.className=P);var k=fe({},_);vf(x)&&(k.ref=Zo(this.triggerRef,x.ref));var T=w.exports.cloneElement(x,k),M;return(s||this.popupRef.current||d)&&(M=I(e,{getContainer:this.getContainer,didUpdate:this.handlePortalUpdate,children:this.getComponent()},"portal")),!s&&v&&(M=null),$e(tO.Provider,{value:this.triggerContextValue,children:[T,M]})}}],[{key:"getDerivedStateFromProps",value:function(s,a){var u=s.popupVisible,d={};return u!==void 0&&a.popupVisible!==u&&(d.popupVisible=u,d.prevPopupVisible=a.popupVisible),d}}]),i}(w.exports.Component);return re(t,"contextType",tO),re(t,"defaultProps",{prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:eae,getDocument:tae,onPopupVisibleChange:kC,afterPopupVisibleChange:kC,onPopupAlign:kC,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1}),t}const z_=rae(moe);var iae=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],oae=function(t){var n=t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:n,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:n,adjustY:1}}}},aae=function(t,n){var r=t.prefixCls;t.disabled;var i=t.visible,o=t.children,s=t.popupElement,a=t.containerWidth,u=t.animation,d=t.transitionName,p=t.dropdownStyle,m=t.dropdownClassName,v=t.direction,x=v===void 0?"ltr":v,_=t.placement,P=t.dropdownMatchSelectWidth,k=t.dropdownRender,T=t.dropdownAlign,M=t.getPopupContainer,O=t.empty,N=t.getTriggerDOMNode,L=t.onPopupVisibleChange,F=t.onPopupMouseEnter,V=Rn(t,iae),B="".concat(r,"-dropdown"),H=s;k&&(H=k(s));var G=w.exports.useMemo(function(){return oae(P)},[P]),ee=u?"".concat(B,"-").concat(u):d,X=w.exports.useRef(null);w.exports.useImperativeHandle(n,function(){return{getPopupElement:function(){return X.current}}});var Z=fe({minWidth:a},p);return typeof P=="number"?Z.width=P:P&&(Z.width=a),I(z_,{...V,showAction:L?["click"]:[],hideAction:L?["click"]:[],popupPlacement:_||(x==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:G,prefixCls:B,popupTransitionName:ee,popup:I("div",{ref:X,onMouseEnter:F,children:H}),popupAlign:T,popupVisible:i,getPopupContainer:M,popupClassName:He(m,re({},"".concat(B,"-empty"),O)),popupStyle:Z,getTriggerDOMNode:N,onPopupVisibleChange:L,children:o})},g9=w.exports.forwardRef(aae);g9.displayName="SelectTrigger";function nO(e,t){var n=e.key,r;return"value"in e&&(r=e.value),n!=null?n:r!==void 0?r:"rc-index-key-".concat(t)}function v9(e,t){var n=e||{},r=n.label,i=n.value,o=n.options;return{label:r||(t?"children":"label"),value:i||"value",options:o||"options"}}function sae(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,i=[],o=v9(n,!1),s=o.label,a=o.value,u=o.options;function d(p,m){p.forEach(function(v){var x=v[s];if(m||!(u in v)){var _=v[a];i.push({key:nO(v,i.length),groupOption:m,data:v,label:x,value:_})}else{var P=x;P===void 0&&r&&(P=v.label),i.push({key:nO(v,i.length),group:!0,data:v,label:P}),d(v[u],!0)}})}return d(e,!1),i}function R3(e){var t=fe({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Dr(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}function lae(e,t){if(!t||!t.length)return null;var n=!1;function r(o,s){var a=dI(s),u=a[0],d=a.slice(1);if(!u)return[o];var p=o.split(u);return n=n||p.length>1,p.reduce(function(m,v){return[].concat(Pt(m),Pt(r(v,d)))},[]).filter(function(m){return m})}var i=r(e,t);return n?i:null}var uae=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],cae=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function A3(e){return e==="tags"||e==="multiple"}var y9=w.exports.forwardRef(function(e,t){var n,r,i=e.id,o=e.prefixCls,s=e.className,a=e.showSearch,u=e.tagRender,d=e.direction,p=e.omitDomProps,m=e.displayValues,v=e.onDisplayValuesChange,x=e.emptyOptions,_=e.notFoundContent,P=_===void 0?"Not Found":_,k=e.onClear,T=e.mode,M=e.disabled,O=e.loading,N=e.getInputElement,L=e.getRawInputElement,F=e.open,V=e.defaultOpen,B=e.onDropdownVisibleChange,H=e.activeValue,G=e.onActiveValueChange,ee=e.activeDescendantId,X=e.searchValue,Z=e.autoClearSearchValue,Q=e.onSearch,le=e.onSearchSplit,ne=e.tokenSeparators,se=e.allowClear,oe=e.showArrow,he=e.inputIcon,_e=e.clearIcon,be=e.OptionList,xe=e.animation,Te=e.transitionName,Ee=e.dropdownStyle,Ce=e.dropdownClassName,ke=e.dropdownMatchSelectWidth,De=e.dropdownRender,Ke=e.dropdownAlign,Ue=e.placement,tt=e.getPopupContainer,lt=e.showAction,St=lt===void 0?[]:lt,We=e.onFocus,bt=e.onBlur,Qe=e.onKeyUp,mt=e.onKeyDown,ct=e.onMouseDown,wt=Rn(e,uae),rt=A3(T),ut=(a!==void 0?a:rt)||T==="combobox",nt=fe({},wt);cae.forEach(function(Nn){delete nt[Nn]}),p==null||p.forEach(function(Nn){delete nt[Nn]});var qe=w.exports.useState(!1),dt=Le(qe,2),_t=dt[0],Dt=dt[1];w.exports.useEffect(function(){Dt(TI())},[]);var Nt=w.exports.useRef(null),jt=w.exports.useRef(null),Ve=w.exports.useRef(null),Ze=w.exports.useRef(null),Yt=w.exports.useRef(null),sn=Uie(),Gt=Le(sn,3),zt=Gt[0],Rt=Gt[1],Qt=Gt[2];w.exports.useImperativeHandle(t,function(){var Nn,An;return{focus:(Nn=Ze.current)===null||Nn===void 0?void 0:Nn.focus,blur:(An=Ze.current)===null||An===void 0?void 0:An.blur,scrollTo:function(ri){var Er;return(Er=Yt.current)===null||Er===void 0?void 0:Er.scrollTo(ri)}}});var pn=w.exports.useMemo(function(){var Nn;if(T!=="combobox")return X;var An=(Nn=m[0])===null||Nn===void 0?void 0:Nn.value;return typeof An=="string"||typeof An=="number"?String(An):""},[X,T,m]),ot=T==="combobox"&&typeof N=="function"&&N()||null,Lt=typeof L=="function"&&L(),Tt=s$(jt,Lt==null||(n=Lt.props)===null||n===void 0?void 0:n.ref),Kt=ki(void 0,{defaultValue:V,value:F}),Zt=Le(Kt,2),ht=Zt[0],xn=Zt[1],bn=ht,tn=!P&&x;(M||tn&&bn&&T==="combobox")&&(bn=!1);var Bt=tn?!1:bn,gt=w.exports.useCallback(function(Nn){var An=Nn!==void 0?Nn:!bn;M||(xn(An),bn!==An&&(B==null||B(An)))},[M,bn,xn,B]),xt=w.exports.useMemo(function(){return(ne||[]).some(function(Nn){return[` `,`\r `].includes(Nn)})},[ne]),Vt=function(An,zn,ri){var Er=!0,Xn=An;G==null||G(null);var Kn=ri?null:lae(An,ne);return T!=="combobox"&&Kn&&(Xn="",le==null||le(Kn),gt(!1),Er=!1),Q&&pn!==Xn&&Q(Xn,{source:zn?"typing":"effect"}),Er},qt=function(An){!An||!An.trim()||Q(An,{source:"submit"})};w.exports.useEffect(function(){!bn&&!rt&&T!=="combobox"&&Vt("",!1,!1)},[bn]),w.exports.useEffect(function(){ht&&M&&xn(!1),M&&Rt(!1)},[M]);var vn=XB(),Fn=Le(vn,2),tr=Fn[0],nr=Fn[1],ye=function(An){var zn=tr(),ri=An.which;if(ri===kt.ENTER&&(T!=="combobox"&&An.preventDefault(),bn||gt(!0)),nr(!!pn),ri===kt.BACKSPACE&&!zn&&rt&&!pn&&m.length){for(var Er=Pt(m),Xn=null,Kn=Er.length-1;Kn>=0;Kn-=1){var or=Er[Kn];if(!or.disabled){Er.splice(Kn,1),Xn=or;break}}Xn&&v(Er,{type:"remove",values:[Xn]})}for(var Tr=arguments.length,Mr=new Array(Tr>1?Tr-1:0),Xr=1;Xr1?zn-1:0),Er=1;Er1?Kn-1:0),Tr=1;Tr1&&arguments[1]!==void 0?arguments[1]:!1;return yo(e).map(function(n,r){if(!w.exports.isValidElement(n)||!n.type)return null;var i=n,o=i.type.isSelectOptGroup,s=i.key,a=i.props,u=a.children,d=Rn(a,gae);return t||!o?vae(n):fe(fe({key:"__RC_SELECT_GRP__".concat(s===null?r:s,"__"),label:s},d),{},{options:b9(u)})}).filter(function(n){return n})}function yae(e,t,n,r,i){return w.exports.useMemo(function(){var o=e,s=!e;s&&(o=b9(t));var a=new Map,u=new Map,d=function(v,x,_){_&&typeof _=="string"&&v.set(x[_],x)};function p(m){for(var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,x=0;xu},r}return Lr(n,[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(i){i.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var i=this.state,o=i.dragging,s=i.visible,a=this.props.prefixCls,u=this.getSpinHeight(),d=this.getTop(),p=this.showScroll(),m=p&&s;return I("div",{ref:this.scrollbarRef,className:He("".concat(a,"-scrollbar"),re({},"".concat(a,"-scrollbar-show"),p)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:m?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden,children:I("div",{ref:this.thumbRef,className:He("".concat(a,"-scrollbar-thumb"),re({},"".concat(a,"-scrollbar-thumb-moving"),o)),style:{width:"100%",height:u,top:d,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown})})}}]),n}(w.exports.Component);function _ae(e){var t=e.children,n=e.setRef,r=w.exports.useCallback(function(i){n(i)},[]);return w.exports.cloneElement(t,{ref:r})}function wae(e,t,n,r,i,o){var s=o.getKey;return e.slice(t,n+1).map(function(a,u){var d=t+u,p=i(a,d,{}),m=s(a);return I(_ae,{setRef:function(x){return r(a,x)},children:p},m)})}var Cae=function(){function e(){Nr(this,e),this.maps=void 0,this.maps=Object.create(null)}return Lr(e,[{key:"set",value:function(n,r){this.maps[n]=r}},{key:"get",value:function(n){return this.maps[n]}}]),e}();function Sae(e,t,n){var r=w.exports.useState(0),i=Le(r,2),o=i[0],s=i[1],a=w.exports.useRef(new Map),u=w.exports.useRef(new Cae),d=w.exports.useRef();function p(){ar.cancel(d.current)}function m(){p(),d.current=ar(function(){a.current.forEach(function(x,_){if(x&&x.offsetParent){var P=lv(x),k=P.offsetHeight;u.current.get(_)!==k&&u.current.set(_,P.offsetHeight)}}),s(function(x){return x+1})})}function v(x,_){var P=e(x),k=a.current.get(P);_?(a.current.set(P,_),m()):a.current.delete(P),!k!=!_&&(_?t==null||t(x):n==null||n(x))}return w.exports.useEffect(function(){return p},[]),[v,m,u.current,o]}function Eae(e,t,n,r,i,o,s,a){var u=w.exports.useRef();return function(d){if(d==null){a();return}if(ar.cancel(u.current),typeof d=="number")s(d);else if(d&&nn(d)==="object"){var p,m=d.align;"index"in d?p=d.index:p=t.findIndex(function(P){return i(P)===d.key});var v=d.offset,x=v===void 0?0:v,_=function P(k,T){if(!(k<0||!e.current)){var M=e.current.clientHeight,O=!1,N=T;if(M){for(var L=T||m,F=0,V=0,B=0,H=Math.min(t.length,p),G=0;G<=H;G+=1){var ee=i(t[G]);V=F;var X=n.get(ee);B=V+(X===void 0?r:X),F=B,G===p&&X===void 0&&(O=!0)}var Z=null;switch(L){case"top":Z=V-x;break;case"bottom":Z=B-M+x;break;default:{var Q=e.current.scrollTop,le=Q+M;Vle&&(N="bottom")}}Z!==null&&Z!==e.current.scrollTop&&s(Z)}u.current=ar(function(){O&&o(),P(k-1,N)},2)}};_(3)}}}function Pae(e,t,n){var r=e.length,i=t.length,o,s;if(r===0&&i===0)return null;r"u"?"undefined":nn(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);const w9=function(e,t){var n=w.exports.useRef(!1),r=w.exports.useRef(null);function i(){clearTimeout(r.current),n.current=!0,r.current=setTimeout(function(){n.current=!1},50)}var o=w.exports.useRef({top:e,bottom:t});return o.current.top=e,o.current.bottom=t,function(s){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,u=s<0&&o.current.top||s>0&&o.current.bottom;return a&&u?(clearTimeout(r.current),n.current=!1):(!u||n.current)&&i(),!n.current&&u}};function kae(e,t,n,r){var i=w.exports.useRef(0),o=w.exports.useRef(null),s=w.exports.useRef(null),a=w.exports.useRef(!1),u=w9(t,n);function d(m){if(!!e){ar.cancel(o.current);var v=m.deltaY;i.current+=v,s.current=v,!u(v)&&(Tae||m.preventDefault(),o.current=ar(function(){var x=a.current?10:1;r(i.current*x),i.current=0}))}}function p(m){!e||(a.current=m.detail===s.current)}return[d,p]}var Mae=14/15;function Rae(e,t,n){var r=w.exports.useRef(!1),i=w.exports.useRef(0),o=w.exports.useRef(null),s=w.exports.useRef(null),a,u=function(v){if(r.current){var x=Math.ceil(v.touches[0].pageY),_=i.current-x;i.current=x,n(_)&&v.preventDefault(),clearInterval(s.current),s.current=setInterval(function(){_*=Mae,(!n(_,!0)||Math.abs(_)<=.1)&&clearInterval(s.current)},16)}},d=function(){r.current=!1,a()},p=function(v){a(),v.touches.length===1&&!r.current&&(r.current=!0,i.current=Math.ceil(v.touches[0].pageY),o.current=v.target,o.current.addEventListener("touchmove",u),o.current.addEventListener("touchend",d))};a=function(){o.current&&(o.current.removeEventListener("touchmove",u),o.current.removeEventListener("touchend",d))},wi(function(){return e&&t.current.addEventListener("touchstart",p),function(){var m;(m=t.current)===null||m===void 0||m.removeEventListener("touchstart",p),a(),clearInterval(s.current)}},[e])}var Aae=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange","innerProps"],Dae=[],Oae={overflowY:"auto",overflowAnchor:"none"};function Nae(e,t){var n=e.prefixCls,r=n===void 0?"rc-virtual-list":n,i=e.className,o=e.height,s=e.itemHeight,a=e.fullHeight,u=a===void 0?!0:a,d=e.style,p=e.data,m=e.children,v=e.itemKey,x=e.virtual,_=e.component,P=_===void 0?"div":_,k=e.onScroll,T=e.onVisibleChange,M=e.innerProps,O=Rn(e,Aae),N=!!(x!==!1&&o&&s),L=N&&p&&s*p.length>o,F=w.exports.useState(0),V=Le(F,2),B=V[0],H=V[1],G=w.exports.useState(!1),ee=Le(G,2),X=ee[0],Z=ee[1],Q=He(r,i),le=p||Dae,ne=w.exports.useRef(),se=w.exports.useRef(),oe=w.exports.useRef(),he=w.exports.useCallback(function(zt){return typeof v=="function"?v(zt):zt==null?void 0:zt[v]},[v]),_e={getKey:he};function be(zt){H(function(Rt){var Qt;typeof zt=="function"?Qt=zt(Rt):Qt=zt;var pn=ut(Qt);return ne.current.scrollTop=pn,pn})}var xe=w.exports.useRef({start:0,end:le.length}),Te=w.exports.useRef(),Ee=Iae(le,he),Ce=Le(Ee,1),ke=Ce[0];Te.current=ke;var De=Sae(he,null,null),Ke=Le(De,4),Ue=Ke[0],tt=Ke[1],lt=Ke[2],St=Ke[3],We=w.exports.useMemo(function(){if(!N)return{scrollHeight:void 0,start:0,end:le.length-1,offset:void 0};if(!L){var zt;return{scrollHeight:((zt=se.current)===null||zt===void 0?void 0:zt.offsetHeight)||0,start:0,end:le.length-1,offset:void 0}}for(var Rt=0,Qt,pn,ot,Lt=le.length,Tt=0;Tt=B&&Qt===void 0&&(Qt=Tt,pn=Rt),xn>B+o&&ot===void 0&&(ot=Tt),Rt=xn}return Qt===void 0&&(Qt=0,pn=0,ot=Math.ceil(o/s)),ot===void 0&&(ot=le.length-1),ot=Math.min(ot+1,le.length),{scrollHeight:Rt,start:Qt,end:ot,offset:pn}},[L,N,B,le,St,o]),bt=We.scrollHeight,Qe=We.start,mt=We.end,ct=We.offset;xe.current.start=Qe,xe.current.end=mt;var wt=bt-o,rt=w.exports.useRef(wt);rt.current=wt;function ut(zt){var Rt=zt;return Number.isNaN(rt.current)||(Rt=Math.min(Rt,rt.current)),Rt=Math.max(Rt,0),Rt}var nt=B<=0,qe=B>=wt,dt=w9(nt,qe);function _t(zt){var Rt=zt;be(Rt)}function Dt(zt){var Rt=zt.currentTarget.scrollTop;Rt!==B&&be(Rt),k==null||k(zt)}var Nt=kae(N,nt,qe,function(zt){be(function(Rt){var Qt=Rt+zt;return Qt})}),jt=Le(Nt,2),Ve=jt[0],Ze=jt[1];Rae(N,ne,function(zt,Rt){return dt(zt,Rt)?!1:(Ve({preventDefault:function(){},deltaY:zt}),!0)}),wi(function(){function zt(Rt){N&&Rt.preventDefault()}return ne.current.addEventListener("wheel",Ve),ne.current.addEventListener("DOMMouseScroll",Ze),ne.current.addEventListener("MozMousePixelScroll",zt),function(){ne.current&&(ne.current.removeEventListener("wheel",Ve),ne.current.removeEventListener("DOMMouseScroll",Ze),ne.current.removeEventListener("MozMousePixelScroll",zt))}},[N]);var Yt=Eae(ne,le,lt,s,he,tt,be,function(){var zt;(zt=oe.current)===null||zt===void 0||zt.delayHidden()});w.exports.useImperativeHandle(t,function(){return{scrollTo:Yt}}),wi(function(){if(T){var zt=le.slice(Qe,mt+1);T(zt,le)}},[Qe,mt,le]);var sn=wae(le,Qe,mt,Ue,m,_e),Gt=null;return o&&(Gt=fe(re({},u?"height":"maxHeight",o),Oae),N&&(Gt.overflowY="hidden",X&&(Gt.pointerEvents="none"))),$e("div",{style:fe(fe({},d),{},{position:"relative"}),className:Q,...O,children:[I(P,{className:"".concat(r,"-holder"),style:Gt,ref:ne,onScroll:Dt,children:I(_9,{prefixCls:r,height:bt,offset:ct,onInnerResize:tt,ref:se,innerProps:M,children:sn})}),N&&I(bae,{ref:oe,prefixCls:r,scrollTop:B,height:o,scrollHeight:bt,count:le.length,onScroll:_t,onStartMove:function(){Z(!0)},onStopMove:function(){Z(!1)}})]})}var $I=w.exports.forwardRef(Nae);$I.displayName="List";function Lae(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var C9=w.exports.createContext(null),Fae=["disabled","title","children","style","className"];function aO(e){return typeof e=="string"||typeof e=="number"}var zae=function(t,n){var r=ZB(),i=r.prefixCls,o=r.id,s=r.open,a=r.multiple,u=r.mode,d=r.searchValue,p=r.toggleOpen,m=r.notFoundContent,v=r.onPopupScroll,x=w.exports.useContext(C9),_=x.flattenOptions,P=x.onActiveValue,k=x.defaultActiveFirstOption,T=x.onSelect,M=x.menuItemSelectedIcon,O=x.rawValues,N=x.fieldNames,L=x.virtual,F=x.listHeight,V=x.listItemHeight,B="".concat(i,"-item"),H=Vv(function(){return _},[s,_],function(Ee,Ce){return Ce[0]&&Ee[1]!==Ce[1]}),G=w.exports.useRef(null),ee=function(Ce){Ce.preventDefault()},X=function(Ce){G.current&&G.current.scrollTo(typeof Ce=="number"?{index:Ce}:Ce)},Z=function(Ce){for(var ke=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,De=H.length,Ke=0;Ke1&&arguments[1]!==void 0?arguments[1]:!1;se(Ce);var De={source:ke?"keyboard":"mouse"},Ke=H[Ce];if(!Ke){P(null,-1,De);return}P(Ke.value,Ce,De)};w.exports.useEffect(function(){oe(k!==!1?Z(0):-1)},[H.length,d]);var he=w.exports.useCallback(function(Ee){return O.has(Ee)&&u!=="combobox"},[u,Pt(O).toString(),O.size]);w.exports.useEffect(function(){var Ee=setTimeout(function(){if(!a&&s&&O.size===1){var ke=Array.from(O)[0],De=H.findIndex(function(Ke){var Ue=Ke.data;return Ue.value===ke});De!==-1&&(oe(De),X(De))}});if(s){var Ce;(Ce=G.current)===null||Ce===void 0||Ce.scrollTo(void 0)}return function(){return clearTimeout(Ee)}},[s,d]);var _e=function(Ce){Ce!==void 0&&T(Ce,{selected:!O.has(Ce)}),a||p(!1)};if(w.exports.useImperativeHandle(n,function(){return{onKeyDown:function(Ce){var ke=Ce.which,De=Ce.ctrlKey;switch(ke){case kt.N:case kt.P:case kt.UP:case kt.DOWN:{var Ke=0;if(ke===kt.UP?Ke=-1:ke===kt.DOWN?Ke=1:Lae()&&De&&(ke===kt.N?Ke=1:ke===kt.P&&(Ke=-1)),Ke!==0){var Ue=Z(ne+Ke,Ke);X(Ue),oe(Ue,!0)}break}case kt.ENTER:{var tt=H[ne];tt&&!tt.data.disabled?_e(tt.value):_e(void 0),s&&Ce.preventDefault();break}case kt.ESC:p(!1),s&&Ce.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Ce){X(Ce)}}}),H.length===0)return I("div",{role:"listbox",id:"".concat(o,"_list"),className:"".concat(B,"-empty"),onMouseDown:ee,children:m});var be=Object.keys(N).map(function(Ee){return N[Ee]}),xe=function(Ce){return Ce.label},Te=function(Ce){var ke=H[Ce];if(!ke)return null;var De=ke.data||{},Ke=De.value,Ue=ke.group,tt=gu(De,!0),lt=xe(ke);return ke?w.exports.createElement("div",{"aria-label":typeof lt=="string"&&!Ue?lt:null,...tt,key:Ce,role:Ue?"presentation":"option",id:"".concat(o,"_list_").concat(Ce),"aria-selected":he(Ke)},Ke):null};return $e(Tn,{children:[$e("div",{role:"listbox",id:"".concat(o,"_list"),style:{height:0,width:0,overflow:"hidden"},children:[Te(ne-1),Te(ne),Te(ne+1)]}),I($I,{itemKey:"key",ref:G,data:H,height:F,itemHeight:V,fullHeight:!1,onMouseDown:ee,onScroll:v,virtual:L,children:function(Ee,Ce){var ke,De=Ee.group,Ke=Ee.groupOption,Ue=Ee.data,tt=Ee.label,lt=Ee.value,St=Ue.key;if(De){var We,bt=(We=Ue.title)!==null&&We!==void 0?We:aO(tt)?tt.toString():void 0;return I("div",{className:He(B,"".concat(B,"-group")),title:bt,children:tt!==void 0?tt:St})}var Qe=Ue.disabled,mt=Ue.title;Ue.children;var ct=Ue.style,wt=Ue.className,rt=Rn(Ue,Fae),ut=Ci(rt,be),nt=he(lt),qe="".concat(B,"-option"),dt=He(B,qe,wt,(ke={},re(ke,"".concat(qe,"-grouped"),Ke),re(ke,"".concat(qe,"-active"),ne===Ce&&!Qe),re(ke,"".concat(qe,"-disabled"),Qe),re(ke,"".concat(qe,"-selected"),nt),ke)),_t=xe(Ee),Dt=!M||typeof M=="function"||nt,Nt=typeof _t=="number"?_t:_t||lt,jt=aO(Nt)?Nt.toString():void 0;return mt!==void 0&&(jt=mt),$e("div",{...gu(ut),"aria-selected":nt,className:dt,title:jt,onMouseMove:function(){ne===Ce||Qe||oe(Ce)},onClick:function(){Qe||_e(lt)},style:ct,children:[I("div",{className:"".concat(qe,"-content"),children:Nt}),w.exports.isValidElement(M)||nt,Dt&&I(cb,{className:"".concat(B,"-option-state"),customizeIcon:M,customizeIconProps:{isSelected:nt},children:nt?"\u2713":null})]})}})]})},S9=w.exports.forwardRef(zae);S9.displayName="OptionList";var $ae=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],Bae=["inputValue"];function Vae(e){return!e||nn(e)!=="object"}var Uae=w.exports.forwardRef(function(e,t){var n=e.id,r=e.mode,i=e.prefixCls,o=i===void 0?"rc-select":i,s=e.backfill,a=e.fieldNames,u=e.inputValue,d=e.searchValue,p=e.onSearch,m=e.autoClearSearchValue,v=m===void 0?!0:m,x=e.onSelect,_=e.onDeselect,P=e.dropdownMatchSelectWidth,k=P===void 0?!0:P,T=e.filterOption,M=e.filterSort,O=e.optionFilterProp,N=e.optionLabelProp,L=e.options,F=e.children,V=e.defaultActiveFirstOption,B=e.menuItemSelectedIcon,H=e.virtual,G=e.listHeight,ee=G===void 0?200:G,X=e.listItemHeight,Z=X===void 0?20:X,Q=e.value,le=e.defaultValue,ne=e.labelInValue,se=e.onChange,oe=Rn(e,$ae),he=x9(n),_e=A3(r),be=!!(!L&&F),xe=w.exports.useMemo(function(){return T===void 0&&r==="combobox"?!1:T},[T,r]),Te=w.exports.useMemo(function(){return v9(a,be)},[JSON.stringify(a),be]),Ee=ki("",{value:d!==void 0?d:u,postState:function(xt){return xt||""}}),Ce=Le(Ee,2),ke=Ce[0],De=Ce[1],Ke=yae(L,F,Te,O,N),Ue=Ke.valueOptions,tt=Ke.labelOptions,lt=Ke.options,St=w.exports.useCallback(function(gt){var xt=e9(gt);return xt.map(function(Vt){var qt,vn,Fn,tr,nr;if(Vae(Vt))qt=Vt;else{var ye;Fn=Vt.key,vn=Vt.label,qt=(ye=Vt.value)!==null&&ye!==void 0?ye:Fn}var q=Ue.get(qt);if(q){var J;vn===void 0&&(vn=q==null?void 0:q[N||Te.label]),Fn===void 0&&(Fn=(J=q==null?void 0:q.key)!==null&&J!==void 0?J:qt),tr=q==null?void 0:q.disabled,nr=q==null?void 0:q.title}return{label:vn,value:qt,key:Fn,disabled:tr,title:nr}})},[Te,N,Ue]),We=ki(le,{value:Q}),bt=Le(We,2),Qe=bt[0],mt=bt[1],ct=w.exports.useMemo(function(){var gt,xt=St(Qe);return r==="combobox"&&!((gt=xt[0])!==null&>!==void 0&>.value)?[]:xt},[Qe,St,r]),wt=dae(ct,Ue),rt=Le(wt,2),ut=rt[0],nt=rt[1],qe=w.exports.useMemo(function(){if(!r&&ut.length===1){var gt=ut[0];if(gt.value===null&&(gt.label===null||gt.label===void 0))return[]}return ut.map(function(xt){var Vt;return fe(fe({},xt),{},{label:(Vt=xt.label)!==null&&Vt!==void 0?Vt:xt.value})})},[r,ut]),dt=w.exports.useMemo(function(){return new Set(ut.map(function(gt){return gt.value}))},[ut]);w.exports.useEffect(function(){if(r==="combobox"){var gt,xt=(gt=ut[0])===null||gt===void 0?void 0:gt.value;De(loe(xt)?String(xt):"")}},[ut]);var _t=iO(function(gt,xt){var Vt,qt=xt!=null?xt:gt;return Vt={},re(Vt,Te.value,gt),re(Vt,Te.label,qt),Vt}),Dt=w.exports.useMemo(function(){if(r!=="tags")return lt;var gt=Pt(lt),xt=function(qt){return Ue.has(qt)};return Pt(ut).sort(function(Vt,qt){return Vt.value2&&arguments[2]!==void 0?arguments[2]:{},qt=Vt.source,vn=qt===void 0?"keyboard":qt;Lt(xt),s&&r==="combobox"&>!==null&&vn==="keyboard"&&Rt(String(gt))},[s,r]),Zt=function(xt,Vt,qt){var vn=function(){var Ae,Pe=nt(xt);return[ne?{label:Pe==null?void 0:Pe[Te.label],value:xt,key:(Ae=Pe==null?void 0:Pe.key)!==null&&Ae!==void 0?Ae:xt}:xt,R3(Pe)]};if(Vt&&x){var Fn=vn(),tr=Le(Fn,2),nr=tr[0],ye=tr[1];x(nr,ye)}else if(!Vt&&_&&qt!=="clear"){var q=vn(),J=Le(q,2),pe=J[0],ce=J[1];_(pe,ce)}},ht=iO(function(gt,xt){var Vt,qt=_e?xt.selected:!0;qt?Vt=_e?[].concat(Pt(ut),[gt]):[gt]:Vt=ut.filter(function(vn){return vn.value!==gt}),Yt(Vt),Zt(gt,qt),r==="combobox"?Rt(""):(!A3||v)&&(De(""),Rt(""))}),xn=function(xt,Vt){Yt(xt);var qt=Vt.type,vn=Vt.values;(qt==="remove"||qt==="clear")&&vn.forEach(function(Fn){Zt(Fn.value,!1,qt)})},bn=function(xt,Vt){if(De(xt),Rt(null),Vt.source==="submit"){var qt=(xt||"").trim();if(qt){var vn=Array.from(new Set([].concat(Pt(dt),[qt])));Yt(vn),Zt(qt,!0),De("")}return}Vt.source!=="blur"&&(r==="combobox"&&Yt(xt),p==null||p(xt))},tn=function(xt){var Vt=xt;r!=="tags"&&(Vt=xt.map(function(vn){var Fn=tt.get(vn);return Fn==null?void 0:Fn.value}).filter(function(vn){return vn!==void 0}));var qt=Array.from(new Set([].concat(Pt(dt),Pt(Vt))));Yt(qt),qt.forEach(function(vn){Zt(vn,!0)})},Bt=w.exports.useMemo(function(){var gt=H!==!1&&k!==!1;return fe(fe({},Ke),{},{flattenOptions:Ze,onActiveValue:Kt,defaultActiveFirstOption:Tt,onSelect:ht,menuItemSelectedIcon:B,rawValues:dt,fieldNames:Te,virtual:gt,listHeight:ee,listItemHeight:Z,childrenAsData:be})},[Ke,Ze,Kt,Tt,ht,B,dt,Te,H,k,ee,Z,be]);return I(C9.Provider,{value:Bt,children:I(y9,{...oe,id:he,prefixCls:o,ref:t,omitDomProps:Bae,mode:r,displayValues:qe,onDisplayValuesChange:xn,searchValue:ke,onSearch:bn,autoClearSearchValue:v,onSearchSplit:tn,dropdownMatchSelectWidth:k,OptionList:S9,emptyOptions:!Ze.length,activeValue:zt,activeDescendantId:"".concat(he,"_list_").concat(ot)})})}),BI=Uae;BI.Option=zI;BI.OptGroup=FI;var jae=function(){var t=w.exports.useContext(On),n=t.getPrefixCls,r=n("empty-img-default");return I("svg",{className:r,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg",children:$e("g",{fill:"none",fillRule:"evenodd",children:[$e("g",{transform:"translate(24 31.67)",children:[I("ellipse",{className:"".concat(r,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),I("path",{className:"".concat(r,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),I("path",{className:"".concat(r,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),I("path",{className:"".concat(r,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),I("path",{className:"".concat(r,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})]}),I("path",{className:"".concat(r,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),$e("g",{className:"".concat(r,"-g"),transform:"translate(149.65 15.383)",children:[I("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),I("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"})]})]})})};const Hae=jae;var Kae=function(){var t=w.exports.useContext(On),n=t.getPrefixCls,r=n("empty-img-simple");return I("svg",{className:r,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg",children:$e("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd",children:[I("ellipse",{className:"".concat(r,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),$e("g",{className:"".concat(r,"-g"),fillRule:"nonzero",children:[I("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),I("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(r,"-path")})]})]})})};const Wae=Kae;var Gae=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=1},subscribe:function(t){return pd.size||this.register(),DC+=1,pd.set(DC,t),t(nx),DC},unsubscribe:function(t){pd.delete(t),pd.size||this.unregister()},unregister:function(){var t=this;Object.keys(tx).forEach(function(n){var r=tx[n],i=t.matchHandlers[r];i==null||i.mql.removeListener(i==null?void 0:i.listener)}),pd.clear()},register:function(){var t=this;Object.keys(tx).forEach(function(n){var r=tx[n],i=function(a){var u=a.matches;t.dispatch(ze(ze({},nx),re({},n,u)))},o=window.matchMedia(r);o.addListener(i),t.matchHandlers[r]={mql:o,listener:i},i(o)})}};const hb=cse;function F9(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=w.exports.useRef({}),n=GI();return w.exports.useEffect(function(){var r=hb.subscribe(function(i){t.current=i,e&&n()});return function(){return hb.unsubscribe(r)}},[]),t.current}var Xa={adjustX:1,adjustY:1},Ya=[0,0],z9={left:{points:["cr","cl"],overflow:Xa,offset:[-4,0],targetOffset:Ya},right:{points:["cl","cr"],overflow:Xa,offset:[4,0],targetOffset:Ya},top:{points:["bc","tc"],overflow:Xa,offset:[0,-4],targetOffset:Ya},bottom:{points:["tc","bc"],overflow:Xa,offset:[0,4],targetOffset:Ya},topLeft:{points:["bl","tl"],overflow:Xa,offset:[0,-4],targetOffset:Ya},leftTop:{points:["tr","tl"],overflow:Xa,offset:[-4,0],targetOffset:Ya},topRight:{points:["br","tr"],overflow:Xa,offset:[0,-4],targetOffset:Ya},rightTop:{points:["tl","tr"],overflow:Xa,offset:[4,0],targetOffset:Ya},bottomRight:{points:["tr","br"],overflow:Xa,offset:[0,4],targetOffset:Ya},rightBottom:{points:["bl","br"],overflow:Xa,offset:[4,0],targetOffset:Ya},bottomLeft:{points:["tl","bl"],overflow:Xa,offset:[0,4],targetOffset:Ya},leftBottom:{points:["br","bl"],overflow:Xa,offset:[-4,0],targetOffset:Ya}};function dse(e){var t=e.showArrow,n=e.arrowContent,r=e.children,i=e.prefixCls,o=e.id,s=e.overlayInnerStyle,a=e.className,u=e.style;return $e("div",{className:He("".concat(i,"-content"),a),style:u,children:[t!==!1&&I("div",{className:"".concat(i,"-arrow"),children:n},"arrow"),I("div",{className:"".concat(i,"-inner"),id:o,role:"tooltip",style:s,children:typeof r=="function"?r():r})]})}var fse=function(t,n){var r=t.overlayClassName,i=t.trigger,o=i===void 0?["hover"]:i,s=t.mouseEnterDelay,a=s===void 0?0:s,u=t.mouseLeaveDelay,d=u===void 0?.1:u,p=t.overlayStyle,m=t.prefixCls,v=m===void 0?"rc-tooltip":m,x=t.children,_=t.onVisibleChange,P=t.afterVisibleChange,k=t.transitionName,T=t.animation,M=t.motion,O=t.placement,N=O===void 0?"right":O,L=t.align,F=L===void 0?{}:L,V=t.destroyTooltipOnHide,B=V===void 0?!1:V,H=t.defaultVisible,G=t.getTooltipContainer,ee=t.overlayInnerStyle,X=t.arrowContent,Z=t.overlay,Q=t.id,le=t.showArrow,ne=Rn(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),se=w.exports.useRef(null);w.exports.useImperativeHandle(n,function(){return se.current});var oe=fe({},ne);"visible"in t&&(oe.popupVisible=t.visible);var he=function(){return I(dse,{showArrow:le,arrowContent:X,prefixCls:v,id:Q,overlayInnerStyle:ee,children:Z},"content")},_e=!1,be=!1;if(typeof B=="boolean")_e=B;else if(B&&nn(B)==="object"){var xe=B.keepParent;_e=xe===!0,be=xe===!1}return I(z_,{popupClassName:r,prefixCls:v,popup:he,action:o,builtinPlacements:z9,popupPlacement:N,ref:se,popupAlign:F,getPopupContainer:G,onPopupVisibleChange:_,afterPopupVisibleChange:P,popupTransitionName:k,popupAnimation:T,popupMotion:M,defaultPopupVisible:H,destroyPopupOnHide:_e,autoDestroy:be,mouseLeaveDelay:d,popupStyle:p,mouseEnterDelay:a,...oe,children:x})};const hse=w.exports.forwardRef(fse);Yo("success","processing","error","default","warning");var pse=Yo("pink","red","yellow","orange","cyan","green","blue","purple","geekblue","magenta","volcano","gold","lime"),mse={adjustX:1,adjustY:1},uO={adjustX:0,adjustY:0},gse=[0,0];function cO(e){return typeof e=="boolean"?e?mse:uO:ze(ze({},uO),e)}function $9(e){var t=e.arrowWidth,n=t===void 0?4:t,r=e.horizontalArrowShift,i=r===void 0?16:r,o=e.verticalArrowShift,s=o===void 0?8:o,a=e.autoAdjustOverflow,u=e.arrowPointAtCenter,d={left:{points:["cr","cl"],offset:[-4,0]},right:{points:["cl","cr"],offset:[4,0]},top:{points:["bc","tc"],offset:[0,-4]},bottom:{points:["tc","bc"],offset:[0,4]},topLeft:{points:["bl","tc"],offset:[-(i+n),-4]},leftTop:{points:["tr","cl"],offset:[-4,-(s+n)]},topRight:{points:["br","tc"],offset:[i+n,-4]},rightTop:{points:["tl","cr"],offset:[4,-(s+n)]},bottomRight:{points:["tr","bc"],offset:[i+n,4]},rightBottom:{points:["bl","cr"],offset:[4,s+n]},bottomLeft:{points:["tl","bc"],offset:[-(i+n),4]},leftBottom:{points:["br","cl"],offset:[-4,s+n]}};return Object.keys(d).forEach(function(p){d[p]=u?ze(ze({},d[p]),{overflow:cO(a),targetOffset:gse}):ze(ze({},z9[p]),{overflow:cO(a)}),d[p].ignoreShake=!0}),d}var vse=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1;if(LI(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||n==="a"&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),o=Number(i),s=null;return i&&!Number.isNaN(o)?s=o:r&&s===null&&(s=0),r&&e.disabled&&(s=null),s!==null&&(s>=0||t&&s<0)}return!1}function G9(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=Pt(e.querySelectorAll("*")).filter(function(r){return hO(r,t)});return hO(e,t)&&n.unshift(e),n}var O3=kt.LEFT,N3=kt.RIGHT,L3=kt.UP,t1=kt.DOWN,n1=kt.ENTER,q9=kt.ESC,$m=kt.HOME,Bm=kt.END,pO=[L3,t1,O3,N3];function kse(e,t,n,r){var i,o,s,a,u="prev",d="next",p="children",m="parent";if(e==="inline"&&r===n1)return{inlineTrigger:!0};var v=(i={},re(i,L3,u),re(i,t1,d),i),x=(o={},re(o,O3,n?d:u),re(o,N3,n?u:d),re(o,t1,p),re(o,n1,p),o),_=(s={},re(s,L3,u),re(s,t1,d),re(s,n1,p),re(s,q9,m),re(s,O3,n?p:m),re(s,N3,n?m:p),s),P={inline:v,horizontal:x,vertical:_,inlineSub:v,horizontalSub:_,verticalSub:_},k=(a=P["".concat(e).concat(t?"":"Sub")])===null||a===void 0?void 0:a[r];switch(k){case u:return{offset:-1,sibling:!0};case d:return{offset:1,sibling:!0};case m:return{offset:-1,sibling:!1};case p:return{offset:1,sibling:!1};default:return null}}function Mse(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}function Rse(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}function Z9(e,t){var n=G9(e,!0);return n.filter(function(r){return t.has(r)})}function mO(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;if(!e)return null;var i=Z9(e,t),o=i.length,s=i.findIndex(function(a){return n===a});return r<0?s===-1?s=o-1:s-=1:r>0&&(s+=1),s=(s+o)%o,i[s]}function Ase(e,t,n,r,i,o,s,a,u,d){var p=w.exports.useRef(),m=w.exports.useRef();m.current=t;var v=function(){ar.cancel(p.current)};return w.exports.useEffect(function(){return function(){v()}},[]),function(x){var _=x.which;if([].concat(pO,[n1,q9,$m,Bm]).includes(_)){var P,k,T,M=function(){P=new Set,k=new Map,T=new Map;var le=o();return le.forEach(function(ne){var se=document.querySelector("[data-menu-id='".concat(qI(r,ne),"']"));se&&(P.add(se),T.set(se,ne),k.set(ne,se))}),P};M();var O=k.get(t),N=Rse(O,P),L=T.get(N),F=kse(e,s(L,!0).length===1,n,_);if(!F&&_!==$m&&_!==Bm)return;(pO.includes(_)||[$m,Bm].includes(_))&&x.preventDefault();var V=function(le){if(le){var ne=le,se=le.querySelector("a");se!=null&&se.getAttribute("href")&&(ne=se);var oe=T.get(le);a(oe),v(),p.current=ar(function(){m.current===oe&&ne.focus()})}};if([$m,Bm].includes(_)||F.sibling||!N){var B;!N||e==="inline"?B=i.current:B=Mse(N);var H,G=Z9(B,P);_===$m?H=G[0]:_===Bm?H=G[G.length-1]:H=mO(B,P,N,F.offset),V(H)}else if(F.inlineTrigger)u(L);else if(F.offset>0)u(L,!0),v(),p.current=ar(function(){M();var Q=N.getAttribute("aria-controls"),le=document.getElementById(Q),ne=mO(le,P);V(ne)},5);else if(F.offset<0){var ee=s(L,!0),X=ee[ee.length-2],Z=k.get(X);u(X,!1),V(Z)}}d==null||d(x)}}function Dse(e){Promise.resolve().then(e)}var XI="__RC_UTIL_PATH_SPLIT__",gO=function(t){return t.join(XI)},Ose=function(t){return t.split(XI)},F3="rc-menu-more";function Nse(){var e=w.exports.useState({}),t=Le(e,2),n=t[1],r=w.exports.useRef(new Map),i=w.exports.useRef(new Map),o=w.exports.useState([]),s=Le(o,2),a=s[0],u=s[1],d=w.exports.useRef(0),p=w.exports.useRef(!1),m=function(){p.current||n({})},v=w.exports.useCallback(function(O,N){var L=gO(N);i.current.set(L,O),r.current.set(O,L),d.current+=1;var F=d.current;Dse(function(){F===d.current&&m()})},[]),x=w.exports.useCallback(function(O,N){var L=gO(N);i.current.delete(L),r.current.delete(O)},[]),_=w.exports.useCallback(function(O){u(O)},[]),P=w.exports.useCallback(function(O,N){var L=r.current.get(O)||"",F=Ose(L);return N&&a.includes(F[0])&&F.unshift(F3),F},[a]),k=w.exports.useCallback(function(O,N){return O.some(function(L){var F=P(L,!0);return F.includes(N)})},[P]),T=function(){var N=Pt(r.current.keys());return a.length&&N.push(F3),N},M=w.exports.useCallback(function(O){var N="".concat(r.current.get(O)).concat(XI),L=new Set;return Pt(i.current.keys()).forEach(function(F){F.startsWith(N)&&L.add(i.current.get(F))}),L},[]);return w.exports.useEffect(function(){return function(){p.current=!0}},[]),{registerPath:v,unregisterPath:x,refreshOverflowKeys:_,isSubPathKey:k,getKeyPath:P,getKeys:T,getSubPathKeys:M}}function uh(e){var t=w.exports.useRef(e);t.current=e;var n=w.exports.useCallback(function(){for(var r,i=arguments.length,o=new Array(i),s=0;s1&&(M.motionAppear=!1);var O=M.onVisibleChanged;return M.onVisibleChanged=function(N){return!v.current&&!N&&k(!0),O==null?void 0:O(N)},P?null:I(gv,{mode:o,locked:!v.current,children:I(Xo,{visible:T,...M,forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(a,"-hidden"),children:function(N){var L=N.className,F=N.style;return I(YI,{id:t,className:L,style:F,children:i})}})})}var Jse=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],ele=["active"],tle=function(t){var n,r=t.style,i=t.className,o=t.title,s=t.eventKey;t.warnKey;var a=t.disabled,u=t.internalPopupClose,d=t.children,p=t.itemIcon,m=t.expandIcon,v=t.popupClassName,x=t.popupOffset,_=t.onClick,P=t.onMouseEnter,k=t.onMouseLeave,T=t.onTitleClick,M=t.onTitleMouseEnter,O=t.onTitleMouseLeave,N=Rn(t,Jse),L=j9(s),F=w.exports.useContext(js),V=F.prefixCls,B=F.mode,H=F.openKeys,G=F.disabled,ee=F.overflowDisabled,X=F.activeKey,Z=F.selectedKeys,Q=F.itemIcon,le=F.expandIcon,ne=F.onItemClick,se=F.onOpenChange,oe=F.onActive,he=w.exports.useContext(ZI),_e=he._internalRenderSubMenuItem,be=w.exports.useContext(W9),xe=be.isSubPathKey,Te=Sp(),Ee="".concat(V,"-submenu"),Ce=G||a,ke=w.exports.useRef(),De=w.exports.useRef(),Ke=p||Q,Ue=m||le,tt=H.includes(s),lt=!ee&&tt,St=xe(Z,s),We=X9(s,Ce,M,O),bt=We.active,Qe=Rn(We,ele),mt=w.exports.useState(!1),ct=Le(mt,2),wt=ct[0],rt=ct[1],ut=function(Qt){Ce||rt(Qt)},nt=function(Qt){ut(!0),P==null||P({key:s,domEvent:Qt})},qe=function(Qt){ut(!1),k==null||k({key:s,domEvent:Qt})},dt=w.exports.useMemo(function(){return bt||(B!=="inline"?wt||xe([X],s):!1)},[B,bt,X,wt,s,xe]),_t=Q9(Te.length),Dt=function(Qt){Ce||(T==null||T({key:s,domEvent:Qt}),B==="inline"&&se(s,!tt))},Nt=uh(function(Rt){_==null||_(pb(Rt)),ne(Rt)}),jt=function(Qt){B!=="inline"&&se(s,Qt)},Ve=function(){oe(s)},Ze=L&&"".concat(L,"-popup"),Yt=$e("div",{role:"menuitem",style:_t,className:"".concat(Ee,"-title"),tabIndex:Ce?null:-1,ref:ke,title:typeof o=="string"?o:null,"data-menu-id":ee&&L?null:L,"aria-expanded":lt,"aria-haspopup":!0,"aria-controls":Ze,"aria-disabled":Ce,onClick:Dt,onFocus:Ve,...Qe,children:[o,I(Y9,{icon:B!=="horizontal"?Ue:null,props:fe(fe({},t),{},{isOpen:lt,isSubMenu:!0}),children:I("i",{className:"".concat(Ee,"-arrow")})})]}),sn=w.exports.useRef(B);if(B!=="inline"&&Te.length>1?sn.current="vertical":sn.current=B,!ee){var Gt=sn.current;Yt=I(Yse,{mode:Gt,prefixCls:Ee,visible:!u&<&&B!=="inline",popupClassName:v,popupOffset:x,popup:I(gv,{mode:Gt==="horizontal"?"vertical":Gt,children:I(YI,{id:Ze,ref:De,children:d})}),disabled:Ce,onVisibleChange:jt,children:Yt})}var zt=$e(yl.Item,{role:"none",...N,component:"li",style:r,className:He(Ee,"".concat(Ee,"-").concat(B),i,(n={},re(n,"".concat(Ee,"-open"),lt),re(n,"".concat(Ee,"-active"),dt),re(n,"".concat(Ee,"-selected"),St),re(n,"".concat(Ee,"-disabled"),Ce),n)),onMouseEnter:nt,onMouseLeave:qe,children:[Yt,!ee&&I(Qse,{id:Ze,open:lt,keyPath:Te,children:d})]});return _e&&(zt=_e(zt,t,{selected:St,active:dt,open:lt,disabled:Ce})),I(gv,{onItemClick:Nt,mode:B==="horizontal"?"vertical":B,itemIcon:Ke,expandIcon:Ue,children:zt})};function j_(e){var t=e.eventKey,n=e.children,r=Sp(t),i=QI(n,r),o=V_();w.exports.useEffect(function(){if(o)return o.registerPath(t,r),function(){o.unregisterPath(t,r)}},[r]);var s;return o?s=i:s=I(tle,{...e,children:i}),I(K9.Provider,{value:r,children:s})}var nle=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],rh=[],rle=w.exports.forwardRef(function(e,t){var n,r,i=e,o=i.prefixCls,s=o===void 0?"rc-menu":o,a=i.rootClassName,u=i.style,d=i.className,p=i.tabIndex,m=p===void 0?0:p,v=i.items,x=i.children,_=i.direction,P=i.id,k=i.mode,T=k===void 0?"vertical":k,M=i.inlineCollapsed,O=i.disabled,N=i.disabledOverflow,L=i.subMenuOpenDelay,F=L===void 0?.1:L,V=i.subMenuCloseDelay,B=V===void 0?.1:V,H=i.forceSubMenuRender,G=i.defaultOpenKeys,ee=i.openKeys,X=i.activeKey,Z=i.defaultActiveFirst,Q=i.selectable,le=Q===void 0?!0:Q,ne=i.multiple,se=ne===void 0?!1:ne,oe=i.defaultSelectedKeys,he=i.selectedKeys,_e=i.onSelect,be=i.onDeselect,xe=i.inlineIndent,Te=xe===void 0?24:xe,Ee=i.motion,Ce=i.defaultMotions,ke=i.triggerSubMenuAction,De=ke===void 0?"hover":ke,Ke=i.builtinPlacements,Ue=i.itemIcon,tt=i.expandIcon,lt=i.overflowedIndicator,St=lt===void 0?"...":lt,We=i.overflowedIndicatorPopupClassName,bt=i.getPopupContainer,Qe=i.onClick,mt=i.onOpenChange,ct=i.onKeyDown;i.openAnimation,i.openTransitionName;var wt=i._internalRenderMenuItem,rt=i._internalRenderSubMenuItem,ut=Rn(i,nle),nt=w.exports.useMemo(function(){return Gse(x,v,rh)},[x,v]),qe=w.exports.useState(!1),dt=Le(qe,2),_t=dt[0],Dt=dt[1],Nt=w.exports.useRef(),jt=Fse(P),Ve=_==="rtl",Ze=ki(G,{value:ee,postState:function(Kn){return Kn||rh}}),Yt=Le(Ze,2),sn=Yt[0],Gt=Yt[1],zt=function(Kn){var or=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;function Tr(){Gt(Kn),mt==null||mt(Kn)}or?Cl.exports.flushSync(Tr):Tr()},Rt=w.exports.useState(sn),Qt=Le(Rt,2),pn=Qt[0],ot=Qt[1],Lt=w.exports.useRef(!1),Tt=w.exports.useMemo(function(){return(T==="inline"||T==="vertical")&&M?["vertical",M]:[T,!1]},[T,M]),Kt=Le(Tt,2),Zt=Kt[0],ht=Kt[1],xn=Zt==="inline",bn=w.exports.useState(Zt),tn=Le(bn,2),Bt=tn[0],gt=tn[1],xt=w.exports.useState(ht),Vt=Le(xt,2),qt=Vt[0],vn=Vt[1];w.exports.useEffect(function(){gt(Zt),vn(ht),Lt.current&&(xn?Gt(pn):zt(rh))},[Zt,ht]);var Fn=w.exports.useState(0),tr=Le(Fn,2),nr=tr[0],ye=tr[1],q=nr>=nt.length-1||Bt!=="horizontal"||N;w.exports.useEffect(function(){xn&&ot(sn)},[sn]),w.exports.useEffect(function(){return Lt.current=!0,function(){Lt.current=!1}},[]);var J=Nse(),pe=J.registerPath,ce=J.unregisterPath,we=J.refreshOverflowKeys,Ae=J.isSubPathKey,Pe=J.getKeyPath,Me=J.getKeys,Be=J.getSubPathKeys,Je=w.exports.useMemo(function(){return{registerPath:pe,unregisterPath:ce}},[pe,ce]),et=w.exports.useMemo(function(){return{isSubPathKey:Ae}},[Ae]);w.exports.useEffect(function(){we(q?rh:nt.slice(nr+1).map(function(Xn){return Xn.key}))},[nr,q]);var Ge=ki(X||Z&&((n=nt[0])===null||n===void 0?void 0:n.key),{value:X}),Ut=Le(Ge,2),Mt=Ut[0],at=Ut[1],$t=uh(function(Xn){at(Xn)}),Xt=uh(function(){at(void 0)});w.exports.useImperativeHandle(t,function(){return{list:Nt.current,focus:function(Kn){var or,Tr=Mt!=null?Mt:(or=nt.find(function(Eu){return!Eu.props.disabled}))===null||or===void 0?void 0:or.key;if(Tr){var Mr,Xr,Oo;(Mr=Nt.current)===null||Mr===void 0||(Xr=Mr.querySelector("li[data-menu-id='".concat(qI(jt,Tr),"']")))===null||Xr===void 0||(Oo=Xr.focus)===null||Oo===void 0||Oo.call(Xr,Kn)}}}});var En=ki(oe||[],{value:he,postState:function(Kn){return Array.isArray(Kn)?Kn:Kn==null?rh:[Kn]}}),hn=Le(En,2),Pn=hn[0],Gn=hn[1],lr=function(Kn){if(le){var or=Kn.key,Tr=Pn.includes(or),Mr;se?Tr?Mr=Pn.filter(function(Oo){return Oo!==or}):Mr=[].concat(Pt(Pn),[or]):Mr=[or],Gn(Mr);var Xr=fe(fe({},Kn),{},{selectedKeys:Mr});Tr?be==null||be(Xr):_e==null||_e(Xr)}!se&&sn.length&&Bt!=="inline"&&zt(rh)},Zr=uh(function(Xn){Qe==null||Qe(pb(Xn)),lr(Xn)}),hr=uh(function(Xn,Kn){var or=sn.filter(function(Mr){return Mr!==Xn});if(Kn)or.push(Xn);else if(Bt!=="inline"){var Tr=Be(Xn);or=or.filter(function(Mr){return!Tr.has(Mr)})}NI(sn,or,!0)||zt(or,!0)}),Vr=uh(bt),Nn=function(Kn,or){var Tr=or!=null?or:!sn.includes(Kn);hr(Kn,Tr)},An=Ase(Bt,Mt,Ve,jt,Nt,Me,Pe,at,Nn,ct);w.exports.useEffect(function(){Dt(!0)},[]);var zn=w.exports.useMemo(function(){return{_internalRenderMenuItem:wt,_internalRenderSubMenuItem:rt}},[wt,rt]),ri=Bt!=="horizontal"||N?nt:nt.map(function(Xn,Kn){return I(gv,{overflowDisabled:Kn>nr,children:Xn},Xn.key)}),Er=I(yl,{id:P,ref:Nt,prefixCls:"".concat(s,"-overflow"),component:"ul",itemComponent:U_,className:He(s,"".concat(s,"-root"),"".concat(s,"-").concat(Bt),d,(r={},re(r,"".concat(s,"-inline-collapsed"),qt),re(r,"".concat(s,"-rtl"),Ve),r),a),dir:_,style:u,role:"menu",tabIndex:m,data:ri,renderRawItem:function(Kn){return Kn},renderRawRest:function(Kn){var or=Kn.length,Tr=or?nt.slice(-or):null;return I(j_,{eventKey:F3,title:St,disabled:q,internalPopupClose:or===0,popupClassName:We,children:Tr})},maxCount:Bt!=="horizontal"||N?yl.INVALIDATE:yl.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(Kn){ye(Kn)},onKeyDown:An,...ut});return I(ZI.Provider,{value:zn,children:I(U9.Provider,{value:jt,children:$e(gv,{prefixCls:s,rootClassName:a,mode:Bt,openKeys:sn,rtl:Ve,disabled:O,motion:_t?Ee:null,defaultMotions:_t?Ce:null,activeKey:Mt,onActive:$t,onInactive:Xt,selectedKeys:Pn,inlineIndent:Te,subMenuOpenDelay:F,subMenuCloseDelay:B,forceSubMenuRender:H,builtinPlacements:Ke,triggerSubMenuAction:De,getPopupContainer:Vr,itemIcon:Ue,expandIcon:tt,onItemClick:Zr,onOpenChange:hr,children:[I(W9.Provider,{value:et,children:Er}),I("div",{style:{display:"none"},"aria-hidden":!0,children:I(H9.Provider,{value:Je,children:nt})})]})})})}),ile=["className","title","eventKey","children"],ole=["children"],ale=function(t){var n=t.className,r=t.title;t.eventKey;var i=t.children,o=Rn(t,ile),s=w.exports.useContext(js),a=s.prefixCls,u="".concat(a,"-item-group");return $e("li",{role:"presentation",...o,onClick:function(p){return p.stopPropagation()},className:He(u,n),children:[I("div",{role:"presentation",className:"".concat(u,"-title"),title:typeof r=="string"?r:void 0,children:r}),I("ul",{role:"group",className:"".concat(u,"-list"),children:i})]})};function H_(e){var t=e.children,n=Rn(e,ole),r=Sp(n.eventKey),i=QI(t,r),o=V_();return o?i:I(ale,{...Ci(n,["warnKey"]),children:i})}function JI(e){var t=e.className,n=e.style,r=w.exports.useContext(js),i=r.prefixCls,o=V_();return o?null:I("li",{className:He("".concat(i,"-item-divider"),t),style:n})}var Wv=rle;Wv.Item=U_;Wv.SubMenu=j_;Wv.ItemGroup=H_;Wv.Divider=JI;var sle={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const lle=sle;var e7=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:lle})})};e7.displayName="LeftOutlined";const t7=w.exports.forwardRef(e7);var ule={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const n7=ule;var r7=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:n7})})};r7.displayName="RightOutlined";const K_=w.exports.forwardRef(r7);globalThis&&globalThis.__rest;var i7=w.exports.createContext({}),cle=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"?F=p?k:"":M===!1&&(F="");var V={title:F};!s&&!m&&(V.title=null,V.open=!1);var B=yo(k).length,H=$e(U_,{...L,className:He((o={},re(o,"".concat(d,"-item-danger"),N),re(o,"".concat(d,"-item-only-child"),(O?B+1:B)===1),o),P),title:typeof M=="string"?M:void 0,children:[ui(O,{className:He(Ro(O)?(a=O.props)===null||a===void 0?void 0:a.className:"","".concat(d,"-item-icon"))}),r.renderItemChildren(m)]});return x||(H=I($i,{...V,placement:v==="rtl"?"left":"right",overlayClassName:"".concat(d,"-inline-collapsed-tooltip"),children:H})),H},r}return Lr(n,[{key:"renderItemChildren",value:function(i){var o=this.context,s=o.prefixCls,a=o.firstLevel,u=this.props,d=u.icon,p=u.children,m=I("span",{className:"".concat(s,"-title-content"),children:p});return(!d||Ro(p)&&p.type==="span")&&p&&i&&a&&typeof p=="string"?I("div",{className:"".concat(s,"-inline-collapsed-noicon"),children:p.charAt(0)}):m}},{key:"render",value:function(){return I(i7.Consumer,{children:this.renderItem})}}]),n}(w.exports.Component);eT.contextType=mb;function a7(e){var t,n=e.popupClassName,r=e.icon,i=e.title,o=e.theme,s=w.exports.useContext(mb),a=s.prefixCls,u=s.inlineCollapsed,d=s.antdMenuTheme,p=Sp(),m;if(!r)m=u&&!p.length&&i&&typeof i=="string"?I("div",{className:"".concat(a,"-inline-collapsed-noicon"),children:i.charAt(0)}):I("span",{className:"".concat(a,"-title-content"),children:i});else{var v=Ro(i)&&i.type==="span";m=$e(Tn,{children:[ui(r,{className:He(Ro(r)?(t=r.props)===null||t===void 0?void 0:t.className:"","".concat(a,"-item-icon"))}),v?i:I("span",{className:"".concat(a,"-title-content"),children:i})]})}var x=w.exports.useMemo(function(){return ze(ze({},s),{firstLevel:!1})},[s]);return I(mb.Provider,{value:x,children:I(j_,{...Ci(e,["icon"]),title:m,popupClassName:He(a,"".concat(a,"-").concat(o||d),n)})})}var ple=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:1,n=Ple++,r=t;function i(){r-=1,r<=0?(e(),delete Lh[n]):Lh[n]=ar(i)}return Lh[n]=ar(i),n}vb.cancel=function(t){t!==void 0&&(ar.cancel(Lh[t]),delete Lh[t])};vb.ids=Lh;var OC;function yO(e){return!e||e.offsetParent===null||e.hidden}function Ile(e){return e instanceof Document?e.body:Array.from(e.childNodes).find(function(t){return(t==null?void 0:t.nodeType)===Node.ELEMENT_NODE})}function Tle(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return t&&t[1]&&t[2]&&t[3]?!(t[1]===t[2]&&t[2]===t[3]):!0}var u7=function(e){ci(n,e);var t=di(n);function n(){var r;return Nr(this,n),r=t.apply(this,arguments),r.containerRef=w.exports.createRef(),r.animationStart=!1,r.destroyed=!1,r.onClick=function(i,o){var s,a,u=r.props,d=u.insertExtraNode,p=u.disabled;if(!(p||!i||yO(i)||i.className.includes("-leave"))){r.extraNode=document.createElement("div");var m=Vn(r),v=m.extraNode,x=r.context.getPrefixCls;v.className="".concat(x(""),"-click-animating-node");var _=r.getAttributeName();if(i.setAttribute(_,"true"),o&&o!=="#fff"&&o!=="#ffffff"&&o!=="rgb(255, 255, 255)"&&o!=="rgba(255, 255, 255, 1)"&&Tle(o)&&!/rgba\((?:\d*, ){3}0\)/.test(o)&&o!=="transparent"){v.style.borderColor=o;var P=((s=i.getRootNode)===null||s===void 0?void 0:s.call(i))||i.ownerDocument,k=(a=Ile(P))!==null&&a!==void 0?a:P;OC=jv(` [`.concat(x(""),"-click-animating-without-extra-node='true']::after, .").concat(x(""),`-click-animating-node { --antd-wave-shadow-color: `).concat(o,`; }`),"antd-wave",{csp:r.csp,attachTo:k})}d&&i.appendChild(v),["transition","animation"].forEach(function(T){i.addEventListener("".concat(T,"start"),r.onTransitionStart),i.addEventListener("".concat(T,"end"),r.onTransitionEnd)})}},r.onTransitionStart=function(i){if(!r.destroyed){var o=r.containerRef.current;!i||i.target!==o||r.animationStart||r.resetEffect(o)}},r.onTransitionEnd=function(i){!i||i.animationName!=="fadeEffect"||r.resetEffect(i.target)},r.bindAnimationEvent=function(i){if(!(!i||!i.getAttribute||i.getAttribute("disabled")||i.className.includes("disabled"))){var o=function(a){if(!(a.target.tagName==="INPUT"||yO(a.target))){r.resetEffect(i);var u=getComputedStyle(i).getPropertyValue("border-top-color")||getComputedStyle(i).getPropertyValue("border-color")||getComputedStyle(i).getPropertyValue("background-color");r.clickWaveTimeoutId=window.setTimeout(function(){return r.onClick(i,u)},0),vb.cancel(r.animationStartId),r.animationStart=!0,r.animationStartId=vb(function(){r.animationStart=!1},10)}};return i.addEventListener("click",o,!0),{cancel:function(){i.removeEventListener("click",o,!0)}}}},r.renderWave=function(i){var o=i.csp,s=r.props.children;if(r.csp=o,!w.exports.isValidElement(s))return s;var a=r.containerRef;return vf(s)&&(a=Zo(s.ref,r.containerRef)),ui(s,{ref:a})},r}return Lr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var i=this.containerRef.current;!i||i.nodeType!==1||(this.instance=this.bindAnimationEvent(i))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var i=this.context.getPrefixCls,o=this.props.insertExtraNode;return o?"".concat(i(""),"-click-animating"):"".concat(i(""),"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(i){var o=this;if(!(!i||i===this.extraNode||!(i instanceof Element))){var s=this.props.insertExtraNode,a=this.getAttributeName();i.setAttribute(a,"false"),OC&&(OC.innerHTML=""),s&&this.extraNode&&i.contains(this.extraNode)&&i.removeChild(this.extraNode),["transition","animation"].forEach(function(u){i.removeEventListener("".concat(u,"start"),o.onTransitionStart),i.removeEventListener("".concat(u,"end"),o.onTransitionEnd)})}}},{key:"render",value:function(){return I(zc,{children:this.renderWave})}}]),n}(w.exports.Component);u7.contextType=On;const kle=u7;var Mle=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(Z=P.map(function(ne){return typeof ne=="string"||typeof ne=="number"?I(yb,{prefixCls:ee,disabled:M,value:ne,checked:d===ne,children:ne},ne.toString()):I(yb,{prefixCls:ee,disabled:ne.disabled||M,value:ne.value,checked:d===ne.value,style:ne.style,children:ne.label},"radio-group-value-options-".concat(ne.value))}));var Q=N||s,le=He(X,"".concat(X,"-").concat(T),(n={},re(n,"".concat(X,"-").concat(Q),Q),re(n,"".concat(X,"-rtl"),o==="rtl"),n),_);return I("div",{...jB(e),className:le,style:L,onMouseEnter:V,onMouseLeave:B,onFocus:H,onBlur:G,id:F,ref:t,children:I(zue,{value:{onChange:m,value:d,disabled:e.disabled,name:e.name,optionType:e.optionType},children:Z})})});const Hue=w.exports.memo(jue);var Kue=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=t||V<0||m&&B>=o}function T(){var F=zC();if(k(F))return M(F);a=setTimeout(T,P(F))}function M(F){return a=void 0,v&&r?x(F):(r=i=void 0,s)}function O(){a!==void 0&&clearTimeout(a),d=0,r=u=i=a=void 0}function N(){return a===void 0?s:M(zC())}function L(){var F=zC(),V=k(F);if(r=arguments,i=this,u=F,V){if(a===void 0)return _(u);if(m)return clearTimeout(a),a=setTimeout(T,t),x(u)}return a===void 0&&(a=setTimeout(T,t)),s}return L.cancel=O,L.flush=N,L}var nce=tce;function S7(e,t){var n=new Set;return e.forEach(function(r){t.has(r)||n.add(r)}),n}function rce(e){var t=e||{},n=t.disabled,r=t.disableCheckbox,i=t.checkable;return!!(n||r)||i===!1}function ice(e,t,n,r){for(var i=new Set(e),o=new Set,s=0;s<=n;s+=1){var a=t.get(s)||new Set;a.forEach(function(m){var v=m.key,x=m.node,_=m.children,P=_===void 0?[]:_;i.has(v)&&!r(x)&&P.filter(function(k){return!r(k.node)}).forEach(function(k){i.add(k.key)})})}for(var u=new Set,d=n;d>=0;d-=1){var p=t.get(d)||new Set;p.forEach(function(m){var v=m.parent,x=m.node;if(!(r(x)||!m.parent||u.has(m.parent.key))){if(r(m.parent.node)){u.add(v.key);return}var _=!0,P=!1;(v.children||[]).filter(function(k){return!r(k.node)}).forEach(function(k){var T=k.key,M=i.has(T);_&&!M&&(_=!1),!P&&(M||o.has(T))&&(P=!0)}),_&&i.add(v.key),P&&o.add(v.key),u.add(v.key)}})}return{checkedKeys:Array.from(i),halfCheckedKeys:Array.from(S7(o,i))}}function oce(e,t,n,r,i){for(var o=new Set(e),s=new Set(t),a=0;a<=r;a+=1){var u=n.get(a)||new Set;u.forEach(function(v){var x=v.key,_=v.node,P=v.children,k=P===void 0?[]:P;!o.has(x)&&!s.has(x)&&!i(_)&&k.filter(function(T){return!i(T.node)}).forEach(function(T){o.delete(T.key)})})}s=new Set;for(var d=new Set,p=r;p>=0;p-=1){var m=n.get(p)||new Set;m.forEach(function(v){var x=v.parent,_=v.node;if(!(i(_)||!v.parent||d.has(v.parent.key))){if(i(v.parent.node)){d.add(x.key);return}var P=!0,k=!1;(x.children||[]).filter(function(T){return!i(T.node)}).forEach(function(T){var M=T.key,O=o.has(M);P&&!O&&(P=!1),!k&&(O||s.has(M))&&(k=!0)}),P||o.delete(x.key),k&&s.add(x.key),d.add(x.key)}})}return{checkedKeys:Array.from(o),halfCheckedKeys:Array.from(S7(s,o))}}function uu(e,t,n,r){var i=[],o;r?o=r:o=rce;var s=new Set(e.filter(function(p){var m=!!n[p];return m||i.push(p),m})),a=new Map,u=0;Object.keys(n).forEach(function(p){var m=n[p],v=m.level,x=a.get(v);x||(x=new Set,a.set(v,x)),x.add(m),u=Math.max(u,v)}),Dr(!i.length,"Tree missing follow keys: ".concat(i.slice(0,100).map(function(p){return"'".concat(p,"'")}).join(", ")));var d;return t===!0?d=ice(s,a,u,o):d=oce(s,t.halfCheckedKeys,a,u,o),d}var oT=w.exports.createContext(null),ace=function(t){for(var n=t.prefixCls,r=t.level,i=t.isStart,o=t.isEnd,s="".concat(n,"-indent-unit"),a=[],u=0;u=0&&n.splice(r,1),n}function Gl(e,t){var n=(e||[]).slice();return n.indexOf(t)===-1&&n.push(t),n}function aT(e){return e.split("-")}function E7(e,t){return"".concat(e,"-").concat(t)}function dce(e){return e&&e.type&&e.type.isTreeNode}function fce(e,t){var n=[],r=t[e];function i(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];o.forEach(function(s){var a=s.key,u=s.children;n.push(a),i(u)})}return i(r.children),n}function hce(e){if(e.parent){var t=aT(e.pos);return Number(t[t.length-1])===e.parent.children.length-1}return!1}function pce(e){var t=aT(e.pos);return Number(t[t.length-1])===0}function TO(e,t,n,r,i,o,s,a,u,d){var p,m=e.clientX,v=e.clientY,x=e.target.getBoundingClientRect(),_=x.top,P=x.height,k=(d==="rtl"?-1:1)*(((i==null?void 0:i.x)||0)-m),T=(k-12)/r,M=a[n.props.eventKey];if(v<_+P/2){var O=s.findIndex(function(le){return le.key===M.key}),N=O<=0?0:O-1,L=s[N].key;M=a[L]}var F=M.key,V=M,B=M.key,H=0,G=0;if(!u.includes(F))for(var ee=0;ee-1.5?o({dragNode:X,dropNode:Z,dropPosition:1})?H=1:Q=!1:o({dragNode:X,dropNode:Z,dropPosition:0})?H=0:o({dragNode:X,dropNode:Z,dropPosition:1})?H=1:Q=!1:o({dragNode:X,dropNode:Z,dropPosition:1})?H=1:Q=!1,{dropPosition:H,dropLevelOffset:G,dropTargetKey:M.key,dropTargetPos:M.pos,dragOverNodeKey:B,dropContainerKey:H===0?null:((p=M.parent)===null||p===void 0?void 0:p.key)||null,dropAllowed:Q}}function kO(e,t){if(!!e){var n=t.multiple;return n?e.slice():e.length?[e[0]]:e}}function $C(e){if(!e)return null;var t;if(Array.isArray(e))t={checkedKeys:e,halfCheckedKeys:void 0};else if(nn(e)==="object")t={checkedKeys:e.checked||void 0,halfCheckedKeys:e.halfChecked||void 0};else return Dr(!1,"`checkedKeys` is not an array or an object"),null;return t}function U3(e,t){var n=new Set;function r(i){if(!n.has(i)){var o=t[i];if(!!o){n.add(i);var s=o.parent,a=o.node;a.disabled||s&&r(s.key)}}}return(e||[]).forEach(function(i){r(i)}),Pt(n)}var mce=["children"];function Yv(e,t){return e!=null?e:t}function xb(e){var t=e||{},n=t.title,r=t._title,i=t.key,o=t.children,s=n||"title";return{title:s,_title:r||[s],key:i||"key",children:o||"children"}}function P7(e){function t(n){var r=yo(n);return r.map(function(i){if(!dce(i))return Dr(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var o=i.key,s=i.props,a=s.children,u=Rn(s,mce),d=fe({key:o},u),p=t(a);return p.length&&(d.children=p),d}).filter(function(i){return i})}return t(e)}function BC(e,t,n){var r=xb(n),i=r._title,o=r.key,s=r.children,a=new Set(t===!0?[]:t),u=[];function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return p.map(function(v,x){for(var _=E7(m?m.pos:"0",x),P=Yv(v[o],_),k,T=0;T1&&arguments[1]!==void 0?arguments[1]:{},n=t.initWrapper,r=t.processEntity,i=t.onProcessFinished,o=t.externalGetKey,s=t.childrenPropName,a=t.fieldNames,u=arguments.length>2?arguments[2]:void 0,d=o||u,p={},m={},v={posEntities:p,keyEntities:m};return n&&(v=n(v)||v),gce(e,function(x){var _=x.node,P=x.index,k=x.pos,T=x.key,M=x.parentPos,O=x.level,N=x.nodes,L={node:_,nodes:N,index:P,key:T,pos:k,level:O},F=Yv(T,k);p[k]=L,m[F]=L,L.parent=p[M],L.parent&&(L.parent.children=L.parent.children||[],L.parent.children.push(L)),r&&r(L,v)},{externalGetKey:d,childrenPropName:s,fieldNames:a}),i&&i(v),v}function Tg(e,t){var n=t.expandedKeys,r=t.selectedKeys,i=t.loadedKeys,o=t.loadingKeys,s=t.checkedKeys,a=t.halfCheckedKeys,u=t.dragOverNodeKey,d=t.dropPosition,p=t.keyEntities,m=p[e],v={eventKey:e,expanded:n.indexOf(e)!==-1,selected:r.indexOf(e)!==-1,loaded:i.indexOf(e)!==-1,loading:o.indexOf(e)!==-1,checked:s.indexOf(e)!==-1,halfChecked:a.indexOf(e)!==-1,pos:String(m?m.pos:""),dragOver:u===e&&d===0,dragOverGapTop:u===e&&d===-1,dragOverGapBottom:u===e&&d===1};return v}function Fi(e){var t=e.data,n=e.expanded,r=e.selected,i=e.checked,o=e.loaded,s=e.loading,a=e.halfChecked,u=e.dragOver,d=e.dragOverGapTop,p=e.dragOverGapBottom,m=e.pos,v=e.active,x=e.eventKey,_=fe(fe({},t),{},{expanded:n,selected:r,checked:i,loaded:o,loading:s,halfChecked:a,dragOver:u,dragOverGapTop:d,dragOverGapBottom:p,pos:m,active:v,key:x});return"props"in _||Object.defineProperty(_,"props",{get:function(){return Dr(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),e}}),_}var vce=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(i=V().map(function(ne){return I($d,{prefixCls:ee,disabled:"disabled"in ne?ne.disabled:m.disabled,value:ne.value,checked:T.includes(ne.value),onChange:ne.onChange,className:"".concat(X,"-item"),style:ne.style,children:ne.label},ne.value.toString())}));var Q={toggleOption:G,value:T,disabled:m.disabled,name:m.name,registerValue:H,cancelValue:B},le=He(X,re({},"".concat(X,"-rtl"),_==="rtl"),u);return I("div",{className:le,style:d,...Z,ref:n,children:I(I7.Provider,{value:Q,children:i})})},xce=w.exports.forwardRef(yce);const bce=w.exports.memo(xce);var _ce=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0){var H=a[0]/2;B.paddingLeft=H,B.paddingRight=H}if(a&&a[1]>0&&!d){var G=a[1]/2;B.paddingTop=G,B.paddingBottom=G}return M&&(B.flex=Pce(M),u===!1&&!B.minWidth&&(B.minWidth=0)),I("div",{...N,style:ze(ze({},B),O),className:V,ref:t,children:T})});const Io=Tce;var kce=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0?Q[0]/-2:void 0,oe=Q[1]!=null&&Q[1]>0?Q[1]/-2:void 0;if(se&&(ne.marginLeft=se,ne.marginRight=se),G){var he=Le(Q,2);ne.rowGap=he[1]}else oe&&(ne.marginTop=oe,ne.marginBottom=oe);var _e=Le(Q,2),be=_e[0],xe=_e[1],Te=w.exports.useMemo(function(){return{gutter:[be,xe],wrap:m,supportFlexGap:G}},[be,xe,m,G]);return I(T7.Provider,{value:Te,children:I("div",{...v,className:le,style:ze(ze({},ne),a),ref:t,children:u})})});const sc=Mce;var k7=w.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.forceRender,o=e.className,s=e.style,a=e.children,u=e.isActive,d=e.role,p=w.exports.useState(u||i),m=Le(p,2),v=m[0],x=m[1];return w.exports.useEffect(function(){(i||u)&&x(!0)},[i,u]),v?I("div",{ref:t,className:He("".concat(r,"-content"),(n={},re(n,"".concat(r,"-content-active"),u),re(n,"".concat(r,"-content-inactive"),!u),n),o),style:s,role:d,children:I("div",{className:"".concat(r,"-content-box"),children:a})}):null});k7.displayName="PanelContent";var Rce=["className","id","style","prefixCls","headerClass","children","isActive","destroyInactivePanel","accordion","forceRender","openMotion","extra","collapsible"],M7=function(e){ci(n,e);var t=di(n);function n(){var r;Nr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s-1;m?d.splice(p,1):d.push(u)}i.setActiveKey(d)},i.getNewChild=function(u,d){if(!u)return null;var p=i.state.activeKey,m=i.props,v=m.prefixCls,x=m.openMotion,_=m.accordion,P=m.destroyInactivePanel,k=m.expandIcon,T=m.collapsible,M=u.key||String(d),O=u.props,N=O.header,L=O.headerClass,F=O.destroyInactivePanel,V=O.collapsible,B=!1;_?B=p[0]===M:B=p.indexOf(M)>-1;var H=V!=null?V:T,G={key:M,panelKey:M,header:N,headerClass:L,isActive:B,prefixCls:v,destroyInactivePanel:F!=null?F:P,openMotion:x,accordion:_,children:u.props.children,onItemClick:H==="disabled"?null:i.onClickItem,expandIcon:k,collapsible:H};return typeof u.type=="string"?u:(Object.keys(G).forEach(function(ee){typeof G[ee]>"u"&&delete G[ee]}),w.exports.cloneElement(u,G))},i.getItems=function(){var u=i.props.children;return yo(u).map(i.getNewChild)},i.setActiveKey=function(u){"activeKey"in i.props||i.setState({activeKey:u}),i.props.onChange(i.props.accordion?u[0]:u)};var o=r.activeKey,s=r.defaultActiveKey,a=s;return"activeKey"in r&&(a=o),i.state={activeKey:RO(a)},i}return Lr(n,[{key:"shouldComponentUpdate",value:function(i,o){return!rf(this.props,i)||!rf(this.state,o)}},{key:"render",value:function(){var i,o=this.props,s=o.prefixCls,a=o.className,u=o.style,d=o.accordion,p=He((i={},re(i,s,!0),re(i,a,!!a),i));return I("div",{className:p,style:u,role:d?"tablist":null,children:this.getItems()})}}],[{key:"getDerivedStateFromProps",value:function(i){var o={};return"activeKey"in i&&(o.activeKey=RO(i.activeKey)),o}}]),n}(w.exports.Component);Qv.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1};Qv.Panel=M7;Qv.Panel;var Ace=function(t){var n=w.exports.useContext(On),r=n.getPrefixCls,i=t.prefixCls,o=t.className,s=o===void 0?"":o,a=t.showArrow,u=a===void 0?!0:a,d=r("collapse",i),p=He(re({},"".concat(d,"-no-arrow"),!u),s);return I(Qv.Panel,{...t,prefixCls:d,className:p})};const Dce=Ace;var R7=function(t){var n,r=w.exports.useContext(On),i=r.getPrefixCls,o=r.direction,s=t.prefixCls,a=t.className,u=a===void 0?"":a,d=t.bordered,p=d===void 0?!0:d,m=t.ghost,v=t.expandIconPosition,x=v===void 0?"start":v,_=i("collapse",s),P=w.exports.useMemo(function(){return x==="left"?"start":x==="right"?"end":x},[x]),k=function(){var L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},F=t.expandIcon,V=F?F(L):I(K_,{rotate:L.isActive?90:void 0});return ui(V,function(){return{className:He(V.props.className,"".concat(_,"-arrow"))}})},T=He("".concat(_,"-icon-position-").concat(P),(n={},re(n,"".concat(_,"-borderless"),!p),re(n,"".concat(_,"-rtl"),o==="rtl"),re(n,"".concat(_,"-ghost"),!!m),n),u),M=ze(ze({},np),{motionAppear:!1,leavedClassName:"".concat(_,"-content-hidden")}),O=function(){var L=t.children;return yo(L).map(function(F,V){var B;if(!((B=F.props)===null||B===void 0)&&B.disabled){var H=F.key||String(V),G=F.props,ee=G.disabled,X=G.collapsible,Z=ze(ze({},Ci(F.props,["disabled"])),{key:H,collapsible:X!=null?X:ee?"disabled":void 0});return ui(F,Z)}return F})};return I(Qv,{openMotion:M,...t,expandIcon:k,prefixCls:_,className:T,children:O()})};R7.Panel=Dce;const ll=R7;var Oce=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0?"-".concat(p):p,O=!!x,N=p==="left"&&m!=null,L=p==="right"&&m!=null,F=He(T,"".concat(T,"-").concat(u),(n={},re(n,"".concat(T,"-with-text"),O),re(n,"".concat(T,"-with-text").concat(M),O),re(n,"".concat(T,"-dashed"),!!_),re(n,"".concat(T,"-plain"),!!P),re(n,"".concat(T,"-rtl"),o==="rtl"),re(n,"".concat(T,"-no-default-orientation-margin-left"),N),re(n,"".concat(T,"-no-default-orientation-margin-right"),L),n),v),V=ze(ze({},N&&{marginLeft:m}),L&&{marginRight:m});return I("div",{className:F,...k,role:"separator",children:x&&u!=="vertical"&&I("span",{className:"".concat(T,"-inner-text"),style:V,children:x})})};const Lce=Nce;var A7=w.exports.createContext(null),AO=[];function Fce(e,t){var n=w.exports.useState(function(){if(!Mo())return null;var _=document.createElement("div");return _}),r=Le(n,1),i=r[0],o=w.exports.useRef(!1),s=w.exports.useContext(A7),a=w.exports.useState(AO),u=Le(a,2),d=u[0],p=u[1],m=s||(o.current?void 0:function(_){p(function(P){var k=[_].concat(Pt(P));return k})});function v(){i.parentElement||document.body.appendChild(i),o.current=!0}function x(){var _;(_=i.parentElement)===null||_===void 0||_.removeChild(i),o.current=!1}return wi(function(){return e?s?s(v):v():x(),x},[e]),wi(function(){d.length&&(d.forEach(function(_){return _()}),p(AO))},[d]),[i,m]}var VC;function bb(e){if(typeof document>"u")return 0;if(e||VC===void 0){var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var n=document.createElement("div"),r=n.style;r.position="absolute",r.top="0",r.left="0",r.pointerEvents="none",r.visibility="hidden",r.width="200px",r.height="150px",r.overflow="hidden",n.appendChild(t),document.body.appendChild(n);var i=t.offsetWidth;n.style.overflow="scroll";var o=t.offsetWidth;i===o&&(o=n.clientWidth),document.body.removeChild(n),VC=i-o}return VC}function DO(e){var t=e.match(/^(.*)px$/),n=Number(t==null?void 0:t[1]);return Number.isNaN(n)?bb():n}function OO(e){if(typeof document>"u"||!e||!(e instanceof Element))return{width:0,height:0};var t=getComputedStyle(e,"::-webkit-scrollbar"),n=t.width,r=t.height;return{width:DO(n),height:DO(r)}}function zce(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var $ce="rc-util-locker-".concat(Date.now()),NO=0;function Bce(e){var t=!!e,n=w.exports.useState(function(){return NO+=1,"".concat($ce,"_").concat(NO)}),r=Le(n,1),i=r[0];wi(function(){if(t){var o=bb(),s=zce();jv(` html body { overflow-y: hidden; `.concat(s?"width: calc(100% - ".concat(o,"px);"):"",` }`),i)}else _D(i);return function(){_D(i)}},[t,i])}var LO=!1;function Vce(e){return typeof e=="boolean"&&(LO=e),LO}var FO=function(t){return t===!1?!1:!Mo()||!t?null:typeof t=="string"?document.querySelector(t):typeof t=="function"?t():t},D7=w.exports.forwardRef(function(e,t){var n=e.open,r=e.autoLock,i=e.getContainer;e.debug;var o=e.autoDestroy,s=o===void 0?!0:o,a=e.children,u=w.exports.useState(n),d=Le(u,2),p=d[0],m=d[1],v=p||n;w.exports.useEffect(function(){(s||n)&&m(n)},[n,s]);var x=w.exports.useState(function(){return FO(i)}),_=Le(x,2),P=_[0],k=_[1];w.exports.useEffect(function(){var ee=FO(i);k(ee!=null?ee:null)});var T=Fce(v&&!P),M=Le(T,2),O=M[0],N=M[1],L=P!=null?P:O;Bce(r&&n&&Mo()&&(L===O||L===document.body));var F=null;if(a&&vf(a)&&t){var V=a;F=V.ref}var B=s$(F,t);if(!v||!Mo()||P===void 0)return null;var H=L===!1||Vce(),G=a;return t&&(G=w.exports.cloneElement(a,{ref:B})),I(A7.Provider,{value:N,children:H?G:Cl.exports.createPortal(G,L)})});function _b(e){var t=w.exports.useState(e),n=Le(t,2),r=n[0],i=n[1];return w.exports.useEffect(function(){var o=setTimeout(function(){i(e)},e.length?0:10);return function(){clearTimeout(o)}},[e]),r}var zO=[];function UC(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;return{key:typeof e=="string"?e:"".concat(n,"-").concat(r),error:e,errorStatus:t}}function O7(e){var t=e.help,n=e.helpStatus,r=e.errors,i=r===void 0?zO:r,o=e.warnings,s=o===void 0?zO:o,a=e.className,u=e.fieldId,d=e.onVisibleChanged,p=w.exports.useContext(jI),m=p.prefixCls,v=w.exports.useContext(On),x=v.getPrefixCls,_="".concat(m,"-item-explain"),P=x(),k=_b(i),T=_b(s),M=w.exports.useMemo(function(){return t!=null?[UC(t,n,"help")]:[].concat(Pt(k.map(function(N,L){return UC(N,"error","error",L)})),Pt(T.map(function(N,L){return UC(N,"warning","warning",L)})))},[t,n,k,T]),O={};return u&&(O.id="".concat(u,"_help")),I(Xo,{motionDeadline:np.motionDeadline,motionName:"".concat(P,"-show-help"),visible:!!M.length,onVisibleChanged:d,children:function(N){var L=N.className,F=N.style;return I("div",{...O,className:He(_,L,a),style:F,role:"alert",children:I(_I,{keys:M,...np,motionName:"".concat(P,"-show-help-item"),component:!1,children:function(V){var B=V.key,H=V.error,G=V.errorStatus,ee=V.className,X=V.style;return I("div",{className:He(ee,re({},"".concat(_,"-").concat(G),G)),style:X,children:H},B)}})})}})}function $O(e){return typeof e=="object"&&e!=null&&e.nodeType===1}function BO(e,t){return(!t||e!=="hidden")&&e!=="visible"&&e!=="clip"}function jC(e,t){if(e.clientHeightt||o>e&&s=t&&a>=n?o-e-r:s>t&&an?s-t+i:0}var VO=function(e,t){var n=window,r=t.scrollMode,i=t.block,o=t.inline,s=t.boundary,a=t.skipOverflowHiddenElements,u=typeof s=="function"?s:function(bt){return bt!==s};if(!$O(e))throw new TypeError("Invalid target");for(var d,p,m=document.scrollingElement||document.documentElement,v=[],x=e;$O(x)&&u(x);){if((x=(p=(d=x).parentElement)==null?d.getRootNode().host||null:p)===m){v.push(x);break}x!=null&&x===document.body&&jC(x)&&!jC(document.documentElement)||x!=null&&jC(x,a)&&v.push(x)}for(var _=n.visualViewport?n.visualViewport.width:innerWidth,P=n.visualViewport?n.visualViewport.height:innerHeight,k=window.scrollX||pageXOffset,T=window.scrollY||pageYOffset,M=e.getBoundingClientRect(),O=M.height,N=M.width,L=M.top,F=M.right,V=M.bottom,B=M.left,H=i==="start"||i==="nearest"?L:i==="end"?V:L+O/2,G=o==="center"?B+N/2:o==="end"?F:B,ee=[],X=0;X=0&&B>=0&&V<=P&&F<=_&&L>=se&&V<=he&&B>=_e&&F<=oe)return ee;var be=getComputedStyle(Z),xe=parseInt(be.borderLeftWidth,10),Te=parseInt(be.borderTopWidth,10),Ee=parseInt(be.borderRightWidth,10),Ce=parseInt(be.borderBottomWidth,10),ke=0,De=0,Ke="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-xe-Ee:0,Ue="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-Te-Ce:0,tt="offsetWidth"in Z?Z.offsetWidth===0?0:ne/Z.offsetWidth:0,lt="offsetHeight"in Z?Z.offsetHeight===0?0:le/Z.offsetHeight:0;if(m===Z)ke=i==="start"?H:i==="end"?H-P:i==="nearest"?ix(T,T+P,P,Te,Ce,T+H,T+H+O,O):H-P/2,De=o==="start"?G:o==="center"?G-_/2:o==="end"?G-_:ix(k,k+_,_,xe,Ee,k+G,k+G+N,N),ke=Math.max(0,ke+T),De=Math.max(0,De+k);else{ke=i==="start"?H-se-Te:i==="end"?H-he+Ce+Ue:i==="nearest"?ix(se,he,le,Te,Ce+Ue,H,H+O,O):H-(se+le/2)+Ue/2,De=o==="start"?G-_e-xe:o==="center"?G-(_e+ne/2)+Ke/2:o==="end"?G-oe+Ee+Ke:ix(_e,oe,ne,xe,Ee+Ke,G,G+N,N);var St=Z.scrollLeft,We=Z.scrollTop;H+=We-(ke=Math.max(0,Math.min(We+ke/lt,Z.scrollHeight-le/lt+Ue))),G+=St-(De=Math.max(0,Math.min(St+De/tt,Z.scrollWidth-ne/tt+Ke)))}ee.push({el:Z,top:ke,left:De})}return ee};function N7(e){return e===Object(e)&&Object.keys(e).length!==0}function Uce(e,t){t===void 0&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach(function(r){var i=r.el,o=r.top,s=r.left;i.scroll&&n?i.scroll({top:o,left:s,behavior:t}):(i.scrollTop=o,i.scrollLeft=s)})}function jce(e){return e===!1?{block:"end",inline:"nearest"}:N7(e)?e:{block:"start",inline:"nearest"}}function Hce(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(N7(t)&&typeof t.behavior=="function")return t.behavior(n?VO(e,t):[]);if(!!n){var r=jce(t);return Uce(VO(e,r),r.behavior)}}var Kce=["parentNode"],Wce="form_item";function kg(e){return e===void 0||e===!1?[]:Array.isArray(e)?e:[e]}function L7(e,t){if(!!e.length){var n=e.join("_");if(t)return"".concat(t,"_").concat(n);var r=Kce.includes(n);return r?"".concat(Wce,"_").concat(n):n}}function UO(e){var t=kg(e);return t.join("_")}function F7(e){var t=pI(),n=Le(t,1),r=n[0],i=w.exports.useRef({}),o=w.exports.useMemo(function(){return e!=null?e:ze(ze({},r),{__INTERNAL__:{itemRef:function(a){return function(u){var d=UO(a);u?i.current[d]=u:delete i.current[d]}}},scrollToField:function(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=kg(a),p=L7(d,o.__INTERNAL__.name),m=p?document.getElementById(p):null;m&&Hce(m,ze({scrollMode:"if-needed",block:"nearest"},u))},getFieldInstance:function(a){var u=UO(a);return i.current[u]}})},[e,r]);return[o]}var Gce=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0||Ce.length>0||e.extra){var wt=[];(e.help||Ee.length>0)&&wt.push("".concat(We,"_help")),e.extra&&wt.push("".concat(We,"_extra")),ct["aria-describedby"]=wt.join(" ")}Ee.length>0&&(ct["aria-invalid"]="true"),bt&&(ct["aria-required"]="true"),vf(a)&&(ct.ref=ke(St,a));var rt=new Set([].concat(Pt(kg(v)),Pt(kg(V))));rt.forEach(function(nt){ct[nt]=function(){for(var qe,dt,_t,Dt,Nt,jt=arguments.length,Ve=new Array(jt),Ze=0;Ze2&&arguments[2]!==void 0?arguments[2]:!0,tt=function(){V(function(St){var We=new Map(St),bt=We.delete(De);return bt?We:St})};return V(function(lt){return new Map(lt).set(De,{url:Ke,canPreview:Ue})}),tt},Ce=function(De){De.stopPropagation(),le(!1),he(null)};return w.exports.useEffect(function(){ee(xe)},[xe]),w.exports.useEffect(function(){!Q&&_e&&ee(xe)},[xe,_e,Q]),$e(Ade,{value:{isPreviewGroup:!0,previewUrls:Te,setPreviewUrls:V,current:G,setCurrent:ee,setShowPreview:le,setMousePosition:he,registerImage:Ee},children:[i,I(j7,{"aria-hidden":!Q,visible:Q,prefixCls:r,onClose:Ce,mousePosition:oe,src:Te.get(G),icons:s,getContainer:_,countRender:M,...O})]})},r1=1,i1=50,Um=1,Ode=.2,Nde=function(t){var n,r=t.visible,i=t.maskTransitionName,o=t.getContainer,s=t.prefixCls,a=t.rootClassName,u=t.icons,d=t.countRender,p=t.showSwitch,m=t.showProgress,v=t.current,x=t.count,_=t.scale,P=t.onSwitchLeft,k=t.onSwitchRight,T=t.onClose,M=t.onZoomIn,O=t.onZoomOut,N=t.onRotateRight,L=t.onRotateLeft,F=u.rotateLeft,V=u.rotateRight,B=u.zoomIn,H=u.zoomOut,G=u.close,ee=u.left,X=u.right,Z="".concat(s,"-operations-operation"),Q="".concat(s,"-operations-icon"),le=[{icon:G,onClick:T,type:"close"},{icon:B,onClick:M,type:"zoomIn",disabled:_===i1},{icon:H,onClick:O,type:"zoomOut",disabled:_===r1},{icon:V,onClick:N,type:"rotateRight"},{icon:F,onClick:L,type:"rotateLeft"}],ne=$e(Tn,{children:[p&&$e(Tn,{children:[I("div",{className:He("".concat(s,"-switch-left"),re({},"".concat(s,"-switch-left-disabled"),v===0)),onClick:P,children:ee}),I("div",{className:He("".concat(s,"-switch-right"),re({},"".concat(s,"-switch-right-disabled"),v===x-1)),onClick:k,children:X})]}),$e("ul",{className:"".concat(s,"-operations"),children:[m&&I("li",{className:"".concat(s,"-operations-progress"),children:(n=d==null?void 0:d(v+1,x))!==null&&n!==void 0?n:"".concat(v+1," / ").concat(x)}),le.map(function(se){var oe,he=se.icon,_e=se.onClick,be=se.type,xe=se.disabled;return I("li",{className:He(Z,(oe={},re(oe,"".concat(s,"-operations-operation-").concat(be),!0),re(oe,"".concat(s,"-operations-operation-disabled"),!!xe),oe)),onClick:_e,children:w.exports.isValidElement(he)?w.exports.cloneElement(he,{className:Q}):he},be)})]})]});return I(Xo,{visible:r,motionName:i,children:function(se){var oe=se.className,he=se.style;return I(D7,{open:!0,getContainer:o!=null?o:document.body,children:I("div",{className:He("".concat(s,"-operations-wrapper"),oe,a),style:he,children:ne})})}})},qO={x:0,y:0,rotate:0,scale:1};function Lde(e){var t=w.exports.useRef(null),n=w.exports.useRef([]),r=w.exports.useState(qO),i=Le(r,2),o=i[0],s=i[1],a=function(){s(qO)},u=function(m){t.current===null&&(n.current=[],t.current=ar(function(){s(function(v){var x=v;return n.current.forEach(function(_){x=fe(fe({},x),_)}),t.current=null,x})})),n.current.push(fe(fe({},o),m))},d=function(m,v,x){var _=e.current,P=_.width,k=_.height,T=_.offsetWidth,M=_.offsetHeight,O=_.offsetLeft,N=_.offsetTop,L=m,F=o.scale*m;F>i1?(L=i1/o.scale,F=i1):Fr){if(t>0)return re({},e,o);if(t<0&&ir)return re({},e,t<0?o:-o);return{}}function Fde(e,t,n,r){var i=V7(),o=i.width,s=i.height,a=null;return e<=o&&t<=s?a={x:0,y:0}:(e>o||t>s)&&(a=fe(fe({},ZO("x",n,e,o)),ZO("y",r,t,s))),a}var zde=["prefixCls","src","alt","onClose","afterClose","visible","icons","rootClassName","getContainer","countRender","scaleStep","transitionName","maskTransitionName"],j7=function(t){var n=t.prefixCls,r=t.src,i=t.alt,o=t.onClose;t.afterClose;var s=t.visible,a=t.icons,u=a===void 0?{}:a,d=t.rootClassName,p=t.getContainer,m=t.countRender,v=t.scaleStep,x=v===void 0?.5:v,_=t.transitionName,P=_===void 0?"zoom":_,k=t.maskTransitionName,T=k===void 0?"fade":k,M=Rn(t,zde),O=w.exports.useRef(),N=w.exports.useRef({deltaX:0,deltaY:0,transformX:0,transformY:0}),L=w.exports.useState(!1),F=Le(L,2),V=F[0],B=F[1],H=w.exports.useContext(cT),G=H.previewUrls,ee=H.current,X=H.isPreviewGroup,Z=H.setCurrent,Q=G.size,le=Array.from(G.keys()),ne=le.indexOf(ee),se=X?G.get(ee):r,oe=X&&Q>1,he=X&&Q>=1,_e=Lde(O),be=_e.transform,xe=_e.resetTransform,Te=_e.updateTransform,Ee=_e.dispatchZoonChange,Ce=be.rotate,ke=be.scale,De=He(re({},"".concat(n,"-moving"),V)),Ke=function(){xe()},Ue=function(){Ee(Um+x)},tt=function(){Ee(Um-x)},lt=function(){Te({rotate:Ce+90})},St=function(){Te({rotate:Ce-90})},We=function(qe){qe.preventDefault(),qe.stopPropagation(),ne>0&&Z(le[ne-1])},bt=function(qe){qe.preventDefault(),qe.stopPropagation(),ne0&&(Dt=Um/Dt),Ee(Dt,qe.clientX,qe.clientY)}},rt=w.exports.useCallback(function(nt){!s||!oe||(nt.keyCode===kt.LEFT?ne>0&&Z(le[ne-1]):nt.keyCode===kt.RIGHT&&ne"u"||e===null?"":String(e)}var afe=function(t){var n=t.inputElement,r=t.prefixCls,i=t.prefix,o=t.suffix,s=t.addonBefore,a=t.addonAfter,u=t.className,d=t.style,p=t.affixWrapperClassName,m=t.groupClassName,v=t.wrapperClassName,x=t.disabled,_=t.readOnly,P=t.focused,k=t.triggerFocus,T=t.allowClear,M=t.value,O=t.handleReset,N=t.hidden,L=w.exports.useRef(null),F=function(oe){var he;(he=L.current)!==null&&he!==void 0&&he.contains(oe.target)&&(k==null||k())},V=function(){var oe;if(!T)return null;var he=!x&&!_&&M,_e="".concat(r,"-clear-icon"),be=nn(T)==="object"&&T!==null&&T!==void 0&&T.clearIcon?T.clearIcon:"\u2716";return I("span",{onClick:O,onMouseDown:function(Te){return Te.preventDefault()},className:He(_e,(oe={},re(oe,"".concat(_e,"-hidden"),!he),re(oe,"".concat(_e,"-has-suffix"),!!o),oe)),role:"button",tabIndex:-1,children:be})},B=w.exports.cloneElement(n,{value:M,hidden:N});if(X7(t)){var H,G="".concat(r,"-affix-wrapper"),ee=He(G,(H={},re(H,"".concat(G,"-disabled"),x),re(H,"".concat(G,"-focused"),P),re(H,"".concat(G,"-readonly"),_),re(H,"".concat(G,"-input-with-clear-btn"),o&&T&&M),H),!o1(t)&&u,p),X=(o||T)&&$e("span",{className:"".concat(r,"-suffix"),children:[V(),o]});B=$e("span",{className:ee,style:d,hidden:!o1(t)&&N,onClick:F,ref:L,children:[i&&I("span",{className:"".concat(r,"-prefix"),children:i}),w.exports.cloneElement(n,{style:null,value:M,hidden:null}),X]})}if(o1(t)){var Z="".concat(r,"-group"),Q="".concat(Z,"-addon"),le=He("".concat(r,"-wrapper"),Z,v),ne=He("".concat(r,"-group-wrapper"),u,m);return I("span",{className:ne,style:d,hidden:N,children:$e("span",{className:le,children:[s&&I("span",{className:Q,children:s}),w.exports.cloneElement(B,{style:null,hidden:null}),a&&I("span",{className:Q,children:a})]})})}return B},sfe=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],lfe=w.exports.forwardRef(function(e,t){var n=e.autoComplete,r=e.onChange,i=e.onFocus,o=e.onBlur,s=e.onPressEnter,a=e.onKeyDown,u=e.prefixCls,d=u===void 0?"rc-input":u,p=e.disabled,m=e.htmlSize,v=e.className,x=e.maxLength,_=e.suffix,P=e.showCount,k=e.type,T=k===void 0?"text":k,M=e.inputClassName,O=Rn(e,sfe),N=ki(e.defaultValue,{value:e.value}),L=Le(N,2),F=L[0],V=L[1],B=w.exports.useState(!1),H=Le(B,2),G=H[0],ee=H[1],X=w.exports.useRef(null),Z=function(xe){X.current&&ofe(X.current,xe)};w.exports.useImperativeHandle(t,function(){return{focus:Z,blur:function(){var xe;(xe=X.current)===null||xe===void 0||xe.blur()},setSelectionRange:function(xe,Te,Ee){var Ce;(Ce=X.current)===null||Ce===void 0||Ce.setSelectionRange(xe,Te,Ee)},select:function(){var xe;(xe=X.current)===null||xe===void 0||xe.select()},input:X.current}}),w.exports.useEffect(function(){ee(function(be){return be&&p?!1:be})},[p]);var Q=function(xe){e.value===void 0&&V(xe.target.value),X.current&&QO(X.current,xe,r)},le=function(xe){s&&xe.key==="Enter"&&s(xe),a==null||a(xe)},ne=function(xe){ee(!0),i==null||i(xe)},se=function(xe){ee(!1),o==null||o(xe)},oe=function(xe){V(""),Z(),X.current&&QO(X.current,xe,r)},he=function(){var xe=Ci(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]);return I("input",{autoComplete:n,...xe,onChange:Q,onFocus:ne,onBlur:se,onKeyDown:le,className:He(d,re({},"".concat(d,"-disabled"),p),M,!o1(e)&&!X7(e)&&v),ref:X,size:m,type:T})},_e=function(){var xe=Number(x)>0;if(_||P){var Te=JO(F),Ee=Pt(Te).length,Ce=nn(P)==="object"?P.formatter({value:Te,count:Ee,maxLength:x}):"".concat(Ee).concat(xe?" / ".concat(x):"");return $e(Tn,{children:[!!P&&I("span",{className:He("".concat(d,"-show-count-suffix"),re({},"".concat(d,"-show-count-has-suffix"),!!_)),children:Ce}),_]})}return null};return I(afe,{...O,prefixCls:d,className:v,inputElement:he(),handleReset:oe,value:JO(F),focused:G,triggerFocus:Z,suffix:_e(),disabled:p})});function Y7(e,t){var n=w.exports.useRef([]),r=function(){n.current.push(setTimeout(function(){var o,s,a,u;((o=e.current)===null||o===void 0?void 0:o.input)&&((s=e.current)===null||s===void 0?void 0:s.input.getAttribute("type"))==="password"&&((a=e.current)===null||a===void 0?void 0:a.input.hasAttribute("value"))&&((u=e.current)===null||u===void 0||u.input.removeAttribute("value"))}))};return w.exports.useEffect(function(){return t&&r(),function(){return n.current.forEach(function(i){i&&clearTimeout(i)})}},[]),r}function ufe(e){return!!(e.prefix||e.suffix||e.allowClear)}var cfe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"||e===null?"":String(e)}function HC(e,t,n,r){if(!!n){var i=t;if(t.type==="click"){var o=e.cloneNode(!0);i=Object.create(t,{target:{value:o},currentTarget:{value:o}}),o.value="",n(i);return}if(r!==void 0){i=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,n(i);return}n(i)}}function ffe(e,t){if(!!e){e.focus(t);var n=t||{},r=n.cursor;if(r){var i=e.value.length;switch(r){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(i,i);break;default:e.setSelectionRange(0,i);break}}}}var hfe=w.exports.forwardRef(function(e,t){var n,r,i,o=e.prefixCls,s=e.bordered,a=s===void 0?!0:s,u=e.status,d=e.size,p=e.disabled,m=e.onBlur,v=e.onFocus,x=e.suffix,_=e.allowClear,P=e.addonAfter,k=e.addonBefore,T=e.className,M=e.onChange,O=cfe(e,["prefixCls","bordered","status","size","disabled","onBlur","onFocus","suffix","allowClear","addonAfter","addonBefore","className","onChange"]),N=Un.useContext(On),L=N.getPrefixCls,F=N.direction,V=N.input,B=L("input",o),H=w.exports.useRef(null),G=xf(B,F),ee=G.compactSize,X=G.compactItemClassnames,Z=Un.useContext(Hs),Q=ee||d||Z,le=Un.useContext(Il),ne=p!=null?p:le,se=w.exports.useContext(ga),oe=se.status,he=se.hasFeedback,_e=se.feedbackIcon,be=Cp(oe,u),xe=ufe(e)||!!he,Te=w.exports.useRef(xe);w.exports.useEffect(function(){xe&&Te.current,Te.current=xe},[xe]);var Ee=Y7(H,!0),Ce=function(lt){Ee(),m==null||m(lt)},ke=function(lt){Ee(),v==null||v(lt)},De=function(lt){Ee(),M==null||M(lt)},Ke=(he||x)&&$e(Tn,{children:[x,he&&_e]}),Ue;return nn(_)==="object"&&(_==null?void 0:_.clearIcon)?Ue=_:_&&(Ue={clearIcon:I(yf,{})}),I(lfe,{ref:Zo(t,H),prefixCls:B,autoComplete:V==null?void 0:V.autoComplete,...O,disabled:ne||void 0,onBlur:Ce,onFocus:ke,suffix:Ke,allowClear:Ue,className:He(T,X),onChange:De,addonAfter:P&&I(rp,{children:I(mv,{override:!0,status:!0,children:P})}),addonBefore:k&&I(rp,{children:I(mv,{override:!0,status:!0,children:k})}),inputClassName:He((n={},re(n,"".concat(B,"-sm"),Q==="small"),re(n,"".concat(B,"-lg"),Q==="large"),re(n,"".concat(B,"-rtl"),F==="rtl"),re(n,"".concat(B,"-borderless"),!a),n),!xe&&Vs(B,be)),affixWrapperClassName:He((r={},re(r,"".concat(B,"-affix-wrapper-sm"),Q==="small"),re(r,"".concat(B,"-affix-wrapper-lg"),Q==="large"),re(r,"".concat(B,"-affix-wrapper-rtl"),F==="rtl"),re(r,"".concat(B,"-affix-wrapper-borderless"),!a),r),Vs("".concat(B,"-affix-wrapper"),be,he)),wrapperClassName:He(re({},"".concat(B,"-group-rtl"),F==="rtl")),groupClassName:He((i={},re(i,"".concat(B,"-group-wrapper-sm"),Q==="small"),re(i,"".concat(B,"-group-wrapper-lg"),Q==="large"),re(i,"".concat(B,"-group-wrapper-rtl"),F==="rtl"),i),Vs("".concat(B,"-group-wrapper"),be,he))})});const dT=hfe;var pfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"};const mfe=pfe;var Q7=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:mfe})})};Q7.displayName="EyeInvisibleOutlined";const gfe=w.exports.forwardRef(Q7);var vfe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i1&&arguments[1]!==void 0?arguments[1]:!1,n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&KC[n])return KC[n];var r=window.getComputedStyle(e),i=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),s=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),a=Pfe.map(function(d){return"".concat(d,":").concat(r.getPropertyValue(d))}).join(";"),u={sizingStyle:a,paddingSize:o,borderSize:s,boxSizing:i};return t&&n&&(KC[n]=u),u}function Tfe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;Qa||(Qa=document.createElement("textarea"),Qa.setAttribute("tab-index","-1"),Qa.setAttribute("aria-hidden","true"),document.body.appendChild(Qa)),e.getAttribute("wrap")?Qa.setAttribute("wrap",e.getAttribute("wrap")):Qa.removeAttribute("wrap");var i=Ife(e,t),o=i.paddingSize,s=i.borderSize,a=i.boxSizing,u=i.sizingStyle;Qa.setAttribute("style","".concat(u,";").concat(Efe)),Qa.value=e.value||e.placeholder||"";var d=void 0,p=void 0,m,v=Qa.scrollHeight;if(a==="border-box"?v+=s:a==="content-box"&&(v-=o),n!==null||r!==null){Qa.value=" ";var x=Qa.scrollHeight-o;n!==null&&(d=x*n,a==="border-box"&&(d=d+o+s),v=Math.max(d,v)),r!==null&&(p=x*r,a==="border-box"&&(p=p+o+s),m=v>p?"":"hidden",v=Math.min(p,v))}var _={height:v,overflowY:m,resize:"none"};return d&&(_.minHeight=d),p&&(_.maxHeight=p),_}var kfe=["prefixCls","onPressEnter","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],WC=0,GC=1,qC=2,Mfe=w.exports.forwardRef(function(e,t){var n=e.prefixCls,r=n===void 0?"rc-textarea":n;e.onPressEnter;var i=e.defaultValue,o=e.value,s=e.autoSize,a=e.onResize,u=e.className,d=e.style,p=e.disabled,m=e.onChange;e.onInternalAutoSize;var v=Rn(e,kfe),x=ki(i,{value:o,postState:function(Ee){return Ee!=null?Ee:""}}),_=Le(x,2),P=_[0],k=_[1],T=function(Ee){k(Ee.target.value),m==null||m(Ee)},M=w.exports.useRef();w.exports.useImperativeHandle(t,function(){return{textArea:M.current}});var O=w.exports.useMemo(function(){return s&&nn(s)==="object"?[s.minRows,s.maxRows]:[]},[s]),N=Le(O,2),L=N[0],F=N[1],V=!!s,B=function(){try{if(document.activeElement===M.current){var Ee=M.current,Ce=Ee.selectionStart,ke=Ee.selectionEnd,De=Ee.scrollTop;M.current.setSelectionRange(Ce,ke),M.current.scrollTop=De}}catch{}},H=w.exports.useState(qC),G=Le(H,2),ee=G[0],X=G[1],Z=w.exports.useState(),Q=Le(Z,2),le=Q[0],ne=Q[1],se=function(){X(WC)};wi(function(){V&&se()},[o,L,F,V]),wi(function(){if(ee===WC)X(GC);else if(ee===GC){var Te=Tfe(M.current,!1,L,F);X(qC),ne(Te)}else B()},[ee]);var oe=w.exports.useRef(),he=function(){ar.cancel(oe.current)},_e=function(Ee){ee===qC&&(a==null||a(Ee),s&&(he(),oe.current=ar(function(){se()})))};w.exports.useEffect(function(){return he},[]);var be=V?le:null,xe=fe(fe({},d),be);return(ee===WC||ee===GC)&&(xe.overflowY="hidden",xe.overflowX="hidden"),I(_u,{onResize:_e,disabled:!(s||a),children:I("textarea",{...v,ref:M,style:xe,className:He(r,u,re({},"".concat(r,"-disabled"),p)),disabled:p,value:P,onChange:T})})}),Rfe=function(e){ci(n,e);var t=di(n);function n(r){var i;Nr(this,n),i=t.call(this,r),i.resizableTextArea=void 0,i.focus=function(){i.resizableTextArea.textArea.focus()},i.saveTextArea=function(s){i.resizableTextArea=s},i.handleChange=function(s){var a=i.props.onChange;i.setValue(s.target.value),a&&a(s)},i.handleKeyDown=function(s){var a=i.props,u=a.onPressEnter,d=a.onKeyDown;s.keyCode===13&&u&&u(s),d&&d(s)};var o=typeof r.value>"u"||r.value===null?r.defaultValue:r.value;return i.state={value:o},i}return Lr(n,[{key:"setValue",value:function(i,o){"value"in this.props||this.setState({value:i},o)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I(Mfe,{...this.props,value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea})}}],[{key:"getDerivedStateFromProps",value:function(i){return"value"in i?{value:i.value}:null}}]),n}(w.exports.Component),Afe=Yo("text","input");function Dfe(e){return!!(e.addonBefore||e.addonAfter)}var Ofe=function(e){ci(n,e);var t=di(n);function n(){return Nr(this,n),t.apply(this,arguments)}return Lr(n,[{key:"renderClearIcon",value:function(i){var o,s=this.props,a=s.value,u=s.disabled,d=s.readOnly,p=s.handleReset,m=s.suffix,v=!u&&!d&&a,x="".concat(i,"-clear-icon");return I(yf,{onClick:p,onMouseDown:function(P){return P.preventDefault()},className:He((o={},re(o,"".concat(x,"-hidden"),!v),re(o,"".concat(x,"-has-suffix"),!!m),o),x),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(i,o,s){var a,u=this.props,d=u.value,p=u.allowClear,m=u.className,v=u.style,x=u.direction,_=u.bordered,P=u.hidden,k=u.status,T=s.status,M=s.hasFeedback;if(!p)return ui(o,{value:d});var O=He("".concat(i,"-affix-wrapper"),"".concat(i,"-affix-wrapper-textarea-with-clear-btn"),Vs("".concat(i,"-affix-wrapper"),Cp(T,k),M),(a={},re(a,"".concat(i,"-affix-wrapper-rtl"),x==="rtl"),re(a,"".concat(i,"-affix-wrapper-borderless"),!_),re(a,"".concat(m),!Dfe(this.props)&&m),a));return $e("span",{className:O,style:v,hidden:P,children:[ui(o,{style:null,value:d}),this.renderClearIcon(i)]})}},{key:"render",value:function(){var i=this;return I(ga.Consumer,{children:function(o){var s=i.props,a=s.prefixCls,u=s.inputType,d=s.element;if(u===Afe[0])return i.renderTextAreaWithClearIcon(a,d,o)}})}}]),n}(w.exports.Component);const Nfe=Ofe;var Lfe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);ir&&(i=t),i}var Ffe=w.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.bordered,o=i===void 0?!0:i,s=e.showCount,a=s===void 0?!1:s,u=e.maxLength,d=e.className,p=e.style,m=e.size,v=e.disabled,x=e.onCompositionStart,_=e.onCompositionEnd,P=e.onChange,k=e.status,T=Lfe(e,["prefixCls","bordered","showCount","maxLength","className","style","size","disabled","onCompositionStart","onCompositionEnd","onChange","status"]),M=w.exports.useContext(On),O=M.getPrefixCls,N=M.direction,L=w.exports.useContext(Hs),F=w.exports.useContext(Il),V=v!=null?v:F,B=w.exports.useContext(ga),H=B.status,G=B.hasFeedback,ee=B.isFormItemInput,X=B.feedbackIcon,Z=Cp(H,k),Q=w.exports.useRef(null),le=w.exports.useRef(null),ne=w.exports.useState(!1),se=Le(ne,2),oe=se[0],he=se[1],_e=w.exports.useRef(),be=w.exports.useRef(0),xe=ki(T.defaultValue,{value:T.value}),Te=Le(xe,2),Ee=Te[0],Ce=Te[1],ke=T.hidden,De=function(nt,qe){T.value===void 0&&(Ce(nt),qe==null||qe())},Ke=Number(u)>0,Ue=function(nt){he(!0),_e.current=Ee,be.current=nt.currentTarget.selectionStart,x==null||x(nt)},tt=function(nt){var qe;he(!1);var dt=nt.currentTarget.value;if(Ke){var _t=be.current>=u+1||be.current===((qe=_e.current)===null||qe===void 0?void 0:qe.length);dt=e5(_t,_e.current,dt,u)}dt!==Ee&&(De(dt),HC(nt.currentTarget,nt,P,dt)),_==null||_(nt)},lt=function(nt){var qe=nt.target.value;if(!oe&&Ke){var dt=nt.target.selectionStart>=u+1||nt.target.selectionStart===qe.length||!nt.target.selectionStart;qe=e5(dt,Ee,qe,u)}De(qe),HC(nt.currentTarget,nt,P,qe)},St=function(nt){var qe,dt,_t;De(""),(qe=Q.current)===null||qe===void 0||qe.focus(),HC((_t=(dt=Q.current)===null||dt===void 0?void 0:dt.resizableTextArea)===null||_t===void 0?void 0:_t.textArea,nt,P)},We=O("input",r);w.exports.useImperativeHandle(t,function(){var ut;return{resizableTextArea:(ut=Q.current)===null||ut===void 0?void 0:ut.resizableTextArea,focus:function(qe){var dt,_t;ffe((_t=(dt=Q.current)===null||dt===void 0?void 0:dt.resizableTextArea)===null||_t===void 0?void 0:_t.textArea,qe)},blur:function(){var qe;return(qe=Q.current)===null||qe===void 0?void 0:qe.blur()}}});var bt=I(Rfe,{...Ci(T,["allowClear"]),disabled:V,className:He((n={},re(n,"".concat(We,"-borderless"),!o),re(n,d,d&&!a),re(n,"".concat(We,"-sm"),L==="small"||m==="small"),re(n,"".concat(We,"-lg"),L==="large"||m==="large"),n),Vs(We,Z)),style:a?{resize:p==null?void 0:p.resize}:p,prefixCls:We,onCompositionStart:Ue,onChange:lt,onCompositionEnd:tt,ref:Q}),Qe=dfe(Ee);!oe&&Ke&&(T.value===null||T.value===void 0)&&(Qe=J7(Qe,u));var mt=I(Nfe,{disabled:V,...T,prefixCls:We,direction:N,inputType:"text",value:Qe,element:bt,handleReset:St,ref:le,bordered:o,status:k,style:a?void 0:p});if(a||G){var ct,wt=Pt(Qe).length,rt="";return nn(a)==="object"?rt=a.formatter({value:Qe,count:wt,maxLength:u}):rt="".concat(wt).concat(Ke?" / ".concat(u):""),$e("div",{hidden:ke,className:He("".concat(We,"-textarea"),(ct={},re(ct,"".concat(We,"-textarea-rtl"),N==="rtl"),re(ct,"".concat(We,"-textarea-show-count"),a),re(ct,"".concat(We,"-textarea-in-form-item"),ee),ct),Vs("".concat(We,"-textarea"),Z,G),d),style:p,"data-count":rt,children:[mt,G&&I("span",{className:"".concat(We,"-textarea-suffix"),children:X})]})}return mt});const eV=Ffe;var Jv=dT;Jv.Group=ife;Jv.Search=Sfe;Jv.TextArea=eV;Jv.Password=_fe;const tV=Jv;var zfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};const $fe=zfe;var nV=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:$fe})})};nV.displayName="UpOutlined";const Bfe=w.exports.forwardRef(nV);function K3(){return typeof BigInt=="function"}function Wd(e){var t=e.trim(),n=t.startsWith("-");n&&(t=t.slice(1)),t=t.replace(/(\.\d*[^0])0*$/,"$1").replace(/\.0*$/,"").replace(/^0+/,""),t.startsWith(".")&&(t="0".concat(t));var r=t||"0",i=r.split("."),o=i[0]||"0",s=i[1]||"0";o==="0"&&s==="0"&&(n=!1);var a=n?"-":"";return{negative:n,negativeStr:a,trimStr:r,integerStr:o,decimalStr:s,fullStr:"".concat(a).concat(r)}}function fT(e){var t=String(e);return!Number.isNaN(Number(t))&&t.includes("e")}function vv(e){var t=String(e);if(fT(e)){var n=Number(t.slice(t.indexOf("e-")+2)),r=t.match(/\.(\d+)/);return r!=null&&r[1]&&(n+=r[1].length),n}return t.includes(".")&&hT(t)?t.length-t.indexOf(".")-1:0}function X_(e){var t=String(e);if(fT(e)){if(e>Number.MAX_SAFE_INTEGER)return String(K3()?BigInt(e).toString():Number.MAX_SAFE_INTEGER);if(eNumber.MAX_SAFE_INTEGER)return new e(Number.MAX_SAFE_INTEGER);if(i0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":X_(this.number):this.origin}}]),e}(),Ufe=function(){function e(t){if(Nr(this,e),this.origin="",this.negative=void 0,this.integer=void 0,this.decimal=void 0,this.decimalLen=void 0,this.empty=void 0,this.nan=void 0,!t&&t!==0||!String(t).trim()){this.empty=!0;return}if(this.origin=String(t),t==="-"){this.nan=!0;return}var n=t;if(fT(n)&&(n=Number(n)),n=typeof n=="string"?n:X_(n),hT(n)){var r=Wd(n);this.negative=r.negative;var i=r.trimStr.split(".");this.integer=BigInt(i[0]);var o=i[1]||"0";this.decimal=BigInt(o),this.decimalLen=o.length}else this.nan=!0}return Lr(e,[{key:"getMark",value:function(){return this.negative?"-":""}},{key:"getIntegerStr",value:function(){return this.integer.toString()}},{key:"getDecimalStr",value:function(){return this.decimal.toString().padStart(this.decimalLen,"0")}},{key:"alignDecimal",value:function(n){var r="".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(n,"0"));return BigInt(r)}},{key:"negate",value:function(){var n=new e(this.toString());return n.negative=!n.negative,n}},{key:"add",value:function(n){if(this.isInvalidate())return new e(n);var r=new e(n);if(r.isInvalidate())return this;var i=Math.max(this.getDecimalStr().length,r.getDecimalStr().length),o=this.alignDecimal(i),s=r.alignDecimal(i),a=(o+s).toString(),u=Wd(a),d=u.negativeStr,p=u.trimStr,m="".concat(d).concat(p.padStart(i+1,"0"));return new e("".concat(m.slice(0,-i),".").concat(m.slice(-i)))}},{key:"isEmpty",value:function(){return this.empty}},{key:"isNaN",value:function(){return this.nan}},{key:"isInvalidate",value:function(){return this.isEmpty()||this.isNaN()}},{key:"equals",value:function(n){return this.toString()===(n==null?void 0:n.toString())}},{key:"lessEquals",value:function(n){return this.add(n.negate().toString()).toNumber()<=0}},{key:"toNumber",value:function(){return this.isNaN()?NaN:Number(this.toString())}},{key:"toString",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return n?this.isInvalidate()?"":Wd("".concat(this.getMark()).concat(this.getIntegerStr(),".").concat(this.getDecimalStr())).fullStr:this.origin}}]),e}();function As(e){return K3()?new Ufe(e):new Vfe(e)}function a1(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e==="")return"";var i=Wd(e),o=i.negativeStr,s=i.integerStr,a=i.decimalStr,u="".concat(t).concat(a),d="".concat(o).concat(s);if(n>=0){var p=Number(a[n]);if(p>=5&&!r){var m=As(e).add("".concat(o,"0.").concat("0".repeat(n)).concat(10-p));return a1(m.toString(),t,n,r)}return n===0?d:"".concat(d).concat(t).concat(a.padEnd(n,"0").slice(0,n))}return u===".0"?d:"".concat(d).concat(u)}var jfe=200,Hfe=600;function Kfe(e){var t=e.prefixCls,n=e.upNode,r=e.downNode,i=e.upDisabled,o=e.downDisabled,s=e.onStep,a=w.exports.useRef(),u=w.exports.useRef();u.current=s;var d=function(k,T){k.preventDefault(),u.current(T);function M(){u.current(T),a.current=setTimeout(M,jfe)}a.current=setTimeout(M,Hfe)},p=function(){clearTimeout(a.current)};if(w.exports.useEffect(function(){return p},[]),TI())return null;var m="".concat(t,"-handler"),v=He(m,"".concat(m,"-up"),re({},"".concat(m,"-up-disabled"),i)),x=He(m,"".concat(m,"-down"),re({},"".concat(m,"-down-disabled"),o)),_={unselectable:"on",role:"button",onMouseUp:p,onMouseLeave:p};return $e("div",{className:"".concat(m,"-wrap"),children:[I("span",{..._,onMouseDown:function(k){d(k,!0)},"aria-label":"Increase Value","aria-disabled":i,className:v,children:n||I("span",{unselectable:"on",className:"".concat(t,"-handler-up-inner")})}),I("span",{..._,onMouseDown:function(k){d(k,!1)},"aria-label":"Decrease Value","aria-disabled":o,className:x,children:r||I("span",{unselectable:"on",className:"".concat(t,"-handler-down-inner")})})]})}function Wfe(e,t){var n=w.exports.useRef(null);function r(){try{var o=e.selectionStart,s=e.selectionEnd,a=e.value,u=a.substring(0,o),d=a.substring(s);n.current={start:o,end:s,value:a,beforeTxt:u,afterTxt:d}}catch{}}function i(){if(e&&n.current&&t)try{var o=e.value,s=n.current,a=s.beforeTxt,u=s.afterTxt,d=s.start,p=o.length;if(o.endsWith(u))p=o.length-n.current.afterTxt.length;else if(o.startsWith(a))p=a.length;else{var m=a[d-1],v=o.indexOf(m,d-1);v!==-1&&(p=v+1)}e.setSelectionRange(p,p)}catch(x){Dr(!1,"Something warning of cursor restore. Please fire issue about this: ".concat(x.message))}}return[r,i]}const Gfe=function(){var e=w.exports.useRef(0),t=function(){ar.cancel(e.current)};return w.exports.useEffect(function(){return t},[]),function(n){t(),e.current=ar(function(){n()})}};var qfe=["prefixCls","className","style","min","max","step","defaultValue","value","disabled","readOnly","upHandler","downHandler","keyboard","controls","stringMode","parser","formatter","precision","decimalSeparator","onChange","onInput","onPressEnter","onStep"],n5=function(t,n){return t||n.isEmpty()?n.toString():n.toNumber()},r5=function(t){var n=As(t);return n.isInvalidate()?null:n},rV=w.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=r===void 0?"rc-input-number":r,o=e.className,s=e.style,a=e.min,u=e.max,d=e.step,p=d===void 0?1:d,m=e.defaultValue,v=e.value,x=e.disabled,_=e.readOnly,P=e.upHandler,k=e.downHandler,T=e.keyboard,M=e.controls,O=M===void 0?!0:M,N=e.stringMode,L=e.parser,F=e.formatter,V=e.precision,B=e.decimalSeparator,H=e.onChange,G=e.onInput,ee=e.onPressEnter,X=e.onStep,Z=Rn(e,qfe),Q="".concat(i,"-input"),le=w.exports.useRef(null),ne=w.exports.useState(!1),se=Le(ne,2),oe=se[0],he=se[1],_e=w.exports.useRef(!1),be=w.exports.useRef(!1),xe=w.exports.useRef(!1),Te=w.exports.useState(function(){return As(v!=null?v:m)}),Ee=Le(Te,2),Ce=Ee[0],ke=Ee[1];function De(Tt){v===void 0&&ke(Tt)}var Ke=w.exports.useCallback(function(Tt,Kt){if(!Kt)return V>=0?V:Math.max(vv(Tt),vv(p))},[V,p]),Ue=w.exports.useCallback(function(Tt){var Kt=String(Tt);if(L)return L(Kt);var Zt=Kt;return B&&(Zt=Zt.replace(B,".")),Zt.replace(/[^\w.-]+/g,"")},[L,B]),tt=w.exports.useRef(""),lt=w.exports.useCallback(function(Tt,Kt){if(F)return F(Tt,{userTyping:Kt,input:String(tt.current)});var Zt=typeof Tt=="number"?X_(Tt):Tt;if(!Kt){var ht=Ke(Zt,Kt);if(hT(Zt)&&(B||ht>=0)){var xn=B||".";Zt=a1(Zt,xn,ht)}}return Zt},[F,Ke,B]),St=w.exports.useState(function(){var Tt=m!=null?m:v;return Ce.isInvalidate()&&["string","number"].includes(nn(Tt))?Number.isNaN(Tt)?"":Tt:lt(Ce.toString(),!1)}),We=Le(St,2),bt=We[0],Qe=We[1];tt.current=bt;function mt(Tt,Kt){Qe(lt(Tt.isInvalidate()?Tt.toString(!1):Tt.toString(!Kt),Kt))}var ct=w.exports.useMemo(function(){return r5(u)},[u,V]),wt=w.exports.useMemo(function(){return r5(a)},[a,V]),rt=w.exports.useMemo(function(){return!ct||!Ce||Ce.isInvalidate()?!1:ct.lessEquals(Ce)},[ct,Ce]),ut=w.exports.useMemo(function(){return!wt||!Ce||Ce.isInvalidate()?!1:Ce.lessEquals(wt)},[wt,Ce]),nt=Wfe(le.current,oe),qe=Le(nt,2),dt=qe[0],_t=qe[1],Dt=function(Kt){return ct&&!Kt.lessEquals(ct)?ct:wt&&!wt.lessEquals(Kt)?wt:null},Nt=function(Kt){return!Dt(Kt)},jt=function(Kt,Zt){var ht=Kt,xn=Nt(ht)||ht.isEmpty();if(!ht.isEmpty()&&!Zt&&(ht=Dt(ht)||ht,xn=!0),!_&&!x&&xn){var bn=ht.toString(),tn=Ke(bn,Zt);return tn>=0&&(ht=As(a1(bn,".",tn)),Nt(ht)||(ht=As(a1(bn,".",tn,!0)))),ht.equals(Ce)||(De(ht),H==null||H(ht.isEmpty()?null:n5(N,ht)),v===void 0&&mt(ht,Zt)),ht}return Ce},Ve=Gfe(),Ze=function Tt(Kt){if(dt(),Qe(Kt),!be.current){var Zt=Ue(Kt),ht=As(Zt);ht.isNaN()||jt(ht,!0)}G==null||G(Kt),Ve(function(){var xn=Kt;L||(xn=Kt.replace(/。/g,".")),xn!==Kt&&Tt(xn)})},Yt=function(){be.current=!0},sn=function(){be.current=!1,Ze(le.current.value)},Gt=function(Kt){Ze(Kt.target.value)},zt=function(Kt){var Zt;if(!(Kt&&rt||!Kt&&ut)){_e.current=!1;var ht=As(xe.current?t5(p):p);Kt||(ht=ht.negate());var xn=(Ce||As(0)).add(ht.toString()),bn=jt(xn,!1);X==null||X(n5(N,bn),{offset:xe.current?t5(p):p,type:Kt?"up":"down"}),(Zt=le.current)===null||Zt===void 0||Zt.focus()}},Rt=function(Kt){var Zt=As(Ue(bt)),ht=Zt;Zt.isNaN()?ht=Ce:ht=jt(Zt,Kt),v!==void 0?mt(Ce,!1):ht.isNaN()||mt(ht,!1)},Qt=function(){_e.current=!0},pn=function(Kt){var Zt=Kt.which,ht=Kt.shiftKey;_e.current=!0,ht?xe.current=!0:xe.current=!1,Zt===kt.ENTER&&(be.current||(_e.current=!1),Rt(!1),ee==null||ee(Kt)),T!==!1&&!be.current&&[kt.UP,kt.DOWN].includes(Zt)&&(zt(kt.UP===Zt),Kt.preventDefault())},ot=function(){_e.current=!1,xe.current=!1},Lt=function(){Rt(!1),he(!1),_e.current=!1};return Pg(function(){Ce.isInvalidate()||mt(Ce,!1)},[V]),Pg(function(){var Tt=As(v);ke(Tt);var Kt=As(Ue(bt));(!Tt.equals(Kt)||!_e.current||F)&&mt(Tt,_e.current)},[v]),Pg(function(){F&&_t()},[bt]),$e("div",{className:He(i,o,(n={},re(n,"".concat(i,"-focused"),oe),re(n,"".concat(i,"-disabled"),x),re(n,"".concat(i,"-readonly"),_),re(n,"".concat(i,"-not-a-number"),Ce.isNaN()),re(n,"".concat(i,"-out-of-range"),!Ce.isInvalidate()&&!Nt(Ce)),n)),style:s,onFocus:function(){he(!0)},onBlur:Lt,onKeyDown:pn,onKeyUp:ot,onCompositionStart:Yt,onCompositionEnd:sn,onBeforeInput:Qt,children:[O&&I(Kfe,{prefixCls:i,upNode:P,downNode:k,upDisabled:rt,downDisabled:ut,onStep:zt}),I("div",{className:"".concat(Q,"-wrap"),children:I("input",{autoComplete:"off",role:"spinbutton","aria-valuemin":a,"aria-valuemax":u,"aria-valuenow":Ce.isInvalidate()?null:Ce.toString(),step:p,...Z,ref:Zo(le,t),className:Q,value:bt,onChange:Gt,disabled:x,readOnly:_})})]})});rV.displayName="InputNumber";var Zfe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i"u"?Z:I("span",{className:"".concat(H,"-handler-up-inner"),children:V.upIcon}),Q=typeof V.downIcon>"u"?Q:I("span",{className:"".concat(H,"-handler-down-inner"),children:V.downIcon}));var ne=w.exports.useContext(ga),se=ne.hasFeedback,oe=ne.status,he=ne.isFormItemInput,_e=ne.feedbackIcon,be=Cp(oe,F),xe=ee||x||s,Te=w.exports.useContext(Il),Ee=_!=null?_:Te,Ce=He((n={},re(n,"".concat(H,"-lg"),xe==="large"),re(n,"".concat(H,"-sm"),xe==="small"),re(n,"".concat(H,"-rtl"),o==="rtl"),re(n,"".concat(H,"-borderless"),!N),re(n,"".concat(H,"-in-form-item"),he),n),Vs(H,be),X,v),ke=I(rV,{ref:m,disabled:Ee,className:Ce,upHandler:Z,downHandler:Q,prefixCls:H,readOnly:L,controls:le,...B});if(M!=null||se){var De,Ke=He("".concat(H,"-affix-wrapper"),Vs("".concat(H,"-affix-wrapper"),be,se),(De={},re(De,"".concat(H,"-affix-wrapper-focused"),d),re(De,"".concat(H,"-affix-wrapper-disabled"),e.disabled),re(De,"".concat(H,"-affix-wrapper-sm"),s==="small"),re(De,"".concat(H,"-affix-wrapper-lg"),s==="large"),re(De,"".concat(H,"-affix-wrapper-rtl"),o==="rtl"),re(De,"".concat(H,"-affix-wrapper-readonly"),L),re(De,"".concat(H,"-affix-wrapper-borderless"),!N),re(De,"".concat(v),!(k||T)&&v),De));ke=$e("div",{className:Ke,style:e.style,onMouseUp:function(){return m.current.focus()},children:[M&&I("span",{className:"".concat(H,"-prefix"),children:M}),ui(ke,{style:null,value:e.value,onFocus:function(ct){var wt;p(!0),(wt=e.onFocus)===null||wt===void 0||wt.call(e,ct)},onBlur:function(ct){var wt;p(!1),(wt=e.onBlur)===null||wt===void 0||wt.call(e,ct)}}),se&&I("span",{className:"".concat(H,"-suffix"),children:_e})]})}if(k!=null||T!=null){var Ue,tt="".concat(H,"-group"),lt="".concat(tt,"-addon"),St=k?I("div",{className:lt,children:k}):null,We=T?I("div",{className:lt,children:T}):null,bt=He("".concat(H,"-wrapper"),tt,re({},"".concat(tt,"-rtl"),o==="rtl")),Qe=He("".concat(H,"-group-wrapper"),(Ue={},re(Ue,"".concat(H,"-group-wrapper-sm"),s==="small"),re(Ue,"".concat(H,"-group-wrapper-lg"),s==="large"),re(Ue,"".concat(H,"-group-wrapper-rtl"),o==="rtl"),Ue),Vs("".concat(H,"-group-wrapper"),be,se),v);ke=I("div",{className:Qe,style:e.style,children:$e("div",{className:bt,children:[St&&I(rp,{children:I(mv,{status:!0,override:!0,children:St})}),ui(ke,{style:null,disabled:Ee}),We&&I(rp,{children:I(mv,{status:!0,override:!0,children:We})})]})})}return ke});const iV=Xfe;var Yfe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M272.9 512l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L186.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H532c6.7 0 10.4-7.7 6.3-12.9L272.9 512zm304 0l265.4-339.1c4.1-5.2.4-12.9-6.3-12.9h-77.3c-4.9 0-9.6 2.3-12.6 6.1L490.8 492.3a31.99 31.99 0 000 39.5l255.3 326.1c3 3.9 7.7 6.1 12.6 6.1H836c6.7 0 10.4-7.7 6.3-12.9L576.9 512z"}}]},name:"double-left",theme:"outlined"};const Qfe=Yfe;var oV=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:Qfe})})};oV.displayName="DoubleLeftOutlined";const Jfe=w.exports.forwardRef(oV);var ehe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M533.2 492.3L277.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H188c-6.7 0-10.4 7.7-6.3 12.9L447.1 512 181.7 851.1A7.98 7.98 0 00188 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5zm304 0L581.9 166.1c-3-3.9-7.7-6.1-12.6-6.1H492c-6.7 0-10.4 7.7-6.3 12.9L751.1 512 485.7 851.1A7.98 7.98 0 00492 864h77.3c4.9 0 9.6-2.3 12.6-6.1l255.3-326.1c9.1-11.7 9.1-27.9 0-39.5z"}}]},name:"double-right",theme:"outlined"};const the=ehe;var aV=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:the})})};aV.displayName="DoubleRightOutlined";const nhe=w.exports.forwardRef(aV);var jm=function(t){var n,r="".concat(t.rootPrefixCls,"-item"),i=He(r,"".concat(r,"-").concat(t.page),(n={},re(n,"".concat(r,"-active"),t.active),re(n,"".concat(r,"-disabled"),!t.page),re(n,t.className,!!t.className),n)),o=function(){t.onClick(t.page)},s=function(u){t.onKeyPress(u,t.onClick,t.page)};return I("li",{title:t.showTitle?t.page:null,className:i,onClick:o,onKeyPress:s,tabIndex:"0",children:t.itemRender(t.page,"page",I("a",{rel:"nofollow",children:t.page}))})};const Cd={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40};var sV=function(e){ci(n,e);var t=di(n);function n(){var r;Nr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s=0||a.relatedTarget.className.indexOf("".concat(m,"-item"))>=0))&&p(r.getValidValue()))},r.go=function(a){var u=r.state.goInputText;u!==""&&(a.keyCode===Cd.ENTER||a.type==="click")&&(r.setState({goInputText:""}),r.props.quickGo(r.getValidValue()))},r}return Lr(n,[{key:"getValidValue",value:function(){var i=this.state.goInputText;return!i||isNaN(i)?void 0:Number(i)}},{key:"getPageSizeOptions",value:function(){var i=this.props,o=i.pageSize,s=i.pageSizeOptions;return s.some(function(a){return a.toString()===o.toString()})?s:s.concat([o.toString()]).sort(function(a,u){var d=isNaN(Number(a))?0:Number(a),p=isNaN(Number(u))?0:Number(u);return d-p})}},{key:"render",value:function(){var i=this,o=this.props,s=o.pageSize,a=o.locale,u=o.rootPrefixCls,d=o.changeSize,p=o.quickGo,m=o.goButton,v=o.selectComponentClass,x=o.buildOptionText,_=o.selectPrefixCls,P=o.disabled,k=this.state.goInputText,T="".concat(u,"-options"),M=v,O=null,N=null,L=null;if(!d&&!p)return null;var F=this.getPageSizeOptions();if(d&&M){var V=F.map(function(B,H){return I(M.Option,{value:B.toString(),children:(x||i.buildOptionText)(B)},H)});O=I(M,{disabled:P,prefixCls:_,showSearch:!1,className:"".concat(T,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(s||F[0]).toString(),onChange:this.changeSize,getPopupContainer:function(H){return H.parentNode},"aria-label":a.page_size,defaultOpen:!1,children:V})}return p&&(m&&(L=typeof m=="boolean"?I("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:P,className:"".concat(T,"-quick-jumper-button"),children:a.jump_to_confirm}):I("span",{onClick:this.go,onKeyUp:this.go,children:m})),N=$e("div",{className:"".concat(T,"-quick-jumper"),children:[a.jump_to,I("input",{disabled:P,type:"text",value:k,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur,"aria-label":a.page}),a.page,L]})),$e("li",{className:"".concat(T),children:[O,N]})}}]),n}(Un.Component);sV.defaultProps={pageSizeOptions:["10","20","50","100"]};const rhe={items_per_page:"\u6761/\u9875",jump_to:"\u8DF3\u81F3",jump_to_confirm:"\u786E\u5B9A",page:"\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",prev_5:"\u5411\u524D 5 \u9875",next_5:"\u5411\u540E 5 \u9875",prev_3:"\u5411\u524D 3 \u9875",next_3:"\u5411\u540E 3 \u9875",page_size:"\u9875\u7801"};function W3(){}function i5(e){var t=Number(e);return typeof t=="number"&&!isNaN(t)&&isFinite(t)&&Math.floor(t)===t}function ihe(e,t,n){return n}function Hu(e,t,n){var r=typeof e>"u"?t.pageSize:e;return Math.floor((n.total-1)/r)+1}var lV=function(e){ci(n,e);var t=di(n);function n(r){var i;Nr(this,n),i=t.call(this,r),i.getJumpPrevPage=function(){return Math.max(1,i.state.current-(i.props.showLessItems?3:5))},i.getJumpNextPage=function(){return Math.min(Hu(void 0,i.state,i.props),i.state.current+(i.props.showLessItems?3:5))},i.getItemIcon=function(d,p){var m=i.props.prefixCls,v=d||I("button",{type:"button","aria-label":p,className:"".concat(m,"-item-link")});return typeof d=="function"&&(v=Un.createElement(d,fe({},i.props))),v},i.savePaginationNode=function(d){i.paginationNode=d},i.isValid=function(d){var p=i.props.total;return i5(d)&&d!==i.state.current&&i5(p)&&p>0},i.shouldDisplayQuickJumper=function(){var d=i.props,p=d.showQuickJumper,m=d.total,v=i.state.pageSize;return m<=v?!1:p},i.handleKeyDown=function(d){(d.keyCode===Cd.ARROW_UP||d.keyCode===Cd.ARROW_DOWN)&&d.preventDefault()},i.handleKeyUp=function(d){var p=i.getValidValue(d),m=i.state.currentInputValue;p!==m&&i.setState({currentInputValue:p}),d.keyCode===Cd.ENTER?i.handleChange(p):d.keyCode===Cd.ARROW_UP?i.handleChange(p-1):d.keyCode===Cd.ARROW_DOWN&&i.handleChange(p+1)},i.handleBlur=function(d){var p=i.getValidValue(d);i.handleChange(p)},i.changePageSize=function(d){var p=i.state.current,m=Hu(d,i.state,i.props);p=p>m?m:p,m===0&&(p=i.state.current),typeof d=="number"&&("pageSize"in i.props||i.setState({pageSize:d}),"current"in i.props||i.setState({current:p,currentInputValue:p})),i.props.onShowSizeChange(p,d),"onChange"in i.props&&i.props.onChange&&i.props.onChange(p,d)},i.handleChange=function(d){var p=i.props,m=p.disabled,v=p.onChange,x=i.state,_=x.pageSize,P=x.current,k=x.currentInputValue;if(i.isValid(d)&&!m){var T=Hu(void 0,i.state,i.props),M=d;return d>T?M=T:d<1&&(M=1),"current"in i.props||i.setState({current:M}),M!==k&&i.setState({currentInputValue:M}),v(M,_),M}return P},i.prev=function(){i.hasPrev()&&i.handleChange(i.state.current-1)},i.next=function(){i.hasNext()&&i.handleChange(i.state.current+1)},i.jumpPrev=function(){i.handleChange(i.getJumpPrevPage())},i.jumpNext=function(){i.handleChange(i.getJumpNextPage())},i.hasPrev=function(){return i.state.current>1},i.hasNext=function(){return i.state.current2?m-2:0),x=2;x=s?u=s:u=Number(o),u}},{key:"getShowSizeChanger",value:function(){var i=this.props,o=i.showSizeChanger,s=i.total,a=i.totalBoundaryShowSizeChanger;return typeof o<"u"?o:s>a}},{key:"renderPrev",value:function(i){var o=this.props,s=o.prevIcon,a=o.itemRender,u=a(i,"prev",this.getItemIcon(s,"prev page")),d=!this.hasPrev();return w.exports.isValidElement(u)?w.exports.cloneElement(u,{disabled:d}):u}},{key:"renderNext",value:function(i){var o=this.props,s=o.nextIcon,a=o.itemRender,u=a(i,"next",this.getItemIcon(s,"next page")),d=!this.hasNext();return w.exports.isValidElement(u)?w.exports.cloneElement(u,{disabled:d}):u}},{key:"render",value:function(){var i=this,o=this.props,s=o.prefixCls,a=o.className,u=o.style,d=o.disabled,p=o.hideOnSinglePage,m=o.total,v=o.locale,x=o.showQuickJumper,_=o.showLessItems,P=o.showTitle,k=o.showTotal,T=o.simple,M=o.itemRender,O=o.showPrevNextJumpers,N=o.jumpPrevIcon,L=o.jumpNextIcon,F=o.selectComponentClass,V=o.selectPrefixCls,B=o.pageSizeOptions,H=this.state,G=H.current,ee=H.pageSize,X=H.currentInputValue;if(p===!0&&m<=ee)return null;var Z=Hu(void 0,this.state,this.props),Q=[],le=null,ne=null,se=null,oe=null,he=null,_e=x&&x.goButton,be=_?1:2,xe=G-1>0?G-1:0,Te=G+1m?m:G*ee])});if(T)return _e&&(typeof _e=="boolean"?he=I("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:v.jump_to_confirm}):he=I("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO,children:_e}),he=I("li",{title:P?"".concat(v.jump_to).concat(G,"/").concat(Z):null,className:"".concat(s,"-simple-pager"),children:he})),$e("ul",{className:He(s,"".concat(s,"-simple"),re({},"".concat(s,"-disabled"),d),a),style:u,ref:this.savePaginationNode,...Ee,children:[Ce,I("li",{title:P?v.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:He("".concat(s,"-prev"),re({},"".concat(s,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev(),children:this.renderPrev(xe)}),$e("li",{title:P?"".concat(G,"/").concat(Z):null,className:"".concat(s,"-simple-pager"),children:[I("input",{type:"text",value:X,disabled:d,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,onBlur:this.handleBlur,size:"3"}),I("span",{className:"".concat(s,"-slash"),children:"/"}),Z]}),I("li",{title:P?v.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:He("".concat(s,"-next"),re({},"".concat(s,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext(),children:this.renderNext(Te)}),he]});if(Z<=3+be*2){var ke={locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:P,itemRender:M};Z||Q.push(w.exports.createElement(jm,{...ke,key:"noPager",page:1,className:"".concat(s,"-item-disabled")}));for(var De=1;De<=Z;De+=1){var Ke=G===De;Q.push(w.exports.createElement(jm,{...ke,key:De,page:De,active:Ke}))}}else{var Ue=_?v.prev_3:v.prev_5,tt=_?v.next_3:v.next_5;O&&(le=I("li",{title:P?Ue:null,onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:He("".concat(s,"-jump-prev"),re({},"".concat(s,"-jump-prev-custom-icon"),!!N)),children:M(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(N,"prev page"))},"prev"),ne=I("li",{title:P?tt:null,tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:He("".concat(s,"-jump-next"),re({},"".concat(s,"-jump-next-custom-icon"),!!L)),children:M(this.getJumpNextPage(),"jump-next",this.getItemIcon(L,"next page"))},"next")),oe=I(jm,{locale:v,last:!0,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:Z,active:!1,showTitle:P,itemRender:M},Z),se=I(jm,{locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:1,active:!1,showTitle:P,itemRender:M},1);var lt=Math.max(1,G-be),St=Math.min(G+be,Z);G-1<=be&&(St=1+be*2),Z-G<=be&&(lt=Z-be*2);for(var We=lt;We<=St;We+=1){var bt=G===We;Q.push(I(jm,{locale:v,rootPrefixCls:s,onClick:this.handleChange,onKeyPress:this.runIfEnter,page:We,active:bt,showTitle:P,itemRender:M},We))}G-1>=be*2&&G!==1+2&&(Q[0]=w.exports.cloneElement(Q[0],{className:"".concat(s,"-item-after-jump-prev")}),Q.unshift(le)),Z-G>=be*2&&G!==Z-2&&(Q[Q.length-1]=w.exports.cloneElement(Q[Q.length-1],{className:"".concat(s,"-item-before-jump-next")}),Q.push(ne)),lt!==1&&Q.unshift(se),St!==Z&&Q.push(oe)}var Qe=!this.hasPrev()||!Z,mt=!this.hasNext()||!Z;return $e("ul",{className:He(s,a,re({},"".concat(s,"-disabled"),d)),style:u,ref:this.savePaginationNode,...Ee,children:[Ce,I("li",{title:P?v.prev_page:null,onClick:this.prev,tabIndex:Qe?null:0,onKeyPress:this.runIfEnterPrev,className:He("".concat(s,"-prev"),re({},"".concat(s,"-disabled"),Qe)),"aria-disabled":Qe,children:this.renderPrev(xe)}),Q,I("li",{title:P?v.next_page:null,onClick:this.next,tabIndex:mt?null:0,onKeyPress:this.runIfEnterNext,className:He("".concat(s,"-next"),re({},"".concat(s,"-disabled"),mt)),"aria-disabled":mt,children:this.renderNext(Te)}),I(sV,{disabled:d,locale:v,rootPrefixCls:s,selectComponentClass:F,selectPrefixCls:V,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:G,pageSize:ee,pageSizeOptions:B,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:_e})]})}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s={};if("current"in i&&(s.current=i.current,i.current!==o.current&&(s.currentInputValue=s.current)),"pageSize"in i&&i.pageSize!==o.pageSize){var a=o.current,u=Hu(i.pageSize,o,i);a=a>u?u:a,"current"in i||(s.current=a,s.currentInputValue=a),s.pageSize=i.pageSize}return s}}]),n}(Un.Component);lV.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:W3,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:W3,locale:rhe,style:{},itemRender:ihe,totalBoundaryShowSizeChanger:50};var uV=function(t){return I(vu,{...t,size:"small"})},cV=function(t){return I(vu,{...t,size:"middle"})};uV.Option=vu.Option;cV.Option=vu.Option;var ohe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i10&&arguments[10]!==void 0?arguments[10]:0,v=r/100*360*((360-s)/360),x=s===0?0:{bottom:0,top:180,left:90,right:-90}[a],_=(100-i)/100*n;return d==="round"&&i!==100&&(_+=p/2,_>=n&&(_=n-.01)),{stroke:typeof u=="string"?u:void 0,strokeDasharray:"".concat(n,"px ").concat(t),strokeDashoffset:_+m,transform:"rotate(".concat(o+v+x,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},pT=function(t){var n=t.id,r=t.prefixCls,i=t.steps,o=t.strokeWidth,s=t.trailWidth,a=t.gapDegree,u=a===void 0?0:a,d=t.gapPosition,p=t.trailColor,m=t.strokeLinecap,v=t.style,x=t.className,_=t.strokeColor,P=t.percent,k=Rn(t,Lhe),T=Nhe(n),M="".concat(T,"-gradient"),O=Hm/2-o/2,N=Math.PI*2*O,L=u>0?90+u/2:-90,F=N*((360-u)/360),V=nn(i)==="object"?i:{count:i,space:2},B=V.count,H=V.space,G=ZC(N,F,0,100,L,u,d,p,m,o),ee=d5(P),X=d5(_),Z=X.find(function(se){return se&&nn(se)==="object"}),Q=Ahe(),le=function(){var oe=0;return ee.map(function(he,_e){var be=X[_e]||X[X.length-1],xe=be&&nn(be)==="object"?"url(#".concat(M,")"):void 0,Te=ZC(N,F,oe,he,L,u,d,be,m,o);return oe+=he,I("circle",{className:"".concat(r,"-circle-path"),r:O,cx:0,cy:0,stroke:xe,strokeLinecap:m,strokeWidth:o,opacity:he===0?0:1,style:Te,ref:function(Ce){Q[_e]=Ce}},_e)}).reverse()},ne=function(){var oe=Math.round(B*(ee[0]/100)),he=100/B,_e=0;return new Array(B).fill(null).map(function(be,xe){var Te=xe<=oe-1?X[0]:p,Ee=Te&&nn(Te)==="object"?"url(#".concat(M,")"):void 0,Ce=ZC(N,F,_e,he,L,u,d,Te,"butt",o,H);return _e+=(F-Ce.strokeDashoffset+H)*100/F,I("circle",{className:"".concat(r,"-circle-path"),r:O,cx:0,cy:0,stroke:Ee,strokeWidth:o,opacity:1,style:Ce,ref:function(De){Q[xe]=De}},xe)})};return $e("svg",{className:He("".concat(r,"-circle"),x),viewBox:"".concat(-Hm/2," ").concat(-Hm/2," ").concat(Hm," ").concat(Hm),style:v,id:n,role:"presentation",...k,children:[Z&&I("defs",{children:I("linearGradient",{id:M,x1:"100%",y1:"0%",x2:"0%",y2:"0%",children:Object.keys(Z).sort(function(se,oe){return c5(se)-c5(oe)}).map(function(se,oe){return I("stop",{offset:se,stopColor:Z[se]},oe)})})}),!B&&I("circle",{className:"".concat(r,"-circle-trail"),r:O,cx:0,cy:0,stroke:p,strokeLinecap:m,strokeWidth:s||o,style:G}),B?ne():le()]})};pT.defaultProps=Rhe;pT.displayName="Circle";function Gd(e){return!e||e<0?0:e>100?100:e}function wb(e){var t=e.success,n=e.successPercent,r=n;return t&&"progress"in t&&(r=t.progress),t&&"percent"in t&&(r=t.percent),r}function Fhe(e){var t=e.percent,n=e.success,r=e.successPercent,i=Gd(wb({success:n,successPercent:r}));return[i,Gd(Gd(t)-i)]}function zhe(e){var t=e.success,n=t===void 0?{}:t,r=e.strokeColor,i=n.strokeColor;return[i||Oh.green,r||null]}var $he=function(t){var n=t.prefixCls,r=t.width,i=t.strokeWidth,o=t.trailColor,s=o===void 0?null:o,a=t.strokeLinecap,u=a===void 0?"round":a,d=t.gapPosition,p=t.gapDegree,m=t.type,v=t.children,x=t.success,_=r||120,P={width:_,height:_,fontSize:_*.15+6},k=i||6,T=d||m==="dashboard"&&"bottom"||void 0,M=function(){if(p||p===0)return p;if(m==="dashboard")return 75},O=Object.prototype.toString.call(t.strokeColor)==="[object Object]",N=zhe({success:x,strokeColor:t.strokeColor}),L=He("".concat(n,"-inner"),re({},"".concat(n,"-circle-gradient"),O));return $e("div",{className:L,style:P,children:[I(pT,{percent:Fhe(t),strokeWidth:k,trailWidth:k,strokeColor:N,strokeLinecap:u,trailColor:s,prefixCls:n,gapDegree:M(),gapPosition:T}),v]})};const Bhe=$he;var Vhe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=100?"success":Z||"normal"}function M(Z,Q){var le=t.format,ne=wb(t);if(!v)return null;var se,oe=le||function(_e){return"".concat(_e,"%")},he=_==="line";return le||Q!=="exception"&&Q!=="success"?se=oe(Gd(u),Gd(ne)):Q==="exception"?se=he?I(yf,{}):I(_p,{}):Q==="success"&&(se=he?I(O_,{}):I(HI,{})),I("span",{className:"".concat(Z,"-text"),title:typeof se=="string"?se:void 0,children:se})}var O=w.exports.useContext(On),N=O.getPrefixCls,L=O.direction,F=N("progress",r),V=T(),B=M(F,V),H=Array.isArray(s)?s[0]:s,G=typeof s=="string"||Array.isArray(s)?s:void 0,ee;_==="line"?ee=o?I(Ghe,{...t,strokeColor:G,prefixCls:F,steps:o,children:B}):I(Khe,{...t,strokeColor:H,prefixCls:F,direction:L,children:B}):(_==="circle"||_==="dashboard")&&(ee=I(Bhe,{...t,strokeColor:H,prefixCls:F,progressStatus:V,children:B}));var X=He(F,(n={},re(n,"".concat(F,"-").concat(_==="dashboard"&&"circle"||o&&"steps"||_),!0),re(n,"".concat(F,"-status-").concat(V),!0),re(n,"".concat(F,"-show-info"),v),re(n,"".concat(F,"-").concat(p),p),re(n,"".concat(F,"-rtl"),L==="rtl"),n),i);return I("div",{...Ci(P,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"]),className:X,role:"progressbar",children:ee})};const Yhe=Xhe;var _f=w.exports.createContext({min:0,max:0,direction:"ltr",step:1,includedStart:0,includedEnd:0,tabIndex:0});function q3(e,t,n){return(e-t)/(n-t)}function mT(e,t,n,r){var i=q3(t,n,r),o={};switch(e){case"rtl":o.right="".concat(i*100,"%"),o.transform="translateX(50%)";break;case"btt":o.bottom="".concat(i*100,"%"),o.transform="translateY(50%)";break;case"ttb":o.top="".concat(i*100,"%"),o.transform="translateY(-50%)";break;default:o.left="".concat(i*100,"%"),o.transform="translateX(-50%)";break}return o}function Eh(e,t){return Array.isArray(e)?e[t]:e}var Qhe=["prefixCls","value","valueIndex","onStartMove","style","render","dragging","onOffsetChange"],Jhe=w.exports.forwardRef(function(e,t){var n,r,i=e.prefixCls,o=e.value,s=e.valueIndex,a=e.onStartMove,u=e.style,d=e.render,p=e.dragging,m=e.onOffsetChange,v=Rn(e,Qhe),x=w.exports.useContext(_f),_=x.min,P=x.max,k=x.direction,T=x.disabled,M=x.range,O=x.tabIndex,N=x.ariaLabelForHandle,L=x.ariaLabelledByForHandle,F=x.ariaValueTextFormatterForHandle,V="".concat(i,"-handle"),B=function(Z){T||a(Z,s)},H=function(Z){if(!T){var Q=null;switch(Z.which||Z.keyCode){case kt.LEFT:Q=k==="ltr"||k==="btt"?-1:1;break;case kt.RIGHT:Q=k==="ltr"||k==="btt"?1:-1;break;case kt.UP:Q=k!=="ttb"?1:-1;break;case kt.DOWN:Q=k!=="ttb"?-1:1;break;case kt.HOME:Q="min";break;case kt.END:Q="max";break;case kt.PAGE_UP:Q=2;break;case kt.PAGE_DOWN:Q=-2;break}Q!==null&&(Z.preventDefault(),m(Q,s))}},G=mT(k,o,_,P),ee=I("div",{ref:t,className:He(V,(n={},re(n,"".concat(V,"-").concat(s+1),M),re(n,"".concat(V,"-dragging"),p),n)),style:fe(fe({},G),u),onMouseDown:B,onTouchStart:B,onKeyDown:H,tabIndex:T?null:Eh(O,s),role:"slider","aria-valuemin":_,"aria-valuemax":P,"aria-valuenow":o,"aria-disabled":T,"aria-label":Eh(N,s),"aria-labelledby":Eh(L,s),"aria-valuetext":(r=Eh(F,s))===null||r===void 0?void 0:r(o),...v});return d&&(ee=d(ee,{index:s,prefixCls:i,value:o,dragging:p})),ee}),epe=["prefixCls","style","onStartMove","onOffsetChange","values","handleRender","draggingIndex"],tpe=w.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.style,i=e.onStartMove,o=e.onOffsetChange,s=e.values,a=e.handleRender,u=e.draggingIndex,d=Rn(e,epe),p=w.exports.useRef({});return w.exports.useImperativeHandle(t,function(){return{focus:function(v){var x;(x=p.current[v])===null||x===void 0||x.focus()}}}),I(Tn,{children:s.map(function(m,v){return I(Jhe,{ref:function(_){_?p.current[v]=_:delete p.current[v]},dragging:u===v,prefixCls:n,style:Eh(r,v),value:m,valueIndex:v,onStartMove:i,onOffsetChange:o,render:a,...d},v)})})});function f5(e){var t="touches"in e?e.touches[0]:e;return{pageX:t.pageX,pageY:t.pageY}}function npe(e,t,n,r,i,o,s,a,u){var d=w.exports.useState(null),p=Le(d,2),m=p[0],v=p[1],x=w.exports.useState(-1),_=Le(x,2),P=_[0],k=_[1],T=w.exports.useState(n),M=Le(T,2),O=M[0],N=M[1],L=w.exports.useState(n),F=Le(L,2),V=F[0],B=F[1],H=w.exports.useRef(null),G=w.exports.useRef(null);w.exports.useEffect(function(){P===-1&&N(n)},[n,P]),w.exports.useEffect(function(){return function(){document.removeEventListener("mousemove",H.current),document.removeEventListener("mouseup",G.current),document.removeEventListener("touchmove",H.current),document.removeEventListener("touchend",G.current)}},[]);var ee=function(se,oe){O.some(function(he,_e){return he!==se[_e]})&&(oe!==void 0&&v(oe),N(se),s(se))},X=function(se,oe){if(se===-1){var he=V[0],_e=V[V.length-1],be=r-he,xe=i-_e,Te=oe*(i-r);Te=Math.max(Te,be),Te=Math.min(Te,xe);var Ee=o(he+Te);Te=Ee-he;var Ce=V.map(function(Ue){return Ue+Te});ee(Ce)}else{var ke=(i-r)*oe,De=Pt(O);De[se]=V[se];var Ke=u(De,ke,se,"dist");ee(Ke.values,Ke.value)}},Z=w.exports.useRef(X);Z.current=X;var Q=function(se,oe){se.stopPropagation();var he=n[oe];k(oe),v(he),B(n);var _e=f5(se),be=_e.pageX,xe=_e.pageY,Te=function(ke){ke.preventDefault();var De=f5(ke),Ke=De.pageX,Ue=De.pageY,tt=Ke-be,lt=Ue-xe,St=e.current.getBoundingClientRect(),We=St.width,bt=St.height,Qe;switch(t){case"btt":Qe=-lt/bt;break;case"ttb":Qe=lt/bt;break;case"rtl":Qe=-tt/We;break;default:Qe=tt/We}Z.current(oe,Qe)},Ee=function Ce(ke){ke.preventDefault(),document.removeEventListener("mouseup",Ce),document.removeEventListener("mousemove",Te),document.removeEventListener("touchend",Ce),document.removeEventListener("touchmove",Te),H.current=null,G.current=null,k(-1),a()};document.addEventListener("mouseup",Ee),document.addEventListener("mousemove",Te),document.addEventListener("touchend",Ee),document.addEventListener("touchmove",Te),H.current=Te,G.current=Ee},le=w.exports.useMemo(function(){var ne=Pt(n).sort(function(oe,he){return oe-he}),se=Pt(O).sort(function(oe,he){return oe-he});return ne.every(function(oe,he){return oe===se[he]})?O:n},[n,O]);return[P,m,le,Q]}function rpe(e){var t=e.prefixCls,n=e.style,r=e.start,i=e.end,o=e.index,s=e.onStartMove,a=w.exports.useContext(_f),u=a.direction,d=a.min,p=a.max,m=a.disabled,v=a.range,x="".concat(t,"-track"),_=q3(r,d,p),P=q3(i,d,p),k=function(O){!m&&s&&s(O,-1)},T={};switch(u){case"rtl":T.right="".concat(_*100,"%"),T.width="".concat(P*100-_*100,"%");break;case"btt":T.bottom="".concat(_*100,"%"),T.height="".concat(P*100-_*100,"%");break;case"ttb":T.top="".concat(_*100,"%"),T.height="".concat(P*100-_*100,"%");break;default:T.left="".concat(_*100,"%"),T.width="".concat(P*100-_*100,"%")}return I("div",{className:He(x,v&&"".concat(x,"-").concat(o+1)),style:fe(fe({},T),n),onMouseDown:k,onTouchStart:k})}function ipe(e){var t=e.prefixCls,n=e.style,r=e.values,i=e.startPoint,o=e.onStartMove,s=w.exports.useContext(_f),a=s.included,u=s.range,d=s.min,p=w.exports.useMemo(function(){if(!u){if(r.length===0)return[];var m=i!=null?i:d,v=r[0];return[{start:Math.min(m,v),end:Math.max(m,v)}]}for(var x=[],_=0;_3&&arguments[3]!==void 0?arguments[3]:"unit";if(typeof P=="number"){var M,O=_[k],N=O+P,L=[];r.forEach(function(G){L.push(G.value)}),L.push(e,t),L.push(a(O));var F=P>0?1:-1;T==="unit"?L.push(a(O+F*n)):L.push(a(N)),L=L.filter(function(G){return G!==null}).filter(function(G){return P<0?G<=O:G>=O}),T==="unit"&&(L=L.filter(function(G){return G!==O}));var V=T==="unit"?O:N;M=L[0];var B=Math.abs(M-V);if(L.forEach(function(G){var ee=Math.abs(G-V);ee1){var H=Pt(_);return H[k]=M,x(H,P-F,k,T)}return M}else{if(P==="min")return e;if(P==="max")return t}},p=function(_,P,k){var T=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unit",M=_[k],O=d(_,P,k,T);return{value:O,changed:O!==M}},m=function(_){return o===null&&_===0||typeof o=="number"&&_3&&arguments[3]!==void 0?arguments[3]:"unit",M=_.map(u),O=M[k],N=d(M,P,k,T);if(M[k]=N,i===!1){var L=o||0;k>0&&M[k-1]!==O&&(M[k]=Math.max(M[k],M[k-1]+L)),k0;H-=1)for(var G=!0;m(M[H]-M[H-1])&&G;){var ee=p(M,-1,H-1);M[H-1]=ee.value,G=ee.changed}for(var X=M.length-1;X>0;X-=1)for(var Z=!0;m(M[X]-M[X-1])&&Z;){var Q=p(M,-1,X-1);M[X-1]=Q.value,Z=Q.changed}for(var le=0;le=0?X:!1},[X,ct]),rt=w.exports.useMemo(function(){var ye=Object.keys(Ee||{});return ye.map(function(q){var J=Ee[q],pe={value:Number(q)};return J&&nn(J)==="object"&&!w.exports.isValidElement(J)&&("label"in J||"style"in J)?(pe.style=J.style,pe.label=J.label):pe.label=J,pe}).filter(function(q){var J=q.label;return J||typeof J=="number"}).sort(function(q,J){return q.value-J.value})},[Ee]),ut=upe(Qe,mt,ct,rt,G,wt),nt=Le(ut,2),qe=nt[0],dt=nt[1],_t=ki(O,{value:M}),Dt=Le(_t,2),Nt=Dt[0],jt=Dt[1],Ve=w.exports.useMemo(function(){var ye=Nt==null?[]:Array.isArray(Nt)?Nt:[Nt],q=Le(ye,1),J=q[0],pe=J===void 0?Qe:J,ce=Nt===null?[]:[pe];if(N){if(ce=Pt(ye),L||Nt===void 0){var we=L>=0?L+1:2;for(ce=ce.slice(0,we);ce.length=0&&St.current.focus(ye)}ot(null)},[pn]);var Tt=w.exports.useMemo(function(){return Z&&ct===null?!1:Z},[Z,ct]),Kt=function(){B==null||B(Yt(Ze.current))},Zt=npe(We,bt,Ve,Qe,mt,qe,sn,Kt,dt),ht=Le(Zt,4),xn=ht[0],bn=ht[1],tn=ht[2],Bt=ht[3],gt=function(q,J){Bt(q,J),V==null||V(Yt(Ze.current))},xt=xn!==-1;w.exports.useEffect(function(){if(!xt){var ye=Ve.lastIndexOf(bn);St.current.focus(ye)}},[xt]);var Vt=w.exports.useMemo(function(){return Pt(tn).sort(function(ye,q){return ye-q})},[tn]),qt=w.exports.useMemo(function(){return N?[Vt[0],Vt[Vt.length-1]]:[Qe,Vt[0]]},[Vt,N,Qe]),vn=Le(qt,2),Fn=vn[0],tr=vn[1];w.exports.useImperativeHandle(t,function(){return{focus:function(){St.current.focus(0)},blur:function(){var q=document,J=q.activeElement;We.current.contains(J)&&(J==null||J.blur())}}}),w.exports.useEffect(function(){d&&St.current.focus(0)},[]);var nr=w.exports.useMemo(function(){return{min:Qe,max:mt,direction:bt,disabled:u,step:ct,included:se,includedStart:Fn,includedEnd:tr,range:N,tabIndex:Ke,ariaLabelForHandle:Ue,ariaLabelledByForHandle:tt,ariaValueTextFormatterForHandle:lt}},[Qe,mt,bt,u,ct,se,Fn,tr,N,Ke,Ue,tt,lt]);return I(_f.Provider,{value:nr,children:$e("div",{ref:We,className:He(i,o,(n={},re(n,"".concat(i,"-disabled"),u),re(n,"".concat(i,"-vertical"),le),re(n,"".concat(i,"-horizontal"),!le),re(n,"".concat(i,"-with-marks"),rt.length),n)),style:s,onMouseDown:zt,children:[I("div",{className:"".concat(i,"-rail"),style:be}),I(ipe,{prefixCls:i,style:he,values:Vt,startPoint:oe,onStartMove:Tt?gt:null}),I(lpe,{prefixCls:i,marks:rt,dots:Ce,style:xe,activeStyle:Te}),I(tpe,{ref:St,prefixCls:i,style:_e,values:tn,draggingIndex:xn,onStartMove:gt,onOffsetChange:Lt,onFocus:p,onBlur:m,handleRender:ke}),I(ape,{prefixCls:i,marks:rt,onClick:Gt})]})})}),dpe=w.exports.forwardRef(function(e,t){var n=e.open,r=w.exports.useRef(null),i=w.exports.useRef(null);function o(){ar.cancel(i.current),i.current=null}function s(){i.current=ar(function(){var a;(a=r.current)===null||a===void 0||a.forcePopupAlign(),i.current=null})}return w.exports.useEffect(function(){return n?s():o(),o},[n,e.title]),I($i,{ref:Zo(r,t),...e})});const fpe=dpe;var hpe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i=n}function Cpe(e){return e&&nn(e)==="object"&&!Array.isArray(e)&&!w.exports.isValidElement(e)}function Spe(e){return typeof e=="string"?!0:vf(e)}var Epe=function(t){var n=t.ellipsis,r=t.rowType,i=t.children,o,s=n===!0?{showTitle:!0}:n;return s&&(s.showTitle||r==="header")&&(typeof i=="string"||typeof i=="number"?o=i.toString():w.exports.isValidElement(i)&&typeof i.props.children=="string"&&(o=i.props.children)),o};function Ppe(e,t){var n,r,i,o=e.prefixCls,s=e.className,a=e.record,u=e.index,d=e.renderIndex,p=e.dataIndex,m=e.render,v=e.children,x=e.component,_=x===void 0?"td":x,P=e.colSpan,k=e.rowSpan,T=e.fixLeft,M=e.fixRight,O=e.firstFixLeft,N=e.lastFixLeft,L=e.firstFixRight,F=e.lastFixRight,V=e.appendNode,B=e.additionalProps,H=B===void 0?{}:B,G=e.ellipsis,ee=e.align,X=e.rowType,Z=e.isSticky,Q=e.hovering,le=e.onHover,ne="".concat(o,"-cell"),se=w.exports.useContext(EV),oe=w.exports.useContext(CV),he=w.exports.useContext(Q_),_e=he.allColumnsFixedLeft,be=w.exports.useMemo(function(){if(Z3(v))return[v];var qe=wV(a,p),dt=qe,_t=void 0;if(m){var Dt=m(qe,a,d);Cpe(Dt)?(dt=Dt.children,_t=Dt.props,se.renderWithProps=!0):dt=Dt}return[dt,_t]},[se.renderWithProps?Math.random():0,v,p,se,a,m,d]),xe=Le(be,2),Te=xe[0],Ee=xe[1],Ce=Te;nn(Ce)==="object"&&!Array.isArray(Ce)&&!w.exports.isValidElement(Ce)&&(Ce=null),G&&(N||L)&&(Ce=I("span",{className:"".concat(ne,"-content"),children:Ce}));var ke=Ee||{},De=ke.colSpan,Ke=ke.rowSpan,Ue=ke.style,tt=ke.className,lt=Rn(ke,_pe),St=(n=De!==void 0?De:P)!==null&&n!==void 0?n:1,We=(r=Ke!==void 0?Ke:k)!==null&&r!==void 0?r:1;if(St===0||We===0)return null;var bt={},Qe=typeof T=="number"&&oe,mt=typeof M=="number"&&oe;Qe&&(bt.position="sticky",bt.left=T),mt&&(bt.position="sticky",bt.right=M);var ct={};ee&&(ct.textAlign=ee);var wt=function(dt){var _t;a&&le(u,u+We-1),H==null||(_t=H.onMouseEnter)===null||_t===void 0||_t.call(H,dt)},rt=function(dt){var _t;a&&le(-1,-1),H==null||(_t=H.onMouseLeave)===null||_t===void 0||_t.call(H,dt)},ut=Epe({rowType:X,ellipsis:G,children:Te}),nt=fe(fe(fe({title:ut},lt),H),{},{colSpan:St!==1?St:null,rowSpan:We!==1?We:null,className:He(ne,s,(i={},re(i,"".concat(ne,"-fix-left"),Qe&&oe),re(i,"".concat(ne,"-fix-left-first"),O&&oe),re(i,"".concat(ne,"-fix-left-last"),N&&oe),re(i,"".concat(ne,"-fix-left-all"),N&&_e&&oe),re(i,"".concat(ne,"-fix-right"),mt&&oe),re(i,"".concat(ne,"-fix-right-first"),L&&oe),re(i,"".concat(ne,"-fix-right-last"),F&&oe),re(i,"".concat(ne,"-ellipsis"),G),re(i,"".concat(ne,"-with-append"),V),re(i,"".concat(ne,"-fix-sticky"),(Qe||mt)&&Z&&oe),re(i,"".concat(ne,"-row-hover"),!Ee&&Q),i),H.className,tt),style:fe(fe(fe(fe({},H.style),ct),bt),Ue),onMouseEnter:wt,onMouseLeave:rt,ref:Spe(_)?t:null});return $e(_,{...nt,children:[V,Ce]})}var PV=w.exports.forwardRef(Ppe);PV.displayName="Cell";var Ipe=["expanded","className","hovering"],Tpe=w.exports.memo(PV,function(e,t){return t.shouldCellUpdate?Ipe.every(function(n){return e[n]===t[n]})&&!t.shouldCellUpdate(t.record,e.record):rf(e,t)}),n0=w.exports.forwardRef(function(e,t){var n=e.index,r=e.additionalProps,i=r===void 0?{}:r,o=e.colSpan,s=e.rowSpan,a=i.colSpan,u=i.rowSpan,d=o!=null?o:a,p=s!=null?s:u,m=bpe(SV,function(_){var P=wpe(n,p||1,_==null?void 0:_.startRow,_==null?void 0:_.endRow);return{onHover:_==null?void 0:_.onHover,hovering:P}}),v=m.onHover,x=m.hovering;return I(Tpe,{...e,colSpan:d,rowSpan:p,hovering:x,ref:t,onHover:v})});n0.displayName="WrappedCell";var Ml=w.exports.createContext(null);function gT(e,t,n,r,i){var o=n[e]||{},s=n[t]||{},a,u;o.fixed==="left"?a=r.left[e]:s.fixed==="right"&&(u=r.right[t]);var d=!1,p=!1,m=!1,v=!1,x=n[t+1],_=n[e-1];if(i==="rtl"){if(a!==void 0){var P=_&&_.fixed==="left";v=!P}else if(u!==void 0){var k=x&&x.fixed==="right";m=!k}}else if(a!==void 0){var T=x&&x.fixed==="left";d=!T}else if(u!==void 0){var M=_&&_.fixed==="right";p=!M}return{fixLeft:a,fixRight:u,lastFixLeft:d,firstFixRight:p,lastFixRight:m,firstFixLeft:v,isSticky:r.isSticky}}function IV(e){var t=e.cells,n=e.stickyOffsets,r=e.flattenColumns,i=e.rowComponent,o=e.cellComponent,s=e.onHeaderRow,a=e.index,u=w.exports.useContext(Ml),d=u.prefixCls,p=u.direction,m;s&&(m=s(t.map(function(x){return x.column}),a));var v=Y_(t.map(function(x){return x.column}));return I(i,{...m,children:t.map(function(x,_){var P=x.column,k=gT(x.colStart,x.colEnd,r,n,p),T;return P&&P.onHeaderCell&&(T=x.column.onHeaderCell(P)),w.exports.createElement(n0,{...x,ellipsis:P.ellipsis,align:P.align,component:o,prefixCls:d,key:v[_],...k,additionalProps:T,rowType:"header"})})})}IV.displayName="HeaderRow";function kpe(e){var t=[];function n(s,a){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t[u]=t[u]||[];var d=a,p=s.filter(Boolean).map(function(m){var v={key:m.key,className:m.className||"",children:m.title,column:m,colStart:d},x=1,_=m.children;return _&&_.length>0&&(x=n(_,d,u+1).reduce(function(P,k){return P+k},0),v.hasSubColumns=!0),"colSpan"in m&&(x=m.colSpan),"rowSpan"in m&&(v.rowSpan=m.rowSpan),v.colSpan=x,v.colEnd=v.colStart+x-1,t[u].push(v),d+=x,x});return p}n(e,0);for(var r=t.length,i=function(a){t[a].forEach(function(u){!("rowSpan"in u)&&!u.hasSubColumns&&(u.rowSpan=r-a)})},o=0;o1?Qe-1:0),ct=1;ct0?[].concat(Pt(t),Pt(X3(o).map(function(s){return fe({fixed:i},s)}))):[].concat(Pt(t),[fe(fe({},n),{},{fixed:i})])},[])}function zpe(e){return e.map(function(t){var n=t.fixed,r=Rn(t,Fpe),i=n;return n==="left"?i="right":n==="right"&&(i="left"),fe({fixed:i},r)})}function $pe(e,t){var n=e.prefixCls,r=e.columns,i=e.children,o=e.expandable,s=e.expandedKeys,a=e.columnTitle,u=e.getRowKey,d=e.onTriggerExpand,p=e.expandIcon,m=e.rowExpandable,v=e.expandIconColumnIndex,x=e.direction,_=e.expandRowByClick,P=e.columnWidth,k=e.fixed,T=w.exports.useMemo(function(){return r||vT(i)},[r,i]),M=w.exports.useMemo(function(){if(o){var L,F=T.slice();if(!F.includes(Sd)){var V=v||0;V>=0&&F.splice(V,0,Sd)}var B=F.indexOf(Sd);F=F.filter(function(X,Z){return X!==Sd||Z===B});var H=T[B],G;(k==="left"||k)&&!v?G="left":(k==="right"||k)&&v===T.length?G="right":G=H?H.fixed:null;var ee=(L={},re(L,Mg,{className:"".concat(n,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),re(L,"title",a),re(L,"fixed",G),re(L,"className","".concat(n,"-row-expand-icon-cell")),re(L,"width",P),re(L,"render",function(Z,Q,le){var ne=u(Q,le),se=s.has(ne),oe=m?m(Q):!0,he=p({prefixCls:n,expanded:se,expandable:oe,record:Q,onExpand:d});return _?I("span",{onClick:function(be){return be.stopPropagation()},children:he}):he}),L);return F.map(function(X){return X===Sd?ee:X})}return T.filter(function(X){return X!==Sd})},[o,T,u,s,p,x]),O=w.exports.useMemo(function(){var L=M;return t&&(L=t(L)),L.length||(L=[{render:function(){return null}}]),L},[t,M,x]),N=w.exports.useMemo(function(){return x==="rtl"?zpe(X3(O)):X3(O)},[O,x]);return[O,N]}function OV(e){var t=w.exports.useRef(e),n=w.exports.useState({}),r=Le(n,2),i=r[1],o=w.exports.useRef(null),s=w.exports.useRef([]);function a(u){s.current.push(u);var d=Promise.resolve();o.current=d,d.then(function(){if(o.current===d){var p=s.current,m=t.current;s.current=[],p.forEach(function(v){t.current=v(t.current)}),o.current=null,m!==t.current&&i({})}})}return w.exports.useEffect(function(){return function(){o.current=null}},[]),[t.current,a]}function Bpe(e){var t=w.exports.useRef(e||null),n=w.exports.useRef();function r(){window.clearTimeout(n.current)}function i(s){t.current=s,r(),n.current=window.setTimeout(function(){t.current=null,n.current=void 0},100)}function o(){return t.current}return w.exports.useEffect(function(){return r},[]),[i,o]}function Vpe(e,t,n){var r=w.exports.useMemo(function(){for(var i=[],o=[],s=0,a=0,u=0;u=0;a-=1){var u=t[a],d=n&&n[a],p=d&&d[Mg];if(u||p||s){var m=p||{};m.columnType;var v=Rn(m,Upe);i.unshift(I("col",{style:{width:u},...v},a)),s=!0}}return I("colgroup",{children:i})}function p5(e){var t=e.className,n=e.children;return I("div",{className:t,children:n})}var LV=w.exports.createContext({});function jpe(e){var t=e.className,n=e.index,r=e.children,i=e.colSpan,o=i===void 0?1:i,s=e.rowSpan,a=e.align,u=w.exports.useContext(Ml),d=u.prefixCls,p=u.direction,m=w.exports.useContext(LV),v=m.scrollColumnIndex,x=m.stickyOffsets,_=m.flattenColumns,P=n+o-1,k=P+1===v?o+1:o,T=gT(n,n+k-1,_,x,p);return I(n0,{className:t,index:n,component:"td",prefixCls:d,record:null,dataIndex:null,align:a,colSpan:k,rowSpan:s,render:function(){return r},...T})}var Hpe=["children"];function Kpe(e){var t=e.children,n=Rn(e,Hpe);return I("tr",{...n,children:t})}function J_(e){var t=e.children;return t}J_.Row=Kpe;J_.Cell=jpe;function ox(e){var t=e.children,n=e.stickyOffsets,r=e.flattenColumns,i=w.exports.useContext(Ml),o=i.prefixCls,s=r.length-1,a=r[s],u=w.exports.useMemo(function(){return{stickyOffsets:n,flattenColumns:r,scrollColumnIndex:a!=null&&a.scrollbar?s:null}},[a,r,s,n]);return I(LV.Provider,{value:u,children:I("tfoot",{className:"".concat(o,"-summary"),children:t})})}var FV=J_;function Wpe(e){var t,n=e.prefixCls,r=e.record,i=e.onExpand,o=e.expanded,s=e.expandable,a="".concat(n,"-row-expand-icon");if(!s)return I("span",{className:He(a,"".concat(n,"-row-spaced"))});var u=function(p){i(r,p),p.stopPropagation()};return I("span",{className:He(a,(t={},re(t,"".concat(n,"-row-expanded"),o),re(t,"".concat(n,"-row-collapsed"),!o),t)),onClick:u})}function Gpe(e,t,n){var r=[];function i(o){(o||[]).forEach(function(s,a){r.push(t(s,a)),i(s[n])})}return i(e),r}var qpe=function(t,n){var r,i,o=t.scrollBodyRef,s=t.onScroll,a=t.offsetScroll,u=t.container,d=w.exports.useContext(Ml),p=d.prefixCls,m=((r=o.current)===null||r===void 0?void 0:r.scrollWidth)||0,v=((i=o.current)===null||i===void 0?void 0:i.clientWidth)||0,x=m&&v*(v/m),_=w.exports.useRef(),P=OV({scrollLeft:0,isHiddenScrollBar:!1}),k=Le(P,2),T=k[0],M=k[1],O=w.exports.useRef({delta:0,x:0}),N=w.exports.useState(!1),L=Le(N,2),F=L[0],V=L[1],B=function(){V(!1)},H=function(Q){Q.persist(),O.current.delta=Q.pageX-T.scrollLeft,O.current.x=0,V(!0),Q.preventDefault()},G=function(Q){var le,ne=Q||((le=window)===null||le===void 0?void 0:le.event),se=ne.buttons;if(!F||se===0){F&&V(!1);return}var oe=O.current.x+Q.pageX-O.current.x-O.current.delta;oe<=0&&(oe=0),oe+x>=v&&(oe=v-x),s({scrollLeft:oe/v*(m+2)}),O.current.x=Q.pageX},ee=function(){if(!!o.current){var Q=H3(o.current).top,le=Q+o.current.offsetHeight,ne=u===window?document.documentElement.scrollTop+window.innerHeight:H3(u).top+u.clientHeight;le-bb()<=ne||Q>=ne-a?M(function(se){return fe(fe({},se),{},{isHiddenScrollBar:!0})}):M(function(se){return fe(fe({},se),{},{isHiddenScrollBar:!1})})}},X=function(Q){M(function(le){return fe(fe({},le),{},{scrollLeft:Q/m*v||0})})};return w.exports.useImperativeHandle(n,function(){return{setScrollLeft:X}}),w.exports.useEffect(function(){var Z=la(document.body,"mouseup",B,!1),Q=la(document.body,"mousemove",G,!1);return ee(),function(){Z.remove(),Q.remove()}},[x,F]),w.exports.useEffect(function(){var Z=la(u,"scroll",ee,!1),Q=la(window,"resize",ee,!1);return function(){Z.remove(),Q.remove()}},[u]),w.exports.useEffect(function(){T.isHiddenScrollBar||M(function(Z){var Q=o.current;return Q?fe(fe({},Z),{},{scrollLeft:Q.scrollLeft/Q.scrollWidth*Q.clientWidth}):Z})},[T.isHiddenScrollBar]),m<=v||!x||T.isHiddenScrollBar?null:I("div",{style:{height:bb(),width:v,bottom:a},className:"".concat(p,"-sticky-scroll"),children:I("div",{onMouseDown:H,ref:_,className:He("".concat(p,"-sticky-scroll-bar"),re({},"".concat(p,"-sticky-scroll-bar-active"),F)),style:{width:"".concat(x,"px"),transform:"translate3d(".concat(T.scrollLeft,"px, 0, 0)")}})})};const Zpe=w.exports.forwardRef(qpe);var m5=Mo()?window:null;function Xpe(e,t){var n=nn(e)==="object"?e:{},r=n.offsetHeader,i=r===void 0?0:r,o=n.offsetSummary,s=o===void 0?0:o,a=n.offsetScroll,u=a===void 0?0:a,d=n.getContainer,p=d===void 0?function(){return m5}:d,m=p()||m5;return w.exports.useMemo(function(){var v=!!e;return{isSticky:v,stickyClassName:v?"".concat(t,"-sticky-holder"):"",offsetHeader:i,offsetSummary:s,offsetScroll:u,container:m}},[u,i,s,t,m])}var Ype=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function Qpe(e,t){return w.exports.useMemo(function(){for(var n=[],r=0;r=0})},[o]),G=o[o.length-1],ee={fixed:G?G.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(O,"-cell-scrollbar")}}},X=w.exports.useMemo(function(){return F?[].concat(Pt(i),[ee]):i},[F,i]),Z=w.exports.useMemo(function(){return F?[].concat(Pt(o),[ee]):o},[F,o]),Q=w.exports.useMemo(function(){var ne=u.right,se=u.left;return fe(fe({},u),{},{left:d==="rtl"?[].concat(Pt(se.map(function(oe){return oe+F})),[0]):se,right:d==="rtl"?ne:[].concat(Pt(ne.map(function(oe){return oe+F})),[0]),isSticky:L})},[F,u,L]),le=Qpe(s,a);return I("div",{style:fe({overflow:"hidden"},L?{top:m,bottom:v}:{}),ref:B,className:He(n,re({},x,!!x)),children:$e("table",{style:{tableLayout:"fixed",visibility:r||le?null:"hidden"},children:[(!r||!P||H)&&I(NV,{colWidths:le?[].concat(Pt(le),[F]):[],columCount:a+1,columns:Z}),k(fe(fe({},T),{},{stickyOffsets:Q,columns:X,flattenColumns:Z}))]})})});Y3.displayName="FixedHolder";var Jpe=[],eme={},l1="rc-table-internal-hook",tme=w.exports.memo(function(e){var t=e.children;return t},function(e,t){return rf(e.props,t.props)?e.pingLeft!==t.pingLeft||e.pingRight!==t.pingRight:!1});function wf(e){var t,n=e.prefixCls,r=e.className,i=e.rowClassName,o=e.style,s=e.data,a=e.rowKey,u=e.scroll,d=e.tableLayout,p=e.direction,m=e.title,v=e.footer,x=e.summary,_=e.id,P=e.showHeader,k=e.components,T=e.emptyText,M=e.onRow,O=e.onHeaderRow,N=e.internalHooks,L=e.transformColumns,F=e.internalRefs,V=e.sticky,B=s||Jpe,H=!!B.length,G=w.exports.useCallback(function(Wn,rr){return wV(k||{},Wn)||rr},[k]),ee=w.exports.useMemo(function(){return typeof a=="function"?a:function(Wn){var rr=Wn&&Wn[a];return rr}},[a]),X=Npe(e),Z=X.expandIcon,Q=X.expandedRowKeys,le=X.defaultExpandedRowKeys,ne=X.defaultExpandAllRows,se=X.expandedRowRender,oe=X.columnTitle,he=X.onExpand,_e=X.onExpandedRowsChange,be=X.expandRowByClick,xe=X.rowExpandable,Te=X.expandIconColumnIndex,Ee=X.expandedRowClassName,Ce=X.childrenColumnName,ke=X.indentSize,De=Z||Wpe,Ke=Ce||"children",Ue=w.exports.useMemo(function(){return se?"row":e.expandable&&N===l1&&e.expandable.__PARENT_RENDER_ICON__||B.some(function(Wn){return Wn&&nn(Wn)==="object"&&Wn[Ke]})?"nest":!1},[!!se,B]),tt=w.exports.useState(function(){return le||(ne?Gpe(B,ee,Ke):[])}),lt=Le(tt,2),St=lt[0],We=lt[1],bt=w.exports.useMemo(function(){return new Set(Q||St||[])},[Q,St]),Qe=w.exports.useCallback(function(Wn){var rr=ee(Wn,B.indexOf(Wn)),Ur,Ui=bt.has(rr);Ui?(bt.delete(rr),Ur=Pt(bt)):Ur=[].concat(Pt(bt),[rr]),We(Ur),he&&he(!Ui,Wn),_e&&_e(Ur)},[ee,bt,B,he,_e]),mt=w.exports.useState(0),ct=Le(mt,2),wt=ct[0],rt=ct[1],ut=$pe(fe(fe(fe({},e),X),{},{expandable:!!se,columnTitle:oe,expandedKeys:bt,getRowKey:ee,onTriggerExpand:Qe,expandIcon:De,expandIconColumnIndex:Te,direction:p}),N===l1?L:null),nt=Le(ut,2),qe=nt[0],dt=nt[1],_t=w.exports.useMemo(function(){return{columns:qe,flattenColumns:dt}},[qe,dt]),Dt=w.exports.useRef(),Nt=w.exports.useRef(),jt=w.exports.useRef(),Ve=w.exports.useRef(),Ze=w.exports.useRef(),Yt=w.exports.useState(!1),sn=Le(Yt,2),Gt=sn[0],zt=sn[1],Rt=w.exports.useState(!1),Qt=Le(Rt,2),pn=Qt[0],ot=Qt[1],Lt=OV(new Map),Tt=Le(Lt,2),Kt=Tt[0],Zt=Tt[1],ht=Y_(dt),xn=ht.map(function(Wn){return Kt.get(Wn)}),bn=w.exports.useMemo(function(){return xn},[xn.join("_")]),tn=Vpe(bn,dt.length,p),Bt=u&&Z3(u.y),gt=u&&Z3(u.x)||Boolean(X.fixed),xt=gt&&dt.some(function(Wn){var rr=Wn.fixed;return rr}),Vt=w.exports.useRef(),qt=Xpe(V,n),vn=qt.isSticky,Fn=qt.offsetHeader,tr=qt.offsetSummary,nr=qt.offsetScroll,ye=qt.stickyClassName,q=qt.container,J=x==null?void 0:x(B),pe=(Bt||vn)&&w.exports.isValidElement(J)&&J.type===J_&&J.props.fixed,ce,we,Ae;Bt&&(we={overflowY:"scroll",maxHeight:u.y}),gt&&(ce={overflowX:"auto"},Bt||(we={overflowY:"hidden"}),Ae={width:(u==null?void 0:u.x)===!0?"auto":u==null?void 0:u.x,minWidth:"100%"});var Pe=w.exports.useCallback(function(Wn,rr){LI(Dt.current)&&Zt(function(Ur){if(Ur.get(Wn)!==rr){var Ui=new Map(Ur);return Ui.set(Wn,rr),Ui}return Ur})},[]),Me=Bpe(null),Be=Le(Me,2),Je=Be[0],et=Be[1];function Ge(Wn,rr){!rr||(typeof rr=="function"?rr(Wn):rr.scrollLeft!==Wn&&(rr.scrollLeft=Wn))}var Ut=function(rr){var Ur=rr.currentTarget,Ui=rr.scrollLeft,Gs=p==="rtl",Jo=typeof Ui=="number"?Ui:Ur.scrollLeft,Rl=Ur||eme;if(!et()||et()===Rl){var bs;Je(Rl),Ge(Jo,Nt.current),Ge(Jo,jt.current),Ge(Jo,Ze.current),Ge(Jo,(bs=Vt.current)===null||bs===void 0?void 0:bs.setScrollLeft)}if(Ur){var Pr=Ur.scrollWidth,_s=Ur.clientWidth;if(Pr===_s){zt(!1),ot(!1);return}Gs?(zt(-Jo0)):(zt(Jo>0),ot(Jo-1}var Sme=Cme,Eme=nw;function Pme(e,t){var n=this.__data__,r=Eme(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Ime=Pme,Tme=cme,kme=yme,Mme=_me,Rme=Sme,Ame=Ime;function Ep(e){var t=-1,n=e==null?0:e.length;for(this.clear();++ta))return!1;var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var m=-1,v=!0,x=n&Qve?new qve:void 0;for(o.set(e,t),o.set(t,e);++m-1&&e%1==0&&e-1&&e%1==0&&e<=aye}var KV=sye,lye=Zv,uye=KV,cye=Xv,dye="[object Arguments]",fye="[object Array]",hye="[object Boolean]",pye="[object Date]",mye="[object Error]",gye="[object Function]",vye="[object Map]",yye="[object Number]",xye="[object Object]",bye="[object RegExp]",_ye="[object Set]",wye="[object String]",Cye="[object WeakMap]",Sye="[object ArrayBuffer]",Eye="[object DataView]",Pye="[object Float32Array]",Iye="[object Float64Array]",Tye="[object Int8Array]",kye="[object Int16Array]",Mye="[object Int32Array]",Rye="[object Uint8Array]",Aye="[object Uint8ClampedArray]",Dye="[object Uint16Array]",Oye="[object Uint32Array]",ti={};ti[Pye]=ti[Iye]=ti[Tye]=ti[kye]=ti[Mye]=ti[Rye]=ti[Aye]=ti[Dye]=ti[Oye]=!0;ti[dye]=ti[fye]=ti[Sye]=ti[hye]=ti[Eye]=ti[pye]=ti[mye]=ti[gye]=ti[vye]=ti[yye]=ti[xye]=ti[bye]=ti[_ye]=ti[wye]=ti[Cye]=!1;function Nye(e){return cye(e)&&uye(e.length)&&!!ti[lye(e)]}var Lye=Nye;function Fye(e){return function(t){return e(t)}}var zye=Fye,Q3={exports:{}};(function(e,t){var n=x7,r=t&&!t.nodeType&&t,i=r&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var u=i&&i.require&&i.require("util").types;return u||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a})(Q3,Q3.exports);var $ye=Lye,Bye=zye,S5=Q3.exports,E5=S5&&S5.isTypedArray,Vye=E5?Bye(E5):$ye,WV=Vye,Uye=j0e,jye=J0e,Hye=rT,Kye=Sb.exports,Wye=oye,Gye=WV,qye=Object.prototype,Zye=qye.hasOwnProperty;function Xye(e,t){var n=Hye(e),r=!n&&jye(e),i=!n&&!r&&Kye(e),o=!n&&!r&&!i&&Gye(e),s=n||r||i||o,a=s?Uye(e.length,String):[],u=a.length;for(var d in e)(t||Zye.call(e,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Wye(d,u)))&&a.push(d);return a}var Yye=Xye,Qye=Object.prototype;function Jye(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Qye;return e===n}var exe=Jye;function txe(e,t){return function(n){return e(t(n))}}var nxe=txe,rxe=nxe,ixe=rxe(Object.keys,Object),oxe=ixe,axe=exe,sxe=oxe,lxe=Object.prototype,uxe=lxe.hasOwnProperty;function cxe(e){if(!axe(e))return sxe(e);var t=[];for(var n in Object(e))uxe.call(e,n)&&n!="constructor"&&t.push(n);return t}var dxe=cxe,fxe=BV,hxe=KV;function pxe(e){return e!=null&&hxe(e.length)&&!fxe(e)}var mxe=pxe,gxe=Yye,vxe=dxe,yxe=mxe;function xxe(e){return yxe(e)?gxe(e):vxe(e)}var bxe=xxe,_xe=R0e,wxe=V0e,Cxe=bxe;function Sxe(e){return _xe(e,Cxe,wxe)}var Exe=Sxe,P5=Exe,Pxe=1,Ixe=Object.prototype,Txe=Ixe.hasOwnProperty;function kxe(e,t,n,r,i,o){var s=n&Pxe,a=P5(e),u=a.length,d=P5(t),p=d.length;if(u!=p&&!s)return!1;for(var m=u;m--;){var v=a[m];if(!(s?v in t:Txe.call(t,v)))return!1}var x=o.get(e),_=o.get(t);if(x&&_)return x==t&&_==e;var P=!0;o.set(e,t),o.set(t,e);for(var k=s;++m0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=e.length,r=t.length;if(Math.abs(n-r)!==1)return{add:!1,key:null};function i(o,s){var a=new Map;o.forEach(function(d){a.set(d,!0)});var u=s.filter(function(d){return!a.has(d)});return u.length===1?u[0]:null}return n ").concat(t);return t}var QV=w.exports.forwardRef(function(e,t){var n=e.prefixCls,r=e.data;e.selectable,e.checkable;var i=e.expandedKeys,o=e.selectedKeys,s=e.checkedKeys,a=e.loadedKeys,u=e.loadingKeys,d=e.halfCheckedKeys,p=e.keyEntities,m=e.disabled,v=e.dragging,x=e.dragOverNodeKey,_=e.dropPosition,P=e.motion,k=e.height,T=e.itemHeight,M=e.virtual,O=e.focusable,N=e.activeItem,L=e.focused,F=e.tabIndex,V=e.onKeyDown,B=e.onFocus,H=e.onBlur,G=e.onActiveChange,ee=e.onListChangeStart,X=e.onListChangeEnd,Z=Rn(e,m1e),Q=w.exports.useRef(null),le=w.exports.useRef(null);w.exports.useImperativeHandle(t,function(){return{scrollTo:function(nt){Q.current.scrollTo(nt)},getIndentWidth:function(){return le.current.offsetWidth}}});var ne=w.exports.useState(i),se=Le(ne,2),oe=se[0],he=se[1],_e=w.exports.useState(r),be=Le(_e,2),xe=be[0],Te=be[1],Ee=w.exports.useState(r),Ce=Le(Ee,2),ke=Ce[0],De=Ce[1],Ke=w.exports.useState([]),Ue=Le(Ke,2),tt=Ue[0],lt=Ue[1],St=w.exports.useState(null),We=Le(St,2),bt=We[0],Qe=We[1],mt=w.exports.useRef(r);mt.current=r;function ct(){var ut=mt.current;Te(ut),De(ut),lt([]),Qe(null),X()}w.exports.useEffect(function(){he(i);var ut=p1e(oe,i);if(ut.key!==null)if(ut.add){var nt=xe.findIndex(function(jt){var Ve=jt.key;return Ve===ut.key}),qe=j5(B5(xe,r,ut.key),M,k,T),dt=xe.slice();dt.splice(nt+1,0,U5),De(dt),lt(qe),Qe("show")}else{var _t=r.findIndex(function(jt){var Ve=jt.key;return Ve===ut.key}),Dt=j5(B5(r,xe,ut.key),M,k,T),Nt=r.slice();Nt.splice(_t+1,0,U5),De(Nt),lt(Dt),Qe("hide")}else xe!==r&&(Te(r),De(r))},[i,r]),w.exports.useEffect(function(){v||ct()},[v]);var wt=P?ke:r,rt={expandedKeys:i,selectedKeys:o,loadedKeys:a,loadingKeys:u,checkedKeys:s,halfCheckedKeys:d,dragOverNodeKey:x,dropPosition:_,keyEntities:p};return $e(Tn,{children:[L&&N&&I("span",{style:V5,"aria-live":"assertive",children:v1e(N)}),I("div",{children:I("input",{style:V5,disabled:O===!1||m,tabIndex:O!==!1?F:null,onKeyDown:V,onFocus:B,onBlur:H,value:"",onChange:g1e,"aria-label":"for screen reader"})}),I("div",{className:"".concat(n,"-treenode"),"aria-hidden":!0,style:{position:"absolute",pointerEvents:"none",visibility:"hidden",height:0,overflow:"hidden",border:0,padding:0},children:I("div",{className:"".concat(n,"-indent"),children:I("div",{ref:le,className:"".concat(n,"-indent-unit")})})}),I($I,{...Z,data:wt,itemKey:H5,height:k,fullHeight:!1,virtual:M,itemHeight:T,prefixCls:"".concat(n,"-list"),ref:Q,onVisibleChange:function(nt,qe){var dt=new Set(nt),_t=qe.filter(function(Dt){return!dt.has(Dt)});_t.some(function(Dt){return H5(Dt)===af})&&ct()},children:function(ut){var nt=ut.pos,qe=ze({},(ZV(ut.data),ut.data)),dt=ut.title,_t=ut.key,Dt=ut.isStart,Nt=ut.isEnd,jt=Yv(_t,nt);delete qe.key,delete qe.children;var Ve=Tg(jt,rt);return I(h1e,{...qe,...Ve,title:dt,active:!!N&&_t===N.key,pos:nt,data:ut.data,isStart:Dt,isEnd:Nt,motion:P,motionNodes:_t===af?tt:null,motionType:bt,onMotionStart:ee,onMotionEnd:ct,treeNodeRequiredProps:rt,onMouseMove:function(){G(null)}})}})]})});QV.displayName="NodeList";function y1e(e){var t=e.dropPosition,n=e.dropLevelOffset,r=e.indent,i={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(t){case-1:i.top=0,i.left=-n*r;break;case 1:i.bottom=0,i.left=-n*r;break;case 0:i.bottom=0,i.left=r;break}return I("div",{style:i})}var x1e=10,aw=function(e){ci(n,e);var t=di(n);function n(){var r;Nr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s2&&arguments[2]!==void 0?arguments[2]:!1,m=r.state,v=m.dragChildrenKeys,x=m.dropPosition,_=m.dropTargetKey,P=m.dropTargetPos,k=m.dropAllowed;if(!!k){var T=r.props.onDrop;if(r.setState({dragOverNodeKey:null}),r.cleanDragState(),_!==null){var M=fe(fe({},Tg(_,r.getTreeNodeRequiredProps())),{},{active:((d=r.getActiveItem())===null||d===void 0?void 0:d.key)===_,data:r.state.keyEntities[_].node}),O=v.indexOf(_)!==-1;Dr(!O,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var N=aT(P),L={event:a,node:Fi(M),dragNode:r.dragNode?Fi(r.dragNode.props):null,dragNodesKeys:[r.dragNode.props.eventKey].concat(v),dropToGap:x!==0,dropPosition:x+Number(N[N.length-1])};p||T==null||T(L),r.dragNode=null}}},r.cleanDragState=function(){var a=r.state.draggingNodeKey;a!==null&&r.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),r.dragStartMousePosition=null,r.currentMouseOverDroppableNodeKey=null},r.triggerExpandActionExpand=function(a,u){var d=r.state,p=d.expandedKeys,m=d.flattenNodes,v=u.expanded,x=u.key,_=u.isLeaf;if(!(_||a.shiftKey||a.metaKey||a.ctrlKey)){var P=m.filter(function(T){return T.key===x})[0],k=Fi(fe(fe({},Tg(x,r.getTreeNodeRequiredProps())),{},{data:P.data}));r.setExpandedKeys(v?il(p,x):Gl(p,x)),r.onNodeExpand(a,k)}},r.onNodeClick=function(a,u){var d=r.props,p=d.onClick,m=d.expandAction;m==="click"&&r.triggerExpandActionExpand(a,u),p==null||p(a,u)},r.onNodeDoubleClick=function(a,u){var d=r.props,p=d.onDoubleClick,m=d.expandAction;m==="doubleClick"&&r.triggerExpandActionExpand(a,u),p==null||p(a,u)},r.onNodeSelect=function(a,u){var d=r.state.selectedKeys,p=r.state,m=p.keyEntities,v=p.fieldNames,x=r.props,_=x.onSelect,P=x.multiple,k=u.selected,T=u[v.key],M=!k;M?P?d=Gl(d,T):d=[T]:d=il(d,T);var O=d.map(function(N){var L=m[N];return L?L.node:null}).filter(function(N){return N});r.setUncontrolledState({selectedKeys:d}),_==null||_(d,{event:"select",selected:M,node:u,selectedNodes:O,nativeEvent:a.nativeEvent})},r.onNodeCheck=function(a,u,d){var p=r.state,m=p.keyEntities,v=p.checkedKeys,x=p.halfCheckedKeys,_=r.props,P=_.checkStrictly,k=_.onCheck,T=u.key,M,O={event:"check",node:u,checked:d,nativeEvent:a.nativeEvent};if(P){var N=d?Gl(v,T):il(v,T),L=il(x,T);M={checked:N,halfChecked:L},O.checkedNodes=N.map(function(ee){return m[ee]}).filter(function(ee){return ee}).map(function(ee){return ee.node}),r.setUncontrolledState({checkedKeys:N})}else{var F=uu([].concat(Pt(v),[T]),!0,m),V=F.checkedKeys,B=F.halfCheckedKeys;if(!d){var H=new Set(V);H.delete(T);var G=uu(Array.from(H),{checked:!1,halfCheckedKeys:B},m);V=G.checkedKeys,B=G.halfCheckedKeys}M=V,O.checkedNodes=[],O.checkedNodesPositions=[],O.halfCheckedKeys=B,V.forEach(function(ee){var X=m[ee];if(!!X){var Z=X.node,Q=X.pos;O.checkedNodes.push(Z),O.checkedNodesPositions.push({node:Z,pos:Q})}}),r.setUncontrolledState({checkedKeys:V},!1,{halfCheckedKeys:B})}k==null||k(M,O)},r.onNodeLoad=function(a){var u=a.key,d=new Promise(function(p,m){r.setState(function(v){var x=v.loadedKeys,_=x===void 0?[]:x,P=v.loadingKeys,k=P===void 0?[]:P,T=r.props,M=T.loadData,O=T.onLoad;if(!M||_.indexOf(u)!==-1||k.indexOf(u)!==-1)return null;var N=M(a);return N.then(function(){var L=r.state.loadedKeys,F=Gl(L,u);O==null||O(F,{event:"load",node:a}),r.setUncontrolledState({loadedKeys:F}),r.setState(function(V){return{loadingKeys:il(V.loadingKeys,u)}}),p()}).catch(function(L){if(r.setState(function(V){return{loadingKeys:il(V.loadingKeys,u)}}),r.loadingRetryTimes[u]=(r.loadingRetryTimes[u]||0)+1,r.loadingRetryTimes[u]>=x1e){var F=r.state.loadedKeys;Dr(!1,"Retry for `loadData` many times but still failed. No more retry."),r.setUncontrolledState({loadedKeys:Gl(F,u)}),p()}m(L)}),{loadingKeys:Gl(k,u)}})});return d.catch(function(){}),d},r.onNodeMouseEnter=function(a,u){var d=r.props.onMouseEnter;d==null||d({event:a,node:u})},r.onNodeMouseLeave=function(a,u){var d=r.props.onMouseLeave;d==null||d({event:a,node:u})},r.onNodeContextMenu=function(a,u){var d=r.props.onRightClick;d&&(a.preventDefault(),d({event:a,node:u}))},r.onFocus=function(){var a=r.props.onFocus;r.setState({focused:!0});for(var u=arguments.length,d=new Array(u),p=0;p1&&arguments[1]!==void 0?arguments[1]:!1,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!r.destroyed){var p=!1,m=!0,v={};Object.keys(a).forEach(function(x){if(x in r.props){m=!1;return}p=!0,v[x]=a[x]}),p&&(!u||m)&&r.setState(fe(fe({},v),d))}},r.scrollTo=function(a){r.listRef.current.scrollTo(a)},r}return Lr(n,[{key:"componentDidMount",value:function(){this.destroyed=!1,this.onUpdated()}},{key:"componentDidUpdate",value:function(){this.onUpdated()}},{key:"onUpdated",value:function(){var i=this.props.activeKey;i!==void 0&&i!==this.state.activeKey&&(this.setState({activeKey:i}),i!==null&&this.scrollTo({key:i}))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("dragend",this.onWindowDragEnd),this.destroyed=!0}},{key:"resetDragState",value:function(){this.setState({dragOverNodeKey:null,dropPosition:null,dropLevelOffset:null,dropTargetKey:null,dropContainerKey:null,dropTargetPos:null,dropAllowed:!1})}},{key:"render",value:function(){var i,o=this.state,s=o.focused,a=o.flattenNodes,u=o.keyEntities,d=o.draggingNodeKey,p=o.activeKey,m=o.dropLevelOffset,v=o.dropContainerKey,x=o.dropTargetKey,_=o.dropPosition,P=o.dragOverNodeKey,k=o.indent,T=this.props,M=T.prefixCls,O=T.className,N=T.style,L=T.showLine,F=T.focusable,V=T.tabIndex,B=V===void 0?0:V,H=T.selectable,G=T.showIcon,ee=T.icon,X=T.switcherIcon,Z=T.draggable,Q=T.checkable,le=T.checkStrictly,ne=T.disabled,se=T.motion,oe=T.loadData,he=T.filterTreeNode,_e=T.height,be=T.itemHeight,xe=T.virtual,Te=T.titleRender,Ee=T.dropIndicatorRender,Ce=T.onContextMenu,ke=T.onScroll,De=T.direction,Ke=T.rootClassName,Ue=T.rootStyle,tt=gu(this.props,{aria:!0,data:!0}),lt;return Z&&(nn(Z)==="object"?lt=Z:typeof Z=="function"?lt={nodeDraggable:Z}:lt={}),I(oT.Provider,{value:{prefixCls:M,selectable:H,showIcon:G,icon:ee,switcherIcon:X,draggable:lt,draggingNodeKey:d,checkable:Q,checkStrictly:le,disabled:ne,keyEntities:u,dropLevelOffset:m,dropContainerKey:v,dropTargetKey:x,dropPosition:_,dragOverNodeKey:P,indent:k,direction:De,dropIndicatorRender:Ee,loadData:oe,filterTreeNode:he,titleRender:Te,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop},children:I("div",{role:"tree",className:He(M,O,Ke,(i={},re(i,"".concat(M,"-show-line"),L),re(i,"".concat(M,"-focused"),s),re(i,"".concat(M,"-active-focused"),p!==null),i)),style:Ue,children:I(QV,{ref:this.listRef,prefixCls:M,style:N,data:a,disabled:ne,selectable:H,checkable:!!Q,motion:se,dragging:d!==null,height:_e,itemHeight:be,virtual:xe,focusable:F,focused:s,tabIndex:B,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Ce,onScroll:ke,...this.getTreeNodeRequiredProps(),...tt})})})}}],[{key:"getDerivedStateFromProps",value:function(i,o){var s=o.prevProps,a={prevProps:i};function u(F){return!s&&F in i||s&&s[F]!==i[F]}var d,p=o.fieldNames;if(u("fieldNames")&&(p=xb(i.fieldNames),a.fieldNames=p),u("treeData")?d=i.treeData:u("children")&&(Dr(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),d=P7(i.children)),d){a.treeData=d;var m=q_(d,{fieldNames:p});a.keyEntities=fe(re({},af,YV),m.keyEntities)}var v=a.keyEntities||o.keyEntities;if(u("expandedKeys")||s&&u("autoExpandParent"))a.expandedKeys=i.autoExpandParent||!s&&i.defaultExpandParent?U3(i.expandedKeys,v):i.expandedKeys;else if(!s&&i.defaultExpandAll){var x=fe({},v);delete x[af],a.expandedKeys=Object.keys(x).map(function(F){return x[F].key})}else!s&&i.defaultExpandedKeys&&(a.expandedKeys=i.autoExpandParent||i.defaultExpandParent?U3(i.defaultExpandedKeys,v):i.defaultExpandedKeys);if(a.expandedKeys||delete a.expandedKeys,d||a.expandedKeys){var _=BC(d||o.treeData,a.expandedKeys||o.expandedKeys,p);a.flattenNodes=_}if(i.selectable&&(u("selectedKeys")?a.selectedKeys=kO(i.selectedKeys,i):!s&&i.defaultSelectedKeys&&(a.selectedKeys=kO(i.defaultSelectedKeys,i))),i.checkable){var P;if(u("checkedKeys")?P=$C(i.checkedKeys)||{}:!s&&i.defaultCheckedKeys?P=$C(i.defaultCheckedKeys)||{}:d&&(P=$C(i.checkedKeys)||{checkedKeys:o.checkedKeys,halfCheckedKeys:o.halfCheckedKeys}),P){var k=P,T=k.checkedKeys,M=T===void 0?[]:T,O=k.halfCheckedKeys,N=O===void 0?[]:O;if(!i.checkStrictly){var L=uu(M,!0,v);M=L.checkedKeys,N=L.halfCheckedKeys}a.checkedKeys=M,a.halfCheckedKeys=N}}return u("loadedKeys")&&(a.loadedKeys=i.loadedKeys),a}}]),n}(w.exports.Component);aw.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[],dropIndicatorRender:y1e,allowDrop:function(){return!0},expandAction:!1};aw.TreeNode=of;var b1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"};const _1e=b1e;var JV=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:_1e})})};JV.displayName="HolderOutlined";const w1e=w.exports.forwardRef(JV);var K5=4;function C1e(e){var t,n=e.dropPosition,r=e.dropLevelOffset,i=e.prefixCls,o=e.indent,s=e.direction,a=s===void 0?"ltr":s,u=a==="ltr"?"left":"right",d=a==="ltr"?"right":"left",p=(t={},re(t,u,-r*o+K5),re(t,d,0),t);switch(n){case-1:p.top=-3;break;case 1:p.bottom=-3;break;default:p.bottom=-3,p[u]=o+K5;break}return I("div",{style:p,className:"".concat(i,"-drop-indicator")})}var S1e={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"filled"};const E1e=S1e;var eU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:E1e})})};eU.displayName="CaretDownFilled";const P1e=w.exports.forwardRef(eU);var I1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494z"}}]},name:"file",theme:"outlined"};const T1e=I1e;var tU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:T1e})})};tU.displayName="FileOutlined";const nU=w.exports.forwardRef(tU);var k1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"minus-square",theme:"outlined"};const M1e=k1e;var rU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:M1e})})};rU.displayName="MinusSquareOutlined";const R1e=w.exports.forwardRef(rU);var A1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"};const D1e=A1e;var iU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:D1e})})};iU.displayName="PlusSquareOutlined";const O1e=w.exports.forwardRef(iU);function oU(e,t,n,r){var i=r.isLeaf,o=r.expanded,s=r.loading;if(s)return I(Mc,{className:"".concat(e,"-switcher-loading-icon")});var a;if(n&&nn(n)==="object"&&(a=n.showLeafIcon),i){if(!n)return null;if(typeof a!="boolean"&&!!a){var u=typeof a=="function"?a(r):a,d="".concat(e,"-switcher-line-custom-icon");return Ro(u)?ui(u,{className:He(u.props.className||"",d)}):u}return a?I(nU,{className:"".concat(e,"-switcher-line-icon")}):I("span",{className:"".concat(e,"-switcher-leaf-line")})}var p="".concat(e,"-switcher-icon"),m=typeof t=="function"?t(r):t;return Ro(m)?ui(m,{className:He(m.props.className||"",p)}):m||(n?o?I(R1e,{className:"".concat(e,"-switcher-line-icon")}):I(O1e,{className:"".concat(e,"-switcher-line-icon")}):I(P1e,{className:p}))}var N1e=w.exports.forwardRef(function(e,t){var n,r=w.exports.useContext(On),i=r.getPrefixCls,o=r.direction,s=r.virtual,a=e.prefixCls,u=e.className,d=e.showIcon,p=d===void 0?!1:d,m=e.showLine,v=e.switcherIcon,x=e.blockNode,_=x===void 0?!1:x,P=e.children,k=e.checkable,T=k===void 0?!1:k,M=e.selectable,O=M===void 0?!0:M,N=e.draggable,L=e.motion,F=L===void 0?ze(ze({},np),{motionAppear:!1}):L,V=i("tree",a),B=ze(ze({},e),{checkable:T,selectable:O,showIcon:p,motion:F,blockNode:_,showLine:Boolean(m),dropIndicatorRender:C1e}),H=w.exports.useMemo(function(){if(!N)return!1;var G={};switch(nn(N)){case"function":G.nodeDraggable=N;break;case"object":G=ze({},N);break}return G.icon!==!1&&(G.icon=G.icon||I(w1e,{})),G},[N]);return I(aw,{itemHeight:20,ref:t,virtual:s,...B,prefixCls:V,className:He((n={},re(n,"".concat(V,"-icon-hide"),!p),re(n,"".concat(V,"-block-node"),_),re(n,"".concat(V,"-unselectable"),!O),re(n,"".concat(V,"-rtl"),o==="rtl"),n),u),direction:o,checkable:T&&I("span",{className:"".concat(V,"-checkbox-inner")}),selectable:O,switcherIcon:function(ee){return oU(V,v,m,ee)},draggable:H,children:P})});const aU=N1e;var L1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"};const F1e=L1e;var sU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:F1e})})};sU.displayName="FolderOpenOutlined";const z1e=w.exports.forwardRef(sU);var $1e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"};const B1e=$1e;var lU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:B1e})})};lU.displayName="FolderOutlined";const V1e=w.exports.forwardRef(lU);var Yl;(function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"})(Yl||(Yl={}));function xT(e,t){function n(r){var i=r.key,o=r.children;t(i,r)!==!1&&xT(o||[],t)}e.forEach(n)}function U1e(e){var t=e.treeData,n=e.expandedKeys,r=e.startKey,i=e.endKey,o=[],s=Yl.None;if(r&&r===i)return[r];if(!r||!i)return[];function a(u){return u===r||u===i}return xT(t,function(u){if(s===Yl.End)return!1;if(a(u)){if(o.push(u),s===Yl.None)s=Yl.Start;else if(s===Yl.Start)return s=Yl.End,!1}else s===Yl.Start&&o.push(u);return n.includes(u)}),o}function JC(e,t){var n=Pt(t),r=[];return xT(e,function(i,o){var s=n.indexOf(i);return s!==-1&&(r.push(o),n.splice(s,1)),!!n.length}),r}var W5=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&arguments[0]!==void 0?arguments[0]:{confirm:!1,closeDropdown:!1},Yt=Ze.confirm,sn=Ze.closeDropdown;Yt&<([]),sn&&X(!1),Ue(""),oe(L?(F||[]).map(function(Gt){return String(Gt)}):[])},bt=function(){var Ze=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{closeDropdown:!0},Yt=Ze.closeDropdown;Yt&&X(!1),lt(se())},Qe=function(Ze){Ze&&Q!==void 0&&oe(Q||[]),X(Ze),!Ze&&!i.filterDropdown&&St()},mt=He(re({},"".concat(o,"-menu-without-submenu"),!Q1e(i.filters||[]))),ct=function(Ze){if(Ze.target.checked){var Yt=Fh(i==null?void 0:i.filters).map(function(sn){return String(sn)});oe(Yt)}else oe([])},wt=function Ve(Ze){var Yt=Ze.filters;return(Yt||[]).map(function(sn,Gt){var zt=String(sn.value),Rt={title:sn.text,key:sn.value!==void 0?zt:Gt};return sn.children&&(Rt.children=Ve({filters:sn.children})),Rt})},rt=function Ve(Ze){var Yt;return ze(ze({},Ze),{text:Ze.title,value:Ze.key,children:((Yt=Ze.children)===null||Yt===void 0?void 0:Yt.map(function(sn){return Ve(sn)}))||[]})},ut;if(typeof i.filterDropdown=="function")ut=i.filterDropdown({prefixCls:"".concat(o,"-custom"),setSelectedKeys:function(Ze){return he({selectedKeys:Ze})},selectedKeys:se(),confirm:bt,clearFilters:We,filters:i.filters,visible:Z,close:function(){X(!1)}});else if(i.filterDropdown)ut=i.filterDropdown;else{var nt=se()||[],qe=function(){return(i.filters||[]).length===0?I(dl,{image:dl.PRESENTED_IMAGE_SIMPLE,description:_.filterEmptyText,imageStyle:{height:24},style:{margin:0,padding:"16px 0"}}):d==="tree"?$e(Tn,{children:[I(q5,{filterSearch:m,value:Ke,onChange:tt,tablePrefixCls:n,locale:_}),$e("div",{className:"".concat(n,"-filter-dropdown-tree"),children:[a?I(bc,{checked:nt.length===Fh(i.filters).length,indeterminate:nt.length>0&&nt.length0?o:e}),v=Math.ceil((o||e)/m.pageSize);m.current>v&&(m.current=v||1);var x=function(k,T){p({current:k!=null?k:1,pageSize:T||m.pageSize})},_=function(k,T){var M;t&&((M=t.onChange)===null||M===void 0||M.call(t,k,T)),x(k,T),n(k,T||(m==null?void 0:m.pageSize))};return t===!1?[{},function(){}]:[ze(ze({},m),{onChange:_}),x]}var Gu={},aE="SELECT_ALL",sE="SELECT_INVERT",lE="SELECT_NONE",Y5=[];function hU(e,t){var n=[];return(e||[]).forEach(function(r){n.push(r),r&&nn(r)==="object"&&t in r&&(n=[].concat(Pt(n),Pt(hU(r[t],t))))}),n}function abe(e,t){var n=e||{},r=n.preserveSelectedRowKeys,i=n.selectedRowKeys,o=n.defaultSelectedRowKeys,s=n.getCheckboxProps,a=n.onChange,u=n.onSelect,d=n.onSelectAll,p=n.onSelectInvert,m=n.onSelectNone,v=n.onSelectMultiple,x=n.columnWidth,_=n.type,P=n.selections,k=n.fixed,T=n.renderCell,M=n.hideSelectAll,O=n.checkStrictly,N=O===void 0?!0:O,L=t.prefixCls,F=t.data,V=t.pageData,B=t.getRecordByKey,H=t.getRowKey,G=t.expandType,ee=t.childrenColumnName,X=t.locale,Z=t.getPopupContainer,Q=ki(i||o||Y5,{value:i}),le=Le(Q,2),ne=le[0],se=le[1],oe=w.exports.useRef(new Map),he=w.exports.useCallback(function(rt){if(r){var ut=new Map;rt.forEach(function(nt){var qe=B(nt);!qe&&oe.current.has(nt)&&(qe=oe.current.get(nt)),ut.set(nt,qe)}),oe.current=ut}},[B,r]);w.exports.useEffect(function(){he(ne)},[ne]);var _e=w.exports.useMemo(function(){return N?{keyEntities:null}:q_(F,{externalGetKey:H,childrenPropName:ee})},[F,H,N,ee]),be=_e.keyEntities,xe=w.exports.useMemo(function(){return hU(V,ee)},[V,ee]),Te=w.exports.useMemo(function(){var rt=new Map;return xe.forEach(function(ut,nt){var qe=H(ut,nt),dt=(s?s(ut):null)||{};rt.set(qe,dt)}),rt},[xe,H,s]),Ee=w.exports.useCallback(function(rt){var ut;return!!(!((ut=Te.get(H(rt)))===null||ut===void 0)&&ut.disabled)},[Te,H]),Ce=w.exports.useMemo(function(){if(N)return[ne||[],[]];var rt=uu(ne,!0,be,Ee),ut=rt.checkedKeys,nt=rt.halfCheckedKeys;return[ut||[],nt]},[ne,N,be,Ee]),ke=Le(Ce,2),De=ke[0],Ke=ke[1],Ue=w.exports.useMemo(function(){var rt=_==="radio"?De.slice(0,1):De;return new Set(rt)},[De,_]),tt=w.exports.useMemo(function(){return _==="radio"?new Set:new Set(Ke)},[Ke,_]),lt=w.exports.useState(null),St=Le(lt,2),We=St[0],bt=St[1];w.exports.useEffect(function(){e||se(Y5)},[!!e]);var Qe=w.exports.useCallback(function(rt,ut){var nt,qe;he(rt),r?(nt=rt,qe=rt.map(function(dt){return oe.current.get(dt)})):(nt=[],qe=[],rt.forEach(function(dt){var _t=B(dt);_t!==void 0&&(nt.push(dt),qe.push(_t))})),se(nt),a==null||a(nt,qe,{type:ut})},[se,B,a,r]),mt=w.exports.useCallback(function(rt,ut,nt,qe){if(u){var dt=nt.map(function(_t){return B(_t)});u(B(rt),ut,dt,qe)}Qe(nt,"single")},[u,B,Qe]),ct=w.exports.useMemo(function(){if(!P||M)return null;var rt=P===!0?[aE,sE,lE]:P;return rt.map(function(ut){return ut===aE?{key:"all",text:X.selectionAll,onSelect:function(){Qe(F.map(function(qe,dt){return H(qe,dt)}).filter(function(qe){var dt=Te.get(qe);return!(dt!=null&&dt.disabled)||Ue.has(qe)}),"all")}}:ut===sE?{key:"invert",text:X.selectInvert,onSelect:function(){var qe=new Set(Ue);V.forEach(function(_t,Dt){var Nt=H(_t,Dt),jt=Te.get(Nt);jt!=null&&jt.disabled||(qe.has(Nt)?qe.delete(Nt):qe.add(Nt))});var dt=Array.from(qe);p&&p(dt),Qe(dt,"invert")}}:ut===lE?{key:"none",text:X.selectNone,onSelect:function(){m==null||m(),Qe(Array.from(Ue).filter(function(qe){var dt=Te.get(qe);return dt==null?void 0:dt.disabled}),"none")}}:ut}).map(function(ut){return ze(ze({},ut),{onSelect:function(){for(var qe,dt,_t=arguments.length,Dt=new Array(_t),Nt=0;Nt<_t;Nt++)Dt[Nt]=arguments[Nt];(dt=ut.onSelect)===null||dt===void 0||(qe=dt).call.apply(qe,[ut].concat(Dt)),bt(null)}})})},[P,Ue,V,H,p,Qe]),wt=w.exports.useCallback(function(rt){var ut;if(!e)return rt.filter(function(tn){return tn!==Gu});var nt=Pt(rt),qe=new Set(Ue),dt=xe.map(H).filter(function(tn){return!Te.get(tn).disabled}),_t=dt.every(function(tn){return qe.has(tn)}),Dt=dt.some(function(tn){return qe.has(tn)}),Nt=function(){var Bt=[];_t?dt.forEach(function(xt){qe.delete(xt),Bt.push(xt)}):dt.forEach(function(xt){qe.has(xt)||(qe.add(xt),Bt.push(xt))});var gt=Array.from(qe);d==null||d(!_t,gt.map(function(xt){return B(xt)}),Bt.map(function(xt){return B(xt)})),Qe(gt,"all"),bt(null)},jt;if(_!=="radio"){var Ve;if(ct){var Ze={getPopupContainer:Z,items:ct.map(function(tn,Bt){var gt=tn.key,xt=tn.text,Vt=tn.onSelect;return{key:gt||Bt,onClick:function(){Vt==null||Vt(dt)},label:xt}})};Ve=I("div",{className:"".concat(L,"-selection-extra"),children:I(qv,{menu:Ze,getPopupContainer:Z,children:I("span",{children:I(KI,{})})})})}var Yt=xe.map(function(tn,Bt){var gt=H(tn,Bt),xt=Te.get(gt)||{};return ze({checked:qe.has(gt)},xt)}).filter(function(tn){var Bt=tn.disabled;return Bt}),sn=!!Yt.length&&Yt.length===xe.length,Gt=sn&&Yt.every(function(tn){var Bt=tn.checked;return Bt}),zt=sn&&Yt.some(function(tn){var Bt=tn.checked;return Bt});jt=!M&&$e("div",{className:"".concat(L,"-selection"),children:[I(bc,{checked:sn?Gt:!!xe.length&&_t,indeterminate:sn?!Gt&&zt:!_t&&Dt,onChange:Nt,disabled:xe.length===0||sn,"aria-label":Ve?"Custom selection":"Select all",skipGroup:!0}),Ve]})}var Rt;_==="radio"?Rt=function(Bt,gt,xt){var Vt=H(gt,xt),qt=qe.has(Vt);return{node:I(C7,{...Te.get(Vt),checked:qt,onClick:function(Fn){return Fn.stopPropagation()},onChange:function(Fn){qe.has(Vt)||mt(Vt,!0,[Vt],Fn.nativeEvent)}}),checked:qt}}:Rt=function(Bt,gt,xt){var Vt,qt=H(gt,xt),vn=qe.has(qt),Fn=tt.has(qt),tr=Te.get(qt),nr;return G==="nest"?nr=Fn:nr=(Vt=tr==null?void 0:tr.indeterminate)!==null&&Vt!==void 0?Vt:Fn,{node:I(bc,{...tr,indeterminate:nr,checked:vn,skipGroup:!0,onClick:function(q){return q.stopPropagation()},onChange:function(q){var J=q.nativeEvent,pe=J.shiftKey,ce=-1,we=-1;if(pe&&N){var Ae=new Set([We,qt]);dt.some(function(Xt,En){if(Ae.has(Xt))if(ce===-1)ce=En;else return we=En,!0;return!1})}if(we!==-1&&ce!==we&&N){var Pe=dt.slice(ce,we+1),Me=[];vn?Pe.forEach(function(Xt){qe.has(Xt)&&(Me.push(Xt),qe.delete(Xt))}):Pe.forEach(function(Xt){qe.has(Xt)||(Me.push(Xt),qe.add(Xt))});var Be=Array.from(qe);v==null||v(!vn,Be.map(function(Xt){return B(Xt)}),Me.map(function(Xt){return B(Xt)})),Qe(Be,"multiple")}else{var Je=De;if(N){var et=vn?il(Je,qt):Gl(Je,qt);mt(qt,!vn,et,J)}else{var Ge=uu([].concat(Pt(Je),[qt]),!0,be,Ee),Ut=Ge.checkedKeys,Mt=Ge.halfCheckedKeys,at=Ut;if(vn){var $t=new Set(Ut);$t.delete(qt),at=uu(Array.from($t),{checked:!1,halfCheckedKeys:Mt},be,Ee).checkedKeys}mt(qt,!vn,at,J)}}bt(vn?null:qt)}}),checked:vn}};var Qt=function(Bt,gt,xt){var Vt=Rt(Bt,gt,xt),qt=Vt.node,vn=Vt.checked;return T?T(vn,gt,xt,qt):qt};if(!nt.includes(Gu))if(nt.findIndex(function(tn){var Bt;return((Bt=tn[Mg])===null||Bt===void 0?void 0:Bt.columnType)==="EXPAND_COLUMN"})===0){var pn=nt,ot=dI(pn),Lt=ot[0],Tt=ot.slice(1);nt=[Lt,Gu].concat(Pt(Tt))}else nt=[Gu].concat(Pt(nt));var Kt=nt.indexOf(Gu);nt=nt.filter(function(tn,Bt){return tn!==Gu||Bt===Kt});var Zt=nt[Kt-1],ht=nt[Kt+1],xn=k;xn===void 0&&((ht==null?void 0:ht.fixed)!==void 0?xn=ht.fixed:(Zt==null?void 0:Zt.fixed)!==void 0&&(xn=Zt.fixed)),xn&&Zt&&((ut=Zt[Mg])===null||ut===void 0?void 0:ut.columnType)==="EXPAND_COLUMN"&&Zt.fixed===void 0&&(Zt.fixed=xn);var bn=re({fixed:xn,width:x,className:"".concat(L,"-selection-column"),title:e.columnTitle||jt,render:Qt},Mg,{className:"".concat(L,"-selection-col")});return nt.map(function(tn){return tn===Gu?bn:tn})},[H,xe,e,De,Ue,tt,x,ct,G,We,Te,v,mt,Ee]);return[wt,Ue]}var sbe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"}}]},name:"caret-down",theme:"outlined"};const lbe=sbe;var pU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:lbe})})};pU.displayName="CaretDownOutlined";const ube=w.exports.forwardRef(pU);var cbe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M858.9 689L530.5 308.2c-9.4-10.9-27.5-10.9-37 0L165.1 689c-12.2 14.2-1.2 35 18.5 35h656.8c19.7 0 30.7-20.8 18.5-35z"}}]},name:"caret-up",theme:"outlined"};const dbe=cbe;var mU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:dbe})})};mU.displayName="CaretUpOutlined";const fbe=w.exports.forwardRef(mU);var u1="ascend",e2="descend";function Eb(e){return nn(e.sorter)==="object"&&typeof e.sorter.multiple=="number"?e.sorter.multiple:!1}function Q5(e){return typeof e=="function"?e:e&&nn(e)==="object"&&e.compare?e.compare:!1}function hbe(e,t){return t?e[e.indexOf(t)+1]:e[0]}function uE(e,t,n){var r=[];function i(o,s){r.push({column:o,key:ip(o,s),multiplePriority:Eb(o),sortOrder:o.sortOrder})}return(e||[]).forEach(function(o,s){var a=ew(s,n);o.children?("sortOrder"in o&&i(o,a),r=[].concat(Pt(r),Pt(uE(o.children,t,a)))):o.sorter&&("sortOrder"in o?i(o,a):t&&o.defaultSortOrder&&r.push({column:o,key:ip(o,a),multiplePriority:Eb(o),sortOrder:o.defaultSortOrder}))}),r}function gU(e,t,n,r,i,o,s,a){return(t||[]).map(function(u,d){var p=ew(d,a),m=u;if(m.sorter){var v=m.sortDirections||i,x=m.showSorterTooltip===void 0?s:m.showSorterTooltip,_=ip(m,p),P=n.find(function(G){var ee=G.key;return ee===_}),k=P?P.sortOrder:null,T=hbe(v,k),M=v.includes(u1)&&I(fbe,{className:He("".concat(e,"-column-sorter-up"),{active:k===u1}),role:"presentation"}),O=v.includes(e2)&&I(ube,{className:He("".concat(e,"-column-sorter-down"),{active:k===e2}),role:"presentation"}),N=o||{},L=N.cancelSort,F=N.triggerAsc,V=N.triggerDesc,B=L;T===e2?B=V:T===u1&&(B=F);var H=nn(x)==="object"?x:{title:B};m=ze(ze({},m),{className:He(m.className,re({},"".concat(e,"-column-sort"),k)),title:function(ee){var X=$e("div",{className:"".concat(e,"-column-sorters"),children:[I("span",{className:"".concat(e,"-column-title"),children:tw(u.title,ee)}),I("span",{className:He("".concat(e,"-column-sorter"),re({},"".concat(e,"-column-sorter-full"),!!(M&&O))),children:$e("span",{className:"".concat(e,"-column-sorter-inner"),children:[M,O]})})]});return x?I($i,{...H,children:X}):X},onHeaderCell:function(ee){var X=u.onHeaderCell&&u.onHeaderCell(ee)||{},Z=X.onClick,Q=X.onKeyDown;X.onClick=function(se){r({column:u,key:_,sortOrder:T,multiplePriority:Eb(u)}),Z==null||Z(se)},X.onKeyDown=function(se){se.keyCode===kt.ENTER&&(r({column:u,key:_,sortOrder:T,multiplePriority:Eb(u)}),Q==null||Q(se))};var le=ome(u.title,{}),ne=le==null?void 0:le.toString();return k?X["aria-sort"]=k==="ascend"?"ascending":"descending":X["aria-label"]=ne||"",X.className=He(X.className,"".concat(e,"-column-has-sorters")),X.tabIndex=0,u.ellipsis&&(X.title=(le!=null?le:"").toString()),X}})}return"children"in m&&(m=ze(ze({},m),{children:gU(e,m.children,n,r,i,o,s,p)})),m})}function J5(e){var t=e.column,n=e.sortOrder;return{column:t,order:n,field:t.dataIndex,columnKey:t.key}}function eN(e){var t=e.filter(function(n){var r=n.sortOrder;return r}).map(J5);return t.length===0&&e.length?ze(ze({},J5(e[e.length-1])),{column:void 0}):t.length<=1?t[0]||{}:t}function cE(e,t,n){var r=t.slice().sort(function(s,a){return a.multiplePriority-s.multiplePriority}),i=e.slice(),o=r.filter(function(s){var a=s.column.sorter,u=s.sortOrder;return Q5(a)&&u});return o.length?i.sort(function(s,a){for(var u=0;u2&&arguments[2]!==void 0?arguments[2]:!1,at=ze(ze({},qe),Ge);Mt&&(qe.resetPagination(),at.pagination.current&&(at.pagination.current=1),p&&p.onChange&&p.onChange(1,at.pagination.pageSize)),G&&G.scrollToFirstRowOnChange!==!1&&ct.body.current&&Vie(0,{getContainer:function(){return ct.body.current}}),M==null||M(at.pagination,at.filters,at.sorter,{currentDataSource:X5(cE(Ke,at.sorterStates,Qe),at.filterStates),action:Ut})},_t=function(Ge,Ut){dt({sorter:Ge,sorterStates:Ut},"sort",!1)},Dt=pbe({prefixCls:lt,mergedColumns:oe,onSorterChange:_t,sortDirections:ee||["ascend","descend"],tableLocale:De,showSorterTooltip:Q}),Nt=Le(Dt,4),jt=Nt[0],Ve=Nt[1],Ze=Nt[2],Yt=Nt[3],sn=w.exports.useMemo(function(){return cE(Ke,Ve,Qe)},[Ke,Ve]);qe.sorter=Yt(),qe.sorterStates=Ve;var Gt=function(Ge,Ut){dt({filters:Ge,filterStates:Ut},"filter",!0)},zt=ebe({prefixCls:lt,locale:De,dropdownPrefixCls:St,mergedColumns:oe,onFilterChange:Gt,getPopupContainer:O}),Rt=Le(zt,3),Qt=Rt[0],pn=Rt[1],ot=Rt[2],Lt=X5(sn,pn);qe.filters=ot,qe.filterStates=pn;var Tt=w.exports.useMemo(function(){var et={};return Object.keys(ot).forEach(function(Ge){ot[Ge]!==null&&(et[Ge]=ot[Ge])}),ze(ze({},Ze),{filters:et})},[Ze,ot]),Kt=mbe(Tt),Zt=Le(Kt,1),ht=Zt[0],xn=function(Ge,Ut){dt({pagination:ze(ze({},qe.pagination),{current:Ge,pageSize:Ut})},"paginate")},bn=obe(Lt.length,p,xn),tn=Le(bn,2),Bt=tn[0],gt=tn[1];qe.pagination=p===!1?{}:rbe(p,Bt),qe.resetPagination=gt;var xt=w.exports.useMemo(function(){if(p===!1||!Bt.pageSize)return Lt;var et=Bt.current,Ge=et===void 0?1:et,Ut=Bt.total,Mt=Bt.pageSize,at=Mt===void 0?fU:Mt;return Lt.lengthat?Lt.slice((Ge-1)*at,Ge*at):Lt:Lt.slice((Ge-1)*at,Ge*at)},[!!p,Lt,Bt&&Bt.current,Bt&&Bt.pageSize,Bt&&Bt.total]),Vt=abe(m,{prefixCls:lt,data:Lt,pageData:xt,getRowKey:wt,getRecordByKey:nt,expandType:mt,childrenColumnName:Qe,locale:De,getPopupContainer:O}),qt=Le(Vt,2),vn=qt[0],Fn=qt[1],tr=function(Ge,Ut,Mt){var at;return typeof _=="function"?at=He(_(Ge,Ut,Mt)):at=He(_),He(re({},"".concat(lt,"-row-selected"),Fn.has(wt(Ge,Ut))),at)};We.__PARENT_RENDER_ICON__=We.expandIcon,We.expandIcon=We.expandIcon||L||ime(De),mt==="nest"&&We.expandIconColumnIndex===void 0?We.expandIconColumnIndex=m?1:0:We.expandIconColumnIndex>0&&m&&(We.expandIconColumnIndex-=1),typeof We.indentSize!="number"&&(We.indentSize=typeof H=="number"?H:15);var nr=w.exports.useCallback(function(et){return ht(vn(Qt(jt(et))))},[jt,Qt,vn]),ye,q;if(p!==!1&&(Bt==null?void 0:Bt.total)){var J;Bt.size?J=Bt.size:J=ke==="small"||ke==="middle"?"small":void 0;var pe=function(Ge){return I(she,{...Bt,className:He("".concat(lt,"-pagination ").concat(lt,"-pagination-").concat(Ge),Bt.className),size:J})},ce=Ce==="rtl"?"left":"right",we=Bt.position;if(we!==null&&Array.isArray(we)){var Ae=we.find(function(et){return et.includes("top")}),Pe=we.find(function(et){return et.includes("bottom")}),Me=we.every(function(et){return"".concat(et)==="none"});!Ae&&!Pe&&!Me&&(q=pe(ce)),Ae&&(ye=pe(Ae.toLowerCase().replace("top",""))),Pe&&(q=pe(Pe.toLowerCase().replace("bottom","")))}else q=pe(ce)}var Be;typeof N=="boolean"?Be={spinning:N}:nn(N)==="object"&&(Be=ze({spinning:!0},N));var Je=He("".concat(lt,"-wrapper"),re({},"".concat(lt,"-wrapper-rtl"),Ce==="rtl"),i);return I("div",{ref:t,className:Je,style:o,children:$e(vs,{spinning:!1,...Be,children:[ye,I(wf,{...he,columns:oe,direction:Ce,expandable:We,prefixCls:lt,className:He((n={},re(n,"".concat(lt,"-middle"),ke==="middle"),re(n,"".concat(lt,"-small"),ke==="small"),re(n,"".concat(lt,"-bordered"),a),re(n,"".concat(lt,"-empty"),Ke.length===0),n)),data:xt,rowKey:wt,rowClassName:tr,emptyText:X&&X.emptyText||(Ee||UI)("Table"),internalHooks:l1,internalRefs:ct,transformColumns:nr}),q]})})}var ybe=w.exports.forwardRef(vbe),Cu=ybe;Cu.SELECTION_COLUMN=Gu;Cu.EXPAND_COLUMN=wf.EXPAND_COLUMN;Cu.SELECTION_ALL=aE;Cu.SELECTION_INVERT=sE;Cu.SELECTION_NONE=lE;Cu.Column=nme;Cu.ColumnGroup=rme;Cu.Summary=FV;const yU=Cu;var xbe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"};const bbe=xbe;var xU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:bbe})})};xU.displayName="DeleteOutlined";const _be=w.exports.forwardRef(xU);var bU=w.exports.createContext(null),_U=w.exports.createContext(null);function wbe(e){return Array.isArray(e)?e:e!==void 0?[e]:[]}function Cbe(e){var t=e||{},n=t.label,r=t.value,i=t.children,o=r||"value";return{_title:n?[n]:["title","label"],value:o,key:o,children:i||"children"}}function dE(e){return!e||e.disabled||e.disableCheckbox||e.checkable===!1}function Sbe(e,t){var n=[];function r(i){i.forEach(function(o){var s=o[t.children];s&&(n.push(o[t.value]),r(s))})}return r(e),n}function tN(e){return e==null}var Ebe={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},Pbe=function(t,n){var r=ZB(),i=r.prefixCls,o=r.multiple,s=r.searchValue,a=r.toggleOpen,u=r.open,d=r.notFoundContent,p=w.exports.useContext(_U),m=p.virtual,v=p.listHeight,x=p.listItemHeight,_=p.treeData,P=p.fieldNames,k=p.onSelect,T=p.dropdownMatchSelectWidth,M=p.treeExpandAction,O=w.exports.useContext(bU),N=O.checkable,L=O.checkedKeys,F=O.halfCheckedKeys,V=O.treeExpandedKeys,B=O.treeDefaultExpandAll,H=O.treeDefaultExpandedKeys,G=O.onTreeExpand,ee=O.treeIcon,X=O.showTreeIcon,Z=O.switcherIcon,Q=O.treeLine,le=O.treeNodeFilterProp,ne=O.loadData,se=O.treeLoadedKeys,oe=O.treeMotion,he=O.onTreeLoad,_e=O.keyEntities,be=w.exports.useRef(),xe=Vv(function(){return _},[u,_],function(_t,Dt){return Dt[0]&&_t[1]!==Dt[1]}),Te=w.exports.useMemo(function(){return N?{checked:L,halfChecked:F}:null},[N,L,F]);w.exports.useEffect(function(){if(u&&!o&&L.length){var _t;(_t=be.current)===null||_t===void 0||_t.scrollTo({key:L[0]})}},[u]);var Ee=String(s).toLowerCase(),Ce=function(Dt){return Ee?String(Dt[le]).toLowerCase().includes(Ee):!1},ke=w.exports.useState(H),De=Le(ke,2),Ke=De[0],Ue=De[1],tt=w.exports.useState(null),lt=Le(tt,2),St=lt[0],We=lt[1],bt=w.exports.useMemo(function(){return V?Pt(V):s?St:Ke},[Ke,St,V,s]);w.exports.useEffect(function(){s&&We(Sbe(_,P))},[s]);var Qe=function(Dt){Ue(Dt),We(Dt),G&&G(Dt)},mt=function(Dt){Dt.preventDefault()},ct=function(Dt,Nt){var jt=Nt.node;N&&dE(jt)||(k(jt.key,{selected:!L.includes(jt.key)}),o||a(!1))},wt=w.exports.useState(null),rt=Le(wt,2),ut=rt[0],nt=rt[1],qe=_e[ut];if(w.exports.useImperativeHandle(n,function(){var _t;return{scrollTo:(_t=be.current)===null||_t===void 0?void 0:_t.scrollTo,onKeyDown:function(Nt){var jt,Ve=Nt.which;switch(Ve){case kt.UP:case kt.DOWN:case kt.LEFT:case kt.RIGHT:(jt=be.current)===null||jt===void 0||jt.onKeyDown(Nt);break;case kt.ENTER:{if(qe){var Ze=(qe==null?void 0:qe.node)||{},Yt=Ze.selectable,sn=Ze.value;Yt!==!1&&ct(null,{node:{key:ut},selected:!L.includes(sn)})}break}case kt.ESC:a(!1)}},onKeyUp:function(){}}}),xe.length===0)return I("div",{role:"listbox",className:"".concat(i,"-empty"),onMouseDown:mt,children:d});var dt={fieldNames:P};return se&&(dt.loadedKeys=se),bt&&(dt.expandedKeys=bt),$e("div",{onMouseDown:mt,children:[qe&&u&&I("span",{style:Ebe,"aria-live":"assertive",children:qe.node.value}),I(aw,{ref:be,focusable:!1,prefixCls:"".concat(i,"-tree"),treeData:xe,height:v,itemHeight:x,virtual:m!==!1&&T!==!1,multiple:o,icon:ee,showIcon:X,switcherIcon:Z,showLine:Q,loadData:s?null:ne,motion:oe,activeKey:ut,checkable:N,checkStrictly:!0,checkedKeys:Te,selectedKeys:N?[]:L,defaultExpandAll:B,...dt,onActiveChange:nt,onSelect:ct,onCheck:ct,onExpand:Qe,onLoad:he,filterTreeNode:Ce,expandAction:M})]})},wU=w.exports.forwardRef(Pbe);wU.displayName="OptionList";var _T=function(){return null},CU="SHOW_ALL",wT="SHOW_PARENT",sw="SHOW_CHILD";function nN(e,t,n,r){var i=new Set(e);return t===sw?e.filter(function(o){var s=n[o];return!(s&&s.children&&s.children.some(function(a){var u=a.node;return i.has(u[r.value])})&&s.children.every(function(a){var u=a.node;return dE(u)||i.has(u[r.value])}))}):t===wT?e.filter(function(o){var s=n[o],a=s?s.parent:null;return!(a&&!dE(a.node)&&i.has(a.key))}):e}var Ibe=["children","value"];function SU(e){return yo(e).map(function(t){if(!w.exports.isValidElement(t)||!t.type)return null;var n=t,r=n.key,i=n.props,o=i.children,s=i.value,a=Rn(i,Ibe),u=fe({key:r,value:s},a),d=SU(o);return d.length&&(u.children=d),u}).filter(function(t){return t})}function fE(e){if(!e)return e;var t=fe({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Dr(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),t}}),t}function Tbe(e,t,n,r,i,o){var s=null,a=null;function u(){function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return p.map(function(x,_){var P="".concat(m,"-").concat(_),k=x[o.value],T=n.includes(k),M=d(x[o.children]||[],P,T),O=I(_T,{...x,children:M.map(function(L){return L.node})});if(t===k&&(s=O),T){var N={pos:P,node:O,children:M};return v||a.push(N),N}return null}).filter(function(x){return x})}a||(a=[],d(r),a.sort(function(p,m){var v=p.node.props.value,x=m.node.props.value,_=n.indexOf(v),P=n.indexOf(x);return _-P}))}Object.defineProperty(e,"triggerNode",{get:function(){return Dr(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),u(),s}}),Object.defineProperty(e,"allCheckedNodes",{get:function(){return Dr(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),u(),i?a:a.map(function(p){var m=p.node;return m})}})}function kbe(e,t){var n=t.id,r=t.pId,i=t.rootPId,o={},s=[],a=e.map(function(u){var d=fe({},u),p=d[n];return o[p]=d,d.key=d.key||p,d});return a.forEach(function(u){var d=u[r],p=o[d];p&&(p.children=p.children||[],p.children.push(u)),(d===i||!p&&i===null)&&s.push(u)}),s}function Mbe(e,t,n){return w.exports.useMemo(function(){return e?n?kbe(e,fe({id:"id",pId:"pId",rootPId:null},n!==!0?n:{})):e:SU(t)},[t,n,e])}const Rbe=function(e){var t=w.exports.useRef({valueLabels:new Map});return w.exports.useMemo(function(){var n=t.current.valueLabels,r=new Map,i=e.map(function(o){var s,a=o.value,u=(s=o.label)!==null&&s!==void 0?s:n.get(a);return r.set(a,u),fe(fe({},o),{},{label:u})});return t.current.valueLabels=r,[i]},[e])};function rN(e){var t=w.exports.useRef();t.current=e;var n=w.exports.useCallback(function(){return t.current.apply(t,arguments)},[]);return n}const Abe=function(e,t){return w.exports.useMemo(function(){var n=q_(e,{fieldNames:t,initWrapper:function(i){return fe(fe({},i),{},{valueEntities:new Map})},processEntity:function(i,o){var s=i.node[t.value];o.valueEntities.set(s,i)}});return n},[e,t])},Dbe=function(e,t,n,r){return w.exports.useMemo(function(){var i=e.map(function(u){var d=u.value;return d}),o=t.map(function(u){var d=u.value;return d}),s=i.filter(function(u){return!r[u]});if(n){var a=uu(i,!0,r);i=a.checkedKeys,o=a.halfCheckedKeys}return[Array.from(new Set([].concat(Pt(s),Pt(i)))),o]},[e,t,n,r])},Obe=function(e,t,n){var r=n.treeNodeFilterProp,i=n.filterTreeNode,o=n.fieldNames,s=o.children;return w.exports.useMemo(function(){if(!t||i===!1)return e;var a;if(typeof i=="function")a=i;else{var u=t.toUpperCase();a=function(m,v){var x=v[r];return String(x).toUpperCase().includes(u)}}function d(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return p.map(function(v){var x=v[s],_=m||a(t,fE(v)),P=d(x||[],_);return _||P.length?fe(fe({},v),{},re({isLeaf:void 0},s,P)):null}).filter(function(v){return v})}return d(e)},[e,t,s,r,i])};var Nbe=["id","prefixCls","value","defaultValue","onChange","onSelect","onDeselect","searchValue","inputValue","onSearch","autoClearSearchValue","filterTreeNode","treeNodeFilterProp","showCheckedStrategy","treeNodeLabelProp","multiple","treeCheckable","treeCheckStrictly","labelInValue","fieldNames","treeDataSimpleMode","treeData","children","loadData","treeLoadedKeys","onTreeLoad","treeDefaultExpandAll","treeExpandedKeys","treeDefaultExpandedKeys","onTreeExpand","treeExpandAction","virtual","listHeight","listItemHeight","onDropdownVisibleChange","dropdownMatchSelectWidth","treeLine","treeIcon","showTreeIcon","switcherIcon","treeMotion"];function Lbe(e){return!e||nn(e)!=="object"}var Fbe=w.exports.forwardRef(function(e,t){var n=e.id,r=e.prefixCls,i=r===void 0?"rc-tree-select":r,o=e.value,s=e.defaultValue,a=e.onChange,u=e.onSelect,d=e.onDeselect,p=e.searchValue,m=e.inputValue,v=e.onSearch,x=e.autoClearSearchValue,_=x===void 0?!0:x,P=e.filterTreeNode,k=e.treeNodeFilterProp,T=k===void 0?"value":k,M=e.showCheckedStrategy,O=M===void 0?sw:M,N=e.treeNodeLabelProp,L=e.multiple,F=e.treeCheckable,V=e.treeCheckStrictly,B=e.labelInValue,H=e.fieldNames,G=e.treeDataSimpleMode,ee=e.treeData,X=e.children,Z=e.loadData,Q=e.treeLoadedKeys,le=e.onTreeLoad,ne=e.treeDefaultExpandAll,se=e.treeExpandedKeys,oe=e.treeDefaultExpandedKeys,he=e.onTreeExpand,_e=e.treeExpandAction,be=e.virtual,xe=e.listHeight,Te=xe===void 0?200:xe,Ee=e.listItemHeight,Ce=Ee===void 0?20:Ee,ke=e.onDropdownVisibleChange,De=e.dropdownMatchSelectWidth,Ke=De===void 0?!0:De,Ue=e.treeLine,tt=e.treeIcon,lt=e.showTreeIcon,St=e.switcherIcon,We=e.treeMotion,bt=Rn(e,Nbe),Qe=x9(n),mt=F&&!V,ct=F||V,wt=V||B,rt=ct||L,ut=ki(s,{value:o}),nt=Le(ut,2),qe=nt[0],dt=nt[1],_t=w.exports.useMemo(function(){return Cbe(H)},[JSON.stringify(H)]),Dt=ki("",{value:p!==void 0?p:m,postState:function(we){return we||""}}),Nt=Le(Dt,2),jt=Nt[0],Ve=Nt[1],Ze=function(we){Ve(we),v==null||v(we)},Yt=Mbe(ee,X,G),sn=Abe(Yt,_t),Gt=sn.keyEntities,zt=sn.valueEntities,Rt=w.exports.useCallback(function(ce){var we=[],Ae=[];return ce.forEach(function(Pe){zt.has(Pe)?Ae.push(Pe):we.push(Pe)}),{missingRawValues:we,existRawValues:Ae}},[zt]),Qt=Obe(Yt,jt,{fieldNames:_t,treeNodeFilterProp:T,filterTreeNode:P}),pn=w.exports.useCallback(function(ce){if(ce){if(N)return ce[N];for(var we=_t._title,Ae=0;Ae"u"){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var m=iN[t.format]||iN.default;window.clipboardData.setData(m,e)}else p.clipboardData.clearData(),p.clipboardData.setData(t.format,e);t.onCopy&&(p.preventDefault(),t.onCopy(p.clipboardData))}),document.body.appendChild(a),o.selectNodeContents(a),s.addRange(o);var d=document.execCommand("copy");if(!d)throw new Error("copy command was unsuccessful");u=!0}catch(p){n&&console.error("unable to copy using execCommand: ",p),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(m){n&&console.error("unable to copy using clipboardData: ",m),n&&console.error("falling back to prompt"),r=Xbe("message"in t?t.message:Zbe),window.prompt(r,e)}}finally{s&&(typeof s.removeRange=="function"?s.removeRange(o):s.removeAllRanges()),a&&document.body.removeChild(a),i()}return u}var Qbe=Ybe,Jbe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 170h-60c-4.4 0-8 3.6-8 8v518H310v-73c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-75h498c35.3 0 64-28.7 64-64V178c0-4.4-3.6-8-8-8z"}}]},name:"enter",theme:"outlined"};const e_e=Jbe;var TU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:e_e})})};TU.displayName="EnterOutlined";const t_e=w.exports.forwardRef(TU);var n_e=function(t){var n=t.prefixCls,r=t["aria-label"],i=t.className,o=t.style,s=t.direction,a=t.maxLength,u=t.autoSize,d=u===void 0?!0:u,p=t.value,m=t.onSave,v=t.onCancel,x=t.onEnd,_=t.component,P=t.enterIcon,k=P===void 0?I(t_e,{}):P,T=w.exports.useRef(null),M=w.exports.useRef(!1),O=w.exports.useRef(),N=w.exports.useState(p),L=Le(N,2),F=L[0],V=L[1];w.exports.useEffect(function(){V(p)},[p]),w.exports.useEffect(function(){if(T.current&&T.current.resizableTextArea){var se=T.current.resizableTextArea.textArea;se.focus();var oe=se.value.length;se.setSelectionRange(oe,oe)}},[]);var B=function(oe){var he=oe.target;V(he.value.replace(/[\n\r]/g,""))},H=function(){M.current=!0},G=function(){M.current=!1},ee=function(oe){var he=oe.keyCode;M.current||(O.current=he)},X=function(){m(F.trim())},Z=function(oe){var he=oe.keyCode,_e=oe.ctrlKey,be=oe.altKey,xe=oe.metaKey,Te=oe.shiftKey;O.current===he&&!M.current&&!_e&&!be&&!xe&&!Te&&(he===kt.ENTER?(X(),x==null||x()):he===kt.ESC&&v())},Q=function(){X()},le=_?"".concat(n,"-").concat(_):"",ne=He(n,"".concat(n,"-edit-content"),re({},"".concat(n,"-rtl"),s==="rtl"),i,le);return $e("div",{className:ne,style:o,children:[I(eV,{ref:T,maxLength:a,value:F,onChange:B,onKeyDown:ee,onKeyUp:Z,onCompositionStart:H,onCompositionEnd:G,onBlur:Q,"aria-label":r,rows:1,autoSize:d}),k!==null?ui(k,{className:"".concat(n,"-edit-content-confirm")}):null]})};const r_e=n_e;function t2(e,t){return w.exports.useMemo(function(){var n=!!e;return[n,ze(ze({},t),n&&nn(e)==="object"?e:null)]},[e])}var i_e=function(t,n){var r=w.exports.useRef(!1);w.exports.useEffect(function(){r.current?t():r.current=!0},n)};const o_e=i_e;var a_e=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it){var d=t-n;return r.push(String(o).slice(0,d)),r}r.push(o),n=u}return e}var u_e=0,sx=1,aN=2,n2=3,sN=4,c_e=function(t){var n=t.enabledMeasure,r=t.children,i=t.text,o=t.width,s=t.fontSize,a=t.rows,u=t.onEllipsis,d=w.exports.useState([0,0,0]),p=Le(d,2),m=Le(p[0],3),v=m[0],x=m[1],_=m[2],P=p[1],k=w.exports.useState(u_e),T=Le(k,2),M=T[0],O=T[1],N=w.exports.useState(0),L=Le(N,2),F=L[0],V=L[1],B=w.exports.useRef(null),H=w.exports.useRef(null),G=w.exports.useMemo(function(){return yo(i)},[i]),ee=w.exports.useMemo(function(){return l_e(G)},[G]),X=w.exports.useMemo(function(){return!n||M!==n2?r(G,!1):r(oN(G,x),x1&>,vn=function(at){var $t;Nt(!0),($t=ht.onExpand)===null||$t===void 0||$t.call(ht,at)},Fn=w.exports.useState(0),tr=Le(Fn,2),nr=tr[0],ye=tr[1],q=w.exports.useState(0),J=Le(q,2),pe=J[0],ce=J[1],we=function(at,$t){var Xt=at.offsetWidth,En;ye(Xt),ce(parseInt((En=window.getComputedStyle)===null||En===void 0?void 0:En.call(window,$t).fontSize,10)||0)},Ae=function(at){var $t;Yt(at),Ze!==at&&(($t=ht.onEllipsis)===null||$t===void 0||$t.call(ht,at))};w.exports.useEffect(function(){var Mt=L.current;if(Zt&>&&Mt){var at=qt?Mt.offsetHeight"u"||!Mt||!gt||!xn)){var at=new IntersectionObserver(function(){Lt(!!Mt.offsetParent)});return at.observe(Mt),function(){at.disconnect()}}},[gt,xn]);var Pe={};ht.tooltip===!0?Pe={title:(n=X.text)!==null&&n!==void 0?n:p}:w.exports.isValidElement(ht.tooltip)?Pe={title:ht.tooltip}:nn(ht.tooltip)==="object"?Pe=ze({title:(r=X.text)!==null&&r!==void 0?r:p},ht.tooltip):Pe={title:ht.tooltip};var Me=w.exports.useMemo(function(){var Mt=function($t){return["string","number"].includes(nn($t))};if(!(!Zt||gt)){if(Mt(X.text))return X.text;if(Mt(p))return p;if(Mt(P))return P;if(Mt(Pe.title))return Pe.title}},[Zt,gt,P,Pe.title,xt]);if(le)return I(r_e,{value:(i=X.text)!==null&&i!==void 0?i:typeof p=="string"?p:"",onSave:be,onCancel:xe,onEnd:X.onEnd,prefixCls:V,className:s,style:a,direction:O,component:_,maxLength:X.maxLength,autoSize:X.autoSize,enterIcon:X.enterIcon});var Be=function(){var at=ht.expandable,$t=ht.symbol;if(!at)return null;var Xt;return $t?Xt=$t:Xt=N.expand,I("a",{className:"".concat(V,"-expand"),onClick:vn,"aria-label":N.expand,children:Xt},"expand")},Je=function(){if(!!ee){var at=X.icon,$t=X.tooltip,Xt=yo($t)[0]||N.edit,En=typeof Xt=="string"?Xt:"";return oe.includes("icon")?I($i,{title:$t===!1?"":Xt,children:I(l5,{ref:F,className:"".concat(V,"-edit"),onClick:_e,"aria-label":En,children:at||I(Wbe,{role:"button"})})},"edit"):null}},et=function(){if(!!Ce){var at=ke.tooltips,$t=ke.icon,Xt=lN(at),En=lN($t),hn=Ue?lx(Xt[1],N.copied):lx(Xt[0],N.copy),Pn=Ue?N.copied:N.copy,Gn=typeof hn=="string"?hn:Pn;return I($i,{title:hn,children:I(l5,{className:He("".concat(V,"-copy"),Ue&&"".concat(V,"-copy-success")),onClick:bt,"aria-label":Gn,children:Ue?lx(En[1],I(HI,{}),!0):lx(En[0],I(jbe,{}),!0)})},"copy")}},Ge=function(at){return[at&&Be(),Je(),et()]},Ut=function(at){return[at&&I("span",{"aria-hidden":!0,children:g_e},"ellipsis"),ht.suffix,Ge(at)]};return I(_u,{onResize:we,disabled:!xn||gt,children:function(Mt){var at;return I(h_e,{tooltipProps:Pe,enabledEllipsis:xn,isEllipsis:xt,children:I(kU,{className:He((at={},re(at,"".concat(V,"-").concat(u),u),re(at,"".concat(V,"-disabled"),d),re(at,"".concat(V,"-ellipsis"),Zt),re(at,"".concat(V,"-single-line"),xn&&tn===1),re(at,"".concat(V,"-ellipsis-single-line"),Vt),re(at,"".concat(V,"-ellipsis-multiple-line"),qt),at),s),prefixCls:o,style:ze(ze({},a),{WebkitLineClamp:qt?tn:void 0}),component:_,ref:Zo(Mt,L,t),direction:O,onClick:oe.includes("text")?_e:void 0,"aria-label":Me==null?void 0:Me.toString(),title:P,...B,children:I(d_e,{enabledMeasure:xn&&!gt,text:p,rows:tn,width:nr,fontSize:pe,onEllipsis:Ae,children:function($t,Xt){var En=$t;$t.length&&Xt&&Me&&(En=I("span",{"aria-hidden":!0,children:En},"show-content"));var hn=m_e(e,$e(Tn,{children:[En,Ut(Xt)]}));return hn}})})})}})});const lw=v_e;var y_e=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(o.percent=o.loaded/o.total*100),e.onProgress(o)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(i){var o=e.data[i];if(Array.isArray(o)){o.forEach(function(s){n.append("".concat(i,"[]"),s)});return}n.append(i,o)}),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(o){e.onError(o)},t.onload=function(){return t.status<200||t.status>=300?e.onError(R_e(e,t),uN(t)):e.onSuccess(uN(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return r["X-Requested-With"]!==null&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach(function(i){r[i]!==null&&t.setRequestHeader(i,r[i])}),t.send(n),{abort:function(){t.abort()}}}var D_e=+new Date,O_e=0;function r2(){return"rc-upload-".concat(D_e,"-").concat(++O_e)}const i2=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=e.type||"",o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim();if(/^\*(\/\*)?$/.test(s))return!0;if(a.charAt(0)==="."){var u=r.toLowerCase(),d=a.toLowerCase(),p=[d];return(d===".jpg"||d===".jpeg")&&(p=[".jpg",".jpeg"]),p.some(function(m){return u.endsWith(m)})}return/\/\*$/.test(a)?o===a.replace(/\/.*$/,""):i===a?!0:/^\w+$/.test(a)?(Dr(!1,"Upload takes an invalidate 'accept' type '".concat(a,"'.Skip for check.")),!0):!1})}return!0};function N_e(e,t){var n=e.createReader(),r=[];function i(){n.readEntries(function(o){var s=Array.prototype.slice.apply(o);r=r.concat(s);var a=!s.length;a?t(r):i()})}i()}var L_e=function(t,n,r){var i=function o(s,a){s.path=a||"",s.isFile?s.file(function(u){r(u)&&(s.fullPath&&!u.webkitRelativePath&&(Object.defineProperties(u,{webkitRelativePath:{writable:!0}}),u.webkitRelativePath=s.fullPath.replace(/^\//,""),Object.defineProperties(u,{webkitRelativePath:{writable:!1}})),n([u]))}):s.isDirectory&&N_e(s,function(u){u.forEach(function(d){o(d,"".concat(a).concat(s.name,"/"))})})};t.forEach(function(o){i(o.webkitGetAsEntry())})},F_e=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],z_e=function(e){ci(n,e);var t=di(n);function n(){var r;Nr(this,n);for(var i=arguments.length,o=new Array(i),s=0;s0&&arguments[0]!==void 0?arguments[0]:"",n=t.split("/"),r=n[n.length-1],i=r.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(i)||[""])[0]},OU=function(t){return t.indexOf("image/")===0},X_e=function(t){if(t.type&&!t.thumbUrl)return OU(t.type);var n=t.thumbUrl||t.url||"",r=Z_e(n);return/^data:image\//.test(n)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(r)?!0:!(/^data:/.test(n)||r)},Ku=200;function Y_e(e){return new Promise(function(t){if(!e.type||!OU(e.type)){t("");return}var n=document.createElement("canvas");n.width=Ku,n.height=Ku,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(Ku,"px; height: ").concat(Ku,"px; z-index: 9999; display: none;"),document.body.appendChild(n);var r=n.getContext("2d"),i=new Image;if(i.onload=function(){var s=i.width,a=i.height,u=Ku,d=Ku,p=0,m=0;s>a?(d=a*(Ku/s),m=-(d-u)/2):(u=s*(Ku/a),p=-(u-d)/2),r.drawImage(i,p,m,u,d);var v=n.toDataURL();document.body.removeChild(n),t(v)},i.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){var o=new FileReader;o.addEventListener("load",function(){o.result&&(i.src=o.result)}),o.readAsDataURL(e)}else i.src=window.URL.createObjectURL(e)})}var Q_e={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const NU=Q_e;var LU=function(t,n){return I(Qn,{...fe(fe({},t),{},{ref:n,icon:NU})})};LU.displayName="DownloadOutlined";const J_e=w.exports.forwardRef(LU);var ewe=w.exports.forwardRef(function(e,t){var n,r=e.prefixCls,i=e.className,o=e.style,s=e.locale,a=e.listType,u=e.file,d=e.items,p=e.progress,m=e.iconRender,v=e.actionIconRender,x=e.itemRender,_=e.isImgUrl,P=e.showPreviewIcon,k=e.showRemoveIcon,T=e.showDownloadIcon,M=e.previewIcon,O=e.removeIcon,N=e.downloadIcon,L=e.onPreview,F=e.onDownload,V=e.onClose,B,H,G=u.status,ee=w.exports.useState(G),X=Le(ee,2),Z=X[0],Q=X[1];w.exports.useEffect(function(){G!=="removed"&&Q(G)},[G]);var le=w.exports.useState(!1),ne=Le(le,2),se=ne[0],oe=ne[1],he=w.exports.useRef(null);w.exports.useEffect(function(){return he.current=setTimeout(function(){oe(!0)},300),function(){he.current&&clearTimeout(he.current)}},[]);var _e="".concat(r,"-span"),be=m(u),xe=I("div",{className:"".concat(r,"-text-icon"),children:be});if(a==="picture"||a==="picture-card")if(Z==="uploading"||!u.thumbUrl&&!u.url){var Te,Ee=He((Te={},re(Te,"".concat(r,"-list-item-thumbnail"),!0),re(Te,"".concat(r,"-list-item-file"),Z!=="uploading"),Te));xe=I("div",{className:Ee,children:be})}else{var Ce,ke=_!=null&&_(u)?I("img",{src:u.thumbUrl||u.url,alt:u.name,className:"".concat(r,"-list-item-image"),crossOrigin:u.crossOrigin}):be,De=He((Ce={},re(Ce,"".concat(r,"-list-item-thumbnail"),!0),re(Ce,"".concat(r,"-list-item-file"),_&&!_(u)),Ce));xe=I("a",{className:De,onClick:function(jt){return L(u,jt)},href:u.url||u.thumbUrl,target:"_blank",rel:"noopener noreferrer",children:ke})}var Ke=He((n={},re(n,"".concat(r,"-list-item"),!0),re(n,"".concat(r,"-list-item-").concat(Z),!0),re(n,"".concat(r,"-list-item-list-type-").concat(a),!0),n)),Ue=typeof u.linkProps=="string"?JSON.parse(u.linkProps):u.linkProps,tt=k?v((typeof O=="function"?O(u):O)||I(_be,{}),function(){return V(u)},r,s.removeFile):null,lt=T&&Z==="done"?v((typeof N=="function"?N(u):N)||I(J_e,{}),function(){return F(u)},r,s.downloadFile):null,St=a!=="picture-card"&&$e("span",{className:He("".concat(r,"-list-item-card-actions"),{picture:a==="picture"}),children:[lt,tt]},"download-delete"),We=He("".concat(r,"-list-item-name")),bt=u.url?[I("a",{target:"_blank",rel:"noopener noreferrer",className:We,title:u.name,...Ue,href:u.url,onClick:function(jt){return L(u,jt)},children:u.name},"view"),St]:[I("span",{className:We,onClick:function(jt){return L(u,jt)},title:u.name,children:u.name},"view"),St],Qe={pointerEvents:"none",opacity:.5},mt=P?I("a",{href:u.url||u.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:u.url||u.thumbUrl?void 0:Qe,onClick:function(jt){return L(u,jt)},title:s.previewFile,children:typeof M=="function"?M(u):M||I(lT,{})}):null,ct=a==="picture-card"&&Z!=="uploading"&&$e("span",{className:"".concat(r,"-list-item-actions"),children:[mt,Z==="done"&<,tt]}),wt;u.response&&typeof u.response=="string"?wt=u.response:wt=((B=u.error)===null||B===void 0?void 0:B.statusText)||((H=u.error)===null||H===void 0?void 0:H.message)||s.uploadError;var rt=$e("span",{className:_e,children:[xe,bt]}),ut=w.exports.useContext(On),nt=ut.getPrefixCls,qe=nt(),dt=$e("div",{className:Ke,children:[I("div",{className:"".concat(r,"-list-item-info"),children:rt}),ct,se&&I(Xo,{motionName:"".concat(qe,"-fade"),visible:Z==="uploading",motionDeadline:2e3,children:function(Nt){var jt=Nt.className,Ve="percent"in u?I(Yhe,{...p,type:"line",percent:u.percent}):null;return I("div",{className:He("".concat(r,"-list-item-progress"),jt),children:Ve})}})]}),_t=He("".concat(r,"-list-").concat(a,"-container"),i),Dt=Z==="error"?I($i,{title:wt,getPopupContainer:function(jt){return jt.parentNode},children:dt}):dt;return I("div",{className:_t,style:o,ref:t,children:x?x(Dt,u,d,{download:F.bind(null,u),preview:L.bind(null,u),remove:V.bind(null,u)}):Dt})});const twe=ewe;var uw=ze({},np);delete uw.onAppearEnd;delete uw.onEnterEnd;delete uw.onLeaveEnd;var nwe=function(t,n){var r,i=t.listType,o=i===void 0?"text":i,s=t.previewFile,a=s===void 0?Y_e:s,u=t.onPreview,d=t.onDownload,p=t.onRemove,m=t.locale,v=t.iconRender,x=t.isImageUrl,_=x===void 0?X_e:x,P=t.prefixCls,k=t.items,T=k===void 0?[]:k,M=t.showPreviewIcon,O=M===void 0?!0:M,N=t.showRemoveIcon,L=N===void 0?!0:N,F=t.showDownloadIcon,V=F===void 0?!1:F,B=t.removeIcon,H=t.previewIcon,G=t.downloadIcon,ee=t.progress,X=ee===void 0?{strokeWidth:2,showInfo:!1}:ee,Z=t.appendAction,Q=t.appendActionVisible,le=Q===void 0?!0:Q,ne=t.itemRender,se=GI(),oe=w.exports.useState(!1),he=Le(oe,2),_e=he[0],be=he[1];w.exports.useEffect(function(){o!=="picture"&&o!=="picture-card"||(T||[]).forEach(function(Qe){typeof document>"u"||typeof window>"u"||!window.FileReader||!window.File||!(Qe.originFileObj instanceof File||Qe.originFileObj instanceof Blob)||Qe.thumbUrl!==void 0||(Qe.thumbUrl="",a&&a(Qe.originFileObj).then(function(mt){Qe.thumbUrl=mt||"",se()}))})},[o,T,a]),w.exports.useEffect(function(){be(!0)},[]);var xe=function(mt,ct){if(!!u)return ct==null||ct.preventDefault(),u(mt)},Te=function(mt){typeof d=="function"?d(mt):mt.url&&window.open(mt.url)},Ee=function(mt){p==null||p(mt)},Ce=function(mt){if(v)return v(mt,o);var ct=mt.status==="uploading",wt=_&&_(mt)?I(G_e,{}):I(V_e,{}),rt=ct?I(Mc,{}):I(H_e,{});return o==="picture"?rt=ct?I(Mc,{}):wt:o==="picture-card"&&(rt=ct?m.uploading:wt),rt},ke=function(mt,ct,wt,rt){var ut={type:"text",size:"small",title:rt,onClick:function(dt){ct(),Ro(mt)&&mt.props.onClick&&mt.props.onClick(dt)},className:"".concat(wt,"-list-item-card-actions-btn")};if(Ro(mt)){var nt=ui(mt,ze(ze({},mt.props),{onClick:function(){}}));return I($n,{...ut,icon:nt})}return I($n,{...ut,children:I("span",{children:mt})})};w.exports.useImperativeHandle(n,function(){return{handlePreview:xe,handleDownload:Te}});var De=w.exports.useContext(On),Ke=De.getPrefixCls,Ue=De.direction,tt=Ke("upload",P),lt=He((r={},re(r,"".concat(tt,"-list"),!0),re(r,"".concat(tt,"-list-").concat(o),!0),re(r,"".concat(tt,"-list-rtl"),Ue==="rtl"),r)),St=Pt(T.map(function(Qe){return{key:Qe.uid,file:Qe}})),We=o==="picture-card"?"animate-inline":"animate",bt={motionDeadline:2e3,motionName:"".concat(tt,"-").concat(We),keys:St,motionAppear:_e};return o!=="picture-card"&&(bt=ze(ze({},uw),bt)),$e("div",{className:lt,children:[I(_I,{...bt,component:!1,children:function(Qe){var mt=Qe.key,ct=Qe.file,wt=Qe.className,rt=Qe.style;return I(twe,{locale:m,prefixCls:tt,className:wt,style:rt,file:ct,items:T,progress:X,listType:o,isImgUrl:_,showPreviewIcon:O,showRemoveIcon:L,showDownloadIcon:V,removeIcon:B,previewIcon:H,downloadIcon:G,iconRender:Ce,actionIconRender:ke,itemRender:ne,onPreview:xe,onDownload:Te,onClose:Ee},mt)}}),Z&&I(Xo,{...bt,visible:le,forceRender:!0,children:function(Qe){var mt=Qe.className,ct=Qe.style;return ui(Z,function(wt){return{className:He(wt.className,mt),style:ze(ze(ze({},ct),{pointerEvents:mt?"none":void 0}),wt.style)}})}})]})},rwe=w.exports.forwardRef(nwe);const iwe=rwe;var owe=globalThis&&globalThis.__awaiter||function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(p){try{d(r.next(p))}catch(m){s(m)}}function u(p){try{d(r.throw(p))}catch(m){s(m)}}function d(p){p.done?o(p.value):i(p.value).then(a,u)}d((r=r.apply(e,t||[])).next())})},lg="__LIST_IGNORE_".concat(Date.now(),"__"),awe=function(t,n){var r,i=t.fileList,o=t.defaultFileList,s=t.onRemove,a=t.showUploadList,u=a===void 0?!0:a,d=t.listType,p=d===void 0?"text":d,m=t.onPreview,v=t.onDownload,x=t.onChange,_=t.onDrop,P=t.previewFile,k=t.disabled,T=t.locale,M=t.iconRender,O=t.isImageUrl,N=t.progress,L=t.prefixCls,F=t.className,V=t.type,B=V===void 0?"select":V,H=t.children,G=t.style,ee=t.itemRender,X=t.maxCount,Z=t.data,Q=Z===void 0?{}:Z,le=t.multiple,ne=le===void 0?!1:le,se=t.action,oe=se===void 0?"":se,he=t.accept,_e=he===void 0?"":he,be=t.supportServerRender,xe=be===void 0?!0:be,Te=w.exports.useContext(Il),Ee=k!=null?k:Te,Ce=ki(o||[],{value:i,postState:function(Rt){return Rt!=null?Rt:[]}}),ke=Le(Ce,2),De=ke[0],Ke=ke[1],Ue=w.exports.useState("drop"),tt=Le(Ue,2),lt=tt[0],St=tt[1],We=w.exports.useRef(null);w.exports.useMemo(function(){var zt=Date.now();(i||[]).forEach(function(Rt,Qt){!Rt.uid&&!Object.isFrozen(Rt)&&(Rt.uid="__AUTO__".concat(zt,"_").concat(Qt,"__"))})},[i]);var bt=function(Rt,Qt,pn){var ot=Pt(Qt);X===1?ot=ot.slice(-1):X&&(ot=ot.slice(0,X)),Cl.exports.flushSync(function(){Ke(ot)});var Lt={file:Rt,fileList:ot};pn&&(Lt.event=pn),x==null||x(Lt)},Qe=function(Rt,Qt){return owe(void 0,void 0,void 0,Zi().mark(function pn(){var ot,Lt,Tt,Kt;return Zi().wrap(function(ht){for(;;)switch(ht.prev=ht.next){case 0:if(ot=t.beforeUpload,Lt=t.transformFile,Tt=Rt,!ot){ht.next=13;break}return ht.next=5,ot(Rt,Qt);case 5:if(Kt=ht.sent,Kt!==!1){ht.next=8;break}return ht.abrupt("return",!1);case 8:if(delete Rt[lg],Kt!==lg){ht.next=12;break}return Object.defineProperty(Rt,lg,{value:!0,configurable:!0}),ht.abrupt("return",!1);case 12:nn(Kt)==="object"&&Kt&&(Tt=Kt);case 13:if(!Lt){ht.next=17;break}return ht.next=16,Lt(Tt);case 16:Tt=ht.sent;case 17:return ht.abrupt("return",Tt);case 18:case"end":return ht.stop()}},pn)}))},mt=function(Rt){var Qt=Rt.filter(function(Lt){return!Lt.file[lg]});if(!!Qt.length){var pn=Qt.map(function(Lt){return ux(Lt.file)}),ot=Pt(De);pn.forEach(function(Lt){ot=cx(Lt,ot)}),pn.forEach(function(Lt,Tt){var Kt=Lt;if(Qt[Tt].parsedFile)Lt.status="uploading";else{var Zt=Lt.originFileObj,ht;try{ht=new File([Zt],Zt.name,{type:Zt.type})}catch{ht=new Blob([Zt],{type:Zt.type}),ht.name=Zt.name,ht.lastModifiedDate=new Date,ht.lastModified=new Date().getTime()}ht.uid=Lt.uid,Kt=ht}bt(Kt,ot)})}},ct=function(Rt,Qt,pn){try{typeof Rt=="string"&&(Rt=JSON.parse(Rt))}catch{}if(!!a2(Qt,De)){var ot=ux(Qt);ot.status="done",ot.percent=100,ot.response=Rt,ot.xhr=pn;var Lt=cx(ot,De);bt(ot,Lt)}},wt=function(Rt,Qt){if(!!a2(Qt,De)){var pn=ux(Qt);pn.status="uploading",pn.percent=Rt.percent;var ot=cx(pn,De);bt(pn,ot,Rt)}},rt=function(Rt,Qt,pn){if(!!a2(pn,De)){var ot=ux(pn);ot.error=Rt,ot.response=Qt,ot.status="error";var Lt=cx(ot,De);bt(ot,Lt)}},ut=function(Rt){var Qt;Promise.resolve(typeof s=="function"?s(Rt):s).then(function(pn){var ot;if(pn!==!1){var Lt=q_e(Rt,De);Lt&&(Qt=ze(ze({},Rt),{status:"removed"}),De==null||De.forEach(function(Tt){var Kt=Qt.uid!==void 0?"uid":"name";Tt[Kt]===Qt[Kt]&&!Object.isFrozen(Tt)&&(Tt.status="removed")}),(ot=We.current)===null||ot===void 0||ot.abort(Qt),bt(Qt,Lt))}})},nt=function(Rt){St(Rt.type),Rt.type==="drop"&&(_==null||_(Rt))};w.exports.useImperativeHandle(n,function(){return{onBatchStart:mt,onSuccess:ct,onProgress:wt,onError:rt,fileList:De,upload:We.current}});var qe=w.exports.useContext(On),dt=qe.getPrefixCls,_t=qe.direction,Dt=dt("upload",L),Nt=ze(ze({onBatchStart:mt,onError:rt,onProgress:wt,onSuccess:ct},t),{data:Q,multiple:ne,action:oe,accept:_e,supportServerRender:xe,prefixCls:Dt,disabled:Ee,beforeUpload:Qe,onChange:void 0});delete Nt.className,delete Nt.style,(!H||Ee)&&delete Nt.id;var jt=function(Rt,Qt){return u?I(bp,{componentName:"Upload",defaultLocale:gs.Upload,children:function(pn){var ot=typeof u=="boolean"?{}:u,Lt=ot.showRemoveIcon,Tt=ot.showPreviewIcon,Kt=ot.showDownloadIcon,Zt=ot.removeIcon,ht=ot.previewIcon,xn=ot.downloadIcon;return I(iwe,{prefixCls:Dt,listType:p,items:De,previewFile:P,onPreview:m,onDownload:v,onRemove:ut,showRemoveIcon:!Ee&&Lt,showPreviewIcon:Tt,showDownloadIcon:Kt,removeIcon:Zt,previewIcon:ht,downloadIcon:xn,iconRender:M,locale:ze(ze({},pn),T),isImageUrl:O,progress:N,appendAction:Rt,appendActionVisible:Qt,itemRender:ee})}}):Rt};if(B==="drag"){var Ve,Ze=He(Dt,(Ve={},re(Ve,"".concat(Dt,"-drag"),!0),re(Ve,"".concat(Dt,"-drag-uploading"),De.some(function(zt){return zt.status==="uploading"})),re(Ve,"".concat(Dt,"-drag-hover"),lt==="dragover"),re(Ve,"".concat(Dt,"-disabled"),Ee),re(Ve,"".concat(Dt,"-rtl"),_t==="rtl"),Ve),F);return $e("span",{children:[I("div",{className:Ze,onDrop:nt,onDragOver:nt,onDragLeave:nt,style:G,children:I(hE,{...Nt,ref:We,className:"".concat(Dt,"-btn"),children:I("div",{className:"".concat(Dt,"-drag-container"),children:H})})}),jt()]})}var Yt=He(Dt,(r={},re(r,"".concat(Dt,"-select"),!0),re(r,"".concat(Dt,"-select-").concat(p),!0),re(r,"".concat(Dt,"-disabled"),Ee),re(r,"".concat(Dt,"-rtl"),_t==="rtl"),r)),sn=function(Rt){return I("div",{className:Yt,style:Rt,children:I(hE,{...Nt,ref:We})})},Gt=sn(H?void 0:{display:"none"});return p==="picture-card"?I("span",{className:He("".concat(Dt,"-picture-card-wrapper"),F),children:jt(Gt,!!H)}):$e("span",{className:F,children:[Gt,jt()]})},swe=w.exports.forwardRef(awe);const FU=swe;var lwe=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);iI($n,{block:!0,className:"mt-2",onClick:e,disabled:t,children:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B"});function fwe(e,t,n){n===void 0&&(n={});var r={type:"Feature"};return(n.id===0||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=t||{},r.geometry=e,r}function hwe(e,t,n){n===void 0&&(n={});for(var r=0,i=e;rn[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]I("div",{className:da("mb-1",t),children:I(pwe,{type:r,className:da("uppercase text-xs",n),children:e})}),{TreeNode:fN}=EU,mwe=e=>e.reduce((t,n)=>(t[n.id]=n,t[n.id].type="ao",n.rayons&&n.rayons.forEach(r=>{t[r.id]=r,t[r.id].type="rayon"}),t),{}),cw=()=>Vi(["regions"],async()=>{const{data:e}=await Mi.get("https://postamates.spatialsystems.ru/api/ao_rayons/");return e},{select:e=>({raw:e,normalized:mwe(e)}),refetchOnWindowFocus:!1,refetchOnMount:!1}),ET=({disabled:e,value:t,onChange:n})=>{const{map:r}=WP(),{data:i,isInitialLoading:o}=cw();return $e("div",{children:[I(xl,{text:"\u0410\u041E / \u0440\u0430\u0439\u043E\u043D"}),I(EU,{showSearch:!0,style:{width:"100%"},value:t,dropdownStyle:{maxHeight:400,overflow:"auto"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0410\u041E \u0438\u043B\u0438 \u0440\u0430\u0439\u043E\u043D",allowClear:!0,treeDefaultExpandAll:!1,onChange:u=>{if(!u)return;const d=i.normalized[u],p=Rp.exports(d.polygon),m=hwe(p.coordinates[0]),v=pE(m);n({id:u,geometry:m,type:d.type}),r.fitBounds([[v[0],v[1]],[v[2],v[3]]],{padding:20})},loading:o,treeNodeFilterProp:"title",onClear:()=>n(null),notFoundContent:I(dl,{image:dl.PRESENTED_IMAGE_SIMPLE,description:"\u041D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E"}),disabled:e,children:i==null?void 0:i.raw.map(u=>{var d;return I(fN,{value:u.id,title:u.name,children:(d=u.rayons)==null?void 0:d.map(p=>I(fN,{value:p.id,title:p.name},p.id))},u.id)})})]})},VU=(e,t,n)=>{if(!t||!n)return!1;const r={};return n.forEach(i=>{r[i]=e[i][0]!==t[i][0]||e[i][1]!==t[i][1]}),r},tu=({value:e})=>I("span",{className:"text-grey text-xs bg-white-background-light",children:e}),hN=(e,t)=>{if(Array.isArray(t)){const[n,r]=t;return{...e,[n]:I(tu,{value:n}),[r]:I(tu,{value:r})}}else return{...e,[t]:I(tu,{value:t})}},a0=({title:e,value:t,onChange:n,onAfterChange:r,min:i=0,max:o=100,range:s=!1,step:a=1,disabled:u=!1,onMouseEnter:d,onMouseLeave:p,showZeroMark:m=!1})=>{const v={[i]:I(tu,{value:i}),[o]:I(tu,{value:o})},[x,_]=w.exports.useState(t),[P,k]=w.exports.useState(hN(v,t));w.exports.useEffect(()=>{_(t),k(hN(v,t))},[t]);const T=N=>{if(Array.isArray(N)){const[L,F]=N;k({...v,[L]:I(tu,{value:L}),[F]:I(tu,{value:F})})}else k({...v,[N]:I(tu,{value:N})});r==null||r(N)},M=N=>{_(N),n==null||n(N)},O=m?{...P,0:I(tu,{value:0})}:P;return $e("div",{onMouseEnter:d,onMouseLeave:p,children:[I(xl,{text:e}),I(mpe,{range:s,value:x,marks:O,onChange:M,onAfterChange:T,min:i,max:o,step:a,disabled:u})]})},ia=({filterRange:e,disabled:t,fullRange:n,title:r,filterKey:i,dynamicKey:o})=>{const{setFilterWithKey:s}=va(),a=u=>s(u,i);return w.exports.useEffect(()=>{if(!n)return;const u=n[0],d=n[1],p=e[0]===Hd[`${i}__gt`]&&e[1]===Hd[`${i}__lt`],m=e[0]===void 0&&e[1]===void 0||e[0]===0&&e[1]===0;(p||m&&o)&&s([u,d],i)},[n]),I(a0,{title:r,value:e,onAfterChange:a,min:n[0],max:n[1],range:!0,disabled:t})};var gwe=w.exports.createContext({});const UU=gwe;var dx=2,pN=.16,vwe=.05,ywe=.05,xwe=.15,jU=5,HU=4,bwe=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function mN(e){var t=e.r,n=e.g,r=e.b,i=ob(t,n,r);return{h:i.h*360,s:i.s,v:i.v}}function fx(e){var t=e.r,n=e.g,r=e.b;return"#".concat(ab(t,n,r,!1))}function _we(e,t,n){var r=n/100,i={r:(t.r-e.r)*r+e.r,g:(t.g-e.g)*r+e.g,b:(t.b-e.b)*r+e.b};return i}function gN(e,t,n){var r;return Math.round(e.h)>=60&&Math.round(e.h)<=240?r=n?Math.round(e.h)-dx*t:Math.round(e.h)+dx*t:r=n?Math.round(e.h)+dx*t:Math.round(e.h)-dx*t,r<0?r+=360:r>=360&&(r-=360),r}function vN(e,t,n){if(e.h===0&&e.s===0)return e.s;var r;return n?r=e.s-pN*t:t===HU?r=e.s+pN:r=e.s+vwe*t,r>1&&(r=1),n&&t===jU&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2))}function yN(e,t,n){var r;return n?r=e.v+ywe*t:r=e.v-xwe*t,r>1&&(r=1),Number(r.toFixed(2))}function mE(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=[],r=Fs(e),i=jU;i>0;i-=1){var o=mN(r),s=fx(Fs({h:gN(o,i,!0),s:vN(o,i,!0),v:yN(o,i,!0)}));n.push(s)}n.push(fx(r));for(var a=1;a<=HU;a+=1){var u=mN(r),d=fx(Fs({h:gN(u,a),s:vN(u,a),v:yN(u,a)}));n.push(d)}return t.theme==="dark"?bwe.map(function(p){var m=p.index,v=p.opacity,x=fx(_we(Fs(t.backgroundColor||"#141414"),Fs(n[m]),v*100));return x}):n}var s2={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1677FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},l2={},u2={};Object.keys(s2).forEach(function(e){l2[e]=mE(s2[e]),l2[e].primary=l2[e][5],u2[e]=mE(s2[e],{theme:"dark",backgroundColor:"#141414"}),u2[e].primary=u2[e][5]});function wwe(e,t){Dr(e,"[@ant-design/icons] ".concat(t))}function xN(e){return nn(e)==="object"&&typeof e.name=="string"&&typeof e.theme=="string"&&(nn(e.icon)==="object"||typeof e.icon=="function")}function bN(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(e).reduce(function(t,n){var r=e[n];switch(n){case"class":t.className=r,delete t.class;break;default:t[n]=r}return t},{})}function gE(e,t,n){return n?Un.createElement(e.tag,fe(fe({key:t},bN(e.attrs)),n),(e.children||[]).map(function(r,i){return gE(r,"".concat(t,"-").concat(e.tag,"-").concat(i))})):Un.createElement(e.tag,fe({key:t},bN(e.attrs)),(e.children||[]).map(function(r,i){return gE(r,"".concat(t,"-").concat(e.tag,"-").concat(i))}))}function KU(e){return mE(e)[0]}function WU(e){return e?Array.isArray(e)?e:[e]:[]}var Cwe=` .anticon { display: inline-block; color: inherit; font-style: normal; line-height: 0; text-align: center; text-transform: none; vertical-align: -0.125em; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .anticon > * { line-height: 1; } .anticon svg { display: inline-block; } .anticon::before { display: none; } .anticon .anticon-icon { display: block; } .anticon[tabindex] { cursor: pointer; } .anticon-spin::before, .anticon-spin { display: inline-block; -webkit-animation: loadingCircle 1s infinite linear; animation: loadingCircle 1s infinite linear; } @-webkit-keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes loadingCircle { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } `,Swe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cwe,n=w.exports.useContext(UU),r=n.csp,i=n.prefixCls,o=t;i&&(o=o.replace(/anticon/g,i)),w.exports.useEffect(function(){jv(o,"@ant-design-icons",{prepend:!0,csp:r})},[])},Ewe=["icon","className","onClick","style","primaryColor","secondaryColor"],Rg={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1};function Pwe(e){var t=e.primaryColor,n=e.secondaryColor;Rg.primaryColor=t,Rg.secondaryColor=n||KU(t),Rg.calculated=!!n}function Iwe(){return fe({},Rg)}var dw=function(t){var n=t.icon,r=t.className,i=t.onClick,o=t.style,s=t.primaryColor,a=t.secondaryColor,u=Rn(t,Ewe),d=Rg;if(s&&(d={primaryColor:s,secondaryColor:a||KU(s)}),Swe(),wwe(xN(n),"icon should be icon definiton, but got ".concat(n)),!xN(n))return null;var p=n;return p&&typeof p.icon=="function"&&(p=fe(fe({},p),{},{icon:p.icon(d.primaryColor,d.secondaryColor)})),gE(p.icon,"svg-".concat(p.name),fe({className:r,onClick:i,style:o,"data-icon":p.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},u))};dw.displayName="IconReact";dw.getTwoToneColors=Iwe;dw.setTwoToneColors=Pwe;const PT=dw;function GU(e){var t=WU(e),n=Le(t,2),r=n[0],i=n[1];return PT.setTwoToneColors({primaryColor:r,secondaryColor:i})}function Twe(){var e=PT.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor}var kwe=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];GU("#1890ff");var fw=w.exports.forwardRef(function(e,t){var n,r=e.className,i=e.icon,o=e.spin,s=e.rotate,a=e.tabIndex,u=e.onClick,d=e.twoToneColor,p=Rn(e,kwe),m=w.exports.useContext(UU),v=m.prefixCls,x=v===void 0?"anticon":v,_=m.rootClassName,P=He(_,x,(n={},re(n,"".concat(x,"-").concat(i.name),!!i.name),re(n,"".concat(x,"-spin"),!!o||i.name==="loading"),n),r),k=a;k===void 0&&u&&(k=-1);var T=s?{msTransform:"rotate(".concat(s,"deg)"),transform:"rotate(".concat(s,"deg)")}:void 0,M=WU(d),O=Le(M,2),N=O[0],L=O[1];return I("span",{...fe(fe({role:"img","aria-label":i.name},p),{},{ref:t,tabIndex:k,onClick:u,className:P}),children:I(PT,{icon:i,primaryColor:N,secondaryColor:L,style:T})})});fw.displayName="AntdIcon";fw.getTwoToneColor=Twe;fw.setTwoToneColor=GU;const Qo=fw;var qU=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Ihe})})};qU.displayName="ArrowRightOutlined";const ZU=w.exports.forwardRef(qU);var XU=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:_B})})};XU.displayName="CheckCircleOutlined";const YU=w.exports.forwardRef(XU);var QU=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:CB})})};QU.displayName="CloseCircleOutlined";const Mwe=w.exports.forwardRef(QU);var JU=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:EB})})};JU.displayName="CloseOutlined";const Rwe=w.exports.forwardRef(JU);var ej=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:NU})})};ej.displayName="DownloadOutlined";const Awe=w.exports.forwardRef(ej);var Dwe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 000 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 00391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 00-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}}]},name:"fullscreen-exit",theme:"outlined"};const Owe=Dwe;var tj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Owe})})};tj.displayName="FullscreenExitOutlined";const Nwe=w.exports.forwardRef(tj);var Lwe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M290 236.4l43.9-43.9a8.01 8.01 0 00-4.7-13.6L169 160c-5.1-.6-9.5 3.7-8.9 8.9L179 329.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L370 423.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L290 236.4zm352.7 187.3c3.1 3.1 8.2 3.1 11.3 0l133.7-133.6 43.7 43.7a8.01 8.01 0 0013.6-4.7L863.9 169c.6-5.1-3.7-9.5-8.9-8.9L694.8 179c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L600.3 370a8.03 8.03 0 000 11.3l42.4 42.4zM845 694.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L654 600.3a8.03 8.03 0 00-11.3 0l-42.4 42.3a8.03 8.03 0 000 11.3L734 787.6l-43.9 43.9a8.01 8.01 0 004.7 13.6L855 864c5.1.6 9.5-3.7 8.9-8.9L845 694.9zm-463.7-94.6a8.03 8.03 0 00-11.3 0L236.3 733.9l-43.7-43.7a8.01 8.01 0 00-13.6 4.7L160.1 855c-.6 5.1 3.7 9.5 8.9 8.9L329.2 845c6.6-.8 9.4-8.9 4.7-13.6L290 787.6 423.7 654c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.4z"}}]},name:"fullscreen",theme:"outlined"};const Fwe=Lwe;var nj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Fwe})})};nj.displayName="FullscreenOutlined";const zwe=w.exports.forwardRef(nj);var $we={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M888.3 757.4h-53.8c-4.2 0-7.7 3.5-7.7 7.7v61.8H197.1V197.1h629.8v61.8c0 4.2 3.5 7.7 7.7 7.7h53.8c4.2 0 7.7-3.4 7.7-7.7V158.7c0-17-13.7-30.7-30.7-30.7H158.7c-17 0-30.7 13.7-30.7 30.7v706.6c0 17 13.7 30.7 30.7 30.7h706.6c17 0 30.7-13.7 30.7-30.7V765.1c0-4.3-3.5-7.7-7.7-7.7zM902 476H588v-76c0-6.7-7.8-10.5-13-6.3l-141.9 112a8 8 0 000 12.6l141.9 112c5.3 4.2 13 .4 13-6.3v-76h314c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z"}}]},name:"import",theme:"outlined"};const Bwe=$we;var rj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Bwe})})};rj.displayName="ImportOutlined";const Vwe=w.exports.forwardRef(rj);var ij=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:TB})})};ij.displayName="InfoCircleOutlined";const oj=w.exports.forwardRef(ij);var aj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:G$})})};aj.displayName="LoadingOutlined";const IT=w.exports.forwardRef(aj);var Uwe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M868 732h-70.3c-4.8 0-9.3 2.1-12.3 5.8-7 8.5-14.5 16.7-22.4 24.5a353.84 353.84 0 01-112.7 75.9A352.8 352.8 0 01512.4 866c-47.9 0-94.3-9.4-137.9-27.8a353.84 353.84 0 01-112.7-75.9 353.28 353.28 0 01-76-112.5C167.3 606.2 158 559.9 158 512s9.4-94.2 27.8-137.8c17.8-42.1 43.4-80 76-112.5s70.5-58.1 112.7-75.9c43.6-18.4 90-27.8 137.9-27.8 47.9 0 94.3 9.3 137.9 27.8 42.2 17.8 80.1 43.4 112.7 75.9 7.9 7.9 15.3 16.1 22.4 24.5 3 3.7 7.6 5.8 12.3 5.8H868c6.3 0 10.2-7 6.7-12.3C798 160.5 663.8 81.6 511.3 82 271.7 82.6 79.6 277.1 82 516.4 84.4 751.9 276.2 942 512.4 942c152.1 0 285.7-78.8 362.3-197.7 3.4-5.3-.4-12.3-6.7-12.3zm88.9-226.3L815 393.7c-5.3-4.2-13-.4-13 6.3v76H488c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h314v76c0 6.7 7.8 10.5 13 6.3l141.9-112a8 8 0 000-12.6z"}}]},name:"logout",theme:"outlined"};const jwe=Uwe;var sj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:jwe})})};sj.displayName="LogoutOutlined";const Hwe=w.exports.forwardRef(sj);var lj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:n7})})};lj.displayName="RightOutlined";const Kwe=w.exports.forwardRef(lj);var uj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:R9})})};uj.displayName="SearchOutlined";const TT=w.exports.forwardRef(uj);var Wwe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M924.8 625.7l-65.5-56c3.1-19 4.7-38.4 4.7-57.8s-1.6-38.8-4.7-57.8l65.5-56a32.03 32.03 0 009.3-35.2l-.9-2.6a443.74 443.74 0 00-79.7-137.9l-1.8-2.1a32.12 32.12 0 00-35.1-9.5l-81.3 28.9c-30-24.6-63.5-44-99.7-57.6l-15.7-85a32.05 32.05 0 00-25.8-25.7l-2.7-.5c-52.1-9.4-106.9-9.4-159 0l-2.7.5a32.05 32.05 0 00-25.8 25.7l-15.8 85.4a351.86 351.86 0 00-99 57.4l-81.9-29.1a32 32 0 00-35.1 9.5l-1.8 2.1a446.02 446.02 0 00-79.7 137.9l-.9 2.6c-4.5 12.5-.8 26.5 9.3 35.2l66.3 56.6c-3.1 18.8-4.6 38-4.6 57.1 0 19.2 1.5 38.4 4.6 57.1L99 625.5a32.03 32.03 0 00-9.3 35.2l.9 2.6c18.1 50.4 44.9 96.9 79.7 137.9l1.8 2.1a32.12 32.12 0 0035.1 9.5l81.9-29.1c29.8 24.5 63.1 43.9 99 57.4l15.8 85.4a32.05 32.05 0 0025.8 25.7l2.7.5a449.4 449.4 0 00159 0l2.7-.5a32.05 32.05 0 0025.8-25.7l15.7-85a350 350 0 0099.7-57.6l81.3 28.9a32 32 0 0035.1-9.5l1.8-2.1c34.8-41.1 61.6-87.5 79.7-137.9l.9-2.6c4.5-12.3.8-26.3-9.3-35zM788.3 465.9c2.5 15.1 3.8 30.6 3.8 46.1s-1.3 31-3.8 46.1l-6.6 40.1 74.7 63.9a370.03 370.03 0 01-42.6 73.6L721 702.8l-31.4 25.8c-23.9 19.6-50.5 35-79.3 45.8l-38.1 14.3-17.9 97a377.5 377.5 0 01-85 0l-17.9-97.2-37.8-14.5c-28.5-10.8-55-26.2-78.7-45.7l-31.4-25.9-93.4 33.2c-17-22.9-31.2-47.6-42.6-73.6l75.5-64.5-6.5-40c-2.4-14.9-3.7-30.3-3.7-45.5 0-15.3 1.2-30.6 3.7-45.5l6.5-40-75.5-64.5c11.3-26.1 25.6-50.7 42.6-73.6l93.4 33.2 31.4-25.9c23.7-19.5 50.2-34.9 78.7-45.7l37.9-14.3 17.9-97.2c28.1-3.2 56.8-3.2 85 0l17.9 97 38.1 14.3c28.7 10.8 55.4 26.2 79.3 45.8l31.4 25.8 92.8-32.9c17 22.9 31.2 47.6 42.6 73.6L781.8 426l6.5 39.9zM512 326c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm79.2 255.2A111.6 111.6 0 01512 614c-29.9 0-58-11.7-79.2-32.8A111.6 111.6 0 01400 502c0-29.9 11.7-58 32.8-79.2C454 401.6 482.1 390 512 390c29.9 0 58 11.6 79.2 32.8A111.6 111.6 0 01624 502c0 29.9-11.7 58-32.8 79.2z"}}]},name:"setting",theme:"outlined"};const Gwe=Wwe;var cj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Gwe})})};cj.displayName="SettingOutlined";const qwe=w.exports.forwardRef(cj);var Zwe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"};const Xwe=Zwe;var dj=function(t,n){return I(Qo,{...fe(fe({},t),{},{ref:n,icon:Xwe})})};dj.displayName="UploadOutlined";const Ywe=w.exports.forwardRef(dj),Qwe=({onClose:e})=>{const{filters:t,ranges:n,setFilterWithKey:r}=va(),{data:i}=oI(),o=w.exports.useMemo(()=>sv(i),[i]),s=w.exports.useMemo(()=>{let u=0;return ms.map(d=>{Qh(t,n,d).result&&(u+=1)}),u},[t,n]),a=()=>{ms.map(u=>{r(n[u],u)})};return $e("div",{className:"ml-4 bg-white rounded-xl z-20 mt-[5vh] shadow-2xl",style:{maxHeight:"90vh",width:"350px",maxWidth:"450px"},children:[$e("div",{className:"flex items-center justify-between font-semibold p-4 border-0 border-b border-solid border-gray-300",children:["\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",I(Rwe,{onClick:e})]}),$e("div",{style:{maxHeight:"calc(90vh - 150px)"},className:"overflow-y-scroll py-3 px-6",children:[I(ll,{bordered:!1,expandIconPosition:"end",style:{background:"none"},className:"filter_group my-4",children:I(ll.Panel,{header:I(xl,{type:"primary",text:"\u041E\u0431\u0449\u0438\u0435",classNameText:"text-black"}),forceRender:!0,children:$e("div",{className:"mt-4 mb-12",children:[I("div",{children:I(ia,{filterRange:[t.doors__gt,t.doors__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u043E\u0432 \u0432 \u0436\u0438\u043B\u043E\u043C \u0434\u043E\u043C\u0435",fullRange:n.doors||[0,0],filterKey:"doors"})}),I("div",{children:I(ia,{filterRange:[t.flat_cnt__gt,t.flat_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",fullRange:n.flat_cnt||[0,0],filterKey:"flat_cnt"})})]})},"filter_common")}),I(ll,{bordered:!1,expandIconPosition:"end",style:{background:"none"},className:"filter_group my-4",children:I(ll.Panel,{header:I(xl,{type:"primary",text:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438 500\u043C",classNameText:"text-black"}),forceRender:!0,children:$e("div",{className:"mt-4 mb-12",children:[I("div",{children:I(ia,{filterRange:[t.rival_post_cnt__gt,t.rival_post_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0442\u0435\u0439",fullRange:n.rival_post_cnt||[0,0],filterKey:"rival_post_cnt"})}),I("div",{children:I(ia,{filterRange:[t.rival_pvz_cnt__gt,t.rival_pvz_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u041F\u0412\u0417",fullRange:n.rival_pvz_cnt||[0,0],filterKey:"rival_pvz_cnt"})}),I("div",{children:I(ia,{filterRange:[t.target_post_cnt__gt,t.target_post_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",fullRange:n.target_post_cnt||[0,0],filterKey:"target_post_cnt"})}),I("div",{children:I(ia,{filterRange:[t.flats_cnt__gt,t.flats_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438",fullRange:n.flats_cnt||[0,0],filterKey:"flats_cnt"})}),I("div",{children:I(ia,{filterRange:[t.tc_cnt__gt,t.tc_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432",fullRange:n.tc_cnt||[0,0],filterKey:"tc_cnt"})}),I("div",{children:I(ia,{filterRange:[t.culture_cnt__gt,t.culture_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B (\u0442\u0435\u0430\u0442\u0440\u044B, \u043C\u0443\u0437\u0435\u0439 \u0438 \u0442\u0434)",fullRange:n.culture_cnt||[0,0],filterKey:"culture_cnt"})}),I("div",{children:I(ia,{filterRange:[t.mfc_cnt__gt,t.mfc_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u041C\u0424\u0426",fullRange:n.mfc_cnt||[0,0],filterKey:"mfc_cnt"})}),I("div",{children:I(ia,{filterRange:[t.public_stop_cnt__gt,t.public_stop_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043E\u043A \u041E\u0422",fullRange:n.public_stop_cnt||[0,0],filterKey:"public_stop_cnt"})}),I("div",{children:I(ia,{filterRange:[t.supermarket_cnt__gt,t.supermarket_cnt__lt],title:"\u041A\u043E\u043B-\u0432\u043E \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432",fullRange:n.supermarket_cnt||[0,0],filterKey:"supermarket_cnt"})}),I("div",{children:I(ia,{filterRange:[t.target_dist__gt,t.target_dist__lt],title:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",fullRange:n.target_dist||[0,0],filterKey:"target_dist"})}),I("div",{children:I(ia,{filterRange:[t.metro_dist__gt,t.metro_dist__lt],title:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043C\u0435\u0442\u0440\u043E",fullRange:n.metro_dist||[0,0],filterKey:"metro_dist"})})]})},"filter_dist")}),o.map(u=>I(ll,{bordered:!1,expandIconPosition:"end",style:{background:"none"},className:"filter_group my-4",children:I(ll.Panel,{header:I(xl,{type:"primary",text:Yz[u.name],classNameText:"text-black"}),forceRender:!0,children:I("div",{className:"mt-4 mb-12",children:u.groups.map(d=>I("div",{children:I(ia,{filterRange:[t[`d${d.id}__gt`],t[`d${d.id}__lt`]],title:d.name,fullRange:n[`d${d.id}`]||[0,0],filterKey:`d${d.id}`,dynamicKey:!0})},d.id))})},`filter_${u.id}`)},`filter_${u.id}`))]}),$e("div",{className:"flex items-center justify-between p-4 border-0 border-t border-solid border-gray-300",children:[$e("span",{children:["\u0412\u044B\u0431\u0440\u0430\u043D\u043E: ",s]}),I("div",{className:"flex gap-2",children:I($n,{disabled:s===0,onClick:()=>a(),type:"secondary",children:"\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u0444\u0438\u043B\u044C\u0442\u0440\u044B"})})]})]})},Jwe=()=>{const{filters:e,ranges:t}=va(),n=w.exports.useMemo(()=>{let u=0;return ms.map(d=>{Qh(e,t,d).result&&(u+=1)}),u},[e,t]),r=()=>{const u=ms.map(d=>{if(Qh(e,t,d).result)return d}).filter(d=>!!d);return u.length===0?I("p",{className:"my-0.5 text-white",children:"\u041D\u0435 \u0432\u044B\u0431\u0440\u0430\u043D\u043E \u043D\u0438 \u043E\u0434\u043D\u043E\u0433\u043E \u0444\u0438\u043B\u044C\u0442\u0440\u0430"}):I("ul",{className:"mb-0 max-w-[300px] pl-5",children:Object.keys(J1).map(d=>{const p=J1[d],m=[];if(u.map(v=>{p[v]&&m.push(p[v])}),m.length!==0)return $e("li",{className:"text-white",children:[I("span",{}),p.name+" ",$e("span",{className:"text-gray-400",children:["(",m.join(", "),")"]})]})})})},[i,o]=w.exports.useState(!1),s=u=>{o(u)},a=()=>I(Qwe,{onClose:()=>o(!1)});return I(qv,{trigger:"click",dropdownRender:()=>a(),onOpenChange:s,open:i,forceRender:!0,placement:"right",children:$e($n,{onClick:u=>u.stopPropagation(),className:"w-full text-left flex justify-between items-center border-0 p-0 mt-16",children:[$e("div",{className:"flex gap-2 items-center",children:["\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0435 \u0444\u0438\u043B\u044C\u0442\u0440\u044B",I(bf,{content:r,trigger:"hover",placement:"rightBottom",className:"rounded-xl mt-0.5 bg-gray-200 p-1 flex justify-center items-center w-[22px] h-[22px] z-10 !text-black",color:"#000000cc",zIndex:4e3,children:n})]}),I(Kwe,{rotate:i?180:0,className:"mt-0.5 mr-1"})]})})},e4e=Object.entries(nI).map(([e,t])=>({value:t,label:t})),t4e=({disabled:e})=>{const{filters:{categories:t},setCategories:n}=va();return $e("div",{children:[I(xl,{text:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438"}),I(vu,{mode:"tags",style:{width:"100%"},placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",onChange:n,options:e4e,allowClear:!0,value:t,disabled:e})]})},n4e=({disabled:e,fullRange:t,isLoading:n})=>{const{filters:{prediction:r},setPrediction:i}=va(),o=s=>i(s);return w.exports.useEffect(()=>{if(!t)return;const s=t.prediction[0],a=t.prediction[1];r[0]===Hd.prediction[0]&&r[1]===Hd.prediction[1]&&i([s,a])},[t]),n?I("div",{className:"flex justify-center items-center",children:I(vs,{})}):I(a0,{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:r,onAfterChange:o,min:t.prediction[0],max:t.prediction[1],range:!0,disabled:e})},r4e=({onSelectedChange:e})=>{const{data:t,isInitialLoading:n}=Gee(),{data:r,isInitialLoading:i,isFetching:o}=qee(),{selection:{excluded:s}}=Pl();return w.exports.useEffect(()=>e(r-s.size),[r,s]),$e("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u041E\u0442\u043E\u0431\u0440\u0430\u043D\u043E \u043B\u043E\u043A\u0430\u0446\u0438\u0439"}),n||i||o?I(vs,{}):I("span",{children:`${r-s.size} / ${t}`})]})},hw=({onSuccess:e})=>{const{toggleUpdateCounter:t}=bu(),n=ys();return NP({mutationFn:r=>Mi.put(`https://postamates.spatialsystems.ru/api/${n}/update_status/?${r.toString()}`),onSuccess:()=>{t(),e==null||e()}})},i4e=({disabled:e})=>{const{filters:t,ranges:n}=va(),{prediction:r,categories:i,region:o}=t,{selection:s}=Pl(),a=ff(),[u,d]=w.exports.useState(!1),{mutate:p,isLoading:m,isSuccess:v}=hw({onSuccess:()=>{a.invalidateQueries(["table",1,t])}}),x=()=>{const P=new URLSearchParams({status:jn.onApproval,"prediction_current[]":r,"categories[]":i,"included[]":[...s.included],"excluded[]":[...s.excluded]});v_(P,t,n),o&&(o.type==="ao"&&P.append("district[]",o.id),o.type==="rayon"&&P.append("area[]",o.id)),p(P)};return $e(Tn,{children:[$e($n,{type:"primary",block:!0,className:"mt-2",onClick:()=>d(!0),disabled:e,children:[I("span",{className:"mr-1",children:"\u0412\u0437\u044F\u0442\u044C \u0432 \u0440\u0430\u0431\u043E\u0442\u0443"}),I(ZU,{})]}),$e(t0,{title:" ",centered:!0,open:u,onCancel:()=>d(!1),closable:!0,footer:(()=>v?[I($n,{type:"primary",onClick:()=>d(!1),children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")]:m?null:$e("div",{className:"flex items-center justify-center gap-x-4",children:[I($n,{onClick:()=>d(!1),children:"\u041E\u0442\u043C\u0435\u043D\u0430"}),I($n,{type:"primary",onClick:x,children:"\u0414\u0430"})]}))(),children:[v?I(GB,{message:"\u0423\u0441\u043F\u0435\u0448\u043D\u043E",description:"\u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0442\u043E\u0447\u043A\u0438 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u044B \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435. \u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043D\u0430 \u043D\u0438\u0445 \u043C\u043E\u0436\u043D\u043E \u0432\u043E \u0432\u0442\u043E\u0440\u043E\u0439 \u0432\u043A\u043B\u0430\u0434\u043A\u0435",type:"success",showIcon:!0}):I(xl,{text:"\u0423\u0432\u0435\u0440\u0435\u043D\u044B, \u0447\u0442\u043E \u0445\u043E\u0442\u0438\u0442\u0435 \u0432\u0437\u044F\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438 \u0432 \u0440\u0430\u0431\u043E\u0442\u0443?",className:"text-center"}),m&&I("div",{className:"flex justify-center py-2",children:I(vs,{tip:"\u041E\u0442\u043F\u0440\u0430\u0432\u043B\u044F\u0435\u043C \u043D\u0430 \u0441\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435...",size:"large"})})]})]})},o4e=()=>{var L;const e=$ee(),{reset:t}=Pl(),{ranges:n,filters:r,setRegion:i,setFilterWithKey:o,setPrediction:s,setCategories:a,setRanges:u}=va(),d=ys(),{data:p}=nte(d);w.exports.useEffect(()=>{const F=p==null?void 0:p.fullRange;!F||(ms.map(V=>{if(!n[V]&&!!F[V]){o(F[V],V);return}const B=n[V]&&F[V]&&n[V][0]!==F[V][0],H=n[V]&&F[V]&&n[V][1]!==F[V][1];(B||H)&&o(F[V],V)}),rI(F,n)&&s(F.prediction),u({...n,...F}))},[p]);const[m,v]=w.exports.useState(!1),x=F=>{v(F===0)},[_,P]=w.exports.useState(!1);w.exports.useEffect(()=>{const F=setTimeout(()=>P(!1),1500);return()=>clearTimeout(F)},[_]);const k=()=>{P(!0)},T=()=>{P(!1)},M=VU(r,n,["prediction"]),O=()=>{ms.map(F=>{o(n[F],F)}),s(n.prediction),a([]),i(null)},N=r.region||M.prediction||r.categories.length!==0;return $e("div",{className:"flex flex-col flex-1 justify-between",children:[$e("div",{children:[$e($i,{title:mee,placement:"right",open:e&&_,onMouseEnter:k,onMouseLeave:T,children:[$e("div",{className:"space-y-5",children:[I(ET,{disabled:e,value:(L=r.region)==null?void 0:L.id,onChange:i}),I(t4e,{disabled:e}),p!=null&&p.isLoading?I(vs,{}):$e(Tn,{children:[I(n4e,{disabled:e,fullRange:n,isLoading:!1}),I(Jwe,{})]})]}),N&&I(ST,{onClick:O,disabled:e})]}),e?I($n,{block:!0,className:"mt-2",onClick:t,children:"\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C \u0440\u0443\u0447\u043D\u043E\u0435 \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u0435"}):null]}),$e("div",{children:[I(r4e,{onSelectedChange:x}),I(i4e,{disabled:m})]})]})},_N={region:null},a4e=e=>({filters:_N,setRegion:t=>e(n=>{n.filters.region=t}),clear:()=>e(t=>{t.filters=_N})}),Cf=Sl(Bv(El(a4e),{name:"postnet/on-approval-filters"})),s4e={[Cn.initial]:!0,[Cn.approve]:!0,[Cn.working]:!0,[Cn.filteredWorking]:!1,[Cn.cancelled]:!0,[Cn.pvz]:!0,[Cn.other]:!0},l4e=[Cn.pvz,Cn.other],u4e=e=>({isVisible:s4e,toggleVisibility:t=>e(n=>{n.isVisible[t]=!n.isVisible[t]}),showLayers:t=>e(n=>{t.forEach(r=>{n.isVisible[r]=!0})}),setLayersVisibility:t=>e(n=>{t.forEach(i=>{n.isVisible[i]=!0}),Object.keys(n.isVisible).filter(i=>!t.includes(i)&&!l4e.includes(i)).forEach(i=>{n.isVisible[i]=!1})})}),Ks=Sl(Bv(El(u4e),{name:"postnet/layers-visibility"})),c4e=()=>{const{filters:{region:e},setRegion:t,clear:n}=Cf(),{isVisible:r,toggleVisibility:i,showLayers:o}=Ks(),s=e||!r[Cn.approve]||!r[Cn.working]||!r[Cn.cancelled],a=()=>{n(),o([Cn.approve,Cn.working,Cn.cancelled])};return $e("div",{className:"space-y-4",children:[I(ET,{value:e==null?void 0:e.id,onChange:t}),$e("div",{children:[I(xl,{text:"\u0421\u0442\u0430\u0442\u0443\u0441\u044B"}),$e("div",{className:"flex flex-col space-y-2",children:[I(bc,{onChange:()=>i(Cn.approve),checked:r[Cn.approve],children:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430"}),I(bc,{className:"!ml-0",onChange:()=>i(Cn.working),checked:r[Cn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u0435\u0442"}),I(bc,{className:"!ml-0",onChange:()=>i(Cn.cancelled),checked:r[Cn.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D"})]})]}),s&&I(ST,{onClick:a})]})},cu={region:null,deltaTraffic:[-1e4,1e4],factTraffic:[-100,0],age:[-1,0]},d4e={region:null,deltaTraffic:[-1e4,1e4],factTraffic:[-100,0],age:[-1,0]},f4e=e=>({filters:cu,ranges:d4e,setDeltaTraffic:t=>{e(n=>{n.filters.deltaTraffic=t})},setFactTraffic:t=>{e(n=>{n.filters.factTraffic=t})},setAge:t=>{e(n=>{n.filters.age=t})},setRegion:t=>e(n=>{n.filters.region=t}),setRanges:t=>e(n=>{n.ranges=t}),clear:t=>e(n=>{if(!t)return n.filters=cu,n;const{deltaTraffic:r,factTraffic:i,age:o}=t;n.filters={...cu,deltaTraffic:r,factTraffic:i,age:o}})}),$c=Sl(Bv(El(f4e),{name:"postnet/working-filters"})),h4e=({fullRange:e})=>{const{filters:{age:t},setAge:n}=$c(),r=i=>n(i);return w.exports.useEffect(()=>{const i=e.age[0],o=e.age[1];t[0]===cu.age[0]&&t[1]===cu.age[1]&&n([i,o])},[e,t]),I(a0,{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430, \u0434\u043D\u0435\u0439",value:t,onAfterChange:r,min:e.age[0],max:e.age[1],range:!0})},p4e=({fullRange:e})=>{const{filters:{deltaTraffic:t},setDeltaTraffic:n}=$c(),r=i=>n(i);return w.exports.useEffect(()=>{const i=e.deltaTraffic[0],o=e.deltaTraffic[1];t[0]===cu.deltaTraffic[0]&&t[1]===cu.deltaTraffic[1]&&n([i,o])},[e,t]),I(a0,{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u0430 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C, %",value:t,onAfterChange:r,min:e.deltaTraffic[0],max:e.deltaTraffic[1],range:!0,showZeroMark:!0})},m4e=({fullRange:e})=>{const{filters:{factTraffic:t},setFactTraffic:n}=$c(),r=i=>n(i);return w.exports.useEffect(()=>{const i=e.factTraffic[0],o=e.factTraffic[1];t[0]===cu.factTraffic[0]&&t[1]===cu.factTraffic[1]&&n([i,o])},[e,t]),I(a0,{title:"\u0424\u0430\u043A\u0442\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",value:t,onAfterChange:r,min:e.factTraffic[0],max:e.factTraffic[1],range:!0})},g4e=()=>{const e=ys();return Vi(["working-max-min"],async()=>{const{data:t}=await Mi.get(`https://postamates.spatialsystems.ru/api/${e}/filters?status[]=${jn.working}`);return t},{select:t=>({deltaTraffic:[t.delta_current[0],t.delta_current[1]],factTraffic:[t.fact[0],t.fact[1]],age:[t.age_day[0],t.age_day[1]]})})},v4e=()=>{var x;const{filters:e,ranges:t,setRegion:n,setAge:r,setDeltaTraffic:i,setRanges:o,setFactTraffic:s,clear:a}=$c(),{data:u,isInitialLoading:d}=g4e();w.exports.useEffect(()=>{if(!u)return;const _=u;Dh(_.deltaTraffic,t,"deltaTraffic")&&i(u.deltaTraffic),Dh(_.factTraffic,t,"factTraffic")&&s(u.deltaTraffic),Dh(_.age,t,"age")&&r(u.deltaTraffic),o({..._})},[u]);const p=VU(e,u,["deltaTraffic","factTraffic","age"]),m=e.region||p.deltaTraffic||p.factTraffic||p.age,v=()=>a(u);return $e("div",{children:[I(ET,{value:(x=e.region)==null?void 0:x.id,onChange:n}),I("div",{className:"space-y-12 mt-4",children:d?I("div",{className:"flex justify-center items-center",children:I(vs,{})}):$e(Tn,{children:[I(p4e,{fullRange:u}),I(m4e,{fullRange:u}),I(h4e,{fullRange:u})]})}),m&&I(ST,{onClick:v})]})},y4e=({isOpened:e,onClose:t})=>{const{setImportMode:n}=Do(),[r,i]=w.exports.useState(!1),{data:o,isInitialLoading:s}=Zee(),[a,u]=w.exports.useState(!1),{mutateAsync:d}=Xee(),p=async()=>{i(!0);try{await d(),u(!0)}catch{}finally{i(!1)}},m=()=>a?[I($n,{type:"primary",onClick:()=>{t(),n(!1)},disabled:r,children:"\u0425\u043E\u0440\u043E\u0448\u043E"},"ok-button")]:[I($n,{type:"default",onClick:t,children:"\u041D\u0430\u0437\u0430\u0434"},"close-button"),I($n,{type:"primary",onClick:()=>p(),disabled:r,children:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044C"},"ok-button")],v=()=>s?I(vs,{}):r?$e("div",{className:"flex flex-col justify-center gap-2 items-center",children:[I(vs,{indicator:I(IT,{style:{fontSize:32},spin:!0})}),"\u0414\u043E\u0431\u0430\u0432\u043B\u044F\u0435\u043C \u0442\u043E\u0447\u043A\u0438..."]}):a?$e("div",{className:"flex items-center justify-center font-bold gap-2",children:[I(YU,{style:{fontSize:24,color:"#52C41A"}}),"\u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E ",o," \u043D\u043E\u0432\u044B\u0445 \u0442\u043E\u0447\u0435\u043A"]}):$e("div",{className:"flex flex-row gap-4",children:[I(oj,{style:{fontSize:24,color:"#FFC53D"}}),$e("div",{className:"flex flex-col gap-2",children:[I("p",{className:"font-bold mb-0",children:"\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u0438\u0435"}),$e("p",{children:["\u0412 \u0431\u0430\u0437\u0443 \u0434\u0430\u043D\u043D\u044B\u0445 \u0431\u0443\u0434\u0435\u0442 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043E ",o," \u043D\u043E\u0432\u044B\u0445 \u0442\u043E\u0447\u0435\u043A."]})]})]});return I(t0,{open:e,title:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0431\u0430\u0437\u0443",onCancel:t,width:400,footer:m(),children:v()})},x4e=({setFileId:e})=>{const t=w.exports.useRef(null),[n,r]=w.exports.useState(!0),i=async s=>{const{onSuccess:a,onError:u,file:d,onProgress:p}=s,m={onUploadProgress:v=>{const x=Math.floor(v.loaded/v.total*100);p({percent:x})}};try{const{id:v}=await Hee(d,m);a("Ok"),e(v)}catch{}},o=async()=>{const s=await jee();await Qz("template.xlsx",s)};return w.exports.useLayoutEffect(()=>{t&&t.current&&!n&&(t.current.click(),r(!0))},[n]),$e(Tn,{children:[I(dwe,{name:"file",accept:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",customRequest:i,children:I($n,{icon:I(Ywe,{}),children:"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B .xlsx"})}),I($n,{className:"p-0 text-xs text-grey underline",type:"text",onClick:o,children:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D"})]})},b4e=({report:e})=>$e(Tn,{children:[$e(sc,{className:da("p-1"),children:[I(Io,{className:"text-gray-600",span:12,children:"\u0412\u0441\u0435\u0433\u043E \u0442\u043E\u0447\u0435\u043A:"}),I(Io,{className:"font-semibold",span:12,children:e.total})]}),$e(sc,{className:da("p-1"),children:[I(Io,{className:"text-gray-600",span:12,children:"\u0421\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0439:"}),I(Io,{className:"font-semibold text-[#2f54eb]",span:12,children:e.matched})]}),$e(sc,{className:da("p-1"),children:[I(Io,{className:"text-gray-600",span:12,children:"\u041F\u0440\u043E\u0431\u043B\u0435\u043C\u043D\u044B\u0435:"}),I(Io,{className:"font-semibold text-[#f5222d]",span:12,children:e.error})]}),$e(sc,{className:da("p-1"),children:[I(Io,{className:"text-gray-600",span:12,children:"\u041D\u043E\u0432\u044B\u0435:"}),I(Io,{className:"font-semibold text-[#52c41a]",span:12,children:e.unmatched})]})]}),_4e=({onClose:e,isOpened:t})=>{const[n,r]=w.exports.useState(),[i,o]=w.exports.useState(),[s,a]=w.exports.useState(!1),[u,d]=w.exports.useState(!1),[p,m]=w.exports.useState(!1),[v,x]=w.exports.useState("\u0418\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u0443\u0435\u043C \u0442\u043E\u0447\u043A\u0438..."),{toggleUpdateCounter:_}=bu(),P=async()=>{a(!0);try{await Kee(n);const M=setInterval(async()=>{const O=await Wee();x(O.task_status),(O.task_status==="\u041F\u0435\u0440\u0435\u0440\u0430\u0441\u0447\u0435\u0442 ML \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D"||!t)&&(o(O.data),a(!1),_(),clearInterval(M))},2e3);_()}catch{m(!0),a(!1)}},k=()=>p?[I($n,{type:"primary",onClick:e,children:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C"},"error-button")]:u?[I($n,{type:"primary",onClick:e,children:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043A \u0432\u044B\u0431\u043E\u0440\u0443"},"finish-button")]:i?[I($n,{type:"primary",onClick:()=>d(!0),children:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043E\u0442\u0447\u0435\u0442"},"report-button")]:[I($n,{type:"primary",onClick:()=>P(),disabled:!n||s,children:"\u0418\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C"},"ok-button")],T=()=>p?$e("div",{className:"flex items-center justify-center font-bold gap-2",children:[I(Mwe,{style:{fontSize:24,color:"#FF4D4F"}}),"\u041F\u0440\u0438 \u0438\u043C\u043F\u043E\u0440\u0442\u0435 \u0442\u043E\u0447\u0435\u043A \u043F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430"]}):s?$e("div",{className:"flex flex-col justify-center gap-2 items-center",children:[I(vs,{indicator:I(IT,{style:{fontSize:64},spin:!0})}),v]}):u?I(b4e,{report:i}):i?$e("div",{className:"flex items-center justify-center font-bold gap-2",children:[I(YU,{style:{fontSize:24,color:"#52C41A"}}),"\u0422\u043E\u0447\u043A\u0438 \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0438\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u044B"]}):I(x4e,{setFileId:r});return I(t0,{open:t,title:"\u0418\u043C\u043F\u043E\u0440\u0442 \u0442\u043E\u0447\u0435\u043A",onCancel:()=>{s||e()},width:400,footer:k(),children:T()})},w4e=()=>{const{mode:e,isImportMode:t,setImportMode:n}=Do(),[r,i]=w.exports.useState(!1),[o,s]=w.exports.useState(!1),a=()=>{n(!1)},u=()=>{n(!0),i(!0)},d=!0;return t?$e("div",{className:"flex flex-row flex-0 gap-2 border-t-[1px] border-b-[1px]",children:[I($n,{type:"default",onClick:a,children:"\u041E\u0442\u043C\u0435\u043D\u0430"}),I($n,{type:"primary",className:"flex-1",onClick:()=>s(!0),children:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0431\u0430\u0437\u0443"}),r&&I(_4e,{isOpened:r,onClose:()=>i(!1)}),o&&I(y4e,{isOpened:o,onClose:()=>s(!1)})]}):e===Gr.PENDING&&d&&I("div",{className:"flex flex-col flex-0 border-t-[1px] border-b-[1px]",children:$e($n,{type:"default",onClick:u,children:[I(Vwe,{}),"\u0418\u043C\u043F\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C"]})})},C4e=w.exports.forwardRef(({isCollapsed:e},t)=>{const{mode:n}=Do(),r=()=>n===Gr.PENDING?I(o4e,{}):n===Gr.ON_APPROVAL?I(c4e,{}):I(v4e,{});return $e("div",{className:da("h-screen p-3 overflow-y-auto shrink-0 border-solid border-border border-0 border-r-[1px] flex flex-col transition-all pt-20",e?"basis-0 px-0 -translate-x-[320px]":"basis-[320px]"),ref:t,children:[I(w4e,{}),I("div",{className:"flex flex-col flex-1",children:r()})]})}),S4e=e=>({clickedPointConfig:null,setClickedPointConfig:(t,n=!1)=>{e(r=>{if(t===null)return r.clickedPointConfig=null,r;r.clickedPointConfig={id:t,shouldSelect:n}})}}),Su=Sl(El(S4e)),E4e=e=>({popup:null,setPopup:t=>{e(n=>{if(!t)return n.popup=null,n;n.popup=t})}}),Sf=Sl(El(E4e)),op=30,kT=e=>{Qz("postamates.xlsx",e)},P4e=({provider:e})=>{const[t,n]=w.exports.useState(!1);return e(t,()=>n(!1)),I($i,{title:"\u0421\u043A\u0430\u0447\u0430\u0442\u044C \u0434\u0430\u043D\u043D\u044B\u0435",children:I($n,{onClick:i=>{i.stopPropagation(),n(!0)},loading:t,disabled:t,children:I(Awe,{})})})},I4e={isOpened:!1,fullScreen:!1},T4e=e=>({tableState:I4e,toggleOpened:t=>{e(n=>{n.tableState.isOpened=t[0]==="opened"})},toggleFullScreen:()=>{e(t=>{t.tableState.fullScreen=!t.tableState.fullScreen})},openTable:()=>{e(t=>{t.tableState.isOpened=!0})}}),s0=Sl(El(T4e));function fj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,eb(e,t)}function aa(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var wN=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),c2=function(){return Math.random().toString(36).substring(7).split("").join(".")},CN={INIT:"@@redux/INIT"+c2(),REPLACE:"@@redux/REPLACE"+c2(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+c2()}};function k4e(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function hj(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(aa(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(aa(1));return n(hj)(e,t)}if(typeof e!="function")throw new Error(aa(2));var i=e,o=t,s=[],a=s,u=!1;function d(){a===s&&(a=s.slice())}function p(){if(u)throw new Error(aa(3));return o}function m(P){if(typeof P!="function")throw new Error(aa(4));if(u)throw new Error(aa(5));var k=!0;return d(),a.push(P),function(){if(!!k){if(u)throw new Error(aa(6));k=!1,d();var M=a.indexOf(P);a.splice(M,1),s=null}}}function v(P){if(!k4e(P))throw new Error(aa(7));if(typeof P.type>"u")throw new Error(aa(8));if(u)throw new Error(aa(9));try{u=!0,o=i(o,P)}finally{u=!1}for(var k=s=a,T=0;T=0;r--){var i=t[r](e);if(i)return i}return function(o,s){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+s.wrappedComponentName+".")}}function PCe(e,t){return e===t}function ICe(e){var t=e===void 0?{}:e,n=t.connectHOC,r=n===void 0?sCe:n,i=t.mapStateToPropsFactories,o=i===void 0?mCe:i,s=t.mapDispatchToPropsFactories,a=s===void 0?fCe:s,u=t.mergePropsFactories,d=u===void 0?bCe:u,p=t.selectorFactory,m=p===void 0?SCe:p;return function(x,_,P,k){k===void 0&&(k={});var T=k,M=T.pure,O=M===void 0?!0:M,N=T.areStatesEqual,L=N===void 0?PCe:N,F=T.areOwnPropsEqual,V=F===void 0?d2:F,B=T.areStatePropsEqual,H=B===void 0?d2:B,G=T.areMergedPropsEqual,ee=G===void 0?d2:G,X=uv(T,ECe),Z=f2(x,o,"mapStateToProps"),Q=f2(_,a,"mapDispatchToProps"),le=f2(P,d,"mergeProps");return r(m,ze({methodName:"connect",getDisplayName:function(se){return"Connect("+se+")"},shouldHandleStateChanges:Boolean(x),initMapStateToProps:Z,initMapDispatchToProps:Q,initMergeProps:le,pure:O,areStatesEqual:L,areOwnPropsEqual:V,areStatePropsEqual:H,areMergedPropsEqual:ee},X))}}const Tj=ICe();A4e(Cl.exports.unstable_batchedUpdates);function TCe(e,t){if(e.length!==t.length)return!1;for(var n=0;n");return r.callbacks},r.setCallbacks=function(a){r.callbacks=a},r}var n=t.prototype;return n.componentDidMount=function(){this.unbind=ss(window,[{eventName:"error",fn:this.onWindowError}])},n.componentDidCatch=function(i){if(i instanceof Tb){this.setState({});return}throw i},n.componentWillUnmount=function(){this.unbind()},n.render=function(){return this.props.children(this.setCallbacks)},t}(Un.Component),BCe=` Press space bar to start a drag. When dragging you can use the arrow keys to move the item around and escape to cancel. Some screen readers may require you to be in focus mode or to use your pass through key `,kb=function(t){return t+1},VCe=function(t){return` You have lifted an item in position `+kb(t.source.index)+` `},Dj=function(t,n){var r=t.droppableId===n.droppableId,i=kb(t.index),o=kb(n.index);return r?` You have moved the item from position `+i+` to position `+o+` `:` You have moved the item from position `+i+` in list `+t.droppableId+` to list `+n.droppableId+` in position `+o+` `},Oj=function(t,n,r){var i=n.droppableId===r.droppableId;return i?` The item `+t+` has been combined with `+r.draggableId:` The item `+t+` in list `+n.droppableId+` has been combined with `+r.draggableId+` in list `+r.droppableId+` `},UCe=function(t){var n=t.destination;if(n)return Dj(t.source,n);var r=t.combine;return r?Oj(t.draggableId,t.source,r):"You are over an area that cannot be dropped on"},LN=function(t){return` The item has returned to its starting position of `+kb(t.index)+` `},jCe=function(t){if(t.reason==="CANCEL")return` Movement cancelled. `+LN(t.source)+` `;var n=t.destination,r=t.combine;return n?` You have dropped the item. `+Dj(t.source,n)+` `:r?` You have dropped the item. `+Oj(t.draggableId,t.source,r)+` `:` The item has been dropped while not over a drop area. `+LN(t.source)+` `},c1={dragHandleUsageInstructions:BCe,onDragStart:VCe,onDragUpdate:UCe,onDragEnd:jCe},ao={x:0,y:0},po=function(t,n){return{x:t.x+n.x,y:t.y+n.y}},Ra=function(t,n){return{x:t.x-n.x,y:t.y-n.y}},wc=function(t,n){return t.x===n.x&&t.y===n.y},Ap=function(t){return{x:t.x!==0?-t.x:0,y:t.y!==0?-t.y:0}},sf=function(t,n,r){var i;return r===void 0&&(r=0),i={},i[t]=n,i[t==="x"?"y":"x"]=r,i},xv=function(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))},FN=function(t,n){return Math.min.apply(Math,n.map(function(r){return xv(t,r)}))},Nj=function(t){return function(n){return{x:t(n.x),y:t(n.y)}}},HCe=function(e,t){var n=zs({top:Math.max(t.top,e.top),right:Math.min(t.right,e.right),bottom:Math.min(t.bottom,e.bottom),left:Math.max(t.left,e.left)});return n.width<=0||n.height<=0?null:n},v0=function(t,n){return{top:t.top+n.y,left:t.left+n.x,bottom:t.bottom+n.y,right:t.right+n.x}},zN=function(t){return[{x:t.left,y:t.top},{x:t.right,y:t.top},{x:t.left,y:t.bottom},{x:t.right,y:t.bottom}]},KCe={top:0,right:0,bottom:0,left:0},WCe=function(t,n){return n?v0(t,n.scroll.diff.displacement):t},GCe=function(t,n,r){if(r&&r.increasedBy){var i;return ze({},t,(i={},i[n.end]=t[n.end]+r.increasedBy[n.line],i))}return t},qCe=function(t,n){return n&&n.shouldClipSubject?HCe(n.pageMarginBox,t):zs(t)},ap=function(e){var t=e.page,n=e.withPlaceholder,r=e.axis,i=e.frame,o=WCe(t.marginBox,i),s=GCe(o,r,n),a=qCe(s,i);return{page:t,withPlaceholder:n,active:a}},LT=function(e,t){e.frame||ln(!1);var n=e.frame,r=Ra(t,n.scroll.initial),i=Ap(r),o=ze({},n,{scroll:{initial:n.scroll.initial,current:t,diff:{value:r,displacement:i},max:n.scroll.max}}),s=ap({page:e.subject.page,withPlaceholder:e.subject.withPlaceholder,axis:e.axis,frame:o}),a=ze({},e,{frame:o,subject:s});return a};function Mb(e){return Object.values?Object.values(e):Object.keys(e).map(function(t){return e[t]})}function FT(e,t){if(e.findIndex)return e.findIndex(t);for(var n=0;ne.bottom,d=r.lefte.right,p=u&&d;if(p)return!0;var m=u&&s||d&&o;return m}},QCe=function(e){var t=cs(e.top,e.bottom),n=cs(e.left,e.right);return function(r){var i=t(r.top)&&t(r.bottom)&&n(r.left)&&n(r.right);return i}},$T={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Vj={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},JCe=function(e){return function(t){var n=cs(t.top,t.bottom),r=cs(t.left,t.right);return function(i){return e===$T?n(i.top)&&n(i.bottom):r(i.left)&&r(i.right)}}},e2e=function(t,n){var r=n.frame?n.frame.scroll.diff.displacement:ao;return v0(t,r)},t2e=function(t,n,r){return n.subject.active?r(n.subject.active)(t):!1},n2e=function(t,n,r){return r(n)(t)},BT=function(t){var n=t.target,r=t.destination,i=t.viewport,o=t.withDroppableDisplacement,s=t.isVisibleThroughFrameFn,a=o?e2e(n,r):n;return t2e(a,r,s)&&n2e(a,i,s)},r2e=function(t){return BT(ze({},t,{isVisibleThroughFrameFn:Bj}))},Uj=function(t){return BT(ze({},t,{isVisibleThroughFrameFn:QCe}))},i2e=function(t){return BT(ze({},t,{isVisibleThroughFrameFn:JCe(t.destination.axis)}))},o2e=function(t,n,r){if(typeof r=="boolean")return r;if(!n)return!0;var i=n.invisible,o=n.visible;if(i[t])return!1;var s=o[t];return s?s.shouldAnimate:!0};function a2e(e,t){var n=e.page.marginBox,r={top:t.point.y,right:0,bottom:0,left:t.point.x};return zs(OT(n,r))}function _v(e){var t=e.afterDragging,n=e.destination,r=e.displacedBy,i=e.viewport,o=e.forceShouldAnimate,s=e.last;return t.reduce(function(u,d){var p=a2e(d,r),m=d.descriptor.id;u.all.push(m);var v=r2e({target:p,destination:n,viewport:i,withDroppableDisplacement:!0});if(!v)return u.invisible[d.descriptor.id]=!0,u;var x=o2e(m,s,o),_={draggableId:m,shouldAnimate:x};return u.visible[m]=_,u},{all:[],visible:{},invisible:{}})}function s2e(e,t){if(!e.length)return 0;var n=e[e.length-1].descriptor.index;return t.inHomeList?n:n+1}function $N(e){var t=e.insideDestination,n=e.inHomeList,r=e.displacedBy,i=e.destination,o=s2e(t,{inHomeList:n});return{displaced:bv,displacedBy:r,at:{type:"REORDER",destination:{droppableId:i.descriptor.id,index:o}}}}function Rb(e){var t=e.draggable,n=e.insideDestination,r=e.destination,i=e.viewport,o=e.displacedBy,s=e.last,a=e.index,u=e.forceShouldAnimate,d=Op(t,r);if(a==null)return $N({insideDestination:n,inHomeList:d,displacedBy:o,destination:r});var p=Bc(n,function(P){return P.descriptor.index===a});if(!p)return $N({insideDestination:n,inHomeList:d,displacedBy:o,destination:r});var m=yw(t,n),v=n.indexOf(p),x=m.slice(v),_=_v({afterDragging:x,destination:r,displacedBy:o,last:s,viewport:i.frame,forceShouldAnimate:u});return{displaced:_,displacedBy:o,at:{type:"REORDER",destination:{droppableId:r.descriptor.id,index:a}}}}function Ac(e,t){return Boolean(t.effected[e])}var l2e=function(e){var t=e.isMovingForward,n=e.destination,r=e.draggables,i=e.combine,o=e.afterCritical;if(!n.isCombineEnabled)return null;var s=i.draggableId,a=r[s],u=a.descriptor.index,d=Ac(s,o);return d?t?u:u-1:t?u+1:u},u2e=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.insideDestination,i=e.location;if(!r.length)return null;var o=i.index,s=t?o+1:o-1,a=r[0].descriptor.index,u=r[r.length-1].descriptor.index,d=n?u:u+1;return sd?null:s},c2e=function(e){var t=e.isMovingForward,n=e.isInHomeList,r=e.draggable,i=e.draggables,o=e.destination,s=e.insideDestination,a=e.previousImpact,u=e.viewport,d=e.afterCritical,p=a.at;if(p||ln(!1),p.type==="REORDER"){var m=u2e({isMovingForward:t,isInHomeList:n,location:p.destination,insideDestination:s});return m==null?null:Rb({draggable:r,insideDestination:s,destination:o,viewport:u,last:a.displaced,displacedBy:a.displacedBy,index:m})}var v=l2e({isMovingForward:t,destination:o,displaced:a.displaced,draggables:i,combine:p.combine,afterCritical:d});return v==null?null:Rb({draggable:r,insideDestination:s,destination:o,viewport:u,last:a.displaced,displacedBy:a.displacedBy,index:v})},d2e=function(e){var t=e.displaced,n=e.afterCritical,r=e.combineWith,i=e.displacedBy,o=Boolean(t.visible[r]||t.invisible[r]);return Ac(r,n)?o?ao:Ap(i.point):o?i.point:ao},f2e=function(e){var t=e.afterCritical,n=e.impact,r=e.draggables,i=vw(n);i||ln(!1);var o=i.draggableId,s=r[o].page.borderBox.center,a=d2e({displaced:n.displaced,afterCritical:t,combineWith:o,displacedBy:n.displacedBy});return po(s,a)},jj=function(t,n){return n.margin[t.start]+n.borderBox[t.size]/2},h2e=function(t,n){return n.margin[t.end]+n.borderBox[t.size]/2},VT=function(t,n,r){return n[t.crossAxisStart]+r.margin[t.crossAxisStart]+r.borderBox[t.crossAxisSize]/2},BN=function(t){var n=t.axis,r=t.moveRelativeTo,i=t.isMoving;return sf(n.line,r.marginBox[n.end]+jj(n,i),VT(n,r.marginBox,i))},VN=function(t){var n=t.axis,r=t.moveRelativeTo,i=t.isMoving;return sf(n.line,r.marginBox[n.start]-h2e(n,i),VT(n,r.marginBox,i))},p2e=function(t){var n=t.axis,r=t.moveInto,i=t.isMoving;return sf(n.line,r.contentBox[n.start]+jj(n,i),VT(n,r.contentBox,i))},m2e=function(e){var t=e.impact,n=e.draggable,r=e.draggables,i=e.droppable,o=e.afterCritical,s=Dp(i.descriptor.id,r),a=n.page,u=i.axis;if(!s.length)return p2e({axis:u,moveInto:i.page,isMoving:a});var d=t.displaced,p=t.displacedBy,m=d.all[0];if(m){var v=r[m];if(Ac(m,o))return VN({axis:u,moveRelativeTo:v.page,isMoving:a});var x=Pb(v.page,p.point);return VN({axis:u,moveRelativeTo:x,isMoving:a})}var _=s[s.length-1];if(_.descriptor.id===n.descriptor.id)return a.borderBox.center;if(Ac(_.descriptor.id,o)){var P=Pb(_.page,Ap(o.displacedBy.point));return BN({axis:u,moveRelativeTo:P,isMoving:a})}return BN({axis:u,moveRelativeTo:_.page,isMoving:a})},vE=function(e,t){var n=e.frame;return n?po(t,n.scroll.diff.displacement):t},g2e=function(t){var n=t.impact,r=t.draggable,i=t.droppable,o=t.draggables,s=t.afterCritical,a=r.page.borderBox.center,u=n.at;return!i||!u?a:u.type==="REORDER"?m2e({impact:n,draggable:r,draggables:o,droppable:i,afterCritical:s}):f2e({impact:n,draggables:o,afterCritical:s})},xw=function(e){var t=g2e(e),n=e.droppable,r=n?vE(n,t):t;return r},Hj=function(e,t){var n=Ra(t,e.scroll.initial),r=Ap(n),i=zs({top:t.y,bottom:t.y+e.frame.height,left:t.x,right:t.x+e.frame.width}),o={frame:i,scroll:{initial:e.scroll.initial,max:e.scroll.max,current:t,diff:{value:n,displacement:r}}};return o};function UN(e,t){return e.map(function(n){return t[n]})}function v2e(e,t){for(var n=0;n1?p.sort(function(m,v){return jo(m)[a.start]-jo(v)[a.start]})[0]:d.sort(function(m,v){var x=FN(n,zN(jo(m))),_=FN(n,zN(jo(v)));return x!==_?x-_:jo(m)[a.start]-jo(v)[a.start]})[0]},jN=function(t,n){var r=t.page.borderBox.center;return Ac(t.descriptor.id,n)?Ra(r,n.displacedBy.point):r},w2e=function(t,n){var r=t.page.borderBox;return Ac(t.descriptor.id,n)?v0(r,Ap(n.displacedBy.point)):r},C2e=function(e){var t=e.pageBorderBoxCenter,n=e.viewport,r=e.destination,i=e.insideDestination,o=e.afterCritical,s=i.filter(function(a){return Uj({target:w2e(a,o),destination:r,viewport:n.frame,withDroppableDisplacement:!0})}).sort(function(a,u){var d=xv(t,vE(r,jN(a,o))),p=xv(t,vE(r,jN(u,o)));return dt.left&&e.topt.top}function R2e(e){var t=e.pageBorderBox,n=e.draggable,r=e.candidates,i=n.page.borderBox.center,o=r.map(function(s){var a=s.axis,u=sf(s.axis.line,t.center[a.line],s.page.borderBox.center[a.crossAxisLine]);return{id:s.descriptor.id,distance:xv(i,u)}}).sort(function(s,a){return a.distance-s.distance});return o[0]?o[0].id:null}function A2e(e){var t=e.pageBorderBox,n=e.draggable,r=e.droppables,i=gw(r).filter(function(o){if(!o.isEnabled)return!1;var s=o.subject.active;if(!s||!M2e(t,s))return!1;if(qj(s)(t.center))return!0;var a=o.axis,u=s.center[a.crossAxisLine],d=t[a.crossAxisStart],p=t[a.crossAxisEnd],m=cs(s[a.crossAxisStart],s[a.crossAxisEnd]),v=m(d),x=m(p);return!v&&!x?!0:v?du});return i.length?i.length===1?i[0].descriptor.id:R2e({pageBorderBox:t,draggable:n,candidates:i}):null}var Zj=function(t,n){return zs(v0(t,n))},D2e=function(e,t){var n=e.frame;return n?Zj(t,n.scroll.diff.value):t};function Xj(e){var t=e.displaced,n=e.id;return Boolean(t.visible[n]||t.invisible[n])}function O2e(e){var t=e.draggable,n=e.closest,r=e.inHomeList;return n?r&&n.descriptor.index>t.descriptor.index?n.descriptor.index-1:n.descriptor.index:null}var N2e=function(e){var t=e.pageBorderBoxWithDroppableScroll,n=e.draggable,r=e.destination,i=e.insideDestination,o=e.last,s=e.viewport,a=e.afterCritical,u=r.axis,d=y0(r.axis,n.displaceBy),p=d.value,m=t[u.start],v=t[u.end],x=yw(n,i),_=Bc(x,function(k){var T=k.descriptor.id,M=k.page.borderBox.center[u.line],O=Ac(T,a),N=Xj({displaced:o,id:T});return O?N?v<=M:mT[a.start]+O&&mT[a.start]-d+O&&pT[a.start]+d+O&&mT[a.start]+O&&p=WN)return oH;var o=i/WN,s=bE+fSe*o,a=r==="CANCEL"?s*hSe:s;return Number(a.toFixed(2))},mSe=function(e){var t=e.impact,n=e.draggable,r=e.dimensions,i=e.viewport,o=e.afterCritical,s=r.draggables,a=r.droppables,u=Na(t),d=u?a[u]:null,p=a[n.descriptor.droppableId],m=Jj({impact:t,draggable:n,draggables:s,afterCritical:o,droppable:d||p,viewport:i}),v=Ra(m,n.client.borderBox.center);return v},gSe=function(e){var t=e.draggables,n=e.reason,r=e.lastImpact,i=e.home,o=e.viewport,s=e.onLiftImpact;if(!r.at||n!=="DROP"){var a=Qj({draggables:t,impact:s,destination:i,viewport:o,forceShouldAnimate:!0});return{impact:a,didDropInsideDroppable:!1}}if(r.at.type==="REORDER")return{impact:r,didDropInsideDroppable:!0};var u=ze({},r,{displaced:bv});return{impact:u,didDropInsideDroppable:!0}},vSe=function(e){var t=e.getState,n=e.dispatch;return function(r){return function(i){if(i.type!=="DROP"){r(i);return}var o=t(),s=i.payload.reason;if(o.phase==="COLLECTING"){n(uSe({reason:s}));return}if(o.phase!=="IDLE"){var a=o.phase==="DROP_PENDING"&&o.isWaiting;a&&ln(!1),o.phase==="DRAGGING"||o.phase==="DROP_PENDING"||ln(!1);var u=o.critical,d=o.dimensions,p=d.draggables[o.critical.draggable.id],m=gSe({reason:s,lastImpact:o.impact,afterCritical:o.afterCritical,onLiftImpact:o.onLiftImpact,home:o.dimensions.droppables[o.critical.droppable.id],viewport:o.viewport,draggables:o.dimensions.draggables}),v=m.impact,x=m.didDropInsideDroppable,_=x?zT(v):null,P=x?vw(v):null,k={index:u.draggable.index,droppableId:u.droppable.id},T={draggableId:p.descriptor.id,type:p.descriptor.type,source:k,reason:s,mode:o.movementMode,destination:_,combine:P},M=mSe({impact:v,draggable:p,dimensions:d,viewport:o.viewport,afterCritical:o.afterCritical}),O={critical:o.critical,afterCritical:o.afterCritical,result:T,impact:v},N=!wc(o.current.client.offset,M)||Boolean(T.combine);if(!N){n(KT({completed:O}));return}var L=pSe({current:o.current.client.offset,destination:M,reason:s}),F={newHomeClientOffset:M,dropDuration:L,completed:O};n(lSe(F))}}}},aH=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function ySe(e){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(n){n.target!==window&&n.target!==window.document||e()}}}function xSe(e){var t=e.onWindowScroll;function n(){t(aH())}var r=yv(n),i=ySe(r),o=_c;function s(){return o!==_c}function a(){s()&&ln(!1),o=ss(window,[i])}function u(){s()||ln(!1),r.cancel(),o(),o=_c}return{start:a,stop:u,isActive:s}}var bSe=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},_Se=function(e){var t=xSe({onWindowScroll:function(r){e.dispatch(nSe({newScroll:r}))}});return function(n){return function(r){!t.isActive()&&r.type==="INITIAL_PUBLISH"&&t.start(),t.isActive()&&bSe(r)&&t.stop(),n(r)}}},wSe=function(e){var t=!1,n=!1,r=setTimeout(function(){n=!0}),i=function(s){t||n||(t=!0,e(s),clearTimeout(r))};return i.wasCalled=function(){return t},i},CSe=function(){var e=[],t=function(o){var s=FT(e,function(d){return d.timerId===o});s===-1&&ln(!1);var a=e.splice(s,1),u=a[0];u.callback()},n=function(o){var s=setTimeout(function(){return t(s)}),a={timerId:s,callback:o};e.push(a)},r=function(){if(!!e.length){var o=[].concat(e);e.length=0,o.forEach(function(s){clearTimeout(s.timerId),s.callback()})}};return{add:n,flush:r}},SSe=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.droppableId===n.droppableId&&t.index===n.index},ESe=function(t,n){return t==null&&n==null?!0:t==null||n==null?!1:t.draggableId===n.draggableId&&t.droppableId===n.droppableId},PSe=function(t,n){if(t===n)return!0;var r=t.draggable.id===n.draggable.id&&t.draggable.droppableId===n.draggable.droppableId&&t.draggable.type===n.draggable.type&&t.draggable.index===n.draggable.index,i=t.droppable.id===n.droppable.id&&t.droppable.type===n.droppable.type;return r&&i},Km=function(t,n){n()},hx=function(t,n){return{draggableId:t.draggable.id,type:t.droppable.type,source:{droppableId:t.droppable.id,index:t.draggable.index},mode:n}},v2=function(t,n,r,i){if(!t){r(i(n));return}var o=wSe(r),s={announce:o};t(n,s),o.wasCalled()||r(i(n))},ISe=function(e,t){var n=CSe(),r=null,i=function(v,x){r&&ln(!1),Km("onBeforeCapture",function(){var _=e().onBeforeCapture;if(_){var P={draggableId:v,mode:x};_(P)}})},o=function(v,x){r&&ln(!1),Km("onBeforeDragStart",function(){var _=e().onBeforeDragStart;_&&_(hx(v,x))})},s=function(v,x){r&&ln(!1);var _=hx(v,x);r={mode:x,lastCritical:v,lastLocation:_.source,lastCombine:null},n.add(function(){Km("onDragStart",function(){return v2(e().onDragStart,_,t,c1.onDragStart)})})},a=function(v,x){var _=zT(x),P=vw(x);r||ln(!1);var k=!PSe(v,r.lastCritical);k&&(r.lastCritical=v);var T=!SSe(r.lastLocation,_);T&&(r.lastLocation=_);var M=!ESe(r.lastCombine,P);if(M&&(r.lastCombine=P),!(!k&&!T&&!M)){var O=ze({},hx(v,r.mode),{combine:P,destination:_});n.add(function(){Km("onDragUpdate",function(){return v2(e().onDragUpdate,O,t,c1.onDragUpdate)})})}},u=function(){r||ln(!1),n.flush()},d=function(v){r||ln(!1),r=null,Km("onDragEnd",function(){return v2(e().onDragEnd,v,t,c1.onDragEnd)})},p=function(){if(!!r){var v=ze({},hx(r.lastCritical,r.mode),{combine:null,destination:null,reason:"CANCEL"});d(v)}};return{beforeCapture:i,beforeStart:o,start:s,update:a,flush:u,drop:d,abort:p}},TSe=function(e,t){var n=ISe(e,t);return function(r){return function(i){return function(o){if(o.type==="BEFORE_INITIAL_CAPTURE"){n.beforeCapture(o.payload.draggableId,o.payload.movementMode);return}if(o.type==="INITIAL_PUBLISH"){var s=o.payload.critical;n.beforeStart(s,o.payload.movementMode),i(o),n.start(s,o.payload.movementMode);return}if(o.type==="DROP_COMPLETE"){var a=o.payload.completed.result;n.flush(),i(o),n.drop(a);return}if(i(o),o.type==="FLUSH"){n.abort();return}var u=r.getState();u.phase==="DRAGGING"&&n.update(u.critical,u.impact)}}}},kSe=function(e){return function(t){return function(n){if(n.type!=="DROP_ANIMATION_FINISHED"){t(n);return}var r=e.getState();r.phase!=="DROP_ANIMATING"&&ln(!1),e.dispatch(KT({completed:r.completed}))}}},MSe=function(e){var t=null,n=null;function r(){n&&(cancelAnimationFrame(n),n=null),t&&(t(),t=null)}return function(i){return function(o){if((o.type==="FLUSH"||o.type==="DROP_COMPLETE"||o.type==="DROP_ANIMATION_FINISHED")&&r(),i(o),o.type==="DROP_ANIMATE"){var s={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var u=e.getState();u.phase==="DROP_ANIMATING"&&e.dispatch(iH())}};n=requestAnimationFrame(function(){n=null,t=ss(window,[s])})}}}},RSe=function(e){return function(){return function(t){return function(n){(n.type==="DROP_COMPLETE"||n.type==="FLUSH"||n.type==="DROP_ANIMATE")&&e.stopPublishing(),t(n)}}}},ASe=function(e){var t=!1;return function(){return function(n){return function(r){if(r.type==="INITIAL_PUBLISH"){t=!0,e.tryRecordFocus(r.payload.critical.draggable.id),n(r),e.tryRestoreFocusRecorded();return}if(n(r),!!t){if(r.type==="FLUSH"){t=!1,e.tryRestoreFocusRecorded();return}if(r.type==="DROP_COMPLETE"){t=!1;var i=r.payload.completed.result;i.combine&&e.tryShiftRecord(i.draggableId,i.combine.draggableId),e.tryRestoreFocusRecorded()}}}}}},DSe=function(t){return t.type==="DROP_COMPLETE"||t.type==="DROP_ANIMATE"||t.type==="FLUSH"},OSe=function(e){return function(t){return function(n){return function(r){if(DSe(r)){e.stop(),n(r);return}if(r.type==="INITIAL_PUBLISH"){n(r);var i=t.getState();i.phase!=="DRAGGING"&&ln(!1),e.start(i);return}n(r),e.scroll(t.getState())}}}},NSe=function(e){return function(t){return function(n){if(t(n),n.type==="PUBLISH_WHILE_DRAGGING"){var r=e.getState();r.phase==="DROP_PENDING"&&(r.isWaiting||e.dispatch(rH({reason:r.reason})))}}}},LSe=pj,FSe=function(e){var t=e.dimensionMarshal,n=e.focusMarshal,r=e.styleMarshal,i=e.getResponders,o=e.announce,s=e.autoScroller;return hj(G2e,LSe(M4e(dSe(r),RSe(t),cSe(t),vSe,kSe,MSe,NSe,OSe(s),_Se,ASe(n),TSe(i,o))))},y2=function(){return{additions:{},removals:{},modified:{}}};function zSe(e){var t=e.registry,n=e.callbacks,r=y2(),i=null,o=function(){i||(n.collectionStarting(),i=requestAnimationFrame(function(){i=null;var p=r,m=p.additions,v=p.removals,x=p.modified,_=Object.keys(m).map(function(T){return t.draggable.getById(T).getDimension(ao)}).sort(function(T,M){return T.descriptor.index-M.descriptor.index}),P=Object.keys(x).map(function(T){var M=t.droppable.getById(T),O=M.callbacks.getScrollWhileDragging();return{droppableId:T,scroll:O}}),k={additions:_,removals:Object.keys(v),modified:P};r=y2(),n.publish(k)}))},s=function(p){var m=p.descriptor.id;r.additions[m]=p,r.modified[p.descriptor.droppableId]=!0,r.removals[m]&&delete r.removals[m],o()},a=function(p){var m=p.descriptor;r.removals[m.id]=!0,r.modified[m.droppableId]=!0,r.additions[m.id]&&delete r.additions[m.id],o()},u=function(){!i||(cancelAnimationFrame(i),i=null,r=y2())};return{add:s,remove:a,stop:u}}var sH=function(e){var t=e.scrollHeight,n=e.scrollWidth,r=e.height,i=e.width,o=Ra({x:n,y:t},{x:i,y:r}),s={x:Math.max(0,o.x),y:Math.max(0,o.y)};return s},lH=function(){var e=document.documentElement;return e||ln(!1),e},uH=function(){var e=lH(),t=sH({scrollHeight:e.scrollHeight,scrollWidth:e.scrollWidth,width:e.clientWidth,height:e.clientHeight});return t},$Se=function(){var e=aH(),t=uH(),n=e.y,r=e.x,i=lH(),o=i.clientWidth,s=i.clientHeight,a=r+o,u=n+s,d=zs({top:n,left:r,right:a,bottom:u}),p={frame:d,scroll:{initial:e,current:e,max:t,diff:{value:ao,displacement:ao}}};return p},BSe=function(e){var t=e.critical,n=e.scrollOptions,r=e.registry,i=$Se(),o=i.scroll.current,s=t.droppable,a=r.droppable.getAllByType(s.type).map(function(m){return m.callbacks.getDimensionAndWatchScroll(o,n)}),u=r.draggable.getAllByType(t.draggable.type).map(function(m){return m.getDimension(o)}),d={draggables:zj(u),droppables:Fj(a)},p={dimensions:d,critical:t,viewport:i};return p};function GN(e,t,n){if(n.descriptor.id===t.id||n.descriptor.type!==t.type)return!1;var r=e.droppable.getById(n.descriptor.droppableId);return r.descriptor.mode==="virtual"}var VSe=function(e,t){var n=null,r=zSe({callbacks:{publish:t.publishWhileDragging,collectionStarting:t.collectionStarting},registry:e}),i=function(x,_){e.droppable.exists(x)||ln(!1),n&&t.updateDroppableIsEnabled({id:x,isEnabled:_})},o=function(x,_){!n||(e.droppable.exists(x)||ln(!1),t.updateDroppableIsCombineEnabled({id:x,isCombineEnabled:_}))},s=function(x,_){!n||(e.droppable.exists(x)||ln(!1),t.updateDroppableScroll({id:x,newScroll:_}))},a=function(x,_){!n||e.droppable.getById(x).callbacks.scroll(_)},u=function(){if(!!n){r.stop();var x=n.critical.droppable;e.droppable.getAllByType(x.type).forEach(function(_){return _.callbacks.dragStopped()}),n.unsubscribe(),n=null}},d=function(x){n||ln(!1);var _=n.critical.draggable;x.type==="ADDITION"&&GN(e,_,x.value)&&r.add(x.value),x.type==="REMOVAL"&&GN(e,_,x.value)&&r.remove(x.value)},p=function(x){n&&ln(!1);var _=e.draggable.getById(x.draggableId),P=e.droppable.getById(_.descriptor.droppableId),k={draggable:_.descriptor,droppable:P.descriptor},T=e.subscribe(d);return n={critical:k,unsubscribe:T},BSe({critical:k,registry:e,scrollOptions:x.scrollOptions})},m={updateDroppableIsEnabled:i,updateDroppableIsCombineEnabled:o,scrollDroppable:a,updateDroppableScroll:s,startPublishing:p,stopPublishing:u};return m},cH=function(e,t){return e.phase==="IDLE"?!0:e.phase!=="DROP_ANIMATING"||e.completed.result.draggableId===t?!1:e.completed.result.reason==="DROP"},USe=function(e){window.scrollBy(e.x,e.y)},jSe=oo(function(e){return gw(e).filter(function(t){return!(!t.isEnabled||!t.frame)})}),HSe=function(t,n){var r=Bc(jSe(n),function(i){return i.frame||ln(!1),qj(i.frame.pageMarginBox)(t)});return r},KSe=function(e){var t=e.center,n=e.destination,r=e.droppables;if(n){var i=r[n];return i.frame?i:null}var o=HSe(t,r);return o},Cc={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(t){return Math.pow(t,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},WSe=function(e,t){var n=e[t.size]*Cc.startFromPercentage,r=e[t.size]*Cc.maxScrollAtPercentage,i={startScrollingFrom:n,maxScrollValueAt:r};return i},dH=function(e){var t=e.startOfRange,n=e.endOfRange,r=e.current,i=n-t;if(i===0)return 0;var o=r-t,s=o/i;return s},qT=1,GSe=function(e,t){if(e>t.startScrollingFrom)return 0;if(e<=t.maxScrollValueAt)return Cc.maxPixelScroll;if(e===t.startScrollingFrom)return qT;var n=dH({startOfRange:t.maxScrollValueAt,endOfRange:t.startScrollingFrom,current:e}),r=1-n,i=Cc.maxPixelScroll*Cc.ease(r);return Math.ceil(i)},qN=Cc.durationDampening.accelerateAt,ZN=Cc.durationDampening.stopDampeningAt,qSe=function(e,t){var n=t,r=ZN,i=Date.now(),o=i-n;if(o>=ZN)return e;if(ot.height,o=n.width>t.width;return!o&&!i?r:o&&i?null:{x:o?0:r.x,y:i?0:r.y}},XSe=Nj(function(e){return e===0?0:e}),fH=function(e){var t=e.dragStartTime,n=e.container,r=e.subject,i=e.center,o=e.shouldUseTimeDampening,s={top:i.y-n.top,right:n.right-i.x,bottom:n.bottom-i.y,left:i.x-n.left},a=YN({container:n,distanceToEdges:s,dragStartTime:t,axis:$T,shouldUseTimeDampening:o}),u=YN({container:n,distanceToEdges:s,dragStartTime:t,axis:Vj,shouldUseTimeDampening:o}),d=XSe({x:u,y:a});if(wc(d,ao))return null;var p=ZSe({container:n,subject:r,proposedScroll:d});return p?wc(p,ao)?null:p:null},YSe=Nj(function(e){return e===0?0:e>0?1:-1}),ZT=function(){var e=function(n,r){return n<0?n:n>r?n-r:0};return function(t){var n=t.current,r=t.max,i=t.change,o=po(n,i),s={x:e(o.x,r.x),y:e(o.y,r.y)};return wc(s,ao)?null:s}}(),hH=function(t){var n=t.max,r=t.current,i=t.change,o={x:Math.max(r.x,n.x),y:Math.max(r.y,n.y)},s=YSe(i),a=ZT({max:o,current:r,change:s});return!a||s.x!==0&&a.x===0||s.y!==0&&a.y===0},XT=function(t,n){return hH({current:t.scroll.current,max:t.scroll.max,change:n})},QSe=function(t,n){if(!XT(t,n))return null;var r=t.scroll.max,i=t.scroll.current;return ZT({current:i,max:r,change:n})},YT=function(t,n){var r=t.frame;return r?hH({current:r.scroll.current,max:r.scroll.max,change:n}):!1},JSe=function(t,n){var r=t.frame;return!r||!YT(t,n)?null:ZT({current:r.scroll.current,max:r.scroll.max,change:n})},e3e=function(e){var t=e.viewport,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,s=fH({dragStartTime:i,container:t.frame,subject:n,center:r,shouldUseTimeDampening:o});return s&&XT(t,s)?s:null},t3e=function(e){var t=e.droppable,n=e.subject,r=e.center,i=e.dragStartTime,o=e.shouldUseTimeDampening,s=t.frame;if(!s)return null;var a=fH({dragStartTime:i,container:s.pageMarginBox,subject:n,center:r,shouldUseTimeDampening:o});return a&&YT(t,a)?a:null},QN=function(e){var t=e.state,n=e.dragStartTime,r=e.shouldUseTimeDampening,i=e.scrollWindow,o=e.scrollDroppable,s=t.current.page.borderBoxCenter,a=t.dimensions.draggables[t.critical.draggable.id],u=a.page.marginBox;if(t.isWindowScrollAllowed){var d=t.viewport,p=e3e({dragStartTime:n,viewport:d,subject:u,center:s,shouldUseTimeDampening:r});if(p){i(p);return}}var m=KSe({center:s,destination:Na(t.impact),droppables:t.dimensions.droppables});if(!!m){var v=t3e({dragStartTime:n,droppable:m,subject:u,center:s,shouldUseTimeDampening:r});v&&o(m.descriptor.id,v)}},n3e=function(e){var t=e.scrollWindow,n=e.scrollDroppable,r=yv(t),i=yv(n),o=null,s=function(p){o||ln(!1);var m=o,v=m.shouldUseTimeDampening,x=m.dragStartTime;QN({state:p,scrollWindow:r,scrollDroppable:i,dragStartTime:x,shouldUseTimeDampening:v})},a=function(p){o&&ln(!1);var m=Date.now(),v=!1,x=function(){v=!0};QN({state:p,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:x,scrollDroppable:x}),o={dragStartTime:m,shouldUseTimeDampening:v},v&&s(p)},u=function(){!o||(r.cancel(),i.cancel(),o=null)};return{start:a,stop:u,scroll:s}},r3e=function(e){var t=e.move,n=e.scrollDroppable,r=e.scrollWindow,i=function(d,p){var m=po(d.current.client.selection,p);t({client:m})},o=function(d,p){if(!YT(d,p))return p;var m=JSe(d,p);if(!m)return n(d.descriptor.id,p),null;var v=Ra(p,m);n(d.descriptor.id,v);var x=Ra(p,v);return x},s=function(d,p,m){if(!d||!XT(p,m))return m;var v=QSe(p,m);if(!v)return r(m),null;var x=Ra(m,v);r(x);var _=Ra(m,x);return _},a=function(d){var p=d.scrollJumpRequest;if(!!p){var m=Na(d.impact);m||ln(!1);var v=o(d.dimensions.droppables[m],p);if(!!v){var x=d.viewport,_=s(d.isWindowScrollAllowed,x,v);!_||i(d,_)}}};return a},i3e=function(e){var t=e.scrollDroppable,n=e.scrollWindow,r=e.move,i=n3e({scrollWindow:n,scrollDroppable:t}),o=r3e({move:r,scrollWindow:n,scrollDroppable:t}),s=function(d){if(d.phase==="DRAGGING"){if(d.movementMode==="FLUID"){i.scroll(d);return}!d.scrollJumpRequest||o(d)}},a={scroll:s,start:i.start,stop:i.stop};return a},sp="data-rbd",lp=function(){var e=sp+"-drag-handle";return{base:e,draggableId:e+"-draggable-id",contextId:e+"-context-id"}}(),_E=function(){var e=sp+"-draggable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),o3e=function(){var e=sp+"-droppable";return{base:e,contextId:e+"-context-id",id:e+"-id"}}(),JN={contextId:sp+"-scroll-container-context-id"},a3e=function(t){return function(n){return"["+n+'="'+t+'"]'}},Wm=function(t,n){return t.map(function(r){var i=r.styles[n];return i?r.selector+" { "+i+" }":""}).join(" ")},s3e="pointer-events: none;",l3e=function(e){var t=a3e(e),n=function(){var a=` cursor: -webkit-grab; cursor: grab; `;return{selector:t(lp.contextId),styles:{always:` -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; `,resting:a,dragging:s3e,dropAnimating:a}}}(),r=function(){var a=` transition: `+Dg.outOfTheWay+`; `;return{selector:t(_E.contextId),styles:{dragging:a,dropAnimating:a,userCancel:a}}}(),i={selector:t(o3e.contextId),styles:{always:"overflow-anchor: none;"}},o={selector:"body",styles:{dragging:` cursor: grabbing; cursor: -webkit-grabbing; user-select: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; overflow-anchor: none; `}},s=[r,n,i,o];return{always:Wm(s,"always"),resting:Wm(s,"resting"),dragging:Wm(s,"dragging"),dropAnimating:Wm(s,"dropAnimating"),userCancel:Wm(s,"userCancel")}},La=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?w.exports.useLayoutEffect:w.exports.useEffect,x2=function(){var t=document.querySelector("head");return t||ln(!1),t},e6=function(t){var n=document.createElement("style");return t&&n.setAttribute("nonce",t),n.type="text/css",n};function u3e(e,t){var n=br(function(){return l3e(e)},[e]),r=w.exports.useRef(null),i=w.exports.useRef(null),o=Ln(oo(function(m){var v=i.current;v||ln(!1),v.textContent=m}),[]),s=Ln(function(m){var v=r.current;v||ln(!1),v.textContent=m},[]);La(function(){!r.current&&!i.current||ln(!1);var m=e6(t),v=e6(t);return r.current=m,i.current=v,m.setAttribute(sp+"-always",e),v.setAttribute(sp+"-dynamic",e),x2().appendChild(m),x2().appendChild(v),s(n.always),o(n.resting),function(){var x=function(P){var k=P.current;k||ln(!1),x2().removeChild(k),P.current=null};x(r),x(i)}},[t,s,o,n.always,n.resting,e]);var a=Ln(function(){return o(n.dragging)},[o,n.dragging]),u=Ln(function(m){if(m==="DROP"){o(n.dropAnimating);return}o(n.userCancel)},[o,n.dropAnimating,n.userCancel]),d=Ln(function(){!i.current||o(n.resting)},[o,n.resting]),p=br(function(){return{dragging:a,dropping:u,resting:d}},[a,u,d]);return p}var pH=function(e){return e&&e.ownerDocument?e.ownerDocument.defaultView:window};function bw(e){return e instanceof pH(e).HTMLElement}function c3e(e,t){var n="["+lp.contextId+'="'+e+'"]',r=Lj(document.querySelectorAll(n));if(!r.length)return null;var i=Bc(r,function(o){return o.getAttribute(lp.draggableId)===t});return!i||!bw(i)?null:i}function d3e(e){var t=w.exports.useRef({}),n=w.exports.useRef(null),r=w.exports.useRef(null),i=w.exports.useRef(!1),o=Ln(function(v,x){var _={id:v,focus:x};return t.current[v]=_,function(){var k=t.current,T=k[v];T!==_&&delete k[v]}},[]),s=Ln(function(v){var x=c3e(e,v);x&&x!==document.activeElement&&x.focus()},[e]),a=Ln(function(v,x){n.current===v&&(n.current=x)},[]),u=Ln(function(){r.current||!i.current||(r.current=requestAnimationFrame(function(){r.current=null;var v=n.current;v&&s(v)}))},[s]),d=Ln(function(v){n.current=null;var x=document.activeElement;!x||x.getAttribute(lp.draggableId)===v&&(n.current=v)},[]);La(function(){return i.current=!0,function(){i.current=!1;var v=r.current;v&&cancelAnimationFrame(v)}},[]);var p=br(function(){return{register:o,tryRecordFocus:d,tryRestoreFocusRecorded:u,tryShiftRecord:a}},[o,d,u,a]);return p}function f3e(){var e={draggables:{},droppables:{}},t=[];function n(m){return t.push(m),function(){var x=t.indexOf(m);x!==-1&&t.splice(x,1)}}function r(m){t.length&&t.forEach(function(v){return v(m)})}function i(m){return e.draggables[m]||null}function o(m){var v=i(m);return v||ln(!1),v}var s={register:function(v){e.draggables[v.descriptor.id]=v,r({type:"ADDITION",value:v})},update:function(v,x){var _=e.draggables[x.descriptor.id];!_||_.uniqueId===v.uniqueId&&(delete e.draggables[x.descriptor.id],e.draggables[v.descriptor.id]=v)},unregister:function(v){var x=v.descriptor.id,_=i(x);!_||v.uniqueId===_.uniqueId&&(delete e.draggables[x],r({type:"REMOVAL",value:v}))},getById:o,findById:i,exists:function(v){return Boolean(i(v))},getAllByType:function(v){return Mb(e.draggables).filter(function(x){return x.descriptor.type===v})}};function a(m){return e.droppables[m]||null}function u(m){var v=a(m);return v||ln(!1),v}var d={register:function(v){e.droppables[v.descriptor.id]=v},unregister:function(v){var x=a(v.descriptor.id);!x||v.uniqueId===x.uniqueId&&delete e.droppables[v.descriptor.id]},getById:u,findById:a,exists:function(v){return Boolean(a(v))},getAllByType:function(v){return Mb(e.droppables).filter(function(x){return x.descriptor.type===v})}};function p(){e.draggables={},e.droppables={},t.length=0}return{draggable:s,droppable:d,subscribe:n,clean:p}}function h3e(){var e=br(f3e,[]);return w.exports.useEffect(function(){return function(){requestAnimationFrame(e.clean)}},[e]),e}var QT=Un.createContext(null),Ab=function(){var e=document.body;return e||ln(!1),e},p3e={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},m3e=function(t){return"rbd-announcement-"+t};function g3e(e){var t=br(function(){return m3e(e)},[e]),n=w.exports.useRef(null);w.exports.useEffect(function(){var o=document.createElement("div");return n.current=o,o.id=t,o.setAttribute("aria-live","assertive"),o.setAttribute("aria-atomic","true"),ze(o.style,p3e),Ab().appendChild(o),function(){setTimeout(function(){var u=Ab();u.contains(o)&&u.removeChild(o),o===n.current&&(n.current=null)})}},[t]);var r=Ln(function(i){var o=n.current;if(o){o.textContent=i;return}},[]);return r}var v3e=0,y3e={separator:"::"};function JT(e,t){return t===void 0&&(t=y3e),br(function(){return""+e+t.separator+v3e++},[t.separator,e])}function x3e(e){var t=e.contextId,n=e.uniqueId;return"rbd-hidden-text-"+t+"-"+n}function b3e(e){var t=e.contextId,n=e.text,r=JT("hidden-text",{separator:"-"}),i=br(function(){return x3e({contextId:t,uniqueId:r})},[r,t]);return w.exports.useEffect(function(){var s=document.createElement("div");return s.id=i,s.textContent=n,s.style.display="none",Ab().appendChild(s),function(){var u=Ab();u.contains(s)&&u.removeChild(s)}},[i,n]),i}var _w=Un.createContext(null);function mH(e){var t=w.exports.useRef(e);return w.exports.useEffect(function(){t.current=e}),t}function _3e(){var e=null;function t(){return Boolean(e)}function n(s){return s===e}function r(s){e&&ln(!1);var a={abandon:s};return e=a,a}function i(){e||ln(!1),e=null}function o(){e&&(e.abandon(),i())}return{isClaimed:t,isActive:n,claim:r,release:i,tryAbandon:o}}var w3e=9,C3e=13,ek=27,gH=32,S3e=33,E3e=34,P3e=35,I3e=36,T3e=37,k3e=38,M3e=39,R3e=40,px,A3e=(px={},px[C3e]=!0,px[w3e]=!0,px),vH=function(e){A3e[e.keyCode]&&e.preventDefault()},ww=function(){var e="visibilitychange";if(typeof document>"u")return e;var t=[e,"ms"+e,"webkit"+e,"moz"+e,"o"+e],n=Bc(t,function(r){return"on"+r in document});return n||e}(),yH=0,t6=5;function D3e(e,t){return Math.abs(t.x-e.x)>=t6||Math.abs(t.y-e.y)>=t6}var n6={type:"IDLE"};function O3e(e){var t=e.cancel,n=e.completed,r=e.getPhase,i=e.setPhase;return[{eventName:"mousemove",fn:function(s){var a=s.button,u=s.clientX,d=s.clientY;if(a===yH){var p={x:u,y:d},m=r();if(m.type==="DRAGGING"){s.preventDefault(),m.actions.move(p);return}m.type!=="PENDING"&&ln(!1);var v=m.point;if(!!D3e(v,p)){s.preventDefault();var x=m.actions.fluidLift(p);i({type:"DRAGGING",actions:x})}}}},{eventName:"mouseup",fn:function(s){var a=r();if(a.type!=="DRAGGING"){t();return}s.preventDefault(),a.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"mousedown",fn:function(s){r().type==="DRAGGING"&&s.preventDefault(),t()}},{eventName:"keydown",fn:function(s){var a=r();if(a.type==="PENDING"){t();return}if(s.keyCode===ek){s.preventDefault(),t();return}vH(s)}},{eventName:"resize",fn:t},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){r().type==="PENDING"&&t()}},{eventName:"webkitmouseforcedown",fn:function(s){var a=r();if(a.type==="IDLE"&&ln(!1),a.actions.shouldRespectForcePress()){t();return}s.preventDefault()}},{eventName:ww,fn:t}]}function N3e(e){var t=w.exports.useRef(n6),n=w.exports.useRef(_c),r=br(function(){return{eventName:"mousedown",fn:function(m){if(!m.defaultPrevented&&m.button===yH&&!(m.ctrlKey||m.metaKey||m.shiftKey||m.altKey)){var v=e.findClosestDraggableId(m);if(!!v){var x=e.tryGetLock(v,s,{sourceEvent:m});if(!!x){m.preventDefault();var _={x:m.clientX,y:m.clientY};n.current(),d(x,_)}}}}}},[e]),i=br(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(m){if(!m.defaultPrevented){var v=e.findClosestDraggableId(m);if(!!v){var x=e.findOptionsForDraggable(v);!x||x.shouldRespectForcePress||!e.canGetLock(v)||m.preventDefault()}}}}},[e]),o=Ln(function(){var m={passive:!1,capture:!0};n.current=ss(window,[i,r],m)},[i,r]),s=Ln(function(){var p=t.current;p.type!=="IDLE"&&(t.current=n6,n.current(),o())},[o]),a=Ln(function(){var p=t.current;s(),p.type==="DRAGGING"&&p.actions.cancel({shouldBlockNextClick:!0}),p.type==="PENDING"&&p.actions.abort()},[s]),u=Ln(function(){var m={capture:!0,passive:!1},v=O3e({cancel:a,completed:s,getPhase:function(){return t.current},setPhase:function(_){t.current=_}});n.current=ss(window,v,m)},[a,s]),d=Ln(function(m,v){t.current.type!=="IDLE"&&ln(!1),t.current={type:"PENDING",point:v,actions:m},u()},[u]);La(function(){return o(),function(){n.current()}},[o])}var ah;function L3e(){}var F3e=(ah={},ah[E3e]=!0,ah[S3e]=!0,ah[I3e]=!0,ah[P3e]=!0,ah);function z3e(e,t){function n(){t(),e.cancel()}function r(){t(),e.drop()}return[{eventName:"keydown",fn:function(o){if(o.keyCode===ek){o.preventDefault(),n();return}if(o.keyCode===gH){o.preventDefault(),r();return}if(o.keyCode===R3e){o.preventDefault(),e.moveDown();return}if(o.keyCode===k3e){o.preventDefault(),e.moveUp();return}if(o.keyCode===M3e){o.preventDefault(),e.moveRight();return}if(o.keyCode===T3e){o.preventDefault(),e.moveLeft();return}if(F3e[o.keyCode]){o.preventDefault();return}vH(o)}},{eventName:"mousedown",fn:n},{eventName:"mouseup",fn:n},{eventName:"click",fn:n},{eventName:"touchstart",fn:n},{eventName:"resize",fn:n},{eventName:"wheel",fn:n,options:{passive:!0}},{eventName:ww,fn:n}]}function $3e(e){var t=w.exports.useRef(L3e),n=br(function(){return{eventName:"keydown",fn:function(o){if(o.defaultPrevented||o.keyCode!==gH)return;var s=e.findClosestDraggableId(o);if(!s)return;var a=e.tryGetLock(s,p,{sourceEvent:o});if(!a)return;o.preventDefault();var u=!0,d=a.snapLift();t.current();function p(){u||ln(!1),u=!1,t.current(),r()}t.current=ss(window,z3e(d,p),{capture:!0,passive:!1})}}},[e]),r=Ln(function(){var o={passive:!1,capture:!0};t.current=ss(window,[n],o)},[n]);La(function(){return r(),function(){t.current()}},[r])}var b2={type:"IDLE"},B3e=120,V3e=.15;function U3e(e){var t=e.cancel,n=e.getPhase;return[{eventName:"orientationchange",fn:t},{eventName:"resize",fn:t},{eventName:"contextmenu",fn:function(i){i.preventDefault()}},{eventName:"keydown",fn:function(i){if(n().type!=="DRAGGING"){t();return}i.keyCode===ek&&i.preventDefault(),t()}},{eventName:ww,fn:t}]}function j3e(e){var t=e.cancel,n=e.completed,r=e.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(o){var s=r();if(s.type!=="DRAGGING"){t();return}s.hasMoved=!0;var a=o.touches[0],u=a.clientX,d=a.clientY,p={x:u,y:d};o.preventDefault(),s.actions.move(p)}},{eventName:"touchend",fn:function(o){var s=r();if(s.type!=="DRAGGING"){t();return}o.preventDefault(),s.actions.drop({shouldBlockNextClick:!0}),n()}},{eventName:"touchcancel",fn:function(o){if(r().type!=="DRAGGING"){t();return}o.preventDefault(),t()}},{eventName:"touchforcechange",fn:function(o){var s=r();s.type==="IDLE"&&ln(!1);var a=o.touches[0];if(!!a){var u=a.force>=V3e;if(!!u){var d=s.actions.shouldRespectForcePress();if(s.type==="PENDING"){d&&t();return}if(d){if(s.hasMoved){o.preventDefault();return}t();return}o.preventDefault()}}}},{eventName:ww,fn:t}]}function H3e(e){var t=w.exports.useRef(b2),n=w.exports.useRef(_c),r=Ln(function(){return t.current},[]),i=Ln(function(x){t.current=x},[]),o=br(function(){return{eventName:"touchstart",fn:function(x){if(!x.defaultPrevented){var _=e.findClosestDraggableId(x);if(!!_){var P=e.tryGetLock(_,a,{sourceEvent:x});if(!!P){var k=x.touches[0],T=k.clientX,M=k.clientY,O={x:T,y:M};n.current(),m(P,O)}}}}}},[e]),s=Ln(function(){var x={capture:!0,passive:!1};n.current=ss(window,[o],x)},[o]),a=Ln(function(){var v=t.current;v.type!=="IDLE"&&(v.type==="PENDING"&&clearTimeout(v.longPressTimerId),i(b2),n.current(),s())},[s,i]),u=Ln(function(){var v=t.current;a(),v.type==="DRAGGING"&&v.actions.cancel({shouldBlockNextClick:!0}),v.type==="PENDING"&&v.actions.abort()},[a]),d=Ln(function(){var x={capture:!0,passive:!1},_={cancel:u,completed:a,getPhase:r},P=ss(window,j3e(_),x),k=ss(window,U3e(_),x);n.current=function(){P(),k()}},[u,r,a]),p=Ln(function(){var x=r();x.type!=="PENDING"&&ln(!1);var _=x.actions.fluidLift(x.point);i({type:"DRAGGING",actions:_,hasMoved:!1})},[r,i]),m=Ln(function(x,_){r().type!=="IDLE"&&ln(!1);var P=setTimeout(p,B3e);i({type:"PENDING",point:_,actions:x,longPressTimerId:P}),d()},[d,r,i,p]);La(function(){return s(),function(){n.current();var _=r();_.type==="PENDING"&&(clearTimeout(_.longPressTimerId),i(b2))}},[r,s,i]),La(function(){var x=ss(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return x},[])}var K3e={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function xH(e,t){if(t==null)return!1;var n=Boolean(K3e[t.tagName.toLowerCase()]);if(n)return!0;var r=t.getAttribute("contenteditable");return r==="true"||r===""?!0:t===e?!1:xH(e,t.parentElement)}function W3e(e,t){var n=t.target;return bw(n)?xH(e,n):!1}var G3e=function(e){return zs(e.getBoundingClientRect()).center};function q3e(e){return e instanceof pH(e).Element}var Z3e=function(){var e="matches";if(typeof document>"u")return e;var t=[e,"msMatchesSelector","webkitMatchesSelector"],n=Bc(t,function(r){return r in Element.prototype});return n||e}();function bH(e,t){return e==null?null:e[Z3e](t)?e:bH(e.parentElement,t)}function X3e(e,t){return e.closest?e.closest(t):bH(e,t)}function Y3e(e){return"["+lp.contextId+'="'+e+'"]'}function Q3e(e,t){var n=t.target;if(!q3e(n))return null;var r=Y3e(e),i=X3e(n,r);return!i||!bw(i)?null:i}function J3e(e,t){var n=Q3e(e,t);return n?n.getAttribute(lp.draggableId):null}function eEe(e,t){var n="["+_E.contextId+'="'+e+'"]',r=Lj(document.querySelectorAll(n)),i=Bc(r,function(o){return o.getAttribute(_E.id)===t});return!i||!bw(i)?null:i}function tEe(e){e.preventDefault()}function mx(e){var t=e.expected,n=e.phase,r=e.isLockActive;return e.shouldWarn,!(!r()||t!==n)}function _H(e){var t=e.lockAPI,n=e.store,r=e.registry,i=e.draggableId;if(t.isClaimed())return!1;var o=r.draggable.findById(i);return!(!o||!o.options.isEnabled||!cH(n.getState(),i))}function nEe(e){var t=e.lockAPI,n=e.contextId,r=e.store,i=e.registry,o=e.draggableId,s=e.forceSensorStop,a=e.sourceEvent,u=_H({lockAPI:t,store:r,registry:i,draggableId:o});if(!u)return null;var d=i.draggable.getById(o),p=eEe(n,d.descriptor.id);if(!p||a&&!d.options.canDragInteractiveElements&&W3e(p,a))return null;var m=t.claim(s||_c),v="PRE_DRAG";function x(){return d.options.shouldRespectForcePress}function _(){return t.isActive(m)}function P(F,V){mx({expected:F,phase:v,isLockActive:_,shouldWarn:!0})&&r.dispatch(V())}var k=P.bind(null,"DRAGGING");function T(F){function V(){t.release(),v="COMPLETED"}v!=="PRE_DRAG"&&(V(),v!=="PRE_DRAG"&&ln(!1)),r.dispatch(Z2e(F.liftActionArgs)),v="DRAGGING";function B(H,G){if(G===void 0&&(G={shouldBlockNextClick:!1}),F.cleanup(),G.shouldBlockNextClick){var ee=ss(window,[{eventName:"click",fn:tEe,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(ee)}V(),r.dispatch(rH({reason:H}))}return ze({isActive:function(){return mx({expected:"DRAGGING",phase:v,isLockActive:_,shouldWarn:!1})},shouldRespectForcePress:x,drop:function(G){return B("DROP",G)},cancel:function(G){return B("CANCEL",G)}},F.actions)}function M(F){var V=yv(function(H){k(function(){return nH({client:H})})}),B=T({liftActionArgs:{id:o,clientSelection:F,movementMode:"FLUID"},cleanup:function(){return V.cancel()},actions:{move:V}});return ze({},B,{move:V})}function O(){var F={moveUp:function(){return k(iSe)},moveRight:function(){return k(aSe)},moveDown:function(){return k(oSe)},moveLeft:function(){return k(sSe)}};return T({liftActionArgs:{id:o,clientSelection:G3e(p),movementMode:"SNAP"},cleanup:_c,actions:F})}function N(){var F=mx({expected:"PRE_DRAG",phase:v,isLockActive:_,shouldWarn:!0});F&&t.release()}var L={isActive:function(){return mx({expected:"PRE_DRAG",phase:v,isLockActive:_,shouldWarn:!1})},shouldRespectForcePress:x,fluidLift:M,snapLift:O,abort:N};return L}var rEe=[N3e,$3e,H3e];function iEe(e){var t=e.contextId,n=e.store,r=e.registry,i=e.customSensors,o=e.enableDefaultSensors,s=[].concat(o?rEe:[],i||[]),a=w.exports.useState(function(){return _3e()})[0],u=Ln(function(M,O){M.isDragging&&!O.isDragging&&a.tryAbandon()},[a]);La(function(){var M=n.getState(),O=n.subscribe(function(){var N=n.getState();u(M,N),M=N});return O},[a,n,u]),La(function(){return a.tryAbandon},[a.tryAbandon]);for(var d=Ln(function(T){return _H({lockAPI:a,registry:r,store:n,draggableId:T})},[a,r,n]),p=Ln(function(T,M,O){return nEe({lockAPI:a,registry:r,contextId:t,store:n,draggableId:T,forceSensorStop:M,sourceEvent:O&&O.sourceEvent?O.sourceEvent:null})},[t,a,r,n]),m=Ln(function(T){return J3e(t,T)},[t]),v=Ln(function(T){var M=r.draggable.findById(T);return M?M.options:null},[r.draggable]),x=Ln(function(){!a.isClaimed()||(a.tryAbandon(),n.getState().phase!=="IDLE"&&n.dispatch(HT()))},[a,n]),_=Ln(a.isClaimed,[a]),P=br(function(){return{canGetLock:d,tryGetLock:p,findClosestDraggableId:m,findOptionsForDraggable:v,tryReleaseLock:x,isLockClaimed:_}},[d,p,m,v,x,_]),k=0;k{const[t,n]=w.exports.useState(e.order);w.exports.useEffect(()=>{n(e.order)},[e]);const r=s=>{if(!s.destination)return;var a=[...t];const[u]=a.splice(s.source.index,1);a.splice(s.destination.index,0,u),n(a),e.setOrder(a)},i=s=>{const a=t.map((u,d)=>s===d?{...u,show:!u.show}:u);n(a),e.setOrder(a)},o=()=>I("div",{onClick:s=>s.stopPropagation(),className:"z-10 bg-white-background rounded-xl p-3 space-y-3",style:{maxHeight:"80vh",overflowY:"scroll",margin:"24px 0 24px"},children:I(uEe,{onDragEnd:r,children:I(IH,{droppableId:"tableOrder",children:s=>$e("div",{className:"flex flex-col",...s.droppableProps,ref:s.innerRef,children:[t.map((a,u)=>{const d=a.position;if(!!e.defaultColumns[d])return I(WEe,{draggableId:`list-${d}`,index:u,children:p=>$e("div",{className:"flex flex-row gap-2 p-1.5 hover:bg-gray-300 rounded-md",ref:p.innerRef,...p.draggableProps,...p.dragHandleProps,children:[I(bc,{onChange:()=>i(u),checked:a.show}),I("p",{className:"m-0",children:e.defaultColumns[d].name||e.defaultColumns[d].title})]})},`list-${d}`)}),s.placeholder]})})})});return I(qv,{trigger:"click",dropdownRender:()=>o(),children:I($n,{onClick:s=>s.stopPropagation(),children:I(qwe,{})})})},JEe=()=>{const{tableState:{fullScreen:e},toggleFullScreen:t}=s0(),[n,r]=w.exports.useState(!1);return w.exports.useEffect(()=>{const a=setTimeout(()=>r(!1),1500);return()=>clearTimeout(a)},[n]),I($i,{title:e?"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C":"\u0420\u0430\u0441\u043A\u0440\u044B\u0442\u044C \u043D\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u044D\u043A\u0440\u0430\u043D",placement:"topRight",open:n,children:I($n,{onClick:a=>{a.stopPropagation(),t()},onMouseEnter:()=>{r(!0)},onMouseLeave:()=>{r(!1)},children:e?I(Nwe,{}):I(zwe,{})})})},Cw=({leftColumn:e,rightColumn:t,exportProvider:n,classes:r,orderColumns:i})=>$e("div",{className:"flex items-center w-full justify-between",children:[$e("div",{className:r==null?void 0:r.leftColumn,children:[I("span",{className:"py-[5px]",children:"\u0422\u0430\u0431\u043B\u0438\u0446\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043E\u0432"}),e]}),$e("div",{className:r==null?void 0:r.rightColumn,children:[t,$e("div",{className:"flex items-center gap-x-1",children:[I(QEe,{orderColumns:i}),n&&I(P4e,{provider:n}),I(JEe,{})]})]})]});let l6=e=>typeof e=="object"&&e!=null&&e.nodeType===1,u6=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",C2=(e,t)=>{if(e.clientHeight{let i=(o=>{if(!o.ownerDocument||!o.ownerDocument.defaultView)return null;try{return o.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!i&&(i.clientHeightot||o>e&&s=t&&a>=n?o-e-r:s>t&&an?s-t+i:0,ePe=e=>{let t=e.parentElement;return t==null?e.getRootNode().host||null:t},c6=(e,t)=>{var n,r,i,o;if(typeof document>"u")return[];let{scrollMode:s,block:a,inline:u,boundary:d,skipOverflowHiddenElements:p}=t,m=typeof d=="function"?d:X=>X!==d;if(!l6(e))throw new TypeError("Invalid target");let v=document.scrollingElement||document.documentElement,x=[],_=e;for(;l6(_)&&m(_);){if(_=ePe(_),_===v){x.push(_);break}_!=null&&_===document.body&&C2(_)&&!C2(document.documentElement)||_!=null&&C2(_,p)&&x.push(_)}let P=(r=(n=window.visualViewport)==null?void 0:n.width)!=null?r:innerWidth,k=(o=(i=window.visualViewport)==null?void 0:i.height)!=null?o:innerHeight,{scrollX:T,scrollY:M}=window,{height:O,width:N,top:L,right:F,bottom:V,left:B}=e.getBoundingClientRect(),H=a==="start"||a==="nearest"?L:a==="end"?V:L+O/2,G=u==="center"?B+N/2:u==="end"?F:B,ee=[];for(let X=0;X=0&&B>=0&&V<=k&&F<=P&&L>=ne&&V<=oe&&B>=he&&F<=se)return ee;let _e=getComputedStyle(Z),be=parseInt(_e.borderLeftWidth,10),xe=parseInt(_e.borderTopWidth,10),Te=parseInt(_e.borderRightWidth,10),Ee=parseInt(_e.borderBottomWidth,10),Ce=0,ke=0,De="offsetWidth"in Z?Z.offsetWidth-Z.clientWidth-be-Te:0,Ke="offsetHeight"in Z?Z.offsetHeight-Z.clientHeight-xe-Ee:0,Ue="offsetWidth"in Z?Z.offsetWidth===0?0:le/Z.offsetWidth:0,tt="offsetHeight"in Z?Z.offsetHeight===0?0:Q/Z.offsetHeight:0;if(v===Z)Ce=a==="start"?H:a==="end"?H-k:a==="nearest"?vx(M,M+k,k,xe,Ee,M+H,M+H+O,O):H-k/2,ke=u==="start"?G:u==="center"?G-P/2:u==="end"?G-P:vx(T,T+P,P,be,Te,T+G,T+G+N,N),Ce=Math.max(0,Ce+M),ke=Math.max(0,ke+T);else{Ce=a==="start"?H-ne-xe:a==="end"?H-oe+Ee+Ke:a==="nearest"?vx(ne,oe,Q,xe,Ee+Ke,H,H+O,O):H-(ne+Q/2)+Ke/2,ke=u==="start"?G-he-be:u==="center"?G-(he+le/2)+De/2:u==="end"?G-se+Te+De:vx(he,se,le,be,Te+De,G,G+N,N);let{scrollLeft:lt,scrollTop:St}=Z;Ce=Math.max(0,Math.min(St+Ce/tt,Z.scrollHeight-Q/tt+Ke)),ke=Math.max(0,Math.min(lt+ke/Ue,Z.scrollWidth-le/Ue+De)),H+=St-Ce,G+=lt-ke}ee.push({el:Z,top:Ce,left:ke})}return ee},tPe=e=>typeof e=="object"&&typeof e.behavior=="function",nPe=e=>e===!1?{block:"end",inline:"nearest"}:(t=>t===Object(t)&&Object.keys(t).length!==0)(e)?e:{block:"start",inline:"nearest"};function rPe(e,t){if(!e.isConnected||!e.ownerDocument.documentElement.contains(e))return;if(tPe(t))return t.behavior(c6(e,t));let n=typeof t=="boolean"||t==null?void 0:t.behavior;for(let{el:r,top:i,left:o}of c6(e,nPe(t)))r.scroll({top:i,left:o,behavior:n})}const nk=Un.memo(({rowSelection:e,data:t,pageSize:n,isClickedPointLoading:r,page:i,onPageChange:o,columns:s,header:a,fullWidth:u,loading:d,onChange:p})=>{const{clickedPointConfig:m,setClickedPointConfig:v}=Su(),{map:x}=WP(),{tableState:_,toggleOpened:P}=s0(),{setPopup:k}=Sf(),T={y:_.fullScreen?"calc(100vh - 136px)":"200px",x:"max-content"};return w.exports.useEffect(()=>{if(m===null||r)return;const M=document.querySelector(".scroll-row");M&&rPe(M,{behavior:"smooth"})},[m,t]),I(ll,{bordered:!1,onChange:P,activeKey:_.isOpened?"opened":null,children:I(ll.Panel,{header:a||I(Cw,{}),collapsible:_.fullScreen?"disabled":void 0,children:I(yU,{size:"small",className:da("table__wrapper",_.fullScreen&&"table__wrapper__fullScreen"),locale:{emptyText:I(dl,{description:"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"})},pagination:{pageSize:n,current:i,onChange:o,total:t==null?void 0:t.count,showSizeChanger:!1,position:"bottomCenter"},showHeader:(t==null?void 0:t.results)&&t.results.length>0,dataSource:t==null?void 0:t.results,columns:s,onChange:p,rowKey:"id",scroll:T,sticky:!0,onRow:M=>({onClick:()=>{const O=Rp.exports(M.geometry);x.flyTo({center:[O.coordinates[0],O.coordinates[1]],zoom:13,essential:!0}),k({features:[{properties:M}],coordinates:O.coordinates}),v(M.id,e==null?void 0:e.selectedRowKeys.includes(M.id))}}),rowSelection:e,rowClassName:M=>da("cursor-pointer",M.id===(m==null?void 0:m.id)&&"scroll-row"),"data-fullwidth":u,loading:d})},"opened")})}),up=(e,t)=>{var n,r;return(r=(n=t==null?void 0:t[e])==null?void 0:n.name)!=null?r:e},CE=[{name:"\u0410\u0434\u0440\u0435\u0441",field:"address"},{name:"\u0420\u0430\u0439\u043E\u043D",field:"area_id",fallbackField:"area",render:up,type:"region"},{name:"\u041E\u043A\u0440\u0443\u0433",field:"district_id",fallbackField:"district",render:up,type:"region"},{name:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",field:"name"},{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category"},{name:"\u0421\u0442\u0430\u0442\u0443\u0441",field:"status",render:e=>Nd[e]},{name:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",field:"prediction_current"}],TH=[{name:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440",field:"flat_cnt"},{name:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438",field:"year_bld"},{name:"\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439",field:"levels"},{name:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D",field:"mat_nes"}];[...CE,...TH];const iPe=[{name:"\u041F\u043B\u0430\u043D",field:"plan_current"},{name:"\u0424\u0430\u043A\u0442",field:"fact"},{name:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",field:"delta_current"},{name:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",field:"age_day"},{name:"id \u043B\u043E\u043A\u0430\u0446\u0438\u0438",field:"postamat_id",empty:"\u041D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D"}],oPe=[{name:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",field:"category_id"},{name:"\u0413\u0440\u0443\u043F\u043F\u0430",field:"group_id"}];function aPe(e,t){const[n,r]=w.exports.useState(e);return w.exports.useEffect(()=>{const i=setTimeout(()=>r(e),t||500);return()=>{clearTimeout(i)}},[e,t]),n}const sPe=e=>I("div",{children:e}),rk=({autoFocus:e=!1})=>{const{map:t}=WP(),[n,r]=w.exports.useState(""),i=aPe(n),{setPopup:o}=Sf(),{setClickedPointConfig:s}=Su(),a=w.exports.useRef(),u=ys(),{data:d}=Vi(["address",i],async()=>(await Mi.get(`https://postamates.spatialsystems.ru/api/${u}/search_address?page_size=100&address=${i}`)).data,{enabled:!!i}),p=w.exports.useMemo(()=>d?d.results.map(x=>({label:sPe(x.address),value:`${x.address}$${x.id}`,item:x})):[],[d]),m=x=>{r(x&&x.split("$")[0])},v=(x,_)=>{const P=Rp.exports(_.item.geometry);t.flyTo({center:[P.coordinates[0],P.coordinates[1]],zoom:13,essential:!0});const k={properties:_.item};o({features:[k],coordinates:P.coordinates}),s(k.properties.id)};return w.exports.useEffect(()=>{e&&(a==null?void 0:a.current)&&a.current.focus()},[e]),I("div",{children:I(use,{options:p,style:{width:300},value:n,onChange:m,onSelect:v,allowClear:!0,onClear:()=>r(""),autoFocus:e,popupClassName:"overflow-visible",children:I(tV,{prefix:I(TT,{}),placeholder:"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0430\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438",className:"text-ellipsis",ref:a})})})};var kH={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},d6=Un.createContext&&Un.createContext(kH),Sc=globalThis&&globalThis.__assign||function(){return Sc=Object.assign||function(e){for(var t,n=1,r=arguments.length;nMath.max(Math.min(e,n),t);function ug(e){return lc(x0(e*2.55),0,255)}function Ec(e){return lc(x0(e*255),0,255)}function nu(e){return lc(x0(e/2.55)/100,0,1)}function f6(e){return lc(x0(e*100),0,100)}const es={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},SE=[..."0123456789ABCDEF"],hPe=e=>SE[e&15],pPe=e=>SE[(e&240)>>4]+SE[e&15],yx=e=>(e&240)>>4===(e&15),mPe=e=>yx(e.r)&&yx(e.g)&&yx(e.b)&&yx(e.a);function gPe(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&es[e[1]]*17,g:255&es[e[2]]*17,b:255&es[e[3]]*17,a:t===5?es[e[4]]*17:255}:(t===7||t===9)&&(n={r:es[e[1]]<<4|es[e[2]],g:es[e[3]]<<4|es[e[4]],b:es[e[5]]<<4|es[e[6]],a:t===9?es[e[7]]<<4|es[e[8]]:255})),n}const vPe=(e,t)=>e<255?t(e):"";function yPe(e){var t=mPe(e)?hPe:pPe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+vPe(e.a,t):void 0}const xPe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function RH(e,t,n){const r=t*Math.min(n,1-n),i=(o,s=(o+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function bPe(e,t,n){const r=(i,o=(i+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function _Pe(e,t,n){const r=RH(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function wPe(e,t,n,r,i){return e===i?(t-n)/r+(t.5?p/(2-o-s):p/(o+s),u=wPe(n,r,i,p,o),u=u*60+.5),[u|0,d||0,a]}function ak(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ec)}function sk(e,t,n){return ak(RH,e,t,n)}function CPe(e,t,n){return ak(_Pe,e,t,n)}function SPe(e,t,n){return ak(bPe,e,t,n)}function AH(e){return(e%360+360)%360}function EPe(e){const t=xPe.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?ug(+t[5]):Ec(+t[5]));const i=AH(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=CPe(i,o,s):t[1]==="hsv"?r=SPe(i,o,s):r=sk(i,o,s),{r:r[0],g:r[1],b:r[2],a:n}}function PPe(e,t){var n=ok(e);n[0]=AH(n[0]+t),n=sk(n),e.r=n[0],e.g=n[1],e.b=n[2]}function IPe(e){if(!e)return;const t=ok(e),n=t[0],r=f6(t[1]),i=f6(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${nu(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const h6={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},p6={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function TPe(){const e={},t=Object.keys(p6),n=Object.keys(h6);let r,i,o,s,a;for(r=0;r>16&255,o>>8&255,o&255]}return e}let xx;function kPe(e){xx||(xx=TPe(),xx.transparent=[0,0,0,0]);const t=xx[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const MPe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function RPe(e){const t=MPe.exec(e);let n=255,r,i,o;if(!!t){if(t[7]!==r){const s=+t[7];n=t[8]?ug(s):lc(s*255,0,255)}return r=+t[1],i=+t[3],o=+t[5],r=255&(t[2]?ug(r):lc(r,0,255)),i=255&(t[4]?ug(i):lc(i,0,255)),o=255&(t[6]?ug(o):lc(o,0,255)),{r,g:i,b:o,a:n}}}function APe(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${nu(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const S2=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,sh=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function DPe(e,t,n){const r=sh(nu(e.r)),i=sh(nu(e.g)),o=sh(nu(e.b));return{r:Ec(S2(r+n*(sh(nu(t.r))-r))),g:Ec(S2(i+n*(sh(nu(t.g))-i))),b:Ec(S2(o+n*(sh(nu(t.b))-o))),a:e.a+n*(t.a-e.a)}}function bx(e,t,n){if(e){let r=ok(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=sk(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function DH(e,t){return e&&Object.assign(t||{},e)}function m6(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ec(e[3]))):(t=DH(e,{r:0,g:0,b:0,a:1}),t.a=Ec(t.a)),t}function OPe(e){return e.charAt(0)==="r"?RPe(e):EPe(e)}class Cv{constructor(t){if(t instanceof Cv)return t;const n=typeof t;let r;n==="object"?r=m6(t):n==="string"&&(r=gPe(t)||kPe(t)||OPe(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=DH(this._rgb);return t&&(t.a=nu(t.a)),t}set rgb(t){this._rgb=m6(t)}rgbString(){return this._valid?APe(this._rgb):void 0}hexString(){return this._valid?yPe(this._rgb):void 0}hslString(){return this._valid?IPe(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let o;const s=n===o?.5:n,a=2*s-1,u=r.a-i.a,d=((a*u===-1?a:(a+u)/(1+a*u))+1)/2;o=1-d,r.r=255&d*r.r+o*i.r+.5,r.g=255&d*r.g+o*i.g+.5,r.b=255&d*r.b+o*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=DPe(this._rgb,t._rgb,n)),this}clone(){return new Cv(this.rgb)}alpha(t){return this._rgb.a=Ec(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=x0(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return bx(this._rgb,2,t),this}darken(t){return bx(this._rgb,2,-t),this}saturate(t){return bx(this._rgb,1,t),this}desaturate(t){return bx(this._rgb,1,-t),this}rotate(t){return PPe(this._rgb,t),this}}/*! * Chart.js v4.5.0 * https://www.chartjs.org * (c) 2025 Chart.js Contributors * Released under the MIT License */function Wl(){}const NPe=(()=>{let e=0;return()=>e++})();function wr(e){return e==null}function li(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Sr(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ro(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ia(e,t){return ro(e)?e:t}function cr(e,t){return typeof e>"u"?t:e}const LPe=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Qr(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ar(e,t,n,r){let i,o,s;if(li(e))if(o=e.length,r)for(i=o-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function $Pe(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function BPe(e){const t=$Pe(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function cp(e,t){return(g6[t]||(g6[t]=BPe(t)))(e)}function lk(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ev=e=>typeof e<"u",Dc=e=>typeof e=="function",v6=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function VPe(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Bi=Math.PI,ds=2*Bi,UPe=ds+Bi,Lb=Number.POSITIVE_INFINITY,jPe=Bi/180,Aa=Bi/2,gd=Bi/4,y6=Bi*2/3,uc=Math.log10,bl=Math.sign;function Ng(e,t,n){return Math.abs(e-t)i-o).pop(),t}function KPe(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Pv(e){return!KPe(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function WPe(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function NH(e,t,n){let r,i,o;for(r=0,i=e.length;ru&&d=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ck(e,t,n){n=n||(s=>e[s]1;)o=i+r>>1,n(o)?i=o:r=o;return{lo:i,hi:r}}const Vd=(e,t,n,r)=>ck(e,n,r?i=>{const o=e[i][t];return oe[i][t]ck(e,n,r=>e[r][t]>=n);function YPe(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{const r="_onData"+lk(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const s=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function _6(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(FH.forEach(o=>{delete e[o]}),delete e._chartjs)}function zH(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const $H=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function BH(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,$H.call(window,()=>{r=!1,e.apply(t,n)}))}}function JPe(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const dk=e=>e==="start"?"left":e==="end"?"right":"center",Po=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,eIe=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function tIe(e,t,n){const r=t.length;let i=0,o=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:u}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,p=s.axis,{min:m,max:v,minDefined:x,maxDefined:_}=s.getUserBounds();if(x){if(i=Math.min(Vd(u,p,m).lo,n?r:Vd(t,p,s.getPixelForValue(m)).lo),d){const P=u.slice(0,i+1).reverse().findIndex(k=>!wr(k[a.axis]));i-=Math.max(0,P)}i=Da(i,0,r-1)}if(_){let P=Math.max(Vd(u,s.axis,v,!0).hi+1,n?0:Vd(t,p,s.getPixelForValue(v),!0).hi+1);if(d){const k=u.slice(P-1).findIndex(T=>!wr(T[a.axis]));P+=Math.max(0,k)}o=Da(P,i,r)-i}else o=r-i}return{start:i,count:o}}function nIe(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),o}const _x=e=>e===0||e===1,w6=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ds/n)),C6=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ds/n)+1,Lg={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Aa)+1,easeOutSine:e=>Math.sin(e*Aa),easeInOutSine:e=>-.5*(Math.cos(Bi*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>_x(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>_x(e)?e:w6(e,.075,.3),easeOutElastic:e=>_x(e)?e:C6(e,.075,.3),easeInOutElastic(e){return _x(e)?e:e<.5?.5*w6(e*2,.1125,.45):.5+.5*C6(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Lg.easeOutBounce(1-e),easeOutBounce(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},easeInOutBounce:e=>e<.5?Lg.easeInBounce(e*2)*.5:Lg.easeOutBounce(e*2-1)*.5+.5};function fk(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function S6(e){return fk(e)?e:new Cv(e)}function E2(e){return fk(e)?e:new Cv(e).saturate(.5).darken(.1).hexString()}const rIe=["x","y","borderWidth","radius","tension"],iIe=["color","borderColor","backgroundColor"];function oIe(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:iIe},numbers:{type:"number",properties:rIe}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function aIe(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const E6=new Map;function sIe(e,t){t=t||{};const n=e+JSON.stringify(t);let r=E6.get(n);return r||(r=new Intl.NumberFormat(e,t),E6.set(n,r)),r}function hk(e,t,n){return sIe(t,n).format(e)}const VH={values(e){return li(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,o=e;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(i="scientific"),o=lIe(e,n)}const s=uc(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),u={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(u,this.options.ticks.format),hk(e,r,u)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(uc(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?VH.numeric.call(this,e,t,n):""}};function lIe(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Sw={formatters:VH};function uIe(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Sw.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const lf=Object.create(null),PE=Object.create(null);function Fg(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;rr.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>E2(i.backgroundColor),this.hoverBorderColor=(r,i)=>E2(i.borderColor),this.hoverColor=(r,i)=>E2(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return P2(this,t,n)}get(t){return Fg(this,t)}describe(t,n){return P2(PE,t,n)}override(t,n){return P2(lf,t,n)}route(t,n,r,i){const o=Fg(this,t),s=Fg(this,r),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const u=this[a],d=s[i];return Sr(u)?Object.assign({},d,u):cr(u,d)},set(u){this[a]=u}}})}apply(t){t.forEach(n=>n(this))}}var _i=new cIe({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[oIe,aIe,uIe]);function dIe(e){return!e||wr(e.size)||wr(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Fb(e,t,n,r,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>r&&(r=o),r}function fIe(e,t,n,r){r=r||{};let i=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let u,d,p,m,v;for(u=0;un.length){for(u=0;u0&&e.stroke()}}function au(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&o.strokeColor!=="";let u,d;for(e.save(),e.font=i.string,mIe(e,o),u=0;u+e||0;function jH(e,t){const n={},r=Sr(t),i=r?Object.keys(t):t,o=Sr(e)?r?s=>cr(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of i)n[s]=_Ie(o(s));return n}function HH(e){return jH(e,{top:"y",right:"x",bottom:"y",left:"x"})}function qd(e){return jH(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ao(e){const t=HH(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Gi(e,t){e=e||{},t=t||_i.font;let n=cr(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=cr(e.style,t.style);r&&!(""+r).match(xIe)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:cr(e.family,t.family),lineHeight:bIe(cr(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:cr(e.weight,t.weight),string:""};return i.string=dIe(i),i}function wx(e,t,n,r){let i=!0,o,s,a;for(o=0,s=e.length;on&&a===0?0:a+u;return{min:s(r,-Math.abs(o)),max:s(i,o)}}function Vc(e,t){return Object.assign(Object.create(e),t)}function gk(e,t=[""],n,r,i=()=>e[0]){const o=n||e;typeof r>"u"&&(r=qH("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:i,override:a=>gk([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,u){return delete a[u],delete a._keys,delete e[0][u],!0},get(a,u){return WH(a,u,()=>MIe(u,t,e,a))},getOwnPropertyDescriptor(a,u){return Reflect.getOwnPropertyDescriptor(a._scopes[0],u)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,u){return T6(a).includes(u)},ownKeys(a){return T6(a)},set(a,u,d){const p=a._storage||(a._storage=i());return a[u]=p[u]=d,delete a._keys,!0}})}function dp(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:KH(e,r),setContext:o=>dp(e,o,n,r),override:o=>dp(e.override(o),t,n,r)};return new Proxy(i,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return WH(o,s,()=>SIe(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function KH(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Dc(n)?n:()=>n,isIndexable:Dc(r)?r:()=>r}}const CIe=(e,t)=>e?e+lk(t):t,vk=(e,t)=>Sr(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function WH(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function SIe(e,t,n){const{_proxy:r,_context:i,_subProxy:o,_descriptors:s}=e;let a=r[t];return Dc(a)&&s.isScriptable(t)&&(a=EIe(t,a,e,n)),li(a)&&a.length&&(a=PIe(t,a,e,s.isIndexable)),vk(t,a)&&(a=dp(a,i,o&&o[t],s)),a}function EIe(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let u=t(o,s||r);return a.delete(e),vk(e,u)&&(u=yk(i._scopes,i,e,u)),u}function PIe(e,t,n,r){const{_proxy:i,_context:o,_subProxy:s,_descriptors:a}=n;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(Sr(t[0])){const u=t,d=i._scopes.filter(p=>p!==u);t=[];for(const p of u){const m=yk(d,i,e,p);t.push(dp(m,o,s&&s[e],a))}}return t}function GH(e,t,n){return Dc(e)?e(t,n):e}const IIe=(e,t)=>e===!0?t:typeof e=="string"?cp(t,e):void 0;function TIe(e,t,n,r,i){for(const o of t){const s=IIe(n,o);if(s){e.add(s);const a=GH(s._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function yk(e,t,n,r){const i=t._rootScopes,o=GH(t._fallback,n,r),s=[...e,...i],a=new Set;a.add(r);let u=I6(a,s,n,o||n,r);return u===null||typeof o<"u"&&o!==n&&(u=I6(a,s,o,u,r),u===null)?!1:gk(Array.from(a),[""],i,o,()=>kIe(t,n,r))}function I6(e,t,n,r,i){for(;n;)n=TIe(e,t,n,r,i);return n}function kIe(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return li(i)&&Sr(n)?n:i||{}}function MIe(e,t,n,r){let i;for(const o of t)if(i=qH(CIe(o,e),n),typeof i<"u")return vk(e,i)?yk(n,r,e,i):i}function qH(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function T6(e){let t=e._keys;return t||(t=e._keys=RIe(e._scopes)),t}function RIe(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}const AIe=Number.EPSILON||1e-14,fp=(e,t)=>te==="x"?"y":"x";function DIe(e,t,n,r){const i=e.skip?t:e,o=t,s=n.skip?t:n,a=EE(o,i),u=EE(s,o);let d=a/(a+u),p=u/(a+u);d=isNaN(d)?0:d,p=isNaN(p)?0:p;const m=r*d,v=r*p;return{previous:{x:o.x-m*(s.x-i.x),y:o.y-m*(s.y-i.y)},next:{x:o.x+v*(s.x-i.x),y:o.y+v*(s.y-i.y)}}}function OIe(e,t,n){const r=e.length;let i,o,s,a,u,d=fp(e,0);for(let p=0;p!d.skip)),t.cubicInterpolationMode==="monotone")LIe(e,i);else{let d=r?e[e.length-1]:e[0];for(o=0,s=e.length;oe.ownerDocument.defaultView.getComputedStyle(e,null);function $Ie(e,t){return Ew(e).getPropertyValue(t)}const BIe=["top","right","bottom","left"];function Zd(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=BIe[i];r[o]=parseFloat(e[t+"-"+o+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const VIe=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function UIe(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=r;let s=!1,a,u;if(VIe(i,o,e.target))a=i,u=o;else{const d=t.getBoundingClientRect();a=r.clientX-d.left,u=r.clientY-d.top,s=!0}return{x:a,y:u,box:s}}function Id(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=Ew(n),o=i.boxSizing==="border-box",s=Zd(i,"padding"),a=Zd(i,"border","width"),{x:u,y:d,box:p}=UIe(e,n),m=s.left+(p&&a.left),v=s.top+(p&&a.top);let{width:x,height:_}=t;return o&&(x-=s.width+a.width,_-=s.height+a.height),{x:Math.round((u-m)/x*n.width/r),y:Math.round((d-v)/_*n.height/r)}}function jIe(e,t,n){let r,i;if(t===void 0||n===void 0){const o=e&&bk(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const s=o.getBoundingClientRect(),a=Ew(o),u=Zd(a,"border","width"),d=Zd(a,"padding");t=s.width-d.width-u.width,n=s.height-d.height-u.height,r=zb(a.maxWidth,o,"clientWidth"),i=zb(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:r||Lb,maxHeight:i||Lb}}const Sx=e=>Math.round(e*10)/10;function HIe(e,t,n,r){const i=Ew(e),o=Zd(i,"margin"),s=zb(i.maxWidth,e,"clientWidth")||Lb,a=zb(i.maxHeight,e,"clientHeight")||Lb,u=jIe(e,t,n);let{width:d,height:p}=u;if(i.boxSizing==="content-box"){const v=Zd(i,"border","width"),x=Zd(i,"padding");d-=x.width+v.width,p-=x.height+v.height}return d=Math.max(0,d-o.width),p=Math.max(0,r?d/r:p-o.height),d=Sx(Math.min(d,s,u.maxWidth)),p=Sx(Math.min(p,a,u.maxHeight)),d&&!p&&(p=Sx(d/2)),(t!==void 0||n!==void 0)&&r&&u.height&&p>u.height&&(p=u.height,d=Sx(Math.floor(p*r))),{width:d,height:p}}function k6(e,t,n){const r=t||1,i=Math.floor(e.height*r),o=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==i||s.width!==o?(e.currentDevicePixelRatio=r,s.height=i,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const KIe=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};xk()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function M6(e,t){const n=$Ie(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Td(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function WIe(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function GIe(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Td(e,i,n),a=Td(i,o,n),u=Td(o,t,n),d=Td(s,a,n),p=Td(a,u,n);return Td(d,p,n)}const qIe=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},ZIe=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function zh(e,t,n){return e?qIe(t,n):ZIe()}function XH(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function YH(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function QH(e){return e==="angle"?{between:LH,compare:qPe,normalize:Ns}:{between:Bd,compare:(t,n)=>t-n,normalize:t=>t}}function R6({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function XIe(e,t,n){const{property:r,start:i,end:o}=n,{between:s,normalize:a}=QH(r),u=t.length;let{start:d,end:p,loop:m}=e,v,x;if(m){for(d+=u,p+=u,v=0,x=u;vu(i,O,T)&&a(i,O)!==0,L=()=>a(o,T)===0||u(o,O,T),F=()=>P||N(),V=()=>!P||L();for(let B=p,H=p;B<=m;++B)M=t[B%s],!M.skip&&(T=d(M[r]),T!==O&&(P=u(T,i,o),k===null&&F()&&(k=a(T,i)===0?B:H),k!==null&&V()&&(_.push(R6({start:k,end:B,loop:v,count:s,style:x})),k=null),H=B,O=T));return k!==null&&_.push(R6({start:k,end:m,loop:v,count:s,style:x})),_}function QIe(e,t){const n=[],r=e.segments;for(let i=0;ii&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function eTe(e,t,n,r){const i=e.length,o=[];let s=t,a=e[t],u;for(u=t+1;u<=n;++u){const d=e[u%i];d.skip||d.stop?a.skip||(r=!1,o.push({start:t%i,end:(u-1)%i,loop:r}),t=s=d.stop?u:null):(s=u,a.skip&&(t=u)),a=d}return s!==null&&o.push({start:t%i,end:s%i,loop:r}),o}function tTe(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:s,end:a}=JIe(n,i,o,r);if(r===!0)return A6(e,[{start:s,end:a,loop:o}],n,t);const u=aa({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=$H.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,u;for(;s>=0;--s)u=o[s],u._active?(u._total>r.duration&&(r.duration=u._total),u.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),o.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);!n||(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ql=new aTe;const O6="transparent",sTe={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=S6(e||O6),i=r.valid&&S6(t||O6);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class lTe{constructor(t,n,r,i){const o=n[r];i=wx([t.to,i,o,t.from]);const s=wx([t.from,o,i]);this._active=!0,this._fn=t.fn||sTe[t.type||typeof s],this._easing=Lg[t.easing]||Lg.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=wx([t.to,n,i,t.from]),this._from=wx([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,o=this._from,s=this._loop,a=this._to;let u;if(this._active=o!==a&&(s||n1?2-u:u,u=this._easing(Math.min(1,Math.max(0,u))),this._target[i]=this._fn(o,a,u)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i{const o=t[i];if(!Sr(o))return;const s={};for(const a of n)s[a]=o[a];(li(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,i=cTe(t,r);if(!i)return[];const o=this._createAnimations(i,r);return r.$shared&&uTe(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,n){const r=this._properties,i=[],o=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let u;for(u=s.length-1;u>=0;--u){const d=s[u];if(d.charAt(0)==="$")continue;if(d==="options"){i.push(...this._animateOptions(t,n));continue}const p=n[d];let m=o[d];const v=r.get(d);if(m)if(v&&m.active()){m.update(v,p,a);continue}else m.cancel();if(!v||!v.duration){t[d]=p;continue}o[d]=m=new lTe(v,t,d,p),i.push(m)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return ql.add(this._chart,r),!0}}function uTe(e,t){const n=[],r=Object.keys(t);for(let i=0;i0||!n&&o<0)return i.index}return null}function z6(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:s,index:a}=r,u=o.axis,d=s.axis,p=pTe(o,s,r),m=t.length;let v;for(let x=0;xn[r].axis===t).shift()}function vTe(e,t){return Vc(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yTe(e,t,n){return Vc(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function qm(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(!!r){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[r]===void 0||o[r][n]===void 0)return;delete o[r][n],o[r]._visualValues!==void 0&&o[r]._visualValues[n]!==void 0&&delete o[r]._visualValues[n]}}}const k2=e=>e==="reset"||e==="none",$6=(e,t)=>t?e:Object.assign({},e),xTe=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:eK(n,!0),values:null};class $h{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=I2(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&qm(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(m,v,x,_)=>m==="x"?v:m==="r"?_:x,o=n.xAxisID=cr(r.xAxisID,T2(t,"x")),s=n.yAxisID=cr(r.yAxisID,T2(t,"y")),a=n.rAxisID=cr(r.rAxisID,T2(t,"r")),u=n.indexAxis,d=n.iAxisID=i(u,o,s,a),p=n.vAxisID=i(u,s,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(p)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&_6(this._data,this),t._stacked&&qm(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Sr(n)){const i=this._cachedMeta;this._data=hTe(n,i)}else if(r!==n){if(r){_6(r,this);const i=this._cachedMeta;qm(i),i._parsed=[]}n&&Object.isExtensible(n)&&QPe(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=I2(n.vScale,n),n.stack!==r.stack&&(i=!0,qm(n),n.stack=r.stack),this._resyncElements(t),(i||o!==n._stacked)&&(z6(this,n._parsed),n._stacked=I2(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:o,_stacked:s}=r,a=o.axis;let u=t===0&&n===i.length?!0:r._sorted,d=t>0&&r._parsed[t-1],p,m,v;if(this._parsing===!1)r._parsed=i,r._sorted=!0,v=i;else{li(i[t])?v=this.parseArrayData(r,i,t,n):Sr(i[t])?v=this.parseObjectData(r,i,t,n):v=this.parsePrimitiveData(r,i,t,n);const x=()=>m[a]===null||d&&m[a]P||m=0;--v)if(!_()){this.updateRangeFromParsed(d,t,x,u);break}}return d}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,o,s;for(i=0,o=n.length;i=0&&tthis.getContext(r,i,n),P=d.resolveNamedOptions(v,x,_,m);return P.$shared&&(P.$shared=u,o[s]=Object.freeze($6(P,u))),P}_resolveAnimations(t,n,r){const i=this.chart,o=this._cachedDataOpts,s=`animation-${n}`,a=o[s];if(a)return a;let u;if(i.options.animation!==!1){const p=this.chart.config,m=p.datasetAnimationScopeKeys(this._type,n),v=p.getOptionScopes(this.getDataset(),m);u=p.createResolver(v,this.getContext(t,r,n))}const d=new JH(i,u&&u.animations);return u&&u._cacheable&&(o[s]=Object.freeze(d)),d}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||k2(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,r),{sharedOptions:o,includeOptions:s}}updateElement(t,n,r,i){k2(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!k2(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,u,d]of this._syncList)this[a](u,d);this._syncList=[];const i=r.length,o=n.length,s=Math.min(o,i);s&&this.parse(0,s),o>i?this._insertElements(i,o-i,t):o{for(d.length+=n,a=d.length-1;a>=s;a--)d[a]=d[a-n]};for(u(o),a=t;ai-o))}return e._cache.$bar}function _Te(e){const t=e.iScale,n=bTe(t,e.type);let r=t._length,i,o,s,a;const u=()=>{s===32767||s===-32768||(Ev(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(i=0,o=n.length;i0?i[e-1]:null,a=eMath.abs(a)&&(u=a,d=s),t[n.axis]=d,t._custom={barStart:u,barEnd:d,start:i,end:o,min:s,max:a}}function tK(e,t,n,r){return li(e)?STe(e,t,n,r):t[n.axis]=n.parse(e,r),t}function B6(e,t,n,r){const i=e.iScale,o=e.vScale,s=i.getLabels(),a=i===o,u=[];let d,p,m,v;for(d=n,p=n+r;d=n?1:-1)}function PTe(e){let t,n,r,i,o;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.basep.controller.options.grouped),o=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),u=a&&a[r.axis],d=p=>{const m=p._parsed.find(x=>x[r.axis]===u),v=m&&m[p.vScale.axis];if(wr(v)||isNaN(v))return!0};for(const p of i)if(!(n!==void 0&&d(p))&&((o===!1||s.indexOf(p.stack)===-1||o===void 0&&p.stack===void 0)&&s.push(p.stack),p.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[cr(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let o,s;for(o=0,s=n.data.length;o0&&this.getParsed(n-1);for(let L=0;L=M){V.skip=!0;continue}const B=this.getParsed(L),H=wr(B[x]),G=V[v]=s.getPixelForValue(B[v],L),ee=V[x]=o||H?a.getBasePixel():a.getPixelForValue(u?this.applyStack(a,B,u):B[x],L);V.skip=isNaN(G)||isNaN(ee)||H,V.stop=L>0&&Math.abs(B[v]-N[v])>k,P&&(V.parsed=B,V.raw=d.data[L]),m&&(V.options=p||this.resolveDataElementOptions(L,F.active?"active":i)),T||this.updateElement(F,L,V,i),N=B}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Bn(f1,"id","line"),Bn(f1,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Bn(f1,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function yd(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _k{constructor(t){Bn(this,"options");this.options=t||{}}static override(t){Object.assign(_k.prototype,t)}init(){}formats(){return yd()}parse(){return yd()}format(){return yd()}add(){return yd()}diff(){return yd()}startOf(){return yd()}endOf(){return yd()}}var MTe={_date:_k};function RTe(e,t,n,r){const{controller:i,data:o,_sorted:s}=e,a=i._cachedMeta.iScale,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const d=a._reversePixels?XPe:Vd;if(r){if(i._sharedOptions){const p=o[0],m=typeof p.getRange=="function"&&p.getRange(t);if(m){const v=d(o,t,n-m),x=d(o,t,n+m);return{lo:v.lo,hi:x.hi}}}}else{const p=d(o,t,n);if(u){const{vScale:m}=i._cachedMeta,{_parsed:v}=e,x=v.slice(0,p.lo+1).reverse().findIndex(P=>!wr(P[m.axis]));p.lo-=Math.max(0,x);const _=v.slice(p.hi).findIndex(P=>!wr(P[m.axis]));p.hi+=Math.max(0,_)}return p}}return{lo:0,hi:o.length-1}}function b0(e,t,n,r,i){const o=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,u=o.length;a{u[s]&&u[s](t[n],i)&&(o.push({element:u,datasetIndex:d,index:p}),a=a||u.inRange(t.x,t.y,i))}),r&&!a?[]:o}var NTe={evaluateInteractionItems:b0,modes:{index(e,t,n,r){const i=Id(t,e),o=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?R2(e,i,o,r,s):A2(e,i,o,!1,r,s),u=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(d=>{const p=a[0].index,m=d.data[p];m&&!m.skip&&u.push({element:m,datasetIndex:d.index,index:p})}),u):[]},dataset(e,t,n,r){const i=Id(t,e),o=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?R2(e,i,o,r,s):A2(e,i,o,!1,r,s);if(a.length>0){const u=a[0].datasetIndex,d=e.getDatasetMeta(u).data;a=[];for(let p=0;pn.pos===t)}function H6(e,t){return e.filter(n=>nK.indexOf(n.pos)===-1&&n.box.axis===t)}function Xm(e,t){return e.sort((n,r)=>{const i=t?r:n,o=t?n:r;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function LTe(e){const t=[];let n,r,i,o,s,a;for(n=0,r=(e||[]).length;nd.box.fullSize),!0),r=Xm(Zm(t,"left"),!0),i=Xm(Zm(t,"right")),o=Xm(Zm(t,"top"),!0),s=Xm(Zm(t,"bottom")),a=H6(t,"x"),u=H6(t,"y");return{fullSize:n,leftAndTop:r.concat(o),rightAndBottom:i.concat(u).concat(s).concat(a),chartArea:Zm(t,"chartArea"),vertical:r.concat(i).concat(u),horizontal:o.concat(s).concat(a)}}function K6(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function rK(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function BTe(e,t,n,r){const{pos:i,box:o}=n,s=e.maxPadding;if(!Sr(i)){n.size&&(e[i]-=n.size);const m=r[n.stack]||{size:0,count:1};m.size=Math.max(m.size,n.horizontal?o.height:o.width),n.size=m.size/m.count,e[i]+=n.size}o.getPadding&&rK(s,o.getPadding());const a=Math.max(0,t.outerWidth-K6(s,e,"left","right")),u=Math.max(0,t.outerHeight-K6(s,e,"top","bottom")),d=a!==e.w,p=u!==e.h;return e.w=a,e.h=u,n.horizontal?{same:d,other:p}:{same:p,other:d}}function VTe(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function UTe(e,t){const n=t.maxPadding;function r(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{o[s]=Math.max(t[s],n[s])}),o}return r(e?["left","right"]:["top","bottom"])}function cg(e,t,n,r){const i=[];let o,s,a,u,d,p;for(o=0,s=e.length,d=0;o{typeof P.beforeLayout=="function"&&P.beforeLayout()});const p=u.reduce((P,k)=>k.box.options&&k.box.options.display===!1?P:P+1,0)||1,m=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/p,hBoxMaxHeight:s/2}),v=Object.assign({},i);rK(v,Ao(r));const x=Object.assign({maxPadding:v,w:o,h:s,x:i.left,y:i.top},i),_=zTe(u.concat(d),m);cg(a.fullSize,x,m,_),cg(u,x,m,_),cg(d,x,m,_)&&cg(u,x,m,_),VTe(x),W6(a.leftAndTop,x,m,_),x.x+=x.w,x.y+=x.h,W6(a.rightAndBottom,x,m,_),e.chartArea={left:x.left,top:x.top,right:x.left+x.w,bottom:x.top+x.h,height:x.h,width:x.w},Ar(a.chartArea,P=>{const k=P.box;Object.assign(k,e.chartArea),k.update(x.w,x.h,{left:0,top:0,right:0,bottom:0})})}};class iK{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class jTe extends iK{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const h1="$chartjs",HTe={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},G6=e=>e===null||e==="";function KTe(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[h1]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",G6(i)){const o=M6(e,"width");o!==void 0&&(e.width=o)}if(G6(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=M6(e,"height");o!==void 0&&(e.height=o)}return e}const oK=KIe?{passive:!0}:!1;function WTe(e,t,n){e&&e.addEventListener(t,n,oK)}function GTe(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,oK)}function qTe(e,t){const n=HTe[e.type]||e.type,{x:r,y:i}=Id(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function $b(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function ZTe(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||$b(a.addedNodes,r),s=s&&!$b(a.removedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function XTe(e,t,n){const r=e.canvas,i=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||$b(a.removedNodes,r),s=s&&!$b(a.addedNodes,r);s&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const Tv=new Map;let q6=0;function aK(){const e=window.devicePixelRatio;e!==q6&&(q6=e,Tv.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function YTe(e,t){Tv.size||window.addEventListener("resize",aK),Tv.set(e,t)}function QTe(e){Tv.delete(e),Tv.size||window.removeEventListener("resize",aK)}function JTe(e,t,n){const r=e.canvas,i=r&&bk(r);if(!i)return;const o=BH((a,u)=>{const d=i.clientWidth;n(a,u),d{const u=a[0],d=u.contentRect.width,p=u.contentRect.height;d===0&&p===0||o(d,p)});return s.observe(i),YTe(e,o),s}function D2(e,t,n){n&&n.disconnect(),t==="resize"&&QTe(e)}function eke(e,t,n){const r=e.canvas,i=BH(o=>{e.ctx!==null&&n(qTe(o,e))},e);return WTe(r,t,i),i}class tke extends iK{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(KTe(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[h1])return!1;const r=n[h1].initial;["height","width"].forEach(o=>{const s=r[o];wr(s)?n.removeAttribute(o):n.setAttribute(o,s)});const i=r.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[h1],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),s={attach:ZTe,detach:XTe,resize:JTe}[n]||eke;i[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:D2,detach:D2,resize:D2}[n]||GTe)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return HIe(t,n,r,i)}isAttached(t){const n=t&&bk(t);return!!(n&&n.isConnected)}}function nke(e){return!xk()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?jTe:tke}class _l{constructor(){Bn(this,"x");Bn(this,"y");Bn(this,"active",!1);Bn(this,"options");Bn(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Pv(this.x)&&Pv(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(o=>{i[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),i}}Bn(_l,"defaults",{}),Bn(_l,"defaultRoutes");function rke(e,t){const n=e.options.ticks,r=ike(e),i=Math.min(n.maxTicksLimit||r,r),o=n.major.enabled?ake(t):[],s=o.length,a=o[0],u=o[s-1],d=[];if(s>i)return ske(t,d,o,s/i),d;const p=oke(o,t,i);if(s>0){let m,v;const x=s>1?Math.round((u-a)/(s-1)):null;for(Ix(t,d,p,wr(x)?0:a-x,a),m=0,v=s-1;mi)return u}return Math.max(i,1)}function ake(e){const t=[];let n,r;for(n=0,r=e.length;ne==="left"?"right":e==="right"?"left":e,Z6=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,X6=(e,t)=>Math.min(t||e,e);function Y6(e,t){const n=[],r=e.length/t,i=e.length;let o=0;for(;os+a)))return u}function dke(e,t){Ar(e,n=>{const r=n.gc,i=r.length/2;let o;if(i>t){for(o=0;or?r:n,r=i&&n>r?n:r,{min:Ia(n,Ia(r,n)),max:Ia(r,Ia(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Qr(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=wIe(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const u=a=o||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const p=this._getLabelSizes(),m=p.widest.width,v=p.highest.height,x=Da(this.chart.width-m,0,this.maxWidth);a=t.offset?this.maxWidth/r:x/(r-1),m+6>a&&(a=x/(r-(t.offset?.5:1)),u=this.maxHeight-Ym(t.grid)-n.padding-Q6(t.title,this.chart.options.font),d=Math.sqrt(m*m+v*v),s=uk(Math.min(Math.asin(Da((p.highest.height+6)/a,-1,1)),Math.asin(Da(u/d,-1,1))-Math.asin(Da(v/d,-1,1)))),s=Math.max(i,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){Qr(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Qr(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const u=Q6(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ym(o)+u):(t.height=this.maxHeight,t.width=Ym(o)+u),r.display&&this.ticks.length){const{first:d,last:p,widest:m,highest:v}=this._getLabelSizes(),x=r.padding*2,_=cc(this.labelRotation),P=Math.cos(_),k=Math.sin(_);if(a){const T=r.mirror?0:k*m.width+P*v.height;t.height=Math.min(this.maxHeight,t.height+T+x)}else{const T=r.mirror?0:P*m.width+k*v.height;t.width=Math.min(this.maxWidth,t.width+T+x)}this._calculatePadding(d,p,k,P)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:o,padding:s},position:a}=this.options,u=this.labelRotation!==0,d=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const p=this.getPixelForTick(0)-this.left,m=this.right-this.getPixelForTick(this.ticks.length-1);let v=0,x=0;u?d?(v=i*t.width,x=r*n.height):(v=r*t.height,x=i*n.width):o==="start"?x=n.width:o==="end"?v=t.width:o!=="inner"&&(v=t.width/2,x=n.width/2),this.paddingLeft=Math.max((v-p+s)*this.width/(this.width-p),0),this.paddingRight=Math.max((x-m+s)*this.width/(this.width-m),0)}else{let p=n.height/2,m=t.height/2;o==="start"?(p=0,m=t.height):o==="end"&&(p=n.height,m=0),this.paddingTop=p+s,this.paddingBottom=m+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Qr(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n({width:s[H]||0,height:a[H]||0});return{first:B(0),last:B(n-1),widest:B(F),highest:B(V),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return ZPe(this._alignToPixels?vd(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&ta*i?a/r:u/i:u*i0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:o,position:s,border:a}=i,u=o.offset,d=this.isHorizontal(),m=this.ticks.length+(u?1:0),v=Ym(o),x=[],_=a.setContext(this.getContext()),P=_.display?_.width:0,k=P/2,T=function(ne){return vd(r,ne,P)};let M,O,N,L,F,V,B,H,G,ee,X,Z;if(s==="top")M=T(this.bottom),V=this.bottom-v,H=M-k,ee=T(t.top)+k,Z=t.bottom;else if(s==="bottom")M=T(this.top),ee=t.top,Z=T(t.bottom)-k,V=M+k,H=this.top+v;else if(s==="left")M=T(this.right),F=this.right-v,B=M-k,G=T(t.left)+k,X=t.right;else if(s==="right")M=T(this.left),G=t.left,X=T(t.right)-k,F=M+k,B=this.left+v;else if(n==="x"){if(s==="center")M=T((t.top+t.bottom)/2+.5);else if(Sr(s)){const ne=Object.keys(s)[0],se=s[ne];M=T(this.chart.scales[ne].getPixelForValue(se))}ee=t.top,Z=t.bottom,V=M+k,H=V+v}else if(n==="y"){if(s==="center")M=T((t.left+t.right)/2);else if(Sr(s)){const ne=Object.keys(s)[0],se=s[ne];M=T(this.chart.scales[ne].getPixelForValue(se))}F=M-k,B=F-v,G=t.left,X=t.right}const Q=cr(i.ticks.maxTicksLimit,m),le=Math.max(1,Math.ceil(m/Q));for(O=0;O0&&(ke-=Ee/2);break}be={left:ke,top:Ce,width:Ee+xe.width,height:Te+xe.height,color:le.backdropColor}}k.push({label:N,font:H,textOffset:X,options:{rotation:P,color:se,strokeColor:oe,strokeWidth:he,textAlign:_e,textBaseline:Z,translation:[L,F],backdrop:be}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-cc(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,u=s.widest.width;let d,p;return n==="left"?i?(p=this.right+o,r==="near"?d="left":r==="center"?(d="center",p+=u/2):(d="right",p+=u)):(p=this.right-a,r==="near"?d="right":r==="center"?(d="center",p-=u/2):(d="left",p=this.left)):n==="right"?i?(p=this.left+o,r==="near"?d="right":r==="center"?(d="center",p-=u/2):(d="left",p-=u)):(p=this.left+a,r==="near"?d="left":r==="center"?(d="center",p+=u/2):(d="right",p=this.right)):d="right",{textAlign:d,x:p}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:o,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,o,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(u,d,p)=>{!p.width||!p.color||(r.save(),r.lineWidth=p.width,r.strokeStyle=p.color,r.setLineDash(p.borderDash||[]),r.lineDashOffset=p.borderDashOffset,r.beginPath(),r.moveTo(u.x,u.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(n.display)for(o=0,s=i.length;o{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let o,s;for(o=0,s=n.length;o{const r=n.split("."),i=r.pop(),o=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),u=s.join(".");_i.route(o,i,u,a)})}function yke(e){return"id"in e&&"defaults"in e}class xke{constructor(){this.controllers=new Tx($h,"datasets",!0),this.elements=new Tx(_l,"elements"),this.plugins=new Tx(Object,"plugins"),this.scales=new Tx(Ef,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const o=r||this._getRegistryForType(i);r||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):Ar(i,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const i=lk(t);Qr(r["before"+i],[],r),n[t](r),Qr(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;no.filter(a=>!s.some(u=>a.plugin.id===u.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function _ke(e){const t={},n=[],r=Object.keys(sl.plugins.items);for(let o=0;o1&&J6(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function eL(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Tke(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return eL(e,"x",n[0])||eL(e,"y",n[0])}return{}}function kke(e,t){const n=lf[e.type]||{scales:{}},r=t.scales||{},i=TE(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Sr(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const u=kE(s,a,Tke(s,e),_i.scales[a.type]),d=Pke(u,i),p=n.scales||{};o[s]=Og(Object.create(null),[{axis:u},a,p[u],p[d]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,u=s.indexAxis||TE(a,t),p=(lf[a]||{}).scales||{};Object.keys(p).forEach(m=>{const v=Eke(m,u),x=s[v+"AxisID"]||v;o[x]=o[x]||Object.create(null),Og(o[x],[{axis:v},r[x],p[m]])})}),Object.keys(o).forEach(s=>{const a=o[s];Og(a,[_i.scales[a.type],_i.scale])}),o}function sK(e){const t=e.options||(e.options={});t.plugins=cr(t.plugins,{}),t.scales=kke(e,t)}function lK(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Mke(e){return e=e||{},e.data=lK(e.data),sK(e),e}const tL=new Map,uK=new Set;function kx(e,t){let n=tL.get(e);return n||(n=t(),tL.set(e,n),uK.add(n)),n}const Qm=(e,t,n)=>{const r=cp(t,n);r!==void 0&&e.add(r)};class Rke{constructor(t){this._config=Mke(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=lK(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),sK(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kx(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return kx(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return kx(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return kx(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:o}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const u=new Set;n.forEach(p=>{t&&(u.add(t),p.forEach(m=>Qm(u,t,m))),p.forEach(m=>Qm(u,i,m)),p.forEach(m=>Qm(u,lf[o]||{},m)),p.forEach(m=>Qm(u,_i,m)),p.forEach(m=>Qm(u,PE,m))});const d=Array.from(u);return d.length===0&&d.push(Object.create(null)),uK.has(n)&&s.set(n,d),d}chartOptionScopes(){const{options:t,type:n}=this;return[t,lf[n]||{},_i.datasets[n]||{},{type:n},_i,PE]}resolveNamedOptions(t,n,r,i=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=nL(this._resolverCache,t,i);let u=s;if(Dke(s,n)){o.$shared=!1,r=Dc(r)?r():r;const d=this.createResolver(t,r,a);u=dp(s,r,d)}for(const d of n)o[d]=u[d];return o}createResolver(t,n,r=[""],i){const{resolver:o}=nL(this._resolverCache,t,r);return Sr(n)?dp(o,n,void 0,i):o}}function nL(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let o=r.get(i);return o||(o={resolver:gk(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,o)),o}const Ake=e=>Sr(e)&&Object.getOwnPropertyNames(e).some(t=>Dc(e[t]));function Dke(e,t){const{isScriptable:n,isIndexable:r}=KH(e);for(const i of t){const o=n(i),s=r(i),a=(s||o)&&e[i];if(o&&(Dc(a)||Ake(a))||s&&li(a))return!0}return!1}var Oke="4.5.0";const Nke=["top","bottom","left","right","chartArea"];function rL(e,t){return e==="top"||e==="bottom"||Nke.indexOf(e)===-1&&t==="x"}function iL(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function oL(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Qr(n&&n.onComplete,[e],t)}function Lke(e){const t=e.chart,n=t.options.animation;Qr(n&&n.onProgress,[e],t)}function cK(e){return xk()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const p1={},aL=e=>{const t=cK(e);return Object.values(p1).filter(n=>n.canvas===t).pop()};function Fke(e,t,n){const r=Object.keys(e);for(const i of r){const o=+i;if(o>=t){const s=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=s)}}}function zke(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}class ul{static register(...t){sl.add(...t),sL()}static unregister(...t){sl.remove(...t),sL()}constructor(t,n){const r=this.config=new Rke(n),i=cK(t),o=aL(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||nke(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,s.aspectRatio),u=a&&a.canvas,d=u&&u.height,p=u&&u.width;if(this.id=NPe(),this.ctx=a,this.canvas=u,this.width=p,this.height=d,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new bke,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=JPe(m=>this.update(m),s.resizeDelay||0),this._dataChanges=[],p1[this.id]=this,!a||!u){console.error("Failed to create chart: can't acquire context from the given item");return}ql.listen(this,"complete",oL),ql.listen(this,"progress",Lke),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:o}=this;return wr(t)?n&&o?o:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return sl}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():k6(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return P6(this.canvas,this.ctx),this}stop(){return ql.stop(this),this}resize(t,n){ql.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,n,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),u=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,k6(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Qr(r.onResize,[this,s],this),this.attached&&this._doResize(u)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ar(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];n&&(o=o.concat(Object.keys(n).map(s=>{const a=n[s],u=kE(s,a),d=u==="r",p=u==="x";return{options:a,dposition:d?"chartArea":p?"bottom":"left",dtype:d?"radialLinear":p?"category":"linear"}}))),Ar(o,s=>{const a=s.options,u=a.id,d=kE(u,a),p=cr(a.type,s.dtype);(a.position===void 0||rL(a.position,d)!==rL(s.dposition))&&(a.position=s.dposition),i[u]=!0;let m=null;if(u in r&&r[u].type===p)m=r[u];else{const v=sl.getScale(p);m=new v({id:u,type:p,ctx:this.ctx,chart:this}),r[m.id]=m}m.init(a,t)}),Ar(i,(s,a)=>{s||delete r[a]}),Ar(r,s=>{ls.configure(this,s,s.options),ls.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,o)=>i.index-o.index),r>n){for(let i=n;in.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let d=0,p=this.data.datasets.length;d{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(iL("z","_idx"));const{_active:a,_lastEvent:u}=this;u?this._eventHandler(u,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ar(this.scales,t=>{ls.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!v6(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:o}of n){const s=r==="_removeElements"?-o:o;Fke(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),i=r(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ls.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ar(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=oTe(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&pk(n,i),t.controller.draw(),i&&mk(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return au(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const o=NTe.modes[n];return typeof o=="function"?o(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=Vc(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,i);Ev(n)?(o.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ql.remove(this),t=0,n=this.data.datasets.length;t{n.addEventListener(this,o,s),t[o]=s},i=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};Ar(this.options.events,o=>r(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(u,d)=>{n.addEventListener(this,u,d),t[u]=d},i=(u,d)=>{t[u]&&(n.removeEventListener(this,u,d),delete t[u])},o=(u,d)=>{this.canvas&&this.resize(u,d)};let s;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Ar(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ar(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let o,s,a,u;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,u=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Ob(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,o=(u,d)=>u.filter(p=>!d.some(m=>p.datasetIndex===m.datasetIndex&&p.index===m.index)),s=o(n,t),a=r?t:o(t,n);s.length&&this.updateHoverStyle(s,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const o=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(o||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:o}=this,s=n,a=this._getActiveElements(t,i,r,s),u=VPe(t),d=zke(t,this._lastEvent,r,u);r&&(this._lastEvent=null,Qr(o.onHover,[t,a,this],this),u&&Qr(o.onClick,[t,a,this],this));const p=!Ob(a,i);return(p||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=d,p}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}Bn(ul,"defaults",_i),Bn(ul,"instances",p1),Bn(ul,"overrides",lf),Bn(ul,"registry",sl),Bn(ul,"version",Oke),Bn(ul,"getChart",aL);function sL(){return Ar(ul.instances,e=>e._plugins.invalidate())}function dK(e,t,n=t){e.lineCap=cr(n.borderCapStyle,t.borderCapStyle),e.setLineDash(cr(n.borderDash,t.borderDash)),e.lineDashOffset=cr(n.borderDashOffset,t.borderDashOffset),e.lineJoin=cr(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=cr(n.borderWidth,t.borderWidth),e.strokeStyle=cr(n.borderColor,t.borderColor)}function $ke(e,t,n){e.lineTo(n.x,n.y)}function Bke(e){return e.stepped?hIe:e.tension||e.cubicInterpolationMode==="monotone"?pIe:$ke}function fK(e,t,n={}){const r=e.length,{start:i=0,end:o=r-1}=n,{start:s,end:a}=t,u=Math.max(i,s),d=Math.min(o,a),p=ia&&o>a;return{count:r,start:u,loop:t.loop,ilen:d(s+(d?a-N:N))%o,O=()=>{P!==k&&(e.lineTo(p,k),e.lineTo(p,P),e.lineTo(p,T))};for(u&&(x=i[M(0)],e.moveTo(x.x,x.y)),v=0;v<=a;++v){if(x=i[M(v)],x.skip)continue;const N=x.x,L=x.y,F=N|0;F===_?(Lk&&(k=L),p=(m*p+N)/++m):(O(),e.lineTo(N,L),_=F,m=0,P=k=L),T=L}O()}function ME(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Uke:Vke}function jke(e){return e.stepped?WIe:e.tension||e.cubicInterpolationMode==="monotone"?GIe:Td}function Hke(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),dK(e,t.options),e.stroke(i)}function Kke(e,t,n,r){const{segments:i,options:o}=t,s=ME(t);for(const a of i)dK(e,o,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Wke=typeof Path2D=="function";function Gke(e,t,n,r){Wke&&!t.options.segment?Hke(e,t,n,r):Kke(e,t,n,r)}class dg extends _l{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;zIe(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=tTe(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],o=this.points,s=QIe(this,{property:n,start:i,end:i});if(!s.length)return;const a=[],u=jke(r);let d,p;for(d=0,p=s.length;dt!=="borderDash"&&t!=="fill"});function lL(e,t,n,r){const i=e.options,{[n]:o}=e.getProps([n],r);return Math.abs(t-o){let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Jke=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class cL extends _l{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Qr(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=Gi(r.font),o=i.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:u}=uL(r,o);let d,p;n.font=i.string,this.isHorizontal()?(d=this.maxWidth,p=this._fitRows(s,o,a,u)+10):(p=this.maxHeight,d=this._fitCols(s,i,a,u)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(p,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,u=this.legendHitBoxes=[],d=this.lineWidths=[0],p=i+a;let m=t;o.textAlign="left",o.textBaseline="middle";let v=-1,x=-p;return this.legendItems.forEach((_,P)=>{const k=r+n/2+o.measureText(_.text).width;(P===0||d[d.length-1]+k+2*a>s)&&(m+=p,d[d.length-(P>0?0:1)]=0,x+=p,v++),u[P]={left:0,top:x,row:v,width:k,height:i},d[d.length-1]+=k+a}),m}_fitCols(t,n,r,i){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,u=this.legendHitBoxes=[],d=this.columnSizes=[],p=s-t;let m=a,v=0,x=0,_=0,P=0;return this.legendItems.forEach((k,T)=>{const{itemWidth:M,itemHeight:O}=eMe(r,n,o,k,i);T>0&&x+O+2*a>p&&(m+=v+a,d.push({width:v,height:x}),_+=v+a,P++,v=x=0),u[T]={left:_,top:x,col:P,width:M,height:O},v=Math.max(v,M),x+=O+a}),m+=v,d.push({width:v,height:x}),m}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:o}}=this,s=zh(o,this.left,this.width);if(this.isHorizontal()){let a=0,u=Po(r,this.left+i,this.right-this.lineWidths[a]);for(const d of n)a!==d.row&&(a=d.row,u=Po(r,this.left+i,this.right-this.lineWidths[a])),d.top+=this.top+t+i,d.left=s.leftForLtr(s.x(u),d.width),u+=d.width+i}else{let a=0,u=Po(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const d of n)d.col!==a&&(a=d.col,u=Po(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),d.top=u,d.left+=this.left+i,d.left=s.leftForLtr(s.x(d.left),d.width),u+=d.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;pk(t,this),this._draw(),mk(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:o,labels:s}=t,a=_i.color,u=zh(t.rtl,this.left,this.width),d=Gi(s.font),{padding:p}=s,m=d.size,v=m/2;let x;this.drawTitle(),i.textAlign=u.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=d.string;const{boxWidth:_,boxHeight:P,itemHeight:k}=uL(s,m),T=function(F,V,B){if(isNaN(_)||_<=0||isNaN(P)||P<0)return;i.save();const H=cr(B.lineWidth,1);if(i.fillStyle=cr(B.fillStyle,a),i.lineCap=cr(B.lineCap,"butt"),i.lineDashOffset=cr(B.lineDashOffset,0),i.lineJoin=cr(B.lineJoin,"miter"),i.lineWidth=H,i.strokeStyle=cr(B.strokeStyle,a),i.setLineDash(cr(B.lineDash,[])),s.usePointStyle){const G={radius:P*Math.SQRT2/2,pointStyle:B.pointStyle,rotation:B.rotation,borderWidth:H},ee=u.xPlus(F,_/2),X=V+v;UH(i,G,ee,X,s.pointStyleWidth&&_)}else{const G=V+Math.max((m-P)/2,0),ee=u.leftForLtr(F,_),X=qd(B.borderRadius);i.beginPath(),Object.values(X).some(Z=>Z!==0)?Iv(i,{x:ee,y:G,w:_,h:P,radius:X}):i.rect(ee,G,_,P),i.fill(),H!==0&&i.stroke()}i.restore()},M=function(F,V,B){uf(i,B.text,F,V+k/2,d,{strikethrough:B.hidden,textAlign:u.textAlign(B.textAlign)})},O=this.isHorizontal(),N=this._computeTitleHeight();O?x={x:Po(o,this.left+p,this.right-r[0]),y:this.top+p+N,line:0}:x={x:this.left+p,y:Po(o,this.top+N+p,this.bottom-n[0].height),line:0},XH(this.ctx,t.textDirection);const L=k+p;this.legendItems.forEach((F,V)=>{i.strokeStyle=F.fontColor,i.fillStyle=F.fontColor;const B=i.measureText(F.text).width,H=u.textAlign(F.textAlign||(F.textAlign=s.textAlign)),G=_+v+B;let ee=x.x,X=x.y;u.setWidth(this.width),O?V>0&&ee+G+p>this.right&&(X=x.y+=L,x.line++,ee=x.x=Po(o,this.left+p,this.right-r[x.line])):V>0&&X+L>this.bottom&&(ee=x.x=ee+n[x.line].width+p,x.line++,X=x.y=Po(o,this.top+N+p,this.bottom-n[x.line].height));const Z=u.x(ee);if(T(Z,X,F),ee=eIe(H,ee+_+v,O?ee+G:this.right,t.rtl),M(u.x(ee),X,F),O)x.x+=G+p;else if(typeof F.text!="string"){const Q=d.lineHeight;x.y+=pK(F,Q)+p}else x.y+=L}),YH(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Gi(n.font),i=Ao(n.padding);if(!n.display)return;const o=zh(t.rtl,this.left,this.width),s=this.ctx,a=n.position,u=r.size/2,d=i.top+u;let p,m=this.left,v=this.width;if(this.isHorizontal())v=Math.max(...this.lineWidths),p=this.top+d,m=Po(t.align,m,this.right-v);else{const _=this.columnSizes.reduce((P,k)=>Math.max(P,k.height),0);p=d+Po(t.align,this.top,this.bottom-_-t.labels.padding-this._computeTitleHeight())}const x=Po(a,m,m+v);s.textAlign=o.textAlign(dk(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,uf(s,n.text,x,p,r)}_computeTitleHeight(){const t=this.options.title,n=Gi(t.font),r=Ao(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,o;if(Bd(t,this.left,this.right)&&Bd(n,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;ro.length>s.length?o:s)),t+n.size/2+r.measureText(i).width}function nMe(e,t,n){let r=e;return typeof t.text!="string"&&(r=pK(t,n)),r}function pK(e,t){const n=e.text?e.text.length:0;return t*n}function rMe(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var iMe={id:"legend",_element:cL,start(e,t,n){const r=e.legend=new cL({ctx:e.ctx,options:n,chart:e});ls.configure(e,r,n),ls.addBox(e,r)},stop(e){ls.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;ls.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(u=>{const d=u.controller.getStyle(n?0:void 0),p=Ao(d.borderWidth);return{text:t[u.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!u.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(p.width+p.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:i||d.textAlign,borderRadius:s&&(a||d.borderRadius),datasetIndex:u.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class mK extends _l{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=li(r.text)?r.text.length:1;this._padding=Ao(r.padding);const o=i*Gi(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:o,options:s}=this,a=s.align;let u=0,d,p,m;return this.isHorizontal()?(p=Po(a,r,o),m=n+t,d=o-r):(s.position==="left"?(p=r+t,m=Po(a,i,n),u=Bi*-.5):(p=o-t,m=Po(a,n,i),u=Bi*.5),d=i-n),{titleX:p,titleY:m,maxWidth:d,rotation:u}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Gi(n.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:u,rotation:d}=this._drawArgs(o);uf(t,n.text,0,0,r,{color:n.color,maxWidth:u,rotation:d,textAlign:dk(n.align),textBaseline:"middle",translation:[s,a]})}}function oMe(e,t){const n=new mK({ctx:e.ctx,options:t,chart:e});ls.configure(e,n,t),ls.addBox(e,n),e.titleBlock=n}var aMe={id:"title",_element:mK,start(e,t,n){oMe(e,n)},stop(e){const t=e.titleBlock;ls.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;ls.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const fg={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,o=0;for(t=0,n=e.length;ta+u)/r.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o-1?e.split(` `):e}function sMe(e,t){const{element:n,datasetIndex:r,index:i}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(i);return{chart:e,label:s,parsed:o.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function dL(e,t){const n=e.chart.ctx,{body:r,footer:i,title:o}=e,{boxWidth:s,boxHeight:a}=t,u=Gi(t.bodyFont),d=Gi(t.titleFont),p=Gi(t.footerFont),m=o.length,v=i.length,x=r.length,_=Ao(t.padding);let P=_.height,k=0,T=r.reduce((N,L)=>N+L.before.length+L.lines.length+L.after.length,0);if(T+=e.beforeBody.length+e.afterBody.length,m&&(P+=m*d.lineHeight+(m-1)*t.titleSpacing+t.titleMarginBottom),T){const N=t.displayColors?Math.max(a,u.lineHeight):u.lineHeight;P+=x*N+(T-x)*u.lineHeight+(T-1)*t.bodySpacing}v&&(P+=t.footerMarginTop+v*p.lineHeight+(v-1)*t.footerSpacing);let M=0;const O=function(N){k=Math.max(k,n.measureText(N).width+M)};return n.save(),n.font=d.string,Ar(e.title,O),n.font=u.string,Ar(e.beforeBody.concat(e.afterBody),O),M=t.displayColors?s+2+t.boxPadding:0,Ar(r,N=>{Ar(N.before,O),Ar(N.lines,O),Ar(N.after,O)}),M=0,n.font=p.string,Ar(e.footer,O),n.restore(),k+=_.width,{width:k,height:P}}function lMe(e,t){const{y:n,height:r}=t;return ne.height-r/2?"bottom":"center"}function uMe(e,t,n,r){const{x:i,width:o}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&i+o+s>t.width||e==="right"&&i-o-s<0)return!0}function cMe(e,t,n,r){const{x:i,width:o}=n,{width:s,chartArea:{left:a,right:u}}=e;let d="center";return r==="center"?d=i<=(a+u)/2?"left":"right":i<=o/2?d="left":i>=s-o/2&&(d="right"),uMe(d,e,t,n)&&(d="center"),d}function fL(e,t,n){const r=n.yAlign||t.yAlign||lMe(e,n);return{xAlign:n.xAlign||t.xAlign||cMe(e,t,n,r),yAlign:r}}function dMe(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function fMe(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function hL(e,t,n,r){const{caretSize:i,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:u}=n,d=i+o,{topLeft:p,topRight:m,bottomLeft:v,bottomRight:x}=qd(s);let _=dMe(t,a);const P=fMe(t,u,d);return u==="center"?a==="left"?_+=d:a==="right"&&(_-=d):a==="left"?_-=Math.max(p,v)+i:a==="right"&&(_+=Math.max(m,x)+i),{x:Da(_,0,r.width-t.width),y:Da(P,0,r.height-t.height)}}function Mx(e,t,n){const r=Ao(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function pL(e){return ol([],Zl(e))}function hMe(e,t,n){return Vc(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function mL(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const gK={beforeTitle:Wl,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex"u"?gK[t].call(n,r):i}class RE extends _l{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,o=new JH(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=hMe(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=oa(r,"beforeTitle",this,t),o=oa(r,"title",this,t),s=oa(r,"afterTitle",this,t);let a=[];return a=ol(a,Zl(i)),a=ol(a,Zl(o)),a=ol(a,Zl(s)),a}getBeforeBody(t,n){return pL(oa(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return Ar(t,o=>{const s={before:[],lines:[],after:[]},a=mL(r,o);ol(s.before,Zl(oa(a,"beforeLabel",this,o))),ol(s.lines,oa(a,"label",this,o)),ol(s.after,Zl(oa(a,"afterLabel",this,o))),i.push(s)}),i}getAfterBody(t,n){return pL(oa(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=oa(r,"beforeFooter",this,t),o=oa(r,"footer",this,t),s=oa(r,"afterFooter",this,t);let a=[];return a=ol(a,Zl(i)),a=ol(a,Zl(o)),a=ol(a,Zl(s)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],o=[],s=[];let a=[],u,d;for(u=0,d=n.length;ut.filter(p,m,v,r))),t.itemSort&&(a=a.sort((p,m)=>t.itemSort(p,m,r))),Ar(a,p=>{const m=mL(t.callbacks,p);i.push(oa(m,"labelColor",this,p)),o.push(oa(m,"labelPointStyle",this,p)),s.push(oa(m,"labelTextColor",this,p))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let o,s=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=fg[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const u=this._size=dL(this,r),d=Object.assign({},a,u),p=fL(this.chart,r,d),m=hL(r,d,p,this.chart);this.xAlign=p.xAlign,this.yAlign=p.yAlign,o={opacity:1,x:m.x,y:m.y,width:u.width,height:u.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const o=this.getCaretPosition(t,r,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:u,topRight:d,bottomLeft:p,bottomRight:m}=qd(a),{x:v,y:x}=t,{width:_,height:P}=n;let k,T,M,O,N,L;return o==="center"?(N=x+P/2,i==="left"?(k=v,T=k-s,O=N+s,L=N-s):(k=v+_,T=k+s,O=N-s,L=N+s),M=k):(i==="left"?T=v+Math.max(u,p)+s:i==="right"?T=v+_-Math.max(d,m)-s:T=this.caretX,o==="top"?(O=x,N=O-s,k=T-s,M=T+s):(O=x+P,N=O+s,k=T+s,M=T-s),L=O),{x1:k,x2:T,x3:M,y1:O,y2:N,y3:L}}drawTitle(t,n,r){const i=this.title,o=i.length;let s,a,u;if(o){const d=zh(r.rtl,this.x,this.width);for(t.x=Mx(this,r.titleAlign,r),n.textAlign=d.textAlign(r.titleAlign),n.textBaseline="middle",s=Gi(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,u=0;uM!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Iv(t,{x:P,y:_,w:d,h:u,radius:T}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Iv(t,{x:k,y:_+1,w:d-2,h:u-2,radius:T}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(P,_,d,u),t.strokeRect(P,_,d,u),t.fillStyle=s.backgroundColor,t.fillRect(k,_+1,d-2,u-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:u,boxWidth:d,boxPadding:p}=r,m=Gi(r.bodyFont);let v=m.lineHeight,x=0;const _=zh(r.rtl,this.x,this.width),P=function(B){n.fillText(B,_.x(t.x+x),t.y+v/2),t.y+=v+o},k=_.textAlign(s);let T,M,O,N,L,F,V;for(n.textAlign=s,n.textBaseline="middle",n.font=m.string,t.x=Mx(this,k,r),n.fillStyle=r.bodyColor,Ar(this.beforeBody,P),x=a&&k!=="right"?s==="center"?d/2+p:d+2+p:0,N=0,F=i.length;N0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,o=r&&r.y;if(i||o){const s=fg[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=dL(this,t),u=Object.assign({},s,this._size),d=fL(n,t,u),p=hL(t,u,d,n);(i._to!==p.x||o._to!==p.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,p))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Ao(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,i,n),XH(t,n.textDirection),o.y+=s.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),YH(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:u})=>{const d=this.chart.getDatasetMeta(a);if(!d)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:d.data[u],index:u}}),o=!Ob(r,i),s=this._positionChanged(i,n);(o||s)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],s=this._getActiveElements(t,o,n,r),a=this._positionChanged(s,t),u=n||!Ob(s,o)||a;return u&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),u}_getActiveElements(t,n,r,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:i,options:o}=this,s=fg[o.position].call(this,t,n);return s!==!1&&(r!==s.x||i!==s.y)}}Bn(RE,"positioners",fg);var pMe={id:"tooltip",_element:RE,positioners:fg,afterInit(e,t,n){n&&(e.tooltip=new RE({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:gK},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const mMe=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function gMe(e,t,n,r){const i=e.indexOf(t);if(i===-1)return mMe(e,t,n,r);const o=e.lastIndexOf(t);return i!==o?n:i}const vMe=(e,t)=>e===null?null:Da(Math.round(e),0,t);function gL(e){const t=this.getLabels();return e>=0&&en.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Bn(AE,"id","category"),Bn(AE,"defaults",{ticks:{callback:gL}});function yMe(e,t){const n=[],{bounds:i,step:o,min:s,max:a,precision:u,count:d,maxTicks:p,maxDigits:m,includeBounds:v}=e,x=o||1,_=p-1,{min:P,max:k}=t,T=!wr(s),M=!wr(a),O=!wr(d),N=(k-P)/(m+1);let L=x6((k-P)/_/x)*x,F,V,B,H;if(L<1e-14&&!T&&!M)return[{value:P},{value:k}];H=Math.ceil(k/L)-Math.floor(P/L),H>_&&(L=x6(H*L/_/x)*x),wr(u)||(F=Math.pow(10,u),L=Math.ceil(L*F)/F),i==="ticks"?(V=Math.floor(P/L)*L,B=Math.ceil(k/L)*L):(V=P,B=k),T&&M&&o&&WPe((a-s)/o,L/1e3)?(H=Math.round(Math.min((a-s)/L,p)),L=(a-s)/H,V=s,B=a):O?(V=T?s:V,B=M?a:B,H=d-1,L=(B-V)/H):(H=(B-V)/L,Ng(H,Math.round(H),L/1e3)?H=Math.round(H):H=Math.ceil(H));const G=Math.max(b6(L),b6(V));F=Math.pow(10,wr(u)?G:u),V=Math.round(V*F)/F,B=Math.round(B*F)/F;let ee=0;for(T&&(v&&V!==s?(n.push({value:s}),Va)break;n.push({value:X})}return M&&v&&B!==a?n.length&&Ng(n[n.length-1].value,a,vL(a,N,e))?n[n.length-1].value=a:n.push({value:a}):(!M||B===a)&&n.push({value:B}),n}function vL(e,t,{horizontal:n,minRotation:r}){const i=cc(r),o=(n?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class Bb extends Ef{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return wr(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:o}=this;const s=u=>i=n?i:u,a=u=>o=r?o:u;if(t){const u=bl(i),d=bl(o);u<0&&d<0?a(0):u>0&&d>0&&s(0)}if(i===o){let u=o===0?1:Math.abs(o*.05);a(o+u),t||s(i-u)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,s=yMe(i,o);return t.bounds==="ticks"&&NH(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return hk(t,this.chart.options.locale,this.options.ticks.format)}}class DE extends Bb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ro(t)?t:0,this.max=ro(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=cc(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Bn(DE,"id","linear"),Bn(DE,"defaults",{ticks:{callback:Sw.formatters.numeric}});const kv=e=>Math.floor(uc(e)),xd=(e,t)=>Math.pow(10,kv(e)+t);function yL(e){return e/Math.pow(10,kv(e))===1}function xL(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function xMe(e,t){const n=t-e;let r=kv(n);for(;xL(e,t,r)>10;)r++;for(;xL(e,t,r)<10;)r--;return Math.min(r,kv(e))}function bMe(e,{min:t,max:n}){t=Ia(e.min,t);const r=[],i=kv(t);let o=xMe(t,n),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),u=i>o?Math.pow(10,i):0,d=Math.round((t-u)*s)/s,p=Math.floor((t-u)/a/10)*a*10;let m=Math.floor((d-p)/Math.pow(10,o)),v=Ia(e.min,Math.round((u+p+m*Math.pow(10,o))*s)/s);for(;v=10?m=m<15?15:20:m++,m>=20&&(o++,m=2,s=o>=0?1:s),v=Math.round((u+p+m*Math.pow(10,o))*s)/s;const x=Ia(e.max,v);return r.push({value:x,major:yL(x),significand:m}),r}class bL extends Ef{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Bb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return ro(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=ro(t)?Math.max(0,t):null,this.max=ro(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ro(this._userMin)&&(this.min=t===xd(this.min,0)?xd(this.min,-1):xd(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const o=a=>r=t?r:a,s=a=>i=n?i:a;r===i&&(r<=0?(o(1),s(10)):(o(xd(r,-1)),s(xd(i,1)))),r<=0&&o(xd(i,-1)),i<=0&&s(xd(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=bMe(n,this);return t.bounds==="ticks"&&NH(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":hk(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=uc(t),this._valueRange=uc(this.max)-uc(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(uc(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Bn(bL,"id","logarithmic"),Bn(bL,"defaults",{ticks:{callback:Sw.formatters.logarithmic,major:{enabled:!0}}});function OE(e){const t=e.ticks;if(t.display&&e.display){const n=Ao(t.backdropPadding);return cr(t.font&&t.font.size,_i.font.size)+n.height}return 0}function _Me(e,t,n){return n=li(n)?n:[n],{w:fIe(e,t.string,n),h:n.length*t.lineHeight}}function _L(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function wMe(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Bi/o:0;for(let u=0;ut.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.startt.b&&(u=(i.end-t.b)/s,e.b=Math.max(e.b,t.b+u))}function SMe(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:o,padding:s,size:a}=n,u=e.getPointPosition(t,r+i+s,o),d=Math.round(uk(Ns(u.angle+Aa))),p=kMe(u.y,a.h,d),m=IMe(d),v=TMe(u.x,a.w,m);return{visible:!0,x:u.x,y:p,textAlign:m,left:v,top:p,right:v+a.w,bottom:p+a.h}}function EMe(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:o}=e;return!(au({x:n,y:r},t)||au({x:n,y:o},t)||au({x:i,y:r},t)||au({x:i,y:o},t))}function PMe(e,t,n){const r=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,u={extra:OE(o)/2,additionalAngle:s?Bi/i:0};let d;for(let p=0;p270||n<90)&&(e-=t),e}function MMe(e,t,n){const{left:r,top:i,right:o,bottom:s}=n,{backdropColor:a}=t;if(!wr(a)){const u=qd(t.borderRadius),d=Ao(t.backdropPadding);e.fillStyle=a;const p=r-d.left,m=i-d.top,v=o-r+d.width,x=s-i+d.height;Object.values(u).some(_=>_!==0)?(e.beginPath(),Iv(e,{x:p,y:m,w:v,h:x,radius:u}),e.fill()):e.fillRect(p,m,v,x)}}function RMe(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(i));MMe(n,s,o);const a=Gi(s.font),{x:u,y:d,textAlign:p}=o;uf(n,e._pointLabels[i],u,d+a.lineHeight/2,a,{color:s.color,textAlign:p,textBaseline:"middle"})}}function vK(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,ds);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let s=1;s{const i=Qr(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?wMe(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=ds/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ns(t*n+cc(r))}getDistanceFromCenterForValue(t){if(wr(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(wr(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t{if(m!==0||m===0&&this.min<0){u=this.getDistanceFromCenterForValue(p.value);const v=this.getContext(m),x=i.setContext(v),_=o.setContext(v);AMe(this,x,u,s,_)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const p=r.setContext(this.getPointLabelContext(a)),{color:m,lineWidth:v}=p;!v||!m||(t.lineWidth=v,t.strokeStyle=m,t.setLineDash(p.borderDash),t.lineDashOffset=p.borderDashOffset,u=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),d=this.getPointPosition(a,u),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,u)=>{if(u===0&&this.min>=0&&!n.reverse)return;const d=r.setContext(this.getContext(u)),p=Gi(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[u].value),d.showLabelBackdrop){t.font=p.string,s=t.measureText(a.label).width,t.fillStyle=d.backdropColor;const m=Ao(d.backdropPadding);t.fillRect(-s/2-m.left,-o-p.size/2-m.top,s+m.width,p.size+m.height)}uf(t,a.label,0,-o,p,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}Bn(Rx,"id","radialLinear"),Bn(Rx,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Sw.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Bn(Rx,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Bn(Rx,"descriptors",{angleLines:{_fallback:"grid"}});const Pw={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ua=Object.keys(Pw);function wL(e,t){return e-t}function CL(e,t){if(wr(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),ro(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(i&&(s=i==="week"&&(Pv(o)||o===!0)?n.startOf(s,"isoWeek",o):n.startOf(s,i)),+s)}function SL(e,t,n,r){const i=ua.length;for(let o=ua.indexOf(e);o=ua.indexOf(n);o--){const s=ua[o];if(Pw[s].common&&e._adapter.diff(i,r,s)>=t-1)return s}return ua[n?ua.indexOf(n):0]}function NMe(e){for(let t=ua.indexOf(e)+1,n=ua.length;t=t?n[r]:n[i];e[o]=!0}}function LMe(e,t,n,r){const i=e._adapter,o=+i.startOf(t[0].value,r),s=t[t.length-1].value;let a,u;for(a=o;a<=s;a=+i.add(a,1,r))u=n[a],u>=0&&(t[u].major=!0);return t}function PL(e,t,n){const r=[],i={},o=t.length;let s,a;for(s=0;s+t.value))}initOffsets(t=[]){let n=0,r=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=Da(n,0,s),r=Da(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,o=i.time,s=o.unit||SL(o.minUnit,n,r,this._getLabelCapacity(n)),a=cr(i.ticks.stepSize,1),u=s==="week"?o.isoWeekday:!1,d=Pv(u)||u===!0,p={};let m=n,v,x;if(d&&(m=+t.startOf(m,"isoWeek",u)),m=+t.startOf(m,d?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const _=i.ticks.source==="data"&&this.getDataTimestamps();for(v=m,x=0;v+P)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,s=n||i[o];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,i){const o=this.options,s=o.ticks.callback;if(s)return Qr(s,[t,n,r],this);const a=o.time.displayFormats,u=this._unit,d=this._majorUnit,p=u&&a[u],m=d&&a[d],v=r[n],x=d&&m&&v&&v.major;return this._adapter.format(t,i||(x?m:p))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=Vd(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:u}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=Vd(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:u}=e[i]);const d=s-o;return d?a+(u-a)*(t-o)/d:a}class IL extends Vb{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Ax(n,this.min),this._tableRange=Ax(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],o=[];let s,a,u,d,p;for(s=0,a=t.length;s=n&&d<=r&&i.push(d);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=i.length;si-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Ax(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Ax(this._table,r*this._tableRange+this._minPos,!0)}}Bn(IL,"id","timeseries"),Bn(IL,"defaults",Vb.defaults);const yK="label";function TL(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function FMe(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function xK(e,t){e.labels=t}function bK(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yK;const r=[];e.datasets=t.map(i=>{const o=e.datasets.find(s=>s[n]===i[n]);return!o||!i.data||r.includes(o)?{...i}:(r.push(o),Object.assign(o,i),o)})}function zMe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yK;const n={labels:[],datasets:[]};return xK(n,e.labels),bK(n,e.datasets,t),n}function $Me(e,t){const{height:n=150,width:r=300,redraw:i=!1,datasetIdKey:o,type:s,data:a,options:u,plugins:d=[],fallbackContent:p,updateMode:m,...v}=e,x=w.exports.useRef(null),_=w.exports.useRef(null),P=()=>{!x.current||(_.current=new ul(x.current,{type:s,data:zMe(a,o),options:u&&{...u},plugins:d}),TL(t,_.current))},k=()=>{TL(t,null),_.current&&(_.current.destroy(),_.current=null)};return w.exports.useEffect(()=>{!i&&_.current&&u&&FMe(_.current,u)},[i,u]),w.exports.useEffect(()=>{!i&&_.current&&xK(_.current.config.data,a.labels)},[i,a.labels]),w.exports.useEffect(()=>{!i&&_.current&&a.datasets&&bK(_.current.config.data,a.datasets,o)},[i,a.datasets]),w.exports.useEffect(()=>{!_.current||(i?(k(),setTimeout(P)):_.current.update(m))},[i,u,a.labels,a.datasets,m]),w.exports.useEffect(()=>{!_.current||(k(),setTimeout(P))},[s]),w.exports.useEffect(()=>(P(),()=>k()),[]),I("canvas",{ref:x,role:"img",height:n,width:r,...v,children:p})}const BMe=w.exports.forwardRef($Me);function VMe(e,t){return ul.register(t),w.exports.forwardRef((n,r)=>I(BMe,{...n,ref:r,type:e}))}const UMe=VMe("line",f1);ul.register(AE,d1,m1,dg,DE,g1,aMe,pMe,iMe);const Dx={target_dist_shap:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u0431\u043B\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",target_post_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0447\u0435\u043A \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442*",target_cnt_ao_mean_shap:"\u0421\u0440\u0435\u0434\u043D\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043A \u0432 \u0442\u043E\u0447\u043A\u0430\u0445 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442 \u0432 \u0410\u041E",rival_pvz_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u041F\u0412\u0417*",rival_post_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u043A\u043E\u043D\u043A\u0443\u0440\u0435\u043D\u0442\u043E\u0432 *",metro_dist_shap:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043C\u0435\u0442\u0440\u043E",property_price_bargains_shap:"\u0426\u0435\u043D\u0430 \u0441\u0434\u0435\u043B\u043E\u043A \u0436\u0438\u043B\u043E\u0439 \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438*",property_price_offers_shap:"\u0426\u0435\u043D\u0430 \u043F\u0440\u0435\u0434\u043B\u043E\u0436\u0435\u043D\u0438\u0439 \u0436\u0438\u043B\u043E\u0439 \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438*",property_mean_floor_shap:"\u0421\u0440\u0435\u0434\u043D\u044F\u044F \u044D\u0442\u0430\u0436\u043D\u043E\u0441\u0442\u044C \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438*",property_era_shap:"\u042D\u043F\u043E\u0445\u0430 \u0436\u0438\u043B\u043E\u0439 \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438*",flats_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440*",popul_home_shap:"\u0427\u0438\u0441\u043B\u0435\u043D\u043D\u043E\u0441\u0442\u044C \u043F\u0440\u043E\u0436\u0438\u0432\u0430\u044E\u0449\u0435\u0433\u043E \u043D\u0430\u0441\u0435\u043B\u0435\u043D\u0438\u044F*",popul_job_shap:"\u0427\u0438\u0441\u043B\u0435\u043D\u043D\u043E\u0441\u0442\u044C \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0435\u0433\u043E \u043D\u0430\u0441\u0435\u043B\u0435\u043D\u0438\u044F*",yndxfood_sum_shap:"\u0421\u0443\u043C\u043C\u0430 \u0437\u0430\u043A\u0430\u0437\u043E\u0432 \u042F\u043D\u0434\u0435\u043A\u0441.\u0415\u0434\u0430*",yndxfood_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0437\u0430\u043A\u0430\u0437\u043E\u0432 \u042F\u043D\u0434\u0435\u043A\u0441.\u0415\u0434\u0430*",school_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0448\u043A\u043E\u043B*",kindergar_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0434\u0435\u0442\u0441\u0430\u0434\u043E\u0432*",public_stop_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043E\u043A \u043E\u0431\u0449. \u0442\u0440\u0430\u043D\u0441\u043F\u043E\u0440\u0442\u0430*",sport_center_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0441\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432*",pharmacy_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0430\u043F\u0442\u0435\u043A*",supermarket_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432*",supermarket_premium_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043F\u0440\u0435\u043C\u0438\u0430\u043B\u044C\u043D\u044B\u0445 \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432*",clinic_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u043B\u0438\u043A\u043B\u0438\u043D\u0438\u043A*",bank_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0431\u0430\u043D\u043A\u043E\u0432*",reca_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0447\u0435\u043A \u043E\u0431\u0449\u0435\u043F\u0438\u0442\u0430*",lab_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043B\u0430\u0431\u043E\u0440\u0430\u0442\u043E\u0440\u0438\u0439*",culture_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B*",attraction_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0434\u043E\u0441\u0442\u043E\u043F\u0440\u0438\u043C\u0435\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439*",mfc_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u041C\u0424\u0426*",bc_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0431\u0438\u0437\u043D\u0435\u0441-\u0446\u0435\u043D\u0442\u0440\u043E\u0432*",tc_cnt_shap:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432*",business_activity_shap:"\u0411\u0438\u0437\u043D\u0435\u0441 \u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C"},jMe=({point:e})=>{const{data:t}=Vi(["mean-data"],async()=>{const{data:o}=await Mi.get("https://postamates.spatialsystems.ru/api/avg_bi_values/");return o},{refetchOnWindowFocus:!1,refetchOnMount:!1}),n={indexAxis:"y",elements:{bar:{borderWidth:0,borderRadius:5,pointStyle:"circle"}},plugins:{legend:{display:!1},tooltip:{displayColors:!1,yAlign:"top",callbacks:{label:function(o){const s=[],a=Object.keys(Dx).find(d=>Dx[d]===o.label),u=a.substring(0,a.length-5);if(o.datasetIndex===0&&s.push("\u0417\u043D\u0430\u0447\u0435\u043D\u0438\u0435: "+e[u]),o.parsed.x!==null){let d="";o.datasetIndex===0&&(d="\u0412\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %: "),o.datasetIndex===1&&(d="\u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0432\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %: "),o.datasetIndex===2&&(d="\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u0439 \u0432\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %: "),s.push(d+o.parsed.x)}return s},body:()=>"\u0412\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %:"}}},scales:{y:{stacked:!0},x:{title:{display:!0,text:"\u0412\u043A\u043B\u0430\u0434 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437, %"},grid:{color:function(o){return o.tick.value===0?"#000000":"#E5E5E5"}}}}},r=Object.keys(Dx).sort((o,s)=>Math.abs(e[o])Dx[o]),datasets:[{data:r.map(o=>e[o]),backgroundColor:r.map(o=>e[o]).map(o=>o<=0?"#CC2500":"#278211"),hoverBackgroundColor:r.map(o=>e[o]).map(o=>o<=0?"#F22C00":"#2DB20C"),type:"line",showLine:!1},{data:r.map(o=>t?t[`min_${o}`]:0),backgroundColor:"#cccccc",hoverBackgroundColor:"#aaaaaa",type:"bar",showLine:!1},{data:r.map(o=>t?t[`max_${o}`]:0),backgroundColor:"#cccccc",hoverBackgroundColor:"#aaaaaa",type:"bar",showLine:!1}]};return I(UMe,{options:n,data:i})},HMe=()=>$e("div",{className:"w-[200px]",children:["\u0413\u0440\u0430\u0444\u0438\u043A \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0442\u043E\u043F-15 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432, \u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442 \u043D\u0430\u0438\u0431\u043E\u043B\u044C\u0448\u0435\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u0435 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A \u0432 \u043E\u043F\u0440\u0435\u0434\u0435\u043B\u0451\u043D\u043D\u043E\u0439 \u0442\u043E\u0447\u043A\u0435.",I("br",{}),I("br",{}),"\u0424\u0430\u043A\u0442\u043E\u0440\u044B \u043C\u043E\u0433\u0443\u0442 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u043E\u043B\u043E\u0436\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0438\u043B\u0438 \u043E\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u0435.",I("br",{}),I("br",{}),"\u0427\u0435\u043C \u0431\u043E\u043B\u044C\u0448\u0435 \u0432\u043B\u0438\u044F\u043D\u0438\u044F \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0435\u0442 \u0444\u0430\u043A\u0442\u043E\u0440 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A, \u0442\u0435\u043C \u0431\u043B\u0438\u0436\u0435 \u0435\u0433\u043E \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u043A 100% (-100%)."]}),_K=({point:e})=>{const[t,n]=w.exports.useState(!1),r=()=>[I($n,{type:"primary",onClick:()=>n(!1),children:"\u0417\u0430\u043A\u0440\u044B\u0442\u044C"},"close-button")];return $e("div",{className:"flex items-center",children:[e.prediction_current,I($i,{title:"\u0412\u043B\u0438\u044F\u043D\u0438\u0435 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432 \u043D\u0430 \u043F\u0440\u043E\u0433\u043D\u043E\u0437",children:I($n,{className:"flex justify-center items-center h-6 ml-1 p-1",type:"primary",onClick:()=>n(!0),children:I(dPe,{})})}),I(t0,{open:t,title:"\u0412\u043A\u043B\u0430\u0434 \u0444\u0430\u043A\u0442\u043E\u0440\u043E\u0432 \u0432 \u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0442\u0440\u0430\u0444\u0438\u043A\u0430",onCancel:()=>n(!1),width:800,footer:r(),style:{top:"15px"},children:$e("div",{children:[$e("div",{className:"flex flex-col gap-2",children:[$e(sc,{className:da("p-1"),children:[I(Io,{className:"font-semibold",span:12,children:"\u0410\u0434\u0440\u0435\u0441 \u0442\u043E\u0447\u043A\u0438:"}),I(Io,{span:12,children:e.address})]}),$e(sc,{className:da("p-1"),children:[I(Io,{className:"font-semibold",span:12,children:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0444\u0438\u043A:"}),I(Io,{span:12,children:e.prediction_current})]})]}),I(Lce,{}),I(jMe,{point:e}),I("p",{children:"* - \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438"}),I(bf,{content:I(HMe,{autoFocus:!0}),trigger:"click",placement:"leftBottom",color:"#ffffff",children:I($n,{type:"text",className:"text-[#1890FF] p-0",children:"\u041A\u0430\u043A \u0447\u0438\u0442\u0430\u0442\u044C \u0433\u0440\u0430\u0444\u0438\u043A?"})})]})})]})},wK=(e=[],t)=>{const{data:n}=cw(),{tableState:{fullScreen:r}}=s0(),[i,o]=iv(`${t}Sort`,null),s=w.exports.useMemo(()=>[{title:r?$e("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u0410\u0434\u0440\u0435\u0441"}),I(bf,{content:I(rk,{autoFocus:!0}),trigger:"click",placement:"right",children:I($n,{onClick:p=>p.stopPropagation(),children:I(TT,{})})})]}):"\u0410\u0434\u0440\u0435\u0441",name:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200,sorter:!0,showSorterTooltip:!1},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"area",key:"area",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(p,m)=>up(m.area,n==null?void 0:n.normalized)},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"district",key:"district",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(p,m)=>up(m.district,n==null?void 0:n.normalized)},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0421\u0442\u0430\u0442\u0443\u0441",dataIndex:"status",key:"status",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(p,m)=>Nd[m.status]},{title:"\u041F\u0440\u043E\u0433\u043D\u043E\u0437\u043D\u044B\u0439 \u0442\u0440\u0430\u0444\u0438\u043A",dataIndex:"prediction_current",key:"prediction_current",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(p,m)=>I(_K,{point:m})},{title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u043E\u0432 \u0432 \u0436\u0438\u043B\u043E\u043C \u0434\u043E\u043C\u0435",dataIndex:"doors",key:"doors",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043B\u0430\u0441\u0441 \u044D\u043D\u0435\u0440\u043E\u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dataIndex:"enrg_cls",key:"enrg_cls",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043F\u043E\u0434\u044A\u0435\u0437\u0434\u0435 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dataIndex:"flat_cnt",key:"flat_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0413\u043E\u0434 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dataIndex:"year_bld",key:"year_bld",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u044D\u0442\u0430\u0436\u0435\u0439 \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dataIndex:"levels",key:"levels",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041C\u0430\u0442\u0435\u0440\u0438\u0430\u043B \u0441\u0442\u0435\u043D \u0436\u0438\u043B\u043E\u0433\u043E \u0434\u043E\u043C\u0430",dataIndex:"mat_nes",key:"mat_nes",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0435\u0442\u0435\u0439 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438 500\u043C (\u0434\u0430\u043B\u0435\u0435 \u0430\u043D\u0430\u043B\u043E\u0433\u0438\u0447\u043D\u043E)",dataIndex:"rival_post_cnt",key:"rival_post_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u041F\u0412\u0417",dataIndex:"rival_pvz_cnt",key:"rival_pvz_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442",dataIndex:"target_post_cnt",key:"target_post_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043A\u0432\u0430\u0440\u0442\u0438\u0440 \u0432 \u043E\u043A\u0440\u0435\u0441\u0442\u043D\u043E\u0441\u0442\u0438",dataIndex:"flats_cnt",key:"flats_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0434\u043E\u0441\u0442\u043E\u043F\u0440\u0438\u043C\u0435\u0447\u0430\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u0435\u0439",dataIndex:"attraction_cnt",key:"attraction_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0431\u0430\u043D\u043A\u043E\u0432",dataIndex:"bank_cnt",key:"bank_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0442\u043E\u0440\u0433\u043E\u0432\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432",dataIndex:"tc_cnt",key:"tc_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0431\u0438\u0437\u043D\u0435\u0441-\u0446\u0435\u043D\u0442\u0440\u043E\u0432",dataIndex:"bc_cnt",key:"bc_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043A\u043B\u0438\u043D\u0438\u043A",dataIndex:"clinic_cnt",key:"clinic_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u043A\u0443\u043B\u044C\u0442\u0443\u0440\u044B (\u0442\u0435\u0430\u0442\u0440\u044B, \u043C\u0443\u0437\u0435\u0439 \u0438 \u0442\u0434)",dataIndex:"culture_cnt",key:"culture_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0441\u043F\u043E\u0440\u0442\u0438\u0432\u043D\u044B\u0445 \u0446\u0435\u043D\u0442\u0440\u043E\u0432",dataIndex:"sport_center_cnt",key:"sport_center_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043B\u0430\u0431\u043E\u0440\u0430\u0442\u043E\u0440\u0438\u0439",dataIndex:"lab_cnt",key:"lab_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0448\u043A\u043E\u043B",dataIndex:"school_cnt",key:"school_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0434\u0435\u0442\u0441\u043A\u0438\u0445 \u0441\u0430\u0434\u043E\u0432",dataIndex:"kindergar_cnt",key:"kindergar_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u041C\u0424\u0426",dataIndex:"mfc_cnt",key:"mfc_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0430\u043F\u0442\u0435\u043A",dataIndex:"pharmacy_cnt",key:"pharmacy_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0441\u0442\u0430\u043D\u043E\u0432\u043E\u043A \u041E\u0422",dataIndex:"public_stop_cnt",key:"public_stop_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043E\u0431\u044A\u0435\u043A\u0442\u043E\u0432 \u0438\u0437 HORECA",dataIndex:"reca_cnt",key:"reca_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432",dataIndex:"supermarket_cnt",key:"supermarket_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u043E\u043B-\u0432\u043E \u043F\u0440\u0435\u043C\u0438\u0430\u043B\u044C\u043D\u044B\u0445 \u0441\u0443\u043F\u0435\u0440\u043C\u0430\u0440\u043A\u0435\u0442\u043E\u0432",dataIndex:"supermarket_premium_cnt",key:"supermarket_premium_cnt",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430 \u041C\u043E\u0439 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"target_dist",key:"target_dist",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0420\u0430\u0441\u0441\u0442\u043E\u044F\u043D\u0438\u0435 \u0434\u043E \u043C\u0435\u0442\u0440\u043E",dataIndex:"metro_dist",key:"metro_dist",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0421\u0442\u043E\u0438\u043C\u043E\u0441\u0442\u044C \u0436\u0438\u043B\u043E\u0439 \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438 ",dataIndex:"property_price_bargains",key:"property_price_bargains",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0411\u0438\u0437\u043D\u0435\u0441-\u0430\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u044C",dataIndex:"business_activity",key:"business_activity",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u042D\u0440\u0430 \u043F\u043E\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0436\u0438\u043B\u043E\u0439 \u043D\u0435\u0434\u0432\u0438\u0436\u0438\u043C\u043E\u0441\u0442\u0438",dataIndex:"property_era",key:"property_era",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0421\u0440\u0435\u0434\u043D\u044F\u044F \u044D\u0442\u0430\u0436\u043D\u043E\u0441\u0442\u044C \u0437\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438",dataIndex:"property_mean_floor",key:"property_mean_floor",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},...e].filter(Boolean),[n==null?void 0:n.normalized,e,r]),[a,u]=iv(`${t}Order`,s.map((p,m)=>({key:p.key,position:m,show:!0})));return w.exports.useEffect(()=>{const m=s.filter(v=>!a.find(x=>x.key===v.key)).map((v,x)=>({key:v.key,position:s.length-x-1,show:!0}));u([...a,...m])},[s]),{columns:w.exports.useMemo(()=>a.flatMap(p=>p.show?s[p.position]:[]).map(p=>i&&i.includes(p==null?void 0:p.key)?{...p,defaultSortOrder:i.includes("-")?"descend":"ascend"}:p).filter(Boolean),[s,a,r]),orderColumns:{defaultColumns:s,order:a,setOrder:u},sort:i,setSort:o}},KMe=(e,t)=>{const{filters:n,ranges:r}=va(),{categories:i,region:o}=n,{selection:s}=Pl(),a=[...s.included],u=[...s.excluded],d=ys();return Vi(["export-initial",n,s],async()=>await iI((()=>{const m=new URLSearchParams({"status[]":[jn.pending]});return v_(m,n,r),m.append("status[]",[jn.pending,jn.cancelled].join(",")),i.length&&m.append("categories[]",i),a.length&&m.append("included[]",a),u.length&&m.append("excluded[]",u),m})(),o,d),{enabled:e,onSuccess:kT,onSettled:t,retry:!1})},WMe=(e,t)=>{const{clickedPointConfig:n}=Su(),{data:r,isInitialLoading:i,isFetching:o}=Vi(["clicked-point",n==null?void 0:n.id],async()=>{const s=new URLSearchParams({"location_ids[]":[n.id]}),{data:a}=await Mi.get(`https://postamates.spatialsystems.ru/api/placement_points?${s.toString()}`);return a},{enabled:e,onSuccess:t});return{data:r,isLoading:i||o}},wk=(e,t)=>{const[n,r]=w.exports.useState(),[i,o]=w.exports.useState(!1),s=w.exports.useRef(),{data:a,isLoading:u}=WMe(i,()=>o(!1)),{clickedPointConfig:d}=Su(),p=ff();return w.exports.useEffect(()=>{!e||r(e)},[e]),w.exports.useEffect(()=>{!e||d===null||e.results.find(v=>v.id===d.id)||o(!0)},[e,d]),w.exports.useEffect(()=>{var m;!((m=a==null?void 0:a.results)!=null&&m[0])||(s.current=a.results[0].id,t(op+1),r({count:(e==null?void 0:e.count)+1,results:[a.results[0],...e.results]}))},[a,e]),w.exports.useEffect(()=>{if(d===null){const m=["clicked-point",s.current];p.removeQueries({queryKey:m}),t(op),r(e)}},[d,e]),{data:n,isClickedPointLoading:u}},GMe=(e,t,n,r,i)=>{const{filters:o,ranges:s}=va(),{updateCounter:a}=bu(),{categories:u,region:d}=o,p=ys(),m=()=>{const T=new URLSearchParams({page:e,page_size:n,"categories[]":u,ordering:i});return v_(T,o,s),T.append("status[]",[jn.pending,jn.cancelled].join(",")),T},{data:v,isInitialLoading:x,isFetching:_}=Vi(["table",e,o,i,p,a],async({signal:T})=>{const M=m();return await gf(M,d,p,T)},{onError:T=>{T.response.data.detail==="\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430"&&t()},refetchOnWindowFocus:!1}),{data:P,isClickedPointLoading:k}=wk(v,r);return{data:P,pageSize:n,isClickedPointLoading:k,isDataLoading:x||_}},kL={New:{name:"\u041D\u043E\u0432\u0430\u044F",color:"import_status_new"},Error:{name:"\u041E\u0448\u0438\u0431\u043A\u0430 \u0433\u0435\u043E\u043A\u043E\u0434\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F",color:"import_status_error"},Matched:{name:"\u0421\u043E\u0432\u043F\u0430\u0434\u0435\u043D\u0438\u0435",color:"import_status_matched"}},qMe=()=>{const{isImportMode:e}=Do(),{toggleUpdateCounter:t}=bu(),[n,r]=w.exports.useState(!1),i=async(s,a)=>{s.stopPropagation(),r(!0);try{await ite(a),t()}catch{}finally{r(!1)}};return{fields:w.exports.useMemo(()=>e?[{title:"\u0421\u0442\u0430\u0442\u0443\u0441 \u0438\u043C\u043F\u043E\u0440\u0442\u0430",dataIndex:"matching_status",key:"matching_status",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(s,a)=>{if(!a.matching_status)return;const u=kL[a.matching_status].name,d=kL[a.matching_status].color;return I("div",{className:`bg-opacity-25 rounded-md px-2 py-1 text-center border-solid border-[2px] ${d}`,children:u})}},{title:"\u0423\u0434\u0430\u043B\u0438\u0442\u044C",key:"del",width:"60px",ellipsis:!0,render:(s,a)=>{if(!!a.id)return I($n,{type:"text",onClick:u=>i(u,a.id),children:I(fPe,{})})}}]:[],[e]),isDeleting:n}},ZMe="pendingTable",XMe=({fullWidth:e})=>{const{selection:t,include:n,exclude:r}=Pl(),{clickedPointConfig:i,setClickedPointConfig:o}=Su(),[s,a]=w.exports.useState(1),[u,d]=w.exports.useState(op),{fields:p,isDeleting:m}=qMe(),{columns:v,orderColumns:x,sort:_,setSort:P}=wK(p,ZMe),{setPopup:k}=Sf(),T=(H,G)=>{H==="ascend"&&P(G),H==="descend"&&P(`-${G}`),H||P(null)},{data:M,isClickedPointLoading:O,isDataLoading:N}=GMe(s,()=>a(1),u,d,_),L=()=>d(op),V={selectedRowKeys:w.exports.useCallback(()=>{var Q;const H=(Q=M==null?void 0:M.results.filter(le=>le.status===jn.pending).map(le=>le.id))!=null?Q:[],G=M==null?void 0:M.results.find(le=>le.id===(i==null?void 0:i.id)),ee=le=>t.excluded.has(le),X=le=>le===(G==null?void 0:G.id)&&(i==null?void 0:i.shouldSelect)===!1;return[...H.filter(le=>!ee(le)&&!X(le)),...t.included]},[M,i,t])(),onSelect:(H,G)=>{const{id:ee}=H;G?n(ee):r(ee)},getCheckboxProps:H=>({disabled:H.status!==jn.pending}),hideSelectAll:!0},B=w.exports.useCallback(H=>{L(),o(null),k(null),a(H)},[]);return I(nk,{rowSelection:V,data:M,onPageChange:B,page:s,pageSize:u,isClickedPointLoading:O,columns:v,fullWidth:e,onChange:(H,G,ee)=>{T(ee.order,ee.columnKey)},header:I(Cw,{exportProvider:KMe,orderColumns:x}),loading:N||m})},YMe=[{label:Nd[jn.pending],value:jn.pending},{label:Nd[jn.onApproval],value:jn.onApproval},{label:Nd[jn.working],value:jn.working},{label:Nd[jn.cancelled],value:jn.cancelled}],CK=({value:e,onChange:t,disabled:n,isLoading:r})=>I(vu,{style:{width:250},value:e,onChange:s=>{t(s)},options:YMe,loading:r,disabled:n,placeholder:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0442\u0430\u0442\u0443\u0441",onClick:s=>s.stopPropagation()}),QMe=(e,t)=>{const{filters:{region:n}}=Cf(),r=ys();return Vi(["export-on-approval",n],async()=>{const i=new URLSearchParams({"status[]":[jn.onApproval,jn.working]});return await iI(i,n,r)},{enabled:e,onSuccess:kT,onSettled:t})},JMe=({selectedIds:e,selectedStatus:t,onOpenMakeWorkingModal:n,onSuccess:r})=>{const i=ff(),{setPopup:o}=Sf(),{mutate:s}=hw({onSuccess:()=>{i.invalidateQueries(["on-approval-points"]),o(null),r()}});return I(Tn,{children:I($n,{type:"primary",onClick:u=>{u.stopPropagation();const d=new URLSearchParams({status:t,"location_ids[]":e});t===jn.working?n():s(d)},children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})})},eRe=({selectedIds:e,onClearSelected:t,onOpenMakeWorkingModal:n,orderColumns:r})=>{const[i,o]=w.exports.useState(jn.pending),s=a=>{a.stopPropagation(),t()};return I(Cw,{leftColumn:e.length>0&&$e(Tn,{children:[I(CK,{value:i,onChange:o}),I(JMe,{selectedIds:e,selectedStatus:i,onOpenMakeWorkingModal:n,onSuccess:t})]}),rightColumn:e.length>0&&I($n,{onClick:s,children:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435"}),classes:{leftColumn:"flex items-center gap-x-4",rightColumn:"flex item-center gap-x-4"},orderColumns:r,exportProvider:QMe})},tRe=[{title:"Id",dataIndex:"id",key:"id",width:50},{title:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",width:200},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0},{title:"\u0421\u0442\u0430\u0442\u0443\u0441",dataIndex:"status",key:"status",width:"120px",ellipsis:!0,render:(e,t)=>Nd[t.status]},{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"120px",editable:!0}];const SK=Un.createContext(null),nRe=({index:e,...t})=>{const[n]=j3.useForm();return I(j3,{form:n,component:!1,children:I(SK.Provider,{value:n,children:I("tr",{...t})})})},rRe=({title:e,editable:t,children:n,dataIndex:r,record:i,handleSave:o,setHasError:s,...a})=>{const[u,d]=w.exports.useState(!1),p=w.exports.useRef(null),m=w.exports.useContext(SK);w.exports.useEffect(()=>{u&&p.current.focus()},[u]);const v=()=>{d(!u),m.setFieldsValue({[r]:i[r]})},x=async()=>{try{const P=await m.validateFields();s(!1),v(),o({...i,...P})}catch(P){console.log("Save failed:",P),s(!0)}};let _=n;return t&&(_=u?I(j3.Item,{style:{margin:0},name:r,rules:[{required:!0,message:`\u0423\u043A\u0430\u0436\u0438\u0442\u0435 ${e}`}],children:I(iV,{ref:p,onPressEnter:x,onBlur:x,className:"w-full",min:0,precision:0})}):I("div",{className:"editable-cell-value-wrap",style:{paddingRight:24},onClick:v,children:n})),I("td",{...a,children:_})},iRe=({data:e,onChange:t,setHasError:n})=>{const r=a=>{const u=[...e],d=u.findIndex(m=>a.id===m.id),p=u[d];u.splice(d,1,{...p,...a}),t(u)},i={body:{row:nRe,cell:rRe}},o=tRe.map(a=>a.editable?{...a,onCell:u=>({record:u,editable:a.editable,dataIndex:a.dataIndex,title:a.title,handleSave:r,setHasError:n})}:a);return I(yU,{components:i,size:"small",pagination:!1,dataSource:e,columns:o,rowKey:"id",sticky:!0,rowClassName:()=>"editable-row",className:"!max-w-full",scroll:{y:"max-content",x:"max-content"}})},oRe=({selectedIds:e,onClose:t,onSuccess:n})=>{const{data:r}=Vi(["make-working-table",e],async()=>{const P=new URLSearchParams({page:1,page_size:100,"location_ids[]":e});return await gf(P)}),[i,o]=w.exports.useState(!1),[s,a]=w.exports.useState([]),[u,d]=w.exports.useState(null);w.exports.useEffect(()=>{a(r==null?void 0:r.results)},[r]);const p=ff(),{setPopup:m}=Sf(),{mutateAsync:v}=t$(),{mutateAsync:x}=hw({});return I(t0,{open:!0,title:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432",onCancel:t,width:800,footer:[u&&I("span",{className:"mr-2 text-primary",children:u},"error"),I($n,{type:"primary",onClick:()=>{const P=s.map(M=>{const O=new URLSearchParams({id:M.id,postamat_id:M.postamat_id});return v(O)}),k=new URLSearchParams({status:jn.working,"location_ids[]":e}),T=x(k);Promise.all([...P,T]).then(()=>{p.invalidateQueries(["on-approval-points"]),d(null),m(null),n(),t()}).catch(()=>d("\u0412\u0432\u0435\u0434\u0435\u043D\u043D\u044B\u0435 \u0438\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440\u044B \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044E\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u0438\u0435"))},disabled:i,children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"},"ok-button")],children:s&&I(iRe,{data:s,onChange:a,setHasError:o})})},aRe=[{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"70px",ellipsis:!0,sorter:!0,showSorterTooltip:!1}],sRe=({fullWidth:e})=>{const[t,n]=w.exports.useState(op),[r,i]=w.exports.useState(1),[o,s]=w.exports.useState([]),{filters:{region:a}}=Cf(),[u,d]=w.exports.useState(!1),{columns:p,orderColumns:m,sort:v,setSort:x}=wK(aRe,"onApprovalTableOrder"),{isVisible:_}=Ks(),P=ys(),k=(H,G)=>{H==="ascend"&&x(G),H==="descend"&&x(`-${G}`),H||x(null)},T=()=>s([]),{data:M,isInitialLoading:O,isFetching:N}=Vi(["on-approval-points",r,a,_,v],async()=>{const H=[];_[Cn.approve]&&H.push(jn.onApproval),_[Cn.working]&&H.push(jn.working),_[Cn.cancelled]&&H.push(jn.cancelled);const G=new URLSearchParams({page:r,page_size:t,"status[]":H.length>0?H:[jn.onApproval,jn.working,jn.cancelled],ordering:v});return H.length===0?{count:0,results:[]}:await gf(G,a,P)},{keepPreviousData:!0}),{data:L,isClickedPointLoading:F}=wk(M,n),V=w.exports.useCallback(H=>i(H),[]);return $e(Tn,{children:[I(nk,{header:I(eRe,{selectedIds:o,onClearSelected:T,onOpenMakeWorkingModal:()=>d(!0),orderColumns:m}),rowSelection:{selectedRowKeys:o,onChange:H=>s(H),hideSelectAll:!0},data:L,onPageChange:V,page:r,pageSize:t,isClickedPointLoading:F,columns:p,fullWidth:e,onChange:(H,G,ee)=>{k(ee.order,ee.columnKey)},loading:O||N}),u&&I(oRe,{selectedIds:o,onClose:()=>d(!1),onSuccess:T})]})},lRe=(e,t)=>{const{filters:{region:n,deltaTraffic:r,factTraffic:i,age:o}}=$c();return Vi(["export-working",n,r,i,o],async()=>{const s=new URLSearchParams({"status[]":[jn.working],"delta_current[]":r,"fact[]":i,"age_day[]":o});return await iI(s,n)},{enabled:e,onSuccess:kT,onSettled:t})},uRe=11,cRe=e=>{const{data:t}=cw(),{tableState:{fullScreen:n}}=s0(),[r,i]=iv(`${e}Order`,[...Array(uRe).keys()].map(d=>({position:d,show:!0}))),[o,s]=iv(`${e}Sort`,null),a=w.exports.useMemo(()=>[{title:n?$e("div",{className:"flex items-center justify-between",children:[I("span",{children:"\u0410\u0434\u0440\u0435\u0441"}),I(bf,{content:I(rk,{autoFocus:!0}),trigger:"click",placement:"right",children:I($n,{onClick:d=>d.stopPropagation(),children:I(TT,{})})})]}):"\u0410\u0434\u0440\u0435\u0441",name:"\u0410\u0434\u0440\u0435\u0441",dataIndex:"address",key:"address",sorter:!0,showSorterTooltip:!1,width:200},{title:"\u0420\u0430\u0439\u043E\u043D",dataIndex:"area",key:"area",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:(d,p)=>up(p.area,t==null?void 0:t.normalized)},{title:"\u041E\u043A\u0440\u0443\u0433",dataIndex:"district",key:"district",width:"120px",ellipsis:!0,render:(d,p)=>up(p.district,t==null?void 0:t.normalized),sorter:!0,showSorterTooltip:!1},{title:"\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435",dataIndex:"name",key:"name",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041A\u0430\u0442\u0435\u0433\u043E\u0440\u0438\u044F",dataIndex:"category",key:"category",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u041F\u043B\u0430\u043D",dataIndex:"plan_current",key:"plan_current",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0424\u0430\u043A\u0442",dataIndex:"fact",key:"fact",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0420\u0430\u0441\u0445\u043E\u0436\u0434\u0435\u043D\u0438\u0435 \u0441 \u043F\u0440\u043E\u0433\u043D\u043E\u0437\u043E\u043C",dataIndex:"delta_current",key:"delta_current",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0417\u0440\u0435\u043B\u043E\u0441\u0442\u044C",dataIndex:"age_day",key:"age_day",width:"120px",ellipsis:!0,sorter:!0,showSorterTooltip:!1},{title:"\u0414\u0430\u0442\u0430 \u043D\u0430\u0447\u0430\u043B\u0430 \u0440\u0430\u0431\u043E\u0442\u044B",dataIndex:"start_date",key:"start_date",width:"120px",sorter:!0,showSorterTooltip:!1,render:d=>d?new Date(d).toLocaleDateString("ru"):"\u041D\u0435\u0442 \u0434\u0430\u043D\u043D\u044B\u0445"},{title:"Id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430",dataIndex:"postamat_id",key:"postamat_id",width:"70px",ellipsis:!0,sorter:!0,showSorterTooltip:!1}],[t==null?void 0:t.normalized,n]);return{columns:w.exports.useMemo(()=>r.flatMap(d=>d.show?a[d.position]:[]).map(d=>o&&o.includes(d.key)?{...d,defaultSortOrder:o.includes("-")?"descend":"ascend"}:d),[a,r,n]),orderColumns:{defaultColumns:a,order:r,setOrder:i},sort:o,setSort:s}},dRe="workingTable",fRe=({fullWidth:e})=>{const[t,n]=w.exports.useState(op),[r,i]=w.exports.useState(1),{filters:{region:o,deltaTraffic:s,factTraffic:a,age:u}}=$c(),{columns:d,orderColumns:p,sort:m,setSort:v}=cRe(dRe),x=(N,L)=>{N==="ascend"&&v(L),N==="descend"&&v(`-${L}`),N||v(null)},{data:_,isInitialLoading:P,isFetching:k}=Vi(["working-points",r,o,s,a,u,m],async()=>{const N=new URLSearchParams({page:r,page_size:t,"status[]":[jn.working],"delta_current[]":s,"fact[]":a,"age_day[]":u,ordering:m});return await gf(N,o)},{keepPreviousData:!0}),{data:T,isClickedPointLoading:M}=wk(_,n),O=w.exports.useCallback(N=>i(N),[]);return I(nk,{data:T,onPageChange:O,page:r,pageSize:t,isClickedPointLoading:M,columns:d,fullWidth:e,onChange:(N,L,F)=>{x(F.order,F.columnKey)},header:I(Cw,{exportProvider:lRe,orderColumns:p}),loading:P||k})},hRe=({fullWidth:e})=>{const{mode:t}=Do();return t===Gr.ON_APPROVAL?I(sRe,{fullWidth:e}):t===Gr.WORKING?I(fRe,{fullWidth:e}):I(XMe,{fullWidth:e})};function pRe(){return I("div",{className:"absolute top-[20px] right-[20px]",children:I(bf,{content:I(Tn,{children:$e($n,{type:"primary",block:!0,children:[I("span",{className:"mr-1",children:"\u0412\u044B\u0439\u0442\u0438"}),I(ZU,{})]})}),trigger:"click",placement:"bottomRight",children:I($i,{title:"\u0412\u044B\u0439\u0442\u0438",placement:"left",children:I($n,{icon:I(Hwe,{}),type:"primary",size:"large"})})})})}const mRe="https://api.mapbox.com/styles/v1/ghermant/cla2nwk5f00el14nxvtjlsi6z/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiZ2hlcm1hbnQiLCJhIjoiY2xhMm5zZ3ZrMDF4MDN2bzc5Yjd0ZjZ1dCJ9.fqnvrEqKKBoguR7R6DR7Yw",gRe=()=>I(Od,{type:"raster",id:"basemap",tiles:[mRe],tileSize:256,children:I(ps,{type:"raster",source:"basemap",id:"basemap-layer",paint:{}})}),vRe=({width:e=40,height:t=40})=>I("img",{width:e,height:t,src:r$,alt:"logo"}),yRe=()=>$e("svg",{width:"102",height:"16",viewBox:"0 0 102 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[I("g",{clipPath:"url(#clip0_857_5233)",children:$e("g",{clipPath:"url(#clip1_857_5233)",children:[I("path",{d:"M27.8387 15.9746L41.7002 15.9746V2.11306L27.8387 2.11306V15.9746Z",fill:"#E40050"}),I("path",{d:"M13.922 2.11328V15.9748H0.0604095L13.922 2.11328Z",fill:"#E40050"}),I("path",{d:"M41.6451 2.11328V15.9748H27.7835L41.6451 2.11328Z",fill:"#CE1344"}),I("path",{d:"M0.0604095 2.11328V15.9748H13.922L0.0604095 2.11328Z",fill:"#CE1344"}),I("path",{d:"M20.8526 15.9745C24.6802 15.9745 27.7832 12.8716 27.7832 9.04389C27.7832 5.21622 24.6802 2.11328 20.8526 2.11328C17.0249 2.11328 13.922 5.21622 13.922 9.04389C13.922 12.8716 17.0249 15.9745 20.8526 15.9745Z",fill:"#CE1344"}),I("path",{d:"M51.9638 8.56478C51.7816 8.56478 51.6242 8.50208 51.4916 8.37604C51.3656 8.2438 51.3029 8.08641 51.3029 7.90388V4.52363L49.6506 6.61049C49.5246 6.77408 49.3515 6.85604 49.1311 6.85604C48.9107 6.85604 48.7376 6.77441 48.6119 6.61049L46.9597 4.52363V7.90388C46.9597 8.08641 46.8967 8.2438 46.7709 8.37604C46.6387 8.50208 46.4813 8.56478 46.2988 8.56478C46.1163 8.56478 45.9589 8.50208 45.8269 8.37604C45.7009 8.2438 45.6379 8.08641 45.6379 7.90388V2.61637C45.6379 2.30159 45.7858 2.09392 46.0816 1.99302C46.3775 1.88624 46.623 1.95873 46.818 2.21016L49.1311 5.13718L51.4442 2.21016C51.6392 1.96461 51.8847 1.89245 52.1812 1.99302C52.4771 2.09392 52.625 2.30159 52.625 2.61637V7.90388C52.625 8.08641 52.5616 8.2438 52.4356 8.37604C52.3037 8.50208 52.1463 8.56478 51.9634 8.56478H51.9638Z",fill:"#192732"}),I("path",{d:"M57.3456 8.56406C56.433 8.56406 55.6555 8.24014 55.0132 7.59165C54.3651 6.94969 54.0408 6.17222 54.0408 5.25957C54.0408 4.34692 54.3651 3.56945 55.0132 2.92749C55.6555 2.27932 56.433 1.95508 57.3456 1.95508C58.2583 1.95508 59.0358 2.27932 59.6777 2.92749C60.3262 3.56977 60.6505 4.34692 60.6505 5.25957C60.6505 6.17222 60.3262 6.94969 59.6777 7.59165C59.0358 8.24014 58.2583 8.56406 57.3456 8.56406ZM57.3456 3.27655C56.798 3.27655 56.3321 3.47181 55.9484 3.86202C55.5579 4.24602 55.3629 4.71198 55.3629 5.25924C55.3629 5.80651 55.5579 6.27279 55.9484 6.65647C56.3324 7.047 56.798 7.24194 57.3456 7.24194C57.8932 7.24194 58.3592 7.047 58.7429 6.65647C59.1331 6.27279 59.3283 5.80683 59.3283 5.25924C59.3283 4.71165 59.1331 4.24569 58.7429 3.86202C58.3589 3.47181 57.8932 3.27655 57.3456 3.27655Z",fill:"#192732"}),I("path",{d:"M67.9207 7.90314C67.9207 8.08567 67.8576 8.24012 67.7319 8.36584C67.5997 8.49808 67.4423 8.56404 67.2598 8.56404C67.0772 8.56404 66.9198 8.49808 66.7876 8.36584C66.6616 8.24012 66.5985 8.086 66.5985 7.90314V4.40012L63.2281 8.32796C63.0958 8.48535 62.929 8.56404 62.7275 8.56404C62.6459 8.56404 62.5701 8.5513 62.5009 8.52616C62.2116 8.41939 62.0669 8.21139 62.0669 7.90314V2.61563C62.0669 2.4331 62.1296 2.27898 62.2557 2.15294C62.3879 2.02069 62.5453 1.95473 62.7278 1.95473C62.9104 1.95473 63.0678 2.02069 63.2 2.15294C63.326 2.27898 63.3891 2.4331 63.3891 2.61563V6.11832L66.7595 2.18102C66.9545 1.95441 67.1971 1.89138 67.4864 1.99196C67.776 2.09906 67.9207 2.30673 67.9207 2.6153V7.90314ZM65.7492 0.0664062C65.9318 0.0664062 66.0888 0.129426 66.2214 0.255141C66.3471 0.387386 66.4101 0.544773 66.4101 0.727304C66.4101 0.909834 66.3471 1.06722 66.2214 1.19947C66.0892 1.32551 65.9318 1.3882 65.7492 1.3882H64.2384C64.0555 1.3882 63.8985 1.32551 63.7662 1.19947C63.6402 1.06722 63.5771 0.909834 63.5771 0.727304C63.5771 0.544773 63.6402 0.387386 63.7662 0.255141C63.8985 0.129426 64.0555 0.0664062 64.2384 0.0664062H65.7492Z",fill:"#192732"}),I("path",{d:"M45.6379 10.0261C45.6379 9.8436 45.7006 9.68948 45.8269 9.56344C45.9592 9.43119 46.1162 9.36523 46.2988 9.36523H50.8307C51.0136 9.36523 51.1703 9.43119 51.3029 9.56344C51.4289 9.68948 51.4916 9.8436 51.4916 10.0261V15.3136C51.4916 15.4962 51.4289 15.6506 51.3029 15.7763C51.1706 15.9086 51.0136 15.9745 50.8307 15.9745C50.6478 15.9745 50.4911 15.9086 50.3585 15.7763C50.2325 15.6506 50.1698 15.4965 50.1698 15.3136V10.687H46.9593V15.3136C46.9593 15.4962 46.8963 15.6506 46.7706 15.7763C46.6384 15.9086 46.481 15.9745 46.2985 15.9745C46.1159 15.9745 45.9585 15.9086 45.8266 15.7763C45.7006 15.6506 45.6376 15.4965 45.6376 15.3136L45.6379 10.0261Z",fill:"#192732"}),I("path",{d:"M56.2129 15.9742C55.3003 15.9742 54.5228 15.6503 53.8805 15.0018C53.2323 14.3598 52.9081 13.5824 52.9081 12.6697C52.9081 11.7571 53.2323 10.9796 53.8805 10.3376C54.5228 9.68948 55.3003 9.36523 56.2129 9.36523C57.1256 9.36523 57.903 9.68948 58.545 10.3376C59.1935 10.9799 59.5177 11.7571 59.5177 12.6697C59.5177 13.5824 59.1935 14.3598 58.545 15.0018C57.903 15.6503 57.1256 15.9742 56.2129 15.9742ZM56.2129 10.6867C55.6653 10.6867 55.1993 10.882 54.8157 11.2722C54.4251 11.6562 54.2302 12.1221 54.2302 12.6694C54.2302 13.2167 54.4251 13.6829 54.8157 14.0666C55.1997 14.4572 55.6653 14.6521 56.2129 14.6521C56.7605 14.6521 57.2265 14.4572 57.6101 14.0666C58.0003 13.6829 58.1956 13.217 58.1956 12.6694C58.1956 12.1218 58.0003 11.6558 57.6101 11.2722C57.2261 10.882 56.7605 10.6867 56.2129 10.6867Z",fill:"#192732"}),I("path",{d:"M60.5561 12.6697C60.5561 11.7571 60.8803 10.9796 61.5285 10.3376C62.1708 9.68948 62.9482 9.36523 63.8609 9.36523C64.9309 9.36523 65.7962 9.78711 66.4575 10.6302C66.5708 10.7752 66.6181 10.9355 66.5992 11.1118C66.5737 11.2944 66.4888 11.4423 66.3442 11.5556C66.1995 11.6689 66.0389 11.713 65.8625 11.6878C65.68 11.6689 65.5321 11.5873 65.4188 11.4423C65.022 10.9388 64.5029 10.687 63.8609 10.687C63.3133 10.687 62.8474 10.8823 62.4637 11.2725C62.0731 11.6565 61.8782 12.1225 61.8782 12.6697C61.8782 13.217 62.0731 13.6833 62.4637 14.0669C62.8477 14.4575 63.3133 14.6524 63.8609 14.6524C64.5029 14.6524 65.0224 14.4007 65.4188 13.8972C65.5321 13.7525 65.68 13.6705 65.8625 13.6516C66.0389 13.6265 66.1995 13.6702 66.3442 13.7838C66.4888 13.8975 66.5737 14.0451 66.5992 14.2276C66.6178 14.4039 66.5708 14.5646 66.4575 14.7092C65.7962 15.5527 64.9309 15.9742 63.8609 15.9742C62.9482 15.9742 62.1708 15.6503 61.5285 15.0018C60.8803 14.3598 60.5561 13.5824 60.5561 12.6697Z",fill:"#192732"}),I("path",{d:"M68.1378 10.687C67.9549 10.687 67.7979 10.6243 67.6656 10.498C67.5396 10.3657 67.4766 10.2087 67.4766 10.0261C67.4766 9.8436 67.5396 9.68621 67.6656 9.55397C67.7979 9.42826 67.9549 9.36523 68.1378 9.36523H72.67C72.8526 9.36523 73.0096 9.42826 73.1419 9.55397C73.2679 9.68621 73.3309 9.8436 73.3309 10.0261C73.3309 10.2087 73.2679 10.3661 73.1419 10.498C73.0096 10.624 72.8526 10.687 72.67 10.687H71.0648V15.3136C71.0648 15.4962 71.0018 15.6506 70.8761 15.7763C70.7438 15.9086 70.5865 15.9745 70.4039 15.9745C70.2214 15.9745 70.0669 15.9086 69.9412 15.7763C69.809 15.6506 69.743 15.4965 69.743 15.3136V10.687H68.1381H68.1378Z",fill:"#192732"}),I("path",{d:"M79.6382 15.0105C79.7198 15.1741 79.7326 15.3443 79.6761 15.5203C79.6193 15.6904 79.5092 15.8161 79.3453 15.898C79.2509 15.9487 79.1533 15.9735 79.0527 15.9735C78.7755 15.9735 78.5773 15.8507 78.4578 15.6055L77.9762 14.6517H74.832L74.3504 15.6055C74.2684 15.7691 74.1427 15.8791 73.9729 15.9359C73.7966 15.9927 73.6265 15.98 73.4629 15.898C73.2993 15.8164 73.1889 15.6904 73.1321 15.5203C73.0756 15.3439 73.088 15.1741 73.17 15.0105L75.8139 9.72303C75.9272 9.50262 76.1254 9.39258 76.4088 9.39258C76.6857 9.39258 76.8807 9.50262 76.994 9.72303L79.6379 15.0105H79.6382ZM77.3153 13.3299L76.4091 11.4984L75.4932 13.3299H77.3153Z",fill:"#192732"}),I("path",{d:"M87.314 15.973C87.1314 15.973 86.9744 15.9103 86.8418 15.7842C86.7158 15.652 86.6531 15.4946 86.6531 15.3121V11.9318L85.0005 14.0187C84.8744 14.1823 84.7014 14.2642 84.4813 14.2642C84.2612 14.2642 84.0878 14.1826 83.9621 14.0187L82.3099 11.9318V15.3121C82.3099 15.4946 82.2469 15.652 82.1208 15.7842C81.9886 15.9103 81.8312 15.973 81.6487 15.973C81.4661 15.973 81.3091 15.9103 81.1765 15.7842C81.0504 15.652 80.9878 15.4946 80.9878 15.3121V10.0246C80.9878 9.7098 81.1353 9.50212 81.4315 9.40122C81.7273 9.29445 81.9729 9.36694 82.1678 9.61837L84.481 12.5454L86.7941 9.61837C86.9891 9.37282 87.2346 9.30065 87.5308 9.40122C87.8266 9.50212 87.9745 9.7098 87.9745 10.0246V15.3121C87.9745 15.4946 87.9115 15.652 87.7855 15.7842C87.6532 15.9103 87.4958 15.973 87.3133 15.973H87.314Z",fill:"#192732"}),I("path",{d:"M95.793 15.0105C95.8746 15.1741 95.8874 15.3443 95.8309 15.5203C95.774 15.6904 95.664 15.8161 95.5001 15.898C95.4057 15.9487 95.3081 15.9735 95.2075 15.9735C94.9303 15.9735 94.7321 15.8507 94.6126 15.6055L94.1309 14.6517H90.9868L90.5051 15.6055C90.4232 15.7691 90.2975 15.8791 90.1277 15.9359C89.9514 15.9927 89.7812 15.98 89.6176 15.898C89.4541 15.8164 89.3437 15.6904 89.2869 15.5203C89.2304 15.3439 89.2428 15.1741 89.3247 15.0105L91.9687 9.72303C92.082 9.50262 92.2802 9.39258 92.5636 9.39258C92.8405 9.39258 93.0354 9.50262 93.1487 9.72303L95.7927 15.0105H95.793ZM93.4701 13.3299L92.5639 11.4984L91.648 13.3299H93.4701Z",fill:"#192732"}),I("path",{d:"M96.2932 10.687C96.1104 10.687 95.9533 10.6243 95.8211 10.498C95.695 10.3657 95.632 10.2087 95.632 10.0261C95.632 9.8436 95.695 9.68621 95.8211 9.55397C95.9533 9.42826 96.1104 9.36523 96.2932 9.36523H100.825C101.008 9.36523 101.165 9.42826 101.297 9.55397C101.423 9.68621 101.486 9.8436 101.486 10.0261C101.486 10.2087 101.423 10.3661 101.297 10.498C101.165 10.624 101.008 10.687 100.825 10.687H99.2202V15.3136C99.2202 15.4962 99.1572 15.6506 99.0315 15.7763C98.8993 15.9086 98.7419 15.9745 98.5594 15.9745C98.3768 15.9745 98.2224 15.9086 98.0967 15.7763C97.9644 15.6506 97.8984 15.4965 97.8984 15.3136V10.687H96.2932Z",fill:"#192732"})]})}),$e("defs",{children:[I("clipPath",{id:"clip0_857_5233",children:I("rect",{width:"102",height:"16",fill:"white"})}),I("clipPath",{id:"clip1_857_5233",children:I("rect",{width:"101.6",height:"16",fill:"white"})})]})]}),xRe=({width:e=24,height:t=24})=>$e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e,height:t,children:[I("polygon",{className:"ai-st0",points:"10.5,3.6 10.5,5.2 10.5,19.9 10.3,20.8 10,21.5 9.5,22.1 9.1,22.5 8.4,22.7 7.8,22.7 7.3,22.7 6.7,22.7 6.1,22.1 5.7,21.6 5.3,20.9 4.5,20.9 4,20.6 3.5,20.2 3.2,19.6 3,19.1 3,17.9 2.3,17.2 2,16.7 1,15 0.7,14.1 0.4,13.2 0.3,11.1 0.4,10.1 0.9,9.3 1.5,8.7 2,8.2 1.8,7.3 1.7,6.4 2,5.8 2.3,5.3 3.2,4.9 4.1,4.7 4.7,4.6 4.7,3.8 4.8,3 5.4,2.2 6.1,1.5 6.7,1.3 7.4,1.1 8,1.1 8.5,1.3 9.3,1.7 9.9,2.4 "}),I("polyline",{className:"ai-st0",points:"18.6,4.1 17.3,5.8 12.6,5.7 "}),I("polyline",{className:"ai-st0",points:"12.3,9.9 17.2,9.8 21,13.6 "}),I("line",{className:"ai-st0",x1:"12.3",y1:"14.5",x2:"14.5",y2:"14.5"}),I("polyline",{className:"ai-st0",points:"12.4,19 15.9,19 17.5,20.7 "}),$e("g",{children:[I("ellipse",{className:"ai-st1",cx:"19.4",cy:"3",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"19.4",cy:"2.9",rx:"1.1",ry:"1.1"})]}),$e("g",{children:[I("ellipse",{className:"ai-st1",cx:"22",cy:"14.6",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"22.1",cy:"14.6",rx:"1.1",ry:"1.1"})]}),$e("g",{children:[I("ellipse",{className:"ai-st1",cx:"16.2",cy:"14.5",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"16.2",cy:"14.4",rx:"1.1",ry:"1.1"})]}),$e("g",{children:[I("ellipse",{className:"ai-st1",cx:"18.7",cy:"21.7",rx:"1.9",ry:"1.9"}),I("ellipse",{className:"ai-st2",cx:"18.7",cy:"21.7",rx:"1.1",ry:"1.1"})]}),I("polyline",{className:"ai-st0",points:"5,9.5 3.6,10.9 3.4,12.7 3.8,13.9 5.6,16.4 "})]});const bRe=({width:e=24,height:t=24})=>$e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[I("polyline",{className:"approve-st0",points:"-273.8,391.3 -273.8,389.8 -274.1,389 -274.8,388.5 -275.9,388.5 -290.5,388.5 -291.2,388.7 -291.9,389.1 -292.3,389.8 -292.4,405.1 -292.3,405.9 -292,406.4 -291.4,406.7 -290.9,406.8 -276,406.8 -275.2,406.7 -274.4,406.4 -273.9,405.8 -273.8,404.3 "}),I("polygon",{className:"approve-st1",points:"-287.3,392.4 -286.4,393.5 -286.2,393.7 -285.8,393.7 -285,393.5 -284.1,392.4 -283.1,391.6 -282.6,391.6 -282,391.6 -281.6,392 -281.4,392.8 -281.6,393.2 -282.4,394.3 -285.6,397 -286,397 -286.4,397 -287.1,396.4 -289.2,394.3 -289.6,393.9 -289.6,393 -289.2,392.4 -288.7,392.2 -288.1,392 -287.7,392 "}),I("polygon",{className:"approve-st1",points:"-276.8,392.9 -275.9,392.4 -275.5,392.4 -275,393.5 -274.5,393.5 -273.9,393.5 -273.2,393.6 -272.9,392.7 -272.3,392.7 -271.8,392.9 -271.3,393.3 -271.1,393.5 -271.6,394.3 -271.3,394.7 -271.1,395 -270.8,395.6 -269.9,395.2 -269.6,395.6 -269.4,396.1 -269.3,396.4 -269.4,396.8 -269.4,397 -270.3,397.2 -270.2,397.9 -270.2,398.4 -270.3,398.7 -269.2,399.2 -269.4,399.6 -269.6,400.1 -270,400.6 -270.1,400.8 -270.9,400.3 -271,400.2 -271.4,400.5 -271.7,400.7 -272.1,401 -272.3,401.2 -272,402 -272.2,402.3 -273.3,402.7 -273.7,402.6 -273.9,401.8 -274,401.5 -274.8,401.6 -275.5,401.5 -275.6,402.5 -275.9,402.7 -276.4,402.6 -277.3,402.3 -277.3,401.9 -276.8,401 -277.5,400.7 -277.7,400.4 -278.1,400 -279,400.3 -279.3,399.8 -279.6,399 -279.5,398.5 -278.6,398.2 -278.5,397.3 -278.6,396.8 -279,396.5 -279.4,396.3 -279.6,396.2 -279.6,395.8 -279.3,395.1 -279.1,394.9 -278.7,394.9 -277.6,395.1 -277.4,394.6 -276.9,394.4 -276.8,394.2 -277.1,393.1 "}),I("circle",{className:"approve-st2",cx:"-274.4",cy:"397.5",r:"2.2"}),I("path",{className:"approve-st1",d:"M-282,400.2h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.5,400-281.7,400.2-282,400.2z"}),I("path",{className:"approve-st1",d:"M-282.1,402.6h-7.4c-0.3,0-0.5-0.2-0.5-0.5l0,0c0-0.3,0.2-0.5,0.5-0.5h7.4c0.3,0,0.5,0.2,0.5,0.5l0,0 C-281.6,402.4-281.8,402.6-282.1,402.6z"})]}),_Re=({width:e=24,height:t=24})=>$e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"-293 385 24 24",width:e,height:t,children:[I("path",{className:"working-st0",d:"M-279.1,402.7"}),I("polyline",{className:"working-st1",points:"-275,391.8 -275,390.5 -275.3,389.9 -276,389.6 -277,389.5 -290.8,389.6 -291.4,389.7 -292.1,390 -292.5,390.4 -292.5,401.4 -292.5,401.9 -292.1,402.3 -291.6,402.5 -291.1,402.6 -280,402.5 "}),I("polyline",{className:"working-st2",points:"-290.8,396 -289.3,396 -288.7,398.4 -287.6,394.3 -286.1,399.7 -285.1,392 -284.2,397 -283.2,395.9 -281.8,396 "}),I("circle",{className:"working-st3",cx:"-277",cy:"397.6",r:"4.6"}),I("circle",{className:"working-st4",cx:"-277.1",cy:"397.5",r:"2.9"}),I("polygon",{className:"working-st3",points:"-270.9,405.7 -269,403.8 -273.5,399.6 -275.4,401 "})]}),wRe=()=>{const{mode:e,setMode:t,isImportMode:n}=Do(),r=o=>{t(o)},i=o=>o===e?"primary":"default";return $e(Tn,{children:[I($i,{title:"\u041E\u0442\u0431\u043E\u0440 \u043B\u043E\u043A\u0430\u0446\u0438\u0439 \u0434\u043B\u044F \u0440\u0430\u0431\u043E\u0442\u044B",children:I($n,{icon:I(xRe,{}),type:i(Gr.PENDING),onClick:()=>r(Gr.PENDING),className:"flex items-center justify-center",size:"large"})}),I($i,{title:"\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0442\u0430\u0442\u0443\u0441\u0430\u043C\u0438 \u043B\u043E\u043A\u0430\u0446\u0438\u0439",children:I($n,{icon:I(bRe,{}),type:i(Gr.ON_APPROVAL),onClick:()=>r(Gr.ON_APPROVAL),className:"flex items-center justify-center",size:"large"})}),I($i,{title:"\u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0438\u043D\u0433 \u0440\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0445 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u043E\u0432",className:"text-center",children:I($n,{icon:I(_Re,{}),type:i(Gr.WORKING),onClick:()=>r(Gr.WORKING),className:"flex items-center justify-center",size:"large",disabled:n})})]})},CRe=()=>$e("div",{className:"absolute top-[20px] left-[19px] flex items-center z-10",children:[$e("div",{className:da("flex items-center gap-x-[42px]"),children:[I(yRe,{}),I("div",{className:"flex items-center gap-x-3",children:I(wRe,{})})]}),I("div",{className:"ml-[71px]",children:I(rk,{})})]}),SRe={finished:"\u041F\u0435\u0440\u0435\u0440\u0430\u0441\u0447\u0435\u0442 ML \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043D"};function ERe(){const{data:e}=tte(),[t,n]=w.exports.useState(!1);w.exports.useEffect(()=>{n((e==null?void 0:e.task_status)!==SRe.finished)},[e]);const r=async()=>{n(!0);try{await Qee()}catch{n(!1)}};return I(bf,{content:()=>t?$e("div",{className:"flex items-center gap-2",children:[I("div",{children:"\u0418\u0434\u0435\u0442 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043C\u044B..."}),I(vs,{})]}):$e(Tn,{children:[I("div",{className:"text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3",children:"\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0435 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043C\u044B"}),I("div",{className:"text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3",children:(e==null?void 0:e.last_time)&&new Date(e==null?void 0:e.last_time).toLocaleString("ru-RU")}),I($n,{type:"text",className:"flex items-center p-2 text-[#C50000] hover:text-[#C50000] text-xs",onClick:()=>r(),children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0438\u0441\u0442\u0435\u043C\u0443"})]}),trigger:"click",placement:"leftBottom",color:"#ffffff",children:I($i,{title:"\u0418\u043D\u0444\u043E",children:I($n,{className:"absolute bottom-[64px] right-[20px] flex items-center justify-center p-3",children:t?I(vs,{indicator:I(IT,{style:{fontSize:16,color:"#000000"},spin:!0})}):I(oj,{className:"w-4 h-4"})})})})}const PRe=5,IRe=3,EK={property:"prediction_current",stops:[[160,"#FDEBF0"],[161,"#F8C7D8"],[186,"#F398BC"],[201,"#EE67A1"],[211,"#B64490"],[226,"#7E237E"],[251,"#46016C"]]},Ub="#A6A6A6",NE="#ff7d00",TRe="rgba(196,195,195,0.6)",PK="#3f5be8",IK="#26a2a2",ML={type:"circle",paint:{"circle-stroke-width":.4,"circle-stroke-color":"#fff","circle-opacity":.8}},wl=(e=EK,t=PRe)=>({...ML,paint:{...ML.paint,"circle-color":e,"circle-radius":["interpolate",["linear"],["zoom"],3,0,9,2,13,t]}}),Jm=wl(),kRe=wl(TRe,IRe),MRe={...wl(NE),paint:{...wl(NE).paint,"circle-stroke-width":1,"circle-stroke-color":"#252525"}},jb={type:"symbol",layout:{"icon-image":"logo","icon-size":["interpolate",["linear"],["zoom"],3,0,9,.1,13,.5]},paint:{"icon-color":"#E63941"}},Hb=e=>({type:"symbol",layout:{"icon-image":["coalesce",["image",e],["image","defaultIcon"]],"icon-size":["interpolate",["linear"],["zoom"],3,0,9,.1,13,.5]}}),RL="#ffffff",AL=16;({...wl(RL,AL),paint:{...wl(RL,AL).paint}});const RRe={...wl(Ub),paint:{...wl(Ub).paint,"circle-stroke-width":1,"circle-stroke-color":"#252525"}};wl(PK);wl(IK);const TK="#676767",DL={id:"ao",type:"line",source:"ao","source-layer":"public.service_ao",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":TK,"line-width":1.5,"line-opacity":.8}},OL={id:"rayon",type:"line",source:"rayon","source-layer":"public.service_rayon",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":TK,"line-width":.5,"line-opacity":.8}},ARe={id:"selected-region",type:"line",source:"selected-region",layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"#CC2222","line-width":4}},DRe=({id:e,categoryId:t,name:n})=>{const{isVisible:r}=Ks(),i=["==",["get","group_id"],e];return I(Tn,{children:I(ps,{...Hb(n+e),id:Cn.other+e,source:"other","source-layer":"public.service_otherobjects",layout:{...Hb(n+e).layout,visibility:r[Cn.other_category+t]?"visible":"none"},filter:i})})},ORe={ao:"district_id",rayon:"area_id"},_0=e=>w.exports.useMemo(()=>e?["==",["get",ORe[e.type]],e.id]:null,[e]),L2=["==",["get","status"],jn.cancelled],NRe=()=>{const{isVisible:e}=Ks(),{filters:{region:t}}=Cf(),n=_0(t),{mode:r}=Do(),i=tf(),o=()=>r===Gr.ON_APPROVAL&&n?["all",L2,n]:L2;return I(Tn,{children:I(ps,{...RRe,id:Cn.cancelled,source:"points","source-layer":i,layout:{visibility:e[Cn.cancelled]?"visible":"none"},filter:o()})})},NL=["==",["get","status"],jn.working],LRe=()=>{const{isVisible:e}=Ks(),t=tf(),{filters:{deltaTraffic:n,factTraffic:r,age:i,region:o},ranges:s}=$c(),a=_0(o),u=Dh(n,s,"deltaTraffic")?[[">=",["get","delta_current"],n[0]],["<=",["get","delta_current"],n[1]]]:[!0],d=Dh(r,s,"factTraffic")?[[">=",["get","fact"],r[0]],["<=",["get","fact"],r[1]]]:[!0],p=Dh(i,s,"age")?[[">=",["get","age_day"],i[0]],["<=",["get","age_day"],i[1]]]:[!0],m=a?["all",NL,...u,...d,...p,a]:["all",NL,...u,...d,...p];return I(Tn,{children:I(ps,{...jb,id:Cn.filteredWorking,source:"points","source-layer":t,layout:{...jb.layout,visibility:e[Cn.filteredWorking]?"visible":"none"},filter:m})})},LL=["==",["get","status"],jn.onApproval],FRe=()=>{const{isVisible:e}=Ks(),t=tf(),{filters:{region:n}}=Cf(),r=_0(n),i=r?["all",LL,r]:LL;return I(Tn,{children:I(ps,{...MRe,id:Cn.approve,source:"points","source-layer":t,layout:{visibility:e[Cn.approve]?"visible":"none"},filter:i})})},zRe=["==",["get","status"],jn.pending],$Re=()=>{const{filters:e,ranges:t}=va(),{prediction:n,categories:r,region:i}=e,{selection:o}=Pl(),s=[...o.included],a=[...o.excluded],u=_0(i),d=["in",["get","id"],["literal",s]],p=["in",["get","id"],["literal",a]],m=[[">=",["get","prediction_current"],n[0]],["<=",["get","prediction_current"],n[1]]],x=ms.map(O=>/d[0-9]/.test(O)&&e[`${O}__lt`]===4e3?[[">=",["get",O],e[`${O}__gt`]]]:[[">=",["get",O],e[`${O}__gt`]],["<=",["get",O],e[`${O}__lt`]]]).filter(O=>{const N=O[0][1][1];return Qh(e,t,N).result}).flat(),_=r.length>0?["in",["get","category"],["literal",r]]:!0,P=zRe,k=rI(e,t)?m:[!0],T=["all",P,["!",p],["any",u?["all",...k,...x,_,u]:["all",...k,...x,_],d]],M=["all",P,["!",d],["any",["!",u?["all",...k,_,u,...x,_]:["all",...k,_,...x]],p]];return{match:T,unmatch:M}},BRe=()=>{const{isVisible:e}=Ks(),t=tf(),{match:n,unmatch:r}=$Re();return $e(Tn,{children:[I(ps,{...Jm,id:Cn["initial-unmatch"],source:"points","source-layer":tf(),layout:{...Jm.layout,visibility:e[Cn.initial]?"visible":"none"},filter:r,paint:kRe.paint}),I(ps,{...Jm,id:Cn["initial-match"],source:"points","source-layer":t,layout:{...Jm.layout,visibility:e[Cn.initial]?"visible":"none"},filter:n,paint:Jm.paint})]})},F2=["==",["get","status"],jn.working],VRe=()=>{const{isVisible:e}=Ks(),t=tf(),{filters:{region:n}}=Cf(),r=_0(n),{mode:i}=Do(),o=()=>i===Gr.ON_APPROVAL&&r?["all",F2,r]:F2;return I(Tn,{children:I(ps,{...jb,id:Cn.working,source:"points","source-layer":t,layout:{...jb.layout,visibility:e[Cn.working]?"visible":"none"},filter:o()})})},URe=()=>{const{updateCounter:e,toggleUpdateCounter:t,updatePVZLayer:n}=bu(),r=tf();return w.exports.useEffect(()=>{t()},[r]),I(Tn,{children:$e(Od,{id:"points",type:"vector",tiles:[`https://postamates.spatialsystems.ru/martin/${r}/{z}/{x}/{y}.pbf`],children:[I(BRe,{}),I(FRe,{}),I(NRe,{}),I(VRe,{}),I(LRe,{})]},`points-${e}-${n}`)})},jRe=({id:e,categoryId:t,name:n})=>{const{isVisible:r}=Ks(),i=["==",["get","group_id"],e];return I(Tn,{children:I(ps,{...Hb(n+e),id:Cn.pvz+e,source:"pvz","source-layer":"public.service_post_and_pvz",layout:{...Hb(n+e).layout,visibility:r[Cn.pvz_category+t]?"visible":"none"},filter:i})})},z2=({data:e})=>I(Od,{id:"selected-region",type:"geojson",data:e,children:I(ps,{...ARe})}),HRe=()=>{const{filters:{region:e}}=va(),{filters:{region:t}}=Cf(),{filters:{region:n}}=$c(),{mode:r}=Do(),i=r===Gr.PENDING&&(e==null?void 0:e.geometry),o=r===Gr.ON_APPROVAL&&(t==null?void 0:t.geometry),s=r===Gr.WORKING&&(n==null?void 0:n.geometry);return $e(Tn,{children:[i&&I(z2,{data:e.geometry}),o&&I(z2,{data:t.geometry}),s&&I(z2,{data:n.geometry})]})},KRe=({postGroups:e,otherGroups:t})=>{const{updateCounter:n,updatePVZLayer:r}=bu();return $e(Tn,{children:[I(Od,{id:"ao",type:"vector",tiles:["https://postamates.spatialsystems.ru/martin/public.service_ao/{z}/{x}/{y}.pbf"],children:I(ps,{...DL,layout:{...DL.layout}})}),I(Od,{id:"rayon",type:"vector",tiles:["https://postamates.spatialsystems.ru/martin/public.service_rayon/{z}/{x}/{y}.pbf"],children:I(ps,{...OL,layout:{...OL.layout}})}),I(HRe,{}),I(URe,{}),I(Od,{id:"pvz",type:"vector",tiles:["https://postamates.spatialsystems.ru/martin/public.service_post_and_pvz/{z}/{x}/{y}.pbf"],children:e==null?void 0:e.map(i=>i.groups.map(o=>I(jRe,{id:o.id,categoryId:o.category,name:YS(o.name)})))},`pvz-${n}-${r}`),I(Od,{id:"other",type:"vector",tiles:["https://postamates.spatialsystems.ru/martin/public.service_otherobjects/{z}/{x}/{y}.pbf"],children:t&&t.map(i=>i.groups.map(o=>I(DRe,{id:o.id,categoryId:o.category,name:YS(o.name)})))},`other-${n}-${r}`)]})},WRe=({postGroups:e,otherGroups:t})=>{const{toggleVisibility:n,isVisible:r}=Ks(),{mode:i}=Do();return $e("div",{className:"space-y-1 flex flex-col",children:[i===Gr.PENDING&&$e(Tn,{children:[I($d,{className:"!ml-0",onChange:()=>n(Cn.working),checked:r[Cn.working],children:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I($d,{className:"!ml-0",onChange:()=>n(Cn.cancelled),checked:r[Cn.cancelled],children:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438"})]}),e==null?void 0:e.map(o=>I($d,{className:"!ml-0",onChange:()=>n(Cn.pvz_category+o.id),checked:r[Cn.pvz_category+o.id],children:o.name},o.id)),t&&t.map(o=>I($d,{className:"!ml-0",onChange:()=>n(Cn.other_category+o.id),checked:r[Cn.other_category+o.id],children:o.name},o.id))]})},GRe=({postGroups:e,otherGroups:t})=>I(bf,{content:I(WRe,{postGroups:e,otherGroups:t}),trigger:"click",placement:"leftBottom",children:I($i,{title:"\u0421\u043B\u043E\u0438",children:I($n,{className:"absolute bottom-[20px] right-[20px] flex items-center justify-center p-3",children:I(cPe,{className:"w-4 h-4"})})})}),Yu=({color:e,imageSrc:t,name:n,hideImage:r,border:i})=>$e("div",{className:"flex gap-2 items-center",children:[t&&I(nfe,{src:t,width:18,height:18,className:"flex items-center",preview:!1}),e&&!t&&I("span",{className:"w-4 h-[100%] flex items-center justify-center",children:I("span",{className:`rounded-xl w-3 h-3 inline-block ${i&&"border-black border-[1px] border-solid"}`,style:{backgroundColor:e}})}),!t&&!e&&!r&&I(vRe,{width:18,height:18}),I("span",{className:"text-xs text-grey",children:n})]}),qRe=EK.stops.map(([e,t])=>t),ZRe=({colors:e,name:t})=>$e("div",{className:"mb-3",children:[I("span",{className:"mb-1 mt-3 text-center",children:t}),I("div",{className:"w-[200px]",children:I("div",{className:"w-full h-[10px] rounded-xl",style:{background:`linear-gradient(to right, ${e.join(",")})`}})}),I("span",{className:"italic",children:"\u043F\u0440\u043E\u0433\u043D\u043E\u0437 \u0442\u0440\u0430\u0444\u0438\u043A\u0430 \u2192"})]}),FL=({item:e,color:t})=>{var n;return I(ll,{bordered:!1,expandIcon:null,style:{background:"none"},className:"legend_group",children:I(ll.Panel,{header:I(Yu,{name:e.name,hideImage:!0}),children:I("div",{className:"ml-3 my-1",children:e.groups&&((n=e.groups)==null?void 0:n.map(r=>I("div",{className:"my-1",children:I(Yu,{color:t,imageSrc:r.image,name:r.name})},r.id)))})},"opened")})};function XRe({postGroups:e,otherGroups:t}){const{mode:n}=Do();return $e("div",{className:"absolute bottom-[20px] left-[20px] text-xs text-grey z-10 bg-white-background rounded-xl p-3 space-y-3",children:[I("div",{children:$e("div",{className:"space-y-1",children:[n===Gr.PENDING&&$e(Tn,{children:[I(ZRe,{colors:qRe,name:"\u041B\u043E\u043A\u0430\u0446\u0438\u0438 \u043A \u0440\u0430\u0441\u0441\u043C\u043E\u0442\u0440\u0435\u043D\u0438\u044E"}),I(Yu,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I(Yu,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",color:Ub,border:!0})]}),n===Gr.ON_APPROVAL&&$e(Tn,{children:[I(Yu,{name:"\u0421\u043E\u0433\u043B\u0430\u0441\u043E\u0432\u0430\u043D\u0438\u0435-\u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043A\u0430",color:NE,border:!0}),I(Yu,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"}),I(Yu,{name:"\u041E\u0442\u043C\u0435\u043D\u0435\u043D\u043D\u044B\u0435 \u043B\u043E\u043A\u0430\u0446\u0438\u0438",color:Ub,border:!0})]}),n===Gr.WORKING&&I(Tn,{children:I(Yu,{name:"\u0420\u0430\u0431\u043E\u0442\u0430\u044E\u0449\u0438\u0435 \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u044B"})})]})}),I("div",{className:"space-y-1",children:e==null?void 0:e.map(r=>I(FL,{item:r,color:PK},r.id))}),I("div",{className:"space-y-1",children:t==null?void 0:t.map(r=>I(FL,{item:r,color:IK},r.id))})]})}const YRe=({lat:e,lng:t,onClose:n,children:r})=>I(xQ,{longitude:t,latitude:e,onClose:n,closeOnClick:!1,style:{minWidth:"330px"},children:r}),QRe=e=>{var p,m,v,x,_;const{data:t}=oI(),{data:n}=n$(),r=w.exports.useMemo(()=>sv(t),[t]),i=w.exports.useMemo(()=>sv(n),[n]),o=w.exports.useMemo(()=>r?r.map(P=>[...P.groups]).flat():[],[r]),s=w.exports.useMemo(()=>i?i.map(P=>[...P.groups]).flat():[],[i]),a=(p=e.layer)==null?void 0:p.id.includes(Cn.other),u=a?(m=i.find(P=>P.id===e.properties.category_id))==null?void 0:m.name:(v=r.find(P=>P.id===e.properties.category_id))==null?void 0:v.name,d=a?(x=s.find(P=>P.id===e.properties.group_id))==null?void 0:x.name:(_=o.find(P=>P.id===e.properties.group_id))==null?void 0:_.name;return{name:u,groupName:d}},Mv=({feature:e,dynamicStatus:t,postamatId:n,point:r})=>{var v,x;const{data:i}=cw(),o=e.properties.category===nI.residential,s=e.properties.status===jn.working,{name:a,groupName:u}=QRe(e),d=((v=e.layer)==null?void 0:v.id.includes(Cn.pvz))||((x=e.layer)==null?void 0:x.id.includes(Cn.other)),p=()=>{if(d)return oPe;const _=s?[...CE,...iPe]:CE;return o?[..._,...TH]:_},m=({field:_,render:P,empty:k,type:T,fallbackField:M})=>{let O=r?r[_]:e.properties[_];return _==="prediction_current"&&(O=I(_K,{point:r})),_==="category_id"&&(O=a),_==="group_id"&&(O=u),_==="status"&&t&&(O=t),_==="postamat_id"&&n&&(O=n),T==="region"?(O=O||(r||e)[M],O=P(O,i==null?void 0:i.normalized)):(O=P?P(O):O,O=QS(O)&&k?k:O),O};return I("div",{children:p().map(_=>$e(sc,{className:da("p-1"),children:[I(Io,{className:"font-semibold",span:12,children:_.name}),I(Io,{span:12,children:m(_)})]},_.field))})},JRe=({feature:e,point:t})=>{const{include:n,selection:r,exclude:i}=Pl(),{setClickedPointConfig:o}=Su(),{filters:s,ranges:a}=va(),u=e.properties.id,d=Jz(s,a,e)&&!r.excluded.has(u)||r.included.has(u);return w.exports.useEffect(()=>o(u,d),[u,d]),$e(Tn,{children:[I(Mv,{feature:e,point:t}),I($n,{type:"primary",className:"mt-2 mx-auto",block:!0,onClick:()=>{d?i(u):n(u)},children:d?"\u0418\u0441\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u0438\u0437 \u0432\u044B\u0431\u043E\u0440\u043A\u0438":"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0432\u044B\u0431\u043E\u0440\u043A\u0443"})]})},eAe=({feature:e,point:t})=>{const n=e.properties.id,{setClickedPointConfig:r}=Su(),{status:i,postamat_id:o}=t,[s,a]=w.exports.useState(i),[u,d]=w.exports.useState(o);w.exports.useEffect(()=>{a(i),d(o)},[i,o]);const[p,m]=w.exports.useState(s===jn.working&&QS(u)),[v,x]=w.exports.useState("");w.exports.useEffect(()=>r(n),[n]);const _=ff(),P=()=>{_.invalidateQueries(["on-approval-points"]),_.invalidateQueries(["clicked-point",n])},{mutateAsync:k,isLoading:T}=hw({}),{mutateAsync:M,isLoading:O}=t$(),N=T||O,L=async()=>{const V=new URLSearchParams({id:n,postamat_id:u}),B=new URLSearchParams({status:jn.working,"location_ids[]":[n]});try{await M(V)}catch{x("\u0423\u043A\u0430\u0437\u0430\u043D\u043D\u044B\u0439 id \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0434\u0440\u0443\u0433\u043E\u0439");return}await k(B),P(),m(!1)};return $e(Tn,{children:[I(Mv,{feature:e,point:t,dynamicStatus:s,postamatId:u}),I("div",{className:"flex justify-center mt-4",children:$e("div",{className:"flex flex-col items-center space-y-2",children:[I(xl,{text:"\u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"}),I(CK,{isLoading:N,disabled:N,value:s,onChange:V=>{if(a(V),V===jn.working)m(!0);else{m(!1);const B=new URLSearchParams({status:V,"location_ids[]":[n]});k(B).then(P)}}}),p&&$e(Tn,{children:[I(xl,{text:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 id \u043F\u043E\u0441\u0442\u0430\u043C\u0430\u0442\u0430"}),I(iV,{className:"w-full",min:0,precision:0,value:u,onChange:V=>d(V)}),v&&I("div",{className:"text-primary text-center",children:v}),I($n,{type:"primary",disabled:QS(u),onClick:L,loading:N,children:"\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u0442\u0430\u0442\u0443\u0441"})]})]})})]})},tAe=({feature:e,point:t})=>{const n=e.properties.id,{setClickedPointConfig:r}=Su();return w.exports.useEffect(()=>r(n),[e]),I(Mv,{feature:e,point:t})},nAe=({width:e=24,height:t=24})=>I("svg",{xmlns:"http://www.w3.org/2000/svg",className:"rounded-md bg-[#cc2222] hover:bg-[#d94c48] p-1",width:e,height:t,viewBox:"0 0 24 24",children:I("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm4.21 14.16c3.53-.61 6.79-1.174 6.79-4.146V7a3 3 0 0 0-2.999-3H15.5l.008.143-.01-.001a3.487 3.487 0 0 1-.914 2.22l.549.182A2 2 0 0 1 16.5 8.441v5.492l.423.073c2.13.37 4.077.708 4.077 2.008 0 1.327-1.993 1.655-4.328 2.04l-.853.143a1 1 0 1 0 .341 1.971l.05-.009zM1 16V7a3 3 0 0 1 3-3h4.5l-.008.143.01-.001c.012.286.058.564.134.828-.66.318-1.136.99-1.136 1.805v7.157l-.488.084C4.907 14.376 3 14.702 3 16c0 1.355 2.146 1.701 4.533 2.087l.775.126.13-1.524a.217.217 0 0 1 .027-.084.196.196 0 0 1 .275-.077l4.66 3.019a.214.214 0 0 1-.022.375L8.28 21.983a.194.194 0 0 1-.099.016.208.208 0 0 1-.18-.23l.134-1.554C4.439 19.635 1 19 1 16zm9.316-9.561A1 1 0 0 0 9 7.387v2.406a.5.5 0 0 0 .146.353l.708.708a.5.5 0 0 1 .146.353v3.984a.5.5 0 0 0 .276.447l.924.462.665-2.992c.024-.11.186-.101.197.012l.36 3.59 1.144.573a.3.3 0 0 0 .434-.268v-4.206a.5.5 0 0 1 .276-.447l.448-.224a.5.5 0 0 0 .276-.447v-2.61a1.5 1.5 0 0 0-1.026-1.423l-3.658-1.22z",fill:"#ffffff"})}),rAe=({feature:e,point:t})=>{var s,a;const{mode:n}=Do(),r=((s=e.layer)==null?void 0:s.id.includes(Cn.pvz))||((a=e.layer)==null?void 0:a.id.includes(Cn.other)),i=e.properties.status===jn.pending,o=e.properties.status===jn.working;return r?I(Mv,{feature:e,point:t}):n===Gr.ON_APPROVAL&&!i?I(eAe,{feature:e,point:t}):n===Gr.WORKING&&o?I(tAe,{feature:e,point:t}):n===Gr.PENDING&&i?I(JRe,{feature:e,point:t}):I(Mv,{feature:e,point:t})},iAe=({features:e,points:t})=>{const{setPopup:n}=Sf(),{selection:r,include:i,exclude:o}=Pl(),{filters:s,ranges:a}=va();return I("div",{className:"space-y-2 p-1",children:e.map(u=>{var x;const d=u.properties.id,p=t.find(_=>_.id===d),m=Jz(s,a,u)&&!r.excluded.has(d)||r.included.has(d),v=()=>{m?o(d):i(d)};return $e("div",{className:"flex flex-row items-center gap-2 w-full",children:[u.properties.status===jn.pending&&I($d,{checked:m,onClick:v}),I($n,{className:"text-start flex-1 !w-0",block:!0,onClick:()=>{n({features:[u],coordinates:u.geometry.coordinates})},children:u.properties.category===nI.residential||u.layer.id===Cn.working?$e("div",{className:"space-x-2 flex items-center w-full",children:[I("span",{className:"flex-1 truncate inline-block",children:p==null?void 0:p.address}),I("span",{children:p==null?void 0:p.name})]}):I("div",{className:"flex w-full",children:$e("span",{className:"truncate",children:[(x=p==null?void 0:p.name)!=null?x:p==null?void 0:p.category,(p==null?void 0:p.category_id)&&getRivalsName(u).name]})})},u.properties.id)]})})})},oAe=({lat:e,lng:t})=>{const n=`https://yandex.ru/maps/?panorama[point]=${t},${e}`;return I("div",{className:"pl-1 flex",children:I($i,{title:"\u041F\u0435\u0440\u0435\u0439\u0442\u0438 \u043D\u0430 \u042F\u043D\u0434\u0435\u043A\u0441.\u041F\u0430\u043D\u043E\u0440\u0430\u043C\u044B",children:I("a",{target:"_blank",href:n,children:I(nAe,{})})})})},aAe=({features:e,lat:t,lng:n,onClose:r})=>{const{data:i,isLoading:o}=rte(e);return $e(YRe,{lat:t,lng:n,onClose:r,children:[I(oAe,{lat:t,lng:n}),o?I(vs,{}):(()=>e.length===1?I(rAe,{feature:e[0],point:i[0]}):I(iAe,{features:e,points:i}))()]})},sAe=({width:e=24,height:t=24})=>$e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:e,height:t,children:[I("polygon",{points:"23.7,4.1 23.7,6.1 0.1,6.2 0.1,4.1 "}),$e("g",{children:[I("circle",{cx:"6.3",cy:"5.2",r:"3.1"}),I("circle",{fill:"#fff",cx:"6.3",cy:"5.2",r:"1.4"})]}),I("polygon",{points:"23.6,11.1 23.7,13.1 0,13.1 0,11 "}),$e("g",{children:[I("circle",{cx:"18.6",cy:"12.1",r:"3.1"}),I("circle",{fill:"#fff",cx:"18.6",cy:"12.1",r:"1.4"})]}),I("polygon",{points:"23.8,18.2 23.9,20.1 0.2,20.2 0.2,18.2 "}),$e("g",{children:[I("circle",{cx:"10.2",cy:"19.1",r:"3.1"}),I("circle",{fill:"#fff",cx:"10.2",cy:"19.1",r:"1.4"})]})]}),lAe=({toggleCollapse:e})=>I($n,{icon:I(sAe,{width:16,height:16}),onClick:e,className:"border-l-0 rounded-bl-none rounded-tl-none absolute top-[100px] flex items-center justify-center"}),uAe=()=>{const e=w.exports.useRef(null),t=w.exports.useRef(null),n=w.exports.useRef(null),{popup:r,setPopup:i}=Sf(),{setClickedPointConfig:o}=Su(),{setLayersVisibility:s}=Ks(),{mode:a}=Do(),{tableState:u,openTable:d}=s0(),{toggleUpdatePVZLayer:p}=bu(),{data:m}=oI(),{data:v}=n$(),x=w.exports.useMemo(()=>sv(m),[m]),_=w.exports.useMemo(()=>sv(v),[v]),P=w.exports.useMemo(()=>{const V=[];return[..._,...x].map(B=>{B.groups.map(H=>{V.push({name:YS(H.name+H.id),url:H.image})})}),[...V,...qA]},[qA,x,_]);w.exports.useEffect(()=>{P.map(V=>{var H,G;const B=new Image(((H=V.size)==null?void 0:H.width)||64,((G=V.size)==null?void 0:G.height)||64);B.src=V.url,B.crossOrigin="Anonymous",B.onload=()=>{e.current.addImage(V.name,B),p()},B.src=V.url,B.crossOrigin="Anonymous"})},[P]);const k=w.exports.useMemo(()=>{const V=[];return x.map(B=>{J1[`category${B.id}`]={name:Yz[B.name]},B.groups.map(H=>{ms.includes(`d${H.id}`)||ms.push(`d${H.id}`),J1[`category${B.id}`][`d${H.id}`]=H.name,V.push(Cn.pvz+H.id)})}),_.map(B=>{B.groups.map(H=>{V.push(Cn.other+H.id)})}),V},[x,_]);w.exports.useEffect(()=>{s(gee[a]),i(null),o(null)},[a]);const T=V=>{if(!V.features){i(null),o(null);return}const B=V.features[0];if(!B){i(null),o(null);return}const{lng:H}=V.lngLat;if(B.geometry.type==="Point"){const G=B.geometry.coordinates.slice();for(;Math.abs(H-G[0])>180;)G[0]+=H>G[0]?360:-360;i({features:V.features,coordinates:G})}},M=V=>{!V.features[0]||(e.current.getCanvas().style.cursor="pointer")},O=V=>{!V.features[0]||(e.current.getCanvas().style.cursor="")};w.exports.useEffect(()=>{const V=new ResizeObserver(YY(()=>{var B;(B=e==null?void 0:e.current)==null||B.resize()},16));return t.current&&V.observe(t.current),()=>{V.disconnect()}},[t.current]),w.exports.useEffect(()=>{u.fullScreen&&!u.isOpened&&d()},[u.fullScreen]);const[N,L]=w.exports.useState(!1),F=()=>L(V=>!V);return I(nQ,{children:$e("div",{className:"w-screen h-screen relative flex overflow-hidden",children:[I(CRe,{}),I(C4e,{isCollapsed:N,ref:n}),$e("div",{className:"flex-1 h-screen flex flex-col ",children:[I("div",{ref:t,className:da(u.fullScreen?"":"flex-1"),children:$e(GP,{mapLib:QY,initialViewState:{latitude:55.7558,longitude:37.6173,zoom:12},dragRotate:!1,ref:e,interactiveLayerIds:[Cn["initial-match"],Cn["initial-unmatch"],Cn.approve,Cn.working,Cn.filteredWorking,Cn.cancelled,...k],onClick:T,onMouseEnter:M,onMouseLeave:O,id:"map",children:[r&&I(aAe,{lat:r.coordinates[1],lng:r.coordinates[0],features:r.features,onClose:()=>{i(null),o(null)}}),I(lAe,{toggleCollapse:F}),I(gRe,{}),I(KRe,{postGroups:x,otherGroups:_}),I(XRe,{postGroups:x,otherGroups:_}),I(ERe,{}),I(pRe,{}),I(GRe,{postGroups:x,otherGroups:_})]})}),I("div",{className:"w-full border-solid border-border border-0 border-t-[1px] z-20",children:I(hRe,{fullWidth:N})})]})]})})};function cAe(){return I(uAe,{})}const dAe=new YZ;LX();const $2="0.0.9";function fAe(){const[e,t]=iv("version_control",$2);return e!==$2&&(localStorage.clear(),t($2)),I(gX,{client:dAe,children:I(DY,{basename:"/",children:I(AY,{children:I(yz,{path:"/",element:I(cAe,{})})})})})}B2.createRoot(document.getElementById("root")).render(I(Un.StrictMode,{children:I(fAe,{})}));